From 7965b477895b3d07d7b5ffe953a2539b636bc425 Mon Sep 17 00:00:00 2001 From: pkieltyka Date: Wed, 6 Nov 2024 03:08:41 +0000 Subject: [PATCH] Build: (dc06766) Merge pull request #12 from 0xsequence/update-vite-base update vite base and gh-pages action --- .nojekyll | 0 CNAME | 2 +- .../{index-DbcaNW7X.js => index-BQVitpju.js} | 2 +- .../{index-BSEof6bf.js => index-SPESv6LF.js} | 4 +- .../{index-B10cr2A7.js => index-zdST_U5z.js} | 126 +++++++++--------- index.html | 2 +- 6 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 .nojekyll rename assets/{index-DbcaNW7X.js => index-BQVitpju.js} (99%) rename assets/{index-BSEof6bf.js => index-SPESv6LF.js} (98%) rename assets/{index-B10cr2A7.js => index-zdST_U5z.js} (54%) diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME index e98cfaa..3748a37 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -recovery.sequence.app \ No newline at end of file +recovery.sequence.app diff --git a/assets/index-DbcaNW7X.js b/assets/index-BQVitpju.js similarity index 99% rename from assets/index-DbcaNW7X.js rename to assets/index-BQVitpju.js index c4f629e..6c792e2 100644 --- a/assets/index-DbcaNW7X.js +++ b/assets/index-BQVitpju.js @@ -1,4 +1,4 @@ -import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-BSEof6bf.js";import"./index-B10cr2A7.js";/** +import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-SPESv6LF.js";import"./index-zdST_U5z.js";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/assets/index-BSEof6bf.js b/assets/index-SPESv6LF.js similarity index 98% rename from assets/index-BSEof6bf.js rename to assets/index-SPESv6LF.js index 04cde0d..9defd1c 100644 --- a/assets/index-BSEof6bf.js +++ b/assets/index-SPESv6LF.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DbcaNW7X.js","assets/index-B10cr2A7.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); -import{_ as pe}from"./index-B10cr2A7.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-DbcaNW7X.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BQVitpju.js","assets/index-zdST_U5z.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); +import{_ as pe}from"./index-zdST_U5z.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(w,!0),l.set(o,[g,w]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(w,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(w,j,A)}),Object.preventExtensions(w)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,w=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],w(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const k=r[3](A(U));y.set(U,[r,k])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),k=Reflect.get(i,a,h);if(U&&(e(k,r)||d.has(r)&&e(k,d.get(r))))return!0;Z(a),F(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,w(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,w(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),w(["set",[a],r,k]),!0}});d.set(o,R);const fe=[q,O,c,ue];return C.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,C,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},be=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:be,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Le=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=b.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const N=P({themeMode:Ue()?"dark":"light"}),ce={state:N,subscribe(e){return D(N,()=>e(N))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(N.themeMode=t),s&&(N.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-BQVitpju.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,Ne as E,J as M,b as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; diff --git a/assets/index-B10cr2A7.js b/assets/index-zdST_U5z.js similarity index 54% rename from assets/index-B10cr2A7.js rename to assets/index-zdST_U5z.js index 98ef163..9eb02b4 100644 --- a/assets/index-B10cr2A7.js +++ b/assets/index-zdST_U5z.js @@ -1,4 +1,4 @@ -var tce=Object.defineProperty;var jO=t=>{throw TypeError(t)};var rce=(t,e,r)=>e in t?tce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var de=(t,e,r)=>rce(t,typeof e!="symbol"?e+"":e,r),YC=(t,e,r)=>e.has(t)||jO("Cannot "+r);var Q=(t,e,r)=>(YC(t,e,"read from private field"),r?r.call(t):e.get(t)),Ie=(t,e,r)=>e.has(t)?jO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ue=(t,e,r,n)=>(YC(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),qe=(t,e,r)=>(YC(t,e,"access private method"),r);var dm=(t,e,r,n)=>({set _(i){ue(t,e,i,r)},get _(){return Q(t,e,n)}});function nce(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function V$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var z$={exports:{}},C4={},H$={exports:{}},Ar={};/** +var tce=Object.defineProperty;var BO=t=>{throw TypeError(t)};var rce=(t,e,r)=>e in t?tce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var de=(t,e,r)=>rce(t,typeof e!="symbol"?e+"":e,r),GC=(t,e,r)=>e.has(t)||BO("Cannot "+r);var Q=(t,e,r)=>(GC(t,e,"read from private field"),r?r.call(t):e.get(t)),Ie=(t,e,r)=>e.has(t)?BO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ue=(t,e,r,n)=>(GC(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),$e=(t,e,r)=>(GC(t,e,"access private method"),r);var um=(t,e,r,n)=>({set _(i){ue(t,e,i,r)},get _(){return Q(t,e,n)}});function nce(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function U$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var $$={exports:{}},m4={},q$={exports:{}},_r={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var tce=Object.defineProperty;var jO=t=>{throw TypeError(t)};var rce=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Jw=Symbol.for("react.element"),ice=Symbol.for("react.portal"),sce=Symbol.for("react.fragment"),oce=Symbol.for("react.strict_mode"),ace=Symbol.for("react.profiler"),cce=Symbol.for("react.provider"),lce=Symbol.for("react.context"),fce=Symbol.for("react.forward_ref"),uce=Symbol.for("react.suspense"),dce=Symbol.for("react.memo"),hce=Symbol.for("react.lazy"),UO=Symbol.iterator;function pce(t){return t===null||typeof t!="object"?null:(t=UO&&t[UO]||t["@@iterator"],typeof t=="function"?t:null)}var G$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W$=Object.assign,K$={};function fy(t,e,r){this.props=t,this.context=e,this.refs=K$,this.updater=r||G$}fy.prototype.isReactComponent={};fy.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};fy.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Y$(){}Y$.prototype=fy.prototype;function PI(t,e,r){this.props=t,this.context=e,this.refs=K$,this.updater=r||G$}var kI=PI.prototype=new Y$;kI.constructor=PI;W$(kI,fy.prototype);kI.isPureReactComponent=!0;var $O=Array.isArray,Q$=Object.prototype.hasOwnProperty,MI={current:null},J$={key:!0,ref:!0,__self:!0,__source:!0};function Z$(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Q$.call(e,n)&&!J$.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1{throw TypeError(t)};var rce=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bce=D,wce=Symbol.for("react.element"),xce=Symbol.for("react.fragment"),Ece=Object.prototype.hasOwnProperty,Cce=bce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ace={key:!0,ref:!0,__self:!0,__source:!0};function tq(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)Ece.call(e,n)&&!Ace.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:wce,type:t,key:s,ref:o,props:i,_owner:Cce.current}}C4.Fragment=xce;C4.jsx=tq;C4.jsxs=tq;z$.exports=C4;var W=z$.exports,rq={exports:{}},ga={},nq={exports:{}},iq={};/** + */var bce=D,wce=Symbol.for("react.element"),xce=Symbol.for("react.fragment"),Ece=Object.prototype.hasOwnProperty,Cce=bce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ace={key:!0,ref:!0,__self:!0,__source:!0};function Z$(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)Ece.call(e,n)&&!Ace.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:wce,type:t,key:s,ref:o,props:i,_owner:Cce.current}}m4.Fragment=xce;m4.jsx=Z$;m4.jsxs=Z$;$$.exports=m4;var W=$$.exports,X$={exports:{}},da={},eq={exports:{}},tq={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var tce=Object.defineProperty;var jO=t=>{throw TypeError(t)};var rce=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(E,x){var w=E.length;E.push(x);e:for(;0>>1,k=E[T];if(0>>1;Ti(j,w))Xi(G,j)?(E[T]=G,E[X]=w,T=X):(E[T]=j,E[oe]=w,T=oe);else if(Xi(G,w))E[T]=G,E[X]=w,T=X;else break e}}return x}function i(E,x){var w=E.sortIndex-x.sortIndex;return w!==0?w:E.id-x.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],f=1,u=null,p=3,g=!1,y=!1,b=!1,I=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(E){for(var x=r(l);x!==null;){if(x.callback===null)n(l);else if(x.startTime<=E)n(l),x.sortIndex=x.expirationTime,e(c,x);else break;x=r(l)}}function L(E){if(b=!1,O(E),!y)if(r(c)!==null)y=!0,R(F);else{var x=r(l);x!==null&&B(L,x.startTime-E)}}function F(E,x){y=!1,b&&(b=!1,C($),$=-1),g=!0;var w=p;try{for(O(x),u=r(c);u!==null&&(!(u.expirationTime>x)||E&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var k=T(u.expirationTime<=x);x=t.unstable_now(),typeof k=="function"?u.callback=k:u===r(c)&&n(c),O(x)}else n(c);u=r(c)}if(u!==null)var H=!0;else{var oe=r(l);oe!==null&&B(L,oe.startTime-x),H=!1}return H}finally{u=null,p=w,g=!1}}var z=!1,_=null,$=-1,ie=5,ce=-1;function K(){return!(t.unstable_now()-ceE||125T?(E.sortIndex=w,e(l,E),r(c)===null&&E===r(l)&&(b?(C($),$=-1):b=!0,B(L,w-T))):(E.sortIndex=k,e(c,E),y||g||(y=!0,R(F))),E},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(E){var x=p;return function(){var w=p;p=x;try{return E.apply(this,arguments)}finally{p=w}}}})(iq);nq.exports=iq;var Sce=nq.exports;/** + */(function(t){function e(E,x){var w=E.length;E.push(x);e:for(;0>>1,k=E[T];if(0>>1;Ti(j,w))Xi(G,j)?(E[T]=G,E[X]=w,T=X):(E[T]=j,E[oe]=w,T=oe);else if(Xi(G,w))E[T]=G,E[X]=w,T=X;else break e}}return x}function i(E,x){var w=E.sortIndex-x.sortIndex;return w!==0?w:E.id-x.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],f=1,u=null,p=3,g=!1,y=!1,b=!1,I=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(E){for(var x=r(l);x!==null;){if(x.callback===null)n(l);else if(x.startTime<=E)n(l),x.sortIndex=x.expirationTime,e(c,x);else break;x=r(l)}}function L(E){if(b=!1,O(E),!y)if(r(c)!==null)y=!0,R(F);else{var x=r(l);x!==null&&B(L,x.startTime-E)}}function F(E,x){y=!1,b&&(b=!1,C($),$=-1),g=!0;var w=p;try{for(O(x),u=r(c);u!==null&&(!(u.expirationTime>x)||E&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var k=T(u.expirationTime<=x);x=t.unstable_now(),typeof k=="function"?u.callback=k:u===r(c)&&n(c),O(x)}else n(c);u=r(c)}if(u!==null)var H=!0;else{var oe=r(l);oe!==null&&B(L,oe.startTime-x),H=!1}return H}finally{u=null,p=w,g=!1}}var z=!1,_=null,$=-1,ie=5,ce=-1;function K(){return!(t.unstable_now()-ceE||125T?(E.sortIndex=w,e(l,E),r(c)===null&&E===r(l)&&(b?(C($),$=-1):b=!0,B(L,w-T))):(E.sortIndex=k,e(c,E),y||g||(y=!0,R(F))),E},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(E){var x=p;return function(){var w=p;p=x;try{return E.apply(this,arguments)}finally{p=w}}}})(tq);eq.exports=tq;var Sce=eq.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var tce=Object.defineProperty;var jO=t=>{throw TypeError(t)};var rce=(t,e,r)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _ce=D,ha=Sce;function Xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fS=Object.prototype.hasOwnProperty,Ice=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,VO={},zO={};function Tce(t){return fS.call(zO,t)?!0:fS.call(VO,t)?!1:Ice.test(t)?zO[t]=!0:(VO[t]=!0,!1)}function Pce(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kce(t,e,r,n){if(e===null||typeof e>"u"||Pce(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ro(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var os={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){os[t]=new ro(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];os[e]=new ro(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){os[t]=new ro(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){os[t]=new ro(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){os[t]=new ro(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){os[t]=new ro(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){os[t]=new ro(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){os[t]=new ro(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){os[t]=new ro(t,5,!1,t.toLowerCase(),null,!1,!1)});var OI=/[\-:]([a-z])/g;function DI(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(OI,DI);os[e]=new ro(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(OI,DI);os[e]=new ro(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(OI,DI);os[e]=new ro(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){os[t]=new ro(t,1,!1,t.toLowerCase(),null,!1,!1)});os.xlinkHref=new ro("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){os[t]=new ro(t,1,!1,t.toLowerCase(),null,!0,!0)});function NI(t,e,r,n){var i=os.hasOwnProperty(e)?os[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),aS=Object.prototype.hasOwnProperty,Ice=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,UO={},$O={};function Tce(t){return aS.call($O,t)?!0:aS.call(UO,t)?!1:Ice.test(t)?$O[t]=!0:(UO[t]=!0,!1)}function Pce(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kce(t,e,r,n){if(e===null||typeof e>"u"||Pce(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function so(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ss={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ss[t]=new so(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ss[e]=new so(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ss[t]=new so(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ss[t]=new so(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ss[t]=new so(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ss[t]=new so(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ss[t]=new so(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ss[t]=new so(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ss[t]=new so(t,5,!1,t.toLowerCase(),null,!1,!1)});var kI=/[\-:]([a-z])/g;function MI(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(kI,MI);ss[e]=new so(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(kI,MI);ss[e]=new so(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(kI,MI);ss[e]=new so(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ss[t]=new so(t,1,!1,t.toLowerCase(),null,!1,!1)});ss.xlinkHref=new so("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ss[t]=new so(t,1,!1,t.toLowerCase(),null,!0,!0)});function RI(t,e,r,n){var i=ss.hasOwnProperty(e)?ss[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` -`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{ZC=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?$m(t):""}function Mce(t){switch(t.tag){case 5:return $m(t.type);case 16:return $m("Lazy");case 13:return $m("Suspense");case 19:return $m("SuspenseList");case 0:case 2:case 15:return t=XC(t.type,!1),t;case 11:return t=XC(t.type.render,!1),t;case 1:return t=XC(t.type,!0),t;default:return""}}function pS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Q1:return"Fragment";case Y1:return"Portal";case uS:return"Profiler";case BI:return"StrictMode";case dS:return"Suspense";case hS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case aq:return(t.displayName||"Context")+".Consumer";case oq:return(t._context.displayName||"Context")+".Provider";case LI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case FI:return e=t.displayName||null,e!==null?e:pS(t.type)||"Memo";case ad:e=t._payload,t=t._init;try{return pS(t(e))}catch{}}return null}function Rce(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pS(e);case 8:return e===BI?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function rh(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function lq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Oce(t){var e=lq(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function L2(t){t._valueTracker||(t._valueTracker=Oce(t))}function fq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=lq(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function $3(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function vS(t,e){var r=e.checked;return Ln({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function GO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=rh(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function uq(t,e){e=e.checked,e!=null&&NI(t,"checked",e,!1)}function gS(t,e){uq(t,e);var r=rh(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yS(t,e.type,r):e.hasOwnProperty("defaultValue")&&yS(t,e.type,rh(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function WO(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function yS(t,e,r){(e!=="number"||$3(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var qm=Array.isArray;function wv(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=F2.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $b(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var ub={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dce=["Webkit","ms","Moz","O"];Object.keys(ub).forEach(function(t){Dce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ub[e]=ub[t]})});function vq(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||ub.hasOwnProperty(t)&&ub[t]?(""+e).trim():e+"px"}function gq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=vq(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Nce=Ln({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wS(t,e){if(e){if(Nce[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xe(62))}}function xS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ES=null;function jI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var CS=null,xv=null,Ev=null;function QO(t){if(t=ex(t)){if(typeof CS!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=T4(e),CS(t.stateNode,t.type,e))}}function yq(t){xv?Ev?Ev.push(t):Ev=[t]:xv=t}function mq(){if(xv){var t=xv,e=Ev;if(Ev=xv=null,QO(t),e)for(t=0;t>>=0,t===0?32:31-(Gce(t)/Wce|0)|0}var j2=64,U2=4194304;function Vm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function H3(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Vm(a):(s&=o,s!==0&&(n=Vm(s)))}else o=r&~i,o!==0?n=Vm(o):s!==0&&(n=Vm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function Zw(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Gc(e),t[e]=r}function Jce(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=hb),sD=" ",oD=!1;function Fq(t,e){switch(t){case"keyup":return Sle.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jq(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var J1=!1;function Ile(t,e){switch(t){case"compositionend":return jq(e);case"keypress":return e.which!==32?null:(oD=!0,sD);case"textInput":return t=e.data,t===sD&&oD?null:t;default:return null}}function Tle(t,e){if(J1)return t==="compositionend"||!WI&&Fq(t,e)?(t=Bq(),q6=zI=Dd=null,J1=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fD(r)}}function Vq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Vq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function zq(){for(var t=window,e=$3();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=$3(t.document)}return e}function KI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Lle(t){var e=zq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Vq(r.ownerDocument.documentElement,r)){if(n!==null&&KI(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=uD(r,s);var o=uD(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Z1=null,PS=null,vb=null,kS=!1;function dD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kS||Z1==null||Z1!==$3(n)||(n=Z1,"selectionStart"in n&&KI(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),vb&&Wb(vb,n)||(vb=n,n=K3(PS,"onSelect"),0tv||(t.current=BS[tv],BS[tv]=null,tv--)}function bn(t,e){tv++,BS[tv]=t.current,t.current=e}var nh={},Os=wh(nh),ko=wh(!1),mp=nh;function Ng(t,e){var r=t.type.contextTypes;if(!r)return nh;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Mo(t){return t=t.childContextTypes,t!=null}function Q3(){An(ko),An(Os)}function bD(t,e,r){if(Os.current!==nh)throw Error(Xe(168));bn(Os,e),bn(ko,r)}function Xq(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Xe(108,Rce(t)||"Unknown",i));return Ln({},r,n)}function J3(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||nh,mp=Os.current,bn(Os,t),bn(ko,ko.current),!0}function wD(t,e,r){var n=t.stateNode;if(!n)throw Error(Xe(169));r?(t=Xq(t,e,mp),n.__reactInternalMemoizedMergedChildContext=t,An(ko),An(Os),bn(Os,t)):An(ko),bn(ko,r)}var Df=null,P4=!1,hA=!1;function eV(t){Df===null?Df=[t]:Df.push(t)}function Yle(t){P4=!0,eV(t)}function xh(){if(!hA&&Df!==null){hA=!0;var t=0,e=sn;try{var r=Df;for(sn=1;t>=o,i-=o,Qf=1<<32-Gc(e)+i|r<$?(ie=_,_=null):ie=_.sibling;var ce=p(C,_,O[$],L);if(ce===null){_===null&&(_=ie);break}t&&_&&ce.alternate===null&&e(C,_),S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce,_=ie}if($===O.length)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;$$?(ie=_,_=null):ie=_.sibling;var K=p(C,_,ce.value,L);if(K===null){_===null&&(_=ie);break}t&&_&&K.alternate===null&&e(C,_),S=s(K,S,$),z===null?F=K:z.sibling=K,z=K,_=ie}if(ce.done)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;!ce.done;$++,ce=O.next())ce=u(C,ce.value,L),ce!==null&&(S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce);return Tn&&f0(C,$),F}for(_=n(C,_);!ce.done;$++,ce=O.next())ce=g(_,C,$,ce.value,L),ce!==null&&(t&&ce.alternate!==null&&_.delete(ce.key===null?$:ce.key),S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce);return t&&_.forEach(function(P){return e(C,P)}),Tn&&f0(C,$),F}function I(C,S,O,L){if(typeof O=="object"&&O!==null&&O.type===Q1&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case B2:e:{for(var F=O.key,z=S;z!==null;){if(z.key===F){if(F=O.type,F===Q1){if(z.tag===7){r(C,z.sibling),S=i(z,O.props.children),S.return=C,C=S;break e}}else if(z.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===ad&&CD(F)===z.type){r(C,z.sibling),S=i(z,O.props),S.ref=mm(C,z,O),S.return=C,C=S;break e}r(C,z);break}else e(C,z);z=z.sibling}O.type===Q1?(S=op(O.props.children,C.mode,L,O.key),S.return=C,C=S):(L=Q6(O.type,O.key,O.props,null,C.mode,L),L.ref=mm(C,S,O),L.return=C,C=L)}return o(C);case Y1:e:{for(z=O.key;S!==null;){if(S.key===z)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){r(C,S.sibling),S=i(S,O.children||[]),S.return=C,C=S;break e}else{r(C,S);break}else e(C,S);S=S.sibling}S=xA(O,C.mode,L),S.return=C,C=S}return o(C);case ad:return z=O._init,I(C,S,z(O._payload),L)}if(qm(O))return y(C,S,O,L);if(hm(O))return b(C,S,O,L);W2(C,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,S!==null&&S.tag===6?(r(C,S.sibling),S=i(S,O),S.return=C,C=S):(r(C,S),S=wA(O,C.mode,L),S.return=C,C=S),o(C)):r(C,S)}return I}var Lg=iV(!0),sV=iV(!1),e5=wh(null),t5=null,iv=null,ZI=null;function XI(){ZI=iv=t5=null}function eT(t){var e=e5.current;An(e5),t._currentValue=e}function jS(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Av(t,e){t5=t,ZI=iv=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Po=!0),t.firstContext=null)}function rc(t){var e=t._currentValue;if(ZI!==t)if(t={context:t,memoizedValue:e,next:null},iv===null){if(t5===null)throw Error(Xe(308));iv=t,t5.dependencies={lanes:0,firstContext:t}}else iv=iv.next=t;return e}var _0=null;function tT(t){_0===null?_0=[t]:_0.push(t)}function oV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,tT(e)):(r.next=i.next,i.next=r),e.interleaved=r,du(t,n)}function du(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var cd=!1;function rT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aV(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ru(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Hd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Lr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,du(t,r)}return i=n.interleaved,i===null?(e.next=e,tT(n)):(e.next=i.next,i.next=e),n.interleaved=e,du(t,r)}function z6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}function AD(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function r5(t,e,r,n){var i=t.updateQueue;cd=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=c))}if(s!==null){var u=i.baseState;o=0,f=l=c=null,a=s;do{var p=a.lane,g=a.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,b=a;switch(p=e,g=r,b.tag){case 1:if(y=b.payload,typeof y=="function"){u=y.call(g,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,p=typeof y=="function"?y.call(g,u,p):y,p==null)break e;u=Ln({},u,p);break e;case 2:cd=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(l=f=g,c=u):f=f.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(c=u),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);xp|=o,t.lanes=o,t.memoizedState=u}}function SD(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=vA.transition;vA.transition={};try{t(!1),e()}finally{sn=r,vA.transition=n}}function AV(){return nc().memoizedState}function Xle(t,e,r){var n=Wd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},SV(t))_V(e,r);else if(r=oV(t,e,r,n),r!==null){var i=Zs();Wc(r,t,n,i),IV(r,e,n)}}function efe(t,e,r){var n=Wd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(SV(t))_V(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Yc(a,o)){var c=e.interleaved;c===null?(i.next=i,tT(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=oV(t,e,i,n),r!==null&&(i=Zs(),Wc(r,t,n,i),IV(r,e,n))}}function SV(t){var e=t.alternate;return t===Bn||e!==null&&e===Bn}function _V(t,e){gb=i5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function IV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,$I(t,r)}}var s5={readContext:rc,useCallback:gs,useContext:gs,useEffect:gs,useImperativeHandle:gs,useInsertionEffect:gs,useLayoutEffect:gs,useMemo:gs,useReducer:gs,useRef:gs,useState:gs,useDebugValue:gs,useDeferredValue:gs,useTransition:gs,useMutableSource:gs,useSyncExternalStore:gs,useId:gs,unstable_isNewReconciler:!1},tfe={readContext:rc,useCallback:function(t,e){return wl().memoizedState=[t,e===void 0?null:e],t},useContext:rc,useEffect:ID,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,G6(4194308,4,bV.bind(null,e,t),r)},useLayoutEffect:function(t,e){return G6(4194308,4,t,e)},useInsertionEffect:function(t,e){return G6(4,2,t,e)},useMemo:function(t,e){var r=wl();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=wl();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Xle.bind(null,Bn,t),[n.memoizedState,t]},useRef:function(t){var e=wl();return t={current:t},e.memoizedState=t},useState:_D,useDebugValue:fT,useDeferredValue:function(t){return wl().memoizedState=t},useTransition:function(){var t=_D(!1),e=t[0];return t=Zle.bind(null,t[1]),wl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Bn,i=wl();if(Tn){if(r===void 0)throw Error(Xe(407));r=r()}else{if(r=e(),Fi===null)throw Error(Xe(349));wp&30||uV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,ID(hV.bind(null,n,s,t),[t]),n.flags|=2048,tw(9,dV.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=wl(),e=Fi.identifierPrefix;if(Tn){var r=Jf,n=Qf;r=(n&~(1<<32-Gc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Xb++,0")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{YC=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Um(t):""}function Mce(t){switch(t.tag){case 5:return Um(t.type);case 16:return Um("Lazy");case 13:return Um("Suspense");case 19:return Um("SuspenseList");case 0:case 2:case 15:return t=QC(t.type,!1),t;case 11:return t=QC(t.type.render,!1),t;case 1:return t=QC(t.type,!0),t;default:return""}}function uS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case J1:return"Fragment";case Q1:return"Portal";case cS:return"Profiler";case OI:return"StrictMode";case lS:return"Suspense";case fS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case iq:return(t.displayName||"Context")+".Consumer";case nq:return(t._context.displayName||"Context")+".Provider";case DI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case NI:return e=t.displayName||null,e!==null?e:uS(t.type)||"Memo";case sd:e=t._payload,t=t._init;try{return uS(t(e))}catch{}}return null}function Rce(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return uS(e);case 8:return e===OI?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function eh(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function oq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Oce(t){var e=oq(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function R2(t){t._valueTracker||(t._valueTracker=Oce(t))}function aq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=oq(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function B3(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function dS(t,e){var r=e.checked;return Fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function VO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=eh(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function cq(t,e){e=e.checked,e!=null&&RI(t,"checked",e,!1)}function hS(t,e){cq(t,e);var r=eh(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?pS(t,e.type,r):e.hasOwnProperty("defaultValue")&&pS(t,e.type,eh(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function zO(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function pS(t,e,r){(e!=="number"||B3(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var $m=Array.isArray;function xv(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=O2.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ub(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var fb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dce=["Webkit","ms","Moz","O"];Object.keys(fb).forEach(function(t){Dce.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),fb[e]=fb[t]})});function dq(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||fb.hasOwnProperty(t)&&fb[t]?(""+e).trim():e+"px"}function hq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=dq(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Nce=Fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yS(t,e){if(e){if(Nce[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ze(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ze(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ze(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ze(62))}}function mS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bS=null;function BI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wS=null,Ev=null,Cv=null;function WO(t){if(t=Xw(t)){if(typeof wS!="function")throw Error(Ze(280));var e=t.stateNode;e&&(e=C4(e),wS(t.stateNode,t.type,e))}}function pq(t){Ev?Cv?Cv.push(t):Cv=[t]:Ev=t}function vq(){if(Ev){var t=Ev,e=Cv;if(Cv=Ev=null,WO(t),e)for(t=0;t>>=0,t===0?32:31-(Gce(t)/Wce|0)|0}var D2=64,N2=4194304;function qm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function U3(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=qm(a):(s&=o,s!==0&&(n=qm(s)))}else o=r&~i,o!==0?n=qm(o):s!==0&&(n=qm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function Jw(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Uc(e),t[e]=r}function Jce(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=db),rD=" ",nD=!1;function Nq(t,e){switch(t){case"keyup":return Sle.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bq(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Z1=!1;function Ile(t,e){switch(t){case"compositionend":return Bq(e);case"keypress":return e.which!==32?null:(nD=!0,rD);case"textInput":return t=e.data,t===rD&&nD?null:t;default:return null}}function Tle(t,e){if(Z1)return t==="compositionend"||!zI&&Nq(t,e)?(t=Oq(),L6=$I=Rd=null,Z1=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=aD(r)}}function Uq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Uq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function $q(){for(var t=window,e=B3();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=B3(t.document)}return e}function HI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Lle(t){var e=$q(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Uq(r.ownerDocument.documentElement,r)){if(n!==null&&HI(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=cD(r,s);var o=cD(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,X1=null,_S=null,pb=null,IS=!1;function lD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;IS||X1==null||X1!==B3(n)||(n=X1,"selectionStart"in n&&HI(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),pb&&Gb(pb,n)||(pb=n,n=V3(_S,"onSelect"),0rv||(t.current=OS[rv],OS[rv]=null,rv--)}function bn(t,e){rv++,OS[rv]=t.current,t.current=e}var th={},Ns=mh(th),Mo=mh(!1),mp=th;function Bg(t,e){var r=t.type.contextTypes;if(!r)return th;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ro(t){return t=t.childContextTypes,t!=null}function H3(){Sn(Mo),Sn(Ns)}function gD(t,e,r){if(Ns.current!==th)throw Error(Ze(168));bn(Ns,e),bn(Mo,r)}function Qq(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Ze(108,Rce(t)||"Unknown",i));return Fn({},r,n)}function G3(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||th,mp=Ns.current,bn(Ns,t),bn(Mo,Mo.current),!0}function yD(t,e,r){var n=t.stateNode;if(!n)throw Error(Ze(169));r?(t=Qq(t,e,mp),n.__reactInternalMemoizedMergedChildContext=t,Sn(Mo),Sn(Ns),bn(Ns,t)):Sn(Mo),bn(Mo,r)}var Of=null,A4=!1,fA=!1;function Jq(t){Of===null?Of=[t]:Of.push(t)}function Yle(t){A4=!0,Jq(t)}function bh(){if(!fA&&Of!==null){fA=!0;var t=0,e=an;try{var r=Of;for(an=1;t>=o,i-=o,Yf=1<<32-Uc(e)+i|r<$?(ie=_,_=null):ie=_.sibling;var ce=p(C,_,O[$],L);if(ce===null){_===null&&(_=ie);break}t&&_&&ce.alternate===null&&e(C,_),S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce,_=ie}if($===O.length)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;$$?(ie=_,_=null):ie=_.sibling;var K=p(C,_,ce.value,L);if(K===null){_===null&&(_=ie);break}t&&_&&K.alternate===null&&e(C,_),S=s(K,S,$),z===null?F=K:z.sibling=K,z=K,_=ie}if(ce.done)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;!ce.done;$++,ce=O.next())ce=u(C,ce.value,L),ce!==null&&(S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce);return Tn&&f0(C,$),F}for(_=n(C,_);!ce.done;$++,ce=O.next())ce=g(_,C,$,ce.value,L),ce!==null&&(t&&ce.alternate!==null&&_.delete(ce.key===null?$:ce.key),S=s(ce,S,$),z===null?F=ce:z.sibling=ce,z=ce);return t&&_.forEach(function(P){return e(C,P)}),Tn&&f0(C,$),F}function I(C,S,O,L){if(typeof O=="object"&&O!==null&&O.type===J1&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case M2:e:{for(var F=O.key,z=S;z!==null;){if(z.key===F){if(F=O.type,F===J1){if(z.tag===7){r(C,z.sibling),S=i(z,O.props.children),S.return=C,C=S;break e}}else if(z.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===sd&&wD(F)===z.type){r(C,z.sibling),S=i(z,O.props),S.ref=ym(C,z,O),S.return=C,C=S;break e}r(C,z);break}else e(C,z);z=z.sibling}O.type===J1?(S=op(O.props.children,C.mode,L,O.key),S.return=C,C=S):(L=H6(O.type,O.key,O.props,null,C.mode,L),L.ref=ym(C,S,O),L.return=C,C=L)}return o(C);case Q1:e:{for(z=O.key;S!==null;){if(S.key===z)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){r(C,S.sibling),S=i(S,O.children||[]),S.return=C,C=S;break e}else{r(C,S);break}else e(C,S);S=S.sibling}S=mA(O,C.mode,L),S.return=C,C=S}return o(C);case sd:return z=O._init,I(C,S,z(O._payload),L)}if($m(O))return y(C,S,O,L);if(dm(O))return b(C,S,O,L);q2(C,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,S!==null&&S.tag===6?(r(C,S.sibling),S=i(S,O),S.return=C,C=S):(r(C,S),S=yA(O,C.mode,L),S.return=C,C=S),o(C)):r(C,S)}return I}var Fg=tV(!0),rV=tV(!1),Y3=mh(null),Q3=null,sv=null,YI=null;function QI(){YI=sv=Q3=null}function JI(t){var e=Y3.current;Sn(Y3),t._currentValue=e}function BS(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Sv(t,e){Q3=t,YI=sv=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ko=!0),t.firstContext=null)}function Qa(t){var e=t._currentValue;if(YI!==t)if(t={context:t,memoizedValue:e,next:null},sv===null){if(Q3===null)throw Error(Ze(308));sv=t,Q3.dependencies={lanes:0,firstContext:t}}else sv=sv.next=t;return e}var _0=null;function ZI(t){_0===null?_0=[t]:_0.push(t)}function nV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,ZI(e)):(r.next=i.next,i.next=r),e.interleaved=r,uu(t,n)}function uu(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var od=!1;function XI(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iV(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function tu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Vd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Fr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,uu(t,r)}return i=n.interleaved,i===null?(e.next=e,ZI(n)):(e.next=i.next,i.next=e),n.interleaved=e,uu(t,r)}function j6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,FI(t,r)}}function xD(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function J3(t,e,r,n){var i=t.updateQueue;od=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=c))}if(s!==null){var u=i.baseState;o=0,f=l=c=null,a=s;do{var p=a.lane,g=a.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,b=a;switch(p=e,g=r,b.tag){case 1:if(y=b.payload,typeof y=="function"){u=y.call(g,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,p=typeof y=="function"?y.call(g,u,p):y,p==null)break e;u=Fn({},u,p);break e;case 2:od=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(l=f=g,c=u):f=f.next=g,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(c=u),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);xp|=o,t.lanes=o,t.memoizedState=u}}function ED(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=dA.transition;dA.transition={};try{t(!1),e()}finally{an=r,dA.transition=n}}function xV(){return Ja().memoizedState}function Xle(t,e,r){var n=Hd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},EV(t))CV(e,r);else if(r=nV(t,e,r,n),r!==null){var i=to();$c(r,t,n,i),AV(r,e,n)}}function efe(t,e,r){var n=Hd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(EV(t))CV(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Vc(a,o)){var c=e.interleaved;c===null?(i.next=i,ZI(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=nV(t,e,i,n),r!==null&&(i=to(),$c(r,t,n,i),AV(r,e,n))}}function EV(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function CV(t,e){vb=X3=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function AV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,FI(t,r)}}var e5={readContext:Qa,useCallback:ms,useContext:ms,useEffect:ms,useImperativeHandle:ms,useInsertionEffect:ms,useLayoutEffect:ms,useMemo:ms,useReducer:ms,useRef:ms,useState:ms,useDebugValue:ms,useDeferredValue:ms,useTransition:ms,useMutableSource:ms,useSyncExternalStore:ms,useId:ms,unstable_isNewReconciler:!1},tfe={readContext:Qa,useCallback:function(t,e){return pl().memoizedState=[t,e===void 0?null:e],t},useContext:Qa,useEffect:AD,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,$6(4194308,4,gV.bind(null,e,t),r)},useLayoutEffect:function(t,e){return $6(4194308,4,t,e)},useInsertionEffect:function(t,e){return $6(4,2,t,e)},useMemo:function(t,e){var r=pl();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=pl();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Xle.bind(null,Ln,t),[n.memoizedState,t]},useRef:function(t){var e=pl();return t={current:t},e.memoizedState=t},useState:CD,useDebugValue:aT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=CD(!1),e=t[0];return t=Zle.bind(null,t[1]),pl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Ln,i=pl();if(Tn){if(r===void 0)throw Error(Ze(407));r=r()}else{if(r=e(),Ni===null)throw Error(Ze(349));wp&30||cV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,AD(fV.bind(null,n,s,t),[t]),n.flags|=2048,ew(9,lV.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=pl(),e=Ni.identifierPrefix;if(Tn){var r=Qf,n=Yf;r=(n&~(1<<32-Uc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Zb++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Ol]=e,t[Qb]=n,LV(t,e,!1,!1),e.stateNode=t;e:{switch(o=xS(r,n),r){case"dialog":xn("cancel",t),xn("close",t),i=n;break;case"iframe":case"object":case"embed":xn("load",t),i=n;break;case"video":case"audio":for(i=0;iUg&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304)}else{if(!n)if(t=n5(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),bm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Tn)return ys(e),null}else 2*oi()-s.renderingStartTime>Ug&&r!==1073741824&&(e.flags|=128,n=!0,bm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=oi(),e.sibling=null,r=Mn.current,bn(Mn,n?r&1|2:r&1),e):(ys(e),null);case 22:case 23:return gT(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?na&1073741824&&(ys(e),e.subtreeFlags&6&&(e.flags|=8192)):ys(e),null;case 24:return null;case 25:return null}throw Error(Xe(156,e.tag))}function lfe(t,e){switch(QI(e),e.tag){case 1:return Mo(e.type)&&Q3(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Fg(),An(ko),An(Os),sT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return iT(e),null;case 13:if(An(Mn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Xe(340));Bg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return An(Mn),null;case 4:return Fg(),null;case 10:return eT(e.type._context),null;case 22:case 23:return gT(),null;case 24:return null;default:return null}}var Y2=!1,Ss=!1,ffe=typeof WeakSet=="function"?WeakSet:Set,_t=null;function sv(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Hn(t,e,n)}else r.current=null}function KS(t,e,r){try{r()}catch(n){Hn(t,e,n)}}var FD=!1;function ufe(t,e){if(MS=G3,t=zq(),KI(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,f=0,u=t,p=null;t:for(;;){for(var g;u!==r||i!==0&&u.nodeType!==3||(a=o+i),u!==s||n!==0&&u.nodeType!==3||(c=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)p=u,u=g;for(;;){if(u===t)break t;if(p===r&&++l===i&&(a=o),p===s&&++f===n&&(c=o),(g=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=g}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(RS={focusedElem:t,selectionRange:r},G3=!1,_t=e;_t!==null;)if(e=_t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,_t=t;else for(;_t!==null;){e=_t;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,I=y.memoizedState,C=e.stateNode,S=C.getSnapshotBeforeUpdate(e.elementType===e.type?b:Rc(e.type,b),I);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var O=e.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Xe(163))}}catch(L){Hn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,_t=t;break}_t=e.return}return y=FD,FD=!1,y}function yb(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&KS(e,r,s)}i=i.next}while(i!==n)}}function R4(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function YS(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function UV(t){var e=t.alternate;e!==null&&(t.alternate=null,UV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ol],delete e[Qb],delete e[NS],delete e[Wle],delete e[Kle])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function $V(t){return t.tag===5||t.tag===3||t.tag===4}function jD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||$V(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function QS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Y3));else if(n!==4&&(t=t.child,t!==null))for(QS(t,e,r),t=t.sibling;t!==null;)QS(t,e,r),t=t.sibling}function JS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(JS(t,e,r),t=t.sibling;t!==null;)JS(t,e,r),t=t.sibling}var Qi=null,Uc=!1;function Zu(t,e,r){for(r=r.child;r!==null;)qV(t,e,r),r=r.sibling}function qV(t,e,r){if(Ul&&typeof Ul.onCommitFiberUnmount=="function")try{Ul.onCommitFiberUnmount(A4,r)}catch{}switch(r.tag){case 5:Ss||sv(r,e);case 6:var n=Qi,i=Uc;Qi=null,Zu(t,e,r),Qi=n,Uc=i,Qi!==null&&(Uc?(t=Qi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Qi.removeChild(r.stateNode));break;case 18:Qi!==null&&(Uc?(t=Qi,r=r.stateNode,t.nodeType===8?dA(t.parentNode,r):t.nodeType===1&&dA(t,r),Hb(t)):dA(Qi,r.stateNode));break;case 4:n=Qi,i=Uc,Qi=r.stateNode.containerInfo,Uc=!0,Zu(t,e,r),Qi=n,Uc=i;break;case 0:case 11:case 14:case 15:if(!Ss&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&KS(r,e,o),i=i.next}while(i!==n)}Zu(t,e,r);break;case 1:if(!Ss&&(sv(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Hn(r,e,a)}Zu(t,e,r);break;case 21:Zu(t,e,r);break;case 22:r.mode&1?(Ss=(n=Ss)||r.memoizedState!==null,Zu(t,e,r),Ss=n):Zu(t,e,r);break;default:Zu(t,e,r)}}function UD(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new ffe),e.forEach(function(n){var i=wfe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function xc(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=oi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*hfe(n/1960))-n,10t?16:t,Nd===null)var n=!1;else{if(t=Nd,Nd=null,c5=0,Lr&6)throw Error(Xe(331));var i=Lr;for(Lr|=4,_t=t.current;_t!==null;){var s=_t,o=s.child;if(_t.flags&16){var a=s.deletions;if(a!==null){for(var c=0;coi()-pT?sp(t,0):hT|=r),Ro(t,e)}function QV(t,e){e===0&&(t.mode&1?(e=U2,U2<<=1,!(U2&130023424)&&(U2=4194304)):e=1);var r=Zs();t=du(t,e),t!==null&&(Zw(t,e,r),Ro(t,r))}function bfe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),QV(t,r)}function wfe(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Xe(314))}n!==null&&n.delete(e),QV(t,r)}var JV;JV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ko.current)Po=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Po=!1,afe(t,e,r);Po=!!(t.flags&131072)}else Po=!1,Tn&&e.flags&1048576&&tV(e,X3,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;W6(t,e),t=e.pendingProps;var i=Ng(e,Os.current);Av(e,r),i=aT(null,e,n,t,i,r);var s=cT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Mo(n)?(s=!0,J3(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rT(e),i.updater=M4,e.stateNode=i,i._reactInternals=e,$S(e,n,t,r),e=zS(null,e,n,!0,s,r)):(e.tag=0,Tn&&s&&YI(e),Ks(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(W6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Efe(n),t=Rc(n,t),i){case 0:e=VS(null,e,n,t,r);break e;case 1:e=ND(null,e,n,t,r);break e;case 11:e=OD(null,e,n,t,r);break e;case 14:e=DD(null,e,n,Rc(n.type,t),r);break e}throw Error(Xe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Rc(n,i),VS(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Rc(n,i),ND(t,e,n,i,r);case 3:e:{if(DV(e),t===null)throw Error(Xe(387));n=e.pendingProps,s=e.memoizedState,i=s.element,aV(t,e),r5(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=jg(Error(Xe(423)),e),e=BD(t,e,n,r,i);break e}else if(n!==i){i=jg(Error(Xe(424)),e),e=BD(t,e,n,r,i);break e}else for(aa=zd(e.stateNode.containerInfo.firstChild),fa=e,Tn=!0,qc=null,r=sV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Bg(),n===i){e=hu(t,e,r);break e}Ks(t,e,n,r)}e=e.child}return e;case 5:return cV(e),t===null&&FS(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,OS(n,i)?o=null:s!==null&&OS(n,s)&&(e.flags|=32),OV(t,e),Ks(t,e,o,r),e.child;case 6:return t===null&&FS(e),null;case 13:return NV(t,e,r);case 4:return nT(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Lg(e,null,n,r):Ks(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Rc(n,i),OD(t,e,n,i,r);case 7:return Ks(t,e,e.pendingProps,r),e.child;case 8:return Ks(t,e,e.pendingProps.children,r),e.child;case 12:return Ks(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,bn(e5,n._currentValue),n._currentValue=o,s!==null)if(Yc(s.value,o)){if(s.children===i.children&&!ko.current){e=hu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=ru(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var f=l.pending;f===null?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),jS(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Xe(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),jS(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ks(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Av(e,r),i=rc(i),n=n(i),e.flags|=1,Ks(t,e,n,r),e.child;case 14:return n=e.type,i=Rc(n,e.pendingProps),i=Rc(n.type,i),DD(t,e,n,i,r);case 15:return MV(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Rc(n,i),W6(t,e),e.tag=1,Mo(n)?(t=!0,J3(e)):t=!1,Av(e,r),TV(e,n,i),$S(e,n,i,r),zS(null,e,n,!0,t,r);case 19:return BV(t,e,r);case 22:return RV(t,e,r)}throw Error(Xe(156,e.tag))};function ZV(t,e){return Sq(t,e)}function xfe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ja(t,e,r,n){return new xfe(t,e,r,n)}function mT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Efe(t){if(typeof t=="function")return mT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===LI)return 11;if(t===FI)return 14}return 2}function Kd(t,e){var r=t.alternate;return r===null?(r=Ja(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Q6(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")mT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Q1:return op(r.children,i,s,e);case BI:o=8,i|=8;break;case uS:return t=Ja(12,r,e,i|2),t.elementType=uS,t.lanes=s,t;case dS:return t=Ja(13,r,e,i),t.elementType=dS,t.lanes=s,t;case hS:return t=Ja(19,r,e,i),t.elementType=hS,t.lanes=s,t;case cq:return D4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case oq:o=10;break e;case aq:o=9;break e;case LI:o=11;break e;case FI:o=14;break e;case ad:o=16,n=null;break e}throw Error(Xe(130,t==null?t:typeof t,""))}return e=Ja(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function op(t,e,r,n){return t=Ja(7,t,n,e),t.lanes=r,t}function D4(t,e,r,n){return t=Ja(22,t,n,e),t.elementType=cq,t.lanes=r,t.stateNode={isHidden:!1},t}function wA(t,e,r){return t=Ja(6,t,null,e),t.lanes=r,t}function xA(t,e,r){return e=Ja(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Cfe(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tA(0),this.expirationTimes=tA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bT(t,e,r,n,i,s,o,a,c){return t=new Cfe(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ja(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},rT(s),t}function Afe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rz)}catch(t){console.error(t)}}rz(),rq.exports=ga;var Eh=rq.exports;const Pfe=_u(Eh),CT=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),j4=D.createContext({}),U4=D.createContext(null),AT=typeof window<"u",nz=AT?D.useLayoutEffect:D.useEffect,iz=D.createContext({strict:!1}),$4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kfe="framerAppearId",sz="data-"+$4(kfe),Mfe={skipAnimations:!1,useManualTiming:!1};function Rfe(t){let e=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,f=!1,u=!1)=>{const g=u&&n?e:r;return f&&s.add(l),g.has(l)||g.add(l),l},cancel:l=>{r.delete(l),s.delete(l)},process:l=>{if(o=l,n){i=!0;return}n=!0,[e,r]=[r,e],r.clear(),e.forEach(a),n=!1,i&&(i=!1,c.process(l))}};return c}const Z2=["read","resolveKeyframes","update","preRender","render","postRender"],Ofe=40;function oz(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=Z2.reduce((C,S)=>(C[S]=Rfe(s),C),{}),{read:a,resolveKeyframes:c,update:l,preRender:f,render:u,postRender:p}=o,g=()=>{const C=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(C-i.timestamp,Ofe),1),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),f.process(i),u.process(i),p.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(g))},y=()=>{r=!0,n=!0,i.isProcessing||t(g)};return{schedule:Z2.reduce((C,S)=>{const O=o[S];return C[S]=(L,F=!1,z=!1)=>(r||y(),O.schedule(L,F,z)),C},{}),cancel:C=>{for(let S=0;S{u&&u.update(r,c)});const g=r[sz],y=D.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return nz(()=>{u&&(u.updateFeatures(),ST.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),D.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,KD||(KD=!0,queueMicrotask(Nfe)))}),u}function Nfe(){window.MotionHandoffIsComplete=!0}function Bfe(t,e,r,n){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:cz(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&av(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:l})}function cz(t){if(t)return t.options.allowProjection!==!1?t.projection:cz(t.parent)}function Lfe(t,e,r){return D.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):av(r)&&(r.current=n))},[e])}function nw(t){return typeof t=="string"||Array.isArray(t)}function iw(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const _T=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],IT=["initial",..._T];function q4(t){return iw(t.animate)||IT.some(e=>nw(t[e]))}function lz(t){return!!(q4(t)||t.variants)}function Ffe(t,e){if(q4(t)){const{initial:r,animate:n}=t;return{initial:r===!1||nw(r)?r:void 0,animate:nw(n)?n:void 0}}return t.inherit!==!1?e:{}}function jfe(t){const{initial:e,animate:r}=Ffe(t,D.useContext(j4));return D.useMemo(()=>({initial:e,animate:r}),[YD(e),YD(r)])}function YD(t){return Array.isArray(t)?t.join(" "):t}const QD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$g={};for(const t in QD)$g[t]={isEnabled:e=>QD[t].some(r=>!!e[r])};function Ufe(t){for(const e in t)$g[e]={...$g[e],...t[e]}}const TT=D.createContext({}),$fe=Symbol.for("motionComponentSymbol"),Ts=t=>t;let r7=Ts;function qfe({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&Ufe(t);function s(a,c){let l;const f={...D.useContext(CT),...a,layoutId:Vfe(a)},{isStatic:u}=f,p=jfe(a),g=n(a,u);if(!u&&AT){zfe();const y=Hfe(f);l=y.MeasureLayout,p.visualElement=Dfe(i,g,f,e,y.ProjectionNode)}return W.jsxs(j4.Provider,{value:p,children:[l&&p.visualElement?W.jsx(l,{visualElement:p.visualElement,...f}):null,r(i,a,Lfe(g,p.visualElement,c),g,u,p.visualElement)]})}const o=D.forwardRef(s);return o[$fe]=i,o}function Vfe({layoutId:t}){const e=D.useContext(TT).id;return e&&t!==void 0?e+"-"+t:t}function zfe(t,e){D.useContext(iz).strict}function Hfe(t){const{drag:e,layout:r}=$g;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function Gfe(t){function e(n,i={}){return qfe(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const Wfe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function PT(t){return typeof t!="string"||t.includes("-")?!1:!!(Wfe.indexOf(t)>-1||/[A-Z]/u.test(t))}const u5={};function Kfe(t){Object.assign(u5,t)}const rx=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ch=new Set(rx);function fz(t,{layout:e,layoutId:r}){return Ch.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!u5[t]||t==="opacity")}const _s=t=>!!(t&&t.getVelocity),uz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ih=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},wb={...hy,transform:t=>ih(0,1,t)},X2={...hy,default:1},xb=t=>Math.round(t*1e5)/1e5,kT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Yfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Qfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function nx(t){return typeof t=="string"}function Jfe(t){return t==null}const ix=t=>({test:e=>nx(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),id=ix("deg"),ql=ix("%"),Yt=ix("px"),Zfe=ix("vh"),Xfe=ix("vw"),JD={...ql,parse:t=>ql.parse(t)/100,transform:t=>ql.transform(t*100)},ZD={...hy,transform:Math.round},MT={borderWidth:Yt,borderTopWidth:Yt,borderRightWidth:Yt,borderBottomWidth:Yt,borderLeftWidth:Yt,borderRadius:Yt,radius:Yt,borderTopLeftRadius:Yt,borderTopRightRadius:Yt,borderBottomRightRadius:Yt,borderBottomLeftRadius:Yt,width:Yt,maxWidth:Yt,height:Yt,maxHeight:Yt,size:Yt,top:Yt,right:Yt,bottom:Yt,left:Yt,padding:Yt,paddingTop:Yt,paddingRight:Yt,paddingBottom:Yt,paddingLeft:Yt,margin:Yt,marginTop:Yt,marginRight:Yt,marginBottom:Yt,marginLeft:Yt,rotate:id,rotateX:id,rotateY:id,rotateZ:id,scale:X2,scaleX:X2,scaleY:X2,scaleZ:X2,skew:id,skewX:id,skewY:id,distance:Yt,translateX:Yt,translateY:Yt,translateZ:Yt,x:Yt,y:Yt,z:Yt,perspective:Yt,transformPerspective:Yt,opacity:wb,originX:JD,originY:JD,originZ:Yt,zIndex:ZD,backgroundPositionX:Yt,backgroundPositionY:Yt,fillOpacity:wb,strokeOpacity:wb,numOctaves:ZD},eue={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tue=rx.length;function rue(t,e,r){let n="",i=!0;for(let s=0;se=>typeof e=="string"&&e.startsWith(t),hz=dz("--"),nue=dz("var(--"),RT=t=>nue(t)?iue.test(t.split("/*")[0].trim()):!1,iue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function OT(t,e,r){const{style:n,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(Ch.has(c)){o=!0;continue}else if(hz(c)){i[c]=l;continue}else{const f=uz(l,MT[c]);c.startsWith("origin")?(a=!0,s[c]=f):n[c]=f}}if(e.transform||(o||r?n.transform=rue(e,t.transform,r):n.transform&&(n.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:f=0}=s;n.transformOrigin=`${c} ${l} ${f}`}}const DT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function pz(t,e,r){for(const n in e)!_s(e[n])&&!fz(n,r)&&(t[n]=e[n])}function sue({transformTemplate:t},e){return D.useMemo(()=>{const r=DT();return OT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function oue(t,e){const r=t.style||{},n={};return pz(n,r,t),Object.assign(n,sue(t,e)),n}function aue(t,e){const r={},n=oue(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const cue=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function d5(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||cue.has(t)}let vz=t=>!d5(t);function lue(t){t&&(vz=e=>e.startsWith("on")?!d5(e):t(e))}try{lue(require("@emotion/is-prop-valid").default)}catch{}function fue(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(vz(i)||r===!0&&d5(i)||!e&&!d5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function XD(t,e,r){return typeof t=="string"?t:Yt.transform(e+r*t)}function uue(t,e,r){const n=XD(e,t.x,t.width),i=XD(r,t.y,t.height);return`${n} ${i}`}const due={offset:"stroke-dashoffset",array:"stroke-dasharray"},hue={offset:"strokeDashoffset",array:"strokeDasharray"};function pue(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?due:hue;t[s.offset]=Yt.transform(-n);const o=Yt.transform(e),a=Yt.transform(r);t[s.array]=`${o} ${a}`}function NT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(OT(t,l,u),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g,dimensions:y}=t;p.transform&&(y&&(g.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||g.transform)&&(g.transformOrigin=uue(y,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&pue(p,o,a,c,!1)}const gz=()=>({...DT(),attrs:{}}),BT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vue(t,e,r,n){const i=D.useMemo(()=>{const s=gz();return NT(s,e,BT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};pz(s,t.style,t),i.style={...s,...i.style}}return i}function gue(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(PT(r)?vue:aue)(n,s,o,r),l=fue(n,typeof r=="string",t),f=r!==D.Fragment?{...l,...c,ref:i}:{},{children:u}=n,p=D.useMemo(()=>_s(u)?u.get():u,[u]);return D.createElement(r,{...f,children:p})}}function yz(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const mz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bz(t,e,r,n){yz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(mz.has(i)?i:$4(i),e.attrs[i])}function LT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(_s(i[o])||e.style&&_s(e.style[o])||fz(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=i[o]);return r&&i&&typeof i.willChange=="string"&&(r.applyWillChange=!1),s}function wz(t,e,r){const n=LT(t,e,r);for(const i in t)if(_s(t[i])||_s(e[i])){const s=rx.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=t[i]}return n}function eN(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function FT(t,e,r,n){if(typeof e=="function"){const[i,s]=eN(n);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=eN(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function jT(t){const e=D.useRef(null);return e.current===null&&(e.current=t()),e.current}const n7=t=>Array.isArray(t),yue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),mue=t=>n7(t)?t[t.length-1]||0:t;function J6(t){const e=_s(t)?t.get():t;return yue(e)?e.toValue():e}const xz=new Set(["opacity","clipPath","filter","transform"]);function Ez(t){if(Ch.has(t))return"transform";if(xz.has(t))return $4(t)}function V4(t,e){t.indexOf(e)===-1&&t.push(e)}function z4(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}function bue({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:r,onMount:n},i,s,o,a){const c={latestValues:xue(i,s,o,a?!1:t,e),renderState:r()};return n&&(c.mount=l=>n(i,l,c)),c}const Cz=t=>(e,r)=>{const n=D.useContext(j4),i=D.useContext(U4),s=()=>bue(t,e,n,i,r);return r?s():jT(s)};function wue(t,e){const r=Ez(e);r&&V4(t,r)}function tN(t,e,r){const n=Array.isArray(e)?e:[e];for(let i=0;i{for(const S in I){let O=I[S];if(Array.isArray(O)){const L=y?O.length-1:0;O=O[L]}O!==null&&(o[S]=O)}for(const S in C)o[S]=C[S]}),c&&(u&&f!==!1&&!iw(u)&&tN(t,u,I=>{for(const C in I)wue(a,C)}),a.length&&(o.willChange=a.join(","))),o}const{schedule:nn,cancel:pu,state:Ji,steps:EA}=oz(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ts,!0),Eue={useVisualState:Cz({scrapeMotionValuesFromProps:wz,createRenderState:gz,onMount:(t,e,{renderState:r,latestValues:n})=>{nn.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),nn.render(()=>{NT(r,n,BT(e.tagName),t.transformTemplate),bz(e,r)})}})},Cue={useVisualState:Cz({applyWillChange:!0,scrapeMotionValuesFromProps:LT,createRenderState:DT})};function Aue(t,{forwardMotionProps:e=!1},r,n){return{...PT(t)?Eue:Cue,preloadedFeatures:r,useRender:gue(e),createVisualElement:n,Component:t}}function Zf(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const Az=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function H4(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Sue=t=>e=>Az(e)&&t(e,H4(e));function nu(t,e,r,n){return Zf(t,e,Sue(r),n)}const _ue=(t,e)=>r=>e(t(r)),iu=(...t)=>t.reduce(_ue);function Sz(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const rN=Sz("dragHorizontal"),nN=Sz("dragVertical");function _z(t){let e=!1;if(t==="y")e=nN();else if(t==="x")e=rN();else{const r=rN(),n=nN();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Iz(){const t=_z(!0);return t?(t(),!1):!0}class Ah{constructor(e){this.isMounted=!1,this.node=e}update(){}}function iN(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||Iz())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const c=a[n];c&&nn.postRender(()=>c(s,o))};return nu(t.current,r,i,{passive:!t.getProps()[n]})}class Iue extends Ah{mount(){this.unmount=iu(iN(this.node,!0),iN(this.node,!1))}unmount(){}}class Tue extends Ah{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=iu(Zf(this.node.current,"focus",()=>this.onFocus()),Zf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Tz=(t,e)=>e?t===e?!0:Tz(t,e.parentElement):!1;function CA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,H4(r))}class Pue extends Ah{constructor(){super(...arguments),this.removeStartListeners=Ts,this.removeEndListeners=Ts,this.removeAccessibleListeners=Ts,this.startPointerPress=(e,r)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),s=nu(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:f,globalTapTarget:u}=this.node.getProps(),p=!u&&!Tz(this.node.current,a.target)?f:l;p&&nn.update(()=>p(a,c))},{passive:!(n.onTap||n.onPointerUp)}),o=nu(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=iu(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||CA("up",(c,l)=>{const{onTap:f}=this.node.getProps();f&&nn.postRender(()=>f(c,l))})};this.removeEndListeners(),this.removeEndListeners=Zf(this.node.current,"keyup",o),CA("down",(a,c)=>{this.startPress(a,c)})},r=Zf(this.node.current,"keydown",e),n=()=>{this.isPressing&&CA("cancel",(s,o)=>this.cancelPress(s,o))},i=Zf(this.node.current,"blur",n);this.removeAccessibleListeners=iu(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&nn.postRender(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Iz()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&nn.postRender(()=>n(e,r))}mount(){const e=this.node.getProps(),r=nu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Zf(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=iu(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const i7=new WeakMap,AA=new WeakMap,kue=t=>{const e=i7.get(t.target);e&&e(t)},Mue=t=>{t.forEach(kue)};function Rue({root:t,...e}){const r=t||document;AA.has(r)||AA.set(r,{});const n=AA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Mue,{root:t,...e})),n[i]}function Oue(t,e,r){const n=Rue(e);return i7.set(t,r),n.observe(t),()=>{i7.delete(t),n.unobserve(t)}}const Due={some:0,all:1};class Nue extends Ah{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Due[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=l?f:u;p&&p(c)};return Oue(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Bue(e,r))&&this.startObserver()}unmount(){}}function Bue({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Lue={inView:{Feature:Nue},tap:{Feature:Pue},focus:{Feature:Tue},hover:{Feature:Iue}};function Pz(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;nt*1e3,ou=t=>t/1e3,Fue={type:"spring",stiffness:500,damping:25,restSpeed:10},jue=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Uue={type:"keyframes",duration:.8},$ue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},que=(t,{keyframes:e})=>e.length>2?Uue:Ch.has(t)?t.startsWith("scale")?jue(e[1]):Fue:$ue;function Vue({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...f}){return!!Object.keys(f).length}function UT(t,e){return t[e]||t.default||t}const zue=t=>t!==null;function W4(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(zue),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const kz=t=>/^0[^.\s]+$/u.test(t);function Hue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||kz(t):!0}const Mz=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Gue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wue(t){const e=Gue.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function Rz(t,e,r=1){const[n,i]=Wue(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return Mz(o)?parseFloat(o):o}return RT(i)?Rz(i,e,r+1):i}const Kue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),sN=t=>t===hy||t===Yt,oN=(t,e)=>parseFloat(t.split(", ")[e]),aN=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return oN(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?oN(s[1],t):0}},Yue=new Set(["x","y","z"]),Que=rx.filter(t=>!Yue.has(t));function Jue(t){const e=[];return Que.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const qg={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:aN(4,13),y:aN(5,14)};qg.translateX=qg.x;qg.translateY=qg.y;const Oz=t=>e=>e.test(t),Zue={test:t=>t==="auto",parse:t=>t},Dz=[hy,Yt,ql,id,Xfe,Zfe,Zue],cN=t=>Dz.find(Oz(t)),ap=new Set;let s7=!1,o7=!1;function Nz(){if(o7){const t=Array.from(ap).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Jue(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}o7=!1,s7=!1,ap.forEach(t=>t.complete()),ap.clear()}function Bz(){ap.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(o7=!0)})}function Xue(){Bz(),Nz()}class $T{constructor(e,r,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ap.add(this),s7||(s7=!0,nn.read(Bz),nn.resolveKeyframes(Nz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let s=0;sr=>!!(nx(r)&&Qfe.test(r)&&r.startsWith(t)||e&&!Jfe(r)&&Object.prototype.hasOwnProperty.call(r,e)),Lz=(t,e,r)=>n=>{if(!nx(n))return n;const[i,s,o,a]=n.match(kT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ede=t=>ih(0,255,t),SA={...hy,transform:t=>Math.round(ede(t))},T0={test:qT("rgb","red"),parse:Lz("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+SA.transform(t)+", "+SA.transform(e)+", "+SA.transform(r)+", "+xb(wb.transform(n))+")"};function tde(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const a7={test:qT("#"),parse:tde,transform:T0.transform},cv={test:qT("hsl","hue"),parse:Lz("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+ql.transform(xb(e))+", "+ql.transform(xb(r))+", "+xb(wb.transform(n))+")"},Cs={test:t=>T0.test(t)||a7.test(t)||cv.test(t),parse:t=>T0.test(t)?T0.parse(t):cv.test(t)?cv.parse(t):a7.parse(t),transform:t=>nx(t)?t:t.hasOwnProperty("red")?T0.transform(t):cv.transform(t)};function rde(t){var e,r;return isNaN(t)&&nx(t)&&(((e=t.match(kT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Yfe))===null||r===void 0?void 0:r.length)||0)>0}const Fz="number",jz="color",nde="var",ide="var(",lN="${}",sde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sw(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(sde,c=>(Cs.test(c)?(n.color.push(s),i.push(jz),r.push(Cs.parse(c))):c.startsWith(ide)?(n.var.push(s),i.push(nde),r.push(c)):(n.number.push(s),i.push(Fz),r.push(parseFloat(c))),++s,lN)).split(lN);return{values:r,split:a,indexes:n,types:i}}function Uz(t){return sw(t).values}function $z(t){const{split:e,types:r}=sw(t),n=e.length;return i=>{let s="";for(let o=0;otypeof t=="number"?0:t;function ade(t){const e=Uz(t);return $z(t)(e.map(ode))}const sh={test:rde,parse:Uz,createTransformer:$z,getAnimatableNone:ade},cde=new Set(["brightness","contrast","saturate","opacity"]);function lde(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(kT)||[];if(!n)return t;const i=r.replace(n,"");let s=cde.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const fde=/\b([a-z-]*)\(.*?\)/gu,c7={...sh,getAnimatableNone:t=>{const e=t.match(fde);return e?e.map(lde).join(" "):t}},ude={...MT,color:Cs,backgroundColor:Cs,outlineColor:Cs,fill:Cs,stroke:Cs,borderColor:Cs,borderTopColor:Cs,borderRightColor:Cs,borderBottomColor:Cs,borderLeftColor:Cs,filter:c7,WebkitFilter:c7},VT=t=>ude[t];function qz(t,e){let r=VT(t);return r!==c7&&(r=sh),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const dde=new Set(["auto","none","0"]);function hde(t,e,r){let n=0,i;for(;n{r.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function zz(t){let e;return()=>(e===void 0&&(e=t()),e)}let Z6;function pde(){Z6=void 0}const au={now:()=>(Z6===void 0&&au.set(Ji.isProcessing||Mfe.useManualTiming?Ji.timestamp:performance.now()),Z6),set:t=>{Z6=t,queueMicrotask(pde)}},fN=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(sh.test(t)||t==="0")&&!t.startsWith("url("));function vde(t){const e=t[0];if(t.length===1)return!0;for(let r=0;ryde?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xue(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=au.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!gde(e,n,i,s))if(o)this.options.duration=0;else{c==null||c(W4(e,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(e,r);f!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...f},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function Gz(t,e){return e?t*(1e3/e):0}const mde=5;function Wz(t,e,r){const n=Math.max(e-mde,0);return Gz(r-t(n),e-n)}const _A=.001,bde=.01,wde=10,xde=.05,Ede=1;function Cde({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=ih(xde,Ede,o),t=ih(bde,wde,ou(t)),o<1?(i=l=>{const f=l*o,u=f*t,p=f-r,g=l7(l,o),y=Math.exp(-u);return _A-p/g*y},s=l=>{const u=l*o*t,p=u*r+r,g=Math.pow(o,2)*Math.pow(l,2)*t,y=Math.exp(-u),b=l7(Math.pow(l,2),o);return(-i(l)+_A>0?-1:1)*((p-g)*y)/b}):(i=l=>{const f=Math.exp(-l*t),u=(l-r)*t+1;return-_A+f*u},s=l=>{const f=Math.exp(-l*t),u=(r-l)*(t*t);return f*u});const a=5/t,c=Sde(i,s,a);if(t=su(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const Ade=12;function Sde(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Tde(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!uN(t,Ide)&&uN(t,_de)){const r=Cde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Kz({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:c,mass:l,duration:f,velocity:u,isResolvedFromDuration:p}=Tde({...n,velocity:-ou(n.velocity||0)}),g=u||0,y=c/(2*Math.sqrt(a*l)),b=s-i,I=ou(Math.sqrt(a/l)),C=Math.abs(b)<5;r||(r=C?.01:2),e||(e=C?.005:.5);let S;if(y<1){const O=l7(I,y);S=L=>{const F=Math.exp(-y*I*L);return s-F*((g+y*I*b)/O*Math.sin(O*L)+b*Math.cos(O*L))}}else if(y===1)S=O=>s-Math.exp(-I*O)*(b+(g+I*b)*O);else{const O=I*Math.sqrt(y*y-1);S=L=>{const F=Math.exp(-y*I*L),z=Math.min(O*L,300);return s-F*((g+y*I*b)*Math.sinh(z)+O*b*Math.cosh(z))/O}}return{calculatedDuration:p&&f||null,next:O=>{const L=S(O);if(p)o.done=O>=f;else{let F=0;y<1&&(F=O===0?su(g):Wz(S,O,L));const z=Math.abs(F)<=r,_=Math.abs(s-L)<=e;o.done=z&&_}return o.value=o.done?s:L,o}}}function dN({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:f}){const u=t[0],p={done:!1,value:u},g=$=>a!==void 0&&$c,y=$=>a===void 0?c:c===void 0||Math.abs(a-$)-b*Math.exp(-$/n),O=$=>C+S($),L=$=>{const ie=S($),ce=O($);p.done=Math.abs(ie)<=l,p.value=p.done?C:ce};let F,z;const _=$=>{g(p.value)&&(F=$,z=Kz({keyframes:[p.value,y(p.value)],velocity:Wz(O,$,p.value),damping:i,stiffness:s,restDelta:l,restSpeed:f}))};return _(0),{calculatedDuration:null,next:$=>{let ie=!1;return!z&&F===void 0&&(ie=!0,L($),_($)),F!==void 0&&$>=F?z.next($-F):(!ie&&L($),p)}}}const Yz=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Pde=1e-7,kde=12;function Mde(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=Yz(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Pde&&++aMde(s,0,1,t,r);return s=>s===0||s===1?s:Yz(i(s),e,n)}const Rde=sx(.42,0,1,1),Ode=sx(0,0,.58,1),Qz=sx(.42,0,.58,1),Dde=t=>Array.isArray(t)&&typeof t[0]!="number",Jz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Zz=t=>e=>1-t(1-e),zT=t=>1-Math.sin(Math.acos(t)),Xz=Zz(zT),Nde=Jz(zT),eH=sx(.33,1.53,.69,.99),HT=Zz(eH),Bde=Jz(HT),Lde=t=>(t*=2)<1?.5*HT(t):.5*(2-Math.pow(2,-10*(t-1))),hN={linear:Ts,easeIn:Rde,easeInOut:Qz,easeOut:Ode,circIn:zT,circInOut:Nde,circOut:Xz,backIn:HT,backInOut:Bde,backOut:eH,anticipate:Lde},pN=t=>{if(Array.isArray(t)){r7(t.length===4);const[e,r,n,i]=t;return sx(e,r,n,i)}else if(typeof t=="string")return r7(hN[t]!==void 0),hN[t];return t},ow=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},On=(t,e,r)=>t+(e-t)*r;function IA(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Fde({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=IA(c,a,t+1/3),s=IA(c,a,t),o=IA(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function h5(t,e){return r=>r>0?e:t}const TA=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},jde=[a7,T0,cv],Ude=t=>jde.find(e=>e.test(t));function vN(t){const e=Ude(t);if(!e)return!1;let r=e.parse(t);return e===cv&&(r=Fde(r)),r}const gN=(t,e)=>{const r=vN(t),n=vN(e);if(!r||!n)return h5(t,e);const i={...r};return s=>(i.red=TA(r.red,n.red,s),i.green=TA(r.green,n.green,s),i.blue=TA(r.blue,n.blue,s),i.alpha=On(r.alpha,n.alpha,s),T0.transform(i))},f7=new Set(["none","hidden"]);function $de(t,e){return f7.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function qde(t,e){return r=>On(t,e,r)}function GT(t){return typeof t=="number"?qde:typeof t=="string"?RT(t)?h5:Cs.test(t)?gN:Hde:Array.isArray(t)?tH:typeof t=="object"?Cs.test(t)?gN:Vde:h5}function tH(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>GT(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function zde(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=sh.createTransformer(e),n=sw(t),i=sw(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?f7.has(t)&&!i.values.length||f7.has(e)&&!n.values.length?$de(t,e):iu(tH(zde(n,i),i.values),r):h5(t,e)};function rH(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?On(t,e,r):GT(t)(t,e)}function Gde(t,e,r){const n=[],i=r||rH,s=t.length-1;for(let o=0;oe[0];if(s===2&&t[0]===t[1])return()=>e[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Gde(e,n,i),a=o.length,c=l=>{let f=0;if(a>1)for(;fc(ih(t[0],t[s-1],l)):c}function Kde(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=ow(0,e,n);t.push(On(r,1,i))}}function Yde(t){const e=[0];return Kde(e,t.length-1),e}function Qde(t,e){return t.map(r=>r*e)}function Jde(t,e){return t.map(()=>e||Qz).splice(0,t.length-1)}function p5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Dde(n)?n.map(pN):pN(n),s={done:!1,value:e[0]},o=Qde(r&&r.length===e.length?r:Yde(e),t),a=Wde(o,e,{ease:Array.isArray(i)?i:Jde(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const yN=2e4;function Zde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=yN?1/0:e}const Xde=t=>{const e=({timestamp:r})=>t(r);return{start:()=>nn.update(e,!0),stop:()=>pu(e),now:()=>Ji.isProcessing?Ji.timestamp:au.now()}},ehe={decay:dN,inertia:dN,tween:p5,keyframes:p5,spring:Kz},the=t=>t/100;class WT extends Hz{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:r,motionValue:n,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||$T,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,r,n,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=ehe[r]||p5;let c,l;a!==p5&&typeof e[0]!="number"&&(c=iu(the,rH(e[0],e[1])),e=[0,100]);const f=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=Zde(f));const{calculatedDuration:u}=f,p=u+i,g=p*(n+1)-i;return{generator:f,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:u,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:$}=this.options;return{done:!0,value:$[$.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:f,resolvedDuration:u}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:y,repeatDelay:b,onUpdate:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-f/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const C=this.currentTime-p*(this.speed>=0?1:-1),S=this.speed>=0?C<0:C>f;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let O=this.currentTime,L=s;if(g){const $=Math.min(this.currentTime,f)/u;let ie=Math.floor($),ce=$%1;!ce&&$>=1&&(ce=1),ce===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(ce=1-ce,b&&(ce-=b/u)):y==="mirror"&&(L=o)),O=ih(0,1,ce)*u}const F=S?{done:!1,value:c[0]}:L.next(O);a&&(F.value=a(F.value));let{done:z}=F;!S&&l!==null&&(z=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return _&&i!==void 0&&(F.value=W4(c,this.options,i)),I&&I(F.value),_&&this.finish(),F}get duration(){const{resolved:e}=this;return e?ou(e.calculatedDuration):0}get time(){return ou(this.currentTime)}set time(e){e=su(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=ou(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Xde,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const nH=t=>Array.isArray(t)&&typeof t[0]=="number";function iH(t){return!!(!t||typeof t=="string"&&t in KT||nH(t)||Array.isArray(t)&&t.every(iH))}const Hm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,KT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hm([0,.65,.55,1]),circOut:Hm([.55,0,1,.45]),backIn:Hm([.31,.01,.66,-.59]),backOut:Hm([.33,1.53,.69,.99])};function rhe(t){return sH(t)||KT.easeOut}function sH(t){if(t)return nH(t)?Hm(t):Array.isArray(t)?t.map(rhe):KT[t]}function nhe(t,e,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){const l={[e]:r};c&&(l.offset=c);const f=sH(a);return Array.isArray(f)&&(l.easing=f),t.animate(l,{delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const ihe=zz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),v5=10,she=2e4;function ohe(t){return t.type==="spring"||!iH(t.ease)}function ahe(t,e){const r=new WT({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(o,a),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){var n;let{duration:i=300,times:s,ease:o,type:a,motionValue:c,name:l,startTime:f}=this.options;if(!(!((n=c.owner)===null||n===void 0)&&n.current))return!1;if(ohe(this.options)){const{onComplete:p,onUpdate:g,motionValue:y,element:b,...I}=this.options,C=ahe(e,I);e=C.keyframes,e.length===1&&(e[1]=e[0]),i=C.duration,s=C.times,o=C.ease,a="keyframes"}const u=nhe(c.owner.current,l,e,{...this.options,duration:i,times:s,ease:o});return u.startTime=f??this.calcStartTime(),this.pendingTimeline?(u.timeline=this.pendingTimeline,this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;c.set(W4(e,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return ou(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return ou(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=su(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return Ts;const{animation:n}=r;n.timeline=e,n.onfinish=null}return Ts}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:s,ease:o,times:a}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:f,onComplete:u,element:p,...g}=this.options,y=new WT({...g,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=su(this.time);l.setWithVelocity(y.sample(b-v5).value,y.sample(b).value,v5)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:s,damping:o,type:a}=e;return ihe()&&n&&xz.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}function che(t,e){let r;const n=()=>{const{currentTime:i}=e,o=(i===null?0:i.value)/100;r!==o&&t(o),r=o};return nn.update(n,!0),()=>pu(n)}const lhe=zz(()=>window.ScrollTimeline!==void 0);class fhe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,r){return Promise.all(this.animations).then(e).catch(r)}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(lhe()&&n.attachTimeline)n.attachTimeline(e);else return n.pause(),che(i=>{n.time=n.duration*i},e)});return()=>{r.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const YT=(t,e,r,n={},i,s,o)=>a=>{const c=UT(n,t)||{},l=c.delay||n.delay||0;let{elapsed:f=0}=n;f=f-su(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{a(),c.onComplete&&c.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:s?void 0:i};Vue(c)||(u={...u,...que(t,u)}),u.duration&&(u.duration=su(u.duration)),u.repeatDelay&&(u.repeatDelay=su(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=W4(u.keyframes,c);if(g!==void 0)return nn.update(()=>{u.onUpdate(g),u.onComplete()}),new fhe([])}return!s&&mN.supports(u)?new mN(u):new WT(u)};class QT{constructor(){this.subscriptions=[]}add(e){return V4(this.subscriptions,e),()=>z4(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class oH{constructor(e,r={}){this.version="11.3.31",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=au.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=au.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uhe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new QT);const n=this.events[e].add(r);return e==="change"?()=>{n(),nn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=au.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>bN)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,bN);return Gz(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function aw(t,e){return new oH(t,e)}function dhe(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,aw(r))}function hhe(t,e){const r=G4(t,e);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=mue(s[o]);dhe(t,o,a)}}function aH(t){return t.props[sz]}class phe extends oH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=Ez(e);if(!r)return;const n=this.counts.get(r)||0;this.counts.set(r,n+1),n===0&&(this.output.push(r),this.update());let i=!1;return()=>{if(i)return;i=!0;const s=this.counts.get(r)-1;this.counts.set(r,s),s===0&&(z4(this.output,r),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function vhe(t){return!!(_s(t)&&t.add)}function u7(t,e){var r;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(!n&&!(!((r=t.props.style)===null||r===void 0)&&r.willChange)&&(n=new phe("auto"),t.addValue("willChange",n)),vhe(n))return n.add(e)}function ghe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function cH(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;n&&(o=n);const l=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const u in c){const p=t.getValue(u,(s=t.latestValues[u])!==null&&s!==void 0?s:null),g=c[u];if(g===void 0||f&&ghe(f,u))continue;const y={delay:r,...UT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=aH(t);if(C){const S=window.MotionHandoffAnimation(C,u,nn);S!==null&&(y.startTime=S,b=!0)}}p.start(YT(u,p,g,t.shouldReduceMotion&&Ch.has(u)?{type:!1}:y,t,b,u7(t,u)));const I=p.animation;I&&l.push(I)}return a&&Promise.all(l).then(()=>{nn.update(()=>{a&&hhe(t,a)})}),l}function d7(t,e,r={}){var n;const i=G4(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>Promise.all(cH(t,i,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=s;return yhe(t,e,f+l,u,p,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,f]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>f())}else return Promise.all([o(),a(r.delay)])}function yhe(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(mhe).forEach((l,f)=>{l.notify("AnimationStart",e),o.push(d7(l,e,{...s,delay:r+c(f)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function mhe(t,e){return t.sortNodePosition(e)}function bhe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>d7(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=d7(t,e,r);else{const i=typeof e=="function"?G4(t,e,r.custom):e;n=Promise.all(cH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const whe=[..._T].reverse(),xhe=_T.length;function Ehe(t){return e=>Promise.all(e.map(({animation:r,options:n})=>bhe(t,r,n)))}function Che(t){let e=Ehe(t),r=wN(),n=!0;const i=c=>(l,f)=>{var u;const p=G4(t,f,c==="exit"?(u=t.presenceContext)===null||u===void 0?void 0:u.custom:void 0);if(p){const{transition:g,transitionEnd:y,...b}=p;l={...l,...b,...y}}return l};function s(c){e=c(t)}function o(c){const l=t.getProps(),f=t.getVariantContext(!0)||{},u=[],p=new Set;let g={},y=1/0;for(let I=0;Iy&&L,ie=!1;const ce=Array.isArray(O)?O:[O];let K=ce.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:P={}}=S,M={...P,...K},v=m=>{$=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const R=t.getValue(m);R&&(R.liveStyle=!1)};for(const m in M){const R=K[m],B=P[m];if(g.hasOwnProperty(m))continue;let E=!1;n7(R)&&n7(B)?E=!Pz(R,B):E=R!==B,E?R!=null?v(m):p.add(m):R!==void 0&&p.has(m)?v(m):S.protectedKeys[m]=!0}S.prevProp=O,S.prevResolvedValues=K,S.isActive&&(g={...g,...K}),n&&t.blockInitialAnimation&&($=!1),$&&(!z||ie)&&u.push(...ce.map(m=>({animation:m,options:{type:C}})))}if(p.size){const I={};p.forEach(C=>{const S=t.getBaseTarget(C),O=t.getValue(C);O&&(O.liveStyle=!0),I[C]=S??null}),u.push({animation:I})}let b=!!u.length;return n&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(u):Promise.resolve()}function a(c,l){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(c,l)}),r[c].isActive=l;const u=o(c);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=wN(),n=!0}}}function Ahe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Pz(e,t):!1}function r0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wN(){return{animate:r0(!0),whileInView:r0(),whileHover:r0(),whileTap:r0(),whileDrag:r0(),whileFocus:r0(),exit:r0()}}class She extends Ah{constructor(e){super(e),e.animationState||(e.animationState=Che(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();iw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let _he=0;class Ihe extends Ah{constructor(){super(...arguments),this.id=_he++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const The={animation:{Feature:She},exit:{Feature:Ihe}},xN=(t,e)=>Math.abs(t-e);function Phe(t,e){const r=xN(t.x,e.x),n=xN(t.y,e.y);return Math.sqrt(r**2+n**2)}class lH{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=kA(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=Phe(u.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:y}=u,{timestamp:b}=Ji;this.history.push({...y,timestamp:b});const{onStart:I,onMove:C}=this.handlers;p||(I&&I(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=PA(p,this.transformPagePoint),nn.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const I=kA(u.type==="pointercancel"?this.lastMoveEventInfo:PA(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(u,I),y&&y(u,I)},!Az(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=H4(e),a=PA(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=Ji;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=r;f&&f(e,kA(a,this.history)),this.removeListeners=iu(nu(this.contextWindow,"pointermove",this.handlePointerMove),nu(this.contextWindow,"pointerup",this.handlePointerUp),nu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),pu(this.updatePoint)}}function PA(t,e){return e?{point:e(t.point)}:t}function EN(t,e){return{x:t.x-e.x,y:t.y-e.y}}function kA({point:t},e){return{point:t,delta:EN(t,fH(e)),offset:EN(t,khe(e)),velocity:Mhe(e,.1)}}function khe(t){return t[0]}function fH(t){return t[t.length-1]}function Mhe(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=fH(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>su(e)));)r--;if(!n)return{x:0,y:0};const s=ou(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const uH=1e-4,Rhe=1-uH,Ohe=1+uH,dH=.01,Dhe=0-dH,Nhe=0+dH;function pa(t){return t.max-t.min}function Bhe(t,e,r){return Math.abs(t-e)<=r}function CN(t,e,r,n=.5){t.origin=n,t.originPoint=On(e.min,e.max,t.origin),t.scale=pa(r)/pa(e),t.translate=On(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Rhe&&t.scale<=Ohe||isNaN(t.scale))&&(t.scale=1),(t.translate>=Dhe&&t.translate<=Nhe||isNaN(t.translate))&&(t.translate=0)}function Eb(t,e,r,n){CN(t.x,e.x,r.x,n?n.originX:void 0),CN(t.y,e.y,r.y,n?n.originY:void 0)}function AN(t,e,r){t.min=r.min+e.min,t.max=t.min+pa(e)}function Lhe(t,e,r){AN(t.x,e.x,r.x),AN(t.y,e.y,r.y)}function SN(t,e,r){t.min=e.min-r.min,t.max=t.min+pa(e)}function Cb(t,e,r){SN(t.x,e.x,r.x),SN(t.y,e.y,r.y)}function Fhe(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?On(r,t,n.max):Math.min(t,r)),t}function _N(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function jhe(t,{top:e,left:r,bottom:n,right:i}){return{x:_N(t.x,r,i),y:_N(t.y,e,n)}}function IN(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=ow(e.min,e.max-n,t.min):n>i&&(r=ow(t.min,t.max-i,e.min)),ih(0,1,r)}function qhe(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const h7=.35;function Vhe(t=h7){return t===!1?t=0:t===!0&&(t=h7),{x:TN(t,"left","right"),y:TN(t,"top","bottom")}}function TN(t,e,r){return{min:PN(t,e),max:PN(t,r)}}function PN(t,e){return typeof t=="number"?t:t[e]||0}const kN=()=>({translate:0,scale:1,origin:0,originPoint:0}),lv=()=>({x:kN(),y:kN()}),MN=()=>({min:0,max:0}),ti=()=>({x:MN(),y:MN()});function Fa(t){return[t("x"),t("y")]}function hH({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function zhe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Hhe(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function MA(t){return t===void 0||t===1}function p7({scale:t,scaleX:e,scaleY:r}){return!MA(t)||!MA(e)||!MA(r)}function d0(t){return p7(t)||pH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pH(t){return RN(t.x)||RN(t.y)}function RN(t){return t&&t!=="0%"}function g5(t,e,r){const n=t-r,i=e*n;return r+i}function ON(t,e,r,n,i){return i!==void 0&&(t=g5(t,i,n)),g5(t,r,n)+e}function v7(t,e=0,r=1,n,i){t.min=ON(t.min,e,r,n,i),t.max=ON(t.max,e,r,n,i)}function vH(t,{x:e,y:r}){v7(t.x,e.translate,e.scale,e.originPoint),v7(t.y,r.translate,r.scale,r.originPoint)}const DN=.999999999999,NN=1.0000000000001;function Ghe(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;aDN&&(e.x=1),e.yDN&&(e.y=1)}function fv(t,e){t.min=t.min+e,t.max=t.max+e}function BN(t,e,r,n,i=.5){const s=On(t.min,t.max,i);v7(t,e,r,s,n)}function uv(t,e){BN(t.x,e.x,e.scaleX,e.scale,e.originX),BN(t.y,e.y,e.scaleY,e.scale,e.originY)}function gH(t,e){return hH(Hhe(t.getBoundingClientRect(),e))}function Whe(t,e,r){const n=gH(t,r),{scroll:i}=e;return i&&(fv(n.x,i.offset.x),fv(n.y,i.offset.y)),n}const yH=({current:t})=>t?t.ownerDocument.defaultView:null,Khe=new WeakMap;class Yhe{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ti(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(H4(f,"page").point)},s=(f,u)=>{var p;const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=_z(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fa(C=>{let S=this.getAxisMotionValue(C).get()||0;if(ql.test(S)){const{projection:O}=this.visualElement;if(O&&O.layout){const L=O.layout.layoutBox[C];L&&(S=pa(L)*(parseFloat(S)/100))}}this.originPoint[C]=S}),b&&nn.postRender(()=>b(f,u)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=u7(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},o=(f,u)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=u;if(g&&this.currentDirection===null){this.currentDirection=Qhe(I),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,I),this.updateAxis("y",u.point,I),this.visualElement.render(),b&&b(f,u)},a=(f,u)=>this.stop(f,u),c=()=>Fa(f=>{var u;return this.getAnimationState(f)==="paused"&&((u=this.getAxisMotionValue(f).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new lH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:yH(this.visualElement)})}stop(e,r){var n;(n=this.removeWillChange)===null||n===void 0||n.call(this);const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&nn.postRender(()=>o(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!e6(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Fhe(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;r&&av(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=jhe(i.layoutBox,r):this.constraints=!1,this.elastic=Vhe(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Fa(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=qhe(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!av(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Whe(n,i.root,this.visualElement.getTransformPagePoint());let o=Uhe(i.layout.layoutBox,s);if(r){const a=r(zhe(o));this.hasMutatedConstraints=!!a,a&&(o=hH(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Fa(f=>{if(!e6(f,r,this.currentDirection))return;let u=c&&c[f]||{};o&&(u={min:0,max:0});const p=i?200:1e6,g=i?40:1e7,y={type:"inertia",velocity:n?e[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(YT(e,n,0,r,this.visualElement,!1,u7(this.visualElement,e)))}stopAnimation(){Fa(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Fa(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Fa(r=>{const{drag:n}=this.getProps();if(!e6(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-On(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!av(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Fa(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=$he({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Fa(o=>{if(!e6(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(On(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;Khe.set(this.visualElement,this);const e=this.visualElement.current,r=nu(e,"pointerdown",c=>{const{drag:l,dragListener:f=!0}=this.getProps();l&&f&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();av(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),nn.read(n);const o=Zf(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Fa(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=c[f].translate,u.set(u.get()+c[f].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=h7,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function e6(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Qhe(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Jhe extends Ah{constructor(e){super(e),this.removeGroupControls=Ts,this.removeListeners=Ts,this.controls=new Yhe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ts}unmount(){this.removeGroupControls(),this.removeListeners()}}const LN=t=>(e,r)=>{t&&nn.postRender(()=>t(e,r))};class Zhe extends Ah{constructor(){super(...arguments),this.removePointerDownListener=Ts}onPointerDown(e){this.session=new lH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:LN(e),onStart:LN(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&nn.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=nu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Xhe(){const t=D.useContext(U4);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=D.useId();D.useEffect(()=>n(i),[]);const s=D.useCallback(()=>r&&r(i),[i,r]);return!e&&r?[!1,s]:[!0]}const X6={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function FN(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xm={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Yt.test(t))t=parseFloat(t);else return t;const r=FN(t,e.target.x),n=FN(t,e.target.y);return`${r}% ${n}%`}},e0e={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=sh.parse(t);if(i.length>5)return n;const s=sh.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,c=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=On(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class t0e extends D.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;Kfe(r0e),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),X6.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||nn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ST.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function mH(t){const[e,r]=Xhe(),n=D.useContext(TT);return W.jsx(t0e,{...t,layoutGroup:n,switchLayoutGroup:D.useContext(az),isPresent:e,safeToRemove:r})}const r0e={borderRadius:{...xm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xm,borderTopRightRadius:xm,borderBottomLeftRadius:xm,borderBottomRightRadius:xm,boxShadow:e0e},bH=["TopLeft","TopRight","BottomLeft","BottomRight"],n0e=bH.length,jN=t=>typeof t=="string"?parseFloat(t):t,UN=t=>typeof t=="number"||Yt.test(t);function i0e(t,e,r,n,i,s){i?(t.opacity=On(0,r.opacity!==void 0?r.opacity:1,s0e(n)),t.opacityExit=On(e.opacity!==void 0?e.opacity:1,0,o0e(n))):s&&(t.opacity=On(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(ow(t,e,n))}function qN(t,e){t.min=e.min,t.max=e.max}function Ma(t,e){qN(t.x,e.x),qN(t.y,e.y)}function VN(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function zN(t,e,r,n,i){return t-=e,t=g5(t,1/r,n),i!==void 0&&(t=g5(t,1/i,n)),t}function a0e(t,e=0,r=1,n=.5,i,s=t,o=t){if(ql.test(e)&&(e=parseFloat(e),e=On(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=On(s.min,s.max,n);t===s&&(a-=e),t.min=zN(t.min,e,r,a,i),t.max=zN(t.max,e,r,a,i)}function HN(t,e,[r,n,i],s,o){a0e(t,e[r],e[n],e[i],e.scale,s,o)}const c0e=["x","scaleX","originX"],l0e=["y","scaleY","originY"];function GN(t,e,r,n){HN(t.x,e,c0e,r?r.x:void 0,n?n.x:void 0),HN(t.y,e,l0e,r?r.y:void 0,n?n.y:void 0)}function WN(t){return t.translate===0&&t.scale===1}function xH(t){return WN(t.x)&&WN(t.y)}function KN(t,e){return t.min===e.min&&t.max===e.max}function f0e(t,e){return KN(t.x,e.x)&&KN(t.y,e.y)}function YN(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function EH(t,e){return YN(t.x,e.x)&&YN(t.y,e.y)}function QN(t){return pa(t.x)/pa(t.y)}function JN(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class u0e{constructor(){this.members=[]}add(e){V4(this.members,e),e.scheduleRender()}remove(e){if(z4(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d0e(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:l,rotate:f,rotateX:u,rotateY:p,skewX:g,skewY:y}=r;l&&(n=`perspective(${l}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),g&&(n+=`skewX(${g}deg) `),y&&(n+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}const h0e=(t,e)=>t.depth-e.depth;class p0e{constructor(){this.children=[],this.isDirty=!1}add(e){V4(this.children,e),this.isDirty=!0}remove(e){z4(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(h0e),this.isDirty=!1,this.children.forEach(e)}}function v0e(t,e){const r=au.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(pu(n),t(s-e))};return nn.read(n,!0),()=>pu(n)}function g0e(t){return t instanceof SVGElement&&t.tagName!=="svg"}function y0e(t,e,r){const n=_s(t)?t:aw(t);return n.start(YT("",n,e,r)),n.animation}const h0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Gm=typeof window<"u"&&window.MotionDebug!==void 0,RA=["","X","Y","Z"],m0e={visibility:"hidden"},ZN=1e3;let b0e=0;function OA(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function CH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=aH(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",nn,!(i||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&CH(n)}function AH({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=b0e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gm&&(h0.totalNodes=h0.resolvedTargetDeltas=h0.recalculatedProjection=0),this.nodes.forEach(E0e),this.nodes.forEach(I0e),this.nodes.forEach(T0e),this.nodes.forEach(C0e),Gm&&window.MotionDebug.record(h0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=v0e(p,250),X6.hasAnimatedSinceResize&&(X6.hasAnimatedSinceResize=!1,this.nodes.forEach(eB))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||O0e,{onLayoutAnimationStart:I,onLayoutAnimationComplete:C}=f.getProps(),S=!this.targetLayout||!EH(this.targetLayout,y)||g,O=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,O);const L={...UT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||eB(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(P0e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CH(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const F=L/1e3;tB(u.x,o.x,F),tB(u.y,o.y,F),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cb(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),M0e(this.relativeTarget,this.relativeTargetOrigin,p,F),O&&f0e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=ti()),Ma(O,this.relativeTarget)),b&&(this.animationValues=f,i0e(f,l,this.latestValues,F,S,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nn.update(()=>{X6.hasAnimatedSinceResize=!0,this.currentAnimation=y0e(0,ZN,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ZN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:f}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&SH(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||ti();const u=pa(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+u;const p=pa(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}Ma(a,c),uv(a,f),Eb(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new u0e),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&OA("z",o,l,this.animationValues);for(let f=0;f{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(XN),this.root.sharedNodes.clear()}}}function w0e(t){t.updateLayout()}function x0e(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?Fa(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=pa(p);p.min=n[u].min,p.max=p.min+g}):SH(s,r.layoutBox,n)&&Fa(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=pa(n[u]);p.max=p.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+g)});const a=lv();Eb(a,n,r.layoutBox);const c=lv();o?Eb(c,t.applyTransform(i,!0),r.measuredBox):Eb(c,n,r.layoutBox);const l=!xH(a);let f=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:g}=u;if(p&&g){const y=ti();Cb(y,r.layoutBox,p.layoutBox);const b=ti();Cb(b,n,g.layoutBox),EH(y,b)||(f=!0),u.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:f})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function E0e(t){Gm&&h0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function C0e(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function A0e(t){t.clearSnapshot()}function XN(t){t.clearMeasurements()}function S0e(t){t.isLayoutDirty=!1}function _0e(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function eB(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function I0e(t){t.resolveTargetDelta()}function T0e(t){t.calcProjection()}function P0e(t){t.resetSkewAndRotation()}function k0e(t){t.removeLeadSnapshot()}function tB(t,e,r){t.translate=On(e.translate,0,r),t.scale=On(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function rB(t,e,r,n){t.min=On(e.min,r.min,n),t.max=On(e.max,r.max,n)}function M0e(t,e,r,n){rB(t.x,e.x,r.x,n),rB(t.y,e.y,r.y,n)}function R0e(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const O0e={duration:.45,ease:[.4,0,.1,1]},nB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),iB=nB("applewebkit/")&&!nB("chrome/")?Math.round:Ts;function sB(t){t.min=iB(t.min),t.max=iB(t.max)}function D0e(t){sB(t.x),sB(t.y)}function SH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Bhe(QN(e),QN(r),.2)}function N0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const B0e=AH({attachResizeListener:(t,e)=>Zf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),DA={current:void 0},_H=AH({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!DA.current){const t=new B0e({});t.mount(window),t.setOptions({layoutScroll:!0}),DA.current=t}return DA.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),L0e={pan:{Feature:Zhe},drag:{Feature:Jhe,ProjectionNode:_H,MeasureLayout:mH}},g7={current:null},IH={current:!1};function F0e(){if(IH.current=!0,!!AT)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>g7.current=t.matches;t.addListener(e),e()}else g7.current=!1}function j0e(t,e,r){for(const n in e){const i=e[n],s=r[n];if(_s(i))t.addValue(n,i);else if(_s(s))t.addValue(n,aw(i,{owner:t}));else if(s!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,aw(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const oB=new WeakMap,U0e=[...Dz,Cs,sh],$0e=t=>U0e.find(Oz(t)),aB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],q0e=IT.length;class V0e{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$T,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,nn.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=q4(r),this.isVariantNode=lz(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const g=u[p];c[p]!==void 0&&_s(g)&&g.set(c[p],!1)}}mount(e){this.current=e,oB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),IH.current||F0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:g7.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){oB.delete(this.current),this.projection&&this.projection.unmount(),pu(this.notifyUpdate),pu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ch.has(e),i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&nn.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in $g){const r=$g[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ti()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=aw(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Mz(i)||kz(i))?i=parseFloat(i):!$0e(i)&&sh.test(r)&&(i=qz(e,r)),this.setBaseTarget(e,_s(i)?i.get():i)),_s(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=FT(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!_s(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new QT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class TH extends V0e{constructor(){super(...arguments),this.KeyframeResolver=Vz}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}}function z0e(t){return window.getComputedStyle(t)}class H0e extends TH{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=yz}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}else{const n=z0e(e),i=(hz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return gH(e,r)}build(e,r,n){OT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return LT(e,r,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;_s(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class G0e extends TH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ti}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Ch.has(r)){const n=VT(r);return n&&n.default||0}return r=mz.has(r)?r:$4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return wz(e,r,n)}build(e,r,n){NT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){bz(e,r,n,i)}mount(e){this.isSVGTag=BT(e.tagName),super.mount(e)}}const W0e=(t,e)=>PT(t)?new G0e(e):new H0e(e,{allowProjection:t!==D.Fragment}),K0e={layout:{ProjectionNode:_H,MeasureLayout:mH}},Y0e={...The,...Lue,...L0e,...K0e},cp=Gfe((t,e)=>Aue(t,e,Y0e,W0e));class Q0e extends D.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function J0e({children:t,isPresent:e}){const r=D.useId(),n=D.useRef(null),i=D.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=D.useContext(CT);return D.useInsertionEffect(()=>{const{width:o,height:a,top:c,left:l}=i.current;if(e||!n.current||!o||!a)return;n.current.dataset.motionPopId=r;const f=document.createElement("style");return s&&(f.nonce=s),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(` +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function vA(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function jS(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var ife=typeof WeakMap=="function"?WeakMap:Map;function _V(t,e,r){r=tu(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){r5||(r5=!0,YS=n),jS(t,e)},r}function IV(t,e,r){r=tu(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){jS(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){jS(t,e),typeof n!="function"&&(zd===null?zd=new Set([this]):zd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function ID(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new ife;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=mfe.bind(null,t,e,r),e.then(t,t))}function TD(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function PD(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=tu(-1,1),e.tag=2,Vd(r,e,1))),r.lanes|=1),t)}var sfe=_u.ReactCurrentOwner,ko=!1;function Js(t,e,r,n){e.child=t===null?rV(e,null,r,n):Fg(e,t.child,r,n)}function kD(t,e,r,n,i){r=r.render;var s=e.ref;return Sv(e,i),n=iT(t,e,r,n,s,i),r=sT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,du(t,e,i)):(Tn&&r&&GI(e),e.flags|=1,Js(t,e,n,i),e.child)}function MD(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!vT(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,TV(t,e,s,n,i)):(t=H6(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Gb,r(o,n)&&t.ref===e.ref)return du(t,e,i)}return e.flags|=1,t=Gd(s,n),t.ref=e.ref,t.return=e,e.child=t}function TV(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Gb(s,n)&&t.ref===e.ref)if(ko=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(ko=!0);else return e.lanes=t.lanes,du(t,e,i)}return US(t,e,r,n,i)}function PV(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},bn(av,Xo),Xo|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,bn(av,Xo),Xo|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,bn(av,Xo),Xo|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,bn(av,Xo),Xo|=n;return Js(t,e,i,r),e.child}function kV(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function US(t,e,r,n,i){var s=Ro(r)?mp:Ns.current;return s=Bg(e,s),Sv(e,i),r=iT(t,e,r,n,s,i),n=sT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,du(t,e,i)):(Tn&&n&&GI(e),e.flags|=1,Js(t,e,r,i),e.child)}function RD(t,e,r,n,i){if(Ro(r)){var s=!0;G3(e)}else s=!1;if(Sv(e,i),e.stateNode===null)q6(t,e),SV(e,r,n),FS(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=r.contextType;typeof l=="object"&&l!==null?l=Qa(l):(l=Ro(r)?mp:Ns.current,l=Bg(e,l));var f=r.getDerivedStateFromProps,u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&_D(e,o,n,l),od=!1;var p=e.memoizedState;o.state=p,J3(e,n,o,i),c=e.memoizedState,a!==n||p!==c||Mo.current||od?(typeof f=="function"&&(LS(e,r,f,n),c=e.memoizedState),(a=od||SD(e,r,a,n,p,c,l))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=l,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,iV(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:_c(e.type,a),o.props=l,u=e.pendingProps,p=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Qa(c):(c=Ro(r)?mp:Ns.current,c=Bg(e,c));var g=r.getDerivedStateFromProps;(f=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==c)&&_D(e,o,n,c),od=!1,p=e.memoizedState,o.state=p,J3(e,n,o,i);var y=e.memoizedState;a!==u||p!==y||Mo.current||od?(typeof g=="function"&&(LS(e,r,g,n),y=e.memoizedState),(l=od||SD(e,r,l,n,p,y,c)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,y,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=y),o.props=n,o.state=y,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return $S(t,e,r,n,s,i)}function $S(t,e,r,n,i,s){kV(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&yD(e,r,!1),du(t,e,s);n=e.stateNode,sfe.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Fg(e,t.child,null,s),e.child=Fg(e,null,a,s)):Js(t,e,a,s),e.memoizedState=n.state,i&&yD(e,r,!0),e.child}function MV(t){var e=t.stateNode;e.pendingContext?gD(t,e.pendingContext,e.pendingContext!==e.context):e.context&&gD(t,e.context,!1),eT(t,e.containerInfo)}function OD(t,e,r,n,i){return Lg(),KI(i),e.flags|=256,Js(t,e,r,n),e.child}var qS={dehydrated:null,treeContext:null,retryLane:0};function VS(t){return{baseLanes:t,cachePool:null,transitions:null}}function RV(t,e,r){var n=e.pendingProps,i=Rn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),bn(Rn,i&1),t===null)return NS(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=P4(o,n,0,null),t=op(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=VS(r),e.memoizedState=qS,t):cT(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return ofe(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=Gd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gd(a,s):(s=op(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?VS(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=qS,n}return s=t.child,t=s.sibling,n=Gd(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function cT(t,e){return e=P4({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function V2(t,e,r,n){return n!==null&&KI(n),Fg(e,t.child,null,r),t=cT(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ofe(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=vA(Error(Ze(422))),V2(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=P4({mode:"visible",children:n.children},i,0,null),s=op(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Fg(e,t.child,null,o),e.child.memoizedState=VS(o),e.memoizedState=qS,s);if(!(e.mode&1))return V2(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(Ze(419)),n=vA(s,n,void 0),V2(t,e,o,n)}if(a=(o&t.childLanes)!==0,ko||a){if(n=Ni,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,uu(t,i),$c(n,t,i,-1))}return pT(),n=vA(Error(Ze(421))),V2(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=bfe.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,na=qd(i.nextSibling),oa=e,Tn=!0,Bc=null,t!==null&&(qa[Va++]=Yf,qa[Va++]=Qf,qa[Va++]=bp,Yf=t.id,Qf=t.overflow,bp=e),e=cT(e,n.children),e.flags|=4096,e)}function DD(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),BS(t.return,e,r)}function gA(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function OV(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Js(t,e,n.children,r),n=Rn.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&DD(t,r,e);else if(t.tag===19)DD(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(bn(Rn,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Z3(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),gA(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Z3(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}gA(e,!0,r,null,s);break;case"together":gA(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function q6(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function du(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),xp|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Ze(153));if(e.child!==null){for(t=e.child,r=Gd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Gd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function afe(t,e,r){switch(e.tag){case 3:MV(e),Lg();break;case 5:sV(e);break;case 1:Ro(e.type)&&G3(e);break;case 4:eT(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;bn(Y3,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(bn(Rn,Rn.current&1),e.flags|=128,null):r&e.child.childLanes?RV(t,e,r):(bn(Rn,Rn.current&1),t=du(t,e,r),t!==null?t.sibling:null);bn(Rn,Rn.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return OV(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bn(Rn,Rn.current),n)break;return null;case 22:case 23:return e.lanes=0,PV(t,e,r)}return du(t,e,r)}var DV,zS,NV,BV;DV=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zS=function(){};NV=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,I0(Nl.current);var s=null;switch(r){case"input":i=dS(t,i),n=dS(t,n),s=[];break;case"select":i=Fn({},i,{value:void 0}),n=Fn({},n,{value:void 0}),s=[];break;case"textarea":i=vS(t,i),n=vS(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=z3)}yS(r,n);var o;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(jb.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(a=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(jb.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&En("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};BV=function(t,e,r,n){r!==n&&(e.flags|=4)};function mm(t,e){if(!Tn)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function bs(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function cfe(t,e,r){var n=e.pendingProps;switch(WI(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bs(e),null;case 1:return Ro(e.type)&&H3(),bs(e),null;case 3:return n=e.stateNode,jg(),Sn(Mo),Sn(Ns),rT(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&($2(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Bc!==null&&(ZS(Bc),Bc=null))),zS(t,e),bs(e),null;case 5:tT(e);var i=I0(Jb.current);if(r=e.type,t!==null&&e.stateNode!=null)NV(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(Ze(166));return bs(e),null}if(t=I0(Nl.current),$2(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Il]=e,n[Yb]=s,t=(e.mode&1)!==0,r){case"dialog":En("cancel",n),En("close",n);break;case"iframe":case"object":case"embed":En("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Il]=e,t[Yb]=n,DV(t,e,!1,!1),e.stateNode=t;e:{switch(o=mS(r,n),r){case"dialog":En("cancel",t),En("close",t),i=n;break;case"iframe":case"object":case"embed":En("load",t),i=n;break;case"video":case"audio":for(i=0;i$g&&(e.flags|=128,n=!0,mm(s,!1),e.lanes=4194304)}else{if(!n)if(t=Z3(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),mm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Tn)return bs(e),null}else 2*ii()-s.renderingStartTime>$g&&r!==1073741824&&(e.flags|=128,n=!0,mm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ii(),e.sibling=null,r=Rn.current,bn(Rn,n?r&1|2:r&1),e):(bs(e),null);case 22:case 23:return hT(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Xo&1073741824&&(bs(e),e.subtreeFlags&6&&(e.flags|=8192)):bs(e),null;case 24:return null;case 25:return null}throw Error(Ze(156,e.tag))}function lfe(t,e){switch(WI(e),e.tag){case 1:return Ro(e.type)&&H3(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return jg(),Sn(Mo),Sn(Ns),rT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return tT(e),null;case 13:if(Sn(Rn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ze(340));Lg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Rn),null;case 4:return jg(),null;case 10:return JI(e.type._context),null;case 22:case 23:return hT(),null;case 24:return null;default:return null}}var z2=!1,Is=!1,ffe=typeof WeakSet=="function"?WeakSet:Set,St=null;function ov(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Hn(t,e,n)}else r.current=null}function HS(t,e,r){try{r()}catch(n){Hn(t,e,n)}}var ND=!1;function ufe(t,e){if(TS=$3,t=$q(),HI(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,f=0,u=t,p=null;t:for(;;){for(var g;u!==r||i!==0&&u.nodeType!==3||(a=o+i),u!==s||n!==0&&u.nodeType!==3||(c=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)p=u,u=g;for(;;){if(u===t)break t;if(p===r&&++l===i&&(a=o),p===s&&++f===n&&(c=o),(g=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=g}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(PS={focusedElem:t,selectionRange:r},$3=!1,St=e;St!==null;)if(e=St,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,St=t;else for(;St!==null;){e=St;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,I=y.memoizedState,C=e.stateNode,S=C.getSnapshotBeforeUpdate(e.elementType===e.type?b:_c(e.type,b),I);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var O=e.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ze(163))}}catch(L){Hn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,St=t;break}St=e.return}return y=ND,ND=!1,y}function gb(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&HS(e,r,s)}i=i.next}while(i!==n)}}function I4(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function GS(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function LV(t){var e=t.alternate;e!==null&&(t.alternate=null,LV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Il],delete e[Yb],delete e[RS],delete e[Wle],delete e[Kle])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function FV(t){return t.tag===5||t.tag===3||t.tag===4}function BD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||FV(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function WS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=z3));else if(n!==4&&(t=t.child,t!==null))for(WS(t,e,r),t=t.sibling;t!==null;)WS(t,e,r),t=t.sibling}function KS(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(KS(t,e,r),t=t.sibling;t!==null;)KS(t,e,r),t=t.sibling}var Yi=null,Dc=!1;function Qu(t,e,r){for(r=r.child;r!==null;)jV(t,e,r),r=r.sibling}function jV(t,e,r){if(Dl&&typeof Dl.onCommitFiberUnmount=="function")try{Dl.onCommitFiberUnmount(b4,r)}catch{}switch(r.tag){case 5:Is||ov(r,e);case 6:var n=Yi,i=Dc;Yi=null,Qu(t,e,r),Yi=n,Dc=i,Yi!==null&&(Dc?(t=Yi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Yi.removeChild(r.stateNode));break;case 18:Yi!==null&&(Dc?(t=Yi,r=r.stateNode,t.nodeType===8?lA(t.parentNode,r):t.nodeType===1&&lA(t,r),zb(t)):lA(Yi,r.stateNode));break;case 4:n=Yi,i=Dc,Yi=r.stateNode.containerInfo,Dc=!0,Qu(t,e,r),Yi=n,Dc=i;break;case 0:case 11:case 14:case 15:if(!Is&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&HS(r,e,o),i=i.next}while(i!==n)}Qu(t,e,r);break;case 1:if(!Is&&(ov(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Hn(r,e,a)}Qu(t,e,r);break;case 21:Qu(t,e,r);break;case 22:r.mode&1?(Is=(n=Is)||r.memoizedState!==null,Qu(t,e,r),Is=n):Qu(t,e,r);break;default:Qu(t,e,r)}}function LD(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new ffe),e.forEach(function(n){var i=wfe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function vc(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=ii()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*hfe(n/1960))-n,10t?16:t,Od===null)var n=!1;else{if(t=Od,Od=null,n5=0,Fr&6)throw Error(Ze(331));var i=Fr;for(Fr|=4,St=t.current;St!==null;){var s=St,o=s.child;if(St.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cii()-uT?sp(t,0):fT|=r),Oo(t,e)}function WV(t,e){e===0&&(t.mode&1?(e=N2,N2<<=1,!(N2&130023424)&&(N2=4194304)):e=1);var r=to();t=uu(t,e),t!==null&&(Jw(t,e,r),Oo(t,r))}function bfe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),WV(t,r)}function wfe(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Ze(314))}n!==null&&n.delete(e),WV(t,r)}var KV;KV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Mo.current)ko=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return ko=!1,afe(t,e,r);ko=!!(t.flags&131072)}else ko=!1,Tn&&e.flags&1048576&&Zq(e,K3,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;q6(t,e),t=e.pendingProps;var i=Bg(e,Ns.current);Sv(e,r),i=iT(null,e,n,t,i,r);var s=sT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ro(n)?(s=!0,G3(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,XI(e),i.updater=_4,e.stateNode=i,i._reactInternals=e,FS(e,n,t,r),e=$S(null,e,n,!0,s,r)):(e.tag=0,Tn&&s&&GI(e),Js(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(q6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Efe(n),t=_c(n,t),i){case 0:e=US(null,e,n,t,r);break e;case 1:e=RD(null,e,n,t,r);break e;case 11:e=kD(null,e,n,t,r);break e;case 14:e=MD(null,e,n,_c(n.type,t),r);break e}throw Error(Ze(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),US(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),RD(t,e,n,i,r);case 3:e:{if(MV(e),t===null)throw Error(Ze(387));n=e.pendingProps,s=e.memoizedState,i=s.element,iV(t,e),J3(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ug(Error(Ze(423)),e),e=OD(t,e,n,r,i);break e}else if(n!==i){i=Ug(Error(Ze(424)),e),e=OD(t,e,n,r,i);break e}else for(na=qd(e.stateNode.containerInfo.firstChild),oa=e,Tn=!0,Bc=null,r=rV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Lg(),n===i){e=du(t,e,r);break e}Js(t,e,n,r)}e=e.child}return e;case 5:return sV(e),t===null&&NS(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,kS(n,i)?o=null:s!==null&&kS(n,s)&&(e.flags|=32),kV(t,e),Js(t,e,o,r),e.child;case 6:return t===null&&NS(e),null;case 13:return RV(t,e,r);case 4:return eT(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Fg(e,null,n,r):Js(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),kD(t,e,n,i,r);case 7:return Js(t,e,e.pendingProps,r),e.child;case 8:return Js(t,e,e.pendingProps.children,r),e.child;case 12:return Js(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,bn(Y3,n._currentValue),n._currentValue=o,s!==null)if(Vc(s.value,o)){if(s.children===i.children&&!Mo.current){e=du(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=tu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var f=l.pending;f===null?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),BS(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ze(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),BS(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Js(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Sv(e,r),i=Qa(i),n=n(i),e.flags|=1,Js(t,e,n,r),e.child;case 14:return n=e.type,i=_c(n,e.pendingProps),i=_c(n.type,i),MD(t,e,n,i,r);case 15:return TV(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:_c(n,i),q6(t,e),e.tag=1,Ro(n)?(t=!0,G3(e)):t=!1,Sv(e,r),SV(e,n,i),FS(e,n,i,r),$S(null,e,n,!0,t,r);case 19:return OV(t,e,r);case 22:return PV(t,e,r)}throw Error(Ze(156,e.tag))};function YV(t,e){return Eq(t,e)}function xfe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ha(t,e,r,n){return new xfe(t,e,r,n)}function vT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Efe(t){if(typeof t=="function")return vT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===DI)return 11;if(t===NI)return 14}return 2}function Gd(t,e){var r=t.alternate;return r===null?(r=Ha(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function H6(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")vT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case J1:return op(r.children,i,s,e);case OI:o=8,i|=8;break;case cS:return t=Ha(12,r,e,i|2),t.elementType=cS,t.lanes=s,t;case lS:return t=Ha(13,r,e,i),t.elementType=lS,t.lanes=s,t;case fS:return t=Ha(19,r,e,i),t.elementType=fS,t.lanes=s,t;case sq:return P4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case nq:o=10;break e;case iq:o=9;break e;case DI:o=11;break e;case NI:o=14;break e;case sd:o=16,n=null;break e}throw Error(Ze(130,t==null?t:typeof t,""))}return e=Ha(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function op(t,e,r,n){return t=Ha(7,t,n,e),t.lanes=r,t}function P4(t,e,r,n){return t=Ha(22,t,n,e),t.elementType=sq,t.lanes=r,t.stateNode={isHidden:!1},t}function yA(t,e,r){return t=Ha(6,t,null,e),t.lanes=r,t}function mA(t,e,r){return e=Ha(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Cfe(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ZC(0),this.expirationTimes=ZC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ZC(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gT(t,e,r,n,i,s,o,a,c){return t=new Cfe(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ha(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},XI(s),t}function Afe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(XV)}catch(t){console.error(t)}}XV(),X$.exports=da;var wh=X$.exports;const Pfe=Su(wh),wT=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),D4=D.createContext({}),N4=D.createContext(null),xT=typeof window<"u",ez=xT?D.useLayoutEffect:D.useEffect,tz=D.createContext({strict:!1}),B4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kfe="framerAppearId",rz="data-"+B4(kfe),Mfe={skipAnimations:!1,useManualTiming:!1};function Rfe(t){let e=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,f=!1,u=!1)=>{const g=u&&n?e:r;return f&&s.add(l),g.has(l)||g.add(l),l},cancel:l=>{r.delete(l),s.delete(l)},process:l=>{if(o=l,n){i=!0;return}n=!0,[e,r]=[r,e],r.clear(),e.forEach(a),n=!1,i&&(i=!1,c.process(l))}};return c}const W2=["read","resolveKeyframes","update","preRender","render","postRender"],Ofe=40;function nz(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=W2.reduce((C,S)=>(C[S]=Rfe(s),C),{}),{read:a,resolveKeyframes:c,update:l,preRender:f,render:u,postRender:p}=o,g=()=>{const C=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(C-i.timestamp,Ofe),1),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),f.process(i),u.process(i),p.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(g))},y=()=>{r=!0,n=!0,i.isProcessing||t(g)};return{schedule:W2.reduce((C,S)=>{const O=o[S];return C[S]=(L,F=!1,z=!1)=>(r||y(),O.schedule(L,F,z)),C},{}),cancel:C=>{for(let S=0;S{u&&u.update(r,c)});const g=r[rz],y=D.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return ez(()=>{u&&(u.updateFeatures(),ET.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),D.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,HD||(HD=!0,queueMicrotask(Nfe)))}),u}function Nfe(){window.MotionHandoffIsComplete=!0}function Bfe(t,e,r,n){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:sz(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&cv(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:l})}function sz(t){if(t)return t.options.allowProjection!==!1?t.projection:sz(t.parent)}function Lfe(t,e,r){return D.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):cv(r)&&(r.current=n))},[e])}function rw(t){return typeof t=="string"||Array.isArray(t)}function nw(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const CT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],AT=["initial",...CT];function L4(t){return nw(t.animate)||AT.some(e=>rw(t[e]))}function oz(t){return!!(L4(t)||t.variants)}function Ffe(t,e){if(L4(t)){const{initial:r,animate:n}=t;return{initial:r===!1||rw(r)?r:void 0,animate:rw(n)?n:void 0}}return t.inherit!==!1?e:{}}function jfe(t){const{initial:e,animate:r}=Ffe(t,D.useContext(D4));return D.useMemo(()=>({initial:e,animate:r}),[GD(e),GD(r)])}function GD(t){return Array.isArray(t)?t.join(" "):t}const WD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},qg={};for(const t in WD)qg[t]={isEnabled:e=>WD[t].some(r=>!!e[r])};function Ufe(t){for(const e in t)qg[e]={...qg[e],...t[e]}}const ST=D.createContext({}),$fe=Symbol.for("motionComponentSymbol"),ks=t=>t;let XS=ks;function qfe({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&Ufe(t);function s(a,c){let l;const f={...D.useContext(wT),...a,layoutId:Vfe(a)},{isStatic:u}=f,p=jfe(a),g=n(a,u);if(!u&&xT){zfe();const y=Hfe(f);l=y.MeasureLayout,p.visualElement=Dfe(i,g,f,e,y.ProjectionNode)}return W.jsxs(D4.Provider,{value:p,children:[l&&p.visualElement?W.jsx(l,{visualElement:p.visualElement,...f}):null,r(i,a,Lfe(g,p.visualElement,c),g,u,p.visualElement)]})}const o=D.forwardRef(s);return o[$fe]=i,o}function Vfe({layoutId:t}){const e=D.useContext(ST).id;return e&&t!==void 0?e+"-"+t:t}function zfe(t,e){D.useContext(tz).strict}function Hfe(t){const{drag:e,layout:r}=qg;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function Gfe(t){function e(n,i={}){return qfe(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const Wfe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _T(t){return typeof t!="string"||t.includes("-")?!1:!!(Wfe.indexOf(t)>-1||/[A-Z]/u.test(t))}const o5={};function Kfe(t){Object.assign(o5,t)}const tx=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xh=new Set(tx);function az(t,{layout:e,layoutId:r}){return xh.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!o5[t]||t==="opacity")}const Ts=t=>!!(t&&t.getVelocity),cz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,rh=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},bb={...py,transform:t=>rh(0,1,t)},K2={...py,default:1},wb=t=>Math.round(t*1e5)/1e5,IT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Yfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Qfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function rx(t){return typeof t=="string"}function Jfe(t){return t==null}const nx=t=>({test:e=>rx(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),rd=nx("deg"),Bl=nx("%"),Qt=nx("px"),Zfe=nx("vh"),Xfe=nx("vw"),KD={...Bl,parse:t=>Bl.parse(t)/100,transform:t=>Bl.transform(t*100)},YD={...py,transform:Math.round},TT={borderWidth:Qt,borderTopWidth:Qt,borderRightWidth:Qt,borderBottomWidth:Qt,borderLeftWidth:Qt,borderRadius:Qt,radius:Qt,borderTopLeftRadius:Qt,borderTopRightRadius:Qt,borderBottomRightRadius:Qt,borderBottomLeftRadius:Qt,width:Qt,maxWidth:Qt,height:Qt,maxHeight:Qt,size:Qt,top:Qt,right:Qt,bottom:Qt,left:Qt,padding:Qt,paddingTop:Qt,paddingRight:Qt,paddingBottom:Qt,paddingLeft:Qt,margin:Qt,marginTop:Qt,marginRight:Qt,marginBottom:Qt,marginLeft:Qt,rotate:rd,rotateX:rd,rotateY:rd,rotateZ:rd,scale:K2,scaleX:K2,scaleY:K2,scaleZ:K2,skew:rd,skewX:rd,skewY:rd,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:bb,originX:KD,originY:KD,originZ:Qt,zIndex:YD,backgroundPositionX:Qt,backgroundPositionY:Qt,fillOpacity:bb,strokeOpacity:bb,numOctaves:YD},eue={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tue=tx.length;function rue(t,e,r){let n="",i=!0;for(let s=0;se=>typeof e=="string"&&e.startsWith(t),fz=lz("--"),nue=lz("var(--"),PT=t=>nue(t)?iue.test(t.split("/*")[0].trim()):!1,iue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kT(t,e,r){const{style:n,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(xh.has(c)){o=!0;continue}else if(fz(c)){i[c]=l;continue}else{const f=cz(l,TT[c]);c.startsWith("origin")?(a=!0,s[c]=f):n[c]=f}}if(e.transform||(o||r?n.transform=rue(e,t.transform,r):n.transform&&(n.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:f=0}=s;n.transformOrigin=`${c} ${l} ${f}`}}const MT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uz(t,e,r){for(const n in e)!Ts(e[n])&&!az(n,r)&&(t[n]=e[n])}function sue({transformTemplate:t},e){return D.useMemo(()=>{const r=MT();return kT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function oue(t,e){const r=t.style||{},n={};return uz(n,r,t),Object.assign(n,sue(t,e)),n}function aue(t,e){const r={},n=oue(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const cue=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function a5(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||cue.has(t)}let dz=t=>!a5(t);function lue(t){t&&(dz=e=>e.startsWith("on")?!a5(e):t(e))}try{lue(require("@emotion/is-prop-valid").default)}catch{}function fue(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(dz(i)||r===!0&&a5(i)||!e&&!a5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function QD(t,e,r){return typeof t=="string"?t:Qt.transform(e+r*t)}function uue(t,e,r){const n=QD(e,t.x,t.width),i=QD(r,t.y,t.height);return`${n} ${i}`}const due={offset:"stroke-dashoffset",array:"stroke-dasharray"},hue={offset:"strokeDashoffset",array:"strokeDasharray"};function pue(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?due:hue;t[s.offset]=Qt.transform(-n);const o=Qt.transform(e),a=Qt.transform(r);t[s.array]=`${o} ${a}`}function RT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(kT(t,l,u),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g,dimensions:y}=t;p.transform&&(y&&(g.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||g.transform)&&(g.transformOrigin=uue(y,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&pue(p,o,a,c,!1)}const hz=()=>({...MT(),attrs:{}}),OT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vue(t,e,r,n){const i=D.useMemo(()=>{const s=hz();return RT(s,e,OT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};uz(s,t.style,t),i.style={...s,...i.style}}return i}function gue(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(_T(r)?vue:aue)(n,s,o,r),l=fue(n,typeof r=="string",t),f=r!==D.Fragment?{...l,...c,ref:i}:{},{children:u}=n,p=D.useMemo(()=>Ts(u)?u.get():u,[u]);return D.createElement(r,{...f,children:p})}}function pz(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const vz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function gz(t,e,r,n){pz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vz.has(i)?i:B4(i),e.attrs[i])}function DT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(Ts(i[o])||e.style&&Ts(e.style[o])||az(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=i[o]);return r&&i&&typeof i.willChange=="string"&&(r.applyWillChange=!1),s}function yz(t,e,r){const n=DT(t,e,r);for(const i in t)if(Ts(t[i])||Ts(e[i])){const s=tx.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=t[i]}return n}function JD(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function NT(t,e,r,n){if(typeof e=="function"){const[i,s]=JD(n);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=JD(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function BT(t){const e=D.useRef(null);return e.current===null&&(e.current=t()),e.current}const e7=t=>Array.isArray(t),yue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),mue=t=>e7(t)?t[t.length-1]||0:t;function G6(t){const e=Ts(t)?t.get():t;return yue(e)?e.toValue():e}const mz=new Set(["opacity","clipPath","filter","transform"]);function bz(t){if(xh.has(t))return"transform";if(mz.has(t))return B4(t)}function F4(t,e){t.indexOf(e)===-1&&t.push(e)}function j4(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}function bue({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:r,onMount:n},i,s,o,a){const c={latestValues:xue(i,s,o,a?!1:t,e),renderState:r()};return n&&(c.mount=l=>n(i,l,c)),c}const wz=t=>(e,r)=>{const n=D.useContext(D4),i=D.useContext(N4),s=()=>bue(t,e,n,i,r);return r?s():BT(s)};function wue(t,e){const r=bz(e);r&&F4(t,r)}function ZD(t,e,r){const n=Array.isArray(e)?e:[e];for(let i=0;i{for(const S in I){let O=I[S];if(Array.isArray(O)){const L=y?O.length-1:0;O=O[L]}O!==null&&(o[S]=O)}for(const S in C)o[S]=C[S]}),c&&(u&&f!==!1&&!nw(u)&&ZD(t,u,I=>{for(const C in I)wue(a,C)}),a.length&&(o.willChange=a.join(","))),o}const{schedule:on,cancel:hu,state:Qi,steps:bA}=nz(typeof requestAnimationFrame<"u"?requestAnimationFrame:ks,!0),Eue={useVisualState:wz({scrapeMotionValuesFromProps:yz,createRenderState:hz,onMount:(t,e,{renderState:r,latestValues:n})=>{on.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),on.render(()=>{RT(r,n,OT(e.tagName),t.transformTemplate),gz(e,r)})}})},Cue={useVisualState:wz({applyWillChange:!0,scrapeMotionValuesFromProps:DT,createRenderState:MT})};function Aue(t,{forwardMotionProps:e=!1},r,n){return{..._T(t)?Eue:Cue,preloadedFeatures:r,useRender:gue(e),createVisualElement:n,Component:t}}function Jf(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const xz=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function U4(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Sue=t=>e=>xz(e)&&t(e,U4(e));function ru(t,e,r,n){return Jf(t,e,Sue(r),n)}const _ue=(t,e)=>r=>e(t(r)),nu=(...t)=>t.reduce(_ue);function Ez(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const XD=Ez("dragHorizontal"),eN=Ez("dragVertical");function Cz(t){let e=!1;if(t==="y")e=eN();else if(t==="x")e=XD();else{const r=XD(),n=eN();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Az(){const t=Cz(!0);return t?(t(),!1):!0}class Eh{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tN(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||Az())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const c=a[n];c&&on.postRender(()=>c(s,o))};return ru(t.current,r,i,{passive:!t.getProps()[n]})}class Iue extends Eh{mount(){this.unmount=nu(tN(this.node,!0),tN(this.node,!1))}unmount(){}}class Tue extends Eh{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=nu(Jf(this.node.current,"focus",()=>this.onFocus()),Jf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Sz=(t,e)=>e?t===e?!0:Sz(t,e.parentElement):!1;function wA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,U4(r))}class Pue extends Eh{constructor(){super(...arguments),this.removeStartListeners=ks,this.removeEndListeners=ks,this.removeAccessibleListeners=ks,this.startPointerPress=(e,r)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),s=ru(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:f,globalTapTarget:u}=this.node.getProps(),p=!u&&!Sz(this.node.current,a.target)?f:l;p&&on.update(()=>p(a,c))},{passive:!(n.onTap||n.onPointerUp)}),o=ru(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=nu(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||wA("up",(c,l)=>{const{onTap:f}=this.node.getProps();f&&on.postRender(()=>f(c,l))})};this.removeEndListeners(),this.removeEndListeners=Jf(this.node.current,"keyup",o),wA("down",(a,c)=>{this.startPress(a,c)})},r=Jf(this.node.current,"keydown",e),n=()=>{this.isPressing&&wA("cancel",(s,o)=>this.cancelPress(s,o))},i=Jf(this.node.current,"blur",n);this.removeAccessibleListeners=nu(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&on.postRender(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Az()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&on.postRender(()=>n(e,r))}mount(){const e=this.node.getProps(),r=ru(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Jf(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=nu(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const t7=new WeakMap,xA=new WeakMap,kue=t=>{const e=t7.get(t.target);e&&e(t)},Mue=t=>{t.forEach(kue)};function Rue({root:t,...e}){const r=t||document;xA.has(r)||xA.set(r,{});const n=xA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Mue,{root:t,...e})),n[i]}function Oue(t,e,r){const n=Rue(e);return t7.set(t,r),n.observe(t),()=>{t7.delete(t),n.unobserve(t)}}const Due={some:0,all:1};class Nue extends Eh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Due[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=l?f:u;p&&p(c)};return Oue(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Bue(e,r))&&this.startObserver()}unmount(){}}function Bue({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Lue={inView:{Feature:Nue},tap:{Feature:Pue},focus:{Feature:Tue},hover:{Feature:Iue}};function _z(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;nt*1e3,su=t=>t/1e3,Fue={type:"spring",stiffness:500,damping:25,restSpeed:10},jue=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Uue={type:"keyframes",duration:.8},$ue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},que=(t,{keyframes:e})=>e.length>2?Uue:xh.has(t)?t.startsWith("scale")?jue(e[1]):Fue:$ue;function Vue({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...f}){return!!Object.keys(f).length}function LT(t,e){return t[e]||t.default||t}const zue=t=>t!==null;function q4(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(zue),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const Iz=t=>/^0[^.\s]+$/u.test(t);function Hue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Iz(t):!0}const Tz=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Gue=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wue(t){const e=Gue.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function Pz(t,e,r=1){const[n,i]=Wue(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return Tz(o)?parseFloat(o):o}return PT(i)?Pz(i,e,r+1):i}const Kue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rN=t=>t===py||t===Qt,nN=(t,e)=>parseFloat(t.split(", ")[e]),iN=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return nN(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?nN(s[1],t):0}},Yue=new Set(["x","y","z"]),Que=tx.filter(t=>!Yue.has(t));function Jue(t){const e=[];return Que.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const Vg={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:iN(4,13),y:iN(5,14)};Vg.translateX=Vg.x;Vg.translateY=Vg.y;const kz=t=>e=>e.test(t),Zue={test:t=>t==="auto",parse:t=>t},Mz=[py,Qt,Bl,rd,Xfe,Zfe,Zue],sN=t=>Mz.find(kz(t)),ap=new Set;let r7=!1,n7=!1;function Rz(){if(n7){const t=Array.from(ap).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Jue(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}n7=!1,r7=!1,ap.forEach(t=>t.complete()),ap.clear()}function Oz(){ap.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(n7=!0)})}function Xue(){Oz(),Rz()}class FT{constructor(e,r,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ap.add(this),r7||(r7=!0,on.read(Oz),on.resolveKeyframes(Rz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let s=0;sr=>!!(rx(r)&&Qfe.test(r)&&r.startsWith(t)||e&&!Jfe(r)&&Object.prototype.hasOwnProperty.call(r,e)),Dz=(t,e,r)=>n=>{if(!rx(n))return n;const[i,s,o,a]=n.match(IT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ede=t=>rh(0,255,t),EA={...py,transform:t=>Math.round(ede(t))},T0={test:jT("rgb","red"),parse:Dz("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+EA.transform(t)+", "+EA.transform(e)+", "+EA.transform(r)+", "+wb(bb.transform(n))+")"};function tde(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const i7={test:jT("#"),parse:tde,transform:T0.transform},lv={test:jT("hsl","hue"),parse:Dz("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Bl.transform(wb(e))+", "+Bl.transform(wb(r))+", "+wb(bb.transform(n))+")"},Ss={test:t=>T0.test(t)||i7.test(t)||lv.test(t),parse:t=>T0.test(t)?T0.parse(t):lv.test(t)?lv.parse(t):i7.parse(t),transform:t=>rx(t)?t:t.hasOwnProperty("red")?T0.transform(t):lv.transform(t)};function rde(t){var e,r;return isNaN(t)&&rx(t)&&(((e=t.match(IT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Yfe))===null||r===void 0?void 0:r.length)||0)>0}const Nz="number",Bz="color",nde="var",ide="var(",oN="${}",sde=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function iw(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(sde,c=>(Ss.test(c)?(n.color.push(s),i.push(Bz),r.push(Ss.parse(c))):c.startsWith(ide)?(n.var.push(s),i.push(nde),r.push(c)):(n.number.push(s),i.push(Nz),r.push(parseFloat(c))),++s,oN)).split(oN);return{values:r,split:a,indexes:n,types:i}}function Lz(t){return iw(t).values}function Fz(t){const{split:e,types:r}=iw(t),n=e.length;return i=>{let s="";for(let o=0;otypeof t=="number"?0:t;function ade(t){const e=Lz(t);return Fz(t)(e.map(ode))}const nh={test:rde,parse:Lz,createTransformer:Fz,getAnimatableNone:ade},cde=new Set(["brightness","contrast","saturate","opacity"]);function lde(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(IT)||[];if(!n)return t;const i=r.replace(n,"");let s=cde.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const fde=/\b([a-z-]*)\(.*?\)/gu,s7={...nh,getAnimatableNone:t=>{const e=t.match(fde);return e?e.map(lde).join(" "):t}},ude={...TT,color:Ss,backgroundColor:Ss,outlineColor:Ss,fill:Ss,stroke:Ss,borderColor:Ss,borderTopColor:Ss,borderRightColor:Ss,borderBottomColor:Ss,borderLeftColor:Ss,filter:s7,WebkitFilter:s7},UT=t=>ude[t];function jz(t,e){let r=UT(t);return r!==s7&&(r=nh),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const dde=new Set(["auto","none","0"]);function hde(t,e,r){let n=0,i;for(;n{r.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function $z(t){let e;return()=>(e===void 0&&(e=t()),e)}let W6;function pde(){W6=void 0}const ou={now:()=>(W6===void 0&&ou.set(Qi.isProcessing||Mfe.useManualTiming?Qi.timestamp:performance.now()),W6),set:t=>{W6=t,queueMicrotask(pde)}},aN=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(nh.test(t)||t==="0")&&!t.startsWith("url("));function vde(t){const e=t[0];if(t.length===1)return!0;for(let r=0;ryde?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xue(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=ou.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!gde(e,n,i,s))if(o)this.options.duration=0;else{c==null||c(q4(e,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(e,r);f!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...f},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function Vz(t,e){return e?t*(1e3/e):0}const mde=5;function zz(t,e,r){const n=Math.max(e-mde,0);return Vz(r-t(n),e-n)}const CA=.001,bde=.01,wde=10,xde=.05,Ede=1;function Cde({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=rh(xde,Ede,o),t=rh(bde,wde,su(t)),o<1?(i=l=>{const f=l*o,u=f*t,p=f-r,g=o7(l,o),y=Math.exp(-u);return CA-p/g*y},s=l=>{const u=l*o*t,p=u*r+r,g=Math.pow(o,2)*Math.pow(l,2)*t,y=Math.exp(-u),b=o7(Math.pow(l,2),o);return(-i(l)+CA>0?-1:1)*((p-g)*y)/b}):(i=l=>{const f=Math.exp(-l*t),u=(l-r)*t+1;return-CA+f*u},s=l=>{const f=Math.exp(-l*t),u=(r-l)*(t*t);return f*u});const a=5/t,c=Sde(i,s,a);if(t=iu(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const Ade=12;function Sde(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Tde(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!cN(t,Ide)&&cN(t,_de)){const r=Cde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Hz({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:c,mass:l,duration:f,velocity:u,isResolvedFromDuration:p}=Tde({...n,velocity:-su(n.velocity||0)}),g=u||0,y=c/(2*Math.sqrt(a*l)),b=s-i,I=su(Math.sqrt(a/l)),C=Math.abs(b)<5;r||(r=C?.01:2),e||(e=C?.005:.5);let S;if(y<1){const O=o7(I,y);S=L=>{const F=Math.exp(-y*I*L);return s-F*((g+y*I*b)/O*Math.sin(O*L)+b*Math.cos(O*L))}}else if(y===1)S=O=>s-Math.exp(-I*O)*(b+(g+I*b)*O);else{const O=I*Math.sqrt(y*y-1);S=L=>{const F=Math.exp(-y*I*L),z=Math.min(O*L,300);return s-F*((g+y*I*b)*Math.sinh(z)+O*b*Math.cosh(z))/O}}return{calculatedDuration:p&&f||null,next:O=>{const L=S(O);if(p)o.done=O>=f;else{let F=0;y<1&&(F=O===0?iu(g):zz(S,O,L));const z=Math.abs(F)<=r,_=Math.abs(s-L)<=e;o.done=z&&_}return o.value=o.done?s:L,o}}}function lN({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:f}){const u=t[0],p={done:!1,value:u},g=$=>a!==void 0&&$c,y=$=>a===void 0?c:c===void 0||Math.abs(a-$)-b*Math.exp(-$/n),O=$=>C+S($),L=$=>{const ie=S($),ce=O($);p.done=Math.abs(ie)<=l,p.value=p.done?C:ce};let F,z;const _=$=>{g(p.value)&&(F=$,z=Hz({keyframes:[p.value,y(p.value)],velocity:zz(O,$,p.value),damping:i,stiffness:s,restDelta:l,restSpeed:f}))};return _(0),{calculatedDuration:null,next:$=>{let ie=!1;return!z&&F===void 0&&(ie=!0,L($),_($)),F!==void 0&&$>=F?z.next($-F):(!ie&&L($),p)}}}const Gz=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Pde=1e-7,kde=12;function Mde(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=Gz(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Pde&&++aMde(s,0,1,t,r);return s=>s===0||s===1?s:Gz(i(s),e,n)}const Rde=ix(.42,0,1,1),Ode=ix(0,0,.58,1),Wz=ix(.42,0,.58,1),Dde=t=>Array.isArray(t)&&typeof t[0]!="number",Kz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Yz=t=>e=>1-t(1-e),$T=t=>1-Math.sin(Math.acos(t)),Qz=Yz($T),Nde=Kz($T),Jz=ix(.33,1.53,.69,.99),qT=Yz(Jz),Bde=Kz(qT),Lde=t=>(t*=2)<1?.5*qT(t):.5*(2-Math.pow(2,-10*(t-1))),fN={linear:ks,easeIn:Rde,easeInOut:Wz,easeOut:Ode,circIn:$T,circInOut:Nde,circOut:Qz,backIn:qT,backInOut:Bde,backOut:Jz,anticipate:Lde},uN=t=>{if(Array.isArray(t)){XS(t.length===4);const[e,r,n,i]=t;return ix(e,r,n,i)}else if(typeof t=="string")return XS(fN[t]!==void 0),fN[t];return t},sw=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Dn=(t,e,r)=>t+(e-t)*r;function AA(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Fde({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=AA(c,a,t+1/3),s=AA(c,a,t),o=AA(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function c5(t,e){return r=>r>0?e:t}const SA=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},jde=[i7,T0,lv],Ude=t=>jde.find(e=>e.test(t));function dN(t){const e=Ude(t);if(!e)return!1;let r=e.parse(t);return e===lv&&(r=Fde(r)),r}const hN=(t,e)=>{const r=dN(t),n=dN(e);if(!r||!n)return c5(t,e);const i={...r};return s=>(i.red=SA(r.red,n.red,s),i.green=SA(r.green,n.green,s),i.blue=SA(r.blue,n.blue,s),i.alpha=Dn(r.alpha,n.alpha,s),T0.transform(i))},a7=new Set(["none","hidden"]);function $de(t,e){return a7.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function qde(t,e){return r=>Dn(t,e,r)}function VT(t){return typeof t=="number"?qde:typeof t=="string"?PT(t)?c5:Ss.test(t)?hN:Hde:Array.isArray(t)?Zz:typeof t=="object"?Ss.test(t)?hN:Vde:c5}function Zz(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>VT(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function zde(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=nh.createTransformer(e),n=iw(t),i=iw(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?a7.has(t)&&!i.values.length||a7.has(e)&&!n.values.length?$de(t,e):nu(Zz(zde(n,i),i.values),r):c5(t,e)};function Xz(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Dn(t,e,r):VT(t)(t,e)}function Gde(t,e,r){const n=[],i=r||Xz,s=t.length-1;for(let o=0;oe[0];if(s===2&&t[0]===t[1])return()=>e[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Gde(e,n,i),a=o.length,c=l=>{let f=0;if(a>1)for(;fc(rh(t[0],t[s-1],l)):c}function Kde(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=sw(0,e,n);t.push(Dn(r,1,i))}}function Yde(t){const e=[0];return Kde(e,t.length-1),e}function Qde(t,e){return t.map(r=>r*e)}function Jde(t,e){return t.map(()=>e||Wz).splice(0,t.length-1)}function l5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Dde(n)?n.map(uN):uN(n),s={done:!1,value:e[0]},o=Qde(r&&r.length===e.length?r:Yde(e),t),a=Wde(o,e,{ease:Array.isArray(i)?i:Jde(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const pN=2e4;function Zde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=pN?1/0:e}const Xde=t=>{const e=({timestamp:r})=>t(r);return{start:()=>on.update(e,!0),stop:()=>hu(e),now:()=>Qi.isProcessing?Qi.timestamp:ou.now()}},ehe={decay:lN,inertia:lN,tween:l5,keyframes:l5,spring:Hz},the=t=>t/100;class zT extends qz{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:r,motionValue:n,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||FT,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,r,n,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=ehe[r]||l5;let c,l;a!==l5&&typeof e[0]!="number"&&(c=nu(the,Xz(e[0],e[1])),e=[0,100]);const f=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=Zde(f));const{calculatedDuration:u}=f,p=u+i,g=p*(n+1)-i;return{generator:f,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:u,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:$}=this.options;return{done:!0,value:$[$.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:f,resolvedDuration:u}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:y,repeatDelay:b,onUpdate:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-f/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const C=this.currentTime-p*(this.speed>=0?1:-1),S=this.speed>=0?C<0:C>f;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let O=this.currentTime,L=s;if(g){const $=Math.min(this.currentTime,f)/u;let ie=Math.floor($),ce=$%1;!ce&&$>=1&&(ce=1),ce===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(ce=1-ce,b&&(ce-=b/u)):y==="mirror"&&(L=o)),O=rh(0,1,ce)*u}const F=S?{done:!1,value:c[0]}:L.next(O);a&&(F.value=a(F.value));let{done:z}=F;!S&&l!==null&&(z=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return _&&i!==void 0&&(F.value=q4(c,this.options,i)),I&&I(F.value),_&&this.finish(),F}get duration(){const{resolved:e}=this;return e?su(e.calculatedDuration):0}get time(){return su(this.currentTime)}set time(e){e=iu(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=su(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Xde,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const eH=t=>Array.isArray(t)&&typeof t[0]=="number";function tH(t){return!!(!t||typeof t=="string"&&t in HT||eH(t)||Array.isArray(t)&&t.every(tH))}const zm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,HT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zm([0,.65,.55,1]),circOut:zm([.55,0,1,.45]),backIn:zm([.31,.01,.66,-.59]),backOut:zm([.33,1.53,.69,.99])};function rhe(t){return rH(t)||HT.easeOut}function rH(t){if(t)return eH(t)?zm(t):Array.isArray(t)?t.map(rhe):HT[t]}function nhe(t,e,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){const l={[e]:r};c&&(l.offset=c);const f=rH(a);return Array.isArray(f)&&(l.easing=f),t.animate(l,{delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const ihe=$z(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),f5=10,she=2e4;function ohe(t){return t.type==="spring"||!tH(t.ease)}function ahe(t,e){const r=new zT({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(o,a),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){var n;let{duration:i=300,times:s,ease:o,type:a,motionValue:c,name:l,startTime:f}=this.options;if(!(!((n=c.owner)===null||n===void 0)&&n.current))return!1;if(ohe(this.options)){const{onComplete:p,onUpdate:g,motionValue:y,element:b,...I}=this.options,C=ahe(e,I);e=C.keyframes,e.length===1&&(e[1]=e[0]),i=C.duration,s=C.times,o=C.ease,a="keyframes"}const u=nhe(c.owner.current,l,e,{...this.options,duration:i,times:s,ease:o});return u.startTime=f??this.calcStartTime(),this.pendingTimeline?(u.timeline=this.pendingTimeline,this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;c.set(q4(e,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return su(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return su(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=iu(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return ks;const{animation:n}=r;n.timeline=e,n.onfinish=null}return ks}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:s,ease:o,times:a}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:f,onComplete:u,element:p,...g}=this.options,y=new zT({...g,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=iu(this.time);l.setWithVelocity(y.sample(b-f5).value,y.sample(b).value,f5)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:s,damping:o,type:a}=e;return ihe()&&n&&mz.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}function che(t,e){let r;const n=()=>{const{currentTime:i}=e,o=(i===null?0:i.value)/100;r!==o&&t(o),r=o};return on.update(n,!0),()=>hu(n)}const lhe=$z(()=>window.ScrollTimeline!==void 0);class fhe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,r){return Promise.all(this.animations).then(e).catch(r)}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(lhe()&&n.attachTimeline)n.attachTimeline(e);else return n.pause(),che(i=>{n.time=n.duration*i},e)});return()=>{r.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const GT=(t,e,r,n={},i,s,o)=>a=>{const c=LT(n,t)||{},l=c.delay||n.delay||0;let{elapsed:f=0}=n;f=f-iu(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{a(),c.onComplete&&c.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:s?void 0:i};Vue(c)||(u={...u,...que(t,u)}),u.duration&&(u.duration=iu(u.duration)),u.repeatDelay&&(u.repeatDelay=iu(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=q4(u.keyframes,c);if(g!==void 0)return on.update(()=>{u.onUpdate(g),u.onComplete()}),new fhe([])}return!s&&vN.supports(u)?new vN(u):new zT(u)};class WT{constructor(){this.subscriptions=[]}add(e){return F4(this.subscriptions,e),()=>j4(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class nH{constructor(e,r={}){this.version="11.3.31",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=ou.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=ou.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uhe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new WT);const n=this.events[e].add(r);return e==="change"?()=>{n(),on.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ou.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gN)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,gN);return Vz(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ow(t,e){return new nH(t,e)}function dhe(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,ow(r))}function hhe(t,e){const r=$4(t,e);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=mue(s[o]);dhe(t,o,a)}}function iH(t){return t.props[rz]}class phe extends nH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=bz(e);if(!r)return;const n=this.counts.get(r)||0;this.counts.set(r,n+1),n===0&&(this.output.push(r),this.update());let i=!1;return()=>{if(i)return;i=!0;const s=this.counts.get(r)-1;this.counts.set(r,s),s===0&&(j4(this.output,r),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function vhe(t){return!!(Ts(t)&&t.add)}function c7(t,e){var r;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(!n&&!(!((r=t.props.style)===null||r===void 0)&&r.willChange)&&(n=new phe("auto"),t.addValue("willChange",n)),vhe(n))return n.add(e)}function ghe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function sH(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;n&&(o=n);const l=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const u in c){const p=t.getValue(u,(s=t.latestValues[u])!==null&&s!==void 0?s:null),g=c[u];if(g===void 0||f&&ghe(f,u))continue;const y={delay:r,...LT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=iH(t);if(C){const S=window.MotionHandoffAnimation(C,u,on);S!==null&&(y.startTime=S,b=!0)}}p.start(GT(u,p,g,t.shouldReduceMotion&&xh.has(u)?{type:!1}:y,t,b,c7(t,u)));const I=p.animation;I&&l.push(I)}return a&&Promise.all(l).then(()=>{on.update(()=>{a&&hhe(t,a)})}),l}function l7(t,e,r={}){var n;const i=$4(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>Promise.all(sH(t,i,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=s;return yhe(t,e,f+l,u,p,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,f]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>f())}else return Promise.all([o(),a(r.delay)])}function yhe(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(mhe).forEach((l,f)=>{l.notify("AnimationStart",e),o.push(l7(l,e,{...s,delay:r+c(f)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function mhe(t,e){return t.sortNodePosition(e)}function bhe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>l7(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=l7(t,e,r);else{const i=typeof e=="function"?$4(t,e,r.custom):e;n=Promise.all(sH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const whe=[...CT].reverse(),xhe=CT.length;function Ehe(t){return e=>Promise.all(e.map(({animation:r,options:n})=>bhe(t,r,n)))}function Che(t){let e=Ehe(t),r=yN(),n=!0;const i=c=>(l,f)=>{var u;const p=$4(t,f,c==="exit"?(u=t.presenceContext)===null||u===void 0?void 0:u.custom:void 0);if(p){const{transition:g,transitionEnd:y,...b}=p;l={...l,...b,...y}}return l};function s(c){e=c(t)}function o(c){const l=t.getProps(),f=t.getVariantContext(!0)||{},u=[],p=new Set;let g={},y=1/0;for(let I=0;Iy&&L,ie=!1;const ce=Array.isArray(O)?O:[O];let K=ce.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:P={}}=S,M={...P,...K},v=m=>{$=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const R=t.getValue(m);R&&(R.liveStyle=!1)};for(const m in M){const R=K[m],B=P[m];if(g.hasOwnProperty(m))continue;let E=!1;e7(R)&&e7(B)?E=!_z(R,B):E=R!==B,E?R!=null?v(m):p.add(m):R!==void 0&&p.has(m)?v(m):S.protectedKeys[m]=!0}S.prevProp=O,S.prevResolvedValues=K,S.isActive&&(g={...g,...K}),n&&t.blockInitialAnimation&&($=!1),$&&(!z||ie)&&u.push(...ce.map(m=>({animation:m,options:{type:C}})))}if(p.size){const I={};p.forEach(C=>{const S=t.getBaseTarget(C),O=t.getValue(C);O&&(O.liveStyle=!0),I[C]=S??null}),u.push({animation:I})}let b=!!u.length;return n&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(u):Promise.resolve()}function a(c,l){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(c,l)}),r[c].isActive=l;const u=o(c);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=yN(),n=!0}}}function Ahe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!_z(e,t):!1}function r0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yN(){return{animate:r0(!0),whileInView:r0(),whileHover:r0(),whileTap:r0(),whileDrag:r0(),whileFocus:r0(),exit:r0()}}class She extends Eh{constructor(e){super(e),e.animationState||(e.animationState=Che(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();nw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let _he=0;class Ihe extends Eh{constructor(){super(...arguments),this.id=_he++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const The={animation:{Feature:She},exit:{Feature:Ihe}},mN=(t,e)=>Math.abs(t-e);function Phe(t,e){const r=mN(t.x,e.x),n=mN(t.y,e.y);return Math.sqrt(r**2+n**2)}class oH{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=IA(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=Phe(u.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:y}=u,{timestamp:b}=Qi;this.history.push({...y,timestamp:b});const{onStart:I,onMove:C}=this.handlers;p||(I&&I(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=_A(p,this.transformPagePoint),on.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const I=IA(u.type==="pointercancel"?this.lastMoveEventInfo:_A(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(u,I),y&&y(u,I)},!xz(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=U4(e),a=_A(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=Qi;this.history=[{...c,timestamp:l}];const{onSessionStart:f}=r;f&&f(e,IA(a,this.history)),this.removeListeners=nu(ru(this.contextWindow,"pointermove",this.handlePointerMove),ru(this.contextWindow,"pointerup",this.handlePointerUp),ru(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),hu(this.updatePoint)}}function _A(t,e){return e?{point:e(t.point)}:t}function bN(t,e){return{x:t.x-e.x,y:t.y-e.y}}function IA({point:t},e){return{point:t,delta:bN(t,aH(e)),offset:bN(t,khe(e)),velocity:Mhe(e,.1)}}function khe(t){return t[0]}function aH(t){return t[t.length-1]}function Mhe(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=aH(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>iu(e)));)r--;if(!n)return{x:0,y:0};const s=su(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const cH=1e-4,Rhe=1-cH,Ohe=1+cH,lH=.01,Dhe=0-lH,Nhe=0+lH;function fa(t){return t.max-t.min}function Bhe(t,e,r){return Math.abs(t-e)<=r}function wN(t,e,r,n=.5){t.origin=n,t.originPoint=Dn(e.min,e.max,t.origin),t.scale=fa(r)/fa(e),t.translate=Dn(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Rhe&&t.scale<=Ohe||isNaN(t.scale))&&(t.scale=1),(t.translate>=Dhe&&t.translate<=Nhe||isNaN(t.translate))&&(t.translate=0)}function xb(t,e,r,n){wN(t.x,e.x,r.x,n?n.originX:void 0),wN(t.y,e.y,r.y,n?n.originY:void 0)}function xN(t,e,r){t.min=r.min+e.min,t.max=t.min+fa(e)}function Lhe(t,e,r){xN(t.x,e.x,r.x),xN(t.y,e.y,r.y)}function EN(t,e,r){t.min=e.min-r.min,t.max=t.min+fa(e)}function Eb(t,e,r){EN(t.x,e.x,r.x),EN(t.y,e.y,r.y)}function Fhe(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?Dn(r,t,n.max):Math.min(t,r)),t}function CN(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function jhe(t,{top:e,left:r,bottom:n,right:i}){return{x:CN(t.x,r,i),y:CN(t.y,e,n)}}function AN(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=sw(e.min,e.max-n,t.min):n>i&&(r=sw(t.min,t.max-i,e.min)),rh(0,1,r)}function qhe(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const f7=.35;function Vhe(t=f7){return t===!1?t=0:t===!0&&(t=f7),{x:SN(t,"left","right"),y:SN(t,"top","bottom")}}function SN(t,e,r){return{min:_N(t,e),max:_N(t,r)}}function _N(t,e){return typeof t=="number"?t:t[e]||0}const IN=()=>({translate:0,scale:1,origin:0,originPoint:0}),fv=()=>({x:IN(),y:IN()}),TN=()=>({min:0,max:0}),Xn=()=>({x:TN(),y:TN()});function Ra(t){return[t("x"),t("y")]}function fH({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function zhe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Hhe(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function TA(t){return t===void 0||t===1}function u7({scale:t,scaleX:e,scaleY:r}){return!TA(t)||!TA(e)||!TA(r)}function d0(t){return u7(t)||uH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function uH(t){return PN(t.x)||PN(t.y)}function PN(t){return t&&t!=="0%"}function u5(t,e,r){const n=t-r,i=e*n;return r+i}function kN(t,e,r,n,i){return i!==void 0&&(t=u5(t,i,n)),u5(t,r,n)+e}function d7(t,e=0,r=1,n,i){t.min=kN(t.min,e,r,n,i),t.max=kN(t.max,e,r,n,i)}function dH(t,{x:e,y:r}){d7(t.x,e.translate,e.scale,e.originPoint),d7(t.y,r.translate,r.scale,r.originPoint)}const MN=.999999999999,RN=1.0000000000001;function Ghe(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;aMN&&(e.x=1),e.yMN&&(e.y=1)}function uv(t,e){t.min=t.min+e,t.max=t.max+e}function ON(t,e,r,n,i=.5){const s=Dn(t.min,t.max,i);d7(t,e,r,s,n)}function dv(t,e){ON(t.x,e.x,e.scaleX,e.scale,e.originX),ON(t.y,e.y,e.scaleY,e.scale,e.originY)}function hH(t,e){return fH(Hhe(t.getBoundingClientRect(),e))}function Whe(t,e,r){const n=hH(t,r),{scroll:i}=e;return i&&(uv(n.x,i.offset.x),uv(n.y,i.offset.y)),n}const pH=({current:t})=>t?t.ownerDocument.defaultView:null,Khe=new WeakMap;class Yhe{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xn(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(U4(f,"page").point)},s=(f,u)=>{var p;const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Cz(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ra(C=>{let S=this.getAxisMotionValue(C).get()||0;if(Bl.test(S)){const{projection:O}=this.visualElement;if(O&&O.layout){const L=O.layout.layoutBox[C];L&&(S=fa(L)*(parseFloat(S)/100))}}this.originPoint[C]=S}),b&&on.postRender(()=>b(f,u)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=c7(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},o=(f,u)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=u;if(g&&this.currentDirection===null){this.currentDirection=Qhe(I),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,I),this.updateAxis("y",u.point,I),this.visualElement.render(),b&&b(f,u)},a=(f,u)=>this.stop(f,u),c=()=>Ra(f=>{var u;return this.getAnimationState(f)==="paused"&&((u=this.getAxisMotionValue(f).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new oH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:pH(this.visualElement)})}stop(e,r){var n;(n=this.removeWillChange)===null||n===void 0||n.call(this);const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&on.postRender(()=>o(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!Y2(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Fhe(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;r&&cv(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=jhe(i.layoutBox,r):this.constraints=!1,this.elastic=Vhe(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ra(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=qhe(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!cv(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Whe(n,i.root,this.visualElement.getTransformPagePoint());let o=Uhe(i.layout.layoutBox,s);if(r){const a=r(zhe(o));this.hasMutatedConstraints=!!a,a&&(o=fH(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ra(f=>{if(!Y2(f,r,this.currentDirection))return;let u=c&&c[f]||{};o&&(u={min:0,max:0});const p=i?200:1e6,g=i?40:1e7,y={type:"inertia",velocity:n?e[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(GT(e,n,0,r,this.visualElement,!1,c7(this.visualElement,e)))}stopAnimation(){Ra(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ra(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Ra(r=>{const{drag:n}=this.getProps();if(!Y2(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-Dn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!cv(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ra(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=$he({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ra(o=>{if(!Y2(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(Dn(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;Khe.set(this.visualElement,this);const e=this.visualElement.current,r=ru(e,"pointerdown",c=>{const{drag:l,dragListener:f=!0}=this.getProps();l&&f&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();cv(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),on.read(n);const o=Jf(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ra(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=c[f].translate,u.set(u.get()+c[f].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=f7,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Y2(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Qhe(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Jhe extends Eh{constructor(e){super(e),this.removeGroupControls=ks,this.removeListeners=ks,this.controls=new Yhe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ks}unmount(){this.removeGroupControls(),this.removeListeners()}}const DN=t=>(e,r)=>{t&&on.postRender(()=>t(e,r))};class Zhe extends Eh{constructor(){super(...arguments),this.removePointerDownListener=ks}onPointerDown(e){this.session=new oH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:DN(e),onStart:DN(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&on.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ru(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Xhe(){const t=D.useContext(N4);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=D.useId();D.useEffect(()=>n(i),[]);const s=D.useCallback(()=>r&&r(i),[i,r]);return!e&&r?[!1,s]:[!0]}const K6={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function NN(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wm={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Qt.test(t))t=parseFloat(t);else return t;const r=NN(t,e.target.x),n=NN(t,e.target.y);return`${r}% ${n}%`}},e0e={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=nh.parse(t);if(i.length>5)return n;const s=nh.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,c=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=Dn(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class t0e extends D.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;Kfe(r0e),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),K6.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||on.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ET.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vH(t){const[e,r]=Xhe(),n=D.useContext(ST);return W.jsx(t0e,{...t,layoutGroup:n,switchLayoutGroup:D.useContext(iz),isPresent:e,safeToRemove:r})}const r0e={borderRadius:{...wm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wm,borderTopRightRadius:wm,borderBottomLeftRadius:wm,borderBottomRightRadius:wm,boxShadow:e0e},gH=["TopLeft","TopRight","BottomLeft","BottomRight"],n0e=gH.length,BN=t=>typeof t=="string"?parseFloat(t):t,LN=t=>typeof t=="number"||Qt.test(t);function i0e(t,e,r,n,i,s){i?(t.opacity=Dn(0,r.opacity!==void 0?r.opacity:1,s0e(n)),t.opacityExit=Dn(e.opacity!==void 0?e.opacity:1,0,o0e(n))):s&&(t.opacity=Dn(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(sw(t,e,n))}function jN(t,e){t.min=e.min,t.max=e.max}function Sa(t,e){jN(t.x,e.x),jN(t.y,e.y)}function UN(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function $N(t,e,r,n,i){return t-=e,t=u5(t,1/r,n),i!==void 0&&(t=u5(t,1/i,n)),t}function a0e(t,e=0,r=1,n=.5,i,s=t,o=t){if(Bl.test(e)&&(e=parseFloat(e),e=Dn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Dn(s.min,s.max,n);t===s&&(a-=e),t.min=$N(t.min,e,r,a,i),t.max=$N(t.max,e,r,a,i)}function qN(t,e,[r,n,i],s,o){a0e(t,e[r],e[n],e[i],e.scale,s,o)}const c0e=["x","scaleX","originX"],l0e=["y","scaleY","originY"];function VN(t,e,r,n){qN(t.x,e,c0e,r?r.x:void 0,n?n.x:void 0),qN(t.y,e,l0e,r?r.y:void 0,n?n.y:void 0)}function zN(t){return t.translate===0&&t.scale===1}function mH(t){return zN(t.x)&&zN(t.y)}function HN(t,e){return t.min===e.min&&t.max===e.max}function f0e(t,e){return HN(t.x,e.x)&&HN(t.y,e.y)}function GN(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function bH(t,e){return GN(t.x,e.x)&&GN(t.y,e.y)}function WN(t){return fa(t.x)/fa(t.y)}function KN(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class u0e{constructor(){this.members=[]}add(e){F4(this.members,e),e.scheduleRender()}remove(e){if(j4(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d0e(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:l,rotate:f,rotateX:u,rotateY:p,skewX:g,skewY:y}=r;l&&(n=`perspective(${l}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),g&&(n+=`skewX(${g}deg) `),y&&(n+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}const h0e=(t,e)=>t.depth-e.depth;class p0e{constructor(){this.children=[],this.isDirty=!1}add(e){F4(this.children,e),this.isDirty=!0}remove(e){j4(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(h0e),this.isDirty=!1,this.children.forEach(e)}}function v0e(t,e){const r=ou.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(hu(n),t(s-e))};return on.read(n,!0),()=>hu(n)}function g0e(t){return t instanceof SVGElement&&t.tagName!=="svg"}function y0e(t,e,r){const n=Ts(t)?t:ow(t);return n.start(GT("",n,e,r)),n.animation}const h0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hm=typeof window<"u"&&window.MotionDebug!==void 0,PA=["","X","Y","Z"],m0e={visibility:"hidden"},YN=1e3;let b0e=0;function kA(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function wH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=iH(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",on,!(i||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&wH(n)}function xH({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=b0e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hm&&(h0.totalNodes=h0.resolvedTargetDeltas=h0.recalculatedProjection=0),this.nodes.forEach(E0e),this.nodes.forEach(I0e),this.nodes.forEach(T0e),this.nodes.forEach(C0e),Hm&&window.MotionDebug.record(h0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=v0e(p,250),K6.hasAnimatedSinceResize&&(K6.hasAnimatedSinceResize=!1,this.nodes.forEach(JN))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||f.getDefaultTransition()||O0e,{onLayoutAnimationStart:I,onLayoutAnimationComplete:C}=f.getProps(),S=!this.targetLayout||!bH(this.targetLayout,y)||g,O=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,O);const L={...LT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||JN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(P0e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wH(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const F=L/1e3;ZN(u.x,o.x,F),ZN(u.y,o.y,F),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eb(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),M0e(this.relativeTarget,this.relativeTargetOrigin,p,F),O&&f0e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Xn()),Sa(O,this.relativeTarget)),b&&(this.animationValues=f,i0e(f,l,this.latestValues,F,S,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(hu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=on.update(()=>{K6.hasAnimatedSinceResize=!0,this.currentAnimation=y0e(0,YN,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:f}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&EH(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Xn();const u=fa(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+u;const p=fa(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}Sa(a,c),dv(a,f),xb(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new u0e),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&kA("z",o,l,this.animationValues);for(let f=0;f{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(QN),this.root.sharedNodes.clear()}}}function w0e(t){t.updateLayout()}function x0e(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?Ra(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=fa(p);p.min=n[u].min,p.max=p.min+g}):EH(s,r.layoutBox,n)&&Ra(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],g=fa(n[u]);p.max=p.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+g)});const a=fv();xb(a,n,r.layoutBox);const c=fv();o?xb(c,t.applyTransform(i,!0),r.measuredBox):xb(c,n,r.layoutBox);const l=!mH(a);let f=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:g}=u;if(p&&g){const y=Xn();Eb(y,r.layoutBox,p.layoutBox);const b=Xn();Eb(b,n,g.layoutBox),bH(y,b)||(f=!0),u.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:f})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function E0e(t){Hm&&h0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function C0e(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function A0e(t){t.clearSnapshot()}function QN(t){t.clearMeasurements()}function S0e(t){t.isLayoutDirty=!1}function _0e(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function JN(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function I0e(t){t.resolveTargetDelta()}function T0e(t){t.calcProjection()}function P0e(t){t.resetSkewAndRotation()}function k0e(t){t.removeLeadSnapshot()}function ZN(t,e,r){t.translate=Dn(e.translate,0,r),t.scale=Dn(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function XN(t,e,r,n){t.min=Dn(e.min,r.min,n),t.max=Dn(e.max,r.max,n)}function M0e(t,e,r,n){XN(t.x,e.x,r.x,n),XN(t.y,e.y,r.y,n)}function R0e(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const O0e={duration:.45,ease:[.4,0,.1,1]},eB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tB=eB("applewebkit/")&&!eB("chrome/")?Math.round:ks;function rB(t){t.min=tB(t.min),t.max=tB(t.max)}function D0e(t){rB(t.x),rB(t.y)}function EH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Bhe(WN(e),WN(r),.2)}function N0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const B0e=xH({attachResizeListener:(t,e)=>Jf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),MA={current:void 0},CH=xH({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!MA.current){const t=new B0e({});t.mount(window),t.setOptions({layoutScroll:!0}),MA.current=t}return MA.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),L0e={pan:{Feature:Zhe},drag:{Feature:Jhe,ProjectionNode:CH,MeasureLayout:vH}},h7={current:null},AH={current:!1};function F0e(){if(AH.current=!0,!!xT)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>h7.current=t.matches;t.addListener(e),e()}else h7.current=!1}function j0e(t,e,r){for(const n in e){const i=e[n],s=r[n];if(Ts(i))t.addValue(n,i);else if(Ts(s))t.addValue(n,ow(i,{owner:t}));else if(s!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,ow(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const nB=new WeakMap,U0e=[...Mz,Ss,nh],$0e=t=>U0e.find(kz(t)),iB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],q0e=AT.length;class V0e{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=FT,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,on.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=L4(r),this.isVariantNode=oz(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const g=u[p];c[p]!==void 0&&Ts(g)&&g.set(c[p],!1)}}mount(e){this.current=e,nB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),AH.current||F0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:h7.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){nB.delete(this.current),this.projection&&this.projection.unmount(),hu(this.notifyUpdate),hu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=xh.has(e),i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&on.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qg){const r=qg[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=ow(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Tz(i)||Iz(i))?i=parseFloat(i):!$0e(i)&&nh.test(r)&&(i=jz(e,r)),this.setBaseTarget(e,Ts(i)?i.get():i)),Ts(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=NT(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Ts(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new WT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class SH extends V0e{constructor(){super(...arguments),this.KeyframeResolver=Uz}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}}function z0e(t){return window.getComputedStyle(t)}class H0e extends SH{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=pz}readValueFromInstance(e,r){if(xh.has(r)){const n=UT(r);return n&&n.default||0}else{const n=z0e(e),i=(fz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return hH(e,r)}build(e,r,n){kT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return DT(e,r,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ts(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class G0e extends SH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(xh.has(r)){const n=UT(r);return n&&n.default||0}return r=vz.has(r)?r:B4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return yz(e,r,n)}build(e,r,n){RT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){gz(e,r,n,i)}mount(e){this.isSVGTag=OT(e.tagName),super.mount(e)}}const W0e=(t,e)=>_T(t)?new G0e(e):new H0e(e,{allowProjection:t!==D.Fragment}),K0e={layout:{ProjectionNode:CH,MeasureLayout:vH}},Y0e={...The,...Lue,...L0e,...K0e},cp=Gfe((t,e)=>Aue(t,e,Y0e,W0e));class Q0e extends D.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function J0e({children:t,isPresent:e}){const r=D.useId(),n=D.useRef(null),i=D.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=D.useContext(wT);return D.useInsertionEffect(()=>{const{width:o,height:a,top:c,left:l}=i.current;if(e||!n.current||!o||!a)return;n.current.dataset.motionPopId=r;const f=document.createElement("style");return s&&(f.nonce=s),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${o}px !important; @@ -45,12 +45,12 @@ Error generating stack: `+s.message+` top: ${c}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(f)}},[e]),W.jsx(Q0e,{isPresent:e,childRef:n,sizeRef:i,children:D.cloneElement(t,{ref:n})})}const Z0e=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=jT(X0e),c=D.useId(),l=D.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:f=>{a.set(f,!0);for(const u of a.values())if(!u)return;n&&n()},register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random()]:[r]);return D.useMemo(()=>{a.forEach((f,u)=>a.set(u,!1))},[r]),D.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=W.jsx(J0e,{isPresent:r,children:t})),W.jsx(U4.Provider,{value:l,children:t})};function X0e(){return new Map}const t6=t=>t.key||"";function cB(t){const e=[];return D.Children.forEach(t,r=>{D.isValidElement(r)&&e.push(r)}),e}const PH=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=D.useMemo(()=>cB(t),[t]),c=a.map(t6),l=D.useRef(!0),f=D.useRef(a),u=jT(()=>new Map),[p,g]=D.useState(a),[y,b]=D.useState(a);nz(()=>{l.current=!1,f.current=a;for(let S=0;S{const O=t6(S),L=a===y||c.includes(O),F=()=>{if(u.has(O))u.set(O,!0);else return;let z=!0;u.forEach(_=>{_||(z=!1)}),z&&(C==null||C(),b(f.current),i&&i())};return W.jsx(Z0e,{isPresent:L,initial:!l.current||n?void 0:!1,custom:L?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:L?void 0:F,children:S},O)})})},kH={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( + `),()=>{document.head.removeChild(f)}},[e]),W.jsx(Q0e,{isPresent:e,childRef:n,sizeRef:i,children:D.cloneElement(t,{ref:n})})}const Z0e=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=BT(X0e),c=D.useId(),l=D.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:f=>{a.set(f,!0);for(const u of a.values())if(!u)return;n&&n()},register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random()]:[r]);return D.useMemo(()=>{a.forEach((f,u)=>a.set(u,!1))},[r]),D.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=W.jsx(J0e,{isPresent:r,children:t})),W.jsx(N4.Provider,{value:l,children:t})};function X0e(){return new Map}const Q2=t=>t.key||"";function sB(t){const e=[];return D.Children.forEach(t,r=>{D.isValidElement(r)&&e.push(r)}),e}const _H=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=D.useMemo(()=>sB(t),[t]),c=a.map(Q2),l=D.useRef(!0),f=D.useRef(a),u=BT(()=>new Map),[p,g]=D.useState(a),[y,b]=D.useState(a);ez(()=>{l.current=!1,f.current=a;for(let S=0;S{const O=Q2(S),L=a===y||c.includes(O),F=()=>{if(u.has(O))u.set(O,!0);else return;let z=!0;u.forEach(_=>{_||(z=!1)}),z&&(C==null||C(),b(f.current),i&&i())};return W.jsx(Z0e,{isPresent:L,initial:!l.current||n?void 0:!1,custom:L?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:L?void 0:F,children:S},O)})})},IH={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( 243.18deg, rgba(86, 52, 189, 0.85) 0%, rgba(49, 41, 223, 0.85) 63.54%, rgba(7, 98, 149, 0.85) 100% - )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},epe={...kH,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},tpe={...kH,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},rpe={dark:epe,light:tpe},npe={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},lB={sm:0,md:480,lg:769,xl:1281};var fB={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function ipe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function spe(t){var e=ipe(t,"string");return typeof e=="symbol"?e:String(e)}function ope(t,e,r){return e=spe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function NA(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],f={},u=NA({},c),p=!1;for(var g of o){var y=c[g];if(y!=null){var b=i[g];p=!0;for(var I of b.mappings)f[I]=y,u[I]==null&&delete u[I]}}var C=p?NA(NA({},f),u):c,S=function(){var F=C[O],z=i[O];try{if(z.mappings)return 1;if(typeof F=="string"||typeof F=="number")l.push(z.values[F].defaultClass);else if(Array.isArray(F))for(var _=0;_t,lpe=function(){return ape(cpe)(...arguments)},MH=lpe({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},18:{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},20:{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"0.25":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},"0.5":{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},"1.5":{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},none:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},px:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},auto:{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},full:{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"1/2":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/3":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"2/3":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},"1/4":{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},"3/4":{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},fit:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},max:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},min:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"},vw:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},vh:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"}}},height:{values:{0:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},1:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},2:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},3:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},4:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},5:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},6:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},7:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},8:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},9:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},10:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},12:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},14:{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},16:{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},18:{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},20:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},"0.25":{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},"0.5":{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},"1.5":{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},none:{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},px:{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},auto:{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},full:{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"1/2":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},"1/3":{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},"2/3":{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},"1/4":{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},"3/4":{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},fit:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"},max:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},min:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},vw:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},vh:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},1:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},2:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},3:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},4:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},5:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},6:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},7:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},8:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},9:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},10:{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},12:{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},14:{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},16:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},18:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},20:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},"0.25":{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"0.5":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1.5":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},none:{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},px:{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},auto:{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},full:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},"1/2":{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},"1/3":{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},"2/3":{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},"1/4":{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"},"3/4":{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},fit:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},max:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},min:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},vw:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},vh:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},1:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},2:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},3:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},4:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},5:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},6:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},7:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},8:{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},9:{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},10:{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},12:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},14:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},16:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},18:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},20:{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"0.25":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"0.5":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1.5":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},none:{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},px:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},auto:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},full:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},"1/2":{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},"1/3":{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"},"2/3":{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},"1/4":{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},"3/4":{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},fit:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},max:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},min:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},vw:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},vh:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},1:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},2:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},3:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},4:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},5:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},6:{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},7:{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},8:{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},9:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},10:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},12:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},14:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},16:{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},18:{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},20:{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"0.25":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"0.5":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},"1.5":{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},none:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},px:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},auto:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},full:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"},"1/2":{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},"1/3":{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},"2/3":{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},"1/4":{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},"3/4":{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},fit:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},max:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},min:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},vw:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},vh:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},1:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},2:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},3:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},4:{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},5:{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},6:{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},7:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},8:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},9:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},10:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},12:{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},14:{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},16:{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},18:{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},20:{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},"0.25":{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},"0.5":{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},"1.5":{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},none:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},px:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"},auto:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},full:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},"1/2":{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},"1/3":{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},"2/3":{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},"1/4":{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},"3/4":{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},fit:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},max:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},min:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},vw:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},vh:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"}}},top:{values:{0:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},1:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},2:{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},3:{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},4:{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},5:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"},6:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},7:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},8:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},9:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},10:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},12:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},14:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},16:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},18:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},20:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},"0.25":{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},"0.5":{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},"1.5":{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},auto:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"}}},bottom:{values:{0:{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},1:{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},2:{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},3:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"},4:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},5:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},6:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},7:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},8:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},9:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},10:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},12:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},14:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},16:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},18:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},20:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},"0.25":{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},"0.5":{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"1.5":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},auto:{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"}}},left:{values:{0:{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},1:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"},2:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},3:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},4:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},5:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},6:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},7:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},8:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},9:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},10:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},12:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},14:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},16:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},18:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},20:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},right:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},18:{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},20:{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"0.25":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"},"0.5":{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},"1.5":{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},auto:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},1:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},2:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},3:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},4:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},5:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},6:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},7:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},8:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},9:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},10:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},12:{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},14:{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},16:{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"},18:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},20:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},"0.25":{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},"0.5":{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},"1.5":{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},1:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},2:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},3:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},4:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},5:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},6:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},7:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},8:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},9:{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},10:{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},12:{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"},14:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},16:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},18:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},20:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},"0.25":{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},"0.5":{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},"1.5":{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},1:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},2:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},3:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},4:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},5:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},6:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},7:{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},8:{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},9:{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"},10:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},12:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},14:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},16:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},18:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},20:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},"0.25":{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},"0.5":{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},"1.5":{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},1:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},2:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},3:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},4:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},5:{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},6:{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},7:{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},8:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"},9:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},10:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},12:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},14:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},16:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},18:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},20:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},"0.25":{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},"0.5":{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},"1.5":{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"}}},marginTop:{values:{0:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},1:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},2:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},3:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},4:{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},5:{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},6:{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},7:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"},8:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},9:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},10:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},12:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},14:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},16:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},18:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},20:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},"0.25":{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},"0.5":{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},"1.5":{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},auto:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},1:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},2:{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},3:{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},4:{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},5:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"},6:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},7:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},8:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},9:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},10:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},12:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},14:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},16:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},18:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},20:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},"0.25":{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},"0.5":{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},"1.5":{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},auto:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},1:{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},2:{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},3:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"},4:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},5:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},6:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},7:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},8:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},9:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},10:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},12:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},14:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},16:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},18:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},20:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},"0.25":{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},"0.5":{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"1.5":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},auto:{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"}}},marginRight:{values:{0:{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"},1:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},2:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},3:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"},4:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},5:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},6:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"},7:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},8:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},9:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"},10:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},12:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},14:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"},16:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},18:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},20:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},"0.25":{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},"0.5":{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},"1.5":{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"},auto:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"}}},gap:{values:{0:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},1:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},2:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},3:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},4:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"},5:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},6:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},7:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},8:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},9:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},10:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"},12:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},14:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},16:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},18:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},20:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},"0.25":{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"},"0.5":{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},"1.5":{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},thin:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},thick:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},thin:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"},thick:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},thin:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},thick:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"},thin:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},thick:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},xs:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"},sm:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},md:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},lg:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},circle:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},xs:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"},sm:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},md:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},lg:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"},circle:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},xs:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},sm:{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},md:{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},lg:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},circle:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},xs:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},sm:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},md:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"},lg:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},circle:{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},xsmall:{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"},small:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},normal:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"},medium:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},large:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"},xlarge:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},normal:{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"},medium:{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},semibold:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},bold:{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},none:{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},normal:{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},wide:{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},5:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},6:{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},7:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"},9:{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},inherit:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},left:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},right:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},display:{values:{block:{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},flex:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},grid:{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},"inline-block":{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},"inline-flex":{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"},none:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},contents:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"}}},position:{values:{absolute:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},fixed:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"},relative:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},sticky:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},"column-reverse":{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"},row:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},"row-reverse":{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ms",md:"fyvr11mt",lg:"fyvr11mu",xl:"fyvr11mv"},defaultClass:"fyvr11ms"},1:{conditions:{sm:"fyvr11mw",md:"fyvr11mx",lg:"fyvr11my",xl:"fyvr11mz"},defaultClass:"fyvr11mw"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11n0",md:"fyvr11n1",lg:"fyvr11n2",xl:"fyvr11n3"},defaultClass:"fyvr11n0"},1:{conditions:{sm:"fyvr11n4",md:"fyvr11n5",lg:"fyvr11n6",xl:"fyvr11n7"},defaultClass:"fyvr11n4"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11n8",md:"fyvr11n9",lg:"fyvr11na",xl:"fyvr11nb"},defaultClass:"fyvr11n8"},wrap:{conditions:{sm:"fyvr11nc",md:"fyvr11nd",lg:"fyvr11ne",xl:"fyvr11nf"},defaultClass:"fyvr11nc"},"wrap-reverse":{conditions:{sm:"fyvr11ng",md:"fyvr11nh",lg:"fyvr11ni",xl:"fyvr11nj"},defaultClass:"fyvr11ng"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11nk",md:"fyvr11nl",lg:"fyvr11nm",xl:"fyvr11nn"},defaultClass:"fyvr11nk"},center:{conditions:{sm:"fyvr11no",md:"fyvr11np",lg:"fyvr11nq",xl:"fyvr11nr"},defaultClass:"fyvr11no"},"flex-end":{conditions:{sm:"fyvr11ns",md:"fyvr11nt",lg:"fyvr11nu",xl:"fyvr11nv"},defaultClass:"fyvr11ns"},stretch:{conditions:{sm:"fyvr11nw",md:"fyvr11nx",lg:"fyvr11ny",xl:"fyvr11nz"},defaultClass:"fyvr11nw"},"space-around":{conditions:{sm:"fyvr11o0",md:"fyvr11o1",lg:"fyvr11o2",xl:"fyvr11o3"},defaultClass:"fyvr11o0"},"space-between":{conditions:{sm:"fyvr11o4",md:"fyvr11o5",lg:"fyvr11o6",xl:"fyvr11o7"},defaultClass:"fyvr11o4"},"space-evenly":{conditions:{sm:"fyvr11o8",md:"fyvr11o9",lg:"fyvr11oa",xl:"fyvr11ob"},defaultClass:"fyvr11o8"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11oc",md:"fyvr11od",lg:"fyvr11oe",xl:"fyvr11of"},defaultClass:"fyvr11oc"},center:{conditions:{sm:"fyvr11og",md:"fyvr11oh",lg:"fyvr11oi",xl:"fyvr11oj"},defaultClass:"fyvr11og"},"flex-end":{conditions:{sm:"fyvr11ok",md:"fyvr11ol",lg:"fyvr11om",xl:"fyvr11on"},defaultClass:"fyvr11ok"},stretch:{conditions:{sm:"fyvr11oo",md:"fyvr11op",lg:"fyvr11oq",xl:"fyvr11or"},defaultClass:"fyvr11oo"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11os",md:"fyvr11ot",lg:"fyvr11ou",xl:"fyvr11ov"},defaultClass:"fyvr11os"},center:{conditions:{sm:"fyvr11ow",md:"fyvr11ox",lg:"fyvr11oy",xl:"fyvr11oz"},defaultClass:"fyvr11ow"},"flex-end":{conditions:{sm:"fyvr11p0",md:"fyvr11p1",lg:"fyvr11p2",xl:"fyvr11p3"},defaultClass:"fyvr11p0"},stretch:{conditions:{sm:"fyvr11p4",md:"fyvr11p5",lg:"fyvr11p6",xl:"fyvr11p7"},defaultClass:"fyvr11p4"},baseline:{conditions:{sm:"fyvr11p8",md:"fyvr11p9",lg:"fyvr11pa",xl:"fyvr11pb"},defaultClass:"fyvr11p8"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11pc",md:"fyvr11pd",lg:"fyvr11pe",xl:"fyvr11pf"},defaultClass:"fyvr11pc"},center:{conditions:{sm:"fyvr11pg",md:"fyvr11ph",lg:"fyvr11pi",xl:"fyvr11pj"},defaultClass:"fyvr11pg"},"flex-end":{conditions:{sm:"fyvr11pk",md:"fyvr11pl",lg:"fyvr11pm",xl:"fyvr11pn"},defaultClass:"fyvr11pk"},stretch:{conditions:{sm:"fyvr11po",md:"fyvr11pp",lg:"fyvr11pq",xl:"fyvr11pr"},defaultClass:"fyvr11po"},baseline:{conditions:{sm:"fyvr11ps",md:"fyvr11pt",lg:"fyvr11pu",xl:"fyvr11pv"},defaultClass:"fyvr11ps"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11pw",md:"fyvr11px",lg:"fyvr11py",xl:"fyvr11pz"},defaultClass:"fyvr11pw"},hidden:{conditions:{sm:"fyvr11q0",md:"fyvr11q1",lg:"fyvr11q2",xl:"fyvr11q3"},defaultClass:"fyvr11q0"},scroll:{conditions:{sm:"fyvr11q4",md:"fyvr11q5",lg:"fyvr11q6",xl:"fyvr11q7"},defaultClass:"fyvr11q4"},visible:{conditions:{sm:"fyvr11q8",md:"fyvr11q9",lg:"fyvr11qa",xl:"fyvr11qb"},defaultClass:"fyvr11q8"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11qc",md:"fyvr11qd",lg:"fyvr11qe",xl:"fyvr11qf"},defaultClass:"fyvr11qc"},hidden:{conditions:{sm:"fyvr11qg",md:"fyvr11qh",lg:"fyvr11qi",xl:"fyvr11qj"},defaultClass:"fyvr11qg"},scroll:{conditions:{sm:"fyvr11qk",md:"fyvr11ql",lg:"fyvr11qm",xl:"fyvr11qn"},defaultClass:"fyvr11qk"},visible:{conditions:{sm:"fyvr11qo",md:"fyvr11qp",lg:"fyvr11qq",xl:"fyvr11qr"},defaultClass:"fyvr11qo"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11qs",md:"fyvr11qt",lg:"fyvr11qu",xl:"fyvr11qv"},defaultClass:"fyvr11qs"},visible:{conditions:{sm:"fyvr11qw",md:"fyvr11qx",lg:"fyvr11qy",xl:"fyvr11qz"},defaultClass:"fyvr11qw"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11r0"},none:{defaultClass:"fyvr11r1"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11r2"},body:{defaultClass:"fyvr11r3"},mono:{defaultClass:"fyvr11r4"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11r5"},clip:{defaultClass:"fyvr11r6"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11r7"},lowercase:{defaultClass:"fyvr11r8"},uppercase:{defaultClass:"fyvr11r9"}}},textDecoration:{values:{none:{defaultClass:"fyvr11ra"},underline:{defaultClass:"fyvr11rb"}}},userSelect:{values:{none:{defaultClass:"fyvr11rc"},text:{defaultClass:"fyvr11rd"},all:{defaultClass:"fyvr11re"},auto:{defaultClass:"fyvr11rf"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11rg"},nowrap:{defaultClass:"fyvr11rh"},initial:{defaultClass:"fyvr11ri"},inherit:{defaultClass:"fyvr11rj"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11rk"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11rl"},"break-word":{defaultClass:"fyvr11rm"},initial:{defaultClass:"fyvr11rn"},inherit:{defaultClass:"fyvr11ro"}}},zIndex:{values:{0:{defaultClass:"fyvr11rp"},1:{defaultClass:"fyvr11rq"},10:{defaultClass:"fyvr11rr"},20:{defaultClass:"fyvr11rs"},30:{defaultClass:"fyvr11rt"},40:{defaultClass:"fyvr11ru"},50:{defaultClass:"fyvr11rv"},"-1":{defaultClass:"fyvr11rw"},auto:{defaultClass:"fyvr11rx"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11ry"},"16/9":{defaultClass:"fyvr11rz"},"4/3":{defaultClass:"fyvr11s0"},"3/1":{defaultClass:"fyvr11s1"},auto:{defaultClass:"fyvr11s2"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11s3",active:"fyvr11s4",disabled:"fyvr11s5",focus:"fyvr11s6",hover:"fyvr11s7",checked:"fyvr11s8"},defaultClass:"fyvr11s3"},white:{conditions:{base:"fyvr11s9",active:"fyvr11sa",disabled:"fyvr11sb",focus:"fyvr11sc",hover:"fyvr11sd",checked:"fyvr11se"},defaultClass:"fyvr11s9"},inherit:{conditions:{base:"fyvr11sf",active:"fyvr11sg",disabled:"fyvr11sh",focus:"fyvr11si",hover:"fyvr11sj",checked:"fyvr11sk"},defaultClass:"fyvr11sf"},transparent:{conditions:{base:"fyvr11sl",active:"fyvr11sm",disabled:"fyvr11sn",focus:"fyvr11so",hover:"fyvr11sp",checked:"fyvr11sq"},defaultClass:"fyvr11sl"},positive:{conditions:{base:"fyvr11sr",active:"fyvr11ss",disabled:"fyvr11st",focus:"fyvr11su",hover:"fyvr11sv",checked:"fyvr11sw"},defaultClass:"fyvr11sr"},negative:{conditions:{base:"fyvr11sx",active:"fyvr11sy",disabled:"fyvr11sz",focus:"fyvr11t0",hover:"fyvr11t1",checked:"fyvr11t2"},defaultClass:"fyvr11sx"},info:{conditions:{base:"fyvr11t3",active:"fyvr11t4",disabled:"fyvr11t5",focus:"fyvr11t6",hover:"fyvr11t7",checked:"fyvr11t8"},defaultClass:"fyvr11t3"},warning:{conditions:{base:"fyvr11t9",active:"fyvr11ta",disabled:"fyvr11tb",focus:"fyvr11tc",hover:"fyvr11td",checked:"fyvr11te"},defaultClass:"fyvr11t9"},gradientBackdrop:{conditions:{base:"fyvr11tf",active:"fyvr11tg",disabled:"fyvr11th",focus:"fyvr11ti",hover:"fyvr11tj",checked:"fyvr11tk"},defaultClass:"fyvr11tf"},gradientPrimary:{conditions:{base:"fyvr11tl",active:"fyvr11tm",disabled:"fyvr11tn",focus:"fyvr11to",hover:"fyvr11tp",checked:"fyvr11tq"},defaultClass:"fyvr11tl"},gradientSecondary:{conditions:{base:"fyvr11tr",active:"fyvr11ts",disabled:"fyvr11tt",focus:"fyvr11tu",hover:"fyvr11tv",checked:"fyvr11tw"},defaultClass:"fyvr11tr"},arbitrumDark:{conditions:{base:"fyvr11tx",active:"fyvr11ty",disabled:"fyvr11tz",focus:"fyvr11u0",hover:"fyvr11u1",checked:"fyvr11u2"},defaultClass:"fyvr11tx"},arbitrumLight:{conditions:{base:"fyvr11u3",active:"fyvr11u4",disabled:"fyvr11u5",focus:"fyvr11u6",hover:"fyvr11u7",checked:"fyvr11u8"},defaultClass:"fyvr11u3"},avalanceDark:{conditions:{base:"fyvr11u9",active:"fyvr11ua",disabled:"fyvr11ub",focus:"fyvr11uc",hover:"fyvr11ud",checked:"fyvr11ue"},defaultClass:"fyvr11u9"},avalanceLight:{conditions:{base:"fyvr11uf",active:"fyvr11ug",disabled:"fyvr11uh",focus:"fyvr11ui",hover:"fyvr11uj",checked:"fyvr11uk"},defaultClass:"fyvr11uf"},bscDark:{conditions:{base:"fyvr11ul",active:"fyvr11um",disabled:"fyvr11un",focus:"fyvr11uo",hover:"fyvr11up",checked:"fyvr11uq"},defaultClass:"fyvr11ul"},bscLight:{conditions:{base:"fyvr11ur",active:"fyvr11us",disabled:"fyvr11ut",focus:"fyvr11uu",hover:"fyvr11uv",checked:"fyvr11uw"},defaultClass:"fyvr11ur"},ethereumDark:{conditions:{base:"fyvr11ux",active:"fyvr11uy",disabled:"fyvr11uz",focus:"fyvr11v0",hover:"fyvr11v1",checked:"fyvr11v2"},defaultClass:"fyvr11ux"},ethereumLight:{conditions:{base:"fyvr11v3",active:"fyvr11v4",disabled:"fyvr11v5",focus:"fyvr11v6",hover:"fyvr11v7",checked:"fyvr11v8"},defaultClass:"fyvr11v3"},gnosisDark:{conditions:{base:"fyvr11v9",active:"fyvr11va",disabled:"fyvr11vb",focus:"fyvr11vc",hover:"fyvr11vd",checked:"fyvr11ve"},defaultClass:"fyvr11v9"},gnosisLight:{conditions:{base:"fyvr11vf",active:"fyvr11vg",disabled:"fyvr11vh",focus:"fyvr11vi",hover:"fyvr11vj",checked:"fyvr11vk"},defaultClass:"fyvr11vf"},polygonDark:{conditions:{base:"fyvr11vl",active:"fyvr11vm",disabled:"fyvr11vn",focus:"fyvr11vo",hover:"fyvr11vp",checked:"fyvr11vq"},defaultClass:"fyvr11vl"},polygonLight:{conditions:{base:"fyvr11vr",active:"fyvr11vs",disabled:"fyvr11vt",focus:"fyvr11vu",hover:"fyvr11vv",checked:"fyvr11vw"},defaultClass:"fyvr11vr"},text100:{conditions:{base:"fyvr11vx",active:"fyvr11vy",disabled:"fyvr11vz",focus:"fyvr11w0",hover:"fyvr11w1",checked:"fyvr11w2"},defaultClass:"fyvr11vx"},text80:{conditions:{base:"fyvr11w3",active:"fyvr11w4",disabled:"fyvr11w5",focus:"fyvr11w6",hover:"fyvr11w7",checked:"fyvr11w8"},defaultClass:"fyvr11w3"},text50:{conditions:{base:"fyvr11w9",active:"fyvr11wa",disabled:"fyvr11wb",focus:"fyvr11wc",hover:"fyvr11wd",checked:"fyvr11we"},defaultClass:"fyvr11w9"},textInverse100:{conditions:{base:"fyvr11wf",active:"fyvr11wg",disabled:"fyvr11wh",focus:"fyvr11wi",hover:"fyvr11wj",checked:"fyvr11wk"},defaultClass:"fyvr11wf"},backgroundPrimary:{conditions:{base:"fyvr11wl",active:"fyvr11wm",disabled:"fyvr11wn",focus:"fyvr11wo",hover:"fyvr11wp",checked:"fyvr11wq"},defaultClass:"fyvr11wl"},backgroundSecondary:{conditions:{base:"fyvr11wr",active:"fyvr11ws",disabled:"fyvr11wt",focus:"fyvr11wu",hover:"fyvr11wv",checked:"fyvr11ww"},defaultClass:"fyvr11wr"},backgroundContrast:{conditions:{base:"fyvr11wx",active:"fyvr11wy",disabled:"fyvr11wz",focus:"fyvr11x0",hover:"fyvr11x1",checked:"fyvr11x2"},defaultClass:"fyvr11wx"},backgroundMuted:{conditions:{base:"fyvr11x3",active:"fyvr11x4",disabled:"fyvr11x5",focus:"fyvr11x6",hover:"fyvr11x7",checked:"fyvr11x8"},defaultClass:"fyvr11x3"},backgroundControl:{conditions:{base:"fyvr11x9",active:"fyvr11xa",disabled:"fyvr11xb",focus:"fyvr11xc",hover:"fyvr11xd",checked:"fyvr11xe"},defaultClass:"fyvr11x9"},backgroundInverse:{conditions:{base:"fyvr11xf",active:"fyvr11xg",disabled:"fyvr11xh",focus:"fyvr11xi",hover:"fyvr11xj",checked:"fyvr11xk"},defaultClass:"fyvr11xf"},backgroundBackdrop:{conditions:{base:"fyvr11xl",active:"fyvr11xm",disabled:"fyvr11xn",focus:"fyvr11xo",hover:"fyvr11xp",checked:"fyvr11xq"},defaultClass:"fyvr11xl"},backgroundOverlay:{conditions:{base:"fyvr11xr",active:"fyvr11xs",disabled:"fyvr11xt",focus:"fyvr11xu",hover:"fyvr11xv",checked:"fyvr11xw"},defaultClass:"fyvr11xr"},backgroundRaised:{conditions:{base:"fyvr11xx",active:"fyvr11xy",disabled:"fyvr11xz",focus:"fyvr11y0",hover:"fyvr11y1",checked:"fyvr11y2"},defaultClass:"fyvr11xx"},buttonGlass:{conditions:{base:"fyvr11y3",active:"fyvr11y4",disabled:"fyvr11y5",focus:"fyvr11y6",hover:"fyvr11y7",checked:"fyvr11y8"},defaultClass:"fyvr11y3"},buttonEmphasis:{conditions:{base:"fyvr11y9",active:"fyvr11ya",disabled:"fyvr11yb",focus:"fyvr11yc",hover:"fyvr11yd",checked:"fyvr11ye"},defaultClass:"fyvr11y9"},buttonInverse:{conditions:{base:"fyvr11yf",active:"fyvr11yg",disabled:"fyvr11yh",focus:"fyvr11yi",hover:"fyvr11yj",checked:"fyvr11yk"},defaultClass:"fyvr11yf"},borderNormal:{conditions:{base:"fyvr11yl",active:"fyvr11ym",disabled:"fyvr11yn",focus:"fyvr11yo",hover:"fyvr11yp",checked:"fyvr11yq"},defaultClass:"fyvr11yl"},borderFocus:{conditions:{base:"fyvr11yr",active:"fyvr11ys",disabled:"fyvr11yt",focus:"fyvr11yu",hover:"fyvr11yv",checked:"fyvr11yw"},defaultClass:"fyvr11yr"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11yx",active:"fyvr11yy",disabled:"fyvr11yz",focus:"fyvr11z0",hover:"fyvr11z1",checked:"fyvr11z2"},defaultClass:"fyvr11yx"},white:{conditions:{base:"fyvr11z3",active:"fyvr11z4",disabled:"fyvr11z5",focus:"fyvr11z6",hover:"fyvr11z7",checked:"fyvr11z8"},defaultClass:"fyvr11z3"},inherit:{conditions:{base:"fyvr11z9",active:"fyvr11za",disabled:"fyvr11zb",focus:"fyvr11zc",hover:"fyvr11zd",checked:"fyvr11ze"},defaultClass:"fyvr11z9"},transparent:{conditions:{base:"fyvr11zf",active:"fyvr11zg",disabled:"fyvr11zh",focus:"fyvr11zi",hover:"fyvr11zj",checked:"fyvr11zk"},defaultClass:"fyvr11zf"},positive:{conditions:{base:"fyvr11zl",active:"fyvr11zm",disabled:"fyvr11zn",focus:"fyvr11zo",hover:"fyvr11zp",checked:"fyvr11zq"},defaultClass:"fyvr11zl"},negative:{conditions:{base:"fyvr11zr",active:"fyvr11zs",disabled:"fyvr11zt",focus:"fyvr11zu",hover:"fyvr11zv",checked:"fyvr11zw"},defaultClass:"fyvr11zr"},info:{conditions:{base:"fyvr11zx",active:"fyvr11zy",disabled:"fyvr11zz",focus:"fyvr1200",hover:"fyvr1201",checked:"fyvr1202"},defaultClass:"fyvr11zx"},warning:{conditions:{base:"fyvr1203",active:"fyvr1204",disabled:"fyvr1205",focus:"fyvr1206",hover:"fyvr1207",checked:"fyvr1208"},defaultClass:"fyvr1203"},gradientBackdrop:{conditions:{base:"fyvr1209",active:"fyvr120a",disabled:"fyvr120b",focus:"fyvr120c",hover:"fyvr120d",checked:"fyvr120e"},defaultClass:"fyvr1209"},gradientPrimary:{conditions:{base:"fyvr120f",active:"fyvr120g",disabled:"fyvr120h",focus:"fyvr120i",hover:"fyvr120j",checked:"fyvr120k"},defaultClass:"fyvr120f"},gradientSecondary:{conditions:{base:"fyvr120l",active:"fyvr120m",disabled:"fyvr120n",focus:"fyvr120o",hover:"fyvr120p",checked:"fyvr120q"},defaultClass:"fyvr120l"},arbitrumDark:{conditions:{base:"fyvr120r",active:"fyvr120s",disabled:"fyvr120t",focus:"fyvr120u",hover:"fyvr120v",checked:"fyvr120w"},defaultClass:"fyvr120r"},arbitrumLight:{conditions:{base:"fyvr120x",active:"fyvr120y",disabled:"fyvr120z",focus:"fyvr1210",hover:"fyvr1211",checked:"fyvr1212"},defaultClass:"fyvr120x"},avalanceDark:{conditions:{base:"fyvr1213",active:"fyvr1214",disabled:"fyvr1215",focus:"fyvr1216",hover:"fyvr1217",checked:"fyvr1218"},defaultClass:"fyvr1213"},avalanceLight:{conditions:{base:"fyvr1219",active:"fyvr121a",disabled:"fyvr121b",focus:"fyvr121c",hover:"fyvr121d",checked:"fyvr121e"},defaultClass:"fyvr1219"},bscDark:{conditions:{base:"fyvr121f",active:"fyvr121g",disabled:"fyvr121h",focus:"fyvr121i",hover:"fyvr121j",checked:"fyvr121k"},defaultClass:"fyvr121f"},bscLight:{conditions:{base:"fyvr121l",active:"fyvr121m",disabled:"fyvr121n",focus:"fyvr121o",hover:"fyvr121p",checked:"fyvr121q"},defaultClass:"fyvr121l"},ethereumDark:{conditions:{base:"fyvr121r",active:"fyvr121s",disabled:"fyvr121t",focus:"fyvr121u",hover:"fyvr121v",checked:"fyvr121w"},defaultClass:"fyvr121r"},ethereumLight:{conditions:{base:"fyvr121x",active:"fyvr121y",disabled:"fyvr121z",focus:"fyvr1220",hover:"fyvr1221",checked:"fyvr1222"},defaultClass:"fyvr121x"},gnosisDark:{conditions:{base:"fyvr1223",active:"fyvr1224",disabled:"fyvr1225",focus:"fyvr1226",hover:"fyvr1227",checked:"fyvr1228"},defaultClass:"fyvr1223"},gnosisLight:{conditions:{base:"fyvr1229",active:"fyvr122a",disabled:"fyvr122b",focus:"fyvr122c",hover:"fyvr122d",checked:"fyvr122e"},defaultClass:"fyvr1229"},polygonDark:{conditions:{base:"fyvr122f",active:"fyvr122g",disabled:"fyvr122h",focus:"fyvr122i",hover:"fyvr122j",checked:"fyvr122k"},defaultClass:"fyvr122f"},polygonLight:{conditions:{base:"fyvr122l",active:"fyvr122m",disabled:"fyvr122n",focus:"fyvr122o",hover:"fyvr122p",checked:"fyvr122q"},defaultClass:"fyvr122l"},text100:{conditions:{base:"fyvr122r",active:"fyvr122s",disabled:"fyvr122t",focus:"fyvr122u",hover:"fyvr122v",checked:"fyvr122w"},defaultClass:"fyvr122r"},text80:{conditions:{base:"fyvr122x",active:"fyvr122y",disabled:"fyvr122z",focus:"fyvr1230",hover:"fyvr1231",checked:"fyvr1232"},defaultClass:"fyvr122x"},text50:{conditions:{base:"fyvr1233",active:"fyvr1234",disabled:"fyvr1235",focus:"fyvr1236",hover:"fyvr1237",checked:"fyvr1238"},defaultClass:"fyvr1233"},textInverse100:{conditions:{base:"fyvr1239",active:"fyvr123a",disabled:"fyvr123b",focus:"fyvr123c",hover:"fyvr123d",checked:"fyvr123e"},defaultClass:"fyvr1239"},backgroundPrimary:{conditions:{base:"fyvr123f",active:"fyvr123g",disabled:"fyvr123h",focus:"fyvr123i",hover:"fyvr123j",checked:"fyvr123k"},defaultClass:"fyvr123f"},backgroundSecondary:{conditions:{base:"fyvr123l",active:"fyvr123m",disabled:"fyvr123n",focus:"fyvr123o",hover:"fyvr123p",checked:"fyvr123q"},defaultClass:"fyvr123l"},backgroundContrast:{conditions:{base:"fyvr123r",active:"fyvr123s",disabled:"fyvr123t",focus:"fyvr123u",hover:"fyvr123v",checked:"fyvr123w"},defaultClass:"fyvr123r"},backgroundMuted:{conditions:{base:"fyvr123x",active:"fyvr123y",disabled:"fyvr123z",focus:"fyvr1240",hover:"fyvr1241",checked:"fyvr1242"},defaultClass:"fyvr123x"},backgroundControl:{conditions:{base:"fyvr1243",active:"fyvr1244",disabled:"fyvr1245",focus:"fyvr1246",hover:"fyvr1247",checked:"fyvr1248"},defaultClass:"fyvr1243"},backgroundInverse:{conditions:{base:"fyvr1249",active:"fyvr124a",disabled:"fyvr124b",focus:"fyvr124c",hover:"fyvr124d",checked:"fyvr124e"},defaultClass:"fyvr1249"},backgroundBackdrop:{conditions:{base:"fyvr124f",active:"fyvr124g",disabled:"fyvr124h",focus:"fyvr124i",hover:"fyvr124j",checked:"fyvr124k"},defaultClass:"fyvr124f"},backgroundOverlay:{conditions:{base:"fyvr124l",active:"fyvr124m",disabled:"fyvr124n",focus:"fyvr124o",hover:"fyvr124p",checked:"fyvr124q"},defaultClass:"fyvr124l"},backgroundRaised:{conditions:{base:"fyvr124r",active:"fyvr124s",disabled:"fyvr124t",focus:"fyvr124u",hover:"fyvr124v",checked:"fyvr124w"},defaultClass:"fyvr124r"},buttonGlass:{conditions:{base:"fyvr124x",active:"fyvr124y",disabled:"fyvr124z",focus:"fyvr1250",hover:"fyvr1251",checked:"fyvr1252"},defaultClass:"fyvr124x"},buttonEmphasis:{conditions:{base:"fyvr1253",active:"fyvr1254",disabled:"fyvr1255",focus:"fyvr1256",hover:"fyvr1257",checked:"fyvr1258"},defaultClass:"fyvr1253"},buttonInverse:{conditions:{base:"fyvr1259",active:"fyvr125a",disabled:"fyvr125b",focus:"fyvr125c",hover:"fyvr125d",checked:"fyvr125e"},defaultClass:"fyvr1259"},borderNormal:{conditions:{base:"fyvr125f",active:"fyvr125g",disabled:"fyvr125h",focus:"fyvr125i",hover:"fyvr125j",checked:"fyvr125k"},defaultClass:"fyvr125f"},borderFocus:{conditions:{base:"fyvr125l",active:"fyvr125m",disabled:"fyvr125n",focus:"fyvr125o",hover:"fyvr125p",checked:"fyvr125q"},defaultClass:"fyvr125l"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr125r",active:"fyvr125s",disabled:"fyvr125t",focus:"fyvr125u",hover:"fyvr125v",checked:"fyvr125w"},defaultClass:"fyvr125r"},dashed:{conditions:{base:"fyvr125x",active:"fyvr125y",disabled:"fyvr125z",focus:"fyvr1260",hover:"fyvr1261",checked:"fyvr1262"},defaultClass:"fyvr125x"},dotted:{conditions:{base:"fyvr1263",active:"fyvr1264",disabled:"fyvr1265",focus:"fyvr1266",hover:"fyvr1267",checked:"fyvr1268"},defaultClass:"fyvr1263"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1269",active:"fyvr126a",disabled:"fyvr126b",focus:"fyvr126c",hover:"fyvr126d",checked:"fyvr126e"},defaultClass:"fyvr1269"},white:{conditions:{base:"fyvr126f",active:"fyvr126g",disabled:"fyvr126h",focus:"fyvr126i",hover:"fyvr126j",checked:"fyvr126k"},defaultClass:"fyvr126f"},inherit:{conditions:{base:"fyvr126l",active:"fyvr126m",disabled:"fyvr126n",focus:"fyvr126o",hover:"fyvr126p",checked:"fyvr126q"},defaultClass:"fyvr126l"},transparent:{conditions:{base:"fyvr126r",active:"fyvr126s",disabled:"fyvr126t",focus:"fyvr126u",hover:"fyvr126v",checked:"fyvr126w"},defaultClass:"fyvr126r"},positive:{conditions:{base:"fyvr126x",active:"fyvr126y",disabled:"fyvr126z",focus:"fyvr1270",hover:"fyvr1271",checked:"fyvr1272"},defaultClass:"fyvr126x"},negative:{conditions:{base:"fyvr1273",active:"fyvr1274",disabled:"fyvr1275",focus:"fyvr1276",hover:"fyvr1277",checked:"fyvr1278"},defaultClass:"fyvr1273"},info:{conditions:{base:"fyvr1279",active:"fyvr127a",disabled:"fyvr127b",focus:"fyvr127c",hover:"fyvr127d",checked:"fyvr127e"},defaultClass:"fyvr1279"},warning:{conditions:{base:"fyvr127f",active:"fyvr127g",disabled:"fyvr127h",focus:"fyvr127i",hover:"fyvr127j",checked:"fyvr127k"},defaultClass:"fyvr127f"},gradientBackdrop:{conditions:{base:"fyvr127l",active:"fyvr127m",disabled:"fyvr127n",focus:"fyvr127o",hover:"fyvr127p",checked:"fyvr127q"},defaultClass:"fyvr127l"},gradientPrimary:{conditions:{base:"fyvr127r",active:"fyvr127s",disabled:"fyvr127t",focus:"fyvr127u",hover:"fyvr127v",checked:"fyvr127w"},defaultClass:"fyvr127r"},gradientSecondary:{conditions:{base:"fyvr127x",active:"fyvr127y",disabled:"fyvr127z",focus:"fyvr1280",hover:"fyvr1281",checked:"fyvr1282"},defaultClass:"fyvr127x"},arbitrumDark:{conditions:{base:"fyvr1283",active:"fyvr1284",disabled:"fyvr1285",focus:"fyvr1286",hover:"fyvr1287",checked:"fyvr1288"},defaultClass:"fyvr1283"},arbitrumLight:{conditions:{base:"fyvr1289",active:"fyvr128a",disabled:"fyvr128b",focus:"fyvr128c",hover:"fyvr128d",checked:"fyvr128e"},defaultClass:"fyvr1289"},avalanceDark:{conditions:{base:"fyvr128f",active:"fyvr128g",disabled:"fyvr128h",focus:"fyvr128i",hover:"fyvr128j",checked:"fyvr128k"},defaultClass:"fyvr128f"},avalanceLight:{conditions:{base:"fyvr128l",active:"fyvr128m",disabled:"fyvr128n",focus:"fyvr128o",hover:"fyvr128p",checked:"fyvr128q"},defaultClass:"fyvr128l"},bscDark:{conditions:{base:"fyvr128r",active:"fyvr128s",disabled:"fyvr128t",focus:"fyvr128u",hover:"fyvr128v",checked:"fyvr128w"},defaultClass:"fyvr128r"},bscLight:{conditions:{base:"fyvr128x",active:"fyvr128y",disabled:"fyvr128z",focus:"fyvr1290",hover:"fyvr1291",checked:"fyvr1292"},defaultClass:"fyvr128x"},ethereumDark:{conditions:{base:"fyvr1293",active:"fyvr1294",disabled:"fyvr1295",focus:"fyvr1296",hover:"fyvr1297",checked:"fyvr1298"},defaultClass:"fyvr1293"},ethereumLight:{conditions:{base:"fyvr1299",active:"fyvr129a",disabled:"fyvr129b",focus:"fyvr129c",hover:"fyvr129d",checked:"fyvr129e"},defaultClass:"fyvr1299"},gnosisDark:{conditions:{base:"fyvr129f",active:"fyvr129g",disabled:"fyvr129h",focus:"fyvr129i",hover:"fyvr129j",checked:"fyvr129k"},defaultClass:"fyvr129f"},gnosisLight:{conditions:{base:"fyvr129l",active:"fyvr129m",disabled:"fyvr129n",focus:"fyvr129o",hover:"fyvr129p",checked:"fyvr129q"},defaultClass:"fyvr129l"},polygonDark:{conditions:{base:"fyvr129r",active:"fyvr129s",disabled:"fyvr129t",focus:"fyvr129u",hover:"fyvr129v",checked:"fyvr129w"},defaultClass:"fyvr129r"},polygonLight:{conditions:{base:"fyvr129x",active:"fyvr129y",disabled:"fyvr129z",focus:"fyvr12a0",hover:"fyvr12a1",checked:"fyvr12a2"},defaultClass:"fyvr129x"},text100:{conditions:{base:"fyvr12a3",active:"fyvr12a4",disabled:"fyvr12a5",focus:"fyvr12a6",hover:"fyvr12a7",checked:"fyvr12a8"},defaultClass:"fyvr12a3"},text80:{conditions:{base:"fyvr12a9",active:"fyvr12aa",disabled:"fyvr12ab",focus:"fyvr12ac",hover:"fyvr12ad",checked:"fyvr12ae"},defaultClass:"fyvr12a9"},text50:{conditions:{base:"fyvr12af",active:"fyvr12ag",disabled:"fyvr12ah",focus:"fyvr12ai",hover:"fyvr12aj",checked:"fyvr12ak"},defaultClass:"fyvr12af"},textInverse100:{conditions:{base:"fyvr12al",active:"fyvr12am",disabled:"fyvr12an",focus:"fyvr12ao",hover:"fyvr12ap",checked:"fyvr12aq"},defaultClass:"fyvr12al"},backgroundPrimary:{conditions:{base:"fyvr12ar",active:"fyvr12as",disabled:"fyvr12at",focus:"fyvr12au",hover:"fyvr12av",checked:"fyvr12aw"},defaultClass:"fyvr12ar"},backgroundSecondary:{conditions:{base:"fyvr12ax",active:"fyvr12ay",disabled:"fyvr12az",focus:"fyvr12b0",hover:"fyvr12b1",checked:"fyvr12b2"},defaultClass:"fyvr12ax"},backgroundContrast:{conditions:{base:"fyvr12b3",active:"fyvr12b4",disabled:"fyvr12b5",focus:"fyvr12b6",hover:"fyvr12b7",checked:"fyvr12b8"},defaultClass:"fyvr12b3"},backgroundMuted:{conditions:{base:"fyvr12b9",active:"fyvr12ba",disabled:"fyvr12bb",focus:"fyvr12bc",hover:"fyvr12bd",checked:"fyvr12be"},defaultClass:"fyvr12b9"},backgroundControl:{conditions:{base:"fyvr12bf",active:"fyvr12bg",disabled:"fyvr12bh",focus:"fyvr12bi",hover:"fyvr12bj",checked:"fyvr12bk"},defaultClass:"fyvr12bf"},backgroundInverse:{conditions:{base:"fyvr12bl",active:"fyvr12bm",disabled:"fyvr12bn",focus:"fyvr12bo",hover:"fyvr12bp",checked:"fyvr12bq"},defaultClass:"fyvr12bl"},backgroundBackdrop:{conditions:{base:"fyvr12br",active:"fyvr12bs",disabled:"fyvr12bt",focus:"fyvr12bu",hover:"fyvr12bv",checked:"fyvr12bw"},defaultClass:"fyvr12br"},backgroundOverlay:{conditions:{base:"fyvr12bx",active:"fyvr12by",disabled:"fyvr12bz",focus:"fyvr12c0",hover:"fyvr12c1",checked:"fyvr12c2"},defaultClass:"fyvr12bx"},backgroundRaised:{conditions:{base:"fyvr12c3",active:"fyvr12c4",disabled:"fyvr12c5",focus:"fyvr12c6",hover:"fyvr12c7",checked:"fyvr12c8"},defaultClass:"fyvr12c3"},buttonGlass:{conditions:{base:"fyvr12c9",active:"fyvr12ca",disabled:"fyvr12cb",focus:"fyvr12cc",hover:"fyvr12cd",checked:"fyvr12ce"},defaultClass:"fyvr12c9"},buttonEmphasis:{conditions:{base:"fyvr12cf",active:"fyvr12cg",disabled:"fyvr12ch",focus:"fyvr12ci",hover:"fyvr12cj",checked:"fyvr12ck"},defaultClass:"fyvr12cf"},buttonInverse:{conditions:{base:"fyvr12cl",active:"fyvr12cm",disabled:"fyvr12cn",focus:"fyvr12co",hover:"fyvr12cp",checked:"fyvr12cq"},defaultClass:"fyvr12cl"},borderNormal:{conditions:{base:"fyvr12cr",active:"fyvr12cs",disabled:"fyvr12ct",focus:"fyvr12cu",hover:"fyvr12cv",checked:"fyvr12cw"},defaultClass:"fyvr12cr"},borderFocus:{conditions:{base:"fyvr12cx",active:"fyvr12cy",disabled:"fyvr12cz",focus:"fyvr12d0",hover:"fyvr12d1",checked:"fyvr12d2"},defaultClass:"fyvr12cx"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr12d3",active:"fyvr12d4",disabled:"fyvr12d5",focus:"fyvr12d6",hover:"fyvr12d7",checked:"fyvr12d8"},defaultClass:"fyvr12d3"},dashed:{conditions:{base:"fyvr12d9",active:"fyvr12da",disabled:"fyvr12db",focus:"fyvr12dc",hover:"fyvr12dd",checked:"fyvr12de"},defaultClass:"fyvr12d9"},dotted:{conditions:{base:"fyvr12df",active:"fyvr12dg",disabled:"fyvr12dh",focus:"fyvr12di",hover:"fyvr12dj",checked:"fyvr12dk"},defaultClass:"fyvr12df"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr12dl",active:"fyvr12dm",disabled:"fyvr12dn",focus:"fyvr12do",hover:"fyvr12dp",checked:"fyvr12dq"},defaultClass:"fyvr12dl"},white:{conditions:{base:"fyvr12dr",active:"fyvr12ds",disabled:"fyvr12dt",focus:"fyvr12du",hover:"fyvr12dv",checked:"fyvr12dw"},defaultClass:"fyvr12dr"},inherit:{conditions:{base:"fyvr12dx",active:"fyvr12dy",disabled:"fyvr12dz",focus:"fyvr12e0",hover:"fyvr12e1",checked:"fyvr12e2"},defaultClass:"fyvr12dx"},transparent:{conditions:{base:"fyvr12e3",active:"fyvr12e4",disabled:"fyvr12e5",focus:"fyvr12e6",hover:"fyvr12e7",checked:"fyvr12e8"},defaultClass:"fyvr12e3"},positive:{conditions:{base:"fyvr12e9",active:"fyvr12ea",disabled:"fyvr12eb",focus:"fyvr12ec",hover:"fyvr12ed",checked:"fyvr12ee"},defaultClass:"fyvr12e9"},negative:{conditions:{base:"fyvr12ef",active:"fyvr12eg",disabled:"fyvr12eh",focus:"fyvr12ei",hover:"fyvr12ej",checked:"fyvr12ek"},defaultClass:"fyvr12ef"},info:{conditions:{base:"fyvr12el",active:"fyvr12em",disabled:"fyvr12en",focus:"fyvr12eo",hover:"fyvr12ep",checked:"fyvr12eq"},defaultClass:"fyvr12el"},warning:{conditions:{base:"fyvr12er",active:"fyvr12es",disabled:"fyvr12et",focus:"fyvr12eu",hover:"fyvr12ev",checked:"fyvr12ew"},defaultClass:"fyvr12er"},gradientBackdrop:{conditions:{base:"fyvr12ex",active:"fyvr12ey",disabled:"fyvr12ez",focus:"fyvr12f0",hover:"fyvr12f1",checked:"fyvr12f2"},defaultClass:"fyvr12ex"},gradientPrimary:{conditions:{base:"fyvr12f3",active:"fyvr12f4",disabled:"fyvr12f5",focus:"fyvr12f6",hover:"fyvr12f7",checked:"fyvr12f8"},defaultClass:"fyvr12f3"},gradientSecondary:{conditions:{base:"fyvr12f9",active:"fyvr12fa",disabled:"fyvr12fb",focus:"fyvr12fc",hover:"fyvr12fd",checked:"fyvr12fe"},defaultClass:"fyvr12f9"},arbitrumDark:{conditions:{base:"fyvr12ff",active:"fyvr12fg",disabled:"fyvr12fh",focus:"fyvr12fi",hover:"fyvr12fj",checked:"fyvr12fk"},defaultClass:"fyvr12ff"},arbitrumLight:{conditions:{base:"fyvr12fl",active:"fyvr12fm",disabled:"fyvr12fn",focus:"fyvr12fo",hover:"fyvr12fp",checked:"fyvr12fq"},defaultClass:"fyvr12fl"},avalanceDark:{conditions:{base:"fyvr12fr",active:"fyvr12fs",disabled:"fyvr12ft",focus:"fyvr12fu",hover:"fyvr12fv",checked:"fyvr12fw"},defaultClass:"fyvr12fr"},avalanceLight:{conditions:{base:"fyvr12fx",active:"fyvr12fy",disabled:"fyvr12fz",focus:"fyvr12g0",hover:"fyvr12g1",checked:"fyvr12g2"},defaultClass:"fyvr12fx"},bscDark:{conditions:{base:"fyvr12g3",active:"fyvr12g4",disabled:"fyvr12g5",focus:"fyvr12g6",hover:"fyvr12g7",checked:"fyvr12g8"},defaultClass:"fyvr12g3"},bscLight:{conditions:{base:"fyvr12g9",active:"fyvr12ga",disabled:"fyvr12gb",focus:"fyvr12gc",hover:"fyvr12gd",checked:"fyvr12ge"},defaultClass:"fyvr12g9"},ethereumDark:{conditions:{base:"fyvr12gf",active:"fyvr12gg",disabled:"fyvr12gh",focus:"fyvr12gi",hover:"fyvr12gj",checked:"fyvr12gk"},defaultClass:"fyvr12gf"},ethereumLight:{conditions:{base:"fyvr12gl",active:"fyvr12gm",disabled:"fyvr12gn",focus:"fyvr12go",hover:"fyvr12gp",checked:"fyvr12gq"},defaultClass:"fyvr12gl"},gnosisDark:{conditions:{base:"fyvr12gr",active:"fyvr12gs",disabled:"fyvr12gt",focus:"fyvr12gu",hover:"fyvr12gv",checked:"fyvr12gw"},defaultClass:"fyvr12gr"},gnosisLight:{conditions:{base:"fyvr12gx",active:"fyvr12gy",disabled:"fyvr12gz",focus:"fyvr12h0",hover:"fyvr12h1",checked:"fyvr12h2"},defaultClass:"fyvr12gx"},polygonDark:{conditions:{base:"fyvr12h3",active:"fyvr12h4",disabled:"fyvr12h5",focus:"fyvr12h6",hover:"fyvr12h7",checked:"fyvr12h8"},defaultClass:"fyvr12h3"},polygonLight:{conditions:{base:"fyvr12h9",active:"fyvr12ha",disabled:"fyvr12hb",focus:"fyvr12hc",hover:"fyvr12hd",checked:"fyvr12he"},defaultClass:"fyvr12h9"},text100:{conditions:{base:"fyvr12hf",active:"fyvr12hg",disabled:"fyvr12hh",focus:"fyvr12hi",hover:"fyvr12hj",checked:"fyvr12hk"},defaultClass:"fyvr12hf"},text80:{conditions:{base:"fyvr12hl",active:"fyvr12hm",disabled:"fyvr12hn",focus:"fyvr12ho",hover:"fyvr12hp",checked:"fyvr12hq"},defaultClass:"fyvr12hl"},text50:{conditions:{base:"fyvr12hr",active:"fyvr12hs",disabled:"fyvr12ht",focus:"fyvr12hu",hover:"fyvr12hv",checked:"fyvr12hw"},defaultClass:"fyvr12hr"},textInverse100:{conditions:{base:"fyvr12hx",active:"fyvr12hy",disabled:"fyvr12hz",focus:"fyvr12i0",hover:"fyvr12i1",checked:"fyvr12i2"},defaultClass:"fyvr12hx"},backgroundPrimary:{conditions:{base:"fyvr12i3",active:"fyvr12i4",disabled:"fyvr12i5",focus:"fyvr12i6",hover:"fyvr12i7",checked:"fyvr12i8"},defaultClass:"fyvr12i3"},backgroundSecondary:{conditions:{base:"fyvr12i9",active:"fyvr12ia",disabled:"fyvr12ib",focus:"fyvr12ic",hover:"fyvr12id",checked:"fyvr12ie"},defaultClass:"fyvr12i9"},backgroundContrast:{conditions:{base:"fyvr12if",active:"fyvr12ig",disabled:"fyvr12ih",focus:"fyvr12ii",hover:"fyvr12ij",checked:"fyvr12ik"},defaultClass:"fyvr12if"},backgroundMuted:{conditions:{base:"fyvr12il",active:"fyvr12im",disabled:"fyvr12in",focus:"fyvr12io",hover:"fyvr12ip",checked:"fyvr12iq"},defaultClass:"fyvr12il"},backgroundControl:{conditions:{base:"fyvr12ir",active:"fyvr12is",disabled:"fyvr12it",focus:"fyvr12iu",hover:"fyvr12iv",checked:"fyvr12iw"},defaultClass:"fyvr12ir"},backgroundInverse:{conditions:{base:"fyvr12ix",active:"fyvr12iy",disabled:"fyvr12iz",focus:"fyvr12j0",hover:"fyvr12j1",checked:"fyvr12j2"},defaultClass:"fyvr12ix"},backgroundBackdrop:{conditions:{base:"fyvr12j3",active:"fyvr12j4",disabled:"fyvr12j5",focus:"fyvr12j6",hover:"fyvr12j7",checked:"fyvr12j8"},defaultClass:"fyvr12j3"},backgroundOverlay:{conditions:{base:"fyvr12j9",active:"fyvr12ja",disabled:"fyvr12jb",focus:"fyvr12jc",hover:"fyvr12jd",checked:"fyvr12je"},defaultClass:"fyvr12j9"},backgroundRaised:{conditions:{base:"fyvr12jf",active:"fyvr12jg",disabled:"fyvr12jh",focus:"fyvr12ji",hover:"fyvr12jj",checked:"fyvr12jk"},defaultClass:"fyvr12jf"},buttonGlass:{conditions:{base:"fyvr12jl",active:"fyvr12jm",disabled:"fyvr12jn",focus:"fyvr12jo",hover:"fyvr12jp",checked:"fyvr12jq"},defaultClass:"fyvr12jl"},buttonEmphasis:{conditions:{base:"fyvr12jr",active:"fyvr12js",disabled:"fyvr12jt",focus:"fyvr12ju",hover:"fyvr12jv",checked:"fyvr12jw"},defaultClass:"fyvr12jr"},buttonInverse:{conditions:{base:"fyvr12jx",active:"fyvr12jy",disabled:"fyvr12jz",focus:"fyvr12k0",hover:"fyvr12k1",checked:"fyvr12k2"},defaultClass:"fyvr12jx"},borderNormal:{conditions:{base:"fyvr12k3",active:"fyvr12k4",disabled:"fyvr12k5",focus:"fyvr12k6",hover:"fyvr12k7",checked:"fyvr12k8"},defaultClass:"fyvr12k3"},borderFocus:{conditions:{base:"fyvr12k9",active:"fyvr12ka",disabled:"fyvr12kb",focus:"fyvr12kc",hover:"fyvr12kd",checked:"fyvr12ke"},defaultClass:"fyvr12k9"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12kf",active:"fyvr12kg",disabled:"fyvr12kh",focus:"fyvr12ki",hover:"fyvr12kj",checked:"fyvr12kk"},defaultClass:"fyvr12kf"},dashed:{conditions:{base:"fyvr12kl",active:"fyvr12km",disabled:"fyvr12kn",focus:"fyvr12ko",hover:"fyvr12kp",checked:"fyvr12kq"},defaultClass:"fyvr12kl"},dotted:{conditions:{base:"fyvr12kr",active:"fyvr12ks",disabled:"fyvr12kt",focus:"fyvr12ku",hover:"fyvr12kv",checked:"fyvr12kw"},defaultClass:"fyvr12kr"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12kx",active:"fyvr12ky",disabled:"fyvr12kz",focus:"fyvr12l0",hover:"fyvr12l1",checked:"fyvr12l2"},defaultClass:"fyvr12kx"},white:{conditions:{base:"fyvr12l3",active:"fyvr12l4",disabled:"fyvr12l5",focus:"fyvr12l6",hover:"fyvr12l7",checked:"fyvr12l8"},defaultClass:"fyvr12l3"},inherit:{conditions:{base:"fyvr12l9",active:"fyvr12la",disabled:"fyvr12lb",focus:"fyvr12lc",hover:"fyvr12ld",checked:"fyvr12le"},defaultClass:"fyvr12l9"},transparent:{conditions:{base:"fyvr12lf",active:"fyvr12lg",disabled:"fyvr12lh",focus:"fyvr12li",hover:"fyvr12lj",checked:"fyvr12lk"},defaultClass:"fyvr12lf"},positive:{conditions:{base:"fyvr12ll",active:"fyvr12lm",disabled:"fyvr12ln",focus:"fyvr12lo",hover:"fyvr12lp",checked:"fyvr12lq"},defaultClass:"fyvr12ll"},negative:{conditions:{base:"fyvr12lr",active:"fyvr12ls",disabled:"fyvr12lt",focus:"fyvr12lu",hover:"fyvr12lv",checked:"fyvr12lw"},defaultClass:"fyvr12lr"},info:{conditions:{base:"fyvr12lx",active:"fyvr12ly",disabled:"fyvr12lz",focus:"fyvr12m0",hover:"fyvr12m1",checked:"fyvr12m2"},defaultClass:"fyvr12lx"},warning:{conditions:{base:"fyvr12m3",active:"fyvr12m4",disabled:"fyvr12m5",focus:"fyvr12m6",hover:"fyvr12m7",checked:"fyvr12m8"},defaultClass:"fyvr12m3"},gradientBackdrop:{conditions:{base:"fyvr12m9",active:"fyvr12ma",disabled:"fyvr12mb",focus:"fyvr12mc",hover:"fyvr12md",checked:"fyvr12me"},defaultClass:"fyvr12m9"},gradientPrimary:{conditions:{base:"fyvr12mf",active:"fyvr12mg",disabled:"fyvr12mh",focus:"fyvr12mi",hover:"fyvr12mj",checked:"fyvr12mk"},defaultClass:"fyvr12mf"},gradientSecondary:{conditions:{base:"fyvr12ml",active:"fyvr12mm",disabled:"fyvr12mn",focus:"fyvr12mo",hover:"fyvr12mp",checked:"fyvr12mq"},defaultClass:"fyvr12ml"},arbitrumDark:{conditions:{base:"fyvr12mr",active:"fyvr12ms",disabled:"fyvr12mt",focus:"fyvr12mu",hover:"fyvr12mv",checked:"fyvr12mw"},defaultClass:"fyvr12mr"},arbitrumLight:{conditions:{base:"fyvr12mx",active:"fyvr12my",disabled:"fyvr12mz",focus:"fyvr12n0",hover:"fyvr12n1",checked:"fyvr12n2"},defaultClass:"fyvr12mx"},avalanceDark:{conditions:{base:"fyvr12n3",active:"fyvr12n4",disabled:"fyvr12n5",focus:"fyvr12n6",hover:"fyvr12n7",checked:"fyvr12n8"},defaultClass:"fyvr12n3"},avalanceLight:{conditions:{base:"fyvr12n9",active:"fyvr12na",disabled:"fyvr12nb",focus:"fyvr12nc",hover:"fyvr12nd",checked:"fyvr12ne"},defaultClass:"fyvr12n9"},bscDark:{conditions:{base:"fyvr12nf",active:"fyvr12ng",disabled:"fyvr12nh",focus:"fyvr12ni",hover:"fyvr12nj",checked:"fyvr12nk"},defaultClass:"fyvr12nf"},bscLight:{conditions:{base:"fyvr12nl",active:"fyvr12nm",disabled:"fyvr12nn",focus:"fyvr12no",hover:"fyvr12np",checked:"fyvr12nq"},defaultClass:"fyvr12nl"},ethereumDark:{conditions:{base:"fyvr12nr",active:"fyvr12ns",disabled:"fyvr12nt",focus:"fyvr12nu",hover:"fyvr12nv",checked:"fyvr12nw"},defaultClass:"fyvr12nr"},ethereumLight:{conditions:{base:"fyvr12nx",active:"fyvr12ny",disabled:"fyvr12nz",focus:"fyvr12o0",hover:"fyvr12o1",checked:"fyvr12o2"},defaultClass:"fyvr12nx"},gnosisDark:{conditions:{base:"fyvr12o3",active:"fyvr12o4",disabled:"fyvr12o5",focus:"fyvr12o6",hover:"fyvr12o7",checked:"fyvr12o8"},defaultClass:"fyvr12o3"},gnosisLight:{conditions:{base:"fyvr12o9",active:"fyvr12oa",disabled:"fyvr12ob",focus:"fyvr12oc",hover:"fyvr12od",checked:"fyvr12oe"},defaultClass:"fyvr12o9"},polygonDark:{conditions:{base:"fyvr12of",active:"fyvr12og",disabled:"fyvr12oh",focus:"fyvr12oi",hover:"fyvr12oj",checked:"fyvr12ok"},defaultClass:"fyvr12of"},polygonLight:{conditions:{base:"fyvr12ol",active:"fyvr12om",disabled:"fyvr12on",focus:"fyvr12oo",hover:"fyvr12op",checked:"fyvr12oq"},defaultClass:"fyvr12ol"},text100:{conditions:{base:"fyvr12or",active:"fyvr12os",disabled:"fyvr12ot",focus:"fyvr12ou",hover:"fyvr12ov",checked:"fyvr12ow"},defaultClass:"fyvr12or"},text80:{conditions:{base:"fyvr12ox",active:"fyvr12oy",disabled:"fyvr12oz",focus:"fyvr12p0",hover:"fyvr12p1",checked:"fyvr12p2"},defaultClass:"fyvr12ox"},text50:{conditions:{base:"fyvr12p3",active:"fyvr12p4",disabled:"fyvr12p5",focus:"fyvr12p6",hover:"fyvr12p7",checked:"fyvr12p8"},defaultClass:"fyvr12p3"},textInverse100:{conditions:{base:"fyvr12p9",active:"fyvr12pa",disabled:"fyvr12pb",focus:"fyvr12pc",hover:"fyvr12pd",checked:"fyvr12pe"},defaultClass:"fyvr12p9"},backgroundPrimary:{conditions:{base:"fyvr12pf",active:"fyvr12pg",disabled:"fyvr12ph",focus:"fyvr12pi",hover:"fyvr12pj",checked:"fyvr12pk"},defaultClass:"fyvr12pf"},backgroundSecondary:{conditions:{base:"fyvr12pl",active:"fyvr12pm",disabled:"fyvr12pn",focus:"fyvr12po",hover:"fyvr12pp",checked:"fyvr12pq"},defaultClass:"fyvr12pl"},backgroundContrast:{conditions:{base:"fyvr12pr",active:"fyvr12ps",disabled:"fyvr12pt",focus:"fyvr12pu",hover:"fyvr12pv",checked:"fyvr12pw"},defaultClass:"fyvr12pr"},backgroundMuted:{conditions:{base:"fyvr12px",active:"fyvr12py",disabled:"fyvr12pz",focus:"fyvr12q0",hover:"fyvr12q1",checked:"fyvr12q2"},defaultClass:"fyvr12px"},backgroundControl:{conditions:{base:"fyvr12q3",active:"fyvr12q4",disabled:"fyvr12q5",focus:"fyvr12q6",hover:"fyvr12q7",checked:"fyvr12q8"},defaultClass:"fyvr12q3"},backgroundInverse:{conditions:{base:"fyvr12q9",active:"fyvr12qa",disabled:"fyvr12qb",focus:"fyvr12qc",hover:"fyvr12qd",checked:"fyvr12qe"},defaultClass:"fyvr12q9"},backgroundBackdrop:{conditions:{base:"fyvr12qf",active:"fyvr12qg",disabled:"fyvr12qh",focus:"fyvr12qi",hover:"fyvr12qj",checked:"fyvr12qk"},defaultClass:"fyvr12qf"},backgroundOverlay:{conditions:{base:"fyvr12ql",active:"fyvr12qm",disabled:"fyvr12qn",focus:"fyvr12qo",hover:"fyvr12qp",checked:"fyvr12qq"},defaultClass:"fyvr12ql"},backgroundRaised:{conditions:{base:"fyvr12qr",active:"fyvr12qs",disabled:"fyvr12qt",focus:"fyvr12qu",hover:"fyvr12qv",checked:"fyvr12qw"},defaultClass:"fyvr12qr"},buttonGlass:{conditions:{base:"fyvr12qx",active:"fyvr12qy",disabled:"fyvr12qz",focus:"fyvr12r0",hover:"fyvr12r1",checked:"fyvr12r2"},defaultClass:"fyvr12qx"},buttonEmphasis:{conditions:{base:"fyvr12r3",active:"fyvr12r4",disabled:"fyvr12r5",focus:"fyvr12r6",hover:"fyvr12r7",checked:"fyvr12r8"},defaultClass:"fyvr12r3"},buttonInverse:{conditions:{base:"fyvr12r9",active:"fyvr12ra",disabled:"fyvr12rb",focus:"fyvr12rc",hover:"fyvr12rd",checked:"fyvr12re"},defaultClass:"fyvr12r9"},borderNormal:{conditions:{base:"fyvr12rf",active:"fyvr12rg",disabled:"fyvr12rh",focus:"fyvr12ri",hover:"fyvr12rj",checked:"fyvr12rk"},defaultClass:"fyvr12rf"},borderFocus:{conditions:{base:"fyvr12rl",active:"fyvr12rm",disabled:"fyvr12rn",focus:"fyvr12ro",hover:"fyvr12rp",checked:"fyvr12rq"},defaultClass:"fyvr12rl"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12rr",active:"fyvr12rs",disabled:"fyvr12rt",focus:"fyvr12ru",hover:"fyvr12rv",checked:"fyvr12rw"},defaultClass:"fyvr12rr"},dashed:{conditions:{base:"fyvr12rx",active:"fyvr12ry",disabled:"fyvr12rz",focus:"fyvr12s0",hover:"fyvr12s1",checked:"fyvr12s2"},defaultClass:"fyvr12rx"},dotted:{conditions:{base:"fyvr12s3",active:"fyvr12s4",disabled:"fyvr12s5",focus:"fyvr12s6",hover:"fyvr12s7",checked:"fyvr12s8"},defaultClass:"fyvr12s3"}}},border:{values:{none:{conditions:{base:"fyvr12s9",active:"fyvr12sa",disabled:"fyvr12sb",focus:"fyvr12sc",hover:"fyvr12sd",checked:"fyvr12se"},defaultClass:"fyvr12s9"}}},color:{values:{black:{conditions:{base:"fyvr12sf",active:"fyvr12sg",disabled:"fyvr12sh",focus:"fyvr12si",hover:"fyvr12sj",checked:"fyvr12sk"},defaultClass:"fyvr12sf"},white:{conditions:{base:"fyvr12sl",active:"fyvr12sm",disabled:"fyvr12sn",focus:"fyvr12so",hover:"fyvr12sp",checked:"fyvr12sq"},defaultClass:"fyvr12sl"},inherit:{conditions:{base:"fyvr12sr",active:"fyvr12ss",disabled:"fyvr12st",focus:"fyvr12su",hover:"fyvr12sv",checked:"fyvr12sw"},defaultClass:"fyvr12sr"},transparent:{conditions:{base:"fyvr12sx",active:"fyvr12sy",disabled:"fyvr12sz",focus:"fyvr12t0",hover:"fyvr12t1",checked:"fyvr12t2"},defaultClass:"fyvr12sx"},positive:{conditions:{base:"fyvr12t3",active:"fyvr12t4",disabled:"fyvr12t5",focus:"fyvr12t6",hover:"fyvr12t7",checked:"fyvr12t8"},defaultClass:"fyvr12t3"},negative:{conditions:{base:"fyvr12t9",active:"fyvr12ta",disabled:"fyvr12tb",focus:"fyvr12tc",hover:"fyvr12td",checked:"fyvr12te"},defaultClass:"fyvr12t9"},info:{conditions:{base:"fyvr12tf",active:"fyvr12tg",disabled:"fyvr12th",focus:"fyvr12ti",hover:"fyvr12tj",checked:"fyvr12tk"},defaultClass:"fyvr12tf"},warning:{conditions:{base:"fyvr12tl",active:"fyvr12tm",disabled:"fyvr12tn",focus:"fyvr12to",hover:"fyvr12tp",checked:"fyvr12tq"},defaultClass:"fyvr12tl"},gradientBackdrop:{conditions:{base:"fyvr12tr",active:"fyvr12ts",disabled:"fyvr12tt",focus:"fyvr12tu",hover:"fyvr12tv",checked:"fyvr12tw"},defaultClass:"fyvr12tr"},gradientPrimary:{conditions:{base:"fyvr12tx",active:"fyvr12ty",disabled:"fyvr12tz",focus:"fyvr12u0",hover:"fyvr12u1",checked:"fyvr12u2"},defaultClass:"fyvr12tx"},gradientSecondary:{conditions:{base:"fyvr12u3",active:"fyvr12u4",disabled:"fyvr12u5",focus:"fyvr12u6",hover:"fyvr12u7",checked:"fyvr12u8"},defaultClass:"fyvr12u3"},arbitrumDark:{conditions:{base:"fyvr12u9",active:"fyvr12ua",disabled:"fyvr12ub",focus:"fyvr12uc",hover:"fyvr12ud",checked:"fyvr12ue"},defaultClass:"fyvr12u9"},arbitrumLight:{conditions:{base:"fyvr12uf",active:"fyvr12ug",disabled:"fyvr12uh",focus:"fyvr12ui",hover:"fyvr12uj",checked:"fyvr12uk"},defaultClass:"fyvr12uf"},avalanceDark:{conditions:{base:"fyvr12ul",active:"fyvr12um",disabled:"fyvr12un",focus:"fyvr12uo",hover:"fyvr12up",checked:"fyvr12uq"},defaultClass:"fyvr12ul"},avalanceLight:{conditions:{base:"fyvr12ur",active:"fyvr12us",disabled:"fyvr12ut",focus:"fyvr12uu",hover:"fyvr12uv",checked:"fyvr12uw"},defaultClass:"fyvr12ur"},bscDark:{conditions:{base:"fyvr12ux",active:"fyvr12uy",disabled:"fyvr12uz",focus:"fyvr12v0",hover:"fyvr12v1",checked:"fyvr12v2"},defaultClass:"fyvr12ux"},bscLight:{conditions:{base:"fyvr12v3",active:"fyvr12v4",disabled:"fyvr12v5",focus:"fyvr12v6",hover:"fyvr12v7",checked:"fyvr12v8"},defaultClass:"fyvr12v3"},ethereumDark:{conditions:{base:"fyvr12v9",active:"fyvr12va",disabled:"fyvr12vb",focus:"fyvr12vc",hover:"fyvr12vd",checked:"fyvr12ve"},defaultClass:"fyvr12v9"},ethereumLight:{conditions:{base:"fyvr12vf",active:"fyvr12vg",disabled:"fyvr12vh",focus:"fyvr12vi",hover:"fyvr12vj",checked:"fyvr12vk"},defaultClass:"fyvr12vf"},gnosisDark:{conditions:{base:"fyvr12vl",active:"fyvr12vm",disabled:"fyvr12vn",focus:"fyvr12vo",hover:"fyvr12vp",checked:"fyvr12vq"},defaultClass:"fyvr12vl"},gnosisLight:{conditions:{base:"fyvr12vr",active:"fyvr12vs",disabled:"fyvr12vt",focus:"fyvr12vu",hover:"fyvr12vv",checked:"fyvr12vw"},defaultClass:"fyvr12vr"},polygonDark:{conditions:{base:"fyvr12vx",active:"fyvr12vy",disabled:"fyvr12vz",focus:"fyvr12w0",hover:"fyvr12w1",checked:"fyvr12w2"},defaultClass:"fyvr12vx"},polygonLight:{conditions:{base:"fyvr12w3",active:"fyvr12w4",disabled:"fyvr12w5",focus:"fyvr12w6",hover:"fyvr12w7",checked:"fyvr12w8"},defaultClass:"fyvr12w3"},text100:{conditions:{base:"fyvr12w9",active:"fyvr12wa",disabled:"fyvr12wb",focus:"fyvr12wc",hover:"fyvr12wd",checked:"fyvr12we"},defaultClass:"fyvr12w9"},text80:{conditions:{base:"fyvr12wf",active:"fyvr12wg",disabled:"fyvr12wh",focus:"fyvr12wi",hover:"fyvr12wj",checked:"fyvr12wk"},defaultClass:"fyvr12wf"},text50:{conditions:{base:"fyvr12wl",active:"fyvr12wm",disabled:"fyvr12wn",focus:"fyvr12wo",hover:"fyvr12wp",checked:"fyvr12wq"},defaultClass:"fyvr12wl"},textInverse100:{conditions:{base:"fyvr12wr",active:"fyvr12ws",disabled:"fyvr12wt",focus:"fyvr12wu",hover:"fyvr12wv",checked:"fyvr12ww"},defaultClass:"fyvr12wr"},backgroundPrimary:{conditions:{base:"fyvr12wx",active:"fyvr12wy",disabled:"fyvr12wz",focus:"fyvr12x0",hover:"fyvr12x1",checked:"fyvr12x2"},defaultClass:"fyvr12wx"},backgroundSecondary:{conditions:{base:"fyvr12x3",active:"fyvr12x4",disabled:"fyvr12x5",focus:"fyvr12x6",hover:"fyvr12x7",checked:"fyvr12x8"},defaultClass:"fyvr12x3"},backgroundContrast:{conditions:{base:"fyvr12x9",active:"fyvr12xa",disabled:"fyvr12xb",focus:"fyvr12xc",hover:"fyvr12xd",checked:"fyvr12xe"},defaultClass:"fyvr12x9"},backgroundMuted:{conditions:{base:"fyvr12xf",active:"fyvr12xg",disabled:"fyvr12xh",focus:"fyvr12xi",hover:"fyvr12xj",checked:"fyvr12xk"},defaultClass:"fyvr12xf"},backgroundControl:{conditions:{base:"fyvr12xl",active:"fyvr12xm",disabled:"fyvr12xn",focus:"fyvr12xo",hover:"fyvr12xp",checked:"fyvr12xq"},defaultClass:"fyvr12xl"},backgroundInverse:{conditions:{base:"fyvr12xr",active:"fyvr12xs",disabled:"fyvr12xt",focus:"fyvr12xu",hover:"fyvr12xv",checked:"fyvr12xw"},defaultClass:"fyvr12xr"},backgroundBackdrop:{conditions:{base:"fyvr12xx",active:"fyvr12xy",disabled:"fyvr12xz",focus:"fyvr12y0",hover:"fyvr12y1",checked:"fyvr12y2"},defaultClass:"fyvr12xx"},backgroundOverlay:{conditions:{base:"fyvr12y3",active:"fyvr12y4",disabled:"fyvr12y5",focus:"fyvr12y6",hover:"fyvr12y7",checked:"fyvr12y8"},defaultClass:"fyvr12y3"},backgroundRaised:{conditions:{base:"fyvr12y9",active:"fyvr12ya",disabled:"fyvr12yb",focus:"fyvr12yc",hover:"fyvr12yd",checked:"fyvr12ye"},defaultClass:"fyvr12y9"},buttonGlass:{conditions:{base:"fyvr12yf",active:"fyvr12yg",disabled:"fyvr12yh",focus:"fyvr12yi",hover:"fyvr12yj",checked:"fyvr12yk"},defaultClass:"fyvr12yf"},buttonEmphasis:{conditions:{base:"fyvr12yl",active:"fyvr12ym",disabled:"fyvr12yn",focus:"fyvr12yo",hover:"fyvr12yp",checked:"fyvr12yq"},defaultClass:"fyvr12yl"},buttonInverse:{conditions:{base:"fyvr12yr",active:"fyvr12ys",disabled:"fyvr12yt",focus:"fyvr12yu",hover:"fyvr12yv",checked:"fyvr12yw"},defaultClass:"fyvr12yr"},borderNormal:{conditions:{base:"fyvr12yx",active:"fyvr12yy",disabled:"fyvr12yz",focus:"fyvr12z0",hover:"fyvr12z1",checked:"fyvr12z2"},defaultClass:"fyvr12yx"},borderFocus:{conditions:{base:"fyvr12z3",active:"fyvr12z4",disabled:"fyvr12z5",focus:"fyvr12z6",hover:"fyvr12z7",checked:"fyvr12z8"},defaultClass:"fyvr12z3"}}},cursor:{values:{default:{conditions:{base:"fyvr12z9",active:"fyvr12za",disabled:"fyvr12zb",focus:"fyvr12zc",hover:"fyvr12zd",checked:"fyvr12ze"},defaultClass:"fyvr12z9"},pointer:{conditions:{base:"fyvr12zf",active:"fyvr12zg",disabled:"fyvr12zh",focus:"fyvr12zi",hover:"fyvr12zj",checked:"fyvr12zk"},defaultClass:"fyvr12zf"},text:{conditions:{base:"fyvr12zl",active:"fyvr12zm",disabled:"fyvr12zn",focus:"fyvr12zo",hover:"fyvr12zp",checked:"fyvr12zq"},defaultClass:"fyvr12zl"}}},opacity:{values:{0:{conditions:{base:"fyvr12zr",active:"fyvr12zs",disabled:"fyvr12zt",focus:"fyvr12zu",hover:"fyvr12zv",checked:"fyvr12zw"},defaultClass:"fyvr12zr"},50:{conditions:{base:"fyvr12zx",active:"fyvr12zy",disabled:"fyvr12zz",focus:"fyvr1300",hover:"fyvr1301",checked:"fyvr1302"},defaultClass:"fyvr12zx"},80:{conditions:{base:"fyvr1303",active:"fyvr1304",disabled:"fyvr1305",focus:"fyvr1306",hover:"fyvr1307",checked:"fyvr1308"},defaultClass:"fyvr1303"},100:{conditions:{base:"fyvr1309",active:"fyvr130a",disabled:"fyvr130b",focus:"fyvr130c",hover:"fyvr130d",checked:"fyvr130e"},defaultClass:"fyvr1309"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr130f",active:"fyvr130g",disabled:"fyvr130h",focus:"fyvr130i",hover:"fyvr130j",checked:"fyvr130k"},defaultClass:"fyvr130f"},auto:{conditions:{base:"fyvr130l",active:"fyvr130m",disabled:"fyvr130n",focus:"fyvr130o",hover:"fyvr130p",checked:"fyvr130q"},defaultClass:"fyvr130l"}}},outline:{values:{none:{conditions:{base:"fyvr130r",active:"fyvr130s",disabled:"fyvr130t",focus:"fyvr130u",hover:"fyvr130v",checked:"fyvr130w"},defaultClass:"fyvr130r"}}},boxShadow:{values:{none:{conditions:{base:"fyvr130x",active:"fyvr130y",disabled:"fyvr130z",focus:"fyvr1310",hover:"fyvr1311",checked:"fyvr1312"},defaultClass:"fyvr130x"}}}}});const fpe=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],y7=t=>(t.display||(t.display=Object.keys(t).some(e=>fpe.includes(e))?"flex":void 0),MH(t));y7.properties=MH.properties;const upe="https://assets.sequence.info/",dpe=5,hpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},RH=t=>t?hpe[t]||t:"medium",ppe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${RH(e)}/`),vpe=(t,e)=>upe+`images/networks/${RH(e)}/${t}.webp?v${dpe}`;function OH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)y7.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=y7({...o,...n});return D.createElement(r,{className:mi(c,i),...a,ref:e})});var DH={exports:{}},Em={};/** + )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},epe={...IH,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},tpe={...IH,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},rpe={dark:epe,light:tpe},npe={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},oB={sm:0,md:480,lg:769,xl:1281};var aB={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function ipe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function spe(t){var e=ipe(t,"string");return typeof e=="symbol"?e:String(e)}function ope(t,e,r){return e=spe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function RA(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],f={},u=RA({},c),p=!1;for(var g of o){var y=c[g];if(y!=null){var b=i[g];p=!0;for(var I of b.mappings)f[I]=y,u[I]==null&&delete u[I]}}var C=p?RA(RA({},f),u):c,S=function(){var F=C[O],z=i[O];try{if(z.mappings)return 1;if(typeof F=="string"||typeof F=="number")l.push(z.values[F].defaultClass);else if(Array.isArray(F))for(var _=0;_t,lpe=function(){return ape(cpe)(...arguments)},TH=lpe({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},18:{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},20:{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"0.25":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},"0.5":{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},"1.5":{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},none:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},px:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},auto:{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},full:{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"1/2":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/3":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"2/3":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},"1/4":{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},"3/4":{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},fit:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},max:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},min:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"},vw:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},vh:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"}}},height:{values:{0:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},1:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},2:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},3:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},4:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},5:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},6:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},7:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},8:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},9:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},10:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},12:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},14:{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},16:{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},18:{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},20:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},"0.25":{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},"0.5":{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},"1.5":{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},none:{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},px:{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},auto:{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},full:{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"1/2":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},"1/3":{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},"2/3":{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},"1/4":{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},"3/4":{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},fit:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"},max:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},min:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},vw:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},vh:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},1:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},2:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},3:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},4:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},5:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},6:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},7:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},8:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},9:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},10:{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},12:{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},14:{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},16:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},18:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},20:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},"0.25":{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"0.5":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1.5":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},none:{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},px:{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},auto:{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},full:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},"1/2":{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},"1/3":{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},"2/3":{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},"1/4":{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"},"3/4":{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},fit:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},max:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},min:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},vw:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},vh:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},1:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},2:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},3:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},4:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},5:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},6:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},7:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},8:{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},9:{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},10:{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},12:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},14:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},16:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},18:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},20:{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"0.25":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"0.5":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1.5":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},none:{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},px:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},auto:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},full:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},"1/2":{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},"1/3":{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"},"2/3":{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},"1/4":{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},"3/4":{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},fit:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},max:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},min:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},vw:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},vh:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},1:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},2:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},3:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},4:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},5:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},6:{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},7:{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},8:{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},9:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},10:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},12:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},14:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},16:{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},18:{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},20:{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"0.25":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"0.5":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},"1.5":{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},none:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},px:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},auto:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},full:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"},"1/2":{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},"1/3":{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},"2/3":{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},"1/4":{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},"3/4":{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},fit:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},max:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},min:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},vw:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},vh:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},1:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},2:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},3:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},4:{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},5:{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},6:{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},7:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},8:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},9:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},10:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},12:{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},14:{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},16:{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},18:{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},20:{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},"0.25":{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},"0.5":{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},"1.5":{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},none:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},px:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"},auto:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},full:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},"1/2":{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},"1/3":{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},"2/3":{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},"1/4":{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},"3/4":{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},fit:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},max:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},min:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},vw:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},vh:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"}}},top:{values:{0:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},1:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},2:{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},3:{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},4:{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},5:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"},6:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},7:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},8:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},9:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},10:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},12:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},14:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},16:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},18:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},20:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},"0.25":{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},"0.5":{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},"1.5":{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},auto:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"}}},bottom:{values:{0:{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},1:{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},2:{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},3:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"},4:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},5:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},6:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},7:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},8:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},9:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},10:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},12:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},14:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},16:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},18:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},20:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},"0.25":{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},"0.5":{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"1.5":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},auto:{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"}}},left:{values:{0:{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},1:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"},2:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},3:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},4:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},5:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},6:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},7:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},8:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},9:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},10:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},12:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},14:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},16:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},18:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},20:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},right:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},18:{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},20:{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"0.25":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"},"0.5":{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},"1.5":{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},auto:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},1:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},2:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},3:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},4:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},5:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},6:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},7:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},8:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},9:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},10:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},12:{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},14:{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},16:{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"},18:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},20:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},"0.25":{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},"0.5":{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},"1.5":{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},1:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},2:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},3:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},4:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},5:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},6:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},7:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},8:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},9:{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},10:{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},12:{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"},14:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},16:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},18:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},20:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},"0.25":{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},"0.5":{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},"1.5":{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},1:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},2:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},3:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},4:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},5:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},6:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},7:{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},8:{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},9:{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"},10:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},12:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},14:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},16:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},18:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},20:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},"0.25":{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},"0.5":{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},"1.5":{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},1:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},2:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},3:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},4:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},5:{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},6:{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},7:{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},8:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"},9:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},10:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},12:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},14:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},16:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},18:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},20:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},"0.25":{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},"0.5":{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},"1.5":{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"}}},marginTop:{values:{0:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},1:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},2:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},3:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},4:{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},5:{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},6:{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},7:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"},8:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},9:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},10:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},12:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},14:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},16:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},18:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},20:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},"0.25":{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},"0.5":{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},"1.5":{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},auto:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},1:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},2:{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},3:{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},4:{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},5:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"},6:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},7:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},8:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},9:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},10:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},12:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},14:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},16:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},18:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},20:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},"0.25":{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},"0.5":{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},"1.5":{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},auto:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},1:{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},2:{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},3:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"},4:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},5:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},6:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},7:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},8:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},9:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},10:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},12:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},14:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},16:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},18:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},20:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},"0.25":{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},"0.5":{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"1.5":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},auto:{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"}}},marginRight:{values:{0:{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"},1:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},2:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},3:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"},4:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},5:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},6:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"},7:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},8:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},9:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"},10:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},12:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},14:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"},16:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},18:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},20:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},"0.25":{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},"0.5":{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},"1.5":{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"},auto:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"}}},gap:{values:{0:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},1:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},2:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},3:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},4:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"},5:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},6:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},7:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},8:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},9:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},10:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"},12:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},14:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},16:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},18:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},20:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},"0.25":{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"},"0.5":{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},"1.5":{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},thin:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},thick:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},thin:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"},thick:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},thin:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},thick:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"},thin:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},thick:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},xs:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"},sm:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},md:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},lg:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},circle:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},xs:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"},sm:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},md:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},lg:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"},circle:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},xs:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},sm:{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},md:{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},lg:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},circle:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},xs:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},sm:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},md:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"},lg:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},circle:{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},xsmall:{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"},small:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},normal:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"},medium:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},large:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"},xlarge:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},normal:{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"},medium:{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},semibold:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},bold:{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},none:{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},normal:{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},wide:{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},5:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},6:{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},7:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"},9:{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},inherit:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},left:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},right:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},display:{values:{block:{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},flex:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},grid:{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},"inline-block":{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},"inline-flex":{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"},none:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},contents:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"}}},position:{values:{absolute:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},fixed:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"},relative:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},sticky:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},"column-reverse":{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"},row:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},"row-reverse":{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ms",md:"fyvr11mt",lg:"fyvr11mu",xl:"fyvr11mv"},defaultClass:"fyvr11ms"},1:{conditions:{sm:"fyvr11mw",md:"fyvr11mx",lg:"fyvr11my",xl:"fyvr11mz"},defaultClass:"fyvr11mw"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11n0",md:"fyvr11n1",lg:"fyvr11n2",xl:"fyvr11n3"},defaultClass:"fyvr11n0"},1:{conditions:{sm:"fyvr11n4",md:"fyvr11n5",lg:"fyvr11n6",xl:"fyvr11n7"},defaultClass:"fyvr11n4"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11n8",md:"fyvr11n9",lg:"fyvr11na",xl:"fyvr11nb"},defaultClass:"fyvr11n8"},wrap:{conditions:{sm:"fyvr11nc",md:"fyvr11nd",lg:"fyvr11ne",xl:"fyvr11nf"},defaultClass:"fyvr11nc"},"wrap-reverse":{conditions:{sm:"fyvr11ng",md:"fyvr11nh",lg:"fyvr11ni",xl:"fyvr11nj"},defaultClass:"fyvr11ng"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11nk",md:"fyvr11nl",lg:"fyvr11nm",xl:"fyvr11nn"},defaultClass:"fyvr11nk"},center:{conditions:{sm:"fyvr11no",md:"fyvr11np",lg:"fyvr11nq",xl:"fyvr11nr"},defaultClass:"fyvr11no"},"flex-end":{conditions:{sm:"fyvr11ns",md:"fyvr11nt",lg:"fyvr11nu",xl:"fyvr11nv"},defaultClass:"fyvr11ns"},stretch:{conditions:{sm:"fyvr11nw",md:"fyvr11nx",lg:"fyvr11ny",xl:"fyvr11nz"},defaultClass:"fyvr11nw"},"space-around":{conditions:{sm:"fyvr11o0",md:"fyvr11o1",lg:"fyvr11o2",xl:"fyvr11o3"},defaultClass:"fyvr11o0"},"space-between":{conditions:{sm:"fyvr11o4",md:"fyvr11o5",lg:"fyvr11o6",xl:"fyvr11o7"},defaultClass:"fyvr11o4"},"space-evenly":{conditions:{sm:"fyvr11o8",md:"fyvr11o9",lg:"fyvr11oa",xl:"fyvr11ob"},defaultClass:"fyvr11o8"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11oc",md:"fyvr11od",lg:"fyvr11oe",xl:"fyvr11of"},defaultClass:"fyvr11oc"},center:{conditions:{sm:"fyvr11og",md:"fyvr11oh",lg:"fyvr11oi",xl:"fyvr11oj"},defaultClass:"fyvr11og"},"flex-end":{conditions:{sm:"fyvr11ok",md:"fyvr11ol",lg:"fyvr11om",xl:"fyvr11on"},defaultClass:"fyvr11ok"},stretch:{conditions:{sm:"fyvr11oo",md:"fyvr11op",lg:"fyvr11oq",xl:"fyvr11or"},defaultClass:"fyvr11oo"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11os",md:"fyvr11ot",lg:"fyvr11ou",xl:"fyvr11ov"},defaultClass:"fyvr11os"},center:{conditions:{sm:"fyvr11ow",md:"fyvr11ox",lg:"fyvr11oy",xl:"fyvr11oz"},defaultClass:"fyvr11ow"},"flex-end":{conditions:{sm:"fyvr11p0",md:"fyvr11p1",lg:"fyvr11p2",xl:"fyvr11p3"},defaultClass:"fyvr11p0"},stretch:{conditions:{sm:"fyvr11p4",md:"fyvr11p5",lg:"fyvr11p6",xl:"fyvr11p7"},defaultClass:"fyvr11p4"},baseline:{conditions:{sm:"fyvr11p8",md:"fyvr11p9",lg:"fyvr11pa",xl:"fyvr11pb"},defaultClass:"fyvr11p8"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11pc",md:"fyvr11pd",lg:"fyvr11pe",xl:"fyvr11pf"},defaultClass:"fyvr11pc"},center:{conditions:{sm:"fyvr11pg",md:"fyvr11ph",lg:"fyvr11pi",xl:"fyvr11pj"},defaultClass:"fyvr11pg"},"flex-end":{conditions:{sm:"fyvr11pk",md:"fyvr11pl",lg:"fyvr11pm",xl:"fyvr11pn"},defaultClass:"fyvr11pk"},stretch:{conditions:{sm:"fyvr11po",md:"fyvr11pp",lg:"fyvr11pq",xl:"fyvr11pr"},defaultClass:"fyvr11po"},baseline:{conditions:{sm:"fyvr11ps",md:"fyvr11pt",lg:"fyvr11pu",xl:"fyvr11pv"},defaultClass:"fyvr11ps"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11pw",md:"fyvr11px",lg:"fyvr11py",xl:"fyvr11pz"},defaultClass:"fyvr11pw"},hidden:{conditions:{sm:"fyvr11q0",md:"fyvr11q1",lg:"fyvr11q2",xl:"fyvr11q3"},defaultClass:"fyvr11q0"},scroll:{conditions:{sm:"fyvr11q4",md:"fyvr11q5",lg:"fyvr11q6",xl:"fyvr11q7"},defaultClass:"fyvr11q4"},visible:{conditions:{sm:"fyvr11q8",md:"fyvr11q9",lg:"fyvr11qa",xl:"fyvr11qb"},defaultClass:"fyvr11q8"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11qc",md:"fyvr11qd",lg:"fyvr11qe",xl:"fyvr11qf"},defaultClass:"fyvr11qc"},hidden:{conditions:{sm:"fyvr11qg",md:"fyvr11qh",lg:"fyvr11qi",xl:"fyvr11qj"},defaultClass:"fyvr11qg"},scroll:{conditions:{sm:"fyvr11qk",md:"fyvr11ql",lg:"fyvr11qm",xl:"fyvr11qn"},defaultClass:"fyvr11qk"},visible:{conditions:{sm:"fyvr11qo",md:"fyvr11qp",lg:"fyvr11qq",xl:"fyvr11qr"},defaultClass:"fyvr11qo"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11qs",md:"fyvr11qt",lg:"fyvr11qu",xl:"fyvr11qv"},defaultClass:"fyvr11qs"},visible:{conditions:{sm:"fyvr11qw",md:"fyvr11qx",lg:"fyvr11qy",xl:"fyvr11qz"},defaultClass:"fyvr11qw"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11r0"},none:{defaultClass:"fyvr11r1"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11r2"},body:{defaultClass:"fyvr11r3"},mono:{defaultClass:"fyvr11r4"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11r5"},clip:{defaultClass:"fyvr11r6"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11r7"},lowercase:{defaultClass:"fyvr11r8"},uppercase:{defaultClass:"fyvr11r9"}}},textDecoration:{values:{none:{defaultClass:"fyvr11ra"},underline:{defaultClass:"fyvr11rb"}}},userSelect:{values:{none:{defaultClass:"fyvr11rc"},text:{defaultClass:"fyvr11rd"},all:{defaultClass:"fyvr11re"},auto:{defaultClass:"fyvr11rf"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11rg"},nowrap:{defaultClass:"fyvr11rh"},initial:{defaultClass:"fyvr11ri"},inherit:{defaultClass:"fyvr11rj"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11rk"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11rl"},"break-word":{defaultClass:"fyvr11rm"},initial:{defaultClass:"fyvr11rn"},inherit:{defaultClass:"fyvr11ro"}}},zIndex:{values:{0:{defaultClass:"fyvr11rp"},1:{defaultClass:"fyvr11rq"},10:{defaultClass:"fyvr11rr"},20:{defaultClass:"fyvr11rs"},30:{defaultClass:"fyvr11rt"},40:{defaultClass:"fyvr11ru"},50:{defaultClass:"fyvr11rv"},"-1":{defaultClass:"fyvr11rw"},auto:{defaultClass:"fyvr11rx"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11ry"},"16/9":{defaultClass:"fyvr11rz"},"4/3":{defaultClass:"fyvr11s0"},"3/1":{defaultClass:"fyvr11s1"},auto:{defaultClass:"fyvr11s2"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11s3",active:"fyvr11s4",disabled:"fyvr11s5",focus:"fyvr11s6",hover:"fyvr11s7",checked:"fyvr11s8"},defaultClass:"fyvr11s3"},white:{conditions:{base:"fyvr11s9",active:"fyvr11sa",disabled:"fyvr11sb",focus:"fyvr11sc",hover:"fyvr11sd",checked:"fyvr11se"},defaultClass:"fyvr11s9"},inherit:{conditions:{base:"fyvr11sf",active:"fyvr11sg",disabled:"fyvr11sh",focus:"fyvr11si",hover:"fyvr11sj",checked:"fyvr11sk"},defaultClass:"fyvr11sf"},transparent:{conditions:{base:"fyvr11sl",active:"fyvr11sm",disabled:"fyvr11sn",focus:"fyvr11so",hover:"fyvr11sp",checked:"fyvr11sq"},defaultClass:"fyvr11sl"},positive:{conditions:{base:"fyvr11sr",active:"fyvr11ss",disabled:"fyvr11st",focus:"fyvr11su",hover:"fyvr11sv",checked:"fyvr11sw"},defaultClass:"fyvr11sr"},negative:{conditions:{base:"fyvr11sx",active:"fyvr11sy",disabled:"fyvr11sz",focus:"fyvr11t0",hover:"fyvr11t1",checked:"fyvr11t2"},defaultClass:"fyvr11sx"},info:{conditions:{base:"fyvr11t3",active:"fyvr11t4",disabled:"fyvr11t5",focus:"fyvr11t6",hover:"fyvr11t7",checked:"fyvr11t8"},defaultClass:"fyvr11t3"},warning:{conditions:{base:"fyvr11t9",active:"fyvr11ta",disabled:"fyvr11tb",focus:"fyvr11tc",hover:"fyvr11td",checked:"fyvr11te"},defaultClass:"fyvr11t9"},gradientBackdrop:{conditions:{base:"fyvr11tf",active:"fyvr11tg",disabled:"fyvr11th",focus:"fyvr11ti",hover:"fyvr11tj",checked:"fyvr11tk"},defaultClass:"fyvr11tf"},gradientPrimary:{conditions:{base:"fyvr11tl",active:"fyvr11tm",disabled:"fyvr11tn",focus:"fyvr11to",hover:"fyvr11tp",checked:"fyvr11tq"},defaultClass:"fyvr11tl"},gradientSecondary:{conditions:{base:"fyvr11tr",active:"fyvr11ts",disabled:"fyvr11tt",focus:"fyvr11tu",hover:"fyvr11tv",checked:"fyvr11tw"},defaultClass:"fyvr11tr"},arbitrumDark:{conditions:{base:"fyvr11tx",active:"fyvr11ty",disabled:"fyvr11tz",focus:"fyvr11u0",hover:"fyvr11u1",checked:"fyvr11u2"},defaultClass:"fyvr11tx"},arbitrumLight:{conditions:{base:"fyvr11u3",active:"fyvr11u4",disabled:"fyvr11u5",focus:"fyvr11u6",hover:"fyvr11u7",checked:"fyvr11u8"},defaultClass:"fyvr11u3"},avalanceDark:{conditions:{base:"fyvr11u9",active:"fyvr11ua",disabled:"fyvr11ub",focus:"fyvr11uc",hover:"fyvr11ud",checked:"fyvr11ue"},defaultClass:"fyvr11u9"},avalanceLight:{conditions:{base:"fyvr11uf",active:"fyvr11ug",disabled:"fyvr11uh",focus:"fyvr11ui",hover:"fyvr11uj",checked:"fyvr11uk"},defaultClass:"fyvr11uf"},bscDark:{conditions:{base:"fyvr11ul",active:"fyvr11um",disabled:"fyvr11un",focus:"fyvr11uo",hover:"fyvr11up",checked:"fyvr11uq"},defaultClass:"fyvr11ul"},bscLight:{conditions:{base:"fyvr11ur",active:"fyvr11us",disabled:"fyvr11ut",focus:"fyvr11uu",hover:"fyvr11uv",checked:"fyvr11uw"},defaultClass:"fyvr11ur"},ethereumDark:{conditions:{base:"fyvr11ux",active:"fyvr11uy",disabled:"fyvr11uz",focus:"fyvr11v0",hover:"fyvr11v1",checked:"fyvr11v2"},defaultClass:"fyvr11ux"},ethereumLight:{conditions:{base:"fyvr11v3",active:"fyvr11v4",disabled:"fyvr11v5",focus:"fyvr11v6",hover:"fyvr11v7",checked:"fyvr11v8"},defaultClass:"fyvr11v3"},gnosisDark:{conditions:{base:"fyvr11v9",active:"fyvr11va",disabled:"fyvr11vb",focus:"fyvr11vc",hover:"fyvr11vd",checked:"fyvr11ve"},defaultClass:"fyvr11v9"},gnosisLight:{conditions:{base:"fyvr11vf",active:"fyvr11vg",disabled:"fyvr11vh",focus:"fyvr11vi",hover:"fyvr11vj",checked:"fyvr11vk"},defaultClass:"fyvr11vf"},polygonDark:{conditions:{base:"fyvr11vl",active:"fyvr11vm",disabled:"fyvr11vn",focus:"fyvr11vo",hover:"fyvr11vp",checked:"fyvr11vq"},defaultClass:"fyvr11vl"},polygonLight:{conditions:{base:"fyvr11vr",active:"fyvr11vs",disabled:"fyvr11vt",focus:"fyvr11vu",hover:"fyvr11vv",checked:"fyvr11vw"},defaultClass:"fyvr11vr"},text100:{conditions:{base:"fyvr11vx",active:"fyvr11vy",disabled:"fyvr11vz",focus:"fyvr11w0",hover:"fyvr11w1",checked:"fyvr11w2"},defaultClass:"fyvr11vx"},text80:{conditions:{base:"fyvr11w3",active:"fyvr11w4",disabled:"fyvr11w5",focus:"fyvr11w6",hover:"fyvr11w7",checked:"fyvr11w8"},defaultClass:"fyvr11w3"},text50:{conditions:{base:"fyvr11w9",active:"fyvr11wa",disabled:"fyvr11wb",focus:"fyvr11wc",hover:"fyvr11wd",checked:"fyvr11we"},defaultClass:"fyvr11w9"},textInverse100:{conditions:{base:"fyvr11wf",active:"fyvr11wg",disabled:"fyvr11wh",focus:"fyvr11wi",hover:"fyvr11wj",checked:"fyvr11wk"},defaultClass:"fyvr11wf"},backgroundPrimary:{conditions:{base:"fyvr11wl",active:"fyvr11wm",disabled:"fyvr11wn",focus:"fyvr11wo",hover:"fyvr11wp",checked:"fyvr11wq"},defaultClass:"fyvr11wl"},backgroundSecondary:{conditions:{base:"fyvr11wr",active:"fyvr11ws",disabled:"fyvr11wt",focus:"fyvr11wu",hover:"fyvr11wv",checked:"fyvr11ww"},defaultClass:"fyvr11wr"},backgroundContrast:{conditions:{base:"fyvr11wx",active:"fyvr11wy",disabled:"fyvr11wz",focus:"fyvr11x0",hover:"fyvr11x1",checked:"fyvr11x2"},defaultClass:"fyvr11wx"},backgroundMuted:{conditions:{base:"fyvr11x3",active:"fyvr11x4",disabled:"fyvr11x5",focus:"fyvr11x6",hover:"fyvr11x7",checked:"fyvr11x8"},defaultClass:"fyvr11x3"},backgroundControl:{conditions:{base:"fyvr11x9",active:"fyvr11xa",disabled:"fyvr11xb",focus:"fyvr11xc",hover:"fyvr11xd",checked:"fyvr11xe"},defaultClass:"fyvr11x9"},backgroundInverse:{conditions:{base:"fyvr11xf",active:"fyvr11xg",disabled:"fyvr11xh",focus:"fyvr11xi",hover:"fyvr11xj",checked:"fyvr11xk"},defaultClass:"fyvr11xf"},backgroundBackdrop:{conditions:{base:"fyvr11xl",active:"fyvr11xm",disabled:"fyvr11xn",focus:"fyvr11xo",hover:"fyvr11xp",checked:"fyvr11xq"},defaultClass:"fyvr11xl"},backgroundOverlay:{conditions:{base:"fyvr11xr",active:"fyvr11xs",disabled:"fyvr11xt",focus:"fyvr11xu",hover:"fyvr11xv",checked:"fyvr11xw"},defaultClass:"fyvr11xr"},backgroundRaised:{conditions:{base:"fyvr11xx",active:"fyvr11xy",disabled:"fyvr11xz",focus:"fyvr11y0",hover:"fyvr11y1",checked:"fyvr11y2"},defaultClass:"fyvr11xx"},buttonGlass:{conditions:{base:"fyvr11y3",active:"fyvr11y4",disabled:"fyvr11y5",focus:"fyvr11y6",hover:"fyvr11y7",checked:"fyvr11y8"},defaultClass:"fyvr11y3"},buttonEmphasis:{conditions:{base:"fyvr11y9",active:"fyvr11ya",disabled:"fyvr11yb",focus:"fyvr11yc",hover:"fyvr11yd",checked:"fyvr11ye"},defaultClass:"fyvr11y9"},buttonInverse:{conditions:{base:"fyvr11yf",active:"fyvr11yg",disabled:"fyvr11yh",focus:"fyvr11yi",hover:"fyvr11yj",checked:"fyvr11yk"},defaultClass:"fyvr11yf"},borderNormal:{conditions:{base:"fyvr11yl",active:"fyvr11ym",disabled:"fyvr11yn",focus:"fyvr11yo",hover:"fyvr11yp",checked:"fyvr11yq"},defaultClass:"fyvr11yl"},borderFocus:{conditions:{base:"fyvr11yr",active:"fyvr11ys",disabled:"fyvr11yt",focus:"fyvr11yu",hover:"fyvr11yv",checked:"fyvr11yw"},defaultClass:"fyvr11yr"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11yx",active:"fyvr11yy",disabled:"fyvr11yz",focus:"fyvr11z0",hover:"fyvr11z1",checked:"fyvr11z2"},defaultClass:"fyvr11yx"},white:{conditions:{base:"fyvr11z3",active:"fyvr11z4",disabled:"fyvr11z5",focus:"fyvr11z6",hover:"fyvr11z7",checked:"fyvr11z8"},defaultClass:"fyvr11z3"},inherit:{conditions:{base:"fyvr11z9",active:"fyvr11za",disabled:"fyvr11zb",focus:"fyvr11zc",hover:"fyvr11zd",checked:"fyvr11ze"},defaultClass:"fyvr11z9"},transparent:{conditions:{base:"fyvr11zf",active:"fyvr11zg",disabled:"fyvr11zh",focus:"fyvr11zi",hover:"fyvr11zj",checked:"fyvr11zk"},defaultClass:"fyvr11zf"},positive:{conditions:{base:"fyvr11zl",active:"fyvr11zm",disabled:"fyvr11zn",focus:"fyvr11zo",hover:"fyvr11zp",checked:"fyvr11zq"},defaultClass:"fyvr11zl"},negative:{conditions:{base:"fyvr11zr",active:"fyvr11zs",disabled:"fyvr11zt",focus:"fyvr11zu",hover:"fyvr11zv",checked:"fyvr11zw"},defaultClass:"fyvr11zr"},info:{conditions:{base:"fyvr11zx",active:"fyvr11zy",disabled:"fyvr11zz",focus:"fyvr1200",hover:"fyvr1201",checked:"fyvr1202"},defaultClass:"fyvr11zx"},warning:{conditions:{base:"fyvr1203",active:"fyvr1204",disabled:"fyvr1205",focus:"fyvr1206",hover:"fyvr1207",checked:"fyvr1208"},defaultClass:"fyvr1203"},gradientBackdrop:{conditions:{base:"fyvr1209",active:"fyvr120a",disabled:"fyvr120b",focus:"fyvr120c",hover:"fyvr120d",checked:"fyvr120e"},defaultClass:"fyvr1209"},gradientPrimary:{conditions:{base:"fyvr120f",active:"fyvr120g",disabled:"fyvr120h",focus:"fyvr120i",hover:"fyvr120j",checked:"fyvr120k"},defaultClass:"fyvr120f"},gradientSecondary:{conditions:{base:"fyvr120l",active:"fyvr120m",disabled:"fyvr120n",focus:"fyvr120o",hover:"fyvr120p",checked:"fyvr120q"},defaultClass:"fyvr120l"},arbitrumDark:{conditions:{base:"fyvr120r",active:"fyvr120s",disabled:"fyvr120t",focus:"fyvr120u",hover:"fyvr120v",checked:"fyvr120w"},defaultClass:"fyvr120r"},arbitrumLight:{conditions:{base:"fyvr120x",active:"fyvr120y",disabled:"fyvr120z",focus:"fyvr1210",hover:"fyvr1211",checked:"fyvr1212"},defaultClass:"fyvr120x"},avalanceDark:{conditions:{base:"fyvr1213",active:"fyvr1214",disabled:"fyvr1215",focus:"fyvr1216",hover:"fyvr1217",checked:"fyvr1218"},defaultClass:"fyvr1213"},avalanceLight:{conditions:{base:"fyvr1219",active:"fyvr121a",disabled:"fyvr121b",focus:"fyvr121c",hover:"fyvr121d",checked:"fyvr121e"},defaultClass:"fyvr1219"},bscDark:{conditions:{base:"fyvr121f",active:"fyvr121g",disabled:"fyvr121h",focus:"fyvr121i",hover:"fyvr121j",checked:"fyvr121k"},defaultClass:"fyvr121f"},bscLight:{conditions:{base:"fyvr121l",active:"fyvr121m",disabled:"fyvr121n",focus:"fyvr121o",hover:"fyvr121p",checked:"fyvr121q"},defaultClass:"fyvr121l"},ethereumDark:{conditions:{base:"fyvr121r",active:"fyvr121s",disabled:"fyvr121t",focus:"fyvr121u",hover:"fyvr121v",checked:"fyvr121w"},defaultClass:"fyvr121r"},ethereumLight:{conditions:{base:"fyvr121x",active:"fyvr121y",disabled:"fyvr121z",focus:"fyvr1220",hover:"fyvr1221",checked:"fyvr1222"},defaultClass:"fyvr121x"},gnosisDark:{conditions:{base:"fyvr1223",active:"fyvr1224",disabled:"fyvr1225",focus:"fyvr1226",hover:"fyvr1227",checked:"fyvr1228"},defaultClass:"fyvr1223"},gnosisLight:{conditions:{base:"fyvr1229",active:"fyvr122a",disabled:"fyvr122b",focus:"fyvr122c",hover:"fyvr122d",checked:"fyvr122e"},defaultClass:"fyvr1229"},polygonDark:{conditions:{base:"fyvr122f",active:"fyvr122g",disabled:"fyvr122h",focus:"fyvr122i",hover:"fyvr122j",checked:"fyvr122k"},defaultClass:"fyvr122f"},polygonLight:{conditions:{base:"fyvr122l",active:"fyvr122m",disabled:"fyvr122n",focus:"fyvr122o",hover:"fyvr122p",checked:"fyvr122q"},defaultClass:"fyvr122l"},text100:{conditions:{base:"fyvr122r",active:"fyvr122s",disabled:"fyvr122t",focus:"fyvr122u",hover:"fyvr122v",checked:"fyvr122w"},defaultClass:"fyvr122r"},text80:{conditions:{base:"fyvr122x",active:"fyvr122y",disabled:"fyvr122z",focus:"fyvr1230",hover:"fyvr1231",checked:"fyvr1232"},defaultClass:"fyvr122x"},text50:{conditions:{base:"fyvr1233",active:"fyvr1234",disabled:"fyvr1235",focus:"fyvr1236",hover:"fyvr1237",checked:"fyvr1238"},defaultClass:"fyvr1233"},textInverse100:{conditions:{base:"fyvr1239",active:"fyvr123a",disabled:"fyvr123b",focus:"fyvr123c",hover:"fyvr123d",checked:"fyvr123e"},defaultClass:"fyvr1239"},backgroundPrimary:{conditions:{base:"fyvr123f",active:"fyvr123g",disabled:"fyvr123h",focus:"fyvr123i",hover:"fyvr123j",checked:"fyvr123k"},defaultClass:"fyvr123f"},backgroundSecondary:{conditions:{base:"fyvr123l",active:"fyvr123m",disabled:"fyvr123n",focus:"fyvr123o",hover:"fyvr123p",checked:"fyvr123q"},defaultClass:"fyvr123l"},backgroundContrast:{conditions:{base:"fyvr123r",active:"fyvr123s",disabled:"fyvr123t",focus:"fyvr123u",hover:"fyvr123v",checked:"fyvr123w"},defaultClass:"fyvr123r"},backgroundMuted:{conditions:{base:"fyvr123x",active:"fyvr123y",disabled:"fyvr123z",focus:"fyvr1240",hover:"fyvr1241",checked:"fyvr1242"},defaultClass:"fyvr123x"},backgroundControl:{conditions:{base:"fyvr1243",active:"fyvr1244",disabled:"fyvr1245",focus:"fyvr1246",hover:"fyvr1247",checked:"fyvr1248"},defaultClass:"fyvr1243"},backgroundInverse:{conditions:{base:"fyvr1249",active:"fyvr124a",disabled:"fyvr124b",focus:"fyvr124c",hover:"fyvr124d",checked:"fyvr124e"},defaultClass:"fyvr1249"},backgroundBackdrop:{conditions:{base:"fyvr124f",active:"fyvr124g",disabled:"fyvr124h",focus:"fyvr124i",hover:"fyvr124j",checked:"fyvr124k"},defaultClass:"fyvr124f"},backgroundOverlay:{conditions:{base:"fyvr124l",active:"fyvr124m",disabled:"fyvr124n",focus:"fyvr124o",hover:"fyvr124p",checked:"fyvr124q"},defaultClass:"fyvr124l"},backgroundRaised:{conditions:{base:"fyvr124r",active:"fyvr124s",disabled:"fyvr124t",focus:"fyvr124u",hover:"fyvr124v",checked:"fyvr124w"},defaultClass:"fyvr124r"},buttonGlass:{conditions:{base:"fyvr124x",active:"fyvr124y",disabled:"fyvr124z",focus:"fyvr1250",hover:"fyvr1251",checked:"fyvr1252"},defaultClass:"fyvr124x"},buttonEmphasis:{conditions:{base:"fyvr1253",active:"fyvr1254",disabled:"fyvr1255",focus:"fyvr1256",hover:"fyvr1257",checked:"fyvr1258"},defaultClass:"fyvr1253"},buttonInverse:{conditions:{base:"fyvr1259",active:"fyvr125a",disabled:"fyvr125b",focus:"fyvr125c",hover:"fyvr125d",checked:"fyvr125e"},defaultClass:"fyvr1259"},borderNormal:{conditions:{base:"fyvr125f",active:"fyvr125g",disabled:"fyvr125h",focus:"fyvr125i",hover:"fyvr125j",checked:"fyvr125k"},defaultClass:"fyvr125f"},borderFocus:{conditions:{base:"fyvr125l",active:"fyvr125m",disabled:"fyvr125n",focus:"fyvr125o",hover:"fyvr125p",checked:"fyvr125q"},defaultClass:"fyvr125l"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr125r",active:"fyvr125s",disabled:"fyvr125t",focus:"fyvr125u",hover:"fyvr125v",checked:"fyvr125w"},defaultClass:"fyvr125r"},dashed:{conditions:{base:"fyvr125x",active:"fyvr125y",disabled:"fyvr125z",focus:"fyvr1260",hover:"fyvr1261",checked:"fyvr1262"},defaultClass:"fyvr125x"},dotted:{conditions:{base:"fyvr1263",active:"fyvr1264",disabled:"fyvr1265",focus:"fyvr1266",hover:"fyvr1267",checked:"fyvr1268"},defaultClass:"fyvr1263"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1269",active:"fyvr126a",disabled:"fyvr126b",focus:"fyvr126c",hover:"fyvr126d",checked:"fyvr126e"},defaultClass:"fyvr1269"},white:{conditions:{base:"fyvr126f",active:"fyvr126g",disabled:"fyvr126h",focus:"fyvr126i",hover:"fyvr126j",checked:"fyvr126k"},defaultClass:"fyvr126f"},inherit:{conditions:{base:"fyvr126l",active:"fyvr126m",disabled:"fyvr126n",focus:"fyvr126o",hover:"fyvr126p",checked:"fyvr126q"},defaultClass:"fyvr126l"},transparent:{conditions:{base:"fyvr126r",active:"fyvr126s",disabled:"fyvr126t",focus:"fyvr126u",hover:"fyvr126v",checked:"fyvr126w"},defaultClass:"fyvr126r"},positive:{conditions:{base:"fyvr126x",active:"fyvr126y",disabled:"fyvr126z",focus:"fyvr1270",hover:"fyvr1271",checked:"fyvr1272"},defaultClass:"fyvr126x"},negative:{conditions:{base:"fyvr1273",active:"fyvr1274",disabled:"fyvr1275",focus:"fyvr1276",hover:"fyvr1277",checked:"fyvr1278"},defaultClass:"fyvr1273"},info:{conditions:{base:"fyvr1279",active:"fyvr127a",disabled:"fyvr127b",focus:"fyvr127c",hover:"fyvr127d",checked:"fyvr127e"},defaultClass:"fyvr1279"},warning:{conditions:{base:"fyvr127f",active:"fyvr127g",disabled:"fyvr127h",focus:"fyvr127i",hover:"fyvr127j",checked:"fyvr127k"},defaultClass:"fyvr127f"},gradientBackdrop:{conditions:{base:"fyvr127l",active:"fyvr127m",disabled:"fyvr127n",focus:"fyvr127o",hover:"fyvr127p",checked:"fyvr127q"},defaultClass:"fyvr127l"},gradientPrimary:{conditions:{base:"fyvr127r",active:"fyvr127s",disabled:"fyvr127t",focus:"fyvr127u",hover:"fyvr127v",checked:"fyvr127w"},defaultClass:"fyvr127r"},gradientSecondary:{conditions:{base:"fyvr127x",active:"fyvr127y",disabled:"fyvr127z",focus:"fyvr1280",hover:"fyvr1281",checked:"fyvr1282"},defaultClass:"fyvr127x"},arbitrumDark:{conditions:{base:"fyvr1283",active:"fyvr1284",disabled:"fyvr1285",focus:"fyvr1286",hover:"fyvr1287",checked:"fyvr1288"},defaultClass:"fyvr1283"},arbitrumLight:{conditions:{base:"fyvr1289",active:"fyvr128a",disabled:"fyvr128b",focus:"fyvr128c",hover:"fyvr128d",checked:"fyvr128e"},defaultClass:"fyvr1289"},avalanceDark:{conditions:{base:"fyvr128f",active:"fyvr128g",disabled:"fyvr128h",focus:"fyvr128i",hover:"fyvr128j",checked:"fyvr128k"},defaultClass:"fyvr128f"},avalanceLight:{conditions:{base:"fyvr128l",active:"fyvr128m",disabled:"fyvr128n",focus:"fyvr128o",hover:"fyvr128p",checked:"fyvr128q"},defaultClass:"fyvr128l"},bscDark:{conditions:{base:"fyvr128r",active:"fyvr128s",disabled:"fyvr128t",focus:"fyvr128u",hover:"fyvr128v",checked:"fyvr128w"},defaultClass:"fyvr128r"},bscLight:{conditions:{base:"fyvr128x",active:"fyvr128y",disabled:"fyvr128z",focus:"fyvr1290",hover:"fyvr1291",checked:"fyvr1292"},defaultClass:"fyvr128x"},ethereumDark:{conditions:{base:"fyvr1293",active:"fyvr1294",disabled:"fyvr1295",focus:"fyvr1296",hover:"fyvr1297",checked:"fyvr1298"},defaultClass:"fyvr1293"},ethereumLight:{conditions:{base:"fyvr1299",active:"fyvr129a",disabled:"fyvr129b",focus:"fyvr129c",hover:"fyvr129d",checked:"fyvr129e"},defaultClass:"fyvr1299"},gnosisDark:{conditions:{base:"fyvr129f",active:"fyvr129g",disabled:"fyvr129h",focus:"fyvr129i",hover:"fyvr129j",checked:"fyvr129k"},defaultClass:"fyvr129f"},gnosisLight:{conditions:{base:"fyvr129l",active:"fyvr129m",disabled:"fyvr129n",focus:"fyvr129o",hover:"fyvr129p",checked:"fyvr129q"},defaultClass:"fyvr129l"},polygonDark:{conditions:{base:"fyvr129r",active:"fyvr129s",disabled:"fyvr129t",focus:"fyvr129u",hover:"fyvr129v",checked:"fyvr129w"},defaultClass:"fyvr129r"},polygonLight:{conditions:{base:"fyvr129x",active:"fyvr129y",disabled:"fyvr129z",focus:"fyvr12a0",hover:"fyvr12a1",checked:"fyvr12a2"},defaultClass:"fyvr129x"},text100:{conditions:{base:"fyvr12a3",active:"fyvr12a4",disabled:"fyvr12a5",focus:"fyvr12a6",hover:"fyvr12a7",checked:"fyvr12a8"},defaultClass:"fyvr12a3"},text80:{conditions:{base:"fyvr12a9",active:"fyvr12aa",disabled:"fyvr12ab",focus:"fyvr12ac",hover:"fyvr12ad",checked:"fyvr12ae"},defaultClass:"fyvr12a9"},text50:{conditions:{base:"fyvr12af",active:"fyvr12ag",disabled:"fyvr12ah",focus:"fyvr12ai",hover:"fyvr12aj",checked:"fyvr12ak"},defaultClass:"fyvr12af"},textInverse100:{conditions:{base:"fyvr12al",active:"fyvr12am",disabled:"fyvr12an",focus:"fyvr12ao",hover:"fyvr12ap",checked:"fyvr12aq"},defaultClass:"fyvr12al"},backgroundPrimary:{conditions:{base:"fyvr12ar",active:"fyvr12as",disabled:"fyvr12at",focus:"fyvr12au",hover:"fyvr12av",checked:"fyvr12aw"},defaultClass:"fyvr12ar"},backgroundSecondary:{conditions:{base:"fyvr12ax",active:"fyvr12ay",disabled:"fyvr12az",focus:"fyvr12b0",hover:"fyvr12b1",checked:"fyvr12b2"},defaultClass:"fyvr12ax"},backgroundContrast:{conditions:{base:"fyvr12b3",active:"fyvr12b4",disabled:"fyvr12b5",focus:"fyvr12b6",hover:"fyvr12b7",checked:"fyvr12b8"},defaultClass:"fyvr12b3"},backgroundMuted:{conditions:{base:"fyvr12b9",active:"fyvr12ba",disabled:"fyvr12bb",focus:"fyvr12bc",hover:"fyvr12bd",checked:"fyvr12be"},defaultClass:"fyvr12b9"},backgroundControl:{conditions:{base:"fyvr12bf",active:"fyvr12bg",disabled:"fyvr12bh",focus:"fyvr12bi",hover:"fyvr12bj",checked:"fyvr12bk"},defaultClass:"fyvr12bf"},backgroundInverse:{conditions:{base:"fyvr12bl",active:"fyvr12bm",disabled:"fyvr12bn",focus:"fyvr12bo",hover:"fyvr12bp",checked:"fyvr12bq"},defaultClass:"fyvr12bl"},backgroundBackdrop:{conditions:{base:"fyvr12br",active:"fyvr12bs",disabled:"fyvr12bt",focus:"fyvr12bu",hover:"fyvr12bv",checked:"fyvr12bw"},defaultClass:"fyvr12br"},backgroundOverlay:{conditions:{base:"fyvr12bx",active:"fyvr12by",disabled:"fyvr12bz",focus:"fyvr12c0",hover:"fyvr12c1",checked:"fyvr12c2"},defaultClass:"fyvr12bx"},backgroundRaised:{conditions:{base:"fyvr12c3",active:"fyvr12c4",disabled:"fyvr12c5",focus:"fyvr12c6",hover:"fyvr12c7",checked:"fyvr12c8"},defaultClass:"fyvr12c3"},buttonGlass:{conditions:{base:"fyvr12c9",active:"fyvr12ca",disabled:"fyvr12cb",focus:"fyvr12cc",hover:"fyvr12cd",checked:"fyvr12ce"},defaultClass:"fyvr12c9"},buttonEmphasis:{conditions:{base:"fyvr12cf",active:"fyvr12cg",disabled:"fyvr12ch",focus:"fyvr12ci",hover:"fyvr12cj",checked:"fyvr12ck"},defaultClass:"fyvr12cf"},buttonInverse:{conditions:{base:"fyvr12cl",active:"fyvr12cm",disabled:"fyvr12cn",focus:"fyvr12co",hover:"fyvr12cp",checked:"fyvr12cq"},defaultClass:"fyvr12cl"},borderNormal:{conditions:{base:"fyvr12cr",active:"fyvr12cs",disabled:"fyvr12ct",focus:"fyvr12cu",hover:"fyvr12cv",checked:"fyvr12cw"},defaultClass:"fyvr12cr"},borderFocus:{conditions:{base:"fyvr12cx",active:"fyvr12cy",disabled:"fyvr12cz",focus:"fyvr12d0",hover:"fyvr12d1",checked:"fyvr12d2"},defaultClass:"fyvr12cx"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr12d3",active:"fyvr12d4",disabled:"fyvr12d5",focus:"fyvr12d6",hover:"fyvr12d7",checked:"fyvr12d8"},defaultClass:"fyvr12d3"},dashed:{conditions:{base:"fyvr12d9",active:"fyvr12da",disabled:"fyvr12db",focus:"fyvr12dc",hover:"fyvr12dd",checked:"fyvr12de"},defaultClass:"fyvr12d9"},dotted:{conditions:{base:"fyvr12df",active:"fyvr12dg",disabled:"fyvr12dh",focus:"fyvr12di",hover:"fyvr12dj",checked:"fyvr12dk"},defaultClass:"fyvr12df"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr12dl",active:"fyvr12dm",disabled:"fyvr12dn",focus:"fyvr12do",hover:"fyvr12dp",checked:"fyvr12dq"},defaultClass:"fyvr12dl"},white:{conditions:{base:"fyvr12dr",active:"fyvr12ds",disabled:"fyvr12dt",focus:"fyvr12du",hover:"fyvr12dv",checked:"fyvr12dw"},defaultClass:"fyvr12dr"},inherit:{conditions:{base:"fyvr12dx",active:"fyvr12dy",disabled:"fyvr12dz",focus:"fyvr12e0",hover:"fyvr12e1",checked:"fyvr12e2"},defaultClass:"fyvr12dx"},transparent:{conditions:{base:"fyvr12e3",active:"fyvr12e4",disabled:"fyvr12e5",focus:"fyvr12e6",hover:"fyvr12e7",checked:"fyvr12e8"},defaultClass:"fyvr12e3"},positive:{conditions:{base:"fyvr12e9",active:"fyvr12ea",disabled:"fyvr12eb",focus:"fyvr12ec",hover:"fyvr12ed",checked:"fyvr12ee"},defaultClass:"fyvr12e9"},negative:{conditions:{base:"fyvr12ef",active:"fyvr12eg",disabled:"fyvr12eh",focus:"fyvr12ei",hover:"fyvr12ej",checked:"fyvr12ek"},defaultClass:"fyvr12ef"},info:{conditions:{base:"fyvr12el",active:"fyvr12em",disabled:"fyvr12en",focus:"fyvr12eo",hover:"fyvr12ep",checked:"fyvr12eq"},defaultClass:"fyvr12el"},warning:{conditions:{base:"fyvr12er",active:"fyvr12es",disabled:"fyvr12et",focus:"fyvr12eu",hover:"fyvr12ev",checked:"fyvr12ew"},defaultClass:"fyvr12er"},gradientBackdrop:{conditions:{base:"fyvr12ex",active:"fyvr12ey",disabled:"fyvr12ez",focus:"fyvr12f0",hover:"fyvr12f1",checked:"fyvr12f2"},defaultClass:"fyvr12ex"},gradientPrimary:{conditions:{base:"fyvr12f3",active:"fyvr12f4",disabled:"fyvr12f5",focus:"fyvr12f6",hover:"fyvr12f7",checked:"fyvr12f8"},defaultClass:"fyvr12f3"},gradientSecondary:{conditions:{base:"fyvr12f9",active:"fyvr12fa",disabled:"fyvr12fb",focus:"fyvr12fc",hover:"fyvr12fd",checked:"fyvr12fe"},defaultClass:"fyvr12f9"},arbitrumDark:{conditions:{base:"fyvr12ff",active:"fyvr12fg",disabled:"fyvr12fh",focus:"fyvr12fi",hover:"fyvr12fj",checked:"fyvr12fk"},defaultClass:"fyvr12ff"},arbitrumLight:{conditions:{base:"fyvr12fl",active:"fyvr12fm",disabled:"fyvr12fn",focus:"fyvr12fo",hover:"fyvr12fp",checked:"fyvr12fq"},defaultClass:"fyvr12fl"},avalanceDark:{conditions:{base:"fyvr12fr",active:"fyvr12fs",disabled:"fyvr12ft",focus:"fyvr12fu",hover:"fyvr12fv",checked:"fyvr12fw"},defaultClass:"fyvr12fr"},avalanceLight:{conditions:{base:"fyvr12fx",active:"fyvr12fy",disabled:"fyvr12fz",focus:"fyvr12g0",hover:"fyvr12g1",checked:"fyvr12g2"},defaultClass:"fyvr12fx"},bscDark:{conditions:{base:"fyvr12g3",active:"fyvr12g4",disabled:"fyvr12g5",focus:"fyvr12g6",hover:"fyvr12g7",checked:"fyvr12g8"},defaultClass:"fyvr12g3"},bscLight:{conditions:{base:"fyvr12g9",active:"fyvr12ga",disabled:"fyvr12gb",focus:"fyvr12gc",hover:"fyvr12gd",checked:"fyvr12ge"},defaultClass:"fyvr12g9"},ethereumDark:{conditions:{base:"fyvr12gf",active:"fyvr12gg",disabled:"fyvr12gh",focus:"fyvr12gi",hover:"fyvr12gj",checked:"fyvr12gk"},defaultClass:"fyvr12gf"},ethereumLight:{conditions:{base:"fyvr12gl",active:"fyvr12gm",disabled:"fyvr12gn",focus:"fyvr12go",hover:"fyvr12gp",checked:"fyvr12gq"},defaultClass:"fyvr12gl"},gnosisDark:{conditions:{base:"fyvr12gr",active:"fyvr12gs",disabled:"fyvr12gt",focus:"fyvr12gu",hover:"fyvr12gv",checked:"fyvr12gw"},defaultClass:"fyvr12gr"},gnosisLight:{conditions:{base:"fyvr12gx",active:"fyvr12gy",disabled:"fyvr12gz",focus:"fyvr12h0",hover:"fyvr12h1",checked:"fyvr12h2"},defaultClass:"fyvr12gx"},polygonDark:{conditions:{base:"fyvr12h3",active:"fyvr12h4",disabled:"fyvr12h5",focus:"fyvr12h6",hover:"fyvr12h7",checked:"fyvr12h8"},defaultClass:"fyvr12h3"},polygonLight:{conditions:{base:"fyvr12h9",active:"fyvr12ha",disabled:"fyvr12hb",focus:"fyvr12hc",hover:"fyvr12hd",checked:"fyvr12he"},defaultClass:"fyvr12h9"},text100:{conditions:{base:"fyvr12hf",active:"fyvr12hg",disabled:"fyvr12hh",focus:"fyvr12hi",hover:"fyvr12hj",checked:"fyvr12hk"},defaultClass:"fyvr12hf"},text80:{conditions:{base:"fyvr12hl",active:"fyvr12hm",disabled:"fyvr12hn",focus:"fyvr12ho",hover:"fyvr12hp",checked:"fyvr12hq"},defaultClass:"fyvr12hl"},text50:{conditions:{base:"fyvr12hr",active:"fyvr12hs",disabled:"fyvr12ht",focus:"fyvr12hu",hover:"fyvr12hv",checked:"fyvr12hw"},defaultClass:"fyvr12hr"},textInverse100:{conditions:{base:"fyvr12hx",active:"fyvr12hy",disabled:"fyvr12hz",focus:"fyvr12i0",hover:"fyvr12i1",checked:"fyvr12i2"},defaultClass:"fyvr12hx"},backgroundPrimary:{conditions:{base:"fyvr12i3",active:"fyvr12i4",disabled:"fyvr12i5",focus:"fyvr12i6",hover:"fyvr12i7",checked:"fyvr12i8"},defaultClass:"fyvr12i3"},backgroundSecondary:{conditions:{base:"fyvr12i9",active:"fyvr12ia",disabled:"fyvr12ib",focus:"fyvr12ic",hover:"fyvr12id",checked:"fyvr12ie"},defaultClass:"fyvr12i9"},backgroundContrast:{conditions:{base:"fyvr12if",active:"fyvr12ig",disabled:"fyvr12ih",focus:"fyvr12ii",hover:"fyvr12ij",checked:"fyvr12ik"},defaultClass:"fyvr12if"},backgroundMuted:{conditions:{base:"fyvr12il",active:"fyvr12im",disabled:"fyvr12in",focus:"fyvr12io",hover:"fyvr12ip",checked:"fyvr12iq"},defaultClass:"fyvr12il"},backgroundControl:{conditions:{base:"fyvr12ir",active:"fyvr12is",disabled:"fyvr12it",focus:"fyvr12iu",hover:"fyvr12iv",checked:"fyvr12iw"},defaultClass:"fyvr12ir"},backgroundInverse:{conditions:{base:"fyvr12ix",active:"fyvr12iy",disabled:"fyvr12iz",focus:"fyvr12j0",hover:"fyvr12j1",checked:"fyvr12j2"},defaultClass:"fyvr12ix"},backgroundBackdrop:{conditions:{base:"fyvr12j3",active:"fyvr12j4",disabled:"fyvr12j5",focus:"fyvr12j6",hover:"fyvr12j7",checked:"fyvr12j8"},defaultClass:"fyvr12j3"},backgroundOverlay:{conditions:{base:"fyvr12j9",active:"fyvr12ja",disabled:"fyvr12jb",focus:"fyvr12jc",hover:"fyvr12jd",checked:"fyvr12je"},defaultClass:"fyvr12j9"},backgroundRaised:{conditions:{base:"fyvr12jf",active:"fyvr12jg",disabled:"fyvr12jh",focus:"fyvr12ji",hover:"fyvr12jj",checked:"fyvr12jk"},defaultClass:"fyvr12jf"},buttonGlass:{conditions:{base:"fyvr12jl",active:"fyvr12jm",disabled:"fyvr12jn",focus:"fyvr12jo",hover:"fyvr12jp",checked:"fyvr12jq"},defaultClass:"fyvr12jl"},buttonEmphasis:{conditions:{base:"fyvr12jr",active:"fyvr12js",disabled:"fyvr12jt",focus:"fyvr12ju",hover:"fyvr12jv",checked:"fyvr12jw"},defaultClass:"fyvr12jr"},buttonInverse:{conditions:{base:"fyvr12jx",active:"fyvr12jy",disabled:"fyvr12jz",focus:"fyvr12k0",hover:"fyvr12k1",checked:"fyvr12k2"},defaultClass:"fyvr12jx"},borderNormal:{conditions:{base:"fyvr12k3",active:"fyvr12k4",disabled:"fyvr12k5",focus:"fyvr12k6",hover:"fyvr12k7",checked:"fyvr12k8"},defaultClass:"fyvr12k3"},borderFocus:{conditions:{base:"fyvr12k9",active:"fyvr12ka",disabled:"fyvr12kb",focus:"fyvr12kc",hover:"fyvr12kd",checked:"fyvr12ke"},defaultClass:"fyvr12k9"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12kf",active:"fyvr12kg",disabled:"fyvr12kh",focus:"fyvr12ki",hover:"fyvr12kj",checked:"fyvr12kk"},defaultClass:"fyvr12kf"},dashed:{conditions:{base:"fyvr12kl",active:"fyvr12km",disabled:"fyvr12kn",focus:"fyvr12ko",hover:"fyvr12kp",checked:"fyvr12kq"},defaultClass:"fyvr12kl"},dotted:{conditions:{base:"fyvr12kr",active:"fyvr12ks",disabled:"fyvr12kt",focus:"fyvr12ku",hover:"fyvr12kv",checked:"fyvr12kw"},defaultClass:"fyvr12kr"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12kx",active:"fyvr12ky",disabled:"fyvr12kz",focus:"fyvr12l0",hover:"fyvr12l1",checked:"fyvr12l2"},defaultClass:"fyvr12kx"},white:{conditions:{base:"fyvr12l3",active:"fyvr12l4",disabled:"fyvr12l5",focus:"fyvr12l6",hover:"fyvr12l7",checked:"fyvr12l8"},defaultClass:"fyvr12l3"},inherit:{conditions:{base:"fyvr12l9",active:"fyvr12la",disabled:"fyvr12lb",focus:"fyvr12lc",hover:"fyvr12ld",checked:"fyvr12le"},defaultClass:"fyvr12l9"},transparent:{conditions:{base:"fyvr12lf",active:"fyvr12lg",disabled:"fyvr12lh",focus:"fyvr12li",hover:"fyvr12lj",checked:"fyvr12lk"},defaultClass:"fyvr12lf"},positive:{conditions:{base:"fyvr12ll",active:"fyvr12lm",disabled:"fyvr12ln",focus:"fyvr12lo",hover:"fyvr12lp",checked:"fyvr12lq"},defaultClass:"fyvr12ll"},negative:{conditions:{base:"fyvr12lr",active:"fyvr12ls",disabled:"fyvr12lt",focus:"fyvr12lu",hover:"fyvr12lv",checked:"fyvr12lw"},defaultClass:"fyvr12lr"},info:{conditions:{base:"fyvr12lx",active:"fyvr12ly",disabled:"fyvr12lz",focus:"fyvr12m0",hover:"fyvr12m1",checked:"fyvr12m2"},defaultClass:"fyvr12lx"},warning:{conditions:{base:"fyvr12m3",active:"fyvr12m4",disabled:"fyvr12m5",focus:"fyvr12m6",hover:"fyvr12m7",checked:"fyvr12m8"},defaultClass:"fyvr12m3"},gradientBackdrop:{conditions:{base:"fyvr12m9",active:"fyvr12ma",disabled:"fyvr12mb",focus:"fyvr12mc",hover:"fyvr12md",checked:"fyvr12me"},defaultClass:"fyvr12m9"},gradientPrimary:{conditions:{base:"fyvr12mf",active:"fyvr12mg",disabled:"fyvr12mh",focus:"fyvr12mi",hover:"fyvr12mj",checked:"fyvr12mk"},defaultClass:"fyvr12mf"},gradientSecondary:{conditions:{base:"fyvr12ml",active:"fyvr12mm",disabled:"fyvr12mn",focus:"fyvr12mo",hover:"fyvr12mp",checked:"fyvr12mq"},defaultClass:"fyvr12ml"},arbitrumDark:{conditions:{base:"fyvr12mr",active:"fyvr12ms",disabled:"fyvr12mt",focus:"fyvr12mu",hover:"fyvr12mv",checked:"fyvr12mw"},defaultClass:"fyvr12mr"},arbitrumLight:{conditions:{base:"fyvr12mx",active:"fyvr12my",disabled:"fyvr12mz",focus:"fyvr12n0",hover:"fyvr12n1",checked:"fyvr12n2"},defaultClass:"fyvr12mx"},avalanceDark:{conditions:{base:"fyvr12n3",active:"fyvr12n4",disabled:"fyvr12n5",focus:"fyvr12n6",hover:"fyvr12n7",checked:"fyvr12n8"},defaultClass:"fyvr12n3"},avalanceLight:{conditions:{base:"fyvr12n9",active:"fyvr12na",disabled:"fyvr12nb",focus:"fyvr12nc",hover:"fyvr12nd",checked:"fyvr12ne"},defaultClass:"fyvr12n9"},bscDark:{conditions:{base:"fyvr12nf",active:"fyvr12ng",disabled:"fyvr12nh",focus:"fyvr12ni",hover:"fyvr12nj",checked:"fyvr12nk"},defaultClass:"fyvr12nf"},bscLight:{conditions:{base:"fyvr12nl",active:"fyvr12nm",disabled:"fyvr12nn",focus:"fyvr12no",hover:"fyvr12np",checked:"fyvr12nq"},defaultClass:"fyvr12nl"},ethereumDark:{conditions:{base:"fyvr12nr",active:"fyvr12ns",disabled:"fyvr12nt",focus:"fyvr12nu",hover:"fyvr12nv",checked:"fyvr12nw"},defaultClass:"fyvr12nr"},ethereumLight:{conditions:{base:"fyvr12nx",active:"fyvr12ny",disabled:"fyvr12nz",focus:"fyvr12o0",hover:"fyvr12o1",checked:"fyvr12o2"},defaultClass:"fyvr12nx"},gnosisDark:{conditions:{base:"fyvr12o3",active:"fyvr12o4",disabled:"fyvr12o5",focus:"fyvr12o6",hover:"fyvr12o7",checked:"fyvr12o8"},defaultClass:"fyvr12o3"},gnosisLight:{conditions:{base:"fyvr12o9",active:"fyvr12oa",disabled:"fyvr12ob",focus:"fyvr12oc",hover:"fyvr12od",checked:"fyvr12oe"},defaultClass:"fyvr12o9"},polygonDark:{conditions:{base:"fyvr12of",active:"fyvr12og",disabled:"fyvr12oh",focus:"fyvr12oi",hover:"fyvr12oj",checked:"fyvr12ok"},defaultClass:"fyvr12of"},polygonLight:{conditions:{base:"fyvr12ol",active:"fyvr12om",disabled:"fyvr12on",focus:"fyvr12oo",hover:"fyvr12op",checked:"fyvr12oq"},defaultClass:"fyvr12ol"},text100:{conditions:{base:"fyvr12or",active:"fyvr12os",disabled:"fyvr12ot",focus:"fyvr12ou",hover:"fyvr12ov",checked:"fyvr12ow"},defaultClass:"fyvr12or"},text80:{conditions:{base:"fyvr12ox",active:"fyvr12oy",disabled:"fyvr12oz",focus:"fyvr12p0",hover:"fyvr12p1",checked:"fyvr12p2"},defaultClass:"fyvr12ox"},text50:{conditions:{base:"fyvr12p3",active:"fyvr12p4",disabled:"fyvr12p5",focus:"fyvr12p6",hover:"fyvr12p7",checked:"fyvr12p8"},defaultClass:"fyvr12p3"},textInverse100:{conditions:{base:"fyvr12p9",active:"fyvr12pa",disabled:"fyvr12pb",focus:"fyvr12pc",hover:"fyvr12pd",checked:"fyvr12pe"},defaultClass:"fyvr12p9"},backgroundPrimary:{conditions:{base:"fyvr12pf",active:"fyvr12pg",disabled:"fyvr12ph",focus:"fyvr12pi",hover:"fyvr12pj",checked:"fyvr12pk"},defaultClass:"fyvr12pf"},backgroundSecondary:{conditions:{base:"fyvr12pl",active:"fyvr12pm",disabled:"fyvr12pn",focus:"fyvr12po",hover:"fyvr12pp",checked:"fyvr12pq"},defaultClass:"fyvr12pl"},backgroundContrast:{conditions:{base:"fyvr12pr",active:"fyvr12ps",disabled:"fyvr12pt",focus:"fyvr12pu",hover:"fyvr12pv",checked:"fyvr12pw"},defaultClass:"fyvr12pr"},backgroundMuted:{conditions:{base:"fyvr12px",active:"fyvr12py",disabled:"fyvr12pz",focus:"fyvr12q0",hover:"fyvr12q1",checked:"fyvr12q2"},defaultClass:"fyvr12px"},backgroundControl:{conditions:{base:"fyvr12q3",active:"fyvr12q4",disabled:"fyvr12q5",focus:"fyvr12q6",hover:"fyvr12q7",checked:"fyvr12q8"},defaultClass:"fyvr12q3"},backgroundInverse:{conditions:{base:"fyvr12q9",active:"fyvr12qa",disabled:"fyvr12qb",focus:"fyvr12qc",hover:"fyvr12qd",checked:"fyvr12qe"},defaultClass:"fyvr12q9"},backgroundBackdrop:{conditions:{base:"fyvr12qf",active:"fyvr12qg",disabled:"fyvr12qh",focus:"fyvr12qi",hover:"fyvr12qj",checked:"fyvr12qk"},defaultClass:"fyvr12qf"},backgroundOverlay:{conditions:{base:"fyvr12ql",active:"fyvr12qm",disabled:"fyvr12qn",focus:"fyvr12qo",hover:"fyvr12qp",checked:"fyvr12qq"},defaultClass:"fyvr12ql"},backgroundRaised:{conditions:{base:"fyvr12qr",active:"fyvr12qs",disabled:"fyvr12qt",focus:"fyvr12qu",hover:"fyvr12qv",checked:"fyvr12qw"},defaultClass:"fyvr12qr"},buttonGlass:{conditions:{base:"fyvr12qx",active:"fyvr12qy",disabled:"fyvr12qz",focus:"fyvr12r0",hover:"fyvr12r1",checked:"fyvr12r2"},defaultClass:"fyvr12qx"},buttonEmphasis:{conditions:{base:"fyvr12r3",active:"fyvr12r4",disabled:"fyvr12r5",focus:"fyvr12r6",hover:"fyvr12r7",checked:"fyvr12r8"},defaultClass:"fyvr12r3"},buttonInverse:{conditions:{base:"fyvr12r9",active:"fyvr12ra",disabled:"fyvr12rb",focus:"fyvr12rc",hover:"fyvr12rd",checked:"fyvr12re"},defaultClass:"fyvr12r9"},borderNormal:{conditions:{base:"fyvr12rf",active:"fyvr12rg",disabled:"fyvr12rh",focus:"fyvr12ri",hover:"fyvr12rj",checked:"fyvr12rk"},defaultClass:"fyvr12rf"},borderFocus:{conditions:{base:"fyvr12rl",active:"fyvr12rm",disabled:"fyvr12rn",focus:"fyvr12ro",hover:"fyvr12rp",checked:"fyvr12rq"},defaultClass:"fyvr12rl"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12rr",active:"fyvr12rs",disabled:"fyvr12rt",focus:"fyvr12ru",hover:"fyvr12rv",checked:"fyvr12rw"},defaultClass:"fyvr12rr"},dashed:{conditions:{base:"fyvr12rx",active:"fyvr12ry",disabled:"fyvr12rz",focus:"fyvr12s0",hover:"fyvr12s1",checked:"fyvr12s2"},defaultClass:"fyvr12rx"},dotted:{conditions:{base:"fyvr12s3",active:"fyvr12s4",disabled:"fyvr12s5",focus:"fyvr12s6",hover:"fyvr12s7",checked:"fyvr12s8"},defaultClass:"fyvr12s3"}}},border:{values:{none:{conditions:{base:"fyvr12s9",active:"fyvr12sa",disabled:"fyvr12sb",focus:"fyvr12sc",hover:"fyvr12sd",checked:"fyvr12se"},defaultClass:"fyvr12s9"}}},color:{values:{black:{conditions:{base:"fyvr12sf",active:"fyvr12sg",disabled:"fyvr12sh",focus:"fyvr12si",hover:"fyvr12sj",checked:"fyvr12sk"},defaultClass:"fyvr12sf"},white:{conditions:{base:"fyvr12sl",active:"fyvr12sm",disabled:"fyvr12sn",focus:"fyvr12so",hover:"fyvr12sp",checked:"fyvr12sq"},defaultClass:"fyvr12sl"},inherit:{conditions:{base:"fyvr12sr",active:"fyvr12ss",disabled:"fyvr12st",focus:"fyvr12su",hover:"fyvr12sv",checked:"fyvr12sw"},defaultClass:"fyvr12sr"},transparent:{conditions:{base:"fyvr12sx",active:"fyvr12sy",disabled:"fyvr12sz",focus:"fyvr12t0",hover:"fyvr12t1",checked:"fyvr12t2"},defaultClass:"fyvr12sx"},positive:{conditions:{base:"fyvr12t3",active:"fyvr12t4",disabled:"fyvr12t5",focus:"fyvr12t6",hover:"fyvr12t7",checked:"fyvr12t8"},defaultClass:"fyvr12t3"},negative:{conditions:{base:"fyvr12t9",active:"fyvr12ta",disabled:"fyvr12tb",focus:"fyvr12tc",hover:"fyvr12td",checked:"fyvr12te"},defaultClass:"fyvr12t9"},info:{conditions:{base:"fyvr12tf",active:"fyvr12tg",disabled:"fyvr12th",focus:"fyvr12ti",hover:"fyvr12tj",checked:"fyvr12tk"},defaultClass:"fyvr12tf"},warning:{conditions:{base:"fyvr12tl",active:"fyvr12tm",disabled:"fyvr12tn",focus:"fyvr12to",hover:"fyvr12tp",checked:"fyvr12tq"},defaultClass:"fyvr12tl"},gradientBackdrop:{conditions:{base:"fyvr12tr",active:"fyvr12ts",disabled:"fyvr12tt",focus:"fyvr12tu",hover:"fyvr12tv",checked:"fyvr12tw"},defaultClass:"fyvr12tr"},gradientPrimary:{conditions:{base:"fyvr12tx",active:"fyvr12ty",disabled:"fyvr12tz",focus:"fyvr12u0",hover:"fyvr12u1",checked:"fyvr12u2"},defaultClass:"fyvr12tx"},gradientSecondary:{conditions:{base:"fyvr12u3",active:"fyvr12u4",disabled:"fyvr12u5",focus:"fyvr12u6",hover:"fyvr12u7",checked:"fyvr12u8"},defaultClass:"fyvr12u3"},arbitrumDark:{conditions:{base:"fyvr12u9",active:"fyvr12ua",disabled:"fyvr12ub",focus:"fyvr12uc",hover:"fyvr12ud",checked:"fyvr12ue"},defaultClass:"fyvr12u9"},arbitrumLight:{conditions:{base:"fyvr12uf",active:"fyvr12ug",disabled:"fyvr12uh",focus:"fyvr12ui",hover:"fyvr12uj",checked:"fyvr12uk"},defaultClass:"fyvr12uf"},avalanceDark:{conditions:{base:"fyvr12ul",active:"fyvr12um",disabled:"fyvr12un",focus:"fyvr12uo",hover:"fyvr12up",checked:"fyvr12uq"},defaultClass:"fyvr12ul"},avalanceLight:{conditions:{base:"fyvr12ur",active:"fyvr12us",disabled:"fyvr12ut",focus:"fyvr12uu",hover:"fyvr12uv",checked:"fyvr12uw"},defaultClass:"fyvr12ur"},bscDark:{conditions:{base:"fyvr12ux",active:"fyvr12uy",disabled:"fyvr12uz",focus:"fyvr12v0",hover:"fyvr12v1",checked:"fyvr12v2"},defaultClass:"fyvr12ux"},bscLight:{conditions:{base:"fyvr12v3",active:"fyvr12v4",disabled:"fyvr12v5",focus:"fyvr12v6",hover:"fyvr12v7",checked:"fyvr12v8"},defaultClass:"fyvr12v3"},ethereumDark:{conditions:{base:"fyvr12v9",active:"fyvr12va",disabled:"fyvr12vb",focus:"fyvr12vc",hover:"fyvr12vd",checked:"fyvr12ve"},defaultClass:"fyvr12v9"},ethereumLight:{conditions:{base:"fyvr12vf",active:"fyvr12vg",disabled:"fyvr12vh",focus:"fyvr12vi",hover:"fyvr12vj",checked:"fyvr12vk"},defaultClass:"fyvr12vf"},gnosisDark:{conditions:{base:"fyvr12vl",active:"fyvr12vm",disabled:"fyvr12vn",focus:"fyvr12vo",hover:"fyvr12vp",checked:"fyvr12vq"},defaultClass:"fyvr12vl"},gnosisLight:{conditions:{base:"fyvr12vr",active:"fyvr12vs",disabled:"fyvr12vt",focus:"fyvr12vu",hover:"fyvr12vv",checked:"fyvr12vw"},defaultClass:"fyvr12vr"},polygonDark:{conditions:{base:"fyvr12vx",active:"fyvr12vy",disabled:"fyvr12vz",focus:"fyvr12w0",hover:"fyvr12w1",checked:"fyvr12w2"},defaultClass:"fyvr12vx"},polygonLight:{conditions:{base:"fyvr12w3",active:"fyvr12w4",disabled:"fyvr12w5",focus:"fyvr12w6",hover:"fyvr12w7",checked:"fyvr12w8"},defaultClass:"fyvr12w3"},text100:{conditions:{base:"fyvr12w9",active:"fyvr12wa",disabled:"fyvr12wb",focus:"fyvr12wc",hover:"fyvr12wd",checked:"fyvr12we"},defaultClass:"fyvr12w9"},text80:{conditions:{base:"fyvr12wf",active:"fyvr12wg",disabled:"fyvr12wh",focus:"fyvr12wi",hover:"fyvr12wj",checked:"fyvr12wk"},defaultClass:"fyvr12wf"},text50:{conditions:{base:"fyvr12wl",active:"fyvr12wm",disabled:"fyvr12wn",focus:"fyvr12wo",hover:"fyvr12wp",checked:"fyvr12wq"},defaultClass:"fyvr12wl"},textInverse100:{conditions:{base:"fyvr12wr",active:"fyvr12ws",disabled:"fyvr12wt",focus:"fyvr12wu",hover:"fyvr12wv",checked:"fyvr12ww"},defaultClass:"fyvr12wr"},backgroundPrimary:{conditions:{base:"fyvr12wx",active:"fyvr12wy",disabled:"fyvr12wz",focus:"fyvr12x0",hover:"fyvr12x1",checked:"fyvr12x2"},defaultClass:"fyvr12wx"},backgroundSecondary:{conditions:{base:"fyvr12x3",active:"fyvr12x4",disabled:"fyvr12x5",focus:"fyvr12x6",hover:"fyvr12x7",checked:"fyvr12x8"},defaultClass:"fyvr12x3"},backgroundContrast:{conditions:{base:"fyvr12x9",active:"fyvr12xa",disabled:"fyvr12xb",focus:"fyvr12xc",hover:"fyvr12xd",checked:"fyvr12xe"},defaultClass:"fyvr12x9"},backgroundMuted:{conditions:{base:"fyvr12xf",active:"fyvr12xg",disabled:"fyvr12xh",focus:"fyvr12xi",hover:"fyvr12xj",checked:"fyvr12xk"},defaultClass:"fyvr12xf"},backgroundControl:{conditions:{base:"fyvr12xl",active:"fyvr12xm",disabled:"fyvr12xn",focus:"fyvr12xo",hover:"fyvr12xp",checked:"fyvr12xq"},defaultClass:"fyvr12xl"},backgroundInverse:{conditions:{base:"fyvr12xr",active:"fyvr12xs",disabled:"fyvr12xt",focus:"fyvr12xu",hover:"fyvr12xv",checked:"fyvr12xw"},defaultClass:"fyvr12xr"},backgroundBackdrop:{conditions:{base:"fyvr12xx",active:"fyvr12xy",disabled:"fyvr12xz",focus:"fyvr12y0",hover:"fyvr12y1",checked:"fyvr12y2"},defaultClass:"fyvr12xx"},backgroundOverlay:{conditions:{base:"fyvr12y3",active:"fyvr12y4",disabled:"fyvr12y5",focus:"fyvr12y6",hover:"fyvr12y7",checked:"fyvr12y8"},defaultClass:"fyvr12y3"},backgroundRaised:{conditions:{base:"fyvr12y9",active:"fyvr12ya",disabled:"fyvr12yb",focus:"fyvr12yc",hover:"fyvr12yd",checked:"fyvr12ye"},defaultClass:"fyvr12y9"},buttonGlass:{conditions:{base:"fyvr12yf",active:"fyvr12yg",disabled:"fyvr12yh",focus:"fyvr12yi",hover:"fyvr12yj",checked:"fyvr12yk"},defaultClass:"fyvr12yf"},buttonEmphasis:{conditions:{base:"fyvr12yl",active:"fyvr12ym",disabled:"fyvr12yn",focus:"fyvr12yo",hover:"fyvr12yp",checked:"fyvr12yq"},defaultClass:"fyvr12yl"},buttonInverse:{conditions:{base:"fyvr12yr",active:"fyvr12ys",disabled:"fyvr12yt",focus:"fyvr12yu",hover:"fyvr12yv",checked:"fyvr12yw"},defaultClass:"fyvr12yr"},borderNormal:{conditions:{base:"fyvr12yx",active:"fyvr12yy",disabled:"fyvr12yz",focus:"fyvr12z0",hover:"fyvr12z1",checked:"fyvr12z2"},defaultClass:"fyvr12yx"},borderFocus:{conditions:{base:"fyvr12z3",active:"fyvr12z4",disabled:"fyvr12z5",focus:"fyvr12z6",hover:"fyvr12z7",checked:"fyvr12z8"},defaultClass:"fyvr12z3"}}},cursor:{values:{default:{conditions:{base:"fyvr12z9",active:"fyvr12za",disabled:"fyvr12zb",focus:"fyvr12zc",hover:"fyvr12zd",checked:"fyvr12ze"},defaultClass:"fyvr12z9"},pointer:{conditions:{base:"fyvr12zf",active:"fyvr12zg",disabled:"fyvr12zh",focus:"fyvr12zi",hover:"fyvr12zj",checked:"fyvr12zk"},defaultClass:"fyvr12zf"},text:{conditions:{base:"fyvr12zl",active:"fyvr12zm",disabled:"fyvr12zn",focus:"fyvr12zo",hover:"fyvr12zp",checked:"fyvr12zq"},defaultClass:"fyvr12zl"}}},opacity:{values:{0:{conditions:{base:"fyvr12zr",active:"fyvr12zs",disabled:"fyvr12zt",focus:"fyvr12zu",hover:"fyvr12zv",checked:"fyvr12zw"},defaultClass:"fyvr12zr"},50:{conditions:{base:"fyvr12zx",active:"fyvr12zy",disabled:"fyvr12zz",focus:"fyvr1300",hover:"fyvr1301",checked:"fyvr1302"},defaultClass:"fyvr12zx"},80:{conditions:{base:"fyvr1303",active:"fyvr1304",disabled:"fyvr1305",focus:"fyvr1306",hover:"fyvr1307",checked:"fyvr1308"},defaultClass:"fyvr1303"},100:{conditions:{base:"fyvr1309",active:"fyvr130a",disabled:"fyvr130b",focus:"fyvr130c",hover:"fyvr130d",checked:"fyvr130e"},defaultClass:"fyvr1309"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr130f",active:"fyvr130g",disabled:"fyvr130h",focus:"fyvr130i",hover:"fyvr130j",checked:"fyvr130k"},defaultClass:"fyvr130f"},auto:{conditions:{base:"fyvr130l",active:"fyvr130m",disabled:"fyvr130n",focus:"fyvr130o",hover:"fyvr130p",checked:"fyvr130q"},defaultClass:"fyvr130l"}}},outline:{values:{none:{conditions:{base:"fyvr130r",active:"fyvr130s",disabled:"fyvr130t",focus:"fyvr130u",hover:"fyvr130v",checked:"fyvr130w"},defaultClass:"fyvr130r"}}},boxShadow:{values:{none:{conditions:{base:"fyvr130x",active:"fyvr130y",disabled:"fyvr130z",focus:"fyvr1310",hover:"fyvr1311",checked:"fyvr1312"},defaultClass:"fyvr130x"}}}}});const fpe=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],p7=t=>(t.display||(t.display=Object.keys(t).some(e=>fpe.includes(e))?"flex":void 0),TH(t));p7.properties=TH.properties;const upe="https://assets.sequence.info/",dpe=5,hpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},PH=t=>t?hpe[t]||t:"medium",ppe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${PH(e)}/`),vpe=(t,e)=>upe+`images/networks/${PH(e)}/${t}.webp?v${dpe}`;function kH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)p7.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=p7({...o,...n});return D.createElement(r,{className:pi(c,i),...a,ref:e})});var MH={exports:{}},xm={};/** * @license React * react-jsx-runtime.production.min.js * @@ -58,12 +58,12 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var dB;function gpe(){if(dB)return Em;dB=1;var t=qt,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var f,u={},p=null,g=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)n.call(c,f)&&!s.hasOwnProperty(f)&&(u[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)u[f]===void 0&&(u[f]=c[f]);return{$$typeof:e,type:a,key:p,ref:g,props:u,_owner:i.current}}return Em.Fragment=r,Em.jsx=o,Em.jsxs=o,Em}DH.exports=gpe();var Y=DH.exports;function ype(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mpe(t){var e=ype(t,"string");return typeof e=="symbol"?e:String(e)}function bpe(t,e,r){return e=mpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pB(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},Fn=t=>{var e=r=>{var n=t.defaultClassName,i=pB(pB({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[f,u]of t.compoundVariants)wpe(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return vB(t.variantClassNames,r=>vB(r,n=>n.split(" ")[0]))}},e};Fn({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11t3",warning:"_2q9vfj9 _2q9vfj1 fyvr11t9",success:"_2q9vfja _2q9vfj2 fyvr11sr",error:"_2q9vfjb _2q9vfj3 fyvr11sx"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _2q9vfj4 fyvr1zc fyvr111g fyvr144 fyvr1f4",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _2q9vfj5 fyvr1zg fyvr111k fyvr148 fyvr1f8",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk _2q9vfj6 fyvr1zk fyvr111o fyvr14c fyvr1fc"}},defaultVariants:{},compoundVariants:[]});const Sh=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(xe,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var xpe=Fn({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11r2 fyvr11ic fyvr11ko fyvr11jo fyvr11j4",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11r3 fyvr11j0 fyvr11kk fyvr11js fyvr11jk",large:"_1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg",medium:"_1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk",normal:"_1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",small:"_1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk",code:"_1qxj1ibh _1qxj1ib7 fyvr11r4 fyvr11io fyvr11k8 fyvr11js fyvr11j8"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11q0 fyvr11qg fyvr11rh fyvr11r5"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Ge=D.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:f,capitalize:u,...p}=t,g=npe[n];return Y.jsx(xe,{as:r,className:mi(i,xpe({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...g,...p,children:c})});var Epe=Fn({defaultClassName:"_140wn8ni _140wn8n0 fyvr11q0 fyvr11qg fyvr11rh fyvr11ow fyvr12s9 fyvr11ra fyvr11l8 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11sl fyvr12w9",ghost:"_140wn8nk _140wn8n2 fyvr11sl fyvr12w9",feature:"_140wn8nl _140wn8n3 fyvr11tr fyvr12sl",primary:"_140wn8nm _140wn8n4 fyvr11tl fyvr12sl",glass:"_140wn8nn _140wn8n5 fyvr11y3 fyvr12w9",emphasis:"_140wn8no _140wn8n6 fyvr11y9 fyvr12w9",raised:"_140wn8np _140wn8n7 fyvr11xx fyvr12w9",danger:"_140wn8nq _140wn8n8 fyvr11sx fyvr12sl",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _140wn8n9 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr11sl fyvr12wl"},shape:{circle:"_140wn8ns _140wn8na fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",square:"_140wn8nt _140wn8nb fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"},disabled:{true:"_140wn8nu _140wn8nc fyvr12z9 fyvr12zx",false:"_140wn8nv _140wn8nd fyvr12zf fyvr1309 fyvr1307"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _140wn8ne fyvr1zg fyvr111k",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nf fyvr1zk fyvr111o",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8ng fyvr1zo fyvr111s",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nh fyvr1zo fyvr111s"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const Zt=D.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:f,rightIcon:u,size:p="md",variant:g="glass",width:y="fit",shape:b="circle",type:I="button",...C}=t,S=f!==void 0&&l!==void 0,O=u!==void 0&&l!==void 0,L=f!==void 0&&l===void 0,F=p==="xs"?"xs":"sm";return Y.jsx(xe,{as:r,className:mi(i,Epe({activeOutline:n,disabled:s||c,hasLeftIcon:S,hasRightIcon:O,iconOnly:L,size:g==="text"?void 0:p,shape:g==="text"?void 0:b,variant:g})),disabled:s||c,display:o,fontWeight:a,ref:e,type:I,width:y,...C,children:L?Y.jsx(f,{size:F}):Y.jsxs(xe,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(xe,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(Ge,{children:l})]}),u&&Y.jsx(u,{size:F})]})})});var Cpe=Fn({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11ec fyvr11eo fyvr11f0 fyvr11fc fyvr1307 fyvr12zf _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rr fyvr12kf fyvr125r fyvr12d3"},blur:{true:"rhmai67 rhmai62 fyvr11r0"}},defaultVariants:{},compoundVariants:[]});const $r=D.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return Y.jsx(xe,{className:mi(r,Cpe({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function Ape(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function K4(...t){return e=>t.forEach(r=>Ape(r,e))}function Tr(...t){return D.useCallback(K4(...t),t)}function Spe(t,e){const r=D.createContext(e);function n(s){const{children:o,...a}=s,c=D.useMemo(()=>a,Object.values(a));return Y.jsx(r.Provider,{value:c,children:o})}function i(s){const o=D.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return n.displayName=t+"Provider",[n,i]}function Bs(t,e=[]){let r=[];function n(s,o){const a=D.createContext(o),c=r.length;r=[...r,o];function l(u){const{scope:p,children:g,...y}=u,b=(p==null?void 0:p[t][c])||a,I=D.useMemo(()=>y,Object.values(y));return Y.jsx(b.Provider,{value:I,children:g})}function f(u,p){const g=(p==null?void 0:p[t][c])||a,y=D.useContext(g);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,f]}const i=()=>{const s=r.map(o=>D.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return D.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,_pe(i,...e)]}function _pe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const u=c(s)[`__scope${l}`];return{...a,...u}},{});return D.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function ot(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Ds(t){const e=D.useRef(t);return D.useEffect(()=>{e.current=t}),D.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function ic({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Ipe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Ds(r),c=D.useCallback(l=>{if(s){const u=typeof l=="function"?l(t):l;u!==t&&a(u)}else i(l)},[s,t,i,a]);return[o,c]}function Ipe({defaultProp:t,onChange:e}){const r=D.useState(t),[n]=r,i=D.useRef(n),s=Ds(e);return D.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Y4(t){const e=D.useRef({value:t,previous:t});return D.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var as=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{};function Q4(t){const[e,r]=D.useState(void 0);return as(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Tpe(t,e){return D.useReducer((r,n)=>e[r][n]??r,t)}var no=t=>{const{present:e,children:r}=t,n=Ppe(e),i=typeof r=="function"?r({present:n.isPresent}):D.Children.only(r),s=Tr(n.ref,kpe(i));return typeof r=="function"||n.isPresent?D.cloneElement(i,{ref:s}):null};no.displayName="Presence";function Ppe(t){const[e,r]=D.useState(),n=D.useRef({}),i=D.useRef(t),s=D.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Tpe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=r6(n.current);s.current=a==="mounted"?l:"none"},[a]),as(()=>{const l=n.current,f=i.current;if(f!==t){const p=s.current,g=r6(l);t?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),as(()=>{if(e){const l=u=>{const g=r6(n.current).includes(u.animationName);u.target===e&&g&&Eh.flushSync(()=>c("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=r6(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function r6(t){return(t==null?void 0:t.animationName)||"none"}function kpe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var Cp=D.forwardRef((t,e)=>{const{children:r,...n}=t,i=D.Children.toArray(r),s=i.find(Mpe);if(s){const o=s.props.children,a=i.map(c=>c===s?D.Children.count(o)>1?D.Children.only(null):D.isValidElement(o)?o.props.children:null:c);return Y.jsx(m7,{...n,ref:e,children:D.isValidElement(o)?D.cloneElement(o,void 0,a):null})}return Y.jsx(m7,{...n,ref:e,children:r})});Cp.displayName="Slot";var m7=D.forwardRef((t,e)=>{const{children:r,...n}=t;if(D.isValidElement(r)){const i=Ope(r);return D.cloneElement(r,{...Rpe(n,r.props),ref:e?K4(e,i):i})}return D.Children.count(r)>1?D.Children.only(null):null});m7.displayName="SlotClone";var NH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Mpe(t){return D.isValidElement(t)&&t.type===NH}function Rpe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Ope(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var Dpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],jt=Dpe.reduce((t,e)=>{const r=D.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Cp:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Y.jsx(a,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JT(t,e){t&&Eh.flushSync(()=>t.dispatchEvent(e))}var ZT="Checkbox",[Npe,fUe]=Bs(ZT),[Bpe,Lpe]=Npe(ZT),BH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=D.useState(null),g=Tr(e,O=>p(O)),y=D.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=ic({prop:i,defaultProp:s,onChange:l}),S=D.useRef(I);return D.useEffect(()=>{const O=u==null?void 0:u.form;if(O){const L=()=>C(S.current);return O.addEventListener("reset",L),()=>O.removeEventListener("reset",L)}},[u,C]),Y.jsxs(Bpe,{scope:r,state:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"checkbox","aria-checked":lp(I)?"mixed":I,"aria-required":o,"data-state":jH(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onKeyDown:ot(t.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:ot(t.onClick,O=>{C(L=>lp(L)?!0:!L),b&&(y.current=O.isPropagationStopped(),y.current||O.stopPropagation())})}),b&&Y.jsx(Fpe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});BH.displayName=ZT;var LH="CheckboxIndicator",FH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Lpe(LH,r);return Y.jsx(no,{present:n||lp(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":jH(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});FH.displayName=LH;var Fpe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=Y4(r),a=Q4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});c.indeterminate=lp(r),u.call(c,lp(r)?!1:r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:lp(r)?!1:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function lp(t){return t==="indeterminate"}function jH(t){return lp(t)?"indeterminate":t?"checked":"unchecked"}var jpe=BH,Upe=FH,$pe=Fn({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11p4 fyvr11mc fyvr11ck fyvr11l8",left:"_43lu9r6 _43lu9r1 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",right:"_43lu9r7 _43lu9r2 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",hidden:"_43lu9r8 _43lu9r3 fyvr11c8 fyvr11l8"}},defaultVariants:{},compoundVariants:[]});const Vp=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?Y.jsxs(xe,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(Ge,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(Ge,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(xe,{as:"label",className:$pe({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var zp=Fn({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const qpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),UH=({size:t="sm",...e})=>Y.jsx(xe,{as:qpe,className:zp({size:t}),...e}),Vpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),XT=({size:t="sm",...e})=>Y.jsx(xe,{as:Vpe,className:zp({size:t}),...e}),zpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),$H=({size:t="sm",...e})=>Y.jsx(xe,{as:zpe,className:zp({size:t}),...e}),Hpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Vg=({size:t="sm",...e})=>Y.jsx(xe,{as:Hpe,className:zp({size:t}),...e}),Gpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.608 6.75h-5.19v-1.5h7.75V13h-1.5V7.81l-7.72 7.72-1.06-1.06 7.72-7.72Z",clipRule:"evenodd"})}),J4=({size:t="sm",...e})=>Y.jsx(xe,{as:Gpe,className:zp({size:t}),...e}),Wpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.418 7h1.5V3.5h3.5V2h-5v5Zm11-5v1.5h3.5V7h1.5V2h-5Zm-9.5 11h-1.5v5h5v-1.5h-3.5V13Zm9.5 5v-1.5h3.5V13h1.5v5h-5Zm-3.75-4v-3.25h-3.25v-1.5h3.25V6h1.5v3.25h3.25v1.5h-3.25V14h-1.5Z",clipRule:"evenodd"})}),Kpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Wpe,className:zp({size:t}),...e}),Ype=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Qpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Ype,className:zp({size:t}),...e});var Jpe=Fn({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11l8 fyvr11ow fyvr11no fyvr11sl fyvr1309 fyvr1307 fyvr12zz fyvr12zf fyvr12zb _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),Zpe="_1c9x66f4 fyvr12w9 fyvr11l8 fyvr11ow fyvr11no fyvr12g fyvr164";const Xpe=({size:t="sm"})=>Y.jsx(Upe,{className:Zpe,children:Y.jsx(XT,{size:t==="lg"?"sm":"xs"})}),eP=D.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return Y.jsx(Vp,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:Y.jsx(jpe,{className:Jpe({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:Y.jsx(Xpe,{size:a})})})});qt.createContext(null);var e1e=eq.useId||(()=>{}),t1e=0;function Xa(t){const[e,r]=D.useState(e1e());return as(()=>{t||r(n=>n??String(t1e++))},[t]),t||(e?`radix-${e}`:"")}var tP="Collapsible",[r1e,uUe]=Bs(tP),[n1e,rP]=r1e(tP),qH=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=ic({prop:n,defaultProp:i,onChange:o});return Y.jsx(n1e,{scope:r,disabled:s,contentId:Xa(),open:c,onOpenToggle:D.useCallback(()=>l(f=>!f),[l]),children:Y.jsx(jt.div,{"data-state":iP(c),"data-disabled":s?"":void 0,...a,ref:e})})});qH.displayName=tP;var VH="CollapsibleTrigger",zH=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=rP(VH,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:ot(t.onClick,i.onOpenToggle)})});zH.displayName=VH;var nP="CollapsibleContent",HH=D.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=rP(nP,t.__scopeCollapsible);return Y.jsx(no,{present:r||i.open,children:({present:s})=>Y.jsx(i1e,{...n,ref:e,present:s})})});HH.displayName=nP;var i1e=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=rP(nP,r),[a,c]=D.useState(n),l=D.useRef(null),f=Tr(e,l),u=D.useRef(0),p=u.current,g=D.useRef(0),y=g.current,b=o.open||a,I=D.useRef(b),C=D.useRef();return D.useEffect(()=>{const S=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(S)},[]),as(()=>{const S=l.current;if(S){C.current=C.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const O=S.getBoundingClientRect();u.current=O.height,g.current=O.width,I.current||(S.style.transitionDuration=C.current.transitionDuration,S.style.animationName=C.current.animationName),c(n)}},[o.open,n]),Y.jsx(jt.div,{"data-state":iP(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...s,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:b&&i})});function iP(t){return t?"open":"closed"}var s1e=qH,o1e=zH,a1e=HH,gB="64px",c1e="_4j62fl0",l1e="_4j62fl2 _4j62fl1 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11l8 fyvr11ow fyvr11sl fyvr12g fyvr12zf fyvr11rc _4efw240",f1e="_4j62fl4 _4j62fl3 fyvr1zk fyvr111o fyvr1uw fyvr1xg fyvr12g",u1e="_4j62fl5";const GH=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=D.useState(n),f=i??c,u=g=>{i===void 0&&l(g)},p=g=>{u(g),s==null||s(g)};return Y.jsx(s1e,{open:f,defaultOpen:n,onOpenChange:p,asChild:!0,children:Y.jsxs(xe,{as:cp.div,className:mi(e,c1e),initial:{height:f?"auto":gB},animate:{height:f?"auto":gB},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[Y.jsxs(o1e,{className:l1e,children:[Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(xe,{as:cp.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:Y.jsx($H,{className:u1e,color:"text50"})})]}),Y.jsx(PH,{children:f&&Y.jsx(a1e,{className:f1e,asChild:!0,forceMount:!0,children:Y.jsx(cp.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function Z4(t){const e=t+"CollectionProvider",[r,n]=Bs(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,I=qt.useRef(null),C=qt.useRef(new Map).current;return Y.jsx(i,{scope:y,itemMap:C,collectionRef:I,children:b})};o.displayName=e;const a=t+"CollectionSlot",c=qt.forwardRef((g,y)=>{const{scope:b,children:I}=g,C=s(a,b),S=Tr(y,C.collectionRef);return Y.jsx(Cp,{ref:S,children:I})});c.displayName=a;const l=t+"CollectionItemSlot",f="data-radix-collection-item",u=qt.forwardRef((g,y)=>{const{scope:b,children:I,...C}=g,S=qt.useRef(null),O=Tr(y,S),L=s(l,b);return qt.useEffect(()=>(L.itemMap.set(S,{ref:S,...C}),()=>void L.itemMap.delete(S))),Y.jsx(Cp,{[f]:"",ref:O,children:I})});u.displayName=l;function p(g){const y=s(t+"CollectionConsumer",g);return qt.useCallback(()=>{const I=y.collectionRef.current;if(!I)return[];const C=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((L,F)=>C.indexOf(L.ref.current)-C.indexOf(F.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},p,n]}var d1e=D.createContext(void 0);function ox(t){const e=D.useContext(d1e);return t||e||"ltr"}function h1e(t,e=globalThis==null?void 0:globalThis.document){const r=Ds(t);D.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var p1e="DismissableLayer",b7="dismissableLayer.update",v1e="dismissableLayer.pointerDownOutside",g1e="dismissableLayer.focusOutside",yB,WH=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),py=D.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=D.useContext(WH),[f,u]=D.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=D.useState({}),y=Tr(e,_=>u(_)),b=Array.from(l.layers),[I]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(I),S=f?b.indexOf(f):-1,O=l.layersWithOutsidePointerEventsDisabled.size>0,L=S>=C,F=m1e(_=>{const $=_.target,ie=[...l.branches].some(ce=>ce.contains($));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),z=b1e(_=>{const $=_.target;[...l.branches].some(ce=>ce.contains($))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},p);return h1e(_=>{S===l.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},p),D.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(yB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),mB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=yB)}},[f,p,r,l]),D.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),mB())},[f,l]),D.useEffect(()=>{const _=()=>g({});return document.addEventListener(b7,_),()=>document.removeEventListener(b7,_)},[]),Y.jsx(jt.div,{...c,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:ot(t.onFocusCapture,z.onFocusCapture),onBlurCapture:ot(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ot(t.onPointerDownCapture,F.onPointerDownCapture)})});py.displayName=p1e;var y1e="DismissableLayerBranch",KH=D.forwardRef((t,e)=>{const r=D.useContext(WH),n=D.useRef(null),i=Tr(e,n);return D.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),Y.jsx(jt.div,{...t,ref:i})});KH.displayName=y1e;function m1e(t,e=globalThis==null?void 0:globalThis.document){const r=Ds(t),n=D.useRef(!1),i=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){YH(v1e,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function b1e(t,e=globalThis==null?void 0:globalThis.document){const r=Ds(t),n=D.useRef(!1);return D.useEffect(()=>{const i=s=>{s.target&&!n.current&&YH(g1e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function mB(){const t=new CustomEvent(b7);document.dispatchEvent(t)}function YH(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var w1e=py,x1e=KH,BA=0;function sP(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??bB()),document.body.insertAdjacentElement("beforeend",t[1]??bB()),BA++,()=>{BA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),BA--}},[])}function bB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var LA="focusScope.autoFocusOnMount",FA="focusScope.autoFocusOnUnmount",wB={bubbles:!1,cancelable:!0},E1e="FocusScope",X4=D.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=D.useState(null),l=Ds(i),f=Ds(s),u=D.useRef(null),p=Tr(e,b=>c(b)),g=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(n){let b=function(O){if(g.paused||!a)return;const L=O.target;a.contains(L)?u.current=L:sd(u.current,{select:!0})},I=function(O){if(g.paused||!a)return;const L=O.relatedTarget;L!==null&&(a.contains(L)||sd(u.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const F of O)F.removedNodes.length>0&&sd(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",I);const S=new MutationObserver(C);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),S.disconnect()}}},[n,a,g.paused]),D.useEffect(()=>{if(a){EB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(LA,wB);a.addEventListener(LA,l),a.dispatchEvent(C),C.defaultPrevented||(C1e(T1e(QH(a)),{select:!0}),document.activeElement===b&&sd(a))}return()=>{a.removeEventListener(LA,l),setTimeout(()=>{const C=new CustomEvent(FA,wB);a.addEventListener(FA,f),a.dispatchEvent(C),C.defaultPrevented||sd(b??document.body,{select:!0}),a.removeEventListener(FA,f),EB.remove(g)},0)}}},[a,l,f,g]);const y=D.useCallback(b=>{if(!r&&!n||g.paused)return;const I=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(I&&C){const S=b.currentTarget,[O,L]=A1e(S);O&&L?!b.shiftKey&&C===L?(b.preventDefault(),r&&sd(O,{select:!0})):b.shiftKey&&C===O&&(b.preventDefault(),r&&sd(L,{select:!0})):C===S&&b.preventDefault()}},[r,n,g.paused]);return Y.jsx(jt.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});X4.displayName=E1e;function C1e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(sd(n,{select:e}),document.activeElement!==r)return}function A1e(t){const e=QH(t),r=xB(e,t),n=xB(e.reverse(),t);return[r,n]}function QH(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function xB(t,e){for(const r of t)if(!S1e(r,{upTo:e}))return r}function S1e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function _1e(t){return t instanceof HTMLInputElement&&"select"in t}function sd(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&_1e(t)&&e&&t.select()}}var EB=I1e();function I1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=CB(t,e),t.unshift(e)},remove(e){var r;t=CB(t,e),(r=t[0])==null||r.resume()}}}function CB(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function T1e(t){return t.filter(e=>e.tagName!=="A")}const P1e=["top","right","bottom","left"],Fl=Math.min,sa=Math.max,y5=Math.round,n6=Math.floor,oh=t=>({x:t,y:t}),k1e={left:"right",right:"left",bottom:"top",top:"bottom"},M1e={start:"end",end:"start"};function w7(t,e,r){return sa(t,Fl(e,r))}function vu(t,e){return typeof t=="function"?t(e):t}function gu(t){return t.split("-")[0]}function vy(t){return t.split("-")[1]}function oP(t){return t==="x"?"y":"x"}function aP(t){return t==="y"?"height":"width"}function ah(t){return["top","bottom"].includes(gu(t))?"y":"x"}function cP(t){return oP(ah(t))}function R1e(t,e,r){r===void 0&&(r=!1);const n=vy(t),i=cP(t),s=aP(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=m5(o)),[o,m5(o)]}function O1e(t){const e=m5(t);return[x7(t),e,x7(e)]}function x7(t){return t.replace(/start|end/g,e=>M1e[e])}function D1e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function N1e(t,e,r,n){const i=vy(t);let s=D1e(gu(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(x7)))),s}function m5(t){return t.replace(/left|right|bottom|top/g,e=>k1e[e])}function B1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function JH(t){return typeof t!="number"?B1e(t):{top:t,right:t,bottom:t,left:t}}function b5(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function AB(t,e,r){let{reference:n,floating:i}=t;const s=ah(e),o=cP(e),a=aP(o),c=gu(e),l=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let g;switch(c){case"top":g={x:f,y:n.y-i.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:u};break;case"left":g={x:n.x-i.width,y:u};break;default:g={x:n.x,y:n.y}}switch(vy(e)){case"start":g[o]-=p*(r&&l?-1:1);break;case"end":g[o]+=p*(r&&l?-1:1);break}return g}const L1e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=AB(l,n,c),p=n,g={},y=0;for(let b=0;b({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=vu(t,e)||{};if(l==null)return{};const u=JH(f),p={x:r,y:n},g=cP(i),y=aP(g),b=await o.getDimensions(l),I=g==="y",C=I?"top":"left",S=I?"bottom":"right",O=I?"clientHeight":"clientWidth",L=s.reference[y]+s.reference[g]-p[g]-s.floating[y],F=p[g]-s.reference[g],z=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=z?z[O]:0;(!_||!await(o.isElement==null?void 0:o.isElement(z)))&&(_=a.floating[O]||s.floating[y]);const $=L/2-F/2,ie=_/2-b[y]/2-1,ce=Fl(u[C],ie),K=Fl(u[S],ie),P=ce,M=_-b[y]-K,v=_/2-b[y]/2+$,m=w7(P,v,M),R=!c.arrow&&vy(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,P;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:ce},reset:{placement:m}};let R=(P=ce.filter(B=>B.overflows[0]<=0).sort((B,E)=>B.overflows[1]-E.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var M;const B=(M=ce.filter(E=>{if(z){const x=ah(E.placement);return x===S||x==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(x=>x>0).reduce((x,w)=>x+w,0)]).sort((E,x)=>E[1]-x[1])[0])==null?void 0:M[0];B&&(R=B);break}case"initialPlacement":R=a;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function SB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _B(t){return P1e.some(e=>t[e]>=0)}const U1e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=vu(t,e);switch(n){case"referenceHidden":{const s=await cw(e,{...i,elementContext:"reference"}),o=SB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:_B(o)}}}case"escaped":{const s=await cw(e,{...i,altBoundary:!0}),o=SB(s,r.floating);return{data:{escapedOffsets:o,escaped:_B(o)}}}default:return{}}}}};async function $1e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=gu(r),a=vy(r),c=ah(r)==="y",l=["left","top"].includes(o)?-1:1,f=s&&c?-1:1,u=vu(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*f,y:p*l}:{x:p*l,y:g*f}}const q1e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await $1e(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},V1e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:I=>{let{x:C,y:S}=I;return{x:C,y:S}}},...c}=vu(t,e),l={x:r,y:n},f=await cw(e,c),u=ah(gu(i)),p=oP(u);let g=l[p],y=l[u];if(s){const I=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+f[I],O=g-f[C];g=w7(S,g,O)}if(o){const I=u==="y"?"top":"left",C=u==="y"?"bottom":"right",S=y+f[I],O=y-f[C];y=w7(S,y,O)}const b=a.fn({...e,[p]:g,[u]:y});return{...b,data:{x:b.x-r,y:b.y-n}}}}},z1e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=vu(t,e),f={x:r,y:n},u=ah(i),p=oP(u);let g=f[p],y=f[u];const b=vu(a,e),I=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const O=p==="y"?"height":"width",L=s.reference[p]-s.floating[O]+I.mainAxis,F=s.reference[p]+s.reference[O]-I.mainAxis;gF&&(g=F)}if(l){var C,S;const O=p==="y"?"width":"height",L=["top","left"].includes(gu(i)),F=s.reference[u]-s.floating[O]+(L&&((C=o.offset)==null?void 0:C[u])||0)+(L?0:I.crossAxis),z=s.reference[u]+s.reference[O]+(L?0:((S=o.offset)==null?void 0:S[u])||0)-(L?I.crossAxis:0);yz&&(y=z)}return{[p]:g,[u]:y}}}},H1e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=vu(t,e),c=await cw(e,a),l=gu(r),f=vy(r),u=ah(r)==="y",{width:p,height:g}=n.floating;let y,b;l==="top"||l==="bottom"?(y=l,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=l,y=f==="end"?"top":"bottom");const I=g-c.top-c.bottom,C=p-c.left-c.right,S=Fl(g-c[y],I),O=Fl(p-c[b],C),L=!e.middlewareData.shift;let F=S,z=O;if(u?z=f||L?Fl(O,C):C:F=f||L?Fl(S,I):I,L&&!f){const $=sa(c.left,0),ie=sa(c.right,0),ce=sa(c.top,0),K=sa(c.bottom,0);u?z=p-2*($!==0||ie!==0?$+ie:sa(c.left,c.right)):F=g-2*(ce!==0||K!==0?ce+K:sa(c.top,c.bottom))}await o({...e,availableWidth:z,availableHeight:F});const _=await i.getDimensions(s.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function gy(t){return ZH(t)?(t.nodeName||"").toLowerCase():"#document"}function ua(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tu(t){var e;return(e=(ZH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ZH(t){return t instanceof Node||t instanceof ua(t).Node}function Yl(t){return t instanceof Element||t instanceof ua(t).Element}function Ql(t){return t instanceof HTMLElement||t instanceof ua(t).HTMLElement}function IB(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ua(t).ShadowRoot}function ax(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Qc(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function G1e(t){return["table","td","th"].includes(gy(t))}function e8(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function lP(t){const e=fP(),r=Qc(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function W1e(t){let e=ch(t);for(;Ql(e)&&!zg(e);){if(e8(e))return null;if(lP(e))return e;e=ch(e)}return null}function fP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zg(t){return["html","body","#document"].includes(gy(t))}function Qc(t){return ua(t).getComputedStyle(t)}function t8(t){return Yl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ch(t){if(gy(t)==="html")return t;const e=t.assignedSlot||t.parentNode||IB(t)&&t.host||Tu(t);return IB(e)?e.host:e}function XH(t){const e=ch(t);return zg(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ql(e)&&ax(e)?e:XH(e)}function lw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=XH(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=ua(i);return s?e.concat(o,o.visualViewport||[],ax(i)?i:[],o.frameElement&&r?lw(o.frameElement):[]):e.concat(i,lw(i,[],r))}function eG(t){const e=Qc(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Ql(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=y5(r)!==s||y5(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function uP(t){return Yl(t)?t:t.contextElement}function _v(t){const e=uP(t);if(!Ql(e))return oh(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=eG(e);let o=(s?y5(r.width):r.width)/n,a=(s?y5(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const K1e=oh(0);function tG(t){const e=ua(t);return!fP()||!e.visualViewport?K1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Y1e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ua(t)?!1:e}function Ap(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=uP(t);let o=oh(1);e&&(n?Yl(n)&&(o=_v(n)):o=_v(t));const a=Y1e(s,r,n)?tG(s):oh(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const p=ua(s),g=n&&Yl(n)?ua(n):n;let y=p,b=y.frameElement;for(;b&&n&&g!==y;){const I=_v(b),C=b.getBoundingClientRect(),S=Qc(b),O=C.left+(b.clientLeft+parseFloat(S.paddingLeft))*I.x,L=C.top+(b.clientTop+parseFloat(S.paddingTop))*I.y;c*=I.x,l*=I.y,f*=I.x,u*=I.y,c+=O,l+=L,y=ua(b),b=y.frameElement}}return b5({width:f,height:u,x:c,y:l})}function Q1e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=Tu(n),a=e?e8(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=oh(1);const f=oh(0),u=Ql(n);if((u||!u&&!s)&&((gy(n)!=="body"||ax(o))&&(c=t8(n)),Ql(n))){const p=Ap(n);l=_v(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+f.x,y:r.y*l.y-c.scrollTop*l.y+f.y}}function J1e(t){return Array.from(t.getClientRects())}function rG(t){return Ap(Tu(t)).left+t8(t).scrollLeft}function Z1e(t){const e=Tu(t),r=t8(t),n=t.ownerDocument.body,i=sa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=sa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+rG(t);const a=-r.scrollTop;return Qc(n).direction==="rtl"&&(o+=sa(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function X1e(t,e){const r=ua(t),n=Tu(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=fP();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function eve(t,e){const r=Ap(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Ql(t)?_v(t):oh(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function TB(t,e,r){let n;if(e==="viewport")n=X1e(t,r);else if(e==="document")n=Z1e(Tu(t));else if(Yl(e))n=eve(e,r);else{const i=tG(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return b5(n)}function nG(t,e){const r=ch(t);return r===e||!Yl(r)||zg(r)?!1:Qc(r).position==="fixed"||nG(r,e)}function tve(t,e){const r=e.get(t);if(r)return r;let n=lw(t,[],!1).filter(a=>Yl(a)&&gy(a)!=="body"),i=null;const s=Qc(t).position==="fixed";let o=s?ch(t):t;for(;Yl(o)&&!zg(o);){const a=Qc(o),c=lP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ax(o)&&!c&&nG(t,o))?n=n.filter(f=>f!==o):i=a,o=ch(o)}return e.set(t,n),n}function rve(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?e8(e)?[]:tve(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,f)=>{const u=TB(e,f,i);return l.top=sa(u.top,l.top),l.right=Fl(u.right,l.right),l.bottom=Fl(u.bottom,l.bottom),l.left=sa(u.left,l.left),l},TB(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function nve(t){const{width:e,height:r}=eG(t);return{width:e,height:r}}function ive(t,e,r){const n=Ql(e),i=Tu(e),s=r==="fixed",o=Ap(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=oh(0);if(n||!n&&!s)if((gy(e)!=="body"||ax(i))&&(a=t8(e)),n){const u=Ap(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&(c.x=rG(i));const l=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:l,y:f,width:o.width,height:o.height}}function jA(t){return Qc(t).position==="static"}function PB(t,e){return!Ql(t)||Qc(t).position==="fixed"?null:e?e(t):t.offsetParent}function iG(t,e){const r=ua(t);if(e8(t))return r;if(!Ql(t)){let i=ch(t);for(;i&&!zg(i);){if(Yl(i)&&!jA(i))return i;i=ch(i)}return r}let n=PB(t,e);for(;n&&G1e(n)&&jA(n);)n=PB(n,e);return n&&zg(n)&&jA(n)&&!lP(n)?r:n||W1e(t)||r}const sve=async function(t){const e=this.getOffsetParent||iG,r=this.getDimensions,n=await r(t.floating);return{reference:ive(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ove(t){return Qc(t).direction==="rtl"}const ave={convertOffsetParentRelativeRectToViewportRelativeRect:Q1e,getDocumentElement:Tu,getClippingRect:rve,getOffsetParent:iG,getElementRects:sve,getClientRects:J1e,getDimensions:nve,getScale:_v,isElement:Yl,isRTL:ove};function cve(t,e){let r=null,n;const i=Tu(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:u,height:p}=t.getBoundingClientRect();if(a||e(),!u||!p)return;const g=n6(f),y=n6(i.clientWidth-(l+u)),b=n6(i.clientHeight-(f+p)),I=n6(l),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-I+"px",threshold:sa(0,Fl(1,c))||1};let O=!0;function L(F){const z=F[0].intersectionRatio;if(z!==c){if(!O)return o();z?o(!1,z):n=setTimeout(()=>{o(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(L,{...S,root:i.ownerDocument})}catch{r=new IntersectionObserver(L,S)}r.observe(t)}return o(!0),s}function lve(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=uP(t),f=i||s?[...l?lw(l):[],...lw(e)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const u=l&&a?cve(l,r):null;let p=-1,g=null;o&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===l&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var O;(O=g)==null||O.observe(e)})),r()}),l&&!c&&g.observe(l),g.observe(e));let y,b=c?Ap(t):null;c&&I();function I(){const C=Ap(t);b&&(C.x!==b.x||C.y!==b.y||C.width!==b.width||C.height!==b.height)&&r(),b=C,y=requestAnimationFrame(I)}return r(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",r),s&&S.removeEventListener("resize",r)}),u==null||u(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const fve=q1e,uve=V1e,dve=j1e,hve=H1e,pve=U1e,kB=F1e,vve=z1e,gve=(t,e,r)=>{const n=new Map,i={platform:ave,...r},s={...i.platform,_c:n};return L1e(t,e,{...i,platform:s})};var e3=typeof document<"u"?D.useLayoutEffect:D.useEffect;function w5(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!w5(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!w5(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function sG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function MB(t,e){const r=sG(t);return Math.round(e*r)/r}function RB(t){const e=D.useRef(t);return e3(()=>{e.current=t}),e}function yve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[f,u]=D.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,g]=D.useState(n);w5(p,n)||g(n);const[y,b]=D.useState(null),[I,C]=D.useState(null),S=D.useCallback(B=>{B!==z.current&&(z.current=B,b(B))},[]),O=D.useCallback(B=>{B!==_.current&&(_.current=B,C(B))},[]),L=s||y,F=o||I,z=D.useRef(null),_=D.useRef(null),$=D.useRef(f),ie=c!=null,ce=RB(c),K=RB(i),P=D.useCallback(()=>{if(!z.current||!_.current)return;const B={placement:e,strategy:r,middleware:p};K.current&&(B.platform=K.current),gve(z.current,_.current,B).then(E=>{const x={...E,isPositioned:!0};M.current&&!w5($.current,x)&&($.current=x,Eh.flushSync(()=>{u(x)}))})},[p,e,r,K]);e3(()=>{l===!1&&$.current.isPositioned&&($.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[l]);const M=D.useRef(!1);e3(()=>(M.current=!0,()=>{M.current=!1}),[]),e3(()=>{if(L&&(z.current=L),F&&(_.current=F),L&&F){if(ce.current)return ce.current(L,F,P);P()}},[L,F,P,ce,ie]);const v=D.useMemo(()=>({reference:z,floating:_,setReference:S,setFloating:O}),[S,O]),m=D.useMemo(()=>({reference:L,floating:F}),[L,F]),R=D.useMemo(()=>{const B={position:r,left:0,top:0};if(!m.floating)return B;const E=MB(m.floating,f.x),x=MB(m.floating,f.y);return a?{...B,transform:"translate("+E+"px, "+x+"px)",...sG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:x}},[r,a,m.floating,f.x,f.y]);return D.useMemo(()=>({...f,update:P,refs:v,elements:m,floatingStyles:R}),[f,P,v,m,R])}const mve=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?kB({element:n.current,padding:i}).fn(r):{}:n?kB({element:n,padding:i}).fn(r):{}}}},bve=(t,e)=>({...fve(t),options:[t,e]}),wve=(t,e)=>({...uve(t),options:[t,e]}),xve=(t,e)=>({...vve(t),options:[t,e]}),Eve=(t,e)=>({...dve(t),options:[t,e]}),Cve=(t,e)=>({...hve(t),options:[t,e]}),Ave=(t,e)=>({...pve(t),options:[t,e]}),Sve=(t,e)=>({...mve(t),options:[t,e]});var _ve="Arrow",oG=D.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return Y.jsx(jt.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:Y.jsx("polygon",{points:"0,0 30,0 15,10"})})});oG.displayName=_ve;var Ive=oG,dP="Popper",[aG,yy]=Bs(dP),[Tve,cG]=aG(dP),lG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=D.useState(null);return Y.jsx(Tve,{scope:e,anchor:n,onAnchorChange:i,children:r})};lG.displayName=dP;var fG="PopperAnchor",uG=D.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=cG(fG,r),o=D.useRef(null),a=Tr(e,o);return D.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:Y.jsx(jt.div,{...i,ref:a})});uG.displayName=fG;var hP="PopperContent",[Pve,kve]=aG(hP),dG=D.forwardRef((t,e)=>{var r,n,i,s,o,a;const{__scopePopper:c,side:l="bottom",sideOffset:f=0,align:u="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:I=0,sticky:C="partial",hideWhenDetached:S=!1,updatePositionStrategy:O="optimized",onPlaced:L,...F}=t,z=cG(hP,c),[_,$]=D.useState(null),ie=Tr(e,Ee=>$(Ee)),[ce,K]=D.useState(null),P=Q4(ce),M=(P==null?void 0:P.width)??0,v=(P==null?void 0:P.height)??0,m=l+(u!=="center"?"-"+u:""),R=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},B=Array.isArray(b)?b:[b],E=B.length>0,x={padding:R,boundary:B.filter(Rve),altBoundary:E},{refs:w,floatingStyles:T,placement:k,isPositioned:H,middlewareData:oe}=yve({strategy:"fixed",placement:m,whileElementsMounted:(...Ee)=>lve(...Ee,{animationFrame:O==="always"}),elements:{reference:z.anchor},middleware:[bve({mainAxis:f+v,alignmentAxis:p}),y&&wve({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?xve():void 0,...x}),y&&Eve({...x}),Cve({...x,apply:({elements:Ee,rects:_e,availableWidth:Re,availableHeight:Te})=>{const{width:De,height:ze}=_e.reference,et=Ee.floating.style;et.setProperty("--radix-popper-available-width",`${Re}px`),et.setProperty("--radix-popper-available-height",`${Te}px`),et.setProperty("--radix-popper-anchor-width",`${De}px`),et.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),ce&&Sve({element:ce,padding:g}),Ove({arrowWidth:M,arrowHeight:v}),S&&Ave({strategy:"referenceHidden",...x})]}),[j,X]=vG(k),G=Ds(L);as(()=>{H&&(G==null||G())},[H,G]);const Z=(r=oe.arrow)==null?void 0:r.x,ee=(n=oe.arrow)==null?void 0:n.y,N=((i=oe.arrow)==null?void 0:i.centerOffset)!==0,[te,fe]=D.useState();return as(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),Y.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:H?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(s=oe.transformOrigin)==null?void 0:s.x,(o=oe.transformOrigin)==null?void 0:o.y].join(" "),...((a=oe.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Y.jsx(Pve,{scope:c,placedSide:j,onArrowChange:K,arrowX:Z,arrowY:ee,shouldHideArrow:N,children:Y.jsx(jt.div,{"data-side":j,"data-align":X,...F,ref:ie,style:{...F.style,animation:H?void 0:"none"}})})})});dG.displayName=hP;var hG="PopperArrow",Mve={top:"bottom",right:"left",bottom:"top",left:"right"},pG=D.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=kve(hG,n),o=Mve[s.placedSide];return Y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:Y.jsx(Ive,{...i,ref:r,style:{...i.style,display:"block"}})})});pG.displayName=hG;function Rve(t){return t!==null}var Ove=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i;const{placement:s,rects:o,middlewareData:a}=e,l=((r=a.arrow)==null?void 0:r.centerOffset)!==0,f=l?0:t.arrowWidth,u=l?0:t.arrowHeight,[p,g]=vG(s),y={start:"0%",center:"50%",end:"100%"}[g],b=(((n=a.arrow)==null?void 0:n.x)??0)+f/2,I=(((i=a.arrow)==null?void 0:i.y)??0)+u/2;let C="",S="";return p==="bottom"?(C=l?y:`${b}px`,S=`${-u}px`):p==="top"?(C=l?y:`${b}px`,S=`${o.floating.height+u}px`):p==="right"?(C=`${-u}px`,S=l?y:`${I}px`):p==="left"&&(C=`${o.floating.width+u}px`,S=l?y:`${I}px`),{data:{x:C,y:S}}}});function vG(t){const[e,r="center"]=t.split("-");return[e,r]}var pP=lG,vP=uG,gP=dG,yP=pG,Dve="Portal",cx=D.forwardRef((t,e)=>{var r;const{container:n,...i}=t,[s,o]=D.useState(!1);as(()=>o(!0),[]);const a=n||s&&((r=globalThis==null?void 0:globalThis.document)==null?void 0:r.body);return a?Pfe.createPortal(Y.jsx(jt.div,{...i,ref:e}),a):null});cx.displayName=Dve;var UA="rovingFocusGroup.onEntryFocus",Nve={bubbles:!1,cancelable:!0},r8="RovingFocusGroup",[E7,gG,Bve]=Z4(r8),[Lve,my]=Bs(r8,[Bve]),[Fve,jve]=Lve(r8),yG=D.forwardRef((t,e)=>Y.jsx(E7.Provider,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(E7.Slot,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Uve,{...t,ref:e})})}));yG.displayName=r8;var Uve=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=t,p=D.useRef(null),g=Tr(e,p),y=ox(s),[b=null,I]=ic({prop:o,defaultProp:a,onChange:c}),[C,S]=D.useState(!1),O=Ds(l),L=gG(r),F=D.useRef(!1),[z,_]=D.useState(0);return D.useEffect(()=>{const $=p.current;if($)return $.addEventListener(UA,O),()=>$.removeEventListener(UA,O)},[O]),Y.jsx(Fve,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:b,onItemFocus:D.useCallback($=>I($),[I]),onItemShiftTab:D.useCallback(()=>S(!0),[]),onFocusableItemAdd:D.useCallback(()=>_($=>$+1),[]),onFocusableItemRemove:D.useCallback(()=>_($=>$-1),[]),children:Y.jsx(jt.div,{tabIndex:C||z===0?-1:0,"data-orientation":n,...u,ref:g,style:{outline:"none",...t.style},onMouseDown:ot(t.onMouseDown,()=>{F.current=!0}),onFocus:ot(t.onFocus,$=>{const ie=!F.current;if($.target===$.currentTarget&&ie&&!C){const ce=new CustomEvent(UA,Nve);if($.currentTarget.dispatchEvent(ce),!ce.defaultPrevented){const K=L().filter(R=>R.focusable),P=K.find(R=>R.active),M=K.find(R=>R.id===b),m=[P,M,...K].filter(Boolean).map(R=>R.ref.current);wG(m,f)}}F.current=!1}),onBlur:ot(t.onBlur,()=>S(!1))})})}),mG="RovingFocusGroupItem",bG=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Xa(),c=s||a,l=jve(mG,r),f=l.currentTabStopId===c,u=gG(r),{onFocusableItemAdd:p,onFocusableItemRemove:g}=l;return D.useEffect(()=>{if(n)return p(),()=>g()},[n,p,g]),Y.jsx(E7.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:Y.jsx(jt.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...o,ref:e,onMouseDown:ot(t.onMouseDown,y=>{n?l.onItemFocus(c):y.preventDefault()}),onFocus:ot(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:ot(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){l.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=Vve(y,l.orientation,l.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=u().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")C.reverse();else if(b==="prev"||b==="next"){b==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=l.loop?zve(C,S+1):C.slice(S+1)}setTimeout(()=>wG(C))}})})})});bG.displayName=mG;var $ve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qve(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Vve(t,e,r){const n=qve(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return $ve[n]}function wG(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function zve(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var mP=yG,bP=bG,Hve=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},T1=new WeakMap,i6=new WeakMap,s6={},$A=0,xG=function(t){return t&&(t.host||xG(t.parentNode))},Gve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=xG(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Wve=function(t,e,r,n){var i=Gve(e,Array.isArray(t)?t:[t]);s6[r]||(s6[r]=new WeakMap);var s=s6[r],o=[],a=new Set,c=new Set(i),l=function(u){!u||a.has(u)||(a.add(u),l(u.parentNode))};i.forEach(l);var f=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))f(p);else try{var g=p.getAttribute(n),y=g!==null&&g!=="false",b=(T1.get(p)||0)+1,I=(s.get(p)||0)+1;T1.set(p,b),s.set(p,I),o.push(p),b===1&&y&&i6.set(p,!0),I===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return f(e),a.clear(),$A++,function(){o.forEach(function(u){var p=T1.get(u)-1,g=s.get(u)-1;T1.set(u,p),s.set(u,g),p||(i6.has(u)||u.removeAttribute(n),i6.delete(u)),g||u.removeAttribute(r)}),$A--,$A||(T1=new WeakMap,T1=new WeakMap,i6=new WeakMap,s6={})}},wP=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=Hve(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Wve(n,i,r,"aria-hidden")):function(){return null}},Dl=function(){return Dl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return fge;var e=uge(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},hge=SG(),Iv="data-scroll-locked",pge=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + */var lB;function gpe(){if(lB)return xm;lB=1;var t=qt,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var f,u={},p=null,g=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)n.call(c,f)&&!s.hasOwnProperty(f)&&(u[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)u[f]===void 0&&(u[f]=c[f]);return{$$typeof:e,type:a,key:p,ref:g,props:u,_owner:i.current}}return xm.Fragment=r,xm.jsx=o,xm.jsxs=o,xm}MH.exports=gpe();var Y=MH.exports;function ype(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mpe(t){var e=ype(t,"string");return typeof e=="symbol"?e:String(e)}function bpe(t,e,r){return e=mpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uB(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},jn=t=>{var e=r=>{var n=t.defaultClassName,i=uB(uB({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[f,u]of t.compoundVariants)wpe(f,i,t.defaultVariants)&&(n+=" "+u);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return dB(t.variantClassNames,r=>dB(r,n=>n.split(" ")[0]))}},e};jn({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11t3",warning:"_2q9vfj9 _2q9vfj1 fyvr11t9",success:"_2q9vfja _2q9vfj2 fyvr11sr",error:"_2q9vfjb _2q9vfj3 fyvr11sx"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _2q9vfj4 fyvr1zc fyvr111g fyvr144 fyvr1f4",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _2q9vfj5 fyvr1zg fyvr111k fyvr148 fyvr1f8",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk _2q9vfj6 fyvr1zk fyvr111o fyvr14c fyvr1fc"}},defaultVariants:{},compoundVariants:[]});const Ch=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(xe,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var xpe=jn({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11r2 fyvr11ic fyvr11ko fyvr11jo fyvr11j4",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11r3 fyvr11j0 fyvr11kk fyvr11js fyvr11jk",large:"_1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg",medium:"_1qxj1ibd _1qxj1ib3 fyvr11r3 fyvr11is fyvr11kc fyvr11jw fyvr11jk",normal:"_1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",small:"_1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk",code:"_1qxj1ibh _1qxj1ib7 fyvr11r4 fyvr11io fyvr11k8 fyvr11js fyvr11j8"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11q0 fyvr11qg fyvr11rh fyvr11r5"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Ge=D.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:f,capitalize:u,...p}=t,g=npe[n];return Y.jsx(xe,{as:r,className:pi(i,xpe({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:f,capitalize:u})),ref:e,...g,...p,children:c})});var Epe=jn({defaultClassName:"_140wn8ni _140wn8n0 fyvr11q0 fyvr11qg fyvr11rh fyvr11ow fyvr12s9 fyvr11ra fyvr11l8 _4efw240",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11sl fyvr12w9",ghost:"_140wn8nk _140wn8n2 fyvr11sl fyvr12w9",feature:"_140wn8nl _140wn8n3 fyvr11tr fyvr12sl",primary:"_140wn8nm _140wn8n4 fyvr11tl fyvr12sl",glass:"_140wn8nn _140wn8n5 fyvr11y3 fyvr12w9",emphasis:"_140wn8no _140wn8n6 fyvr11y9 fyvr12w9",raised:"_140wn8np _140wn8n7 fyvr11xx fyvr12w9",danger:"_140wn8nq _140wn8n8 fyvr11sx fyvr12sl",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11r3 fyvr11ik fyvr11k4 fyvr11k0 fyvr11jc _140wn8n9 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr11sl fyvr12wl"},shape:{circle:"_140wn8ns _140wn8na fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",square:"_140wn8nt _140wn8nb fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"},disabled:{true:"_140wn8nu _140wn8nc fyvr12z9 fyvr12zx",false:"_140wn8nv _140wn8nd fyvr12zf fyvr1309 fyvr1307"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _140wn8ne fyvr1zg fyvr111k",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nf fyvr1zk fyvr111o",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8ng fyvr1zo fyvr111s",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _140wn8nh fyvr1zo fyvr111s"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const Xt=D.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:f,rightIcon:u,size:p="md",variant:g="glass",width:y="fit",shape:b="circle",type:I="button",...C}=t,S=f!==void 0&&l!==void 0,O=u!==void 0&&l!==void 0,L=f!==void 0&&l===void 0,F=p==="xs"?"xs":"sm";return Y.jsx(xe,{as:r,className:pi(i,Epe({activeOutline:n,disabled:s||c,hasLeftIcon:S,hasRightIcon:O,iconOnly:L,size:g==="text"?void 0:p,shape:g==="text"?void 0:b,variant:g})),disabled:s||c,display:o,fontWeight:a,ref:e,type:I,width:y,...C,children:L?Y.jsx(f,{size:F}):Y.jsxs(xe,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(xe,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(Ge,{children:l})]}),u&&Y.jsx(u,{size:F})]})})});var Cpe=jn({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr11ec fyvr11eo fyvr11f0 fyvr11fc fyvr1307 fyvr12zf _4efw240"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rr fyvr12kf fyvr125r fyvr12d3"},blur:{true:"rhmai67 rhmai62 fyvr11r0"}},defaultVariants:{},compoundVariants:[]});const qr=D.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return Y.jsx(xe,{className:pi(r,Cpe({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function Ape(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function V4(...t){return e=>t.forEach(r=>Ape(r,e))}function kr(...t){return D.useCallback(V4(...t),t)}function Spe(t,e){const r=D.createContext(e);function n(s){const{children:o,...a}=s,c=D.useMemo(()=>a,Object.values(a));return Y.jsx(r.Provider,{value:c,children:o})}function i(s){const o=D.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return n.displayName=t+"Provider",[n,i]}function Fs(t,e=[]){let r=[];function n(s,o){const a=D.createContext(o),c=r.length;r=[...r,o];function l(u){const{scope:p,children:g,...y}=u,b=(p==null?void 0:p[t][c])||a,I=D.useMemo(()=>y,Object.values(y));return Y.jsx(b.Provider,{value:I,children:g})}function f(u,p){const g=(p==null?void 0:p[t][c])||a,y=D.useContext(g);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,f]}const i=()=>{const s=r.map(o=>D.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return D.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,_pe(i,...e)]}function _pe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const u=c(s)[`__scope${l}`];return{...a,...u}},{});return D.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function ot(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Bs(t){const e=D.useRef(t);return D.useEffect(()=>{e.current=t}),D.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Za({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Ipe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Bs(r),c=D.useCallback(l=>{if(s){const u=typeof l=="function"?l(t):l;u!==t&&a(u)}else i(l)},[s,t,i,a]);return[o,c]}function Ipe({defaultProp:t,onChange:e}){const r=D.useState(t),[n]=r,i=D.useRef(n),s=Bs(e);return D.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function z4(t){const e=D.useRef({value:t,previous:t});return D.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var os=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{};function H4(t){const[e,r]=D.useState(void 0);return os(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Tpe(t,e){return D.useReducer((r,n)=>e[r][n]??r,t)}var oo=t=>{const{present:e,children:r}=t,n=Ppe(e),i=typeof r=="function"?r({present:n.isPresent}):D.Children.only(r),s=kr(n.ref,kpe(i));return typeof r=="function"||n.isPresent?D.cloneElement(i,{ref:s}):null};oo.displayName="Presence";function Ppe(t){const[e,r]=D.useState(),n=D.useRef({}),i=D.useRef(t),s=D.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Tpe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=J2(n.current);s.current=a==="mounted"?l:"none"},[a]),os(()=>{const l=n.current,f=i.current;if(f!==t){const p=s.current,g=J2(l);t?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),os(()=>{if(e){const l=u=>{const g=J2(n.current).includes(u.animationName);u.target===e&&g&&wh.flushSync(()=>c("ANIMATION_END"))},f=u=>{u.target===e&&(s.current=J2(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function J2(t){return(t==null?void 0:t.animationName)||"none"}function kpe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var Cp=D.forwardRef((t,e)=>{const{children:r,...n}=t,i=D.Children.toArray(r),s=i.find(Mpe);if(s){const o=s.props.children,a=i.map(c=>c===s?D.Children.count(o)>1?D.Children.only(null):D.isValidElement(o)?o.props.children:null:c);return Y.jsx(v7,{...n,ref:e,children:D.isValidElement(o)?D.cloneElement(o,void 0,a):null})}return Y.jsx(v7,{...n,ref:e,children:r})});Cp.displayName="Slot";var v7=D.forwardRef((t,e)=>{const{children:r,...n}=t;if(D.isValidElement(r)){const i=Ope(r);return D.cloneElement(r,{...Rpe(n,r.props),ref:e?V4(e,i):i})}return D.Children.count(r)>1?D.Children.only(null):null});v7.displayName="SlotClone";var RH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Mpe(t){return D.isValidElement(t)&&t.type===RH}function Rpe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Ope(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var Dpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],jt=Dpe.reduce((t,e)=>{const r=D.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Cp:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Y.jsx(a,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function KT(t,e){t&&wh.flushSync(()=>t.dispatchEvent(e))}var YT="Checkbox",[Npe,fUe]=Fs(YT),[Bpe,Lpe]=Npe(YT),OH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=D.useState(null),g=kr(e,O=>p(O)),y=D.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=Za({prop:i,defaultProp:s,onChange:l}),S=D.useRef(I);return D.useEffect(()=>{const O=u==null?void 0:u.form;if(O){const L=()=>C(S.current);return O.addEventListener("reset",L),()=>O.removeEventListener("reset",L)}},[u,C]),Y.jsxs(Bpe,{scope:r,state:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"checkbox","aria-checked":lp(I)?"mixed":I,"aria-required":o,"data-state":BH(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onKeyDown:ot(t.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:ot(t.onClick,O=>{C(L=>lp(L)?!0:!L),b&&(y.current=O.isPropagationStopped(),y.current||O.stopPropagation())})}),b&&Y.jsx(Fpe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});OH.displayName=YT;var DH="CheckboxIndicator",NH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Lpe(DH,r);return Y.jsx(oo,{present:n||lp(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":BH(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});NH.displayName=DH;var Fpe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=z4(r),a=H4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});c.indeterminate=lp(r),u.call(c,lp(r)?!1:r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:lp(r)?!1:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function lp(t){return t==="indeterminate"}function BH(t){return lp(t)?"indeterminate":t?"checked":"unchecked"}var jpe=OH,Upe=NH,$pe=jn({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11p4 fyvr11mc fyvr11ck fyvr11l8",left:"_43lu9r6 _43lu9r1 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",right:"_43lu9r7 _43lu9r2 fyvr11ow fyvr11mk fyvr11ck fyvr11l8",hidden:"_43lu9r8 _43lu9r3 fyvr11c8 fyvr11l8"}},defaultVariants:{},compoundVariants:[]});const Vp=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?Y.jsxs(xe,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(Ge,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(Ge,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(xe,{as:"label",className:$pe({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var zp=jn({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const qpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),LH=({size:t="sm",...e})=>Y.jsx(xe,{as:qpe,className:zp({size:t}),...e}),Vpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),QT=({size:t="sm",...e})=>Y.jsx(xe,{as:Vpe,className:zp({size:t}),...e}),zpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),FH=({size:t="sm",...e})=>Y.jsx(xe,{as:zpe,className:zp({size:t}),...e}),Hpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),zg=({size:t="sm",...e})=>Y.jsx(xe,{as:Hpe,className:zp({size:t}),...e}),Gpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.608 6.75h-5.19v-1.5h7.75V13h-1.5V7.81l-7.72 7.72-1.06-1.06 7.72-7.72Z",clipRule:"evenodd"})}),G4=({size:t="sm",...e})=>Y.jsx(xe,{as:Gpe,className:zp({size:t}),...e}),Wpe=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.418 7h1.5V3.5h3.5V2h-5v5Zm11-5v1.5h3.5V7h1.5V2h-5Zm-9.5 11h-1.5v5h5v-1.5h-3.5V13Zm9.5 5v-1.5h3.5V13h1.5v5h-5Zm-3.75-4v-3.25h-3.25v-1.5h3.25V6h1.5v3.25h3.25v1.5h-3.25V14h-1.5Z",clipRule:"evenodd"})}),Kpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Wpe,className:zp({size:t}),...e}),Ype=t=>Y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Qpe=({size:t="sm",...e})=>Y.jsx(xe,{as:Ype,className:zp({size:t}),...e});var Jpe=jn({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11l8 fyvr11ow fyvr11no fyvr11sl fyvr1309 fyvr1307 fyvr12zz fyvr12zf fyvr12zb _4efw240",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),Zpe="_1c9x66f4 fyvr12w9 fyvr11l8 fyvr11ow fyvr11no fyvr12g fyvr164";const Xpe=({size:t="sm"})=>Y.jsx(Upe,{className:Zpe,children:Y.jsx(QT,{size:t==="lg"?"sm":"xs"})}),JT=D.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return Y.jsx(Vp,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:Y.jsx(jpe,{className:Jpe({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:Y.jsx(Xpe,{size:a})})})});qt.createContext(null);var e1e=J$.useId||(()=>{}),t1e=0;function Wa(t){const[e,r]=D.useState(e1e());return os(()=>{t||r(n=>n??String(t1e++))},[t]),t||(e?`radix-${e}`:"")}var ZT="Collapsible",[r1e,uUe]=Fs(ZT),[n1e,XT]=r1e(ZT),jH=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=Za({prop:n,defaultProp:i,onChange:o});return Y.jsx(n1e,{scope:r,disabled:s,contentId:Wa(),open:c,onOpenToggle:D.useCallback(()=>l(f=>!f),[l]),children:Y.jsx(jt.div,{"data-state":tP(c),"data-disabled":s?"":void 0,...a,ref:e})})});jH.displayName=ZT;var UH="CollapsibleTrigger",$H=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=XT(UH,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":tP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:ot(t.onClick,i.onOpenToggle)})});$H.displayName=UH;var eP="CollapsibleContent",qH=D.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=XT(eP,t.__scopeCollapsible);return Y.jsx(oo,{present:r||i.open,children:({present:s})=>Y.jsx(i1e,{...n,ref:e,present:s})})});qH.displayName=eP;var i1e=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=XT(eP,r),[a,c]=D.useState(n),l=D.useRef(null),f=kr(e,l),u=D.useRef(0),p=u.current,g=D.useRef(0),y=g.current,b=o.open||a,I=D.useRef(b),C=D.useRef();return D.useEffect(()=>{const S=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(S)},[]),os(()=>{const S=l.current;if(S){C.current=C.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const O=S.getBoundingClientRect();u.current=O.height,g.current=O.width,I.current||(S.style.transitionDuration=C.current.transitionDuration,S.style.animationName=C.current.animationName),c(n)}},[o.open,n]),Y.jsx(jt.div,{"data-state":tP(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...s,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:b&&i})});function tP(t){return t?"open":"closed"}var s1e=jH,o1e=$H,a1e=qH,hB="64px",c1e="_4j62fl0",l1e="_4j62fl2 _4j62fl1 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11l8 fyvr11ow fyvr11sl fyvr12g fyvr12zf fyvr11rc _4efw240",f1e="_4j62fl4 _4j62fl3 fyvr1zk fyvr111o fyvr1uw fyvr1xg fyvr12g",u1e="_4j62fl5";const VH=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=D.useState(n),f=i??c,u=g=>{i===void 0&&l(g)},p=g=>{u(g),s==null||s(g)};return Y.jsx(s1e,{open:f,defaultOpen:n,onOpenChange:p,asChild:!0,children:Y.jsxs(xe,{as:cp.div,className:pi(e,c1e),initial:{height:f?"auto":hB},animate:{height:f?"auto":hB},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[Y.jsxs(o1e,{className:l1e,children:[Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(xe,{as:cp.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:f?180:0},animate:{rotate:f?180:0},transition:{ease:"linear",duration:.1},children:Y.jsx(FH,{className:u1e,color:"text50"})})]}),Y.jsx(_H,{children:f&&Y.jsx(a1e,{className:f1e,asChild:!0,forceMount:!0,children:Y.jsx(cp.div,{initial:{opacity:f?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function W4(t){const e=t+"CollectionProvider",[r,n]=Fs(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,I=qt.useRef(null),C=qt.useRef(new Map).current;return Y.jsx(i,{scope:y,itemMap:C,collectionRef:I,children:b})};o.displayName=e;const a=t+"CollectionSlot",c=qt.forwardRef((g,y)=>{const{scope:b,children:I}=g,C=s(a,b),S=kr(y,C.collectionRef);return Y.jsx(Cp,{ref:S,children:I})});c.displayName=a;const l=t+"CollectionItemSlot",f="data-radix-collection-item",u=qt.forwardRef((g,y)=>{const{scope:b,children:I,...C}=g,S=qt.useRef(null),O=kr(y,S),L=s(l,b);return qt.useEffect(()=>(L.itemMap.set(S,{ref:S,...C}),()=>void L.itemMap.delete(S))),Y.jsx(Cp,{[f]:"",ref:O,children:I})});u.displayName=l;function p(g){const y=s(t+"CollectionConsumer",g);return qt.useCallback(()=>{const I=y.collectionRef.current;if(!I)return[];const C=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((L,F)=>C.indexOf(L.ref.current)-C.indexOf(F.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},p,n]}var d1e=D.createContext(void 0);function sx(t){const e=D.useContext(d1e);return t||e||"ltr"}function h1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t);D.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var p1e="DismissableLayer",g7="dismissableLayer.update",v1e="dismissableLayer.pointerDownOutside",g1e="dismissableLayer.focusOutside",pB,zH=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vy=D.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=D.useContext(zH),[f,u]=D.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=D.useState({}),y=kr(e,_=>u(_)),b=Array.from(l.layers),[I]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(I),S=f?b.indexOf(f):-1,O=l.layersWithOutsidePointerEventsDisabled.size>0,L=S>=C,F=m1e(_=>{const $=_.target,ie=[...l.branches].some(ce=>ce.contains($));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),z=b1e(_=>{const $=_.target;[...l.branches].some(ce=>ce.contains($))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},p);return h1e(_=>{S===l.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},p),D.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),vB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=pB)}},[f,p,r,l]),D.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),vB())},[f,l]),D.useEffect(()=>{const _=()=>g({});return document.addEventListener(g7,_),()=>document.removeEventListener(g7,_)},[]),Y.jsx(jt.div,{...c,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:ot(t.onFocusCapture,z.onFocusCapture),onBlurCapture:ot(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ot(t.onPointerDownCapture,F.onPointerDownCapture)})});vy.displayName=p1e;var y1e="DismissableLayerBranch",HH=D.forwardRef((t,e)=>{const r=D.useContext(zH),n=D.useRef(null),i=kr(e,n);return D.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),Y.jsx(jt.div,{...t,ref:i})});HH.displayName=y1e;function m1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=D.useRef(!1),i=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){GH(v1e,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function b1e(t,e=globalThis==null?void 0:globalThis.document){const r=Bs(t),n=D.useRef(!1);return D.useEffect(()=>{const i=s=>{s.target&&!n.current&&GH(g1e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function vB(){const t=new CustomEvent(g7);document.dispatchEvent(t)}function GH(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?KT(i,s):i.dispatchEvent(s)}var w1e=vy,x1e=HH,OA=0;function rP(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??gB()),document.body.insertAdjacentElement("beforeend",t[1]??gB()),OA++,()=>{OA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),OA--}},[])}function gB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var DA="focusScope.autoFocusOnMount",NA="focusScope.autoFocusOnUnmount",yB={bubbles:!1,cancelable:!0},E1e="FocusScope",K4=D.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=D.useState(null),l=Bs(i),f=Bs(s),u=D.useRef(null),p=kr(e,b=>c(b)),g=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(n){let b=function(O){if(g.paused||!a)return;const L=O.target;a.contains(L)?u.current=L:nd(u.current,{select:!0})},I=function(O){if(g.paused||!a)return;const L=O.relatedTarget;L!==null&&(a.contains(L)||nd(u.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const F of O)F.removedNodes.length>0&&nd(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",I);const S=new MutationObserver(C);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),S.disconnect()}}},[n,a,g.paused]),D.useEffect(()=>{if(a){bB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(DA,yB);a.addEventListener(DA,l),a.dispatchEvent(C),C.defaultPrevented||(C1e(T1e(WH(a)),{select:!0}),document.activeElement===b&&nd(a))}return()=>{a.removeEventListener(DA,l),setTimeout(()=>{const C=new CustomEvent(NA,yB);a.addEventListener(NA,f),a.dispatchEvent(C),C.defaultPrevented||nd(b??document.body,{select:!0}),a.removeEventListener(NA,f),bB.remove(g)},0)}}},[a,l,f,g]);const y=D.useCallback(b=>{if(!r&&!n||g.paused)return;const I=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(I&&C){const S=b.currentTarget,[O,L]=A1e(S);O&&L?!b.shiftKey&&C===L?(b.preventDefault(),r&&nd(O,{select:!0})):b.shiftKey&&C===O&&(b.preventDefault(),r&&nd(L,{select:!0})):C===S&&b.preventDefault()}},[r,n,g.paused]);return Y.jsx(jt.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});K4.displayName=E1e;function C1e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(nd(n,{select:e}),document.activeElement!==r)return}function A1e(t){const e=WH(t),r=mB(e,t),n=mB(e.reverse(),t);return[r,n]}function WH(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function mB(t,e){for(const r of t)if(!S1e(r,{upTo:e}))return r}function S1e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function _1e(t){return t instanceof HTMLInputElement&&"select"in t}function nd(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&_1e(t)&&e&&t.select()}}var bB=I1e();function I1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=wB(t,e),t.unshift(e)},remove(e){var r;t=wB(t,e),(r=t[0])==null||r.resume()}}}function wB(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function T1e(t){return t.filter(e=>e.tagName!=="A")}const P1e=["top","right","bottom","left"],Rl=Math.min,ta=Math.max,d5=Math.round,Z2=Math.floor,ih=t=>({x:t,y:t}),k1e={left:"right",right:"left",bottom:"top",top:"bottom"},M1e={start:"end",end:"start"};function y7(t,e,r){return ta(t,Rl(e,r))}function pu(t,e){return typeof t=="function"?t(e):t}function vu(t){return t.split("-")[0]}function gy(t){return t.split("-")[1]}function nP(t){return t==="x"?"y":"x"}function iP(t){return t==="y"?"height":"width"}function sh(t){return["top","bottom"].includes(vu(t))?"y":"x"}function sP(t){return nP(sh(t))}function R1e(t,e,r){r===void 0&&(r=!1);const n=gy(t),i=sP(t),s=iP(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=h5(o)),[o,h5(o)]}function O1e(t){const e=h5(t);return[m7(t),e,m7(e)]}function m7(t){return t.replace(/start|end/g,e=>M1e[e])}function D1e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function N1e(t,e,r,n){const i=gy(t);let s=D1e(vu(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(m7)))),s}function h5(t){return t.replace(/left|right|bottom|top/g,e=>k1e[e])}function B1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function KH(t){return typeof t!="number"?B1e(t):{top:t,right:t,bottom:t,left:t}}function p5(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function xB(t,e,r){let{reference:n,floating:i}=t;const s=sh(e),o=sP(e),a=iP(o),c=vu(e),l=s==="y",f=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let g;switch(c){case"top":g={x:f,y:n.y-i.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:u};break;case"left":g={x:n.x-i.width,y:u};break;default:g={x:n.x,y:n.y}}switch(gy(e)){case"start":g[o]-=p*(r&&l?-1:1);break;case"end":g[o]+=p*(r&&l?-1:1);break}return g}const L1e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=xB(l,n,c),p=n,g={},y=0;for(let b=0;b({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:f=0}=pu(t,e)||{};if(l==null)return{};const u=KH(f),p={x:r,y:n},g=sP(i),y=iP(g),b=await o.getDimensions(l),I=g==="y",C=I?"top":"left",S=I?"bottom":"right",O=I?"clientHeight":"clientWidth",L=s.reference[y]+s.reference[g]-p[g]-s.floating[y],F=p[g]-s.reference[g],z=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=z?z[O]:0;(!_||!await(o.isElement==null?void 0:o.isElement(z)))&&(_=a.floating[O]||s.floating[y]);const $=L/2-F/2,ie=_/2-b[y]/2-1,ce=Rl(u[C],ie),K=Rl(u[S],ie),P=ce,M=_-b[y]-K,v=_/2-b[y]/2+$,m=y7(P,v,M),R=!c.arrow&&gy(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,P;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:ce},reset:{placement:m}};let R=(P=ce.filter(B=>B.overflows[0]<=0).sort((B,E)=>B.overflows[1]-E.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var M;const B=(M=ce.filter(E=>{if(z){const x=sh(E.placement);return x===S||x==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(x=>x>0).reduce((x,w)=>x+w,0)]).sort((E,x)=>E[1]-x[1])[0])==null?void 0:M[0];B&&(R=B);break}case"initialPlacement":R=a;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function EB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function CB(t){return P1e.some(e=>t[e]>=0)}const U1e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=pu(t,e);switch(n){case"referenceHidden":{const s=await aw(e,{...i,elementContext:"reference"}),o=EB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:CB(o)}}}case"escaped":{const s=await aw(e,{...i,altBoundary:!0}),o=EB(s,r.floating);return{data:{escapedOffsets:o,escaped:CB(o)}}}default:return{}}}}};async function $1e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=vu(r),a=gy(r),c=sh(r)==="y",l=["left","top"].includes(o)?-1:1,f=s&&c?-1:1,u=pu(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*f,y:p*l}:{x:p*l,y:g*f}}const q1e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await $1e(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},V1e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:I=>{let{x:C,y:S}=I;return{x:C,y:S}}},...c}=pu(t,e),l={x:r,y:n},f=await aw(e,c),u=sh(vu(i)),p=nP(u);let g=l[p],y=l[u];if(s){const I=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+f[I],O=g-f[C];g=y7(S,g,O)}if(o){const I=u==="y"?"top":"left",C=u==="y"?"bottom":"right",S=y+f[I],O=y-f[C];y=y7(S,y,O)}const b=a.fn({...e,[p]:g,[u]:y});return{...b,data:{x:b.x-r,y:b.y-n}}}}},z1e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=pu(t,e),f={x:r,y:n},u=sh(i),p=nP(u);let g=f[p],y=f[u];const b=pu(a,e),I=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const O=p==="y"?"height":"width",L=s.reference[p]-s.floating[O]+I.mainAxis,F=s.reference[p]+s.reference[O]-I.mainAxis;gF&&(g=F)}if(l){var C,S;const O=p==="y"?"width":"height",L=["top","left"].includes(vu(i)),F=s.reference[u]-s.floating[O]+(L&&((C=o.offset)==null?void 0:C[u])||0)+(L?0:I.crossAxis),z=s.reference[u]+s.reference[O]+(L?0:((S=o.offset)==null?void 0:S[u])||0)-(L?I.crossAxis:0);yz&&(y=z)}return{[p]:g,[u]:y}}}},H1e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=pu(t,e),c=await aw(e,a),l=vu(r),f=gy(r),u=sh(r)==="y",{width:p,height:g}=n.floating;let y,b;l==="top"||l==="bottom"?(y=l,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=l,y=f==="end"?"top":"bottom");const I=g-c.top-c.bottom,C=p-c.left-c.right,S=Rl(g-c[y],I),O=Rl(p-c[b],C),L=!e.middlewareData.shift;let F=S,z=O;if(u?z=f||L?Rl(O,C):C:F=f||L?Rl(S,I):I,L&&!f){const $=ta(c.left,0),ie=ta(c.right,0),ce=ta(c.top,0),K=ta(c.bottom,0);u?z=p-2*($!==0||ie!==0?$+ie:ta(c.left,c.right)):F=g-2*(ce!==0||K!==0?ce+K:ta(c.top,c.bottom))}await o({...e,availableWidth:z,availableHeight:F});const _=await i.getDimensions(s.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function yy(t){return YH(t)?(t.nodeName||"").toLowerCase():"#document"}function aa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Iu(t){var e;return(e=(YH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function YH(t){return t instanceof Node||t instanceof aa(t).Node}function Vl(t){return t instanceof Element||t instanceof aa(t).Element}function zl(t){return t instanceof HTMLElement||t instanceof aa(t).HTMLElement}function AB(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof aa(t).ShadowRoot}function ox(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=zc(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function G1e(t){return["table","td","th"].includes(yy(t))}function Y4(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function oP(t){const e=aP(),r=zc(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function W1e(t){let e=oh(t);for(;zl(e)&&!Hg(e);){if(Y4(e))return null;if(oP(e))return e;e=oh(e)}return null}function aP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hg(t){return["html","body","#document"].includes(yy(t))}function zc(t){return aa(t).getComputedStyle(t)}function Q4(t){return Vl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oh(t){if(yy(t)==="html")return t;const e=t.assignedSlot||t.parentNode||AB(t)&&t.host||Iu(t);return AB(e)?e.host:e}function QH(t){const e=oh(t);return Hg(e)?t.ownerDocument?t.ownerDocument.body:t.body:zl(e)&&ox(e)?e:QH(e)}function cw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=QH(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=aa(i);return s?e.concat(o,o.visualViewport||[],ox(i)?i:[],o.frameElement&&r?cw(o.frameElement):[]):e.concat(i,cw(i,[],r))}function JH(t){const e=zc(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=zl(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=d5(r)!==s||d5(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function cP(t){return Vl(t)?t:t.contextElement}function Iv(t){const e=cP(t);if(!zl(e))return ih(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=JH(e);let o=(s?d5(r.width):r.width)/n,a=(s?d5(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const K1e=ih(0);function ZH(t){const e=aa(t);return!aP()||!e.visualViewport?K1e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Y1e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==aa(t)?!1:e}function Ap(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=cP(t);let o=ih(1);e&&(n?Vl(n)&&(o=Iv(n)):o=Iv(t));const a=Y1e(s,r,n)?ZH(s):ih(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(s){const p=aa(s),g=n&&Vl(n)?aa(n):n;let y=p,b=y.frameElement;for(;b&&n&&g!==y;){const I=Iv(b),C=b.getBoundingClientRect(),S=zc(b),O=C.left+(b.clientLeft+parseFloat(S.paddingLeft))*I.x,L=C.top+(b.clientTop+parseFloat(S.paddingTop))*I.y;c*=I.x,l*=I.y,f*=I.x,u*=I.y,c+=O,l+=L,y=aa(b),b=y.frameElement}}return p5({width:f,height:u,x:c,y:l})}function Q1e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=Iu(n),a=e?Y4(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=ih(1);const f=ih(0),u=zl(n);if((u||!u&&!s)&&((yy(n)!=="body"||ox(o))&&(c=Q4(n)),zl(n))){const p=Ap(n);l=Iv(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+f.x,y:r.y*l.y-c.scrollTop*l.y+f.y}}function J1e(t){return Array.from(t.getClientRects())}function XH(t){return Ap(Iu(t)).left+Q4(t).scrollLeft}function Z1e(t){const e=Iu(t),r=Q4(t),n=t.ownerDocument.body,i=ta(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ta(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+XH(t);const a=-r.scrollTop;return zc(n).direction==="rtl"&&(o+=ta(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function X1e(t,e){const r=aa(t),n=Iu(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=aP();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function eve(t,e){const r=Ap(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=zl(t)?Iv(t):ih(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function SB(t,e,r){let n;if(e==="viewport")n=X1e(t,r);else if(e==="document")n=Z1e(Iu(t));else if(Vl(e))n=eve(e,r);else{const i=ZH(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return p5(n)}function eG(t,e){const r=oh(t);return r===e||!Vl(r)||Hg(r)?!1:zc(r).position==="fixed"||eG(r,e)}function tve(t,e){const r=e.get(t);if(r)return r;let n=cw(t,[],!1).filter(a=>Vl(a)&&yy(a)!=="body"),i=null;const s=zc(t).position==="fixed";let o=s?oh(t):t;for(;Vl(o)&&!Hg(o);){const a=zc(o),c=oP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ox(o)&&!c&&eG(t,o))?n=n.filter(f=>f!==o):i=a,o=oh(o)}return e.set(t,n),n}function rve(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?Y4(e)?[]:tve(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,f)=>{const u=SB(e,f,i);return l.top=ta(u.top,l.top),l.right=Rl(u.right,l.right),l.bottom=Rl(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},SB(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function nve(t){const{width:e,height:r}=JH(t);return{width:e,height:r}}function ive(t,e,r){const n=zl(e),i=Iu(e),s=r==="fixed",o=Ap(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ih(0);if(n||!n&&!s)if((yy(e)!=="body"||ox(i))&&(a=Q4(e)),n){const u=Ap(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&(c.x=XH(i));const l=o.left+a.scrollLeft-c.x,f=o.top+a.scrollTop-c.y;return{x:l,y:f,width:o.width,height:o.height}}function BA(t){return zc(t).position==="static"}function _B(t,e){return!zl(t)||zc(t).position==="fixed"?null:e?e(t):t.offsetParent}function tG(t,e){const r=aa(t);if(Y4(t))return r;if(!zl(t)){let i=oh(t);for(;i&&!Hg(i);){if(Vl(i)&&!BA(i))return i;i=oh(i)}return r}let n=_B(t,e);for(;n&&G1e(n)&&BA(n);)n=_B(n,e);return n&&Hg(n)&&BA(n)&&!oP(n)?r:n||W1e(t)||r}const sve=async function(t){const e=this.getOffsetParent||tG,r=this.getDimensions,n=await r(t.floating);return{reference:ive(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ove(t){return zc(t).direction==="rtl"}const ave={convertOffsetParentRelativeRectToViewportRelativeRect:Q1e,getDocumentElement:Iu,getClippingRect:rve,getOffsetParent:tG,getElementRects:sve,getClientRects:J1e,getDimensions:nve,getScale:Iv,isElement:Vl,isRTL:ove};function cve(t,e){let r=null,n;const i=Iu(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:u,height:p}=t.getBoundingClientRect();if(a||e(),!u||!p)return;const g=Z2(f),y=Z2(i.clientWidth-(l+u)),b=Z2(i.clientHeight-(f+p)),I=Z2(l),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-I+"px",threshold:ta(0,Rl(1,c))||1};let O=!0;function L(F){const z=F[0].intersectionRatio;if(z!==c){if(!O)return o();z?o(!1,z):n=setTimeout(()=>{o(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(L,{...S,root:i.ownerDocument})}catch{r=new IntersectionObserver(L,S)}r.observe(t)}return o(!0),s}function lve(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=cP(t),f=i||s?[...l?cw(l):[],...cw(e)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});const u=l&&a?cve(l,r):null;let p=-1,g=null;o&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===l&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var O;(O=g)==null||O.observe(e)})),r()}),l&&!c&&g.observe(l),g.observe(e));let y,b=c?Ap(t):null;c&&I();function I(){const C=Ap(t);b&&(C.x!==b.x||C.y!==b.y||C.width!==b.width||C.height!==b.height)&&r(),b=C,y=requestAnimationFrame(I)}return r(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",r),s&&S.removeEventListener("resize",r)}),u==null||u(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const fve=q1e,uve=V1e,dve=j1e,hve=H1e,pve=U1e,IB=F1e,vve=z1e,gve=(t,e,r)=>{const n=new Map,i={platform:ave,...r},s={...i.platform,_c:n};return L1e(t,e,{...i,platform:s})};var Y6=typeof document<"u"?D.useLayoutEffect:D.useEffect;function v5(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!v5(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!v5(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function rG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function TB(t,e){const r=rG(t);return Math.round(e*r)/r}function PB(t){const e=D.useRef(t);return Y6(()=>{e.current=t}),e}function yve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[f,u]=D.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,g]=D.useState(n);v5(p,n)||g(n);const[y,b]=D.useState(null),[I,C]=D.useState(null),S=D.useCallback(B=>{B!==z.current&&(z.current=B,b(B))},[]),O=D.useCallback(B=>{B!==_.current&&(_.current=B,C(B))},[]),L=s||y,F=o||I,z=D.useRef(null),_=D.useRef(null),$=D.useRef(f),ie=c!=null,ce=PB(c),K=PB(i),P=D.useCallback(()=>{if(!z.current||!_.current)return;const B={placement:e,strategy:r,middleware:p};K.current&&(B.platform=K.current),gve(z.current,_.current,B).then(E=>{const x={...E,isPositioned:!0};M.current&&!v5($.current,x)&&($.current=x,wh.flushSync(()=>{u(x)}))})},[p,e,r,K]);Y6(()=>{l===!1&&$.current.isPositioned&&($.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[l]);const M=D.useRef(!1);Y6(()=>(M.current=!0,()=>{M.current=!1}),[]),Y6(()=>{if(L&&(z.current=L),F&&(_.current=F),L&&F){if(ce.current)return ce.current(L,F,P);P()}},[L,F,P,ce,ie]);const v=D.useMemo(()=>({reference:z,floating:_,setReference:S,setFloating:O}),[S,O]),m=D.useMemo(()=>({reference:L,floating:F}),[L,F]),R=D.useMemo(()=>{const B={position:r,left:0,top:0};if(!m.floating)return B;const E=TB(m.floating,f.x),x=TB(m.floating,f.y);return a?{...B,transform:"translate("+E+"px, "+x+"px)",...rG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:x}},[r,a,m.floating,f.x,f.y]);return D.useMemo(()=>({...f,update:P,refs:v,elements:m,floatingStyles:R}),[f,P,v,m,R])}const mve=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?IB({element:n.current,padding:i}).fn(r):{}:n?IB({element:n,padding:i}).fn(r):{}}}},bve=(t,e)=>({...fve(t),options:[t,e]}),wve=(t,e)=>({...uve(t),options:[t,e]}),xve=(t,e)=>({...vve(t),options:[t,e]}),Eve=(t,e)=>({...dve(t),options:[t,e]}),Cve=(t,e)=>({...hve(t),options:[t,e]}),Ave=(t,e)=>({...pve(t),options:[t,e]}),Sve=(t,e)=>({...mve(t),options:[t,e]});var _ve="Arrow",nG=D.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return Y.jsx(jt.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:Y.jsx("polygon",{points:"0,0 30,0 15,10"})})});nG.displayName=_ve;var Ive=nG,lP="Popper",[iG,my]=Fs(lP),[Tve,sG]=iG(lP),oG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=D.useState(null);return Y.jsx(Tve,{scope:e,anchor:n,onAnchorChange:i,children:r})};oG.displayName=lP;var aG="PopperAnchor",cG=D.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=sG(aG,r),o=D.useRef(null),a=kr(e,o);return D.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:Y.jsx(jt.div,{...i,ref:a})});cG.displayName=aG;var fP="PopperContent",[Pve,kve]=iG(fP),lG=D.forwardRef((t,e)=>{var r,n,i,s,o,a;const{__scopePopper:c,side:l="bottom",sideOffset:f=0,align:u="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:I=0,sticky:C="partial",hideWhenDetached:S=!1,updatePositionStrategy:O="optimized",onPlaced:L,...F}=t,z=sG(fP,c),[_,$]=D.useState(null),ie=kr(e,Ee=>$(Ee)),[ce,K]=D.useState(null),P=H4(ce),M=(P==null?void 0:P.width)??0,v=(P==null?void 0:P.height)??0,m=l+(u!=="center"?"-"+u:""),R=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},B=Array.isArray(b)?b:[b],E=B.length>0,x={padding:R,boundary:B.filter(Rve),altBoundary:E},{refs:w,floatingStyles:T,placement:k,isPositioned:H,middlewareData:oe}=yve({strategy:"fixed",placement:m,whileElementsMounted:(...Ee)=>lve(...Ee,{animationFrame:O==="always"}),elements:{reference:z.anchor},middleware:[bve({mainAxis:f+v,alignmentAxis:p}),y&&wve({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?xve():void 0,...x}),y&&Eve({...x}),Cve({...x,apply:({elements:Ee,rects:_e,availableWidth:Re,availableHeight:Te})=>{const{width:De,height:ze}=_e.reference,Xe=Ee.floating.style;Xe.setProperty("--radix-popper-available-width",`${Re}px`),Xe.setProperty("--radix-popper-available-height",`${Te}px`),Xe.setProperty("--radix-popper-anchor-width",`${De}px`),Xe.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),ce&&Sve({element:ce,padding:g}),Ove({arrowWidth:M,arrowHeight:v}),S&&Ave({strategy:"referenceHidden",...x})]}),[j,X]=dG(k),G=Bs(L);os(()=>{H&&(G==null||G())},[H,G]);const Z=(r=oe.arrow)==null?void 0:r.x,ee=(n=oe.arrow)==null?void 0:n.y,N=((i=oe.arrow)==null?void 0:i.centerOffset)!==0,[te,fe]=D.useState();return os(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),Y.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:H?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(s=oe.transformOrigin)==null?void 0:s.x,(o=oe.transformOrigin)==null?void 0:o.y].join(" "),...((a=oe.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Y.jsx(Pve,{scope:c,placedSide:j,onArrowChange:K,arrowX:Z,arrowY:ee,shouldHideArrow:N,children:Y.jsx(jt.div,{"data-side":j,"data-align":X,...F,ref:ie,style:{...F.style,animation:H?void 0:"none"}})})})});lG.displayName=fP;var fG="PopperArrow",Mve={top:"bottom",right:"left",bottom:"top",left:"right"},uG=D.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=kve(fG,n),o=Mve[s.placedSide];return Y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:Y.jsx(Ive,{...i,ref:r,style:{...i.style,display:"block"}})})});uG.displayName=fG;function Rve(t){return t!==null}var Ove=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i;const{placement:s,rects:o,middlewareData:a}=e,l=((r=a.arrow)==null?void 0:r.centerOffset)!==0,f=l?0:t.arrowWidth,u=l?0:t.arrowHeight,[p,g]=dG(s),y={start:"0%",center:"50%",end:"100%"}[g],b=(((n=a.arrow)==null?void 0:n.x)??0)+f/2,I=(((i=a.arrow)==null?void 0:i.y)??0)+u/2;let C="",S="";return p==="bottom"?(C=l?y:`${b}px`,S=`${-u}px`):p==="top"?(C=l?y:`${b}px`,S=`${o.floating.height+u}px`):p==="right"?(C=`${-u}px`,S=l?y:`${I}px`):p==="left"&&(C=`${o.floating.width+u}px`,S=l?y:`${I}px`),{data:{x:C,y:S}}}});function dG(t){const[e,r="center"]=t.split("-");return[e,r]}var uP=oG,dP=cG,hP=lG,pP=uG,Dve="Portal",ax=D.forwardRef((t,e)=>{var r;const{container:n,...i}=t,[s,o]=D.useState(!1);os(()=>o(!0),[]);const a=n||s&&((r=globalThis==null?void 0:globalThis.document)==null?void 0:r.body);return a?Pfe.createPortal(Y.jsx(jt.div,{...i,ref:e}),a):null});ax.displayName=Dve;var LA="rovingFocusGroup.onEntryFocus",Nve={bubbles:!1,cancelable:!0},J4="RovingFocusGroup",[b7,hG,Bve]=W4(J4),[Lve,by]=Fs(J4,[Bve]),[Fve,jve]=Lve(J4),pG=D.forwardRef((t,e)=>Y.jsx(b7.Provider,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(b7.Slot,{scope:t.__scopeRovingFocusGroup,children:Y.jsx(Uve,{...t,ref:e})})}));pG.displayName=J4;var Uve=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=t,p=D.useRef(null),g=kr(e,p),y=sx(s),[b=null,I]=Za({prop:o,defaultProp:a,onChange:c}),[C,S]=D.useState(!1),O=Bs(l),L=hG(r),F=D.useRef(!1),[z,_]=D.useState(0);return D.useEffect(()=>{const $=p.current;if($)return $.addEventListener(LA,O),()=>$.removeEventListener(LA,O)},[O]),Y.jsx(Fve,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:b,onItemFocus:D.useCallback($=>I($),[I]),onItemShiftTab:D.useCallback(()=>S(!0),[]),onFocusableItemAdd:D.useCallback(()=>_($=>$+1),[]),onFocusableItemRemove:D.useCallback(()=>_($=>$-1),[]),children:Y.jsx(jt.div,{tabIndex:C||z===0?-1:0,"data-orientation":n,...u,ref:g,style:{outline:"none",...t.style},onMouseDown:ot(t.onMouseDown,()=>{F.current=!0}),onFocus:ot(t.onFocus,$=>{const ie=!F.current;if($.target===$.currentTarget&&ie&&!C){const ce=new CustomEvent(LA,Nve);if($.currentTarget.dispatchEvent(ce),!ce.defaultPrevented){const K=L().filter(R=>R.focusable),P=K.find(R=>R.active),M=K.find(R=>R.id===b),m=[P,M,...K].filter(Boolean).map(R=>R.ref.current);yG(m,f)}}F.current=!1}),onBlur:ot(t.onBlur,()=>S(!1))})})}),vG="RovingFocusGroupItem",gG=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Wa(),c=s||a,l=jve(vG,r),f=l.currentTabStopId===c,u=hG(r),{onFocusableItemAdd:p,onFocusableItemRemove:g}=l;return D.useEffect(()=>{if(n)return p(),()=>g()},[n,p,g]),Y.jsx(b7.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:Y.jsx(jt.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...o,ref:e,onMouseDown:ot(t.onMouseDown,y=>{n?l.onItemFocus(c):y.preventDefault()}),onFocus:ot(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:ot(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){l.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=Vve(y,l.orientation,l.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=u().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")C.reverse();else if(b==="prev"||b==="next"){b==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=l.loop?zve(C,S+1):C.slice(S+1)}setTimeout(()=>yG(C))}})})})});gG.displayName=vG;var $ve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qve(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Vve(t,e,r){const n=qve(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return $ve[n]}function yG(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function zve(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var vP=pG,gP=gG,Hve=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},P1=new WeakMap,X2=new WeakMap,e6={},FA=0,mG=function(t){return t&&(t.host||mG(t.parentNode))},Gve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=mG(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Wve=function(t,e,r,n){var i=Gve(e,Array.isArray(t)?t:[t]);e6[r]||(e6[r]=new WeakMap);var s=e6[r],o=[],a=new Set,c=new Set(i),l=function(u){!u||a.has(u)||(a.add(u),l(u.parentNode))};i.forEach(l);var f=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))f(p);else try{var g=p.getAttribute(n),y=g!==null&&g!=="false",b=(P1.get(p)||0)+1,I=(s.get(p)||0)+1;P1.set(p,b),s.set(p,I),o.push(p),b===1&&y&&X2.set(p,!0),I===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return f(e),a.clear(),FA++,function(){o.forEach(function(u){var p=P1.get(u)-1,g=s.get(u)-1;P1.set(u,p),s.set(u,g),p||(X2.has(u)||u.removeAttribute(n),X2.delete(u)),g||u.removeAttribute(r)}),FA--,FA||(P1=new WeakMap,P1=new WeakMap,X2=new WeakMap,e6={})}},yP=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=Hve(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Wve(n,i,r,"aria-hidden")):function(){return null}},Tl=function(){return Tl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return fge;var e=uge(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},hge=EG(),Tv="data-scroll-locked",pge=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` .`.concat(Yve,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } - body[`).concat(Iv,`] { + body[`).concat(Tv,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` @@ -76,46 +76,46 @@ Error generating stack: `+s.message+` `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(t3,` { + .`).concat(Q6,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(r3,` { + .`).concat(J6,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat(t3," .").concat(t3,` { + .`).concat(Q6," .").concat(Q6,` { right: 0 `).concat(n,`; } - .`).concat(r3," .").concat(r3,` { + .`).concat(J6," .").concat(J6,` { margin-right: 0 `).concat(n,`; } - body[`).concat(Iv,`] { + body[`).concat(Tv,`] { `).concat(Qve,": ").concat(a,`px; } -`)},DB=function(){var t=parseInt(document.body.getAttribute(Iv)||"0",10);return isFinite(t)?t:0},vge=function(){D.useEffect(function(){return document.body.setAttribute(Iv,(DB()+1).toString()),function(){var t=DB()-1;t<=0?document.body.removeAttribute(Iv):document.body.setAttribute(Iv,t.toString())}},[])},gge=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;vge();var s=D.useMemo(function(){return dge(i)},[i]);return D.createElement(hge,{styles:pge(s,!e,i,r?"":"!important")})},C7=!1;if(typeof window<"u")try{var o6=Object.defineProperty({},"passive",{get:function(){return C7=!0,!0}});window.addEventListener("test",o6,o6),window.removeEventListener("test",o6,o6)}catch{C7=!1}var P1=C7?{passive:!1}:!1,yge=function(t){return t.tagName==="TEXTAREA"},_G=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!yge(t)&&r[e]==="visible")},mge=function(t){return _G(t,"overflowY")},bge=function(t){return _G(t,"overflowX")},NB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=IG(t,n);if(i){var s=TG(t,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wge=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},xge=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},IG=function(t,e){return t==="v"?mge(e):bge(e)},TG=function(t,e){return t==="v"?wge(e):xge(e)},Ege=function(t,e){return t==="h"&&e==="rtl"?-1:1},Cge=function(t,e,r,n,i){var s=Ege(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,f=o>0,u=0,p=0;do{var g=TG(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&IG(t,a)&&(u+=C,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(u)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(l=!0),l},a6=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},BB=function(t){return[t.deltaX,t.deltaY]},LB=function(t){return t&&"current"in t?t.current:t},Age=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Sge=function(t){return` +`)},MB=function(){var t=parseInt(document.body.getAttribute(Tv)||"0",10);return isFinite(t)?t:0},vge=function(){D.useEffect(function(){return document.body.setAttribute(Tv,(MB()+1).toString()),function(){var t=MB()-1;t<=0?document.body.removeAttribute(Tv):document.body.setAttribute(Tv,t.toString())}},[])},gge=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;vge();var s=D.useMemo(function(){return dge(i)},[i]);return D.createElement(hge,{styles:pge(s,!e,i,r?"":"!important")})},w7=!1;if(typeof window<"u")try{var t6=Object.defineProperty({},"passive",{get:function(){return w7=!0,!0}});window.addEventListener("test",t6,t6),window.removeEventListener("test",t6,t6)}catch{w7=!1}var k1=w7?{passive:!1}:!1,yge=function(t){return t.tagName==="TEXTAREA"},CG=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!yge(t)&&r[e]==="visible")},mge=function(t){return CG(t,"overflowY")},bge=function(t){return CG(t,"overflowX")},RB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=AG(t,n);if(i){var s=SG(t,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wge=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},xge=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},AG=function(t,e){return t==="v"?mge(e):bge(e)},SG=function(t,e){return t==="v"?wge(e):xge(e)},Ege=function(t,e){return t==="h"&&e==="rtl"?-1:1},Cge=function(t,e,r,n,i){var s=Ege(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,f=o>0,u=0,p=0;do{var g=SG(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&AG(t,a)&&(u+=C,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(f&&(Math.abs(u)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(l=!0),l},r6=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},OB=function(t){return[t.deltaX,t.deltaY]},DB=function(t){return t&&"current"in t?t.current:t},Age=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Sge=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},_ge=0,k1=[];function Ige(t){var e=D.useRef([]),r=D.useRef([0,0]),n=D.useRef(),i=D.useState(_ge++)[0],s=D.useState(SG)[0],o=D.useRef(t);D.useEffect(function(){o.current=t},[t]),D.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=Kve([t.lockRef.current],(t.shards||[]).map(LB)).filter(Boolean);return b.forEach(function(I){return I.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=D.useCallback(function(b,I){if("touches"in b&&b.touches.length===2)return!o.current.allowPinchZoom;var C=a6(b),S=r.current,O="deltaX"in b?b.deltaX:S[0]-C[0],L="deltaY"in b?b.deltaY:S[1]-C[1],F,z=b.target,_=Math.abs(O)>Math.abs(L)?"h":"v";if("touches"in b&&_==="h"&&z.type==="range")return!1;var $=NB(_,z);if(!$)return!0;if($?F=_:(F=_==="v"?"h":"v",$=NB(_,z)),!$)return!1;if(!n.current&&"changedTouches"in b&&(O||L)&&(n.current=F),!F)return!0;var ie=n.current||F;return Cge(ie,I,b,ie==="h"?O:L,!0)},[]),c=D.useCallback(function(b){var I=b;if(!(!k1.length||k1[k1.length-1]!==s)){var C="deltaY"in I?BB(I):a6(I),S=e.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&Age(F.delta,C)})[0];if(S&&S.should){I.cancelable&&I.preventDefault();return}if(!S){var O=(o.current.shards||[]).map(LB).filter(Boolean).filter(function(F){return F.contains(I.target)}),L=O.length>0?a(I,O[0]):!o.current.noIsolation;L&&I.cancelable&&I.preventDefault()}}},[]),l=D.useCallback(function(b,I,C,S){var O={name:b,delta:I,target:C,should:S,shadowParent:Tge(C)};e.current.push(O),setTimeout(function(){e.current=e.current.filter(function(L){return L!==O})},1)},[]),f=D.useCallback(function(b){r.current=a6(b),n.current=void 0},[]),u=D.useCallback(function(b){l(b.type,BB(b),b.target,a(b,t.lockRef.current))},[]),p=D.useCallback(function(b){l(b.type,a6(b),b.target,a(b,t.lockRef.current))},[]);D.useEffect(function(){return k1.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",c,P1),document.addEventListener("touchmove",c,P1),document.addEventListener("touchstart",f,P1),function(){k1=k1.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,P1),document.removeEventListener("touchmove",c,P1),document.removeEventListener("touchstart",f,P1)}},[]);var g=t.removeScrollBar,y=t.inert;return D.createElement(D.Fragment,null,y?D.createElement(s,{styles:Sge(i)}):null,g?D.createElement(gge,{gapMode:t.gapMode}):null)}function Tge(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Pge=nge(AG,Ige);var i8=D.forwardRef(function(t,e){return D.createElement(n8,Dl({},t,{ref:e,sideCar:Pge}))});i8.classNames=n8.classNames;var A7=["Enter"," "],kge=["ArrowDown","PageUp","Home"],PG=["ArrowUp","PageDown","End"],Mge=[...kge,...PG],Rge={ltr:[...A7,"ArrowRight"],rtl:[...A7,"ArrowLeft"]},Oge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},lx="Menu",[fw,Dge,Nge]=Z4(lx),[Hp,kG]=Bs(lx,[Nge,yy,my]),s8=yy(),MG=my(),[Bge,Gp]=Hp(lx),[Lge,fx]=Hp(lx),RG=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=t,a=s8(e),[c,l]=D.useState(null),f=D.useRef(!1),u=Ds(s),p=ox(i);return D.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),Y.jsx(pP,{...a,children:Y.jsx(Bge,{scope:e,open:r,onOpenChange:u,content:c,onContentChange:l,children:Y.jsx(Lge,{scope:e,onClose:D.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:p,modal:o,children:n})})})};RG.displayName=lx;var Fge="MenuAnchor",xP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=s8(r);return Y.jsx(vP,{...i,...n,ref:e})});xP.displayName=Fge;var EP="MenuPortal",[jge,OG]=Hp(EP,{forceMount:void 0}),DG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Gp(EP,e);return Y.jsx(jge,{scope:e,forceMount:r,children:Y.jsx(no,{present:r||s.open,children:Y.jsx(cx,{asChild:!0,container:i,children:n})})})};DG.displayName=EP;var ec="MenuContent",[Uge,CP]=Hp(ec),NG=D.forwardRef((t,e)=>{const r=OG(ec,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(ec,t.__scopeMenu),o=fx(ec,t.__scopeMenu);return Y.jsx(fw.Provider,{scope:t.__scopeMenu,children:Y.jsx(no,{present:n||s.open,children:Y.jsx(fw.Slot,{scope:t.__scopeMenu,children:o.modal?Y.jsx($ge,{...i,ref:e}):Y.jsx(qge,{...i,ref:e})})})})}),$ge=D.forwardRef((t,e)=>{const r=Gp(ec,t.__scopeMenu),n=D.useRef(null),i=Tr(e,n);return D.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(AP,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),qge=D.forwardRef((t,e)=>{const r=Gp(ec,t.__scopeMenu);return Y.jsx(AP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),AP=D.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,...b}=t,I=Gp(ec,r),C=fx(ec,r),S=s8(r),O=MG(r),L=Dge(r),[F,z]=D.useState(null),_=D.useRef(null),$=Tr(e,_,I.onContentChange),ie=D.useRef(0),ce=D.useRef(""),K=D.useRef(0),P=D.useRef(null),M=D.useRef("right"),v=D.useRef(0),m=y?i8:D.Fragment,R=y?{as:Cp,allowPinchZoom:!0}:void 0,B=x=>{var w,T;const k=ce.current+x,H=L().filter(ee=>!ee.disabled),oe=document.activeElement,j=(w=H.find(ee=>ee.ref.current===oe))==null?void 0:w.textValue,X=H.map(ee=>ee.textValue),G=eye(X,k,j),Z=(T=H.find(ee=>ee.textValue===G))==null?void 0:T.ref.current;(function ee(N){ce.current=N,window.clearTimeout(ie.current),N!==""&&(ie.current=window.setTimeout(()=>ee(""),1e3))})(k),Z&&setTimeout(()=>Z.focus())};D.useEffect(()=>()=>window.clearTimeout(ie.current),[]),sP();const E=D.useCallback(x=>{var w,T;return M.current===((w=P.current)==null?void 0:w.side)&&rye(x,(T=P.current)==null?void 0:T.area)},[]);return Y.jsx(Uge,{scope:r,searchRef:ce,onItemEnter:D.useCallback(x=>{E(x)&&x.preventDefault()},[E]),onItemLeave:D.useCallback(x=>{var w;E(x)||((w=_.current)==null||w.focus(),z(null))},[E]),onTriggerLeave:D.useCallback(x=>{E(x)&&x.preventDefault()},[E]),pointerGraceTimerRef:K,onPointerGraceIntentChange:D.useCallback(x=>{P.current=x},[]),children:Y.jsx(m,{...R,children:Y.jsx(X4,{asChild:!0,trapped:i,onMountAutoFocus:ot(s,x=>{var w;x.preventDefault(),(w=_.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:Y.jsx(py,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,children:Y.jsx(mP,{asChild:!0,...O,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:z,onEntryFocus:ot(c,x=>{C.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(gP,{role:"menu","aria-orientation":"vertical","data-state":JG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:$,style:{outline:"none",...b.style},onKeyDown:ot(b.onKeyDown,x=>{const T=x.target.closest("[data-radix-menu-content]")===x.currentTarget,k=x.ctrlKey||x.altKey||x.metaKey,H=x.key.length===1;T&&(x.key==="Tab"&&x.preventDefault(),!k&&H&&B(x.key));const oe=_.current;if(x.target!==oe||!Mge.includes(x.key))return;x.preventDefault();const X=L().filter(G=>!G.disabled).map(G=>G.ref.current);PG.includes(x.key)&&X.reverse(),Zge(X)}),onBlur:ot(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(ie.current),ce.current="")}),onPointerMove:ot(t.onPointerMove,uw(x=>{const w=x.target,T=v.current!==x.clientX;if(x.currentTarget.contains(w)&&T){const k=x.clientX>v.current?"right":"left";M.current=k,v.current=x.clientX}}))})})})})})})});NG.displayName=ec;var Vge="MenuGroup",SP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});SP.displayName=Vge;var zge="MenuLabel",BG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});BG.displayName=zge;var x5="MenuItem",FB="menu.itemSelect",o8=D.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=D.useRef(null),o=fx(x5,t.__scopeMenu),a=CP(x5,t.__scopeMenu),c=Tr(e,s),l=D.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent(FB,{bubbles:!0,cancelable:!0});u.addEventListener(FB,g=>n==null?void 0:n(g),{once:!0}),JT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(LG,{...i,ref:c,disabled:r,onClick:ot(t.onClick,f),onPointerDown:u=>{var p;(p=t.onPointerDown)==null||p.call(t,u),l.current=!0},onPointerUp:ot(t.onPointerUp,u=>{var p;l.current||(p=u.currentTarget)==null||p.click()}),onKeyDown:ot(t.onKeyDown,u=>{const p=a.searchRef.current!=="";r||p&&u.key===" "||A7.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});o8.displayName=x5;var LG=D.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=CP(x5,r),a=MG(r),c=D.useRef(null),l=Tr(e,c),[f,u]=D.useState(!1),[p,g]=D.useState("");return D.useEffect(()=>{const y=c.current;y&&g((y.textContent??"").trim())},[s.children]),Y.jsx(fw.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:Y.jsx(bP,{asChild:!0,...a,focusable:!n,children:Y.jsx(jt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:ot(t.onPointerMove,uw(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ot(t.onPointerLeave,uw(y=>o.onItemLeave(y))),onFocus:ot(t.onFocus,()=>u(!0)),onBlur:ot(t.onBlur,()=>u(!1))})})})}),Hge="MenuCheckboxItem",FG=D.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx(VG,{scope:t.__scopeMenu,checked:r,children:Y.jsx(o8,{role:"menuitemcheckbox","aria-checked":E5(r)?"mixed":r,...i,ref:e,"data-state":IP(r),onSelect:ot(i.onSelect,()=>n==null?void 0:n(E5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});FG.displayName=Hge;var jG="MenuRadioGroup",[Gge,Wge]=Hp(jG,{value:void 0,onValueChange:()=>{}}),UG=D.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Ds(n);return Y.jsx(Gge,{scope:t.__scopeMenu,value:r,onValueChange:s,children:Y.jsx(SP,{...i,ref:e})})});UG.displayName=jG;var $G="MenuRadioItem",qG=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=Wge($G,t.__scopeMenu),s=r===i.value;return Y.jsx(VG,{scope:t.__scopeMenu,checked:s,children:Y.jsx(o8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":IP(s),onSelect:ot(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});qG.displayName=$G;var _P="MenuItemIndicator",[VG,Kge]=Hp(_P,{checked:!1}),zG=D.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Kge(_P,r);return Y.jsx(no,{present:n||E5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":IP(s.checked)})})});zG.displayName=_P;var Yge="MenuSeparator",HG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});HG.displayName=Yge;var Qge="MenuArrow",GG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=s8(r);return Y.jsx(yP,{...i,...n,ref:e})});GG.displayName=Qge;var Jge="MenuSub",[dUe,WG]=Hp(Jge),Wm="MenuSubTrigger",KG=D.forwardRef((t,e)=>{const r=Gp(Wm,t.__scopeMenu),n=fx(Wm,t.__scopeMenu),i=WG(Wm,t.__scopeMenu),s=CP(Wm,t.__scopeMenu),o=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},f=D.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return D.useEffect(()=>f,[f]),D.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),Y.jsx(xP,{asChild:!0,...l,children:Y.jsx(LG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":JG(r.open),...t,ref:K4(e,i.onTriggerChange),onClick:u=>{var p;(p=t.onClick)==null||p.call(t,u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ot(t.onPointerMove,uw(u=>{s.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:ot(t.onPointerLeave,uw(u=>{var p,g;f();const y=(p=r.content)==null?void 0:p.getBoundingClientRect();if(y){const b=(g=r.content)==null?void 0:g.dataset.side,I=b==="right",C=I?-5:5,S=y[I?"left":"right"],O=y[I?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+C,y:u.clientY},{x:S,y:y.top},{x:O,y:y.top},{x:O,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ot(t.onKeyDown,u=>{var p;const g=s.searchRef.current!=="";t.disabled||g&&u.key===" "||Rge[n.dir].includes(u.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),u.preventDefault())})})})});KG.displayName=Wm;var YG="MenuSubContent",QG=D.forwardRef((t,e)=>{const r=OG(ec,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(ec,t.__scopeMenu),o=fx(ec,t.__scopeMenu),a=WG(YG,t.__scopeMenu),c=D.useRef(null),l=Tr(e,c);return Y.jsx(fw.Provider,{scope:t.__scopeMenu,children:Y.jsx(no,{present:n||s.open,children:Y.jsx(fw.Slot,{scope:t.__scopeMenu,children:Y.jsx(AP,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ot(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ot(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:ot(t.onKeyDown,f=>{var u;const p=f.currentTarget.contains(f.target),g=Oge[o.dir].includes(f.key);p&&g&&(s.onOpenChange(!1),(u=a.trigger)==null||u.focus(),f.preventDefault())})})})})})});QG.displayName=YG;function JG(t){return t?"open":"closed"}function E5(t){return t==="indeterminate"}function IP(t){return E5(t)?"indeterminate":t?"checked":"unchecked"}function Zge(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Xge(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function eye(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Xge(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function tye(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function rye(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return tye(r,e)}function uw(t){return e=>e.pointerType==="mouse"?t(e):void 0}var nye=RG,iye=xP,sye=DG,oye=NG,aye=SP,cye=BG,lye=o8,fye=FG,uye=UG,dye=qG,hye=zG,pye=HG,vye=GG,gye=KG,yye=QG,TP="DropdownMenu",[mye,hUe]=Bs(TP,[kG]),io=kG(),[bye,ZG]=mye(TP),XG=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=io(e),l=D.useRef(null),[f=!1,u]=ic({prop:i,defaultProp:s,onChange:o});return Y.jsx(bye,{scope:e,triggerId:Xa(),triggerRef:l,contentId:Xa(),open:f,onOpenChange:u,onOpenToggle:D.useCallback(()=>u(p=>!p),[u]),modal:a,children:Y.jsx(nye,{...c,open:f,onOpenChange:u,dir:n,modal:a,children:r})})};XG.displayName=TP;var eW="DropdownMenuTrigger",tW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=ZG(eW,r),o=io(r);return Y.jsx(iye,{asChild:!0,...o,children:Y.jsx(jt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:K4(e,s.triggerRef),onPointerDown:ot(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ot(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});tW.displayName=eW;var wye="DropdownMenuPortal",xye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=io(e);return Y.jsx(sye,{...n,...r})};xye.displayName=wye;var rW="DropdownMenuContent",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ZG(rW,r),s=io(r),o=D.useRef(!1);return Y.jsx(oye,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:ot(t.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ot(t.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nW.displayName=rW;var Eye="DropdownMenuGroup",Cye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(aye,{...i,...n,ref:e})});Cye.displayName=Eye;var Aye="DropdownMenuLabel",Sye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(cye,{...i,...n,ref:e})});Sye.displayName=Aye;var _ye="DropdownMenuItem",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(lye,{...i,...n,ref:e})});iW.displayName=_ye;var Iye="DropdownMenuCheckboxItem",sW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(fye,{...i,...n,ref:e})});sW.displayName=Iye;var Tye="DropdownMenuRadioGroup",Pye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(uye,{...i,...n,ref:e})});Pye.displayName=Tye;var kye="DropdownMenuRadioItem",oW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(dye,{...i,...n,ref:e})});oW.displayName=kye;var Mye="DropdownMenuItemIndicator",aW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(hye,{...i,...n,ref:e})});aW.displayName=Mye;var Rye="DropdownMenuSeparator",Oye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(pye,{...i,...n,ref:e})});Oye.displayName=Rye;var Dye="DropdownMenuArrow",cW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(vye,{...i,...n,ref:e})});cW.displayName=Dye;var Nye="DropdownMenuSubTrigger",Bye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(gye,{...i,...n,ref:e})});Bye.displayName=Nye;var Lye="DropdownMenuSubContent",Fye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=io(r);return Y.jsx(yye,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Fye.displayName=Lye;var jye=XG,Uye=tW,$ye=nW,qye=iW,Vye=sW,zye=oW,lW=aW,Hye=cW,Gye="_1k2mbvi1 _1k2mbvi0 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr1v4 fyvr1x8 fyvr1zc fyvr111g fyvr11r0 fyvr11xx",Wye="_1k2mbvi2",PP="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",fW="_1k2mbvi5";const Kye=jye,Yye=Uye,Qye=({className:t,children:e,...r})=>Y.jsxs($ye,{className:mi(Gye,t),side:"bottom",sideOffset:4,align:"center",...r,children:[e,Y.jsx(Jye,{})]}),Jye=()=>Y.jsx(Hye,{className:Wye}),HA=({className:t,children:e,...r})=>Y.jsx(qye,{className:mi(PP,t),asChild:!0,...r,children:Y.jsx(xe,{children:Y.jsx(Ge,{variant:"small",children:e})})}),Zye=({children:t})=>Y.jsx(lW,{className:fW,children:t});D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Vye,{className:mi(PP,t),...r,ref:n,children:[Y.jsx(Zye,{children:Y.jsx(XT,{size:"xs"})}),Y.jsx(Ge,{variant:"small",children:e})]}));D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(zye,{className:mi(PP,t),...r,ref:n,children:[Y.jsx(lW,{className:fW,children:Y.jsx(Ge,{children:"•"})}),Y.jsx(Ge,{variant:"small",children:e})]}));const yu=D.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return Y.jsx(Zt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Xye=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var eme="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _1hq71vk0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rx fyvr12kl fyvr125x fyvr12d9 fyvr11ow fyvr11lk fyvr11mk fyvr11nk fyvr1h4 fyvr11m4",tme=Fn({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1hq71vk7 _1hq71vk3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1hq71vk8 _1hq71vk4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),rme="_1hq71vka _1hq71vk9 fyvr130x fyvr130r fyvr11lw fyvr12zr fyvr1m0 fyvr1qg fyvr1o8 fyvr1so";const nme={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4",csv:".csv,text/csv",json:".json,application/json"};D.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:f="Upload a file",validExtensions:u,...p}=t,g=D.useRef(null),y=Xye(g,e),[b,I]=D.useState(null),C=O=>{const L=O.currentTarget.files;if(!L||!L[0])return;const F=L[0],z=F.name,_=F.size/1e3;I({name:z,size:_,extension:z.split(".").pop()??""}),l==null||l(F)},S=u.map(O=>nme[O]).join(",");return Y.jsx(Vp,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:Y.jsxs(xe,{width:"full",minWidth:"0",justifyContent:b?"space-between":"flex-start",gap:"2",color:b?"text100":"text50",className:mi(eme,tme({borderRadius:r})),children:[b?Y.jsxs(xe,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(Ge,{ellipsis:!0,children:b.name}),Y.jsxs(Ge,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(Ge,{ellipsis:!0,children:f}),Y.jsx(xe,{accept:S,as:"input",className:rme,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:C,ref:y,type:"file",...p}),b&&Y.jsx(yu,{cursor:"pointer",icon:Vg,size:"xs",onClick:O=>{var L;O.preventDefault(),O.stopPropagation(),(L=g.current)!=null&&L.value&&(g.current.value=""),l==null||l(null),I(null)},zIndex:"10"})]})})});var ime=Fn({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const S7=1e3,Tv=64,GA=Tv/2,WA=(t,e=S7)=>t%e/(S7/Tv),M1=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},sme=(t,e,r)=>{const n=t%360,i=(t+120)%360,s=r%360;return{a:`hsl(${n}deg 100% 40%)`,b:`hsl(${i}deg 100% 50%)`,c:`hsl(${s}deg 100% 50%)`}},ome=(t,e)=>{const r=[];for(let n=0;n{const s=Tv/10+WA(n.r,S7*1.5/(i+1));return{...sme(n.a,n.b,n.c),x:WA(n.x),y:WA(n.y),r:s}})};D.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=ome(r,i);return Y.jsxs(xe,{as:"svg",className:mi(e,ime({size:n})),viewBox:`0 0 ${Tv} ${Tv}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[Y.jsxs("defs",{children:[Y.jsx("clipPath",{id:"circle-clip",children:Y.jsx("circle",{cx:GA,cy:GA,r:GA})}),Y.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Y.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Y.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),Y.jsx("feGaussianBlur",{stdDeviation:Tv/10,result:"effect1_foregroundBlur"})]}),Y.jsxs("linearGradient",{id:`gradient-background-${r}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[Y.jsx("stop",{offset:"0",stopColor:o[0].c}),Y.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map((a,c)=>Y.jsxs(D.Fragment,{children:[Y.jsxs("radialGradient",{id:`gradient-primary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.a}),Y.jsx("stop",{offset:"1",stopColor:a.b})]}),Y.jsxs("radialGradient",{id:`gradient-secondary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.c}),Y.jsx("stop",{offset:"1",stopColor:a.b})]})]},c))]}),Y.jsxs("g",{clipPath:"url(#circle-clip)",children:[Y.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${r})`}),Y.jsx("g",{filter:"url(#blur)",children:o.map((a,c)=>Y.jsxs(D.Fragment,{children:[Y.jsx("circle",{fill:`url(#gradient-primary-${r}-${c})`,cx:a.x,cy:a.y,r:a.r}),Y.jsx("circle",{fill:`url(#gradient-secondary-${r}-${c})`,cx:a.y,cy:a.x,r:a.r/2})]},c))})]})]})});const a8=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=D.useState(!1),o=a=>{s(!0),r==null||r(a)};return Y.jsx(xe,{as:cp.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})};var kP="Dialog",[uW,pUe]=Bs(kP),[ame,el]=uW(kP),dW=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=D.useRef(null),c=D.useRef(null),[l=!1,f]=ic({prop:n,defaultProp:i,onChange:s});return Y.jsx(ame,{scope:e,triggerRef:a,contentRef:c,contentId:Xa(),titleId:Xa(),descriptionId:Xa(),open:l,onOpenChange:f,onOpenToggle:D.useCallback(()=>f(u=>!u),[f]),modal:o,children:r})};dW.displayName=kP;var hW="DialogTrigger",cme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=el(hW,r),s=Tr(e,i.triggerRef);return Y.jsx(jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":OP(i.open),...n,ref:s,onClick:ot(t.onClick,i.onOpenToggle)})});cme.displayName=hW;var MP="DialogPortal",[lme,pW]=uW(MP,{forceMount:void 0}),vW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=el(MP,e);return Y.jsx(lme,{scope:e,forceMount:r,children:D.Children.map(n,o=>Y.jsx(no,{present:r||s.open,children:Y.jsx(cx,{asChild:!0,container:i,children:o})}))})};vW.displayName=MP;var C5="DialogOverlay",gW=D.forwardRef((t,e)=>{const r=pW(C5,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=el(C5,t.__scopeDialog);return s.modal?Y.jsx(no,{present:n||s.open,children:Y.jsx(fme,{...i,ref:e})}):null});gW.displayName=C5;var fme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=el(C5,r);return Y.jsx(i8,{as:Cp,allowPinchZoom:!0,shards:[i.contentRef],children:Y.jsx(jt.div,{"data-state":OP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Sp="DialogContent",yW=D.forwardRef((t,e)=>{const r=pW(Sp,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=el(Sp,t.__scopeDialog);return Y.jsx(no,{present:n||s.open,children:s.modal?Y.jsx(ume,{...i,ref:e}):Y.jsx(dme,{...i,ref:e})})});yW.displayName=Sp;var ume=D.forwardRef((t,e)=>{const r=el(Sp,t.__scopeDialog),n=D.useRef(null),i=Tr(e,r.contentRef,n);return D.useEffect(()=>{const s=n.current;if(s)return wP(s)},[]),Y.jsx(mW,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ot(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ot(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault())})}),dme=D.forwardRef((t,e)=>{const r=el(Sp,t.__scopeDialog),n=D.useRef(!1),i=D.useRef(!1);return Y.jsx(mW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)==null||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)==null?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),mW=D.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=el(Sp,r),c=D.useRef(null),l=Tr(e,c);return sP(),Y.jsxs(Y.Fragment,{children:[Y.jsx(X4,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Y.jsx(py,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":OP(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),Y.jsxs(Y.Fragment,{children:[Y.jsx(vme,{titleId:a.titleId}),Y.jsx(yme,{contentRef:c,descriptionId:a.descriptionId})]})]})}),RP="DialogTitle",hme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=el(RP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});hme.displayName=RP;var bW="DialogDescription",pme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=el(bW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});pme.displayName=bW;var wW="DialogClose",xW=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=el(wW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,()=>i.onOpenChange(!1))})});xW.displayName=wW;function OP(t){return t?"open":"closed"}var EW="DialogTitleWarning",[vUe,CW]=Spe(EW,{contentName:Sp,titleName:RP,docsSlug:"dialog"}),vme=({titleId:t})=>{const e=CW(EW),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},_ge=0,M1=[];function Ige(t){var e=D.useRef([]),r=D.useRef([0,0]),n=D.useRef(),i=D.useState(_ge++)[0],s=D.useState(EG)[0],o=D.useRef(t);D.useEffect(function(){o.current=t},[t]),D.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=Kve([t.lockRef.current],(t.shards||[]).map(DB)).filter(Boolean);return b.forEach(function(I){return I.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=D.useCallback(function(b,I){if("touches"in b&&b.touches.length===2)return!o.current.allowPinchZoom;var C=r6(b),S=r.current,O="deltaX"in b?b.deltaX:S[0]-C[0],L="deltaY"in b?b.deltaY:S[1]-C[1],F,z=b.target,_=Math.abs(O)>Math.abs(L)?"h":"v";if("touches"in b&&_==="h"&&z.type==="range")return!1;var $=RB(_,z);if(!$)return!0;if($?F=_:(F=_==="v"?"h":"v",$=RB(_,z)),!$)return!1;if(!n.current&&"changedTouches"in b&&(O||L)&&(n.current=F),!F)return!0;var ie=n.current||F;return Cge(ie,I,b,ie==="h"?O:L,!0)},[]),c=D.useCallback(function(b){var I=b;if(!(!M1.length||M1[M1.length-1]!==s)){var C="deltaY"in I?OB(I):r6(I),S=e.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&Age(F.delta,C)})[0];if(S&&S.should){I.cancelable&&I.preventDefault();return}if(!S){var O=(o.current.shards||[]).map(DB).filter(Boolean).filter(function(F){return F.contains(I.target)}),L=O.length>0?a(I,O[0]):!o.current.noIsolation;L&&I.cancelable&&I.preventDefault()}}},[]),l=D.useCallback(function(b,I,C,S){var O={name:b,delta:I,target:C,should:S,shadowParent:Tge(C)};e.current.push(O),setTimeout(function(){e.current=e.current.filter(function(L){return L!==O})},1)},[]),f=D.useCallback(function(b){r.current=r6(b),n.current=void 0},[]),u=D.useCallback(function(b){l(b.type,OB(b),b.target,a(b,t.lockRef.current))},[]),p=D.useCallback(function(b){l(b.type,r6(b),b.target,a(b,t.lockRef.current))},[]);D.useEffect(function(){return M1.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",c,k1),document.addEventListener("touchmove",c,k1),document.addEventListener("touchstart",f,k1),function(){M1=M1.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,k1),document.removeEventListener("touchmove",c,k1),document.removeEventListener("touchstart",f,k1)}},[]);var g=t.removeScrollBar,y=t.inert;return D.createElement(D.Fragment,null,y?D.createElement(s,{styles:Sge(i)}):null,g?D.createElement(gge,{gapMode:t.gapMode}):null)}function Tge(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Pge=nge(xG,Ige);var X4=D.forwardRef(function(t,e){return D.createElement(Z4,Tl({},t,{ref:e,sideCar:Pge}))});X4.classNames=Z4.classNames;var x7=["Enter"," "],kge=["ArrowDown","PageUp","Home"],_G=["ArrowUp","PageDown","End"],Mge=[...kge,..._G],Rge={ltr:[...x7,"ArrowRight"],rtl:[...x7,"ArrowLeft"]},Oge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cx="Menu",[lw,Dge,Nge]=W4(cx),[Hp,IG]=Fs(cx,[Nge,my,by]),e8=my(),TG=by(),[Bge,Gp]=Hp(cx),[Lge,lx]=Hp(cx),PG=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=t,a=e8(e),[c,l]=D.useState(null),f=D.useRef(!1),u=Bs(s),p=sx(i);return D.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),Y.jsx(uP,{...a,children:Y.jsx(Bge,{scope:e,open:r,onOpenChange:u,content:c,onContentChange:l,children:Y.jsx(Lge,{scope:e,onClose:D.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:p,modal:o,children:n})})})};PG.displayName=cx;var Fge="MenuAnchor",mP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(dP,{...i,...n,ref:e})});mP.displayName=Fge;var bP="MenuPortal",[jge,kG]=Hp(bP,{forceMount:void 0}),MG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Gp(bP,e);return Y.jsx(jge,{scope:e,forceMount:r,children:Y.jsx(oo,{present:r||s.open,children:Y.jsx(ax,{asChild:!0,container:i,children:n})})})};MG.displayName=bP;var Ka="MenuContent",[Uge,wP]=Hp(Ka),RG=D.forwardRef((t,e)=>{const r=kG(Ka,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(Ka,t.__scopeMenu),o=lx(Ka,t.__scopeMenu);return Y.jsx(lw.Provider,{scope:t.__scopeMenu,children:Y.jsx(oo,{present:n||s.open,children:Y.jsx(lw.Slot,{scope:t.__scopeMenu,children:o.modal?Y.jsx($ge,{...i,ref:e}):Y.jsx(qge,{...i,ref:e})})})})}),$ge=D.forwardRef((t,e)=>{const r=Gp(Ka,t.__scopeMenu),n=D.useRef(null),i=kr(e,n);return D.useEffect(()=>{const s=n.current;if(s)return yP(s)},[]),Y.jsx(xP,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),qge=D.forwardRef((t,e)=>{const r=Gp(Ka,t.__scopeMenu);return Y.jsx(xP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),xP=D.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,...b}=t,I=Gp(Ka,r),C=lx(Ka,r),S=e8(r),O=TG(r),L=Dge(r),[F,z]=D.useState(null),_=D.useRef(null),$=kr(e,_,I.onContentChange),ie=D.useRef(0),ce=D.useRef(""),K=D.useRef(0),P=D.useRef(null),M=D.useRef("right"),v=D.useRef(0),m=y?X4:D.Fragment,R=y?{as:Cp,allowPinchZoom:!0}:void 0,B=x=>{var w,T;const k=ce.current+x,H=L().filter(ee=>!ee.disabled),oe=document.activeElement,j=(w=H.find(ee=>ee.ref.current===oe))==null?void 0:w.textValue,X=H.map(ee=>ee.textValue),G=eye(X,k,j),Z=(T=H.find(ee=>ee.textValue===G))==null?void 0:T.ref.current;(function ee(N){ce.current=N,window.clearTimeout(ie.current),N!==""&&(ie.current=window.setTimeout(()=>ee(""),1e3))})(k),Z&&setTimeout(()=>Z.focus())};D.useEffect(()=>()=>window.clearTimeout(ie.current),[]),rP();const E=D.useCallback(x=>{var w,T;return M.current===((w=P.current)==null?void 0:w.side)&&rye(x,(T=P.current)==null?void 0:T.area)},[]);return Y.jsx(Uge,{scope:r,searchRef:ce,onItemEnter:D.useCallback(x=>{E(x)&&x.preventDefault()},[E]),onItemLeave:D.useCallback(x=>{var w;E(x)||((w=_.current)==null||w.focus(),z(null))},[E]),onTriggerLeave:D.useCallback(x=>{E(x)&&x.preventDefault()},[E]),pointerGraceTimerRef:K,onPointerGraceIntentChange:D.useCallback(x=>{P.current=x},[]),children:Y.jsx(m,{...R,children:Y.jsx(K4,{asChild:!0,trapped:i,onMountAutoFocus:ot(s,x=>{var w;x.preventDefault(),(w=_.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:Y.jsx(vy,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,children:Y.jsx(vP,{asChild:!0,...O,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:z,onEntryFocus:ot(c,x=>{C.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(hP,{role:"menu","aria-orientation":"vertical","data-state":KG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:$,style:{outline:"none",...b.style},onKeyDown:ot(b.onKeyDown,x=>{const T=x.target.closest("[data-radix-menu-content]")===x.currentTarget,k=x.ctrlKey||x.altKey||x.metaKey,H=x.key.length===1;T&&(x.key==="Tab"&&x.preventDefault(),!k&&H&&B(x.key));const oe=_.current;if(x.target!==oe||!Mge.includes(x.key))return;x.preventDefault();const X=L().filter(G=>!G.disabled).map(G=>G.ref.current);_G.includes(x.key)&&X.reverse(),Zge(X)}),onBlur:ot(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(ie.current),ce.current="")}),onPointerMove:ot(t.onPointerMove,fw(x=>{const w=x.target,T=v.current!==x.clientX;if(x.currentTarget.contains(w)&&T){const k=x.clientX>v.current?"right":"left";M.current=k,v.current=x.clientX}}))})})})})})})});RG.displayName=Ka;var Vge="MenuGroup",EP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});EP.displayName=Vge;var zge="MenuLabel",OG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});OG.displayName=zge;var g5="MenuItem",NB="menu.itemSelect",t8=D.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=D.useRef(null),o=lx(g5,t.__scopeMenu),a=wP(g5,t.__scopeMenu),c=kr(e,s),l=D.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent(NB,{bubbles:!0,cancelable:!0});u.addEventListener(NB,g=>n==null?void 0:n(g),{once:!0}),KT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(DG,{...i,ref:c,disabled:r,onClick:ot(t.onClick,f),onPointerDown:u=>{var p;(p=t.onPointerDown)==null||p.call(t,u),l.current=!0},onPointerUp:ot(t.onPointerUp,u=>{var p;l.current||(p=u.currentTarget)==null||p.click()}),onKeyDown:ot(t.onKeyDown,u=>{const p=a.searchRef.current!=="";r||p&&u.key===" "||x7.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});t8.displayName=g5;var DG=D.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=wP(g5,r),a=TG(r),c=D.useRef(null),l=kr(e,c),[f,u]=D.useState(!1),[p,g]=D.useState("");return D.useEffect(()=>{const y=c.current;y&&g((y.textContent??"").trim())},[s.children]),Y.jsx(lw.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:Y.jsx(gP,{asChild:!0,...a,focusable:!n,children:Y.jsx(jt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:ot(t.onPointerMove,fw(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ot(t.onPointerLeave,fw(y=>o.onItemLeave(y))),onFocus:ot(t.onFocus,()=>u(!0)),onBlur:ot(t.onBlur,()=>u(!1))})})})}),Hge="MenuCheckboxItem",NG=D.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx(UG,{scope:t.__scopeMenu,checked:r,children:Y.jsx(t8,{role:"menuitemcheckbox","aria-checked":y5(r)?"mixed":r,...i,ref:e,"data-state":AP(r),onSelect:ot(i.onSelect,()=>n==null?void 0:n(y5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});NG.displayName=Hge;var BG="MenuRadioGroup",[Gge,Wge]=Hp(BG,{value:void 0,onValueChange:()=>{}}),LG=D.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Bs(n);return Y.jsx(Gge,{scope:t.__scopeMenu,value:r,onValueChange:s,children:Y.jsx(EP,{...i,ref:e})})});LG.displayName=BG;var FG="MenuRadioItem",jG=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=Wge(FG,t.__scopeMenu),s=r===i.value;return Y.jsx(UG,{scope:t.__scopeMenu,checked:s,children:Y.jsx(t8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":AP(s),onSelect:ot(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});jG.displayName=FG;var CP="MenuItemIndicator",[UG,Kge]=Hp(CP,{checked:!1}),$G=D.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Kge(CP,r);return Y.jsx(oo,{present:n||y5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":AP(s.checked)})})});$G.displayName=CP;var Yge="MenuSeparator",qG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});qG.displayName=Yge;var Qge="MenuArrow",VG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(pP,{...i,...n,ref:e})});VG.displayName=Qge;var Jge="MenuSub",[dUe,zG]=Hp(Jge),Gm="MenuSubTrigger",HG=D.forwardRef((t,e)=>{const r=Gp(Gm,t.__scopeMenu),n=lx(Gm,t.__scopeMenu),i=zG(Gm,t.__scopeMenu),s=wP(Gm,t.__scopeMenu),o=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},f=D.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return D.useEffect(()=>f,[f]),D.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),Y.jsx(mP,{asChild:!0,...l,children:Y.jsx(DG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":KG(r.open),...t,ref:V4(e,i.onTriggerChange),onClick:u=>{var p;(p=t.onClick)==null||p.call(t,u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ot(t.onPointerMove,fw(u=>{s.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:ot(t.onPointerLeave,fw(u=>{var p,g;f();const y=(p=r.content)==null?void 0:p.getBoundingClientRect();if(y){const b=(g=r.content)==null?void 0:g.dataset.side,I=b==="right",C=I?-5:5,S=y[I?"left":"right"],O=y[I?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+C,y:u.clientY},{x:S,y:y.top},{x:O,y:y.top},{x:O,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ot(t.onKeyDown,u=>{var p;const g=s.searchRef.current!=="";t.disabled||g&&u.key===" "||Rge[n.dir].includes(u.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),u.preventDefault())})})})});HG.displayName=Gm;var GG="MenuSubContent",WG=D.forwardRef((t,e)=>{const r=kG(Ka,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(Ka,t.__scopeMenu),o=lx(Ka,t.__scopeMenu),a=zG(GG,t.__scopeMenu),c=D.useRef(null),l=kr(e,c);return Y.jsx(lw.Provider,{scope:t.__scopeMenu,children:Y.jsx(oo,{present:n||s.open,children:Y.jsx(lw.Slot,{scope:t.__scopeMenu,children:Y.jsx(xP,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ot(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ot(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:ot(t.onKeyDown,f=>{var u;const p=f.currentTarget.contains(f.target),g=Oge[o.dir].includes(f.key);p&&g&&(s.onOpenChange(!1),(u=a.trigger)==null||u.focus(),f.preventDefault())})})})})})});WG.displayName=GG;function KG(t){return t?"open":"closed"}function y5(t){return t==="indeterminate"}function AP(t){return y5(t)?"indeterminate":t?"checked":"unchecked"}function Zge(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Xge(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function eye(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Xge(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function tye(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function rye(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return tye(r,e)}function fw(t){return e=>e.pointerType==="mouse"?t(e):void 0}var nye=PG,iye=mP,sye=MG,oye=RG,aye=EP,cye=OG,lye=t8,fye=NG,uye=LG,dye=jG,hye=$G,pye=qG,vye=VG,gye=HG,yye=WG,SP="DropdownMenu",[mye,hUe]=Fs(SP,[IG]),ao=IG(),[bye,YG]=mye(SP),QG=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=ao(e),l=D.useRef(null),[f=!1,u]=Za({prop:i,defaultProp:s,onChange:o});return Y.jsx(bye,{scope:e,triggerId:Wa(),triggerRef:l,contentId:Wa(),open:f,onOpenChange:u,onOpenToggle:D.useCallback(()=>u(p=>!p),[u]),modal:a,children:Y.jsx(nye,{...c,open:f,onOpenChange:u,dir:n,modal:a,children:r})})};QG.displayName=SP;var JG="DropdownMenuTrigger",ZG=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=YG(JG,r),o=ao(r);return Y.jsx(iye,{asChild:!0,...o,children:Y.jsx(jt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:V4(e,s.triggerRef),onPointerDown:ot(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ot(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});ZG.displayName=JG;var wye="DropdownMenuPortal",xye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=ao(e);return Y.jsx(sye,{...n,...r})};xye.displayName=wye;var XG="DropdownMenuContent",eW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=YG(XG,r),s=ao(r),o=D.useRef(!1);return Y.jsx(oye,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:ot(t.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ot(t.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eW.displayName=XG;var Eye="DropdownMenuGroup",Cye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(aye,{...i,...n,ref:e})});Cye.displayName=Eye;var Aye="DropdownMenuLabel",Sye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(cye,{...i,...n,ref:e})});Sye.displayName=Aye;var _ye="DropdownMenuItem",tW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(lye,{...i,...n,ref:e})});tW.displayName=_ye;var Iye="DropdownMenuCheckboxItem",rW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(fye,{...i,...n,ref:e})});rW.displayName=Iye;var Tye="DropdownMenuRadioGroup",Pye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(uye,{...i,...n,ref:e})});Pye.displayName=Tye;var kye="DropdownMenuRadioItem",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(dye,{...i,...n,ref:e})});nW.displayName=kye;var Mye="DropdownMenuItemIndicator",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(hye,{...i,...n,ref:e})});iW.displayName=Mye;var Rye="DropdownMenuSeparator",Oye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(pye,{...i,...n,ref:e})});Oye.displayName=Rye;var Dye="DropdownMenuArrow",sW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(vye,{...i,...n,ref:e})});sW.displayName=Dye;var Nye="DropdownMenuSubTrigger",Bye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(gye,{...i,...n,ref:e})});Bye.displayName=Nye;var Lye="DropdownMenuSubContent",Fye=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(yye,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Fye.displayName=Lye;var jye=QG,Uye=ZG,$ye=eW,qye=tW,Vye=rW,zye=nW,oW=iW,Hye=sW,Gye="_1k2mbvi1 _1k2mbvi0 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr1v4 fyvr1x8 fyvr1zc fyvr111g fyvr11r0 fyvr11xx",Wye="_1k2mbvi2",_P="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",aW="_1k2mbvi5";const Kye=jye,Yye=Uye,Qye=({className:t,children:e,...r})=>Y.jsxs($ye,{className:pi(Gye,t),side:"bottom",sideOffset:4,align:"center",...r,children:[e,Y.jsx(Jye,{})]}),Jye=()=>Y.jsx(Hye,{className:Wye}),qA=({className:t,children:e,...r})=>Y.jsx(qye,{className:pi(_P,t),asChild:!0,...r,children:Y.jsx(xe,{children:Y.jsx(Ge,{variant:"small",children:e})})}),Zye=({children:t})=>Y.jsx(oW,{className:aW,children:t});D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Vye,{className:pi(_P,t),...r,ref:n,children:[Y.jsx(Zye,{children:Y.jsx(QT,{size:"xs"})}),Y.jsx(Ge,{variant:"small",children:e})]}));D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(zye,{className:pi(_P,t),...r,ref:n,children:[Y.jsx(oW,{className:aW,children:Y.jsx(Ge,{children:"•"})}),Y.jsx(Ge,{variant:"small",children:e})]}));const gu=D.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return Y.jsx(Xt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Xye=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var eme="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _1hq71vk0 fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr12rf fyvr12k3 fyvr125f fyvr12cr fyvr12rx fyvr12kl fyvr125x fyvr12d9 fyvr11ow fyvr11lk fyvr11mk fyvr11nk fyvr1h4 fyvr11m4",tme=jn({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1hq71vk7 _1hq71vk3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1hq71vk8 _1hq71vk4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),rme="_1hq71vka _1hq71vk9 fyvr130x fyvr130r fyvr11lw fyvr12zr fyvr1m0 fyvr1qg fyvr1o8 fyvr1so";const nme={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*, video/*",pdf:".pdf,application/pdf",mp4:".mp4,video/mp4",csv:".csv,text/csv",json:".json,application/json"};D.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:f="Upload a file",validExtensions:u,...p}=t,g=D.useRef(null),y=Xye(g,e),[b,I]=D.useState(null),C=O=>{const L=O.currentTarget.files;if(!L||!L[0])return;const F=L[0],z=F.name,_=F.size/1e3;I({name:z,size:_,extension:z.split(".").pop()??""}),l==null||l(F)},S=u.map(O=>nme[O]).join(",");return Y.jsx(Vp,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:Y.jsxs(xe,{width:"full",minWidth:"0",justifyContent:b?"space-between":"flex-start",gap:"2",color:b?"text100":"text50",className:pi(eme,tme({borderRadius:r})),children:[b?Y.jsxs(xe,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(Ge,{ellipsis:!0,children:b.name}),Y.jsxs(Ge,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(Ge,{ellipsis:!0,children:f}),Y.jsx(xe,{accept:S,as:"input",className:rme,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:C,ref:y,type:"file",...p}),b&&Y.jsx(gu,{cursor:"pointer",icon:zg,size:"xs",onClick:O=>{var L;O.preventDefault(),O.stopPropagation(),(L=g.current)!=null&&L.value&&(g.current.value=""),l==null||l(null),I(null)},zIndex:"10"})]})})});var ime=jn({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const E7=1e3,Pv=64,VA=Pv/2,zA=(t,e=E7)=>t%e/(E7/Pv),R1=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},sme=(t,e,r)=>{const n=t%360,i=(t+120)%360,s=r%360;return{a:`hsl(${n}deg 100% 40%)`,b:`hsl(${i}deg 100% 50%)`,c:`hsl(${s}deg 100% 50%)`}},ome=(t,e)=>{const r=[];for(let n=0;n{const s=Pv/10+zA(n.r,E7*1.5/(i+1));return{...sme(n.a,n.b,n.c),x:zA(n.x),y:zA(n.y),r:s}})};D.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=ome(r,i);return Y.jsxs(xe,{as:"svg",className:pi(e,ime({size:n})),viewBox:`0 0 ${Pv} ${Pv}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[Y.jsxs("defs",{children:[Y.jsx("clipPath",{id:"circle-clip",children:Y.jsx("circle",{cx:VA,cy:VA,r:VA})}),Y.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Y.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Y.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),Y.jsx("feGaussianBlur",{stdDeviation:Pv/10,result:"effect1_foregroundBlur"})]}),Y.jsxs("linearGradient",{id:`gradient-background-${r}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[Y.jsx("stop",{offset:"0",stopColor:o[0].c}),Y.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map((a,c)=>Y.jsxs(D.Fragment,{children:[Y.jsxs("radialGradient",{id:`gradient-primary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.a}),Y.jsx("stop",{offset:"1",stopColor:a.b})]}),Y.jsxs("radialGradient",{id:`gradient-secondary-${r}-${c}`,children:[Y.jsx("stop",{offset:"0",stopColor:a.c}),Y.jsx("stop",{offset:"1",stopColor:a.b})]})]},c))]}),Y.jsxs("g",{clipPath:"url(#circle-clip)",children:[Y.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${r})`}),Y.jsx("g",{filter:"url(#blur)",children:o.map((a,c)=>Y.jsxs(D.Fragment,{children:[Y.jsx("circle",{fill:`url(#gradient-primary-${r}-${c})`,cx:a.x,cy:a.y,r:a.r}),Y.jsx("circle",{fill:`url(#gradient-secondary-${r}-${c})`,cx:a.y,cy:a.x,r:a.r/2})]},c))})]})]})});const r8=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=D.useState(!1),o=a=>{s(!0),r==null||r(a)};return Y.jsx(xe,{as:cp.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})};var IP="Dialog",[cW,pUe]=Fs(IP),[ame,Kc]=cW(IP),lW=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=D.useRef(null),c=D.useRef(null),[l=!1,f]=Za({prop:n,defaultProp:i,onChange:s});return Y.jsx(ame,{scope:e,triggerRef:a,contentRef:c,contentId:Wa(),titleId:Wa(),descriptionId:Wa(),open:l,onOpenChange:f,onOpenToggle:D.useCallback(()=>f(u=>!u),[f]),modal:o,children:r})};lW.displayName=IP;var fW="DialogTrigger",cme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(fW,r),s=kr(e,i.triggerRef);return Y.jsx(jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":kP(i.open),...n,ref:s,onClick:ot(t.onClick,i.onOpenToggle)})});cme.displayName=fW;var TP="DialogPortal",[lme,uW]=cW(TP,{forceMount:void 0}),dW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Kc(TP,e);return Y.jsx(lme,{scope:e,forceMount:r,children:D.Children.map(n,o=>Y.jsx(oo,{present:r||s.open,children:Y.jsx(ax,{asChild:!0,container:i,children:o})}))})};dW.displayName=TP;var m5="DialogOverlay",hW=D.forwardRef((t,e)=>{const r=uW(m5,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Kc(m5,t.__scopeDialog);return s.modal?Y.jsx(oo,{present:n||s.open,children:Y.jsx(fme,{...i,ref:e})}):null});hW.displayName=m5;var fme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(m5,r);return Y.jsx(X4,{as:Cp,allowPinchZoom:!0,shards:[i.contentRef],children:Y.jsx(jt.div,{"data-state":kP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Sp="DialogContent",pW=D.forwardRef((t,e)=>{const r=uW(Sp,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Kc(Sp,t.__scopeDialog);return Y.jsx(oo,{present:n||s.open,children:s.modal?Y.jsx(ume,{...i,ref:e}):Y.jsx(dme,{...i,ref:e})})});pW.displayName=Sp;var ume=D.forwardRef((t,e)=>{const r=Kc(Sp,t.__scopeDialog),n=D.useRef(null),i=kr(e,r.contentRef,n);return D.useEffect(()=>{const s=n.current;if(s)return yP(s)},[]),Y.jsx(vW,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ot(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ot(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ot(t.onFocusOutside,s=>s.preventDefault())})}),dme=D.forwardRef((t,e)=>{const r=Kc(Sp,t.__scopeDialog),n=D.useRef(!1),i=D.useRef(!1);return Y.jsx(vW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)==null||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)==null?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vW=D.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Kc(Sp,r),c=D.useRef(null),l=kr(e,c);return rP(),Y.jsxs(Y.Fragment,{children:[Y.jsx(K4,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Y.jsx(vy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":kP(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),Y.jsxs(Y.Fragment,{children:[Y.jsx(vme,{titleId:a.titleId}),Y.jsx(yme,{contentRef:c,descriptionId:a.descriptionId})]})]})}),PP="DialogTitle",hme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(PP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});hme.displayName=PP;var gW="DialogDescription",pme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(gW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});pme.displayName=gW;var yW="DialogClose",mW=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(yW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,()=>i.onOpenChange(!1))})});mW.displayName=yW;function kP(t){return t?"open":"closed"}var bW="DialogTitleWarning",[vUe,wW]=Spe(bW,{contentName:Sp,titleName:PP,docsSlug:"dialog"}),vme=({titleId:t})=>{const e=wW(bW),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return D.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},gme="DialogDescriptionWarning",yme=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${CW(gme).contentName}}.`;return D.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},mme=dW,bme=vW,wme=gW,xme=yW,Eme=xW,Cme=Fn({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr12g fyvr164",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),Ame=Fn({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const Sme=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return Y.jsx(xe,{className:Ame({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:Y.jsx(xe,{className:Cme({direction:n}),background:"backgroundPrimary",...i,children:e})})};function _me(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Ime(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function AW(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n={};for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=AW(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function jB(t,e,r){t.style.setProperty(_me(e),r)}function UB(t,e,r){if(typeof r=="object"){var n=e;AW(r,(a,c)=>{a!=null&&jB(t,Ime(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&jB(t,s,i[s])}}}const DP=["dark","light"],SW="dark",Tme="data-theme",$B="@sequence.theme",Pme=t=>DP.includes(t),kme=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),_W=t=>t?`${$B}.${t}`:$B,Mme=t=>{const e=localStorage.getItem(_W(t));return e&&DP.includes(e)?e:SW},IW=D.createContext(null),Rme=t=>{const[e,r]=D.useState(t.theme||SW);D.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),D.useEffect(()=>{t.theme||r(Mme(t.scope))},[t.theme,t.scope]),D.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),D.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(Pme(e)?(i.setAttribute(Tme,e),UB(i,fB,{colors:rpe[e]})):kme(e)&&UB(i,fB,{colors:e}),t.root&&i.classList.add("seq-root"))},[e,t.root]);const n=D.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{DP.includes(i)&&(localStorage.setItem(_W(t.scope),i),r(i))}}),[e,t.root,t.scope]);return Y.jsx(IW.Provider,{value:n,children:t.children})},Ome=()=>{const t=D.useContext(IW);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Dme="_5b32m91 _5b32m90 fyvr11no fyvr11ow fyvr11l8 fyvr11m0 fyvr11rs fyvr1m0 fyvr1qg fyvr1so fyvr1o8",Nme="_5b32m93 _5b32m92 fyvr11m0 fyvr1m0 fyvr1qg fyvr1so fyvr1o8",Bme=Fn({defaultClassName:"_5b32m95 _5b32m94 fyvr11hg fyvr11i4 fyvr11fo fyvr11g6 fyvr11gc fyvr11gu fyvr11q0 fyvr11qg fyvr1310 fyvr130u fyvr11l8 fyvr11mc fyvr11m0 fyvr11wl fyvr1o8 fyvr1qe",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),Lme="_5b32m9b _5b32m9a fyvr113s fyvr1160 fyvr1188 fyvr11ag fyvr11lw fyvr1so fyvr1m0 fyvr11rs";const Tc=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:f,rootProps:u={}}=t,{root:p}=Ome(),[g,y]=D.useState(null);return D.useEffect(()=>{y(document.querySelector(p||"body"))},[p]),g?Y.jsx(mme,{modal:!0,defaultOpen:!0,onOpenChange:o,children:Y.jsx(bme,{forceMount:!0,container:g,children:Y.jsxs(xe,{...u,className:mi("seq-root",Dme,u==null?void 0:u.className),children:[Y.jsx(xe,{as:wme,asChild:!0,background:r,className:Nme,forceMount:!0,children:Y.jsx(cp.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),Y.jsx(xme,{asChild:!0,className:Bme({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:b=>{s?o==null||o():b.preventDefault()},onInteractOutside:b=>{s||b.preventDefault()},children:Y.jsxs(cp.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...f,children:[a?Y.jsx(Sme,{children:n}):n,s&&Y.jsx(Eme,{asChild:!0,children:Y.jsx(yu,{icon:Vg,backdropFilter:"blur",size:"xs",className:Lme,"aria-label":"Close"})})]},"modal-content")})]})})}):null};var Fme="_1acm19y1 _1acm19y0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1zk fyvr111o fyvr11lk fyvr11ow fyvr11sl fyvr12w9 fyvr1h4 fyvr11cg",jme=Fn({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1acm19y7 _1acm19y3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1acm19y8 _1acm19y4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Ume=Fn({defaultClassName:"_1acm19ya _1acm19y9 fyvr1z4 fyvr1118 fyvr1vc fyvr1xg fyvr130x fyvr130r fyvr11l4 fyvr11sl fyvr12w9 fyvr12s9 fyvr12g fyvr164",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg"}},defaultVariants:{},compoundVariants:[]});const Wn=D.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:f,rightIcon:u,name:p,controls:g,type:y="text",numeric:b=!1,...I}=t;return Y.jsx(Vp,{description:s,disabled:o,display:"grid",id:a??p,label:c,labelLocation:l,children:Y.jsx(xe,{width:"full",children:Y.jsxs(xe,{className:mi(Fme,jme({borderRadius:i})),children:[f&&Y.jsx(f,{size:"sm"}),Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:Ume({numeric:b}),disabled:o,id:a??p,name:p,ref:e,type:y,...I}),u&&Y.jsx(u,{size:"sm"}),g]})})})}),$me=RegExp("^\\d*(?:\\\\[.])?\\d*$");function qme(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}D.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:f}=l.target;f=f.replace(/,/g,"."),f.startsWith(".")&&(f="0"+f),f.startsWith("0")&&(f=f.replace(/^0+(?=\d)/,"")),(f===""||$me.test(qme(f)))&&(i==null||i({...l,target:{...l.target,value:f}}))},c=l=>{const{value:f}=l.target;let u=f;u.endsWith(".")&&(u=u.slice(0,-1)),u.endsWith(".0")&&(u=u.slice(0,-2)),u==="0"&&(u=""),s==null||s(l),u!==f&&(i==null||i({...l,target:{...l.target,value:u}}))};return Y.jsx(Wn,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});Fn({defaultClassName:"_1jujggt1",variantClassNames:{size:{sm:"_1jujggt2",normal:"_1jujggt3",md:"_1jujggt4",lg:"_1jujggt5",xl:"_1jujggt6"}},defaultVariants:{},compoundVariants:[]});var NP="Progress",BP=100,[Vme,gUe]=Bs(NP),[zme,Hme]=Vme(NP),Gme=D.forwardRef((t,e)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=Kme,...o}=t;(i||i===0)&&!qB(i)&&console.error(Yme(`${i}`,"Progress"));const a=qB(i)?i:BP;n!==null&&!VB(n,a)&&console.error(Qme(`${n}`,"Progress"));const c=VB(n,a)?n:null,l=A5(c)?s(c,a):void 0;return Y.jsx(zme,{scope:r,value:c,max:a,children:Y.jsx(jt.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":A5(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":PW(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});Gme.displayName=NP;var TW="ProgressIndicator",Wme=D.forwardRef((t,e)=>{const{__scopeProgress:r,...n}=t,i=Hme(TW,r);return Y.jsx(jt.div,{"data-state":PW(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:e})});Wme.displayName=TW;function Kme(t,e){return`${Math.round(t/e*100)}%`}function PW(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function A5(t){return typeof t=="number"}function qB(t){return A5(t)&&!isNaN(t)&&t>0}function VB(t,e){return A5(t)&&!isNaN(t)&&t<=e&&t>=0}function Yme(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${BP}\`.`}function Qme(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return D.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},gme="DialogDescriptionWarning",yme=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wW(gme).contentName}}.`;return D.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},mme=lW,bme=dW,wme=hW,xme=pW,Eme=mW,Cme=jn({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr12g fyvr164",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),Ame=jn({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const Sme=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return Y.jsx(xe,{className:Ame({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:Y.jsx(xe,{className:Cme({direction:n}),background:"backgroundPrimary",...i,children:e})})};function _me(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Ime(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function xW(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n={};for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=xW(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function BB(t,e,r){t.style.setProperty(_me(e),r)}function LB(t,e,r){if(typeof r=="object"){var n=e;xW(r,(a,c)=>{a!=null&&BB(t,Ime(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&BB(t,s,i[s])}}}const MP=["dark","light"],EW="dark",Tme="data-theme",FB="@sequence.theme",Pme=t=>MP.includes(t),kme=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),CW=t=>t?`${FB}.${t}`:FB,Mme=t=>{const e=localStorage.getItem(CW(t));return e&&MP.includes(e)?e:EW},AW=D.createContext(null),Rme=t=>{const[e,r]=D.useState(t.theme||EW);D.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),D.useEffect(()=>{t.theme||r(Mme(t.scope))},[t.theme,t.scope]),D.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),D.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(Pme(e)?(i.setAttribute(Tme,e),LB(i,aB,{colors:rpe[e]})):kme(e)&&LB(i,aB,{colors:e}),t.root&&i.classList.add("seq-root"))},[e,t.root]);const n=D.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{MP.includes(i)&&(localStorage.setItem(CW(t.scope),i),r(i))}}),[e,t.root,t.scope]);return Y.jsx(AW.Provider,{value:n,children:t.children})},Ome=()=>{const t=D.useContext(AW);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Dme="_5b32m91 _5b32m90 fyvr11no fyvr11ow fyvr11l8 fyvr11m0 fyvr11rs fyvr1m0 fyvr1qg fyvr1so fyvr1o8",Nme="_5b32m93 _5b32m92 fyvr11m0 fyvr1m0 fyvr1qg fyvr1so fyvr1o8",Bme=jn({defaultClassName:"_5b32m95 _5b32m94 fyvr11hg fyvr11i4 fyvr11fo fyvr11g6 fyvr11gc fyvr11gu fyvr11q0 fyvr11qg fyvr1310 fyvr130u fyvr11l8 fyvr11mc fyvr11m0 fyvr11wl fyvr1o8 fyvr1qe",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),Lme="_5b32m9b _5b32m9a fyvr113s fyvr1160 fyvr1188 fyvr11ag fyvr11lw fyvr1so fyvr1m0 fyvr11rs";const Ec=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:f,rootProps:u={}}=t,{root:p}=Ome(),[g,y]=D.useState(null);return D.useEffect(()=>{y(document.querySelector(p||"body"))},[p]),g?Y.jsx(mme,{modal:!0,defaultOpen:!0,onOpenChange:o,children:Y.jsx(bme,{forceMount:!0,container:g,children:Y.jsxs(xe,{...u,className:pi("seq-root",Dme,u==null?void 0:u.className),children:[Y.jsx(xe,{as:wme,asChild:!0,background:r,className:Nme,forceMount:!0,children:Y.jsx(cp.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),Y.jsx(xme,{asChild:!0,className:Bme({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:b=>{s?o==null||o():b.preventDefault()},onInteractOutside:b=>{s||b.preventDefault()},children:Y.jsxs(cp.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...f,children:[a?Y.jsx(Sme,{children:n}):n,s&&Y.jsx(Eme,{asChild:!0,children:Y.jsx(gu,{icon:zg,backdropFilter:"blur",size:"xs",className:Lme,"aria-label":"Close"})})]},"modal-content")})]})})}):null};var Fme="_1acm19y1 _1acm19y0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1zk fyvr111o fyvr11lk fyvr11ow fyvr11sl fyvr12w9 fyvr1h4 fyvr11cg",jme=jn({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"_1acm19y7 _1acm19y3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"_1acm19y8 _1acm19y4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Ume=jn({defaultClassName:"_1acm19ya _1acm19y9 fyvr1z4 fyvr1118 fyvr1vc fyvr1xg fyvr130x fyvr130r fyvr11l4 fyvr11sl fyvr12w9 fyvr12s9 fyvr12g fyvr164",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11r3 fyvr11iw fyvr11kg fyvr11jw fyvr11jg"}},defaultVariants:{},compoundVariants:[]});const Wn=D.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:f,rightIcon:u,name:p,controls:g,type:y="text",numeric:b=!1,...I}=t;return Y.jsx(Vp,{description:s,disabled:o,display:"grid",id:a??p,label:c,labelLocation:l,children:Y.jsx(xe,{width:"full",children:Y.jsxs(xe,{className:pi(Fme,jme({borderRadius:i})),children:[f&&Y.jsx(f,{size:"sm"}),Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:Ume({numeric:b}),disabled:o,id:a??p,name:p,ref:e,type:y,...I}),u&&Y.jsx(u,{size:"sm"}),g]})})})}),$me=RegExp("^\\d*(?:\\\\[.])?\\d*$");function qme(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}D.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:f}=l.target;f=f.replace(/,/g,"."),f.startsWith(".")&&(f="0"+f),f.startsWith("0")&&(f=f.replace(/^0+(?=\d)/,"")),(f===""||$me.test(qme(f)))&&(i==null||i({...l,target:{...l.target,value:f}}))},c=l=>{const{value:f}=l.target;let u=f;u.endsWith(".")&&(u=u.slice(0,-1)),u.endsWith(".0")&&(u=u.slice(0,-2)),u==="0"&&(u=""),s==null||s(l),u!==f&&(i==null||i({...l,target:{...l.target,value:u}}))};return Y.jsx(Wn,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});jn({defaultClassName:"_1jujggt1",variantClassNames:{size:{sm:"_1jujggt2",normal:"_1jujggt3",md:"_1jujggt4",lg:"_1jujggt5",xl:"_1jujggt6"}},defaultVariants:{},compoundVariants:[]});var RP="Progress",OP=100,[Vme,gUe]=Fs(RP),[zme,Hme]=Vme(RP),Gme=D.forwardRef((t,e)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=Kme,...o}=t;(i||i===0)&&!jB(i)&&console.error(Yme(`${i}`,"Progress"));const a=jB(i)?i:OP;n!==null&&!UB(n,a)&&console.error(Qme(`${n}`,"Progress"));const c=UB(n,a)?n:null,l=b5(c)?s(c,a):void 0;return Y.jsx(zme,{scope:r,value:c,max:a,children:Y.jsx(jt.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":b5(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":_W(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});Gme.displayName=RP;var SW="ProgressIndicator",Wme=D.forwardRef((t,e)=>{const{__scopeProgress:r,...n}=t,i=Hme(SW,r);return Y.jsx(jt.div,{"data-state":_W(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:e})});Wme.displayName=SW;function Kme(t,e){return`${Math.round(t/e*100)}%`}function _W(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function b5(t){return typeof t=="number"}function jB(t){return b5(t)&&!isNaN(t)&&t>0}function UB(t,e){return b5(t)&&!isNaN(t)&&t<=e&&t>=0}function Yme(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${OP}\`.`}function Qme(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${BP} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${OP} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var LP="Radio",[Jme,kW]=Bs(LP),[Zme,Xme]=Jme(LP),MW=D.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[f,u]=D.useState(null),p=Tr(e,b=>u(b)),g=D.useRef(!1),y=f?!!f.closest("form"):!0;return Y.jsxs(Zme,{scope:r,checked:i,disabled:o,children:[Y.jsx(jt.button,{type:"button",role:"radio","aria-checked":i,"data-state":DW(i),"data-disabled":o?"":void 0,disabled:o,value:a,...l,ref:p,onClick:ot(t.onClick,b=>{i||c==null||c(),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&Y.jsx(ebe,{control:f,bubbles:!g.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}})]})});MW.displayName=LP;var RW="RadioIndicator",OW=D.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Xme(RW,r);return Y.jsx(no,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":DW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});OW.displayName=RW;var ebe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=Y4(r),a=Q4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function DW(t){return t?"checked":"unchecked"}var tbe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],FP="RadioGroup",[rbe,yUe]=Bs(FP,[my,kW]),NW=my(),BW=kW(),[nbe,ibe]=rbe(FP),LW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...p}=t,g=NW(r),y=ox(l),[b,I]=ic({prop:s,defaultProp:i,onChange:u});return Y.jsx(nbe,{scope:r,name:n,required:o,disabled:a,value:b,onValueChange:I,children:Y.jsx(mP,{asChild:!0,...g,orientation:c,dir:y,loop:f,children:Y.jsx(jt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...p,ref:e})})})});LW.displayName=FP;var FW="RadioGroupItem",jW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=ibe(FW,r),o=s.disabled||n,a=NW(r),c=BW(r),l=D.useRef(null),f=Tr(e,l),u=s.value===i.value,p=D.useRef(!1);return D.useEffect(()=>{const g=b=>{tbe.includes(b.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",y)}},[]),Y.jsx(bP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(MW,{disabled:o,required:s.required,checked:u,...c,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:ot(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:ot(i.onFocus,()=>{var g;p.current&&((g=l.current)==null||g.click())})})})});jW.displayName=FW;var sbe="RadioGroupIndicator",UW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=BW(r);return Y.jsx(OW,{...i,...n,ref:e})});UW.displayName=sbe;var obe=LW,abe=jW,cbe=UW,lbe=Fn({defaultClassName:"io59uy3 io59uy0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1uw fyvr1x0 fyvr1z4 fyvr1118 fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11sl fyvr12zf fyvr12zb fyvr1307 fyvr12zz _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11eg fyvr11es fyvr11f4 fyvr11fg",lg:"io59uy5 io59uy2 fyvr11ek fyvr11ew fyvr11f8 fyvr11fk"}},defaultVariants:{},compoundVariants:[]}),fbe=Fn({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11l8 fyvr11ow fyvr11no fyvr11m4 fyvr12g fyvr164 fyvr12w9",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const ube=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return Y.jsx(xe,{alignItems:"center",children:Y.jsx(Vp,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:Y.jsx(abe,{className:lbe({size:n}),value:i,id:e,disabled:s,children:Y.jsx(cbe,{className:fbe({size:n})})})})})};D.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return Y.jsx(obe,{disabled:n,name:s,ref:e,...c,children:Y.jsx(xe,{flexDirection:r,gap:i,children:o.map(({label:l,value:f,disabled:u})=>Y.jsx(ube,{id:`${s}-${f}`,label:l,size:a,value:f,disabled:u},f))})})});function zB(t,[e,r]){return Math.min(r,Math.max(e,t))}var dbe="VisuallyHidden",ux=D.forwardRef((t,e)=>Y.jsx(jt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));ux.displayName=dbe;var hbe=ux,pbe=[" ","Enter","ArrowUp","ArrowDown"],vbe=[" ","Enter"],dx="Select",[c8,l8,gbe]=Z4(dx),[by,mUe]=Bs(dx,[gbe,yy]),f8=yy(),[ybe,_h]=by(dx),[mbe,bbe]=by(dx),$W=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:u,disabled:p,required:g}=t,y=f8(e),[b,I]=D.useState(null),[C,S]=D.useState(null),[O,L]=D.useState(!1),F=ox(l),[z=!1,_]=ic({prop:n,defaultProp:i,onChange:s}),[$,ie]=ic({prop:o,defaultProp:a,onChange:c}),ce=D.useRef(null),K=b?!!b.closest("form"):!0,[P,M]=D.useState(new Set),v=Array.from(P).map(m=>m.props.value).join(";");return Y.jsx(pP,{...y,children:Y.jsxs(ybe,{required:g,scope:e,trigger:b,onTriggerChange:I,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:L,contentId:Xa(),value:$,onValueChange:ie,open:z,onOpenChange:_,dir:F,triggerPointerDownPosRef:ce,disabled:p,children:[Y.jsx(c8.Provider,{scope:e,children:Y.jsx(mbe,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(m=>{M(R=>new Set(R).add(m))},[]),onNativeOptionRemove:D.useCallback(m=>{M(R=>{const B=new Set(R);return B.delete(m),B})},[]),children:r})}),K?Y.jsxs(aK,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:$,onChange:m=>ie(m.target.value),disabled:p,children:[$===void 0?Y.jsx("option",{value:""}):null,Array.from(P)]},v):null]})})};$W.displayName=dx;var qW="SelectTrigger",VW=D.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=f8(r),o=_h(qW,r),a=o.disabled||n,c=Tr(e,o.onTriggerChange),l=l8(r),[f,u,p]=cK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=lK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(vP,{asChild:!0,...s,children:Y.jsx(jt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":oK(o.value)?"":void 0,...i,ref:c,onClick:ot(i.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ot(i.onPointerDown,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ot(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(b&&y.key===" ")&&pbe.includes(y.key)&&(g(),y.preventDefault())})})})});VW.displayName=qW;var zW="SelectValue",HW=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=_h(zW,r),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,u=Tr(e,c.onValueNodeChange);return as(()=>{l(f)},[l,f]),Y.jsx(jt.span,{...a,ref:u,style:{pointerEvents:"none"},children:oK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});HW.displayName=zW;var wbe="SelectIcon",GW=D.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});GW.displayName=wbe;var _p="SelectContent",WW=D.forwardRef((t,e)=>{const r=_h(_p,t.__scopeSelect),[n,i]=D.useState();if(as(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Eh.createPortal(Y.jsx(KW,{scope:t.__scopeSelect,children:Y.jsx(c8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(YW,{...t,ref:e})});WW.displayName=_p;var kf=10,[KW,Ih]=by(_p),xbe="SelectContentImpl",YW=D.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I,...C}=t,S=_h(_p,r),[O,L]=D.useState(null),[F,z]=D.useState(null),_=Tr(e,G=>L(G)),[$,ie]=D.useState(null),[ce,K]=D.useState(null),P=l8(r),[M,v]=D.useState(!1),m=D.useRef(!1);D.useEffect(()=>{if(O)return wP(O)},[O]),sP();const R=D.useCallback(G=>{const[Z,...ee]=P().map(fe=>fe.ref.current),[N]=ee.slice(-1),te=document.activeElement;for(const fe of G)if(fe===te||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Z&&F&&(F.scrollTop=0),fe===N&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==te))return},[P,F]),B=D.useCallback(()=>R([$,O]),[R,$,O]);D.useEffect(()=>{M&&B()},[M,B]);const{onOpenChange:E,triggerPointerDownPosRef:x}=S;D.useEffect(()=>{if(O){let G={x:0,y:0};const Z=N=>{var te,fe;G={x:Math.abs(Math.round(N.pageX)-(((te=x.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(N.pageY)-(((fe=x.current)==null?void 0:fe.y)??0))}},ee=N=>{G.x<=10&&G.y<=10?N.preventDefault():O.contains(N.target)||E(!1),document.removeEventListener("pointermove",Z),x.current=null};return x.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ee,{capture:!0})}}},[O,E,x]),D.useEffect(()=>{const G=()=>E(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[E]);const[w,T]=cK(G=>{const Z=P().filter(te=>!te.disabled),ee=Z.find(te=>te.ref.current===document.activeElement),N=lK(Z,G,ee);N&&setTimeout(()=>N.ref.current.focus())}),k=D.useCallback((G,Z,ee)=>{const N=!m.current&&!ee;(S.value!==void 0&&S.value===Z||N)&&(ie(G),N&&(m.current=!0))},[S.value]),H=D.useCallback(()=>O==null?void 0:O.focus(),[O]),oe=D.useCallback((G,Z,ee)=>{const N=!m.current&&!ee;(S.value!==void 0&&S.value===Z||N)&&K(G)},[S.value]),j=n==="popper"?_7:QW,X=j===_7?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I}:{};return Y.jsx(KW,{scope:r,content:O,viewport:F,onViewportChange:z,itemRefCallback:k,selectedItem:$,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:B,selectedItemText:ce,position:n,isPositioned:M,searchRef:w,children:Y.jsx(i8,{as:Cp,allowPinchZoom:!0,children:Y.jsx(X4,{asChild:!0,trapped:S.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ot(i,G=>{var Z;(Z=S.trigger)==null||Z.focus({preventScroll:!0}),G.preventDefault()}),children:Y.jsx(py,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:Y.jsx(j,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:G=>G.preventDefault(),...C,...X,onPlaced:()=>v(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ot(C.onKeyDown,G=>{const Z=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Z&&G.key.length===1&&T(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let N=P().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(G.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const te=G.target,fe=N.indexOf(te);N=N.slice(fe+1)}setTimeout(()=>R(N)),G.preventDefault()}})})})})})})});YW.displayName=xbe;var Ebe="SelectItemAlignedPosition",QW=D.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=_h(_p,r),o=Ih(_p,r),[a,c]=D.useState(null),[l,f]=D.useState(null),u=Tr(e,_=>f(_)),p=l8(r),g=D.useRef(!1),y=D.useRef(!0),{viewport:b,selectedItem:I,selectedItemText:C,focusSelectedItem:S}=o,O=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&b&&I&&C){const _=s.trigger.getBoundingClientRect(),$=l.getBoundingClientRect(),ie=s.valueNode.getBoundingClientRect(),ce=C.getBoundingClientRect();if(s.dir!=="rtl"){const te=ce.left-$.left,fe=ie.left-te,Ee=_.left-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-kf,De=zB(fe,[kf,Te-Re]);a.style.minWidth=_e+"px",a.style.left=De+"px"}else{const te=$.right-ce.right,fe=window.innerWidth-ie.right-te,Ee=window.innerWidth-_.right-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-kf,De=zB(fe,[kf,Te-Re]);a.style.minWidth=_e+"px",a.style.right=De+"px"}const K=p(),P=window.innerHeight-kf*2,M=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),R=parseInt(v.paddingTop,10),B=parseInt(v.borderBottomWidth,10),E=parseInt(v.paddingBottom,10),x=m+R+M+E+B,w=Math.min(I.offsetHeight*5,x),T=window.getComputedStyle(b),k=parseInt(T.paddingTop,10),H=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-kf,j=P-oe,X=I.offsetHeight/2,G=I.offsetTop+X,Z=m+R+G,ee=x-Z;if(Z<=oe){const te=I===K[K.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-b.offsetTop-b.offsetHeight,Ee=Math.max(j,X+(te?H:0)+fe+B),_e=Z+Ee;a.style.height=_e+"px"}else{const te=I===K[0].ref.current;a.style.top="0px";const Ee=Math.max(oe,m+b.offsetTop+(te?k:0)+X)+ee;a.style.height=Ee+"px",b.scrollTop=Z-oe+b.offsetTop}a.style.margin=`${kf}px 0`,a.style.minHeight=w+"px",a.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,a,l,b,I,C,s.dir,n]);as(()=>O(),[O]);const[L,F]=D.useState();as(()=>{l&&F(window.getComputedStyle(l).zIndex)},[l]);const z=D.useCallback(_=>{_&&y.current===!0&&(O(),S==null||S(),y.current=!1)},[O,S]);return Y.jsx(Abe,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:Y.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:Y.jsx(jt.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});QW.displayName=Ebe;var Cbe="SelectPopperPosition",_7=D.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=kf,...s}=t,o=f8(r);return Y.jsx(gP,{...o,...s,ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_7.displayName=Cbe;var[Abe,jP]=by(_p,{}),I7="SelectViewport",JW=D.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Ih(I7,r),o=jP(I7,r),a=Tr(e,s.onViewportChange),c=D.useRef(0);return Y.jsxs(Y.Fragment,{children:[Y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),Y.jsx(c8.Slot,{scope:r,children:Y.jsx(jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"auto",...i.style},onScroll:ot(i.onScroll,l=>{const f=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&u){const g=Math.abs(c.current-f.scrollTop);if(g>0){const y=window.innerHeight-kf*2,b=parseFloat(u.style.minHeight),I=parseFloat(u.style.height),C=Math.max(b,I);if(C0?L:0,u.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});JW.displayName=I7;var ZW="SelectGroup",[Sbe,_be]=by(ZW),XW=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Xa();return Y.jsx(Sbe,{scope:r,id:i,children:Y.jsx(jt.div,{role:"group","aria-labelledby":i,...n,ref:e})})});XW.displayName=ZW;var eK="SelectLabel",Ibe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=_be(eK,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});Ibe.displayName=eK;var S5="SelectItem",[Tbe,tK]=by(S5),rK=D.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=_h(S5,r),c=Ih(S5,r),l=a.value===n,[f,u]=D.useState(s??""),[p,g]=D.useState(!1),y=Tr(e,C=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,C,n,i)}),b=Xa(),I=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Y.jsx(Tbe,{scope:r,value:n,disabled:i,textId:b,isSelected:l,onItemTextChange:D.useCallback(C=>{u(S=>S||((C==null?void 0:C.textContent)??"").trim())},[]),children:Y.jsx(c8.ItemSlot,{scope:r,value:n,disabled:i,textValue:f,children:Y.jsx(jt.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:ot(o.onFocus,()=>g(!0)),onBlur:ot(o.onBlur,()=>g(!1)),onPointerUp:ot(o.onPointerUp,I),onPointerMove:ot(o.onPointerMove,C=>{var S;i?(S=c.onItemLeave)==null||S.call(c):C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ot(o.onPointerLeave,C=>{var S;C.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:ot(o.onKeyDown,C=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&C.key===" "||(vbe.includes(C.key)&&I(),C.key===" "&&C.preventDefault())})})})})});rK.displayName=S5;var Km="SelectItemText",nK=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=_h(Km,r),a=Ih(Km,r),c=tK(Km,r),l=bbe(Km,r),[f,u]=D.useState(null),p=Tr(e,C=>u(C),c.onItemTextChange,C=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,C,c.value,c.disabled)}),g=f==null?void 0:f.textContent,y=D.useMemo(()=>Y.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:I}=l;return as(()=>(b(y),()=>I(y)),[b,I,y]),Y.jsxs(Y.Fragment,{children:[Y.jsx(jt.span,{id:c.textId,...s,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Eh.createPortal(s.children,o.valueNode):null]})});nK.displayName=Km;var iK="SelectItemIndicator",Pbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return tK(iK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});Pbe.displayName=iK;var T7="SelectScrollUpButton",kbe=D.forwardRef((t,e)=>{const r=Ih(T7,t.__scopeSelect),n=jP(T7,t.__scopeSelect),[i,s]=D.useState(!1),o=Tr(e,n.onScrollButtonChange);return as(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(sK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});kbe.displayName=T7;var P7="SelectScrollDownButton",Mbe=D.forwardRef((t,e)=>{const r=Ih(P7,t.__scopeSelect),n=jP(P7,t.__scopeSelect),[i,s]=D.useState(!1),o=Tr(e,n.onScrollButtonChange);return as(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(sK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Mbe.displayName=P7;var sK=D.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=Ih("SelectScrollButton",r),o=D.useRef(null),a=l8(r),c=D.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),as(()=>{var l;const f=a().find(u=>u.ref.current===document.activeElement);(l=f==null?void 0:f.ref.current)==null||l.scrollIntoView({block:"nearest"})},[a]),Y.jsx(jt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:ot(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ot(i.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ot(i.onPointerLeave,()=>{c()})})}),Rbe="SelectSeparator",Obe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return Y.jsx(jt.div,{"aria-hidden":!0,...n,ref:e})});Obe.displayName=Rbe;var k7="SelectArrow",Dbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=f8(r),s=_h(k7,r),o=Ih(k7,r);return s.open&&o.position==="popper"?Y.jsx(yP,{...i,...n,ref:e}):null});Dbe.displayName=k7;function oK(t){return t===""||t===void 0}var aK=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=D.useRef(null),s=Tr(e,i),o=Y4(r);return D.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),Y.jsx(ux,{asChild:!0,children:Y.jsx("select",{...n,ref:s,defaultValue:r})})});aK.displayName="BubbleSelect";function cK(t){const e=Ds(t),r=D.useRef(""),n=D.useRef(0),i=D.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=D.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function lK(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Nbe(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Nbe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var Bbe=$W,Lbe=VW,Fbe=HW,jbe=GW,Ube=WW,$be=JW,qbe=XW,Vbe=rK,zbe=nK,Hbe="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwum0 fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr11lk fyvr11jc fyvr12w9 fyvr11cc fyvr11o4 fyvr11rc fyvr12zf fyvr12s9",Gbe=Fn({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"gohwum7 gohwum3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"gohwum8 gohwum4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Wbe="gohwuma gohwum9 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11q0 fyvr11qg fyvr11r0 fyvr11y3 fyvr12w9 fyvr11rt",Kbe="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwumd fyvr1zk fyvr111o fyvr1v8 fyvr1xc fyvr1310 fyvr1311 fyvr130u fyvr130v fyvr11l8 fyvr11o4 fyvr11ow fyvr12zf fyvr12zb fyvr12w9 fyvr1309 fyvr12zz";const Ybe=D.forwardRef(({children:t,className:e,...r},n)=>Y.jsx(Vbe,{className:mi(Kbe,e),...r,ref:n,children:Y.jsx(zbe,{children:t})})),M7=D.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:f,...u}=t;return Y.jsx(Vp,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:Y.jsxs(Bbe,{disabled:n,name:c,...u,children:[Y.jsxs(Lbe,{id:i??c,className:mi(Hbe,Gbe({borderRadius:r})),ref:e,children:[Y.jsx(Fbe,{placeholder:f}),Y.jsx(xe,{as:jbe,display:"inline-flex",children:Y.jsx($H,{})})]}),Y.jsx(Ube,{className:Wbe,children:Y.jsx($be,{children:Y.jsx(qbe,{children:l.map(({value:p,label:g,...y})=>Y.jsx(Ybe,{value:p,...y,children:g},p))})})})]})})});D.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?Y.jsx(yu,{icon:Vg,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return Y.jsx(Wn,{ref:e,name:s,leftIcon:Qpe,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var Qbe=Fn({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const lh=D.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(xe,{className:Qbe({size:r}),color:"text50",ref:e,...n,children:Y.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[Y.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),Y.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});D.forwardRef(({children:t},e)=>Y.jsx(xe,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));var UP="Switch",[Jbe,bUe]=Bs(UP),[Zbe,Xbe]=Jbe(UP),fK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=D.useState(null),g=Tr(e,S=>p(S)),y=D.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=ic({prop:i,defaultProp:s,onChange:l});return Y.jsxs(Zbe,{scope:r,checked:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"switch","aria-checked":I,"aria-required":o,"data-state":hK(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onClick:ot(t.onClick,S=>{C(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&Y.jsx(ewe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});fK.displayName=UP;var uK="SwitchThumb",dK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Xbe(uK,r);return Y.jsx(jt.span,{"data-state":hK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});dK.displayName=uK;var ewe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=Y4(r),a=Q4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function hK(t){return t?"checked":"unchecked"}var twe=fK,rwe=dK,nwe="_1lp2u8e1 _1lp2u8e0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1v0 fyvr1x4 fyvr1z8 fyvr111c fyvr11x9 fyvr11m4 fyvr12zf fyvr12s9 _4efw240",iwe="_1lp2u8e3 _1lp2u8e2 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11lw fyvr1m0 fyvr1qg fyvr1k fyvr148 fyvr11s9";const swe=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return Y.jsx(Vp,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:Y.jsx(twe,{className:nwe,disabled:e,...a,children:Y.jsx(xe,{position:"relative",width:"full",height:"full",children:Y.jsx(rwe,{className:iwe})})})})};Fn({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11k8"},active:{true:"nwwh3zb nwwh3z2 fyvr130d",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12zx"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11yf fyvr12wr"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11sl fyvr12wf"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12w9"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12wf"]]});var $P="Tabs",[owe,wUe]=Bs($P,[my]),pK=my(),[awe,qP]=owe($P),vK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,f=ox(a),[u,p]=ic({prop:n,onChange:i,defaultProp:s});return Y.jsx(awe,{scope:r,baseId:Xa(),value:u,onValueChange:p,orientation:o,dir:f,activationMode:c,children:Y.jsx(jt.div,{dir:f,"data-orientation":o,...l,ref:e})})});vK.displayName=$P;var gK="TabsList",yK=D.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=qP(gK,r),o=pK(r);return Y.jsx(mP,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:Y.jsx(jt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});yK.displayName=gK;var mK="TabsTrigger",bK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=qP(mK,r),a=pK(r),c=EK(o.baseId,n),l=CK(o.baseId,n),f=n===o.value;return Y.jsx(bP,{asChild:!0,...a,focusable:!i,active:f,children:Y.jsx(jt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":l,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:ot(t.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?o.onValueChange(n):u.preventDefault()}),onKeyDown:ot(t.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(n)}),onFocus:ot(t.onFocus,()=>{const u=o.activationMode!=="manual";!f&&!i&&u&&o.onValueChange(n)})})})});bK.displayName=mK;var wK="TabsContent",xK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=qP(wK,r),c=EK(a.baseId,n),l=CK(a.baseId,n),f=n===a.value,u=D.useRef(f);return D.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),Y.jsx(no,{present:i||f,children:({present:p})=>Y.jsx(jt.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:l,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:u.current?"0s":void 0},children:p&&s})})});xK.displayName=wK;function EK(t,e){return`${t}-trigger-${e}`}function CK(t,e){return`${t}-content-${e}`}var cwe=vK,lwe=yK,fwe=bK,uwe="_10c8o0n1 _10c8o0n0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr11l8 fyvr11m4 fyvr12g fyvr11wr fyvr14w",dwe="_10c8o0n3 _10c8o0n2 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr130x fyvr130r fyvr12g fyvr164 fyvr12zf fyvr11m4 fyvr11sl fyvr11rc fyvr12wf",hwe="_10c8o0n5 _10c8o0n4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11lw fyvr1m0 fyvr1qg fyvr14k fyvr11y3 fyvr130f";const pwe=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return Y.jsxs(lwe,{className:uwe,style:{outline:void 0},children:[Y.jsx(xe,{display:"flex",position:"absolute",inset:"2",height:"8",children:Y.jsx("div",{className:hwe,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>Y.jsx(fwe,{className:dwe,value:s.value,children:Y.jsx(Ge,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},vwe=cwe,HB=xK;var gwe="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _1ppqbnx0 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zc fyvr111g fyvr1v0 fyvr1x4 fyvr11lk fyvr11cc fyvr11rh";D.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return Y.jsxs(xe,{className:gwe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(Ge,{children:n})]})});var VP="ToastProvider",[zP,ywe,mwe]=Z4("Toast"),[AK,xUe]=Bs("Toast",[mwe]),[bwe,u8]=AK(VP),SK=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,c]=D.useState(null),[l,f]=D.useState(0),u=D.useRef(!1),p=D.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${VP}\`. Expected non-empty \`string\`.`),Y.jsx(zP.Provider,{scope:e,children:Y.jsx(bwe,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:D.useCallback(()=>f(g=>g+1),[]),onToastRemove:D.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:p,children:o})})};SK.displayName=VP;var _K="ToastViewport",wwe=["F8"],R7="toast.viewportPause",O7="toast.viewportResume",IK=D.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=wwe,label:i="Notifications ({hotkey})",...s}=t,o=u8(_K,r),a=ywe(r),c=D.useRef(null),l=D.useRef(null),f=D.useRef(null),u=D.useRef(null),p=Tr(e,u,o.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;D.useEffect(()=>{const I=C=>{var S;n.every(L=>C[L]||C.code===L)&&((S=u.current)==null||S.focus())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[n]),D.useEffect(()=>{const I=c.current,C=u.current;if(y&&I&&C){const S=()=>{if(!o.isClosePausedRef.current){const z=new CustomEvent(R7);C.dispatchEvent(z),o.isClosePausedRef.current=!0}},O=()=>{if(o.isClosePausedRef.current){const z=new CustomEvent(O7);C.dispatchEvent(z),o.isClosePausedRef.current=!1}},L=z=>{!I.contains(z.relatedTarget)&&O()},F=()=>{I.contains(document.activeElement)||O()};return I.addEventListener("focusin",S),I.addEventListener("focusout",L),I.addEventListener("pointermove",S),I.addEventListener("pointerleave",F),window.addEventListener("blur",S),window.addEventListener("focus",O),()=>{I.removeEventListener("focusin",S),I.removeEventListener("focusout",L),I.removeEventListener("pointermove",S),I.removeEventListener("pointerleave",F),window.removeEventListener("blur",S),window.removeEventListener("focus",O)}}},[y,o.isClosePausedRef]);const b=D.useCallback(({tabbingDirection:I})=>{const S=a().map(O=>{const L=O.ref.current,F=[L,...Dwe(L)];return I==="forwards"?F:F.reverse()});return(I==="forwards"?S.reverse():S).flat()},[a]);return D.useEffect(()=>{const I=u.current;if(I){const C=S=>{var O,L,F;const z=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!z){const $=document.activeElement,ie=S.shiftKey;if(S.target===I&&ie){(O=l.current)==null||O.focus();return}const P=b({tabbingDirection:ie?"backwards":"forwards"}),M=P.findIndex(v=>v===$);KA(P.slice(M+1))?S.preventDefault():ie?(L=l.current)==null||L.focus():(F=f.current)==null||F.focus()}};return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)}},[a,b]),Y.jsxs(x1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&Y.jsx(D7,{ref:l,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"forwards"});KA(I)}}),Y.jsx(zP.Slot,{scope:r,children:Y.jsx(jt.ol,{tabIndex:-1,...s,ref:p})}),y&&Y.jsx(D7,{ref:f,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"backwards"});KA(I)}})]})});IK.displayName=_K;var TK="ToastFocusProxy",D7=D.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=u8(TK,r);return Y.jsx(ux,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var a;const c=o.relatedTarget;!((a=s.viewport)!=null&&a.contains(c))&&n()}})});D7.displayName=TK;var d8="Toast",xwe="toast.swipeStart",Ewe="toast.swipeMove",Cwe="toast.swipeCancel",Awe="toast.swipeEnd",PK=D.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=t,[a=!0,c]=ic({prop:n,defaultProp:i,onChange:s});return Y.jsx(no,{present:r||a,children:Y.jsx(Iwe,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Ds(t.onPause),onResume:Ds(t.onResume),onSwipeStart:ot(t.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ot(t.onSwipeMove,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:ot(t.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ot(t.onSwipeEnd,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});PK.displayName=d8;var[Swe,_we]=AK(d8,{onClose(){}}),Iwe=D.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:p,onSwipeEnd:g,...y}=t,b=u8(d8,r),[I,C]=D.useState(null),S=Tr(e,v=>C(v)),O=D.useRef(null),L=D.useRef(null),F=i||b.duration,z=D.useRef(0),_=D.useRef(F),$=D.useRef(0),{onToastAdd:ie,onToastRemove:ce}=b,K=Ds(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),P=D.useCallback(v=>{!v||v===1/0||(window.clearTimeout($.current),z.current=new Date().getTime(),$.current=window.setTimeout(K,v))},[K]);D.useEffect(()=>{const v=b.viewport;if(v){const m=()=>{P(_.current),l==null||l()},R=()=>{const B=new Date().getTime()-z.current;_.current=_.current-B,window.clearTimeout($.current),c==null||c()};return v.addEventListener(R7,R),v.addEventListener(O7,m),()=>{v.removeEventListener(R7,R),v.removeEventListener(O7,m)}}},[b.viewport,F,c,l,P]),D.useEffect(()=>{s&&!b.isClosePausedRef.current&&P(F)},[s,F,b.isClosePausedRef,P]),D.useEffect(()=>(ie(),()=>ce()),[ie,ce]);const M=D.useMemo(()=>I?NK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[M&&Y.jsx(Twe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:M}),Y.jsx(Swe,{scope:r,onClose:K,children:Eh.createPortal(Y.jsx(zP.ItemSlot,{scope:r,children:Y.jsx(w1e,{asChild:!0,onEscapeKeyDown:ot(a,()=>{b.isFocusedToastEscapeKeyDownRef.current||K(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:Y.jsx(jt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":b.swipeDirection,...y,ref:S,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ot(t.onKeyDown,v=>{v.key==="Escape"&&(a==null||a(v.nativeEvent),v.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:ot(t.onPointerDown,v=>{v.button===0&&(O.current={x:v.clientX,y:v.clientY})}),onPointerMove:ot(t.onPointerMove,v=>{if(!O.current)return;const m=v.clientX-O.current.x,R=v.clientY-O.current.y,B=!!L.current,E=["left","right"].includes(b.swipeDirection),x=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=E?x(0,m):0,T=E?0:x(0,R),k=v.pointerType==="touch"?10:2,H={x:w,y:T},oe={originalEvent:v,delta:H};B?(L.current=H,c6(Ewe,u,oe,{discrete:!1})):GB(H,b.swipeDirection,k)?(L.current=H,c6(xwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>k||Math.abs(R)>k)&&(O.current=null)}),onPointerUp:ot(t.onPointerUp,v=>{const m=L.current,R=v.target;if(R.hasPointerCapture(v.pointerId)&&R.releasePointerCapture(v.pointerId),L.current=null,O.current=null,m){const B=v.currentTarget,E={originalEvent:v,delta:m};GB(m,b.swipeDirection,b.swipeThreshold)?c6(Awe,g,E,{discrete:!0}):c6(Cwe,p,E,{discrete:!0}),B.addEventListener("click",x=>x.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),Twe=t=>{const{__scopeToast:e,children:r,...n}=t,i=u8(d8,e),[s,o]=D.useState(!1),[a,c]=D.useState(!1);return Rwe(()=>o(!0)),D.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:Y.jsx(cx,{asChild:!0,children:Y.jsx(ux,{...n,children:s&&Y.jsxs(Y.Fragment,{children:[i.label," ",r]})})})},Pwe="ToastTitle",kK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});kK.displayName=Pwe;var kwe="ToastDescription",MK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});MK.displayName=kwe;var RK="ToastAction",Mwe=D.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(DK,{altText:r,asChild:!0,children:Y.jsx(HP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${RK}\`. Expected non-empty \`string\`.`),null)});Mwe.displayName=RK;var OK="ToastClose",HP=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=_we(OK,r);return Y.jsx(DK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,i.onClose)})})});HP.displayName=OK;var DK=D.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return Y.jsx(jt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function NK(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Owe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...NK(n))}}),e}function c6(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?JT(i,s):i.dispatchEvent(s)}var GB=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Rwe(t=()=>{}){const e=Ds(t);as(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Owe(t){return t.nodeType===t.ELEMENT_NODE}function Dwe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function KA(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Nwe=SK,Bwe=IK,Lwe=PK,Fwe=kK,jwe=MK,Uwe=HP,$we="_6wut8v1 _6wut8v0 fyvr130x fyvr130r fyvr11m0 fyvr1so fyvr1o8 fyvr12g fyvr11cg fyvr11mc fyvr11l8",qwe=Fn({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});const BK=D.createContext(null),Vwe=t=>{const{children:e,...r}=t,[n,i]=D.useState(new Set);return Y.jsxs(Nwe,{...r,children:[Y.jsxs(BK.Provider,{value:i,children:[e,Y.jsx(PH,{children:Array.from(n).map(s=>Y.jsx(Hwe,{...s},s.id))})]}),Y.jsx(zwe,{})]})},zwe=()=>Y.jsx(Bwe,{className:$we}),Hwe=t=>{const{id:e,variant:r,title:n,description:i,icon:s,isDismissible:o=!0,...a}=t,c=()=>{if(s)return Y.jsx(s,{});switch(r){case"success":return Y.jsx(xe,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(XT,{})});case"error":return Y.jsx(xe,{background:"negative",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(Vg,{})});default:return null}};return Y.jsx(Lwe,{className:qwe({variant:r}),open:!0,forceMount:!0,asChild:!0,...a,children:Y.jsxs($r,{as:cp.li,layoutId:e,layout:!0,initial:{x:"100%"},animate:{x:0},exit:{y:"100%",opacity:0},borderRadius:"md",background:"buttonGlass",backdropFilter:"blur",position:"relative",width:"full",justifyContent:"space-between",children:[Y.jsxs(xe,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(xe,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Fwe,{children:Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(jwe,{children:Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"medium",color:"text50",children:i})})]})]}),o&&Y.jsx(Uwe,{"aria-label":"Close",asChild:!0,children:Y.jsx(yu,{icon:Vg,size:"xs"})})]})})},h8=()=>{const t=D.useContext(BK);return e=>{const r={...e,id:Math.random().toString(36).slice(2,12),onOpenChange:n=>{n||t(i=>(i.delete(r),new Set([...i])))}};t(n=>new Set([...n,r]))}};var Gwe="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _15pztn0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr12w9 fyvr12s9 fyvr130r fyvr12g fyvr11l8",Wwe="_15pztn2";const Kwe=D.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:f,rows:u,resize:p=!1,...g}=t;return Y.jsx(Vp,{description:s,disabled:o,display:"grid",id:a??f,label:c,labelLocation:l,children:Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:mi(Gwe,p&&Wwe),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...g})})});var Ywe=Fn({defaultClassName:"_18h918k5 _18h918k0 fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11l8",variantClassNames:{size:{xs:"_18h918k6",sm:"_18h918k7",md:"_18h918k8",lg:"_18h918k9",xl:"_18h918ka"},borderRadius:{circle:"_18h918kb _18h918k1 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",lg:"_18h918kc _18h918k2 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs",md:"_18h918kd _18h918k3 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go",sm:"_18h918ke _18h918k4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"}},defaultVariants:{},compoundVariants:[]}),Qwe="_18h918kf";const Jwe=D.memo(t=>{const{chainId:e,borderRadius:r="circle",className:n,disableAnimation:i=!1,style:s,src:o,size:a="md",...c}=t,l=o||ppe(vpe(e),a);return Y.jsx(xe,{className:mi(n,Ywe({borderRadius:r,size:a})),style:s,flexShrink:"0",...c,children:Y.jsx(a8,{className:Qwe,disableAnimation:i,src:l})})});var Zwe=Fn({defaultClassName:"bnrreb1 bnrreb0 fyvr11no fyvr11ow fyvr11m4 fyvr11l8",variantClassNames:{size:{xs:"bnrreb2",sm:"bnrreb3",md:"bnrreb4",lg:"bnrreb5",xl:"bnrreb6"}},defaultVariants:{},compoundVariants:[]}),Xwe="bnrreb7",exe="bnrreb9 bnrreb8 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11wr fyvr12g fyvr164 fyvr11l8",WB="bnrreba";const KB="40%",YB="-2%";D.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",withNetwork:c,...l}=t;return Y.jsxs(xe,{className:mi(r,Zwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(a8,{className:mi(Xwe,c&&WB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(Ge,{className:mi(exe,c&&WB),variant:"normal",fontWeight:"medium",color:"text50",borderRadius:e,overflow:"hidden",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)}),c&&Y.jsx(Jwe,{chainId:c,position:"absolute",zIndex:"1",disableAnimation:n,style:{width:KB,height:KB,right:YB,bottom:YB}})]})});var[p8,EUe]=Bs("Tooltip",[yy]),v8=yy(),LK="TooltipProvider",txe=700,N7="tooltip.open",[rxe,GP]=p8(LK),nxe=t=>{const{__scopeTooltip:e,delayDuration:r=txe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=D.useState(!0),c=D.useRef(!1),l=D.useRef(0);return D.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),Y.jsx(rxe,{scope:e,isOpenDelayed:o,delayDuration:r,onOpen:D.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:D.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:D.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:s})};nxe.displayName=LK;var g8="Tooltip",[ixe,hx]=p8(g8),sxe=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=GP(g8,t.__scopeTooltip),l=v8(e),[f,u]=D.useState(null),p=Xa(),g=D.useRef(0),y=o??c.disableHoverableContent,b=a??c.delayDuration,I=D.useRef(!1),[C=!1,S]=ic({prop:n,defaultProp:i,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(N7))):c.onClose(),s==null||s(_)}}),O=D.useMemo(()=>C?I.current?"delayed-open":"instant-open":"closed",[C]),L=D.useCallback(()=>{window.clearTimeout(g.current),I.current=!1,S(!0)},[S]),F=D.useCallback(()=>{window.clearTimeout(g.current),S(!1)},[S]),z=D.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{I.current=!0,S(!0)},b)},[b,S]);return D.useEffect(()=>()=>window.clearTimeout(g.current),[]),Y.jsx(pP,{...l,children:Y.jsx(ixe,{scope:e,contentId:p,open:C,stateAttribute:O,trigger:f,onTriggerChange:u,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayed?z():L()},[c.isOpenDelayed,z,L]),onTriggerLeave:D.useCallback(()=>{y?F():window.clearTimeout(g.current)},[F,y]),onOpen:L,onClose:F,disableHoverableContent:y,children:r})})};sxe.displayName=g8;var B7="TooltipTrigger",oxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=hx(B7,r),s=GP(B7,r),o=v8(r),a=D.useRef(null),c=Tr(e,a,i.onTriggerChange),l=D.useRef(!1),f=D.useRef(!1),u=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),Y.jsx(vP,{asChild:!0,...o,children:Y.jsx(jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:ot(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:ot(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:ot(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ot(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ot(t.onBlur,i.onClose),onClick:ot(t.onClick,i.onClose)})})});oxe.displayName=B7;var WP="TooltipPortal",[axe,cxe]=p8(WP,{forceMount:void 0}),lxe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=hx(WP,e);return Y.jsx(axe,{scope:e,forceMount:r,children:Y.jsx(no,{present:r||s.open,children:Y.jsx(cx,{asChild:!0,container:i,children:n})})})};lxe.displayName=WP;var Hg="TooltipContent",fxe=D.forwardRef((t,e)=>{const r=cxe(Hg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,o=hx(Hg,t.__scopeTooltip);return Y.jsx(no,{present:n||o.open,children:o.disableHoverableContent?Y.jsx(FK,{side:i,...s,ref:e}):Y.jsx(uxe,{side:i,...s,ref:e})})}),uxe=D.forwardRef((t,e)=>{const r=hx(Hg,t.__scopeTooltip),n=GP(Hg,t.__scopeTooltip),i=D.useRef(null),s=Tr(e,i),[o,a]=D.useState(null),{trigger:c,onClose:l}=r,f=i.current,{onPointerInTransitChange:u}=n,p=D.useCallback(()=>{a(null),u(!1)},[u]),g=D.useCallback((y,b)=>{const I=y.currentTarget,C={x:y.clientX,y:y.clientY},S=vxe(C,I.getBoundingClientRect()),O=gxe(C,S),L=yxe(b.getBoundingClientRect()),F=bxe([...O,...L]);a(F),u(!0)},[u]);return D.useEffect(()=>()=>p(),[p]),D.useEffect(()=>{if(c&&f){const y=I=>g(I,f),b=I=>g(I,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",b)}}},[c,f,g,p]),D.useEffect(()=>{if(o){const y=b=>{const I=b.target,C={x:b.clientX,y:b.clientY},S=(c==null?void 0:c.contains(I))||(f==null?void 0:f.contains(I)),O=!mxe(C,o);S?p():O&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,o,l,p]),Y.jsx(FK,{...t,ref:s})}),[dxe,hxe]=p8(g8,{isInside:!1}),FK=D.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=hx(Hg,r),l=v8(r),{onClose:f}=c;return D.useEffect(()=>(document.addEventListener(N7,f),()=>document.removeEventListener(N7,f)),[f]),D.useEffect(()=>{if(c.trigger){const u=p=>{const g=p.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,f]),Y.jsx(py,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:Y.jsxs(gP,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Y.jsx(NH,{children:n}),Y.jsx(dxe,{scope:r,isInside:!0,children:Y.jsx(hbe,{id:c.contentId,role:"tooltip",children:i||n})})]})})});fxe.displayName=Hg;var jK="TooltipArrow",pxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=v8(r);return hxe(jK,r).isInside?null:Y.jsx(yP,{...i,...n,ref:e})});pxe.displayName=jK;function vxe(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function gxe(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function yxe(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function mxe(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function bxe(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),wxe(e)}function wxe(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const KP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${lB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${lB.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=D.useState(()=>i?window.matchMedia(n).matches:s);return D.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),f=()=>{c&&a(l.matches)};return f(),l.addListener(f),()=>{c=!1,l.removeListener(f)}},[n,i]),o};var L7={},QB=Eh;L7.createRoot=QB.createRoot,L7.hydrateRoot=QB.hydrateRoot;var UK={exports:{}},on={};/** @license React v16.13.1 +Defaulting to \`null\`.`}var DP="Radio",[Jme,IW]=Fs(DP),[Zme,Xme]=Jme(DP),TW=D.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[f,u]=D.useState(null),p=kr(e,b=>u(b)),g=D.useRef(!1),y=f?!!f.closest("form"):!0;return Y.jsxs(Zme,{scope:r,checked:i,disabled:o,children:[Y.jsx(jt.button,{type:"button",role:"radio","aria-checked":i,"data-state":MW(i),"data-disabled":o?"":void 0,disabled:o,value:a,...l,ref:p,onClick:ot(t.onClick,b=>{i||c==null||c(),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&Y.jsx(ebe,{control:f,bubbles:!g.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}})]})});TW.displayName=DP;var PW="RadioIndicator",kW=D.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Xme(PW,r);return Y.jsx(oo,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":MW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});kW.displayName=PW;var ebe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=z4(r),a=H4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function MW(t){return t?"checked":"unchecked"}var tbe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],NP="RadioGroup",[rbe,yUe]=Fs(NP,[by,IW]),RW=by(),OW=IW(),[nbe,ibe]=rbe(NP),DW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...p}=t,g=RW(r),y=sx(l),[b,I]=Za({prop:s,defaultProp:i,onChange:u});return Y.jsx(nbe,{scope:r,name:n,required:o,disabled:a,value:b,onValueChange:I,children:Y.jsx(vP,{asChild:!0,...g,orientation:c,dir:y,loop:f,children:Y.jsx(jt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...p,ref:e})})})});DW.displayName=NP;var NW="RadioGroupItem",BW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=ibe(NW,r),o=s.disabled||n,a=RW(r),c=OW(r),l=D.useRef(null),f=kr(e,l),u=s.value===i.value,p=D.useRef(!1);return D.useEffect(()=>{const g=b=>{tbe.includes(b.key)&&(p.current=!0)},y=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",y)}},[]),Y.jsx(gP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(TW,{disabled:o,required:s.required,checked:u,...c,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:ot(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:ot(i.onFocus,()=>{var g;p.current&&((g=l.current)==null||g.click())})})})});BW.displayName=NW;var sbe="RadioGroupIndicator",LW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=OW(r);return Y.jsx(kW,{...i,...n,ref:e})});LW.displayName=sbe;var obe=DW,abe=BW,cbe=LW,lbe=jn({defaultClassName:"io59uy3 io59uy0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1uw fyvr1x0 fyvr1z4 fyvr1118 fyvr12rl fyvr12k9 fyvr125l fyvr12cx fyvr12rr fyvr12kf fyvr125r fyvr12d3 fyvr11sl fyvr12zf fyvr12zb fyvr1307 fyvr12zz _4efw240",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11eg fyvr11es fyvr11f4 fyvr11fg",lg:"io59uy5 io59uy2 fyvr11ek fyvr11ew fyvr11f8 fyvr11fk"}},defaultVariants:{},compoundVariants:[]}),fbe=jn({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11l8 fyvr11ow fyvr11no fyvr11m4 fyvr12g fyvr164 fyvr12w9",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const ube=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return Y.jsx(xe,{alignItems:"center",children:Y.jsx(Vp,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:Y.jsx(abe,{className:lbe({size:n}),value:i,id:e,disabled:s,children:Y.jsx(cbe,{className:fbe({size:n})})})})})};D.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return Y.jsx(obe,{disabled:n,name:s,ref:e,...c,children:Y.jsx(xe,{flexDirection:r,gap:i,children:o.map(({label:l,value:f,disabled:u})=>Y.jsx(ube,{id:`${s}-${f}`,label:l,size:a,value:f,disabled:u},f))})})});function $B(t,[e,r]){return Math.min(r,Math.max(e,t))}var dbe="VisuallyHidden",fx=D.forwardRef((t,e)=>Y.jsx(jt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));fx.displayName=dbe;var hbe=fx,pbe=[" ","Enter","ArrowUp","ArrowDown"],vbe=[" ","Enter"],ux="Select",[n8,i8,gbe]=W4(ux),[wy,mUe]=Fs(ux,[gbe,my]),s8=my(),[ybe,Ah]=wy(ux),[mbe,bbe]=wy(ux),FW=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:u,disabled:p,required:g}=t,y=s8(e),[b,I]=D.useState(null),[C,S]=D.useState(null),[O,L]=D.useState(!1),F=sx(l),[z=!1,_]=Za({prop:n,defaultProp:i,onChange:s}),[$,ie]=Za({prop:o,defaultProp:a,onChange:c}),ce=D.useRef(null),K=b?!!b.closest("form"):!0,[P,M]=D.useState(new Set),v=Array.from(P).map(m=>m.props.value).join(";");return Y.jsx(uP,{...y,children:Y.jsxs(ybe,{required:g,scope:e,trigger:b,onTriggerChange:I,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:L,contentId:Wa(),value:$,onValueChange:ie,open:z,onOpenChange:_,dir:F,triggerPointerDownPosRef:ce,disabled:p,children:[Y.jsx(n8.Provider,{scope:e,children:Y.jsx(mbe,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(m=>{M(R=>new Set(R).add(m))},[]),onNativeOptionRemove:D.useCallback(m=>{M(R=>{const B=new Set(R);return B.delete(m),B})},[]),children:r})}),K?Y.jsxs(iK,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:$,onChange:m=>ie(m.target.value),disabled:p,children:[$===void 0?Y.jsx("option",{value:""}):null,Array.from(P)]},v):null]})})};FW.displayName=ux;var jW="SelectTrigger",UW=D.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=s8(r),o=Ah(jW,r),a=o.disabled||n,c=kr(e,o.onTriggerChange),l=i8(r),[f,u,p]=sK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=oK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(dP,{asChild:!0,...s,children:Y.jsx(jt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":nK(o.value)?"":void 0,...i,ref:c,onClick:ot(i.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ot(i.onPointerDown,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ot(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(b&&y.key===" ")&&pbe.includes(y.key)&&(g(),y.preventDefault())})})})});UW.displayName=jW;var $W="SelectValue",qW=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Ah($W,r),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,u=kr(e,c.onValueNodeChange);return os(()=>{l(f)},[l,f]),Y.jsx(jt.span,{...a,ref:u,style:{pointerEvents:"none"},children:nK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});qW.displayName=$W;var wbe="SelectIcon",VW=D.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});VW.displayName=wbe;var _p="SelectContent",zW=D.forwardRef((t,e)=>{const r=Ah(_p,t.__scopeSelect),[n,i]=D.useState();if(os(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?wh.createPortal(Y.jsx(HW,{scope:t.__scopeSelect,children:Y.jsx(n8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(GW,{...t,ref:e})});zW.displayName=_p;var Pf=10,[HW,Sh]=wy(_p),xbe="SelectContentImpl",GW=D.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I,...C}=t,S=Ah(_p,r),[O,L]=D.useState(null),[F,z]=D.useState(null),_=kr(e,G=>L(G)),[$,ie]=D.useState(null),[ce,K]=D.useState(null),P=i8(r),[M,v]=D.useState(!1),m=D.useRef(!1);D.useEffect(()=>{if(O)return yP(O)},[O]),rP();const R=D.useCallback(G=>{const[Z,...ee]=P().map(fe=>fe.ref.current),[N]=ee.slice(-1),te=document.activeElement;for(const fe of G)if(fe===te||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Z&&F&&(F.scrollTop=0),fe===N&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==te))return},[P,F]),B=D.useCallback(()=>R([$,O]),[R,$,O]);D.useEffect(()=>{M&&B()},[M,B]);const{onOpenChange:E,triggerPointerDownPosRef:x}=S;D.useEffect(()=>{if(O){let G={x:0,y:0};const Z=N=>{var te,fe;G={x:Math.abs(Math.round(N.pageX)-(((te=x.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(N.pageY)-(((fe=x.current)==null?void 0:fe.y)??0))}},ee=N=>{G.x<=10&&G.y<=10?N.preventDefault():O.contains(N.target)||E(!1),document.removeEventListener("pointermove",Z),x.current=null};return x.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ee,{capture:!0})}}},[O,E,x]),D.useEffect(()=>{const G=()=>E(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[E]);const[w,T]=sK(G=>{const Z=P().filter(te=>!te.disabled),ee=Z.find(te=>te.ref.current===document.activeElement),N=oK(Z,G,ee);N&&setTimeout(()=>N.ref.current.focus())}),k=D.useCallback((G,Z,ee)=>{const N=!m.current&&!ee;(S.value!==void 0&&S.value===Z||N)&&(ie(G),N&&(m.current=!0))},[S.value]),H=D.useCallback(()=>O==null?void 0:O.focus(),[O]),oe=D.useCallback((G,Z,ee)=>{const N=!m.current&&!ee;(S.value!==void 0&&S.value===Z||N)&&K(G)},[S.value]),j=n==="popper"?C7:WW,X=j===C7?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:u,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:b,avoidCollisions:I}:{};return Y.jsx(HW,{scope:r,content:O,viewport:F,onViewportChange:z,itemRefCallback:k,selectedItem:$,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:B,selectedItemText:ce,position:n,isPositioned:M,searchRef:w,children:Y.jsx(X4,{as:Cp,allowPinchZoom:!0,children:Y.jsx(K4,{asChild:!0,trapped:S.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ot(i,G=>{var Z;(Z=S.trigger)==null||Z.focus({preventScroll:!0}),G.preventDefault()}),children:Y.jsx(vy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:Y.jsx(j,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:G=>G.preventDefault(),...C,...X,onPlaced:()=>v(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ot(C.onKeyDown,G=>{const Z=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Z&&G.key.length===1&&T(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let N=P().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(G.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const te=G.target,fe=N.indexOf(te);N=N.slice(fe+1)}setTimeout(()=>R(N)),G.preventDefault()}})})})})})})});GW.displayName=xbe;var Ebe="SelectItemAlignedPosition",WW=D.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Ah(_p,r),o=Sh(_p,r),[a,c]=D.useState(null),[l,f]=D.useState(null),u=kr(e,_=>f(_)),p=i8(r),g=D.useRef(!1),y=D.useRef(!0),{viewport:b,selectedItem:I,selectedItemText:C,focusSelectedItem:S}=o,O=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&b&&I&&C){const _=s.trigger.getBoundingClientRect(),$=l.getBoundingClientRect(),ie=s.valueNode.getBoundingClientRect(),ce=C.getBoundingClientRect();if(s.dir!=="rtl"){const te=ce.left-$.left,fe=ie.left-te,Ee=_.left-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-Pf,De=$B(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.left=De+"px"}else{const te=$.right-ce.right,fe=window.innerWidth-ie.right-te,Ee=window.innerWidth-_.right-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-Pf,De=$B(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.right=De+"px"}const K=p(),P=window.innerHeight-Pf*2,M=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),R=parseInt(v.paddingTop,10),B=parseInt(v.borderBottomWidth,10),E=parseInt(v.paddingBottom,10),x=m+R+M+E+B,w=Math.min(I.offsetHeight*5,x),T=window.getComputedStyle(b),k=parseInt(T.paddingTop,10),H=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-Pf,j=P-oe,X=I.offsetHeight/2,G=I.offsetTop+X,Z=m+R+G,ee=x-Z;if(Z<=oe){const te=I===K[K.length-1].ref.current;a.style.bottom="0px";const fe=l.clientHeight-b.offsetTop-b.offsetHeight,Ee=Math.max(j,X+(te?H:0)+fe+B),_e=Z+Ee;a.style.height=_e+"px"}else{const te=I===K[0].ref.current;a.style.top="0px";const Ee=Math.max(oe,m+b.offsetTop+(te?k:0)+X)+ee;a.style.height=Ee+"px",b.scrollTop=Z-oe+b.offsetTop}a.style.margin=`${Pf}px 0`,a.style.minHeight=w+"px",a.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,a,l,b,I,C,s.dir,n]);os(()=>O(),[O]);const[L,F]=D.useState();os(()=>{l&&F(window.getComputedStyle(l).zIndex)},[l]);const z=D.useCallback(_=>{_&&y.current===!0&&(O(),S==null||S(),y.current=!1)},[O,S]);return Y.jsx(Abe,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:Y.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:Y.jsx(jt.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});WW.displayName=Ebe;var Cbe="SelectPopperPosition",C7=D.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Pf,...s}=t,o=s8(r);return Y.jsx(hP,{...o,...s,ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});C7.displayName=Cbe;var[Abe,BP]=wy(_p,{}),A7="SelectViewport",KW=D.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Sh(A7,r),o=BP(A7,r),a=kr(e,s.onViewportChange),c=D.useRef(0);return Y.jsxs(Y.Fragment,{children:[Y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),Y.jsx(n8.Slot,{scope:r,children:Y.jsx(jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"auto",...i.style},onScroll:ot(i.onScroll,l=>{const f=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&u){const g=Math.abs(c.current-f.scrollTop);if(g>0){const y=window.innerHeight-Pf*2,b=parseFloat(u.style.minHeight),I=parseFloat(u.style.height),C=Math.max(b,I);if(C0?L:0,u.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});KW.displayName=A7;var YW="SelectGroup",[Sbe,_be]=wy(YW),QW=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Wa();return Y.jsx(Sbe,{scope:r,id:i,children:Y.jsx(jt.div,{role:"group","aria-labelledby":i,...n,ref:e})})});QW.displayName=YW;var JW="SelectLabel",Ibe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=_be(JW,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});Ibe.displayName=JW;var w5="SelectItem",[Tbe,ZW]=wy(w5),XW=D.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=Ah(w5,r),c=Sh(w5,r),l=a.value===n,[f,u]=D.useState(s??""),[p,g]=D.useState(!1),y=kr(e,C=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,C,n,i)}),b=Wa(),I=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Y.jsx(Tbe,{scope:r,value:n,disabled:i,textId:b,isSelected:l,onItemTextChange:D.useCallback(C=>{u(S=>S||((C==null?void 0:C.textContent)??"").trim())},[]),children:Y.jsx(n8.ItemSlot,{scope:r,value:n,disabled:i,textValue:f,children:Y.jsx(jt.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:ot(o.onFocus,()=>g(!0)),onBlur:ot(o.onBlur,()=>g(!1)),onPointerUp:ot(o.onPointerUp,I),onPointerMove:ot(o.onPointerMove,C=>{var S;i?(S=c.onItemLeave)==null||S.call(c):C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ot(o.onPointerLeave,C=>{var S;C.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:ot(o.onKeyDown,C=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&C.key===" "||(vbe.includes(C.key)&&I(),C.key===" "&&C.preventDefault())})})})})});XW.displayName=w5;var Wm="SelectItemText",eK=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Ah(Wm,r),a=Sh(Wm,r),c=ZW(Wm,r),l=bbe(Wm,r),[f,u]=D.useState(null),p=kr(e,C=>u(C),c.onItemTextChange,C=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,C,c.value,c.disabled)}),g=f==null?void 0:f.textContent,y=D.useMemo(()=>Y.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:I}=l;return os(()=>(b(y),()=>I(y)),[b,I,y]),Y.jsxs(Y.Fragment,{children:[Y.jsx(jt.span,{id:c.textId,...s,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?wh.createPortal(s.children,o.valueNode):null]})});eK.displayName=Wm;var tK="SelectItemIndicator",Pbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return ZW(tK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});Pbe.displayName=tK;var S7="SelectScrollUpButton",kbe=D.forwardRef((t,e)=>{const r=Sh(S7,t.__scopeSelect),n=BP(S7,t.__scopeSelect),[i,s]=D.useState(!1),o=kr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});kbe.displayName=S7;var _7="SelectScrollDownButton",Mbe=D.forwardRef((t,e)=>{const r=Sh(_7,t.__scopeSelect),n=BP(_7,t.__scopeSelect),[i,s]=D.useState(!1),o=kr(e,n.onScrollButtonChange);return os(()=>{if(r.viewport&&r.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?Y.jsx(rK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Mbe.displayName=_7;var rK=D.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=Sh("SelectScrollButton",r),o=D.useRef(null),a=i8(r),c=D.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),os(()=>{var l;const f=a().find(u=>u.ref.current===document.activeElement);(l=f==null?void 0:f.ref.current)==null||l.scrollIntoView({block:"nearest"})},[a]),Y.jsx(jt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:ot(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ot(i.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ot(i.onPointerLeave,()=>{c()})})}),Rbe="SelectSeparator",Obe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return Y.jsx(jt.div,{"aria-hidden":!0,...n,ref:e})});Obe.displayName=Rbe;var I7="SelectArrow",Dbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=s8(r),s=Ah(I7,r),o=Sh(I7,r);return s.open&&o.position==="popper"?Y.jsx(pP,{...i,...n,ref:e}):null});Dbe.displayName=I7;function nK(t){return t===""||t===void 0}var iK=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=D.useRef(null),s=kr(e,i),o=z4(r);return D.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[o,r]),Y.jsx(fx,{asChild:!0,children:Y.jsx("select",{...n,ref:s,defaultValue:r})})});iK.displayName="BubbleSelect";function sK(t){const e=Bs(t),r=D.useRef(""),n=D.useRef(0),i=D.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=D.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function oK(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Nbe(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Nbe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var Bbe=FW,Lbe=UW,Fbe=qW,jbe=VW,Ube=zW,$be=KW,qbe=QW,Vbe=XW,zbe=eK,Hbe="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwum0 fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr11lk fyvr11jc fyvr12w9 fyvr11cc fyvr11o4 fyvr11rc fyvr12zf fyvr12s9",Gbe=jn({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg",sm:"gohwum7 gohwum3 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk",md:"gohwum8 gohwum4 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go"}},defaultVariants:{},compoundVariants:[]}),Wbe="gohwuma gohwum9 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11q0 fyvr11qg fyvr11r0 fyvr11y3 fyvr12w9 fyvr11rt",Kbe="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 gohwumd fyvr1zk fyvr111o fyvr1v8 fyvr1xc fyvr1310 fyvr1311 fyvr130u fyvr130v fyvr11l8 fyvr11o4 fyvr11ow fyvr12zf fyvr12zb fyvr12w9 fyvr1309 fyvr12zz";const Ybe=D.forwardRef(({children:t,className:e,...r},n)=>Y.jsx(Vbe,{className:pi(Kbe,e),...r,ref:n,children:Y.jsx(zbe,{children:t})})),T7=D.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:f,...u}=t;return Y.jsx(Vp,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:Y.jsxs(Bbe,{disabled:n,name:c,...u,children:[Y.jsxs(Lbe,{id:i??c,className:pi(Hbe,Gbe({borderRadius:r})),ref:e,children:[Y.jsx(Fbe,{placeholder:f}),Y.jsx(xe,{as:jbe,display:"inline-flex",children:Y.jsx(FH,{})})]}),Y.jsx(Ube,{className:Wbe,children:Y.jsx($be,{children:Y.jsx(qbe,{children:l.map(({value:p,label:g,...y})=>Y.jsx(Ybe,{value:p,...y,children:g},p))})})})]})})});D.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?Y.jsx(gu,{icon:zg,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return Y.jsx(Wn,{ref:e,name:s,leftIcon:Qpe,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var Qbe=jn({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const ah=D.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(xe,{className:Qbe({size:r}),color:"text50",ref:e,...n,children:Y.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[Y.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),Y.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});D.forwardRef(({children:t},e)=>Y.jsx(xe,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));var LP="Switch",[Jbe,bUe]=Fs(LP),[Zbe,Xbe]=Jbe(LP),aK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...f}=t,[u,p]=D.useState(null),g=kr(e,S=>p(S)),y=D.useRef(!1),b=u?!!u.closest("form"):!0,[I=!1,C]=Za({prop:i,defaultProp:s,onChange:l});return Y.jsxs(Zbe,{scope:r,checked:I,disabled:a,children:[Y.jsx(jt.button,{type:"button",role:"switch","aria-checked":I,"aria-required":o,"data-state":fK(I),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onClick:ot(t.onClick,S=>{C(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&Y.jsx(ewe,{control:u,bubbles:!y.current,name:n,value:c,checked:I,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});aK.displayName=LP;var cK="SwitchThumb",lK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Xbe(cK,r);return Y.jsx(jt.span,{"data-state":fK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});lK.displayName=cK;var ewe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=D.useRef(null),o=z4(r),a=H4(e);return D.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&u){const p=new Event("click",{bubbles:n});u.call(c,r),c.dispatchEvent(p)}},[o,r,n]),Y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fK(t){return t?"checked":"unchecked"}var twe=aK,rwe=lK,nwe="_1lp2u8e1 _1lp2u8e0 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1v0 fyvr1x4 fyvr1z8 fyvr111c fyvr11x9 fyvr11m4 fyvr12zf fyvr12s9 _4efw240",iwe="_1lp2u8e3 _1lp2u8e2 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11lw fyvr1m0 fyvr1qg fyvr1k fyvr148 fyvr11s9";const swe=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return Y.jsx(Vp,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:Y.jsx(twe,{className:nwe,disabled:e,...a,children:Y.jsx(xe,{position:"relative",width:"full",height:"full",children:Y.jsx(rwe,{className:iwe})})})})};jn({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11k8"},active:{true:"nwwh3zb nwwh3z2 fyvr130d",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12zx"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11yf fyvr12wr"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11sl fyvr12wf"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12w9"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12wf"]]});var FP="Tabs",[owe,wUe]=Fs(FP,[by]),uK=by(),[awe,jP]=owe(FP),dK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,f=sx(a),[u,p]=Za({prop:n,onChange:i,defaultProp:s});return Y.jsx(awe,{scope:r,baseId:Wa(),value:u,onValueChange:p,orientation:o,dir:f,activationMode:c,children:Y.jsx(jt.div,{dir:f,"data-orientation":o,...l,ref:e})})});dK.displayName=FP;var hK="TabsList",pK=D.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=jP(hK,r),o=uK(r);return Y.jsx(vP,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:Y.jsx(jt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});pK.displayName=hK;var vK="TabsTrigger",gK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=jP(vK,r),a=uK(r),c=bK(o.baseId,n),l=wK(o.baseId,n),f=n===o.value;return Y.jsx(gP,{asChild:!0,...a,focusable:!i,active:f,children:Y.jsx(jt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":l,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:ot(t.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?o.onValueChange(n):u.preventDefault()}),onKeyDown:ot(t.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(n)}),onFocus:ot(t.onFocus,()=>{const u=o.activationMode!=="manual";!f&&!i&&u&&o.onValueChange(n)})})})});gK.displayName=vK;var yK="TabsContent",mK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=jP(yK,r),c=bK(a.baseId,n),l=wK(a.baseId,n),f=n===a.value,u=D.useRef(f);return D.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),Y.jsx(oo,{present:i||f,children:({present:p})=>Y.jsx(jt.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:l,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:u.current?"0s":void 0},children:p&&s})})});mK.displayName=yK;function bK(t,e){return`${t}-trigger-${e}`}function wK(t,e){return`${t}-content-${e}`}var cwe=dK,lwe=pK,fwe=gK,uwe="_10c8o0n1 _10c8o0n0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr11l8 fyvr11m4 fyvr12g fyvr11wr fyvr14w",dwe="_10c8o0n3 _10c8o0n2 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr130x fyvr130r fyvr12g fyvr164 fyvr12zf fyvr11m4 fyvr11sl fyvr11rc fyvr12wf",hwe="_10c8o0n5 _10c8o0n4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11lw fyvr1m0 fyvr1qg fyvr14k fyvr11y3 fyvr130f";const pwe=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return Y.jsxs(lwe,{className:uwe,style:{outline:void 0},children:[Y.jsx(xe,{display:"flex",position:"absolute",inset:"2",height:"8",children:Y.jsx("div",{className:hwe,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>Y.jsx(fwe,{className:dwe,value:s.value,children:Y.jsx(Ge,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},vwe=cwe,qB=mK;var gwe="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11r3 fyvr11ig fyvr11k4 fyvr11k0 fyvr11jk _1ppqbnx0 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zc fyvr111g fyvr1v0 fyvr1x4 fyvr11lk fyvr11cc fyvr11rh";D.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return Y.jsxs(xe,{className:gwe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(Ge,{children:n})]})});var UP="ToastProvider",[$P,ywe,mwe]=W4("Toast"),[xK,xUe]=Fs("Toast",[mwe]),[bwe,o8]=xK(UP),EK=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,c]=D.useState(null),[l,f]=D.useState(0),u=D.useRef(!1),p=D.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${UP}\`. Expected non-empty \`string\`.`),Y.jsx($P.Provider,{scope:e,children:Y.jsx(bwe,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:D.useCallback(()=>f(g=>g+1),[]),onToastRemove:D.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:p,children:o})})};EK.displayName=UP;var CK="ToastViewport",wwe=["F8"],P7="toast.viewportPause",k7="toast.viewportResume",AK=D.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=wwe,label:i="Notifications ({hotkey})",...s}=t,o=o8(CK,r),a=ywe(r),c=D.useRef(null),l=D.useRef(null),f=D.useRef(null),u=D.useRef(null),p=kr(e,u,o.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;D.useEffect(()=>{const I=C=>{var S;n.every(L=>C[L]||C.code===L)&&((S=u.current)==null||S.focus())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[n]),D.useEffect(()=>{const I=c.current,C=u.current;if(y&&I&&C){const S=()=>{if(!o.isClosePausedRef.current){const z=new CustomEvent(P7);C.dispatchEvent(z),o.isClosePausedRef.current=!0}},O=()=>{if(o.isClosePausedRef.current){const z=new CustomEvent(k7);C.dispatchEvent(z),o.isClosePausedRef.current=!1}},L=z=>{!I.contains(z.relatedTarget)&&O()},F=()=>{I.contains(document.activeElement)||O()};return I.addEventListener("focusin",S),I.addEventListener("focusout",L),I.addEventListener("pointermove",S),I.addEventListener("pointerleave",F),window.addEventListener("blur",S),window.addEventListener("focus",O),()=>{I.removeEventListener("focusin",S),I.removeEventListener("focusout",L),I.removeEventListener("pointermove",S),I.removeEventListener("pointerleave",F),window.removeEventListener("blur",S),window.removeEventListener("focus",O)}}},[y,o.isClosePausedRef]);const b=D.useCallback(({tabbingDirection:I})=>{const S=a().map(O=>{const L=O.ref.current,F=[L,...Dwe(L)];return I==="forwards"?F:F.reverse()});return(I==="forwards"?S.reverse():S).flat()},[a]);return D.useEffect(()=>{const I=u.current;if(I){const C=S=>{var O,L,F;const z=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!z){const $=document.activeElement,ie=S.shiftKey;if(S.target===I&&ie){(O=l.current)==null||O.focus();return}const P=b({tabbingDirection:ie?"backwards":"forwards"}),M=P.findIndex(v=>v===$);HA(P.slice(M+1))?S.preventDefault():ie?(L=l.current)==null||L.focus():(F=f.current)==null||F.focus()}};return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)}},[a,b]),Y.jsxs(x1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&Y.jsx(M7,{ref:l,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"forwards"});HA(I)}}),Y.jsx($P.Slot,{scope:r,children:Y.jsx(jt.ol,{tabIndex:-1,...s,ref:p})}),y&&Y.jsx(M7,{ref:f,onFocusFromOutsideViewport:()=>{const I=b({tabbingDirection:"backwards"});HA(I)}})]})});AK.displayName=CK;var SK="ToastFocusProxy",M7=D.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=o8(SK,r);return Y.jsx(fx,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var a;const c=o.relatedTarget;!((a=s.viewport)!=null&&a.contains(c))&&n()}})});M7.displayName=SK;var a8="Toast",xwe="toast.swipeStart",Ewe="toast.swipeMove",Cwe="toast.swipeCancel",Awe="toast.swipeEnd",_K=D.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=t,[a=!0,c]=Za({prop:n,defaultProp:i,onChange:s});return Y.jsx(oo,{present:r||a,children:Y.jsx(Iwe,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Bs(t.onPause),onResume:Bs(t.onResume),onSwipeStart:ot(t.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ot(t.onSwipeMove,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:ot(t.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ot(t.onSwipeEnd,l=>{const{x:f,y:u}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});_K.displayName=a8;var[Swe,_we]=xK(a8,{onClose(){}}),Iwe=D.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:p,onSwipeEnd:g,...y}=t,b=o8(a8,r),[I,C]=D.useState(null),S=kr(e,v=>C(v)),O=D.useRef(null),L=D.useRef(null),F=i||b.duration,z=D.useRef(0),_=D.useRef(F),$=D.useRef(0),{onToastAdd:ie,onToastRemove:ce}=b,K=Bs(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),P=D.useCallback(v=>{!v||v===1/0||(window.clearTimeout($.current),z.current=new Date().getTime(),$.current=window.setTimeout(K,v))},[K]);D.useEffect(()=>{const v=b.viewport;if(v){const m=()=>{P(_.current),l==null||l()},R=()=>{const B=new Date().getTime()-z.current;_.current=_.current-B,window.clearTimeout($.current),c==null||c()};return v.addEventListener(P7,R),v.addEventListener(k7,m),()=>{v.removeEventListener(P7,R),v.removeEventListener(k7,m)}}},[b.viewport,F,c,l,P]),D.useEffect(()=>{s&&!b.isClosePausedRef.current&&P(F)},[s,F,b.isClosePausedRef,P]),D.useEffect(()=>(ie(),()=>ce()),[ie,ce]);const M=D.useMemo(()=>I?RK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[M&&Y.jsx(Twe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:M}),Y.jsx(Swe,{scope:r,onClose:K,children:wh.createPortal(Y.jsx($P.ItemSlot,{scope:r,children:Y.jsx(w1e,{asChild:!0,onEscapeKeyDown:ot(a,()=>{b.isFocusedToastEscapeKeyDownRef.current||K(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:Y.jsx(jt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":b.swipeDirection,...y,ref:S,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ot(t.onKeyDown,v=>{v.key==="Escape"&&(a==null||a(v.nativeEvent),v.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:ot(t.onPointerDown,v=>{v.button===0&&(O.current={x:v.clientX,y:v.clientY})}),onPointerMove:ot(t.onPointerMove,v=>{if(!O.current)return;const m=v.clientX-O.current.x,R=v.clientY-O.current.y,B=!!L.current,E=["left","right"].includes(b.swipeDirection),x=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=E?x(0,m):0,T=E?0:x(0,R),k=v.pointerType==="touch"?10:2,H={x:w,y:T},oe={originalEvent:v,delta:H};B?(L.current=H,n6(Ewe,u,oe,{discrete:!1})):VB(H,b.swipeDirection,k)?(L.current=H,n6(xwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>k||Math.abs(R)>k)&&(O.current=null)}),onPointerUp:ot(t.onPointerUp,v=>{const m=L.current,R=v.target;if(R.hasPointerCapture(v.pointerId)&&R.releasePointerCapture(v.pointerId),L.current=null,O.current=null,m){const B=v.currentTarget,E={originalEvent:v,delta:m};VB(m,b.swipeDirection,b.swipeThreshold)?n6(Awe,g,E,{discrete:!0}):n6(Cwe,p,E,{discrete:!0}),B.addEventListener("click",x=>x.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),Twe=t=>{const{__scopeToast:e,children:r,...n}=t,i=o8(a8,e),[s,o]=D.useState(!1),[a,c]=D.useState(!1);return Rwe(()=>o(!0)),D.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:Y.jsx(ax,{asChild:!0,children:Y.jsx(fx,{...n,children:s&&Y.jsxs(Y.Fragment,{children:[i.label," ",r]})})})},Pwe="ToastTitle",IK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});IK.displayName=Pwe;var kwe="ToastDescription",TK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});TK.displayName=kwe;var PK="ToastAction",Mwe=D.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(MK,{altText:r,asChild:!0,children:Y.jsx(qP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${PK}\`. Expected non-empty \`string\`.`),null)});Mwe.displayName=PK;var kK="ToastClose",qP=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=_we(kK,r);return Y.jsx(MK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,i.onClose)})})});qP.displayName=kK;var MK=D.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return Y.jsx(jt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function RK(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Owe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...RK(n))}}),e}function n6(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?KT(i,s):i.dispatchEvent(s)}var VB=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Rwe(t=()=>{}){const e=Bs(t);os(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Owe(t){return t.nodeType===t.ELEMENT_NODE}function Dwe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function HA(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Nwe=EK,Bwe=AK,Lwe=_K,Fwe=IK,jwe=TK,Uwe=qP,$we="_6wut8v1 _6wut8v0 fyvr130x fyvr130r fyvr11m0 fyvr1so fyvr1o8 fyvr12g fyvr11cg fyvr11mc fyvr11l8",qwe=jn({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});const OK=D.createContext(null),Vwe=t=>{const{children:e,...r}=t,[n,i]=D.useState(new Set);return Y.jsxs(Nwe,{...r,children:[Y.jsxs(OK.Provider,{value:i,children:[e,Y.jsx(_H,{children:Array.from(n).map(s=>Y.jsx(Hwe,{...s},s.id))})]}),Y.jsx(zwe,{})]})},zwe=()=>Y.jsx(Bwe,{className:$we}),Hwe=t=>{const{id:e,variant:r,title:n,description:i,icon:s,isDismissible:o=!0,...a}=t,c=()=>{if(s)return Y.jsx(s,{});switch(r){case"success":return Y.jsx(xe,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(QT,{})});case"error":return Y.jsx(xe,{background:"negative",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(zg,{})});default:return null}};return Y.jsx(Lwe,{className:qwe({variant:r}),open:!0,forceMount:!0,asChild:!0,...a,children:Y.jsxs(qr,{as:cp.li,layoutId:e,layout:!0,initial:{x:"100%"},animate:{x:0},exit:{y:"100%",opacity:0},borderRadius:"md",background:"buttonGlass",backdropFilter:"blur",position:"relative",width:"full",justifyContent:"space-between",children:[Y.jsxs(xe,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(xe,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Fwe,{children:Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(jwe,{children:Y.jsx(Ge,{as:"div",variant:"normal",fontWeight:"medium",color:"text50",children:i})})]})]}),o&&Y.jsx(Uwe,{"aria-label":"Close",asChild:!0,children:Y.jsx(gu,{icon:zg,size:"xs"})})]})})},c8=()=>{const t=D.useContext(OK);return e=>{const r={...e,id:Math.random().toString(36).slice(2,12),onOpenChange:n=>{n||t(i=>(i.delete(r),new Set([...i])))}};t(n=>new Set([...n,r]))}};var Gwe="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11r3 fyvr11io fyvr11k8 fyvr11k0 fyvr11j8 _15pztn0 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11ow fyvr11sl fyvr12w9 fyvr12s9 fyvr130r fyvr12g fyvr11l8",Wwe="_15pztn2";const Kwe=D.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:f,rows:u,resize:p=!1,...g}=t;return Y.jsx(Vp,{description:s,disabled:o,display:"grid",id:a??f,label:c,labelLocation:l,children:Y.jsx(xe,{as:r,autoComplete:n,spellCheck:"false",className:pi(Gwe,p&&Wwe),disabled:o,id:a??f,name:f,ref:e,rows:u,borderRadius:i,...g})})});var Ywe=jn({defaultClassName:"_18h918k5 _18h918k0 fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11l8",variantClassNames:{size:{xs:"_18h918k6",sm:"_18h918k7",md:"_18h918k8",lg:"_18h918k9",xl:"_18h918ka"},borderRadius:{circle:"_18h918kb _18h918k1 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw",lg:"_18h918kc _18h918k2 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs",md:"_18h918kd _18h918k3 fyvr11hc fyvr11i0 fyvr11g0 fyvr11go",sm:"_18h918ke _18h918k4 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk"}},defaultVariants:{},compoundVariants:[]}),Qwe="_18h918kf";const Jwe=D.memo(t=>{const{chainId:e,borderRadius:r="circle",className:n,disableAnimation:i=!1,style:s,src:o,size:a="md",...c}=t,l=o||ppe(vpe(e),a);return Y.jsx(xe,{className:pi(n,Ywe({borderRadius:r,size:a})),style:s,flexShrink:"0",...c,children:Y.jsx(r8,{className:Qwe,disableAnimation:i,src:l})})});var Zwe=jn({defaultClassName:"bnrreb1 bnrreb0 fyvr11no fyvr11ow fyvr11m4 fyvr11l8",variantClassNames:{size:{xs:"bnrreb2",sm:"bnrreb3",md:"bnrreb4",lg:"bnrreb5",xl:"bnrreb6"}},defaultVariants:{},compoundVariants:[]}),Xwe="bnrreb7",exe="bnrreb9 bnrreb8 fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr11q0 fyvr11qg fyvr11no fyvr11ow fyvr11wr fyvr12g fyvr164 fyvr11l8",zB="bnrreba";const HB="40%",GB="-2%";D.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",withNetwork:c,...l}=t;return Y.jsxs(xe,{className:pi(r,Zwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(r8,{className:pi(Xwe,c&&zB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(Ge,{className:pi(exe,c&&zB),variant:"normal",fontWeight:"medium",color:"text50",borderRadius:e,overflow:"hidden",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)}),c&&Y.jsx(Jwe,{chainId:c,position:"absolute",zIndex:"1",disableAnimation:n,style:{width:HB,height:HB,right:GB,bottom:GB}})]})});var[l8,EUe]=Fs("Tooltip",[my]),f8=my(),DK="TooltipProvider",txe=700,R7="tooltip.open",[rxe,VP]=l8(DK),nxe=t=>{const{__scopeTooltip:e,delayDuration:r=txe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=D.useState(!0),c=D.useRef(!1),l=D.useRef(0);return D.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),Y.jsx(rxe,{scope:e,isOpenDelayed:o,delayDuration:r,onOpen:D.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:D.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:D.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:s})};nxe.displayName=DK;var u8="Tooltip",[ixe,dx]=l8(u8),sxe=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=VP(u8,t.__scopeTooltip),l=f8(e),[f,u]=D.useState(null),p=Wa(),g=D.useRef(0),y=o??c.disableHoverableContent,b=a??c.delayDuration,I=D.useRef(!1),[C=!1,S]=Za({prop:n,defaultProp:i,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(R7))):c.onClose(),s==null||s(_)}}),O=D.useMemo(()=>C?I.current?"delayed-open":"instant-open":"closed",[C]),L=D.useCallback(()=>{window.clearTimeout(g.current),I.current=!1,S(!0)},[S]),F=D.useCallback(()=>{window.clearTimeout(g.current),S(!1)},[S]),z=D.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{I.current=!0,S(!0)},b)},[b,S]);return D.useEffect(()=>()=>window.clearTimeout(g.current),[]),Y.jsx(uP,{...l,children:Y.jsx(ixe,{scope:e,contentId:p,open:C,stateAttribute:O,trigger:f,onTriggerChange:u,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayed?z():L()},[c.isOpenDelayed,z,L]),onTriggerLeave:D.useCallback(()=>{y?F():window.clearTimeout(g.current)},[F,y]),onOpen:L,onClose:F,disableHoverableContent:y,children:r})})};sxe.displayName=u8;var O7="TooltipTrigger",oxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=dx(O7,r),s=VP(O7,r),o=f8(r),a=D.useRef(null),c=kr(e,a,i.onTriggerChange),l=D.useRef(!1),f=D.useRef(!1),u=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),Y.jsx(dP,{asChild:!0,...o,children:Y.jsx(jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:ot(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:ot(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:ot(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ot(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ot(t.onBlur,i.onClose),onClick:ot(t.onClick,i.onClose)})})});oxe.displayName=O7;var zP="TooltipPortal",[axe,cxe]=l8(zP,{forceMount:void 0}),lxe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=dx(zP,e);return Y.jsx(axe,{scope:e,forceMount:r,children:Y.jsx(oo,{present:r||s.open,children:Y.jsx(ax,{asChild:!0,container:i,children:n})})})};lxe.displayName=zP;var Gg="TooltipContent",fxe=D.forwardRef((t,e)=>{const r=cxe(Gg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,o=dx(Gg,t.__scopeTooltip);return Y.jsx(oo,{present:n||o.open,children:o.disableHoverableContent?Y.jsx(NK,{side:i,...s,ref:e}):Y.jsx(uxe,{side:i,...s,ref:e})})}),uxe=D.forwardRef((t,e)=>{const r=dx(Gg,t.__scopeTooltip),n=VP(Gg,t.__scopeTooltip),i=D.useRef(null),s=kr(e,i),[o,a]=D.useState(null),{trigger:c,onClose:l}=r,f=i.current,{onPointerInTransitChange:u}=n,p=D.useCallback(()=>{a(null),u(!1)},[u]),g=D.useCallback((y,b)=>{const I=y.currentTarget,C={x:y.clientX,y:y.clientY},S=vxe(C,I.getBoundingClientRect()),O=gxe(C,S),L=yxe(b.getBoundingClientRect()),F=bxe([...O,...L]);a(F),u(!0)},[u]);return D.useEffect(()=>()=>p(),[p]),D.useEffect(()=>{if(c&&f){const y=I=>g(I,f),b=I=>g(I,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",b)}}},[c,f,g,p]),D.useEffect(()=>{if(o){const y=b=>{const I=b.target,C={x:b.clientX,y:b.clientY},S=(c==null?void 0:c.contains(I))||(f==null?void 0:f.contains(I)),O=!mxe(C,o);S?p():O&&(p(),l())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,o,l,p]),Y.jsx(NK,{...t,ref:s})}),[dxe,hxe]=l8(u8,{isInside:!1}),NK=D.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=dx(Gg,r),l=f8(r),{onClose:f}=c;return D.useEffect(()=>(document.addEventListener(R7,f),()=>document.removeEventListener(R7,f)),[f]),D.useEffect(()=>{if(c.trigger){const u=p=>{const g=p.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,f]),Y.jsx(vy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:Y.jsxs(hP,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Y.jsx(RH,{children:n}),Y.jsx(dxe,{scope:r,isInside:!0,children:Y.jsx(hbe,{id:c.contentId,role:"tooltip",children:i||n})})]})})});fxe.displayName=Gg;var BK="TooltipArrow",pxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=f8(r);return hxe(BK,r).isInside?null:Y.jsx(pP,{...i,...n,ref:e})});pxe.displayName=BK;function vxe(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function gxe(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function yxe(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function mxe(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,o=e.length-1;sn!=f>n&&r<(l-a)*(n-c)/(f-c)+a&&(i=!i)}return i}function bxe(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),wxe(e)}function wxe(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const HP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${oB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${oB.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=D.useState(()=>i?window.matchMedia(n).matches:s);return D.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),f=()=>{c&&a(l.matches)};return f(),l.addListener(f),()=>{c=!1,l.removeListener(f)}},[n,i]),o};var D7={},WB=wh;D7.createRoot=WB.createRoot,D7.hydrateRoot=WB.hydrateRoot;var LK={exports:{}},cn={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Vi=typeof Symbol=="function"&&Symbol.for,YP=Vi?Symbol.for("react.element"):60103,QP=Vi?Symbol.for("react.portal"):60106,y8=Vi?Symbol.for("react.fragment"):60107,m8=Vi?Symbol.for("react.strict_mode"):60108,b8=Vi?Symbol.for("react.profiler"):60114,w8=Vi?Symbol.for("react.provider"):60109,x8=Vi?Symbol.for("react.context"):60110,JP=Vi?Symbol.for("react.async_mode"):60111,E8=Vi?Symbol.for("react.concurrent_mode"):60111,C8=Vi?Symbol.for("react.forward_ref"):60112,A8=Vi?Symbol.for("react.suspense"):60113,xxe=Vi?Symbol.for("react.suspense_list"):60120,S8=Vi?Symbol.for("react.memo"):60115,_8=Vi?Symbol.for("react.lazy"):60116,Exe=Vi?Symbol.for("react.block"):60121,Cxe=Vi?Symbol.for("react.fundamental"):60117,Axe=Vi?Symbol.for("react.responder"):60118,Sxe=Vi?Symbol.for("react.scope"):60119;function ma(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case YP:switch(t=t.type,t){case JP:case E8:case y8:case b8:case m8:case A8:return t;default:switch(t=t&&t.$$typeof,t){case x8:case C8:case _8:case S8:case w8:return t;default:return e}}case QP:return e}}}function $K(t){return ma(t)===E8}on.AsyncMode=JP;on.ConcurrentMode=E8;on.ContextConsumer=x8;on.ContextProvider=w8;on.Element=YP;on.ForwardRef=C8;on.Fragment=y8;on.Lazy=_8;on.Memo=S8;on.Portal=QP;on.Profiler=b8;on.StrictMode=m8;on.Suspense=A8;on.isAsyncMode=function(t){return $K(t)||ma(t)===JP};on.isConcurrentMode=$K;on.isContextConsumer=function(t){return ma(t)===x8};on.isContextProvider=function(t){return ma(t)===w8};on.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===YP};on.isForwardRef=function(t){return ma(t)===C8};on.isFragment=function(t){return ma(t)===y8};on.isLazy=function(t){return ma(t)===_8};on.isMemo=function(t){return ma(t)===S8};on.isPortal=function(t){return ma(t)===QP};on.isProfiler=function(t){return ma(t)===b8};on.isStrictMode=function(t){return ma(t)===m8};on.isSuspense=function(t){return ma(t)===A8};on.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===y8||t===E8||t===b8||t===m8||t===A8||t===xxe||typeof t=="object"&&t!==null&&(t.$$typeof===_8||t.$$typeof===S8||t.$$typeof===w8||t.$$typeof===x8||t.$$typeof===C8||t.$$typeof===Cxe||t.$$typeof===Axe||t.$$typeof===Sxe||t.$$typeof===Exe)};on.typeOf=ma;UK.exports=on;var _xe=UK.exports,qK=_xe,Ixe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Txe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},VK={};VK[qK.ForwardRef]=Ixe;VK[qK.Memo]=Txe;function F7(){return F7=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(r=Pxe(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return r=t[Symbol.iterator](),r.next.bind(r)}var ZB,kxe=function(){function t(){this._plugins=[]}var e=t.prototype;return e.use=function(n){this._plugins.push(n)},e.onCreate=function(n,i){this._plugins.forEach(function(s){return s.onCreate==null?void 0:s.onCreate(n,i)})},e.onChange=function(n,i,s){this._plugins.forEach(function(o){return o.onChange==null?void 0:o.onChange(n,i,s)})},e.onBecomeObserved=function(n){this._plugins.forEach(function(i){return i.onBecomeObserved==null?void 0:i.onBecomeObserved(n)})},e.onBecomeUnobserved=function(n){this._plugins.forEach(function(i){return i.onBecomeUnobserved==null?void 0:i.onBecomeUnobserved(n)})},e.onAttach=function(n,i){this._plugins.forEach(function(s){return s.onAttach==null?void 0:s.onAttach(n,i)})},e.onDetach=function(n,i){this._plugins.forEach(function(s){return s.onDetach==null?void 0:s.onDetach(n,i)})},t}(),l6=Symbol(),n0=new kxe,f6=[],Cm=!1,YA=[],u6=0,n3=function(){function t(r,n){n===void 0&&(n={}),this._prevVal=l6,this._inputs=[],this._outputs=[],this._listeners=[],this._attachedToInputs=!1,this.onChange=this.subscribe,this._val=r,this._options=n,n0.onCreate(this,r)}var e=t.prototype;return e.get=function(){var n=f6[f6.length-1];if(n&&Cm)try{return Cm=!1,n.push(this),this._get()}finally{Cm=!0}else return this._get()},e._get=function(){var n=!this._attachedToInputs||this._prevVal!==l6;return n?this._evaluate():this._val},e._evaluate=function(){return this._val},e._set=function(n){this._val!==n&&(this._addToBatchRecursively(),this._val=n)},e.subscribe=function(n){var i=this;this._listeners.push(n),this._attachToInputs();var s=!1;return function(){s||(s=!0,i._listeners.splice(i._listeners.indexOf(n),1),i._detachFromInputs())}},e.onBecomeObserved=function(){},e.onBecomeUnobserved=function(){},e.getInputs=function(){return this._inputs},e.getOptions=function(){return this._options},e.withOptions=function(n){return this._options=F7({},this._options,n),this},t._captureInputs=function(n){try{var i=[];return f6.push(i),Cm=!0,n(),i}finally{f6.pop(),Cm=!1}},e._addInput=function(n){this._inputs.push(n),this._attachedToInputs&&this._attachToInput(n)},e._removeInput=function(n){this._inputs.splice(this._inputs.indexOf(n),1),this._attachedToInputs&&this._detachFromInput(n)},e._shouldAttachToInputs=function(){return this._listeners.length>0||this._outputs.length>0},e._attachToInputs=function(){if(!this._attachedToInputs&&this._shouldAttachToInputs()){this._attachedToInputs=!0,this._val=this._evaluate(),this.onBecomeObserved(),n0.onBecomeObserved(this);for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._attachToInput(s),s._attachToInputs()}}},e._detachFromInputs=function(){if(this._attachedToInputs&&!this._shouldAttachToInputs()){this._attachedToInputs=!1;for(var n=Ym(this._inputs),i;!(i=n()).done;){var s=i.value;this._detachFromInput(s),s._detachFromInputs()}this.onBecomeUnobserved(),n0.onBecomeUnobserved(this)}},e._attachToInput=function(n){n._outputs.push(this),n0.onAttach(this,n)},e._detachFromInput=function(n){n._outputs.splice(n._outputs.indexOf(this),1),n0.onDetach(this,n)},e._addToBatchRecursively=function(){if(this._prevVal===l6){this._prevVal=this._val;for(var n=Ym(this._outputs),i;!(i=n()).done;){var s=i.value;s._addToBatchRecursively()}YA.push(this)}},t._batch=function(n){try{u6++,u6===1&&ZB?ZB(n):n()}finally{if(u6--,u6===0){var i=YA;YA=[];for(var s=i.length-1;s>=0;s--){var o=i[s],a=o._prevVal;o._prevVal=l6,o._val=o._evaluate();var c=o._val;if(c!==a){for(var l=Ym(o._listeners.slice()),f;!(f=l()).done;){var u=f.value;u(c,a)}n0.onChange(o,c,a)}}}}},t._use=function(n){n0.use(n)},t}();function Mxe(t){var e,r;return function(n){var i=!1;if(!e||n.length!==e.length)i=!0;else for(var s=0;snew Dxe,zK=D.createContext(null),Bxe=({store:t,children:e})=>W.jsx(zK.Provider,{value:t,children:e});function Ir(t){const e=D.useContext(zK);if(!e)throw new Error("store cannot be null! check your ");return e.get(t)}/** + */var Ui=typeof Symbol=="function"&&Symbol.for,GP=Ui?Symbol.for("react.element"):60103,WP=Ui?Symbol.for("react.portal"):60106,d8=Ui?Symbol.for("react.fragment"):60107,h8=Ui?Symbol.for("react.strict_mode"):60108,p8=Ui?Symbol.for("react.profiler"):60114,v8=Ui?Symbol.for("react.provider"):60109,g8=Ui?Symbol.for("react.context"):60110,KP=Ui?Symbol.for("react.async_mode"):60111,y8=Ui?Symbol.for("react.concurrent_mode"):60111,m8=Ui?Symbol.for("react.forward_ref"):60112,b8=Ui?Symbol.for("react.suspense"):60113,xxe=Ui?Symbol.for("react.suspense_list"):60120,w8=Ui?Symbol.for("react.memo"):60115,x8=Ui?Symbol.for("react.lazy"):60116,Exe=Ui?Symbol.for("react.block"):60121,Cxe=Ui?Symbol.for("react.fundamental"):60117,Axe=Ui?Symbol.for("react.responder"):60118,Sxe=Ui?Symbol.for("react.scope"):60119;function pa(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case GP:switch(t=t.type,t){case KP:case y8:case d8:case p8:case h8:case b8:return t;default:switch(t=t&&t.$$typeof,t){case g8:case m8:case x8:case w8:case v8:return t;default:return e}}case WP:return e}}}function FK(t){return pa(t)===y8}cn.AsyncMode=KP;cn.ConcurrentMode=y8;cn.ContextConsumer=g8;cn.ContextProvider=v8;cn.Element=GP;cn.ForwardRef=m8;cn.Fragment=d8;cn.Lazy=x8;cn.Memo=w8;cn.Portal=WP;cn.Profiler=p8;cn.StrictMode=h8;cn.Suspense=b8;cn.isAsyncMode=function(t){return FK(t)||pa(t)===KP};cn.isConcurrentMode=FK;cn.isContextConsumer=function(t){return pa(t)===g8};cn.isContextProvider=function(t){return pa(t)===v8};cn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===GP};cn.isForwardRef=function(t){return pa(t)===m8};cn.isFragment=function(t){return pa(t)===d8};cn.isLazy=function(t){return pa(t)===x8};cn.isMemo=function(t){return pa(t)===w8};cn.isPortal=function(t){return pa(t)===WP};cn.isProfiler=function(t){return pa(t)===p8};cn.isStrictMode=function(t){return pa(t)===h8};cn.isSuspense=function(t){return pa(t)===b8};cn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===d8||t===y8||t===p8||t===h8||t===b8||t===xxe||typeof t=="object"&&t!==null&&(t.$$typeof===x8||t.$$typeof===w8||t.$$typeof===v8||t.$$typeof===g8||t.$$typeof===m8||t.$$typeof===Cxe||t.$$typeof===Axe||t.$$typeof===Sxe||t.$$typeof===Exe)};cn.typeOf=pa;LK.exports=cn;var _xe=LK.exports,jK=_xe,Ixe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Txe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},UK={};UK[jK.ForwardRef]=Ixe;UK[jK.Memo]=Txe;function N7(){return N7=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(r=Pxe(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return r=t[Symbol.iterator](),r.next.bind(r)}var YB,kxe=function(){function t(){this._plugins=[]}var e=t.prototype;return e.use=function(n){this._plugins.push(n)},e.onCreate=function(n,i){this._plugins.forEach(function(s){return s.onCreate==null?void 0:s.onCreate(n,i)})},e.onChange=function(n,i,s){this._plugins.forEach(function(o){return o.onChange==null?void 0:o.onChange(n,i,s)})},e.onBecomeObserved=function(n){this._plugins.forEach(function(i){return i.onBecomeObserved==null?void 0:i.onBecomeObserved(n)})},e.onBecomeUnobserved=function(n){this._plugins.forEach(function(i){return i.onBecomeUnobserved==null?void 0:i.onBecomeUnobserved(n)})},e.onAttach=function(n,i){this._plugins.forEach(function(s){return s.onAttach==null?void 0:s.onAttach(n,i)})},e.onDetach=function(n,i){this._plugins.forEach(function(s){return s.onDetach==null?void 0:s.onDetach(n,i)})},t}(),i6=Symbol(),n0=new kxe,s6=[],Em=!1,GA=[],o6=0,Z6=function(){function t(r,n){n===void 0&&(n={}),this._prevVal=i6,this._inputs=[],this._outputs=[],this._listeners=[],this._attachedToInputs=!1,this.onChange=this.subscribe,this._val=r,this._options=n,n0.onCreate(this,r)}var e=t.prototype;return e.get=function(){var n=s6[s6.length-1];if(n&&Em)try{return Em=!1,n.push(this),this._get()}finally{Em=!0}else return this._get()},e._get=function(){var n=!this._attachedToInputs||this._prevVal!==i6;return n?this._evaluate():this._val},e._evaluate=function(){return this._val},e._set=function(n){this._val!==n&&(this._addToBatchRecursively(),this._val=n)},e.subscribe=function(n){var i=this;this._listeners.push(n),this._attachToInputs();var s=!1;return function(){s||(s=!0,i._listeners.splice(i._listeners.indexOf(n),1),i._detachFromInputs())}},e.onBecomeObserved=function(){},e.onBecomeUnobserved=function(){},e.getInputs=function(){return this._inputs},e.getOptions=function(){return this._options},e.withOptions=function(n){return this._options=N7({},this._options,n),this},t._captureInputs=function(n){try{var i=[];return s6.push(i),Em=!0,n(),i}finally{s6.pop(),Em=!1}},e._addInput=function(n){this._inputs.push(n),this._attachedToInputs&&this._attachToInput(n)},e._removeInput=function(n){this._inputs.splice(this._inputs.indexOf(n),1),this._attachedToInputs&&this._detachFromInput(n)},e._shouldAttachToInputs=function(){return this._listeners.length>0||this._outputs.length>0},e._attachToInputs=function(){if(!this._attachedToInputs&&this._shouldAttachToInputs()){this._attachedToInputs=!0,this._val=this._evaluate(),this.onBecomeObserved(),n0.onBecomeObserved(this);for(var n=Km(this._inputs),i;!(i=n()).done;){var s=i.value;this._attachToInput(s),s._attachToInputs()}}},e._detachFromInputs=function(){if(this._attachedToInputs&&!this._shouldAttachToInputs()){this._attachedToInputs=!1;for(var n=Km(this._inputs),i;!(i=n()).done;){var s=i.value;this._detachFromInput(s),s._detachFromInputs()}this.onBecomeUnobserved(),n0.onBecomeUnobserved(this)}},e._attachToInput=function(n){n._outputs.push(this),n0.onAttach(this,n)},e._detachFromInput=function(n){n._outputs.splice(n._outputs.indexOf(this),1),n0.onDetach(this,n)},e._addToBatchRecursively=function(){if(this._prevVal===i6){this._prevVal=this._val;for(var n=Km(this._outputs),i;!(i=n()).done;){var s=i.value;s._addToBatchRecursively()}GA.push(this)}},t._batch=function(n){try{o6++,o6===1&&YB?YB(n):n()}finally{if(o6--,o6===0){var i=GA;GA=[];for(var s=i.length-1;s>=0;s--){var o=i[s],a=o._prevVal;o._prevVal=i6,o._val=o._evaluate();var c=o._val;if(c!==a){for(var l=Km(o._listeners.slice()),f;!(f=l()).done;){var u=f.value;u(c,a)}n0.onChange(o,c,a)}}}}},t._use=function(n){n0.use(n)},t}();function Mxe(t){var e,r;return function(n){var i=!1;if(!e||n.length!==e.length)i=!0;else for(var s=0;snew Dxe,$K=D.createContext(null),Bxe=({store:t,children:e})=>W.jsx($K.Provider,{value:t,children:e});function Pr(t){const e=D.useContext($K);if(!e)throw new Error("store cannot be null! check your ");return e.get(t)}/** * @remix-run/router v1.19.1 * * Copyright (c) Remix Software Inc. @@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function dw(){return dw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function HK(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Fxe(){return Math.random().toString(36).substr(2,8)}function eL(t,e){return{usr:t.state,key:t.key,idx:e}}function j7(t,e,r,n){return r===void 0&&(r=null),dw({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?wy(e):e,{state:r,key:e&&e.key||n||Fxe()})}function _5(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function wy(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function jxe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Bd.Pop,c=null,l=f();l==null&&(l=0,o.replaceState(dw({},o.state,{idx:l}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Bd.Pop;let I=f(),C=I==null?null:I-l;l=I,c&&c({action:a,location:b.location,delta:C})}function p(I,C){a=Bd.Push;let S=j7(b.location,I,C);l=f()+1;let O=eL(S,l),L=b.createHref(S);try{o.pushState(O,"",L)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;i.location.assign(L)}s&&c&&c({action:a,location:b.location,delta:1})}function g(I,C){a=Bd.Replace;let S=j7(b.location,I,C);l=f();let O=eL(S,l),L=b.createHref(S);o.replaceState(O,"",L),s&&c&&c({action:a,location:b.location,delta:0})}function y(I){let C=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof I=="string"?I:_5(I);return S=S.replace(/ $/,"%20"),fi(C,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,C)}let b={get action(){return a},get location(){return t(i,o)},listen(I){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(XB,u),c=I,()=>{i.removeEventListener(XB,u),c=null}},createHref(I){return e(i,I)},createURL:y,encodeLocation(I){let C=y(I);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(I){return o.go(I)}};return b}var tL;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(tL||(tL={}));function Uxe(t,e,r){return r===void 0&&(r="/"),$xe(t,e,r,!1)}function $xe(t,e,r,n){let i=typeof e=="string"?wy(e):e,s=ZP(i.pathname||"/",r);if(s==null)return null;let o=GK(t);qxe(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(fi(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let l=Yd([n,c.relativePath]),f=r.concat(c);s.children&&s.children.length>0&&(fi(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),GK(s.children,e,f,l)),!(s.path==null&&!s.index)&&e.push({path:l,score:Yxe(l,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of WK(s.path))i(s,o,c)}),e}function WK(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=WK(n.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function qxe(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Qxe(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Vxe=/^:[\w-]+$/,zxe=3,Hxe=2,Gxe=1,Wxe=10,Kxe=-2,rL=t=>t==="*";function Yxe(t,e){let r=t.split("/"),n=r.length;return r.some(rL)&&(n+=Kxe),e&&(n+=Hxe),r.filter(i=>!rL(i)).reduce((i,s)=>i+(Vxe.test(s)?zxe:s===""?Gxe:Wxe),n)}function Qxe(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function Jxe(t,e,r){let{routesMeta:n}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:g}=f;if(p==="*"){let b=a[u]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const y=a[u];return g&&!y?l[p]=void 0:l[p]=(y||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:o,pattern:t}}function Zxe(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),HK(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(n.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Xxe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return HK(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ZP(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function e2e(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?wy(t):t;return{pathname:r?r.startsWith("/")?r:t2e(r,e):e,search:i2e(n),hash:s2e(i)}}function t2e(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function QA(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function r2e(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function XP(t,e){let r=r2e(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ek(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=wy(t):(i=dw({},t),fi(!i.pathname||!i.pathname.includes("?"),QA("?","pathname","search",i)),fi(!i.pathname||!i.pathname.includes("#"),QA("#","pathname","hash",i)),fi(!i.search||!i.search.includes("#"),QA("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?e[u]:"/"}let c=e2e(i,a),l=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||f)&&(c.pathname+="/"),c}const Yd=t=>t.join("/").replace(/\/\/+/g,"/"),n2e=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),i2e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,s2e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function o2e(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const KK=["post","put","patch","delete"];new Set(KK);const a2e=["get",...KK];new Set(a2e);/** + */function uw(){return uw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function qK(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Fxe(){return Math.random().toString(36).substr(2,8)}function JB(t,e){return{usr:t.state,key:t.key,idx:e}}function B7(t,e,r,n){return r===void 0&&(r=null),uw({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?xy(e):e,{state:r,key:e&&e.key||n||Fxe()})}function x5(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function xy(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function jxe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,a=Dd.Pop,c=null,l=f();l==null&&(l=0,o.replaceState(uw({},o.state,{idx:l}),""));function f(){return(o.state||{idx:null}).idx}function u(){a=Dd.Pop;let I=f(),C=I==null?null:I-l;l=I,c&&c({action:a,location:b.location,delta:C})}function p(I,C){a=Dd.Push;let S=B7(b.location,I,C);l=f()+1;let O=JB(S,l),L=b.createHref(S);try{o.pushState(O,"",L)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;i.location.assign(L)}s&&c&&c({action:a,location:b.location,delta:1})}function g(I,C){a=Dd.Replace;let S=B7(b.location,I,C);l=f();let O=JB(S,l),L=b.createHref(S);o.replaceState(O,"",L),s&&c&&c({action:a,location:b.location,delta:0})}function y(I){let C=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof I=="string"?I:x5(I);return S=S.replace(/ $/,"%20"),ci(C,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,C)}let b={get action(){return a},get location(){return t(i,o)},listen(I){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(QB,u),c=I,()=>{i.removeEventListener(QB,u),c=null}},createHref(I){return e(i,I)},createURL:y,encodeLocation(I){let C=y(I);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(I){return o.go(I)}};return b}var ZB;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(ZB||(ZB={}));function Uxe(t,e,r){return r===void 0&&(r="/"),$xe(t,e,r,!1)}function $xe(t,e,r,n){let i=typeof e=="string"?xy(e):e,s=YP(i.pathname||"/",r);if(s==null)return null;let o=VK(t);qxe(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(ci(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let l=Wd([n,c.relativePath]),f=r.concat(c);s.children&&s.children.length>0&&(ci(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),VK(s.children,e,f,l)),!(s.path==null&&!s.index)&&e.push({path:l,score:Yxe(l,s.index),routesMeta:f})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of zK(s.path))i(s,o,c)}),e}function zK(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=zK(n.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function qxe(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Qxe(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Vxe=/^:[\w-]+$/,zxe=3,Hxe=2,Gxe=1,Wxe=10,Kxe=-2,XB=t=>t==="*";function Yxe(t,e){let r=t.split("/"),n=r.length;return r.some(XB)&&(n+=Kxe),e&&(n+=Hxe),r.filter(i=>!XB(i)).reduce((i,s)=>i+(Vxe.test(s)?zxe:s===""?Gxe:Wxe),n)}function Qxe(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function Jxe(t,e,r){let{routesMeta:n}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:g}=f;if(p==="*"){let b=a[u]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const y=a[u];return g&&!y?l[p]=void 0:l[p]=(y||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:o,pattern:t}}function Zxe(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),qK(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(n.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Xxe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return qK(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function YP(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function e2e(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?xy(t):t;return{pathname:r?r.startsWith("/")?r:t2e(r,e):e,search:i2e(n),hash:s2e(i)}}function t2e(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function WA(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function r2e(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function QP(t,e){let r=r2e(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function JP(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=xy(t):(i=uw({},t),ci(!i.pathname||!i.pathname.includes("?"),WA("?","pathname","search",i)),ci(!i.pathname||!i.pathname.includes("#"),WA("#","pathname","hash",i)),ci(!i.search||!i.search.includes("#"),WA("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=r;else{let u=e.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?e[u]:"/"}let c=e2e(i,a),l=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||f)&&(c.pathname+="/"),c}const Wd=t=>t.join("/").replace(/\/\/+/g,"/"),n2e=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),i2e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,s2e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function o2e(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const HK=["post","put","patch","delete"];new Set(HK);const a2e=["get",...HK];new Set(a2e);/** * React Router v6.26.1 * * Copyright (c) Remix Software Inc. @@ -133,7 +133,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function hw(){return hw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),D.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=ek(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Yd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function JK(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=D.useContext(Th),{matches:i}=D.useContext(Ph),{pathname:s}=px(),o=JSON.stringify(XP(i,n.v7_relativeSplatPath));return D.useMemo(()=>ek(t,JSON.parse(o),s,r==="path"),[t,o,s,r])}function u2e(t,e){return d2e(t,e)}function d2e(t,e,r,n){xy()||fi(!1);let{navigator:i}=D.useContext(Th),{matches:s}=D.useContext(Ph),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=px(),f;if(e){var u;let I=typeof e=="string"?wy(e):e;c==="/"||(u=I.pathname)!=null&&u.startsWith(c)||fi(!1),f=I}else f=l;let p=f.pathname||"/",g=p;if(c!=="/"){let I=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(I.length).join("/")}let y=Uxe(t,{pathname:g}),b=y2e(y&&y.map(I=>Object.assign({},I,{params:Object.assign({},a,I.params),pathname:Yd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Yd([c,i.encodeLocation?i.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),s,r,n);return e&&b?D.createElement(T8.Provider,{value:{location:hw({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Bd.Pop}},b):b}function h2e(){let t=x2e(),e=o2e(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),r?D.createElement("pre",{style:i},r):null,null)}const p2e=D.createElement(h2e,null);class v2e extends D.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?D.createElement(Ph.Provider,{value:this.props.routeContext},D.createElement(YK.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function g2e(t){let{routeContext:e,match:r,children:n}=t,i=D.useContext(tk);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),D.createElement(Ph.Provider,{value:e},n)}function y2e(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if(!r)return null;if(r.errors)t=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||fi(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,l=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((f,u,p)=>{let g,y=!1,b=null,I=null;r&&(g=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||p2e,c&&(l<0&&p===0?(y=!0,I=null):l===p&&(y=!0,I=u.route.hydrateFallbackElement||null)));let C=e.concat(o.slice(0,p+1)),S=()=>{let O;return g?O=b:y?O=I:u.route.Component?O=D.createElement(u.route.Component,null):u.route.element?O=u.route.element:O=f,D.createElement(g2e,{match:u,routeContext:{outlet:f,matches:C,isDataRoute:r!=null},children:O})};return r&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?D.createElement(v2e,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):S()},null)}var ZK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ZK||{}),I5=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(I5||{});function m2e(t){let e=D.useContext(tk);return e||fi(!1),e}function b2e(t){let e=D.useContext(c2e);return e||fi(!1),e}function w2e(t){let e=D.useContext(Ph);return e||fi(!1),e}function XK(t){let e=w2e(),r=e.matches[e.matches.length-1];return r.route.id||fi(!1),r.route.id}function x2e(){var t;let e=D.useContext(YK),r=b2e(I5.UseRouteError),n=XK(I5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function E2e(){let{router:t}=m2e(ZK.UseNavigateStable),e=XK(I5.UseNavigateStable),r=D.useRef(!1);return QK(()=>{r.current=!0}),D.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,hw({fromRouteId:e},s)))},[t,e])}function JA(t){let{to:e,replace:r,state:n,relative:i}=t;xy()||fi(!1);let{future:s,static:o}=D.useContext(Th),{matches:a}=D.useContext(Ph),{pathname:c}=px(),l=rk(),f=ek(e,XP(a,s.v7_relativeSplatPath),c,i==="path"),u=JSON.stringify(f);return D.useEffect(()=>l(JSON.parse(u),{replace:r,state:n,relative:i}),[l,u,i,r,n]),null}function i3(t){fi(!1)}function C2e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Bd.Pop,navigator:s,static:o=!1,future:a}=t;xy()&&fi(!1);let c=e.replace(/^\/*/,"/"),l=D.useMemo(()=>({basename:c,navigator:s,static:o,future:hw({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof n=="string"&&(n=wy(n));let{pathname:f="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,b=D.useMemo(()=>{let I=ZP(f,c);return I==null?null:{location:{pathname:I,search:u,hash:p,state:g,key:y},navigationType:i}},[c,f,u,p,g,y,i]);return b==null?null:D.createElement(Th.Provider,{value:l},D.createElement(T8.Provider,{children:r,value:b}))}function A2e(t){let{children:e,location:r}=t;return u2e(U7(e),r)}new Promise(()=>{});function U7(t,e){e===void 0&&(e=[]);let r=[];return D.Children.forEach(t,(n,i)=>{if(!D.isValidElement(n))return;let s=[...e,i];if(n.type===D.Fragment){r.push.apply(r,U7(n.props.children,s));return}n.type!==i3&&fi(!1),!n.props.index||!n.props.children||fi(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=U7(n.props.children,s)),r.push(o)}),r}/** + */function dw(){return dw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),D.useCallback(function(l,f){if(f===void 0&&(f={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=JP(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Wd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function KK(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=D.useContext(_h),{matches:i}=D.useContext(Ih),{pathname:s}=hx(),o=JSON.stringify(QP(i,n.v7_relativeSplatPath));return D.useMemo(()=>JP(t,JSON.parse(o),s,r==="path"),[t,o,s,r])}function u2e(t,e){return d2e(t,e)}function d2e(t,e,r,n){Ey()||ci(!1);let{navigator:i}=D.useContext(_h),{matches:s}=D.useContext(Ih),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=hx(),f;if(e){var u;let I=typeof e=="string"?xy(e):e;c==="/"||(u=I.pathname)!=null&&u.startsWith(c)||ci(!1),f=I}else f=l;let p=f.pathname||"/",g=p;if(c!=="/"){let I=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(I.length).join("/")}let y=Uxe(t,{pathname:g}),b=y2e(y&&y.map(I=>Object.assign({},I,{params:Object.assign({},a,I.params),pathname:Wd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Wd([c,i.encodeLocation?i.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),s,r,n);return e&&b?D.createElement(C8.Provider,{value:{location:dw({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Dd.Pop}},b):b}function h2e(){let t=x2e(),e=o2e(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),r?D.createElement("pre",{style:i},r):null,null)}const p2e=D.createElement(h2e,null);class v2e extends D.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?D.createElement(Ih.Provider,{value:this.props.routeContext},D.createElement(GK.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function g2e(t){let{routeContext:e,match:r,children:n}=t,i=D.useContext(ZP);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),D.createElement(Ih.Provider,{value:e},n)}function y2e(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var s;if(!r)return null;if(r.errors)t=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||ci(!1),o=o.slice(0,Math.min(o.length,f+1))}let c=!1,l=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((f,u,p)=>{let g,y=!1,b=null,I=null;r&&(g=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||p2e,c&&(l<0&&p===0?(y=!0,I=null):l===p&&(y=!0,I=u.route.hydrateFallbackElement||null)));let C=e.concat(o.slice(0,p+1)),S=()=>{let O;return g?O=b:y?O=I:u.route.Component?O=D.createElement(u.route.Component,null):u.route.element?O=u.route.element:O=f,D.createElement(g2e,{match:u,routeContext:{outlet:f,matches:C,isDataRoute:r!=null},children:O})};return r&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?D.createElement(v2e,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):S()},null)}var YK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(YK||{}),E5=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(E5||{});function m2e(t){let e=D.useContext(ZP);return e||ci(!1),e}function b2e(t){let e=D.useContext(c2e);return e||ci(!1),e}function w2e(t){let e=D.useContext(Ih);return e||ci(!1),e}function QK(t){let e=w2e(),r=e.matches[e.matches.length-1];return r.route.id||ci(!1),r.route.id}function x2e(){var t;let e=D.useContext(GK),r=b2e(E5.UseRouteError),n=QK(E5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function E2e(){let{router:t}=m2e(YK.UseNavigateStable),e=QK(E5.UseNavigateStable),r=D.useRef(!1);return WK(()=>{r.current=!0}),D.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,dw({fromRouteId:e},s)))},[t,e])}function KA(t){let{to:e,replace:r,state:n,relative:i}=t;Ey()||ci(!1);let{future:s,static:o}=D.useContext(_h),{matches:a}=D.useContext(Ih),{pathname:c}=hx(),l=XP(),f=JP(e,QP(a,s.v7_relativeSplatPath),c,i==="path"),u=JSON.stringify(f);return D.useEffect(()=>l(JSON.parse(u),{replace:r,state:n,relative:i}),[l,u,i,r,n]),null}function X6(t){ci(!1)}function C2e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Dd.Pop,navigator:s,static:o=!1,future:a}=t;Ey()&&ci(!1);let c=e.replace(/^\/*/,"/"),l=D.useMemo(()=>({basename:c,navigator:s,static:o,future:dw({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof n=="string"&&(n=xy(n));let{pathname:f="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,b=D.useMemo(()=>{let I=YP(f,c);return I==null?null:{location:{pathname:I,search:u,hash:p,state:g,key:y},navigationType:i}},[c,f,u,p,g,y,i]);return b==null?null:D.createElement(_h.Provider,{value:l},D.createElement(C8.Provider,{children:r,value:b}))}function A2e(t){let{children:e,location:r}=t;return u2e(L7(e),r)}new Promise(()=>{});function L7(t,e){e===void 0&&(e=[]);let r=[];return D.Children.forEach(t,(n,i)=>{if(!D.isValidElement(n))return;let s=[...e,i];if(n.type===D.Fragment){r.push.apply(r,L7(n.props.children,s));return}n.type!==X6&&ci(!1),!n.props.index||!n.props.children||ci(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=L7(n.props.children,s)),r.push(o)}),r}/** * React Router DOM v6.26.1 * * Copyright (c) Remix Software Inc. @@ -142,26 +142,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function $7(){return $7=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function _2e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function I2e(t,e){return t.button===0&&(!e||e==="_self")&&!_2e(t)}const T2e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],P2e="6";try{window.__reactRouterVersion=P2e}catch{}const k2e="startTransition",iL=eq[k2e];function M2e(t){let{basename:e,children:r,future:n,window:i}=t,s=D.useRef();s.current==null&&(s.current=Lxe({window:i,v5Compat:!0}));let o=s.current,[a,c]=D.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},f=D.useCallback(u=>{l&&iL?iL(()=>c(u)):c(u)},[c,l]);return D.useLayoutEffect(()=>o.listen(f),[o,f]),D.createElement(C2e,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const R2e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",O2e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eY=D.forwardRef(function(e,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:a,target:c,to:l,preventScrollReset:f,unstable_viewTransition:u}=e,p=S2e(e,T2e),{basename:g}=D.useContext(Th),y,b=!1;if(typeof l=="string"&&O2e.test(l)&&(y=l,R2e))try{let O=new URL(window.location.href),L=l.startsWith("//")?new URL(O.protocol+l):new URL(l),F=ZP(L.pathname,g);L.origin===O.origin&&F!=null?l=F+L.search+L.hash:b=!0}catch{}let I=l2e(l,{relative:i}),C=D2e(l,{replace:o,state:a,target:c,preventScrollReset:f,relative:i,unstable_viewTransition:u});function S(O){n&&n(O),O.defaultPrevented||C(O)}return D.createElement("a",$7({},p,{href:y||I,onClick:b||s?n:S,ref:r,target:c}))});var sL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sL||(sL={}));var oL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(oL||(oL={}));function D2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=rk(),l=px(),f=JK(t,{relative:o});return D.useCallback(u=>{if(I2e(u,r)){u.preventDefault();let p=n!==void 0?n:_5(l)===_5(f);c(t,{replace:p,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[l,c,f,n,i,r,t,s,o,a])}const N2e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var B2e=Object.freeze({__proto__:null,abi:N2e});const L2e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],F2e={isValidSignatureBytes32:"0x1626ba7e"};var j2e=Object.freeze({__proto__:null,abi:L2e,returns:F2e});const U2e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var $2e=Object.freeze({__proto__:null,abi:U2e});const q2e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var V2e=Object.freeze({__proto__:null,abi:q2e});const z2e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var H2e=Object.freeze({__proto__:null,abi:z2e});const G2e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var W2e=Object.freeze({__proto__:null,abi:G2e});const K2e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var Y2e=Object.freeze({__proto__:null,abi:K2e});const Q2e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var J2e=Object.freeze({__proto__:null,abi:Q2e});const Ps={erc6492:$2e,erc5719:B2e,erc1271:j2e,factory:V2e,mainModule:H2e,mainModuleUpgradable:W2e,sequenceUtils:Y2e,requireFreshSigner:J2e},tY="6.13.2";function Z2e(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Ot(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&Z2e(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function dv(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(dv).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return dv(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${dv(r)}: ${dv(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Is(t,e){return t&&t.code===e}function nk(t){return Is(t,"CALL_EXCEPTION")}function zn(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${dv(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+dv(a))}}s.push(`code=${e}`),s.push(`version=${tY}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Ot(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Ot(i,{shortMessage:n}),i}function Le(t,e,r,n){if(!t)throw zn(e,r,n)}function ve(t,e,r,n){Le(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function rY(t,e,r){r==null&&(r=""),r&&(r=": "+r),Le(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Le(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const X2e=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function nY(t){Le(X2e.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function kh(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Le(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function iY(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+aL[i&15]}return r}function qr(t){return"0x"+t.map(e=>Me(e).substring(2)).join("")}function fp(t){return Gr(t,!0)?(t.length-2)/2:Ue(t).length}function mn(t,e,r){const n=Ue(t);return r!=null&&r>n.length&&Le(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Me(n.slice(e??0,r??n.length))}function sY(t,e,r){const n=Ue(t);Le(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),Me(i)}function Kc(t,e){return sY(t,e,!0)}function oY(t,e){return sY(t,e,!1)}const P8=BigInt(0),Vc=BigInt(1),hv=9007199254740991;function T5(t,e){const r=k8(t,"value"),n=BigInt(or(e,"width"));if(Le(r>>n===P8,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Vc){const i=(Vc<=-hv&&t<=hv,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){ve(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}ve(!1,"invalid BigNumberish value",e||"value",t)}function k8(t,e){const r=Pt(t,e);return Le(r>=P8,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const cL="0123456789abcdef";function vx(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=cL[r>>4],e+=cL[r&15];return BigInt(e)}return Pt(t)}function or(t,e){switch(typeof t){case"bigint":return ve(t>=-hv&&t<=hv,"overflow",e||"value",t),Number(t);case"number":return ve(Number.isInteger(t),"underflow",e||"value",t),ve(t>=-hv&&t<=hv,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return or(BigInt(t),e)}catch(r){ve(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}ve(!1,"invalid numeric value",e||"value",t)}function e6e(t){return or(vx(t))}function tc(t,e){let n=k8(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=or(e,"width");for(Le(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function a6e(t,e,r,n,i){return t==="OVERLONG"?(ve(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),lY(t,e,r))}const c6e=Object.freeze({error:o6e,ignore:lY,replace:a6e});function l6e(t,e){e==null&&(e=c6e.error);const r=Ue(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Ii(t,e){ve(typeof t=="string","invalid string value","str",t),e!=null&&(nY(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);ve(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function f6e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ip(t,e){return f6e(l6e(t,e))}function fY(t){async function e(r,n){Le(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();Le(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Le(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=zn("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=zn("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let l;try{l=await fetch(r.url,c)}catch(g){throw clearTimeout(a),s||g}clearTimeout(a);const f={};l.headers.forEach((g,y)=>{f[y.toLowerCase()]=g});const u=await l.arrayBuffer(),p=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:f,body:p}}return e}const u6e=12,d6e=250;let lL=fY();const h6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let ZA=!1;async function uY(t,e){try{const r=t.match(h6e);if(!r)throw new Error("invalid data");return new Qd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?i6e(r[3]):g6e(r[3]))}catch{return new Qd(599,"BAD REQUEST (invalid data: URI)",{},null,new Jl(t))}}function dY(t){async function e(r,n){try{const i=r.match(p6e);if(!i)throw new Error("invalid link");return new Jl(`${t}${i[2]}`)}catch{return new Qd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Jl(r))}}return e}const h6={data:uY,ipfs:dY("https://gateway.ipfs.io/ipfs/")},hY=new WeakMap;var L0,yd;class v6e{constructor(e){Ie(this,L0);Ie(this,yd);ue(this,L0,[]),ue(this,yd,!1),hY.set(e,()=>{if(!Q(this,yd)){ue(this,yd,!0);for(const r of Q(this,L0))setTimeout(()=>{r()},0);ue(this,L0,[])}})}addListener(e){Le(!Q(this,yd),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,L0).push(e)}get cancelled(){return Q(this,yd)}checkSignal(){Le(!this.cancelled,"cancelled","CANCELLED",{})}}L0=new WeakMap,yd=new WeakMap;function p6(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Wv,Kv,Nc,Lf,Yv,Qv,Ri,Xo,Ff,F0,j0,U0,Sl,Bc,md,$0,Qm;const g4=class g4{constructor(e){Ie(this,$0);Ie(this,Wv);Ie(this,Kv);Ie(this,Nc);Ie(this,Lf);Ie(this,Yv);Ie(this,Qv);Ie(this,Ri);Ie(this,Xo);Ie(this,Ff);Ie(this,F0);Ie(this,j0);Ie(this,U0);Ie(this,Sl);Ie(this,Bc);Ie(this,md);ue(this,Qv,String(e)),ue(this,Wv,!1),ue(this,Kv,!0),ue(this,Nc,{}),ue(this,Lf,""),ue(this,Yv,3e5),ue(this,Bc,{slotInterval:d6e,maxAttempts:u6e}),ue(this,md,null)}get url(){return Q(this,Qv)}set url(e){ue(this,Qv,String(e))}get body(){return Q(this,Ri)==null?null:new Uint8Array(Q(this,Ri))}set body(e){if(e==null)ue(this,Ri,void 0),ue(this,Xo,void 0);else if(typeof e=="string")ue(this,Ri,Ii(e)),ue(this,Xo,"text/plain");else if(e instanceof Uint8Array)ue(this,Ri,e),ue(this,Xo,"application/octet-stream");else if(typeof e=="object")ue(this,Ri,Ii(JSON.stringify(e))),ue(this,Xo,"application/json");else throw new Error("invalid body")}hasBody(){return Q(this,Ri)!=null}get method(){return Q(this,Lf)?Q(this,Lf):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ue(this,Lf,String(e).toUpperCase())}get headers(){const e=Object.assign({},Q(this,Nc));return Q(this,Ff)&&(e.authorization=`Basic ${s6e(Ii(Q(this,Ff)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&Q(this,Xo)&&(e["content-type"]=Q(this,Xo)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){Q(this,Nc)[String(e).toLowerCase()]=String(r)}clearHeaders(){ue(this,Nc,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),ue(this,Yv,e)}get preflightFunc(){return Q(this,F0)||null}set preflightFunc(e){ue(this,F0,e)}get processFunc(){return Q(this,j0)||null}set processFunc(e){ue(this,j0,e)}get retryFunc(){return Q(this,U0)||null}set retryFunc(e){ue(this,U0,e)}get getUrlFunc(){return Q(this,md)||lL}set getUrlFunc(e){ue(this,md,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(Q(this,Bc).slotInterval=e.slotInterval),e.maxAttempts!=null&&(Q(this,Bc).maxAttempts=e.maxAttempts)}send(){return Le(Q(this,Sl)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ue(this,Sl,new v6e(this)),qe(this,$0,Qm).call(this,0,fL()+this.timeout,0,this,new Qd(0,"",{},null,this))}cancel(){Le(Q(this,Sl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=hY.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Le(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new g4(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ue(i,Nc,Object.assign({},Q(this,Nc))),Q(this,Ri)&&ue(i,Ri,new Uint8Array(Q(this,Ri))),ue(i,Xo,Q(this,Xo)),i}clone(){const e=new g4(this.url);return ue(e,Lf,Q(this,Lf)),Q(this,Ri)&&ue(e,Ri,Q(this,Ri)),ue(e,Xo,Q(this,Xo)),ue(e,Nc,Object.assign({},Q(this,Nc))),ue(e,Ff,Q(this,Ff)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ue(e,F0,Q(this,F0)),ue(e,j0,Q(this,j0)),ue(e,U0,Q(this,U0)),ue(e,Bc,Object.assign({},Q(this,Bc))),ue(e,md,Q(this,md)),e}static lockConfig(){ZA=!0}static getGateway(e){return h6[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(ZA)throw new Error("gateways locked");h6[e]=r}static registerGetUrl(e){if(ZA)throw new Error("gateways locked");lL=e}static createGetUrlFunc(e){return fY()}static createDataGateway(){return uY}static createIpfsGatewayFunc(e){return dY(e)}};Wv=new WeakMap,Kv=new WeakMap,Nc=new WeakMap,Lf=new WeakMap,Yv=new WeakMap,Qv=new WeakMap,Ri=new WeakMap,Xo=new WeakMap,Ff=new WeakMap,F0=new WeakMap,j0=new WeakMap,U0=new WeakMap,Sl=new WeakMap,Bc=new WeakMap,md=new WeakMap,$0=new WeakSet,Qm=async function(e,r,n,i,s){var f,u,p;if(e>=Q(this,Bc).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Le(fL()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await y6e(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in h6){const g=await h6[a](o.url,p6(Q(i,Sl)));if(g instanceof Qd){let y=g;if(this.processFunc){p6(Q(i,Sl));try{y=await this.processFunc(o,y)}catch(b){(b.throttle==null||typeof b.stall!="number")&&y.makeServerError("error in post-processing function",b).assertOk()}}return y}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,p6(Q(i,Sl)));let l=new Qd(c.statusCode,c.statusMessage,c.headers,c.body,i);if(l.statusCode===301||l.statusCode===302){try{const g=l.headers.location||"";return qe(f=o.redirect(g),$0,Qm).call(f,e+1,r,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,e))){const g=l.headers["retry-after"];let y=Q(this,Bc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(y=parseInt(g)),qe(u=o.clone(),$0,Qm).call(u,e+1,r,y,i,l)}if(this.processFunc){p6(Q(i,Sl));try{l=await this.processFunc(o,l)}catch(g){(g.throttle==null||typeof g.stall!="number")&&l.makeServerError("error in post-processing function",g).assertOk();let y=Q(this,Bc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return g.stall>=0&&(y=g.stall),qe(p=o.clone(),$0,Qm).call(p,e+1,r,y,i,l)}}return l};let Jl=g4;var Nw,Bw,Lw,ea,Jv,q0;const ZM=class ZM{constructor(e,r,n,i,s){Ie(this,Nw);Ie(this,Bw);Ie(this,Lw);Ie(this,ea);Ie(this,Jv);Ie(this,q0);ue(this,Nw,e),ue(this,Bw,r),ue(this,Lw,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ue(this,ea,i==null?null:new Uint8Array(i)),ue(this,Jv,s||null),ue(this,q0,{message:""})}toString(){return``}get statusCode(){return Q(this,Nw)}get statusMessage(){return Q(this,Bw)}get headers(){return Object.assign({},Q(this,Lw))}get body(){return Q(this,ea)==null?null:new Uint8Array(Q(this,ea))}get bodyText(){try{return Q(this,ea)==null?"":Ip(Q(this,ea))}catch{Le(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Le(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Ot(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return Q(this,ea)!=null}get request(){return Q(this,Jv)}ok(){return Q(this,q0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=Q(this,q0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{Q(this,ea)&&(i=Ip(Q(this,ea)))}catch{}Le(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Nw=new WeakMap,Bw=new WeakMap,Lw=new WeakMap,ea=new WeakMap,Jv=new WeakMap,q0=new WeakMap;let Qd=ZM;function fL(){return new Date().getTime()}function g6e(t){return Ii(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function y6e(t){return new Promise(e=>setTimeout(e,t))}const m6e=BigInt(-1),kc=BigInt(0),pv=BigInt(1),b6e=BigInt(5),R1={};let kv="0000";for(;kv.length<80;)kv+=kv;function i0(t){let e=kv;for(;e.length=-i&&tkc?t=T5(P0(t,n),n):t=-T5(P0(-t,n),n)}else{const i=pv<=0&&ts[a]==null?l:(ve(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}ve(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),ve(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function w6e(t,e){let r="";t0?n*=i0(i):i<0&&(r*=i0(-i)),rn?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=Q(this,an);return Q(this,an)kc&&(e+=Q(this,Gs)-pv),e=Q(this,an)/Q(this,Gs)*Q(this,Gs),qe(this,Xr,Sf).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=b6e*i0(r-1);let i=this.value+n;const s=i0(r);return i=i/s*s,Sm(i,Q(this,Lc),"round"),new hd(R1,i,Q(this,Lc))}isZero(){return Q(this,an)===kc}isNegative(){return Q(this,an)0){const c=i0(a);Le(o%c===kc,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=i0(-a));return Sm(o,s,"fromValue"),new hd(R1,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);ve(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=XA(r);let s=n[2]||"0",o=n[3]||"";for(;o.length{Le(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=uL(t,e+1,n);return r(e+1+n+i),dL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),dL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=uL(t,e+1,n);r(e+1+n+i);const s=Me(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=Me(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:x6e(t[e])}}function M8(t){const e=Ue(t,"data"),r=pY(e,0);return ve(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function hL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function vY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(vY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=hL(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Ue(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=hL(e.length);return r.unshift(183+r.length),r.concat(e)}const pL="0123456789abcdef";function Tp(t){let e="0x";for(const r of vY(t))e+=pL[r>>4],e+=pL[r&15];return e}const gY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function fh(t,e){let r=18;if(typeof e=="string"){const n=gY.indexOf(e);ve(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=or(e,"unit"));return k5.fromValue(t,r,{decimals:r,width:512}).toString()}function W7(t,e){ve(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=gY.indexOf(e);ve(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=or(e,"unit"));return k5.fromString(t,{decimals:r,width:512}).value}function E6e(t){return W7(t,18)}function C6e(t){const e=Ue(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Me(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Qs=32,K7=new Uint8Array(Qs),A6e=["then"],v6={},yY=new WeakMap;function m0(t){return yY.get(t)}function vL(t,e){yY.set(t,e)}function _m(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function Y7(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Gg?Y7(m0(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Gg&&(o=Y7(m0(o),o,r)),n[i]=o),n},{})}var Zv;const yv=class yv extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==v6&&(i=r,s=[],o=!1);super(i.length);Ie(this,Zv);i.forEach((l,f)=>{this[f]=l});const a=s.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(vL(this,Object.freeze(i.map((l,f)=>{const u=s[f];return u!=null&&a.get(u)===1?u:null}))),ue(this,Zv,[]),Q(this,Zv)==null&&Q(this,Zv),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,u)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const g=or(f,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const y=l[g];return y instanceof Error&&_m(`index ${g}`,y),y}if(A6e.indexOf(f)>=0)return Reflect.get(l,f,u);const p=l[f];if(p instanceof Function)return function(...g){return p.apply(this===u?l:this,g)};if(!(f in l))return l.getValue.apply(this===u?l:this,[f])}return Reflect.get(l,f,u)}});return vL(c,m0(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&_m(`index ${s}`,i),r&&i instanceof yv&&(i=i.toArray(r)),n.push(i)}),n}toObject(r){const n=m0(this);return n.reduce((i,s,o)=>(Le(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Y7(n,this,r)),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=m0(this),s=[],o=[];for(let a=r;a{Q(this,jf)[e]=gL(r)}}}jf=new WeakMap,V0=new WeakMap,Xv=new WeakSet,s3=function(e){return Q(this,jf).push(e),ue(this,V0,Q(this,V0)+e.length),e.length};var Eo,ta,z0,H0,bd,Up,Z7,mY;const XM=class XM{constructor(e,r,n){Ie(this,Up);de(this,"allowLoose");Ie(this,Eo);Ie(this,ta);Ie(this,z0);Ie(this,H0);Ie(this,bd);Ot(this,{allowLoose:!!r}),ue(this,Eo,es(e)),ue(this,z0,0),ue(this,H0,null),ue(this,bd,n??1024),ue(this,ta,0)}get data(){return Me(Q(this,Eo))}get dataLength(){return Q(this,Eo).length}get consumed(){return Q(this,ta)}get bytes(){return new Uint8Array(Q(this,Eo))}subReader(e){const r=new XM(Q(this,Eo).slice(Q(this,ta)+e),this.allowLoose,Q(this,bd));return ue(r,H0,this),r}readBytes(e,r){let n=qe(this,Up,mY).call(this,0,e,!!r);return qe(this,Up,Z7).call(this,e),ue(this,ta,Q(this,ta)+n.length),n.slice(0,e)}readValue(){return vx(this.readBytes(Qs))}readIndex(){return e6e(this.readBytes(Qs))}};Eo=new WeakMap,ta=new WeakMap,z0=new WeakMap,H0=new WeakMap,bd=new WeakMap,Up=new WeakSet,Z7=function(e){var r;if(Q(this,H0))return qe(r=Q(this,H0),Up,Z7).call(r,e);ue(this,z0,Q(this,z0)+e),Le(Q(this,bd)<1||Q(this,z0)<=Q(this,bd)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,bd)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:es(Q(this,Eo)),offset:Q(this,ta),length:e,info:{bytesRead:Q(this,z0),dataLength:this.dataLength}})},mY=function(e,r,n){let i=Math.ceil(r/Qs)*Qs;return Q(this,ta)+i>Q(this,Eo).length&&(this.allowLoose&&n&&Q(this,ta)+r<=Q(this,Eo).length?i=r:Le(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:es(Q(this,Eo)),length:Q(this,Eo).length,offset:Q(this,ta)+i})),Q(this,Eo).slice(Q(this,ta),Q(this,ta)+i)};let J7=XM;function oa(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function sk(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function bY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");oa(t.outputLen),oa(t.blockLen)}function Wg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function wY(t,e){sk(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,o3=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),a3=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),hl=(t,e)=>t<<32-e|t>>>e,S6e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!S6e)throw new Error("Non little-endian hardware is not supported");const _6e=async()=>{};async function yL(t,e,r){let n=Date.now();for(let i=0;i=0&&sn+i.length,0));let r=0;return t.forEach(n=>{if(!xY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class ok{clone(){return this._cloneInto()}}const P6e={}.toString;function EY(t,e){if(e!==void 0&&P6e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function R8(t){const e=n=>t().update(Kg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function k6e(t=32){if(e9&&typeof e9.getRandomValues=="function")return e9.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let CY=class extends ok{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,bY(e);const n=Kg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew CY(t,e).update(r).digest();O8.create=(t,e)=>new CY(t,e);function M6e(t,e,r,n){bY(t);const i=EY({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if(oa(s),oa(o),oa(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Kg(e),l=Kg(r),f=new Uint8Array(o),u=O8.create(t,c),p=u._cloneInto().update(l);return{c:s,dkLen:o,asyncTick:a,DK:f,PRF:u,PRFSalt:p}}function R6e(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function ak(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:c}=M6e(t,e,r,n);let l;const f=new Uint8Array(4),u=a3(f),p=new Uint8Array(a.outputLen);for(let g=1,y=0;y>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class ck extends ok{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=a3(this.buffer)}update(e){Wg(this);const{view:r,buffer:n,blockLen:i}=this;e=Kg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let u=o;uf.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ut&e^~t&r,N6e=(t,e,r)=>t&e^t&r^e&r,B6e=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]),Xu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ed=new Uint32Array(64);let L6e=class extends ck{constructor(){super(64,32,8,!1),this.A=Xu[0]|0,this.B=Xu[1]|0,this.C=Xu[2]|0,this.D=Xu[3]|0,this.E=Xu[4]|0,this.F=Xu[5]|0,this.G=Xu[6]|0,this.H=Xu[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let u=0;u<16;u++,r+=4)ed[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=ed[u-15],g=ed[u-2],y=hl(p,7)^hl(p,18)^p>>>3,b=hl(g,17)^hl(g,19)^g>>>10;ed[u]=b+ed[u-7]+y+ed[u-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:f}=this;for(let u=0;u<64;u++){const p=hl(a,6)^hl(a,11)^hl(a,25),g=f+p+D6e(a,c,l)+B6e[u]+ed[u]|0,b=(hl(n,2)^hl(n,13)^hl(n,22))+N6e(n,i,s)|0;f=l,l=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,c,l,f)}roundClean(){ed.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ey=R8(()=>new L6e),g6=BigInt(2**32-1),X7=BigInt(32);function AY(t,e=!1){return e?{h:Number(t&g6),l:Number(t>>X7&g6)}:{h:Number(t>>X7&g6)|0,l:Number(t&g6)|0}}function SY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),j6e=(t,e,r)=>t>>>r,U6e=(t,e,r)=>t<<32-r|e>>>r,$6e=(t,e,r)=>t>>>r|e<<32-r,q6e=(t,e,r)=>t<<32-r|e>>>r,V6e=(t,e,r)=>t<<64-r|e>>>r-32,z6e=(t,e,r)=>t>>>r-32|e<<64-r,H6e=(t,e)=>e,G6e=(t,e)=>t,_Y=(t,e,r)=>t<>>32-r,IY=(t,e,r)=>e<>>32-r,TY=(t,e,r)=>e<>>64-r,PY=(t,e,r)=>t<>>64-r;function W6e(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const K6e=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Y6e=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Q6e=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),J6e=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Z6e=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),X6e=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,dr={fromBig:AY,split:SY,toBig:F6e,shrSH:j6e,shrSL:U6e,rotrSH:$6e,rotrSL:q6e,rotrBH:V6e,rotrBL:z6e,rotr32H:H6e,rotr32L:G6e,rotlSH:_Y,rotlSL:IY,rotlBH:TY,rotlBL:PY,add:W6e,add3L:K6e,add3H:Y6e,add4L:Q6e,add4H:J6e,add5H:X6e,add5L:Z6e},[e3e,t3e]=dr.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"].map(t=>BigInt(t))),td=new Uint32Array(80),rd=new Uint32Array(80);let r3e=class extends ck{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(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:f,Fh:u,Fl:p,Gh:g,Gl:y,Hh:b,Hl:I}=this;return[e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I]}set(e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=f|0,this.Fh=u|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=b|0,this.Hl=I|0}process(e,r){for(let O=0;O<16;O++,r+=4)td[O]=e.getUint32(r),rd[O]=e.getUint32(r+=4);for(let O=16;O<80;O++){const L=td[O-15]|0,F=rd[O-15]|0,z=dr.rotrSH(L,F,1)^dr.rotrSH(L,F,8)^dr.shrSH(L,F,7),_=dr.rotrSL(L,F,1)^dr.rotrSL(L,F,8)^dr.shrSL(L,F,7),$=td[O-2]|0,ie=rd[O-2]|0,ce=dr.rotrSH($,ie,19)^dr.rotrBH($,ie,61)^dr.shrSH($,ie,6),K=dr.rotrSL($,ie,19)^dr.rotrBL($,ie,61)^dr.shrSL($,ie,6),P=dr.add4L(_,K,rd[O-7],rd[O-16]),M=dr.add4H(P,z,ce,td[O-7],td[O-16]);td[O]=M|0,rd[O]=P|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:f,Eh:u,El:p,Fh:g,Fl:y,Gh:b,Gl:I,Hh:C,Hl:S}=this;for(let O=0;O<80;O++){const L=dr.rotrSH(u,p,14)^dr.rotrSH(u,p,18)^dr.rotrBH(u,p,41),F=dr.rotrSL(u,p,14)^dr.rotrSL(u,p,18)^dr.rotrBL(u,p,41),z=u&g^~u&b,_=p&y^~p&I,$=dr.add5L(S,F,_,t3e[O],rd[O]),ie=dr.add5H($,C,L,z,e3e[O],td[O]),ce=$|0,K=dr.rotrSH(n,i,28)^dr.rotrBH(n,i,34)^dr.rotrBH(n,i,39),P=dr.rotrSL(n,i,28)^dr.rotrBL(n,i,34)^dr.rotrBL(n,i,39),M=n&s^n&a^s&a,v=i&o^i&c^o&c;C=b|0,S=I|0,b=g|0,I=y|0,g=u|0,y=p|0,{h:u,l:p}=dr.add(l|0,f|0,ie|0,ce|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=dr.add3L(ce,P,v);n=dr.add3H(m,ie,K,M),i=m|0}({h:n,l:i}=dr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=dr.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=dr.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:f}=dr.add(this.Dh|0,this.Dl|0,l|0,f|0),{h:u,l:p}=dr.add(this.Eh|0,this.El|0,u|0,p|0),{h:g,l:y}=dr.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:b,l:I}=dr.add(this.Gh|0,this.Gl|0,b|0,I|0),{h:C,l:S}=dr.add(this.Hh|0,this.Hl|0,C|0,S|0),this.set(n,i,s,o,a,c,l,f,u,p,g,y,b,I,C,S)}roundClean(){td.fill(0),rd.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)}};const lk=R8(()=>new r3e);function n3e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const mL=n3e(),bL=mL.crypto||mL.msCrypto;function i3e(t){switch(t){case"sha256":return Ey.create();case"sha512":return lk.create()}ve(!1,"invalid hashing algorithm name","algorithm",t)}function s3e(t,e){const r={sha256:Ey,sha512:lk}[t];return ve(r!=null,"invalid hmac algorithm","algorithm",t),O8.create(r,e)}function o3e(t,e,r,n,i){const s={sha256:Ey,sha512:lk}[i];return ve(s!=null,"invalid pbkdf2 algorithm","algorithm",i),ak(s,t,e,{c:r,dkLen:n})}function a3e(t){Le(bL!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),ve(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return bL.getRandomValues(e),e}let kY=!1;const MY=function(t,e,r){return s3e(t,e).update(r).digest()};let RY=MY;function Cy(t,e,r){const n=Ue(e,"key"),i=Ue(r,"data");return Me(RY(t,n,i))}Cy._=MY;Cy.lock=function(){kY=!0};Cy.register=function(t){if(kY)throw new Error("computeHmac is locked");RY=t};Object.freeze(Cy);const[OY,DY,NY]=[[],[],[]],c3e=BigInt(0),Im=BigInt(1),l3e=BigInt(2),f3e=BigInt(7),u3e=BigInt(256),d3e=BigInt(113);for(let t=0,e=Im,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],OY.push(2*(5*n+r)),DY.push((t+1)*(t+2)/2%64);let i=c3e;for(let s=0;s<7;s++)e=(e<>f3e)*d3e)%u3e,e&l3e&&(i^=Im<<(Im<r>32?TY(t,e,r):_Y(t,e,r),xL=(t,e,r)=>r>32?PY(t,e,r):IY(t,e,r);function v3e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],f=r[c+1],u=wL(l,f,1)^r[a],p=xL(l,f,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=u,t[o+g+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=DY[o],c=wL(i,s,a),l=xL(i,s,a),f=OY[o];i=t[f],s=t[f+1],t[f]=c,t[f+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=h3e[n],t[1]^=p3e[n]}r.fill(0)}class fk extends ok{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,oa(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=o3(this.state)}keccak(){v3e(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Wg(this);const{blockLen:r,state:n}=this;e=Kg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return oa(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(wY(e,this),this.finished)throw new 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(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new fk(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const g3e=(t,e,r)=>R8(()=>new fk(e,t,r)),y3e=g3e(1,136,256/8);let BY=!1;const LY=function(t){return y3e(t)};let FY=LY;function gr(t){const e=Ue(t,"data");return Me(FY(e))}gr._=LY;gr.lock=function(){BY=!0};gr.register=function(t){if(BY)throw new TypeError("keccak256 is locked");FY=t};Object.freeze(gr);const m3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),jY=Uint8Array.from({length:16},(t,e)=>e),b3e=jY.map(t=>(9*t+5)%16);let uk=[jY],dk=[b3e];for(let t=0;t<4;t++)for(let e of[uk,dk])e.push(e[t].map(r=>m3e[r]));const UY=[[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(t=>new Uint8Array(t)),w3e=uk.map((t,e)=>t.map(r=>UY[e][r])),x3e=dk.map((t,e)=>t.map(r=>UY[e][r])),E3e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),C3e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y6=(t,e)=>t<>>32-e;function EL(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const m6=new Uint32Array(16);let A3e=class extends ck{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let g=0;g<16;g++,r+=4)m6[g]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,c=a,l=this.h3|0,f=l,u=this.h4|0,p=u;for(let g=0;g<5;g++){const y=4-g,b=E3e[g],I=C3e[g],C=uk[g],S=dk[g],O=w3e[g],L=x3e[g];for(let F=0;F<16;F++){const z=y6(n+EL(g,s,a,l)+m6[C[F]]+b,O[F])+u|0;n=u,u=l,l=y6(a,10)|0,a=s,s=z}for(let F=0;F<16;F++){const z=y6(i+EL(y,o,c,f)+m6[S[F]]+I,L[F])+p|0;i=p,p=f,f=y6(c,10)|0,c=o,o=z}}this.set(this.h1+a+f|0,this.h2+l+p|0,this.h3+u+i|0,this.h4+n+o|0,this.h0+s+c|0)}roundClean(){m6.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};const S3e=R8(()=>new A3e);let $Y=!1;const qY=function(t){return S3e(t)};let VY=qY;function Ay(t){const e=Ue(t,"data");return Me(VY(e))}Ay._=qY;Ay.lock=function(){$Y=!0};Ay.register=function(t){if($Y)throw new TypeError("ripemd160 is locked");VY=t};Object.freeze(Ay);let zY=!1;const HY=function(t,e,r,n,i){return o3e(t,e,r,n,i)};let GY=HY;function Mh(t,e,r,n,i){const s=Ue(t,"password"),o=Ue(e,"salt");return Me(GY(s,o,r,n,i))}Mh._=HY;Mh.lock=function(){zY=!0};Mh.register=function(t){if(zY)throw new Error("pbkdf2 is locked");GY=t};Object.freeze(Mh);let WY=!1;const KY=function(t){return new Uint8Array(a3e(t))};let YY=KY;function da(t){return YY(t)}da._=KY;da.lock=function(){WY=!0};da.register=function(t){if(WY)throw new Error("randomBytes is locked");YY=t};Object.freeze(da);const Fr=(t,e)=>t<>>32-e;function CL(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],f=t[e++]^r[n++],u=t[e++]^r[n++],p=t[e++]^r[n++],g=t[e++]^r[n++],y=t[e++]^r[n++],b=t[e++]^r[n++],I=t[e++]^r[n++],C=t[e++]^r[n++],S=t[e++]^r[n++],O=t[e++]^r[n++],L=t[e++]^r[n++],F=t[e++]^r[n++],z=o,_=a,$=c,ie=l,ce=f,K=u,P=p,M=g,v=y,m=b,R=I,B=C,E=S,x=O,w=L,T=F;for(let k=0;k<8;k+=2)ce^=Fr(z+E|0,7),v^=Fr(ce+z|0,9),E^=Fr(v+ce|0,13),z^=Fr(E+v|0,18),m^=Fr(K+_|0,7),x^=Fr(m+K|0,9),_^=Fr(x+m|0,13),K^=Fr(_+x|0,18),w^=Fr(R+P|0,7),$^=Fr(w+R|0,9),P^=Fr($+w|0,13),R^=Fr(P+$|0,18),ie^=Fr(T+B|0,7),M^=Fr(ie+T|0,9),B^=Fr(M+ie|0,13),T^=Fr(B+M|0,18),_^=Fr(z+ie|0,7),$^=Fr(_+z|0,9),ie^=Fr($+_|0,13),z^=Fr(ie+$|0,18),P^=Fr(K+ce|0,7),M^=Fr(P+K|0,9),ce^=Fr(M+P|0,13),K^=Fr(ce+M|0,18),B^=Fr(R+m|0,7),v^=Fr(B+R|0,9),m^=Fr(v+B|0,13),R^=Fr(m+v|0,18),E^=Fr(T+w|0,7),x^=Fr(E+T|0,9),w^=Fr(x+E|0,13),T^=Fr(w+x|0,18);i[s++]=o+z|0,i[s++]=a+_|0,i[s++]=c+$|0,i[s++]=l+ie|0,i[s++]=f+ce|0,i[s++]=u+K|0,i[s++]=p+P|0,i[s++]=g+M|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+R|0,i[s++]=C+B|0,i[s++]=S+E|0,i[s++]=O+x|0,i[s++]=L+w|0,i[s++]=F+T|0}function Mv(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a0&&(o+=16),CL(r,s,t,e+=16,r,o)}function QY(t,e,r){const n=EY({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:f}=n;if(oa(i),oa(s),oa(o),oa(a),oa(c),oa(l),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const u=128*s,p=u/4;if(i<=1||i&i-1||i>=2**(u/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/u)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=u*(i+o);if(g>l)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${l} (maxmem)`);const y=ak(Ey,t,e,{c:1,dkLen:u*o}),b=o3(y),I=o3(new Uint8Array(u*i)),C=o3(new Uint8Array(u));let S=()=>{};if(f){const O=2*i*o,L=Math.max(Math.floor(O/1e4),1);let F=0;S=()=>{F++,f&&(!(F%L)||F===O)&&f(F/O)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:p,V:I,B32:b,B:y,tmp:C,blockMixCb:S,asyncTick:c}}function JY(t,e,r,n,i){const s=ak(Ey,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function _3e(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:f,tmp:u,blockMixCb:p}=QY(t,e,r);for(let g=0;g{Mv(c,I,c,I+=a,i),p()}),Mv(c,(n-1)*a,l,b,i),p(),await yL(n,g,()=>{const C=l[b+a-16]%n;for(let S=0;St instanceof Uint8Array,P3e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Yg(t){if(!N8(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!N8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function M3e(t,e){if(t.length!==e.length)return!1;for(let r=0;raQ;t>>=D8,e+=1);return e}function D3e(t,e){return t>>BigInt(e)&D8}const N3e=(t,e,r)=>t|(r?D8:aQ)<(T3e<new Uint8Array(t),AL=t=>Uint8Array.from(t);function lQ(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=t9(t),i=t9(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...u)=>r(i,n,...u),c=(u=t9())=>{i=a(AL([0]),u),n=a(),u.length!==0&&(i=a(AL([1]),u),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const p=[];for(;u{o(),c(u);let g;for(;!(g=p(l()));)c();return o(),g}}const B3e={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function gx(t,e,r={}){const n=(i,s,o)=>{const a=B3e[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const L3e=Object.freeze(Object.defineProperty({__proto__:null,bitGet:D3e,bitLen:O3e,bitMask:gk,bitSet:N3e,bytesToHex:Yg,bytesToNumberBE:up,bytesToNumberLE:pk,concatBytes:pw,createHmacDrbg:lQ,ensureBytes:Oc,equalBytes:M3e,hexToBytes:Qg,hexToNumber:hk,numberToBytesBE:Jg,numberToBytesLE:vk,numberToHexUnpadded:cQ,numberToVarBytesBE:k3e,utf8ToBytes:R3e,validateObject:gx},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Bi=BigInt(0),ai=BigInt(1),b0=BigInt(2),F3e=BigInt(3),e_=BigInt(4),SL=BigInt(5),_L=BigInt(8);BigInt(9);BigInt(16);function So(t,e){const r=t%e;return r>=Bi?r:e+r}function j3e(t,e,r){if(r<=Bi||e 0");if(r===ai)return Bi;let n=ai;for(;e>Bi;)e&ai&&(n=n*t%r),t=t*t%r,e>>=ai;return n}function Ra(t,e,r){let n=t;for(;e-- >Bi;)n*=n,n%=r;return n}function t_(t,e){if(t===Bi||e<=Bi)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=So(t,e),n=e,i=Bi,s=ai;for(;r!==Bi;){const a=n/r,c=n%r,l=i-s*a;n=r,r=c,i=s,s=l}if(n!==ai)throw new Error("invert: does not exist");return So(i,e)}function U3e(t){const e=(t-ai)/b0;let r,n,i;for(r=t-ai,n=0;r%b0===Bi;r/=b0,n++);for(i=b0;i(n[i]="function",n),e);return gx(t,r)}function z3e(t,e,r){if(r 0");if(r===Bi)return t.ONE;if(r===ai)return e;let n=t.ONE,i=e;for(;r>Bi;)r&ai&&(n=t.mul(n,i)),i=t.sqr(i),r>>=ai;return n}function H3e(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function fQ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function G3e(t,e,r=!1,n={}){if(t<=Bi)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=fQ(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=$3e(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:gk(i),ZERO:Bi,ONE:ai,create:c=>So(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Bi<=c&&cc===Bi,isOdd:c=>(c&ai)===ai,neg:c=>So(-c,t),eql:(c,l)=>c===l,sqr:c=>So(c*c,t),add:(c,l)=>So(c+l,t),sub:(c,l)=>So(c-l,t),mul:(c,l)=>So(c*l,t),pow:(c,l)=>z3e(a,c,l),div:(c,l)=>So(c*t_(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>t_(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>H3e(a,c),cmov:(c,l,f)=>f?l:c,toBytes:c=>r?vk(c,s):Jg(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?pk(c):up(c)}});return Object.freeze(a)}function uQ(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function dQ(t){const e=uQ(t);return e+Math.ceil(e/2)}function W3e(t,e,r=!1){const n=t.length,i=uQ(e),s=dQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?up(t):pk(t),a=So(o,e-ai)+ai;return r?vk(a,i):Jg(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const K3e=BigInt(0),r9=BigInt(1);function Y3e(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>K3e;)s&r9&&(o=o.add(a)),a=a.double(),s>>=r9;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let l=i,f=l;for(let u=0;u>=g,I>c&&(I-=p,o+=r9);const C=b,S=b+Math.abs(I)-1,O=y%2!==0,L=I<0;I===0?f=f.add(r(O,s[C])):l=l.add(r(L,s[S]))}return{p:l,f}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function hQ(t){return V3e(t.Fp),gx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q3e(t){const e=hQ(t);gx(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:J3e,hexToBytes:Z3e}=L3e,k0={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=k0;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:J3e(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=k0,r=typeof t=="string"?Z3e(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=k0._parseInt(r.subarray(2)),{d:o,l:a}=k0._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,r=l=>{const f=l.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Yf=BigInt(0),Ga=BigInt(1);BigInt(2);const IL=BigInt(3);BigInt(4);function X3e(t){const e=Q3e(t),{Fp:r}=e,n=e.toBytes||((y,b,I)=>{const C=b.toAffine();return pw(Uint8Array.from([4]),r.toBytes(C.x),r.toBytes(C.y))}),i=e.fromBytes||(y=>{const b=y.subarray(1),I=r.fromBytes(b.subarray(0,r.BYTES)),C=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:I,y:C}});function s(y){const{a:b,b:I}=e,C=r.sqr(y),S=r.mul(C,y);return r.add(r.add(S,r.mul(y,b)),I)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&Yfr.eql(O,r.ZERO);return S(I)&&S(C)?u.ZERO:new u(I,C,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const I=r.invertBatch(b.map(C=>C.pz));return b.map((C,S)=>C.toAffine(I[S])).map(u.fromAffine)}static fromHex(b){const I=u.fromAffine(i(Oc("pointHex",b)));return I.assertValidity(),I}static fromPrivateKey(b){return u.BASE.multiply(c(b))}_setWindowSize(b){this._WINDOW_SIZE=b,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:I}=this.toAffine();if(!r.isValid(b)||!r.isValid(I))throw new Error("bad point: x or y not FE");const C=r.sqr(I),S=s(b);if(!r.eql(C,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:I,py:C,pz:S}=this,{px:O,py:L,pz:F}=b,z=r.eql(r.mul(I,F),r.mul(O,S)),_=r.eql(r.mul(C,F),r.mul(L,S));return z&&_}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:I}=e,C=r.mul(I,IL),{px:S,py:O,pz:L}=this;let F=r.ZERO,z=r.ZERO,_=r.ZERO,$=r.mul(S,S),ie=r.mul(O,O),ce=r.mul(L,L),K=r.mul(S,O);return K=r.add(K,K),_=r.mul(S,L),_=r.add(_,_),F=r.mul(b,_),z=r.mul(C,ce),z=r.add(F,z),F=r.sub(ie,z),z=r.add(ie,z),z=r.mul(F,z),F=r.mul(K,F),_=r.mul(C,_),ce=r.mul(b,ce),K=r.sub($,ce),K=r.mul(b,K),K=r.add(K,_),_=r.add($,$),$=r.add(_,$),$=r.add($,ce),$=r.mul($,K),z=r.add(z,$),ce=r.mul(O,L),ce=r.add(ce,ce),$=r.mul(ce,K),F=r.sub(F,$),_=r.mul(ce,ie),_=r.add(_,_),_=r.add(_,_),new u(F,z,_)}add(b){f(b);const{px:I,py:C,pz:S}=this,{px:O,py:L,pz:F}=b;let z=r.ZERO,_=r.ZERO,$=r.ZERO;const ie=e.a,ce=r.mul(e.b,IL);let K=r.mul(I,O),P=r.mul(C,L),M=r.mul(S,F),v=r.add(I,C),m=r.add(O,L);v=r.mul(v,m),m=r.add(K,P),v=r.sub(v,m),m=r.add(I,S);let R=r.add(O,F);return m=r.mul(m,R),R=r.add(K,M),m=r.sub(m,R),R=r.add(C,S),z=r.add(L,F),R=r.mul(R,z),z=r.add(P,M),R=r.sub(R,z),$=r.mul(ie,m),z=r.mul(ce,M),$=r.add(z,$),z=r.sub(P,$),$=r.add(P,$),_=r.mul(z,$),P=r.add(K,K),P=r.add(P,K),M=r.mul(ie,M),m=r.mul(ce,m),P=r.add(P,M),M=r.sub(K,M),M=r.mul(ie,M),m=r.add(m,M),K=r.mul(P,m),_=r.add(_,K),K=r.mul(R,m),z=r.mul(v,z),z=r.sub(z,K),K=r.mul(v,P),$=r.mul(R,$),$=r.add($,K),new u(z,_,$)}subtract(b){return this.add(b.negate())}is0(){return this.equals(u.ZERO)}wNAF(b){return g.wNAFCached(this,l,b,I=>{const C=r.invertBatch(I.map(S=>S.pz));return I.map((S,O)=>S.toAffine(C[O])).map(u.fromAffine)})}multiplyUnsafe(b){const I=u.ZERO;if(b===Yf)return I;if(a(b),b===Ga)return this;const{endo:C}=e;if(!C)return g.unsafeLadder(this,b);let{k1neg:S,k1:O,k2neg:L,k2:F}=C.splitScalar(b),z=I,_=I,$=this;for(;O>Yf||F>Yf;)O&Ga&&(z=z.add($)),F&Ga&&(_=_.add($)),$=$.double(),O>>=Ga,F>>=Ga;return S&&(z=z.negate()),L&&(_=_.negate()),_=new u(r.mul(_.px,C.beta),_.py,_.pz),z.add(_)}multiply(b){a(b);let I=b,C,S;const{endo:O}=e;if(O){const{k1neg:L,k1:F,k2neg:z,k2:_}=O.splitScalar(I);let{p:$,f:ie}=this.wNAF(F),{p:ce,f:K}=this.wNAF(_);$=g.constTimeNegate(L,$),ce=g.constTimeNegate(z,ce),ce=new u(r.mul(ce.px,O.beta),ce.py,ce.pz),C=$.add(ce),S=ie.add(K)}else{const{p:L,f:F}=this.wNAF(I);C=L,S=F}return u.normalizeZ([C,S])[0]}multiplyAndAddUnsafe(b,I,C){const S=u.BASE,O=(F,z)=>z===Yf||z===Ga||!F.equals(S)?F.multiplyUnsafe(z):F.multiply(z),L=O(this,I).add(O(b,C));return L.is0()?void 0:L}toAffine(b){const{px:I,py:C,pz:S}=this,O=this.is0();b==null&&(b=O?r.ONE:r.inv(S));const L=r.mul(I,b),F=r.mul(C,b),z=r.mul(S,b);if(O)return{x:r.ZERO,y:r.ZERO};if(!r.eql(z,r.ONE))throw new Error("invZ was invalid");return{x:L,y:F}}isTorsionFree(){const{h:b,isTorsionFree:I}=e;if(b===Ga)return!0;if(I)return I(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:I}=e;return b===Ga?this:I?I(u,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(u,this,b)}toHex(b=!0){return Yg(this.toRawBytes(b))}}u.BASE=new u(e.Gx,e.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,g=Y3e(u,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function e5e(t){const e=hQ(t);return gx(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function t5e(t){const e=e5e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return YfYg(Jg(m,e.nByteLength));function y(m){const R=n>>Ga;return m>R}function b(m){return y(m)?a(-m):m}const I=(m,R,B)=>up(m.slice(R,B));class C{constructor(R,B,E){this.r=R,this.s=B,this.recovery=E,this.assertValidity()}static fromCompact(R){const B=e.nByteLength;return R=Oc("compactSignature",R,B*2),new C(I(R,0,B),I(R,B,2*B))}static fromDER(R){const{r:B,s:E}=k0.toSig(Oc("DER",R));return new C(B,E)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(R){return new C(this.r,this.s,R)}recoverPublicKey(R){const{r:B,s:E,recovery:x}=this,w=_(Oc("msgHash",R));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const T=x===2||x===3?B+e.n:B;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const k=x&1?"03":"02",H=l.fromHex(k+g(T)),oe=c(T),j=a(-w*oe),X=a(E*oe),G=l.BASE.multiplyAndAddUnsafe(H,j,X);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Qg(this.toDERHex())}toDERHex(){return k0.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Qg(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=dQ(e.n);return W3e(e.randomBytes(m),e.n)},precompute(m=8,R=l.BASE){return R._setWindowSize(m),R.multiply(BigInt(3)),R}};function O(m,R=!0){return l.fromPrivateKey(m).toRawBytes(R)}function L(m){const R=m instanceof Uint8Array,B=typeof m=="string",E=(R||B)&&m.length;return R?E===i||E===s:B?E===2*i||E===2*s:m instanceof l}function F(m,R,B=!0){if(L(m))throw new Error("first arg must be private key");if(!L(R))throw new Error("second arg must be public key");return l.fromHex(R).multiply(f(m)).toRawBytes(B)}const z=e.bits2int||function(m){const R=up(m),B=m.length*8-e.nBitLength;return B>0?R>>BigInt(B):R},_=e.bits2int_modN||function(m){return a(z(m))},$=gk(e.nBitLength);function ie(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(Yf<=m&&m<$))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Jg(m,e.nByteLength)}function ce(m,R,B=K){if(["recovered","canonical"].some(ee=>ee in B))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=e;let{lowS:w,prehash:T,extraEntropy:k}=B;w==null&&(w=!0),m=Oc("msgHash",m),T&&(m=Oc("prehashed msgHash",E(m)));const H=_(m),oe=f(R),j=[ie(oe),ie(H)];if(k!=null){const ee=k===!0?x(r.BYTES):k;j.push(Oc("extraEntropy",ee))}const X=pw(...j),G=H;function Z(ee){const N=z(ee);if(!p(N))return;const te=c(N),fe=l.BASE.multiply(N).toAffine(),Ee=a(fe.x);if(Ee===Yf)return;const _e=a(te*a(G+Ee*oe));if(_e===Yf)return;let Re=(fe.x===Ee?0:2)|Number(fe.y&Ga),Te=_e;return w&&y(_e)&&(Te=b(_e),Re^=1),new C(Ee,Te,Re)}return{seed:X,k2sig:Z}}const K={lowS:e.lowS,prehash:!1},P={lowS:e.lowS,prehash:!1};function M(m,R,B=K){const{seed:E,k2sig:x}=ce(m,R,B),w=e;return lQ(w.hash.outputLen,w.nByteLength,w.hmac)(E,x)}l.BASE._setWindowSize(8);function v(m,R,B,E=P){var fe;const x=m;if(R=Oc("msgHash",R),B=Oc("publicKey",B),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=E;let k,H;try{if(typeof x=="string"||x instanceof Uint8Array)try{k=C.fromDER(x)}catch(Ee){if(!(Ee instanceof k0.Err))throw Ee;k=C.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:Ee,s:_e}=x;k=new C(Ee,_e)}else throw new Error("PARSE");H=l.fromHex(B)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&k.hasHighS())return!1;T&&(R=e.hash(R));const{r:oe,s:j}=k,X=_(R),G=c(j),Z=a(X*G),ee=a(oe*G),N=(fe=l.BASE.multiplyAndAddUnsafe(H,Z,ee))==null?void 0:fe.toAffine();return N?a(N.x)===oe:!1}return{CURVE:e,getPublicKey:O,getSharedSecret:F,sign:M,verify:v,ProjectivePoint:l,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function r5e(t){return{hash:t,hmac:(e,...r)=>O8(t,e,T6e(...r)),randomBytes:k6e}}function n5e(t,e){const r=n=>t5e({...t,...r5e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),TL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),i5e=BigInt(1),r_=BigInt(2),PL=(t,e)=>(t+e/r_)/e;function s5e(t){const e=pQ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,f=l*l*t%e,u=Ra(f,r,e)*f%e,p=Ra(u,r,e)*f%e,g=Ra(p,r_,e)*l%e,y=Ra(g,i,e)*g%e,b=Ra(y,s,e)*y%e,I=Ra(b,a,e)*b%e,C=Ra(I,c,e)*I%e,S=Ra(C,a,e)*b%e,O=Ra(S,r,e)*f%e,L=Ra(O,o,e)*y%e,F=Ra(L,n,e)*l%e,z=Ra(F,r_,e);if(!n_.eql(n_.sqr(z),t))throw new Error("Cannot find square root");return z}const n_=G3e(pQ,void 0,void 0,{sqrt:s5e}),od=n5e({a:BigInt(0),b:BigInt(7),Fp:n_,n:TL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=TL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=PL(s*t,e),c=PL(-n*t,e);let l=So(t-a*r-c*i,e),f=So(-a*n-c*s,e);const u=l>o,p=f>o;if(u&&(l=e-l),p&&(f=e-f),l>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:l,k2neg:p,k2:f}}}},Ey);BigInt(0);od.ProjectivePoint;const bu="0x0000000000000000000000000000000000000000",Zg="0x0000000000000000000000000000000000000000000000000000000000000000",o5e=`Ethereum Signed Message: -`,kL=BigInt(0),ML=BigInt(1),RL=BigInt(2),OL=BigInt(27),DL=BigInt(28),b6=BigInt(35),O1={};function NL(t){return Kc(ts(t),32)}var eg,tg,rg,G0,Ao;let wu=(Ao=class{constructor(e,r,n,i){Ie(this,eg);Ie(this,tg);Ie(this,rg);Ie(this,G0);kh(e,O1,"Signature"),ue(this,eg,r),ue(this,tg,n),ue(this,rg,i),ue(this,G0,null)}get r(){return Q(this,eg)}set r(e){ve(fp(e)===32,"invalid r","value",e),ue(this,eg,Me(e))}get s(){return Q(this,tg)}set s(e){ve(fp(e)===32,"invalid s","value",e);const r=Me(e);ve(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ue(this,tg,r)}get v(){return Q(this,rg)}set v(e){const r=or(e,"value");ve(r===27||r===28,"invalid v","v",e),ue(this,rg,r)}get networkV(){return Q(this,G0)}get legacyChainId(){const e=this.networkV;return e==null?null:Ao.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ue(this.s);return this.yParity&&(e[0]|=128),Me(e)}get compactSerialized(){return qr([this.r,this.yParityAndS])}get serialized(){return qr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Ao(O1,this.r,this.s,this.v);return this.networkV&&ue(e,G0,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Pt(e,"v");return r==OL||r==DL?kL:(ve(r>=b6,"invalid EIP-155 v","v",e),(r-b6)/RL)}static getChainIdV(e,r){return Pt(e)*RL+BigInt(35+r-27)}static getNormalizedV(e){const r=Pt(e);return r===kL||r===OL?27:r===ML||r===DL?28:(ve(r>=b6,"invalid v","v",e),r&ML?27:28)}static from(e){function r(l,f){ve(l,f,"signature",e)}if(e==null)return new Ao(O1,Zg,Zg,27);if(typeof e=="string"){const l=Ue(e,"signature");if(l.length===64){const f=Me(l.slice(0,32)),u=l.slice(32,64),p=u[0]&128?28:27;return u[0]&=127,new Ao(O1,f,Me(u),p)}if(l.length===65){const f=Me(l.slice(0,32)),u=l.slice(32,64);r((u[0]&128)===0,"non-canonical s");const p=Ao.getNormalizedV(l[64]);return new Ao(O1,f,Me(u),p)}r(!1,"invalid raw signature length")}if(e instanceof Ao)return e.clone();const n=e.r;r(n!=null,"missing r");const i=NL(n),s=function(l,f){if(l!=null)return NL(l);if(f!=null){r(Gr(f,32),"invalid yParityAndS");const u=Ue(f);return u[0]&=127,Me(u)}r(!1,"missing s")}(e.s,e.yParityAndS);r((Ue(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(l,f,u){if(l!=null){const p=Pt(l);return{networkV:p>=b6?p:void 0,v:Ao.getNormalizedV(p)}}if(f!=null)return r(Gr(f,32),"invalid yParityAndS"),{v:Ue(f)[0]&128?28:27};if(u!=null){switch(or(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Ao(O1,i,s,a);return o&&ue(c,G0,o),r(e.yParity==null||or(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},eg=new WeakMap,tg=new WeakMap,rg=new WeakMap,G0=new WeakMap,Ao);var Uf,Ll;let Jd=(Ll=class{constructor(e){Ie(this,Uf);ve(fp(e)===32,"invalid private key","privateKey","[REDACTED]"),ue(this,Uf,Me(e))}get privateKey(){return Q(this,Uf)}get publicKey(){return Ll.computePublicKey(Q(this,Uf))}get compressedPublicKey(){return Ll.computePublicKey(Q(this,Uf),!0)}sign(e){ve(fp(e)===32,"invalid digest length","digest",e);const r=od.sign(es(e),es(Q(this,Uf)),{lowS:!0});return wu.from({r:tc(r.r,32),s:tc(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ll.computePublicKey(e);return Me(od.getSharedSecret(es(Q(this,Uf)),Ue(r),!1))}static computePublicKey(e,r){let n=Ue(e,"key");if(n.length===32){const s=od.getPublicKey(n,!!r);return Me(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=od.ProjectivePoint.fromHex(n);return Me(i.toRawBytes(r))}static recoverPublicKey(e,r){ve(fp(e)===32,"invalid digest length","digest",e);const n=wu.from(r);let i=od.Signature.fromCompact(es(qr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(es(e));return ve(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=od.ProjectivePoint.fromHex(Ll.computePublicKey(e).substring(2)),s=od.ProjectivePoint.fromHex(Ll.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}},Uf=new WeakMap,Ll);const a5e=BigInt(0),c5e=BigInt(36);function BL(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ue(gr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const yk={};for(let t=0;t<10;t++)yk[String(t)]=String(t);for(let t=0;t<26;t++)yk[String.fromCharCode(65+t)]=String(10+t);const LL=15;function l5e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>yk[n]).join("");for(;e.length>=LL;){let n=e.substring(0,LL);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const f5e=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function u5e(t){t=t.toLowerCase();let e=a5e;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return Q(this,W0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return Q(this,W0)===!0?-1:Q(this,W0)===!1?this.value.length:null}static from(e,r){return new Rf(Mf,e,r)}static uint8(e){return St(e,8)}static uint16(e){return St(e,16)}static uint24(e){return St(e,24)}static uint32(e){return St(e,32)}static uint40(e){return St(e,40)}static uint48(e){return St(e,48)}static uint56(e){return St(e,56)}static uint64(e){return St(e,64)}static uint72(e){return St(e,72)}static uint80(e){return St(e,80)}static uint88(e){return St(e,88)}static uint96(e){return St(e,96)}static uint104(e){return St(e,104)}static uint112(e){return St(e,112)}static uint120(e){return St(e,120)}static uint128(e){return St(e,128)}static uint136(e){return St(e,136)}static uint144(e){return St(e,144)}static uint152(e){return St(e,152)}static uint160(e){return St(e,160)}static uint168(e){return St(e,168)}static uint176(e){return St(e,176)}static uint184(e){return St(e,184)}static uint192(e){return St(e,192)}static uint200(e){return St(e,200)}static uint208(e){return St(e,208)}static uint216(e){return St(e,216)}static uint224(e){return St(e,224)}static uint232(e){return St(e,232)}static uint240(e){return St(e,240)}static uint248(e){return St(e,248)}static uint256(e){return St(e,256)}static uint(e){return St(e,256)}static int8(e){return St(e,-8)}static int16(e){return St(e,-16)}static int24(e){return St(e,-24)}static int32(e){return St(e,-32)}static int40(e){return St(e,-40)}static int48(e){return St(e,-48)}static int56(e){return St(e,-56)}static int64(e){return St(e,-64)}static int72(e){return St(e,-72)}static int80(e){return St(e,-80)}static int88(e){return St(e,-88)}static int96(e){return St(e,-96)}static int104(e){return St(e,-104)}static int112(e){return St(e,-112)}static int120(e){return St(e,-120)}static int128(e){return St(e,-128)}static int136(e){return St(e,-136)}static int144(e){return St(e,-144)}static int152(e){return St(e,-152)}static int160(e){return St(e,-160)}static int168(e){return St(e,-168)}static int176(e){return St(e,-176)}static int184(e){return St(e,-184)}static int192(e){return St(e,-192)}static int200(e){return St(e,-200)}static int208(e){return St(e,-208)}static int216(e){return St(e,-216)}static int224(e){return St(e,-224)}static int232(e){return St(e,-232)}static int240(e){return St(e,-240)}static int248(e){return St(e,-248)}static int256(e){return St(e,-256)}static int(e){return St(e,-256)}static bytes1(e){return jr(e,1)}static bytes2(e){return jr(e,2)}static bytes3(e){return jr(e,3)}static bytes4(e){return jr(e,4)}static bytes5(e){return jr(e,5)}static bytes6(e){return jr(e,6)}static bytes7(e){return jr(e,7)}static bytes8(e){return jr(e,8)}static bytes9(e){return jr(e,9)}static bytes10(e){return jr(e,10)}static bytes11(e){return jr(e,11)}static bytes12(e){return jr(e,12)}static bytes13(e){return jr(e,13)}static bytes14(e){return jr(e,14)}static bytes15(e){return jr(e,15)}static bytes16(e){return jr(e,16)}static bytes17(e){return jr(e,17)}static bytes18(e){return jr(e,18)}static bytes19(e){return jr(e,19)}static bytes20(e){return jr(e,20)}static bytes21(e){return jr(e,21)}static bytes22(e){return jr(e,22)}static bytes23(e){return jr(e,23)}static bytes24(e){return jr(e,24)}static bytes25(e){return jr(e,25)}static bytes26(e){return jr(e,26)}static bytes27(e){return jr(e,27)}static bytes28(e){return jr(e,28)}static bytes29(e){return jr(e,29)}static bytes30(e){return jr(e,30)}static bytes31(e){return jr(e,31)}static bytes32(e){return jr(e,32)}static address(e){return new Rf(Mf,"address",e)}static bool(e){return new Rf(Mf,"bool",!!e)}static bytes(e){return new Rf(Mf,"bytes",e)}static string(e){return new Rf(Mf,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Rf(Mf,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===FL}static dereference(e,r){if(Rf.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};W0=new WeakMap;let ks=Rf;class h5e extends Pu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=ks.dereference(r,"string");try{n=Qt(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Qt(tc(e.readValue(),20))}}class p5e extends Pu{constructor(r){super(r.name,r.type,"_",r.dynamic);de(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function gQ(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const f=l.localName;return Le(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),Le(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),c[f]=!0,r[f]})}else ve(!1,"invalid tuple value","tuple",r);ve(e.length===n.length,"types/value length mismatch","tuple",r);let i=new Q7,s=new Q7,o=[];e.forEach((c,l)=>{let f=n[l];if(c.dynamic){let u=s.length;c.encode(s,f);let p=i.writeUpdatableValue();o.push(g=>{p(g+u)})}else c.encode(i,f)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function yQ(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(Is(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(Is(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Gg.fromItems(r,n)}class v5e extends Pu{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);de(this,"coder");de(this,"length");Ot(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+E5e))&&this._throwError("value out-of-bounds",n),i=ik(i,8*Qs)}else(iP0(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=P0(r.readValue(),this.size*8);return this.signed&&(n=T5(n,this.size*8)),n}}class S5e extends mQ{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Ii(ks.dereference(r,"string")))}decode(e){return Ip(super.decode(e))}}class w6 extends Pu{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);de(this,"coders");Ot(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=ks.dereference(n,"tuple");return gQ(r,this.coders,i)}decode(r){return yQ(r,this.coders)}}function Oo(t){return gr(Ii(t))}var _5e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const jL=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),UL=4;function I5e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let F=1;F>--c&1}const u=31,p=2**u,g=p>>>1,y=g>>1,b=p-1;let I=0;for(let F=0;F1;){let ce=z+_>>>1;F>>1|f(),$=$<<1^g,ie=(ie^g)<<1|g|1;S=$,O=1+ie-$}let L=n-4;return C.map(F=>{switch(F-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return F-1}})}function T5e(t){let e=0;return()=>t[e++]}function bQ(t){return T5e(I5e(P5e(t)))}function P5e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function k5e(t){return t&1?~t>>1:t>>1}function M5e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=gw(t);if(e.length)return e})}function xQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(R5e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(O5e(r,t))}return e.flat()}function yw(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function EQ(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function R5e(t,e){let r=1+e(),n=e(),i=yw(e);return EQ(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((f,u)=>{let p=u*n;return[c+u*r,l.map(g=>g+p)]})})}function O5e(t,e){let r=1+e();return EQ(r,1+t,e).map(i=>[i[0],i.slice(1)])}function D5e(t){let e=[],r=gw(t);return i(n([]),[]),e;function n(s){let o=t(),a=yw(()=>{let c=gw(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let f of l.Q)i(l,[...a,f],c)}}}function N5e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function CQ(t){return`{${N5e(t)}}`}function B5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function _Q(t){return t&16777215}let i_,$L,s_,c3;function z5e(){let t=bQ(F5e);i_=new Map(wQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),$L=new Set(gw(t)),s_=new Map,c3=new Map;for(let[e,r]of xQ(t)){if(!$L.has(e)&&r.length==2){let[n,i]=r,s=c3.get(n);s||(s=new Map,c3.set(n,s)),s.set(i,e)}s_.set(e,r.reverse())}}function IQ(t){return t>=mw&&t=M5&&t<$5e&&e>=R5&&eO5&&e0&&i(O5+l)}else{let o=s_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Jm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=H5e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function PQ(t){return TQ(t).map(_Q)}function W5e(t){return G5e(TQ(t))}const qL=45,kQ=".",MQ=65039,RQ=1,N5=t=>Array.from(t);function bw(t,e){return t.P.has(e)||t.Q.has(e)}class K5e extends Array{get is_emoji(){return!0}}let o_,OQ,M0,a_,DQ,Rv,i9,q1,v0,VL,c_;function mk(){if(o_)return;let t=bQ(_5e);const e=()=>gw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));o_=new Map(xQ(t)),OQ=r(),M0=e(),a_=new Set(e().map(f=>M0[f])),M0=new Set(M0),DQ=r(),r();let i=wQ(t),s=t();const o=()=>{let f=new Set;return e().forEach(u=>n(f,i[u])),n(f,e()),f};Rv=yw(f=>{let u=yw(t).map(p=>p+96);if(u.length){let p=f>=s;u[0]-=32,u=Xg(u),p&&(u=`Restricted[${u}]`);let g=o(),y=o(),b=!t();return{N:u,P:g,Q:y,M:b,R:p}}}),i9=r(),q1=new Map;let a=e().concat(N5(i9)).sort((f,u)=>f-u);a.forEach((f,u)=>{let p=t(),g=a[u]=p?a[u-p]:{V:[],M:new Map};g.V.push(f),i9.has(f)||q1.set(f,g)});for(let{V:f,M:u}of new Set(q1.values())){let p=[];for(let y of f){let b=Rv.filter(C=>bw(C,y)),I=p.find(({G:C})=>b.some(S=>C.has(S)));I||(I={G:new Set,V:[]},p.push(I)),I.V.push(y),n(I.G,b)}let g=p.flatMap(y=>N5(y.G));for(let{G:y,V:b}of p){let I=new Set(g.filter(C=>!y.has(C)));for(let C of b)u.set(C,I)}}v0=new Set;let c=new Set;const l=f=>v0.has(f)?c.add(f):v0.add(f);for(let f of Rv){for(let u of f.P)l(u);for(let u of f.Q)l(u)}for(let f of v0)!q1.has(f)&&!c.has(f)&&q1.set(f,RQ);n(v0,PQ(v0)),VL=D5e(t).map(f=>K5e.from(f)).sort(L5e),c_=new Map;for(let f of VL){let u=[c_];for(let p of f){let g=u.map(y=>{let b=y.get(p);return b||(b=new Map,y.set(p,b)),b});p===MQ?u.push(...g):u=g}for(let p of u)p.V=f}}function bk(t){return(NQ(t)?"":`${wk(B8([t]))} `)+CQ(t)}function wk(t){return`"${t}"‎`}function Y5e(t){if(t.length>=4&&t[2]==qL&&t[3]==qL)throw new Error(`invalid label extension: "${Xg(t.slice(0,4))}"`)}function Q5e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function J5e(t){let e=t[0],r=jL.get(e);if(r)throw Ab(`leading ${r}`);let n=t.length,i=-1;for(let s=1;se&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o{let s=B5e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=s4e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let f=o.output=a.flat();if(Q5e(f),!(o.emoji=c>1||a[0].is_emoji)&&f.every(p=>p<128))Y5e(f),l="ASCII";else{let p=a.flatMap(g=>g.is_emoji?[]:g);if(!p.length)l="Emoji";else{if(M0.has(f[0]))throw Ab("leading combining mark");for(let b=1;bo.has(a)):N5(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>bw(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function r4e(t){let e=Rv;for(let r of t){let n=e.filter(i=>bw(i,r));if(!n.length)throw Rv.some(i=>bw(i,r))?LQ(e[0],r):BQ(r);if(e=n,n.length==1)break}return e}function n4e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${wk(B8(e,63))}: ${i}`)}return Xg(n)}).join(kQ)}function BQ(t){return new Error(`disallowed character: ${bk(t)}`)}function LQ(t,e){let r=bk(e),n=Rv.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Ab(t){return new Error(`illegal placement: ${t}`)}function i4e(t,e){for(let r of e)if(!bw(t,r))throw LQ(t,r);if(t.M){let r=PQ(e);for(let n=1,i=r.length;nUL)throw new Error(`excessive non-spacing marks: ${wk(B8(r.slice(n-1,s)))} (${s-n}/${UL})`);n=s}}}function s4e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=a4e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(v0.has(o))i.push(o);else{let a=o_.get(o);if(a)i.push(...a);else if(!OQ.has(o))throw BQ(o)}}}return i.length&&n.push(e(i)),n}function o4e(t){return t.filter(e=>e!=MQ)}function a4e(t,e){let r=c_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const FQ=new Uint8Array(32);FQ.fill(0);function zL(t){return ve(t.length!==0,"invalid ENS name; empty component","comp",t),t}function jQ(t){const e=Ii(c4e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{ve(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function s9(t,e){return{address:Qt(t),storageKeys:e.map((r,n)=>(ve(Gr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Wp(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(ve(r.length===2,"invalid slot set",`value[${n}]`,r),s9(r[0],r[1])):(ve(r!=null&&typeof r=="object","invalid address-slot set","value",t),s9(r.address,r.storageKeys)));ve(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return s9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function yx(t){let e;return typeof t=="string"?e=Jd.computePublicKey(t,!1):e=t.publicKey,Qt(gr("0x"+e.substring(4)).substring(26))}function B5(t,e){return yx(Jd.recoverPublicKey(t,e))}const Di=BigInt(0),f4e=BigInt(2),u4e=BigInt(27),d4e=BigInt(28),h4e=BigInt(35),p4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),o9=4096*32;function HL(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=sc(e).substring(4),"0x"+r}function L8(t){return t==="0x"?null:Qt(t)}function xk(t,e){try{return Wp(t)}catch(r){ve(!1,r.message,e,t)}}function mx(t,e){return t==="0x"?0:or(t,e)}function ci(t,e){if(t==="0x")return Di;const r=Pt(t,e);return ve(r<=p4e,"value exceeds uint size",e,r),r}function Cn(t,e){const r=Pt(t,"value"),n=ts(r);return ve(n.length<=32,"value too large",`tx.${e}`,r),n}function Ek(t){return Wp(t).map(e=>[e.address,e.storageKeys])}function v4e(t,e){ve(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;ri.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):qr(["0x03",Tp(n)])}var _l,ng,ig,sg,og,ag,cg,lg,fg,ug,dg,hg,K0,wd,$f,xd,pg,l3;const Of=class Of{constructor(){Ie(this,pg);Ie(this,_l);Ie(this,ng);Ie(this,ig);Ie(this,sg);Ie(this,og);Ie(this,ag);Ie(this,cg);Ie(this,lg);Ie(this,fg);Ie(this,ug);Ie(this,dg);Ie(this,hg);Ie(this,K0);Ie(this,wd);Ie(this,$f);Ie(this,xd);ue(this,_l,null),ue(this,ng,null),ue(this,sg,0),ue(this,og,Di),ue(this,ag,null),ue(this,cg,null),ue(this,lg,null),ue(this,ig,"0x"),ue(this,fg,Di),ue(this,ug,Di),ue(this,dg,null),ue(this,hg,null),ue(this,K0,null),ue(this,wd,null),ue(this,xd,null),ue(this,$f,null)}get type(){return Q(this,_l)}set type(e){switch(e){case null:ue(this,_l,null);break;case 0:case"legacy":ue(this,_l,0);break;case 1:case"berlin":case"eip-2930":ue(this,_l,1);break;case 2:case"london":case"eip-1559":ue(this,_l,2);break;case 3:case"cancun":case"eip-4844":ue(this,_l,3);break;default:ve(!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"}return null}get to(){const e=Q(this,ng);return e==null&&this.type===3?bu:e}set to(e){ue(this,ng,e==null?null:Qt(e))}get nonce(){return Q(this,sg)}set nonce(e){ue(this,sg,or(e,"value"))}get gasLimit(){return Q(this,og)}set gasLimit(e){ue(this,og,Pt(e))}get gasPrice(){const e=Q(this,ag);return e==null&&(this.type===0||this.type===1)?Di:e}set gasPrice(e){ue(this,ag,e==null?null:Pt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Q(this,cg);return e??(this.type===2||this.type===3?Di:null)}set maxPriorityFeePerGas(e){ue(this,cg,e==null?null:Pt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Q(this,lg);return e??(this.type===2||this.type===3?Di:null)}set maxFeePerGas(e){ue(this,lg,e==null?null:Pt(e,"maxFeePerGas"))}get data(){return Q(this,ig)}set data(e){ue(this,ig,Me(e))}get value(){return Q(this,fg)}set value(e){ue(this,fg,Pt(e,"value"))}get chainId(){return Q(this,ug)}set chainId(e){ue(this,ug,Pt(e))}get signature(){return Q(this,dg)||null}set signature(e){ue(this,dg,e==null?null:wu.from(e))}get accessList(){const e=Q(this,hg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){ue(this,hg,e==null?null:Wp(e))}get maxFeePerBlobGas(){const e=Q(this,K0);return e==null&&this.type===3?Di:e}set maxFeePerBlobGas(e){ue(this,K0,e==null?null:Pt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=Q(this,wd);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){ve(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;rObject.assign({},e))}set blobs(e){if(e==null){ue(this,xd,null);return}const r=[],n=[];for(let i=0;i=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=Q(this,K0)!=null||Q(this,wd);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Le(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Le(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Le(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Of.from(this)}toJSON(){const e=r=>r==null?null:r.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}}static from(e){if(e==null)return new Of;if(typeof e=="string"){const n=Ue(e);if(n[0]>=127)return Of.from(g4e(n));switch(n[0]){case 1:return Of.from(w4e(n));case 2:return Of.from(m4e(n));case 3:return Of.from(E4e(n))}Le(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Of;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=wu.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(ve(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),ve(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(ve(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),ve(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};_l=new WeakMap,ng=new WeakMap,ig=new WeakMap,sg=new WeakMap,og=new WeakMap,ag=new WeakMap,cg=new WeakMap,lg=new WeakMap,fg=new WeakMap,ug=new WeakMap,dg=new WeakMap,hg=new WeakMap,K0=new WeakMap,wd=new WeakMap,$f=new WeakMap,xd=new WeakMap,pg=new WeakSet,l3=function(e,r){Le(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return y4e(this,n);case 1:return x4e(this,n);case 2:return b4e(this,n);case 3:return C4e(this,n,r?this.blobs:null)}Le(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let ww=Of;function Ak(t){return typeof t=="string"&&(t=Ii(t)),gr(qr([Ii(o5e),Ii(String(t.length)),t]))}function A4e(t,e){const r=Ak(t);return B5(r,e)}const S4e=new RegExp("^bytes([0-9]+)$"),_4e=new RegExp("^(u?int)([0-9]*)$"),I4e=new RegExp("^(.*)\\[([0-9]*)\\]$");function UQ(t,e,r){switch(t){case"address":return Ue(r?Kc(e,32):Qt(e));case"string":return Ii(e);case"bytes":return Ue(e);case"bool":return e=e?"0x01":"0x00",Ue(r?Kc(e,32):e)}let n=t.match(_4e);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return ve((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=ik(e,s)),Ue(Kc(ts(e),s/8))}if(n=t.match(S4e),n){const i=parseInt(n[1]);return ve(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),ve(fp(e)===i,`invalid value for ${t}`,"value",e),r?Ue(oY(e,32)):e}if(n=t.match(I4e),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));ve(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(UQ(i,a,!0))}),Ue(qr(o))}ve(!1,"invalid type","type",t)}function Cr(t,e){ve(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(UQ(n,e[i]))}),Me(qr(r))}function dp(t,e){return gr(Cr(t,e))}const $Q=new Uint8Array(32);$Q.fill(0);const T4e=BigInt(-1),qQ=BigInt(0),VQ=BigInt(1),P4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function k4e(t){const e=Ue(t),r=e.length%32;return r?qr([e,$Q.slice(r)]):Me(e)}const M4e=tc(VQ,32),R4e=tc(qQ,32),GL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},a9=["name","version","chainId","verifyingContract","salt"];function WL(t){return function(e){return ve(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const O4e={name:WL("name"),version:WL("version"),chainId:function(t){const e=Pt(t,"domain.chainId");return ve(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):zc(e)},verifyingContract:function(t){try{return Qt(t).toLowerCase()}catch{}ve(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ue(t,"domain.salt");return ve(e.length===32,'invalid domain value "salt"',"domain.salt",t),Me(e)}};function c9(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);ve(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=P0(P4e,r?n-1:n),s=r?(i+VQ)*T4e:qQ;return function(o){const a=Pt(o,"value");return ve(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),tc(r?ik(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return ve(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=Ue(n);return ve(i.length===r,`invalid length for ${t}`,"value",n),k4e(n)}}}switch(t){case"address":return function(e){return Kc(Qt(e),32)};case"bool":return function(e){return e?M4e:R4e};case"bytes":return function(e){return gr(e)};case"string":return function(e){return Oo(e)}}return null}function KL(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function x6(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var Fw,qf,vg,y4,zQ;const Ua=class Ua{constructor(e){Ie(this,y4);de(this,"primaryType");Ie(this,Fw);Ie(this,qf);Ie(this,vg);ue(this,qf,new Map),ue(this,vg,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:f})=>{let{base:u,index:p}=x6(f);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(p||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),ue(this,Fw,JSON.stringify(s));for(const c in s){const l=new Set;for(const f of s[c]){ve(!l.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),l.add(f.name);const u=x6(f.type).base;ve(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!c9(u)&&(ve(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),r.get(c).add(u))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);ve(o.length!==0,"missing primary type","types",e),ve(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Ot(this,{primaryType:o[0]});function a(c,l){ve(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const f of r.get(c))if(n.has(f)){a(f,l);for(const u of l)i.get(u).add(f)}l.delete(c)}a(this.primaryType,new Set);for(const[c,l]of i){const f=Array.from(l);f.sort(),Q(this,qf).set(c,KL(c,s[c])+f.map(u=>KL(u,s[u])).join(""))}}get types(){return JSON.parse(Q(this,Fw))}getEncoder(e){let r=Q(this,vg).get(e);return r||(r=qe(this,y4,zQ).call(this,e),Q(this,vg).set(e,r)),r}encodeType(e){const r=Q(this,qf).get(e);return ve(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return gr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(c9(e))return n(e,r);const i=x6(e).array;if(i)return ve(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});ve(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Ua(e)}static getPrimaryType(e){return Ua.from(e).primaryType}static hashStruct(e,r,n){return Ua.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=GL[n];ve(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>a9.indexOf(n.name)-a9.indexOf(i.name)),Ua.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return qr(["0x1901",Ua.hashDomain(e),Ua.from(r).hash(n)])}static hash(e,r,n){return gr(Ua.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Gr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Ua.from(r);o.visit(n,(a,c)=>(a==="address"&&!Gr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){Ua.hashDomain(e);const i={},s=[];a9.forEach(c=>{const l=e[c];l!=null&&(i[c]=O4e[c](l),s.push({name:c,type:GL[c]}))});const o=Ua.from(r);r=o.types;const a=Object.assign({},r);return ve(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Me(Ue(l));if(c.match(/^u?int/))return Pt(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return ve(typeof l=="string","invalid string","value",l),l}ve(!1,"unsupported type","type",c)})}}};Fw=new WeakMap,qf=new WeakMap,vg=new WeakMap,y4=new WeakSet,zQ=function(e){{const i=c9(e);if(i)return i}const r=x6(e).array;if(r){const i=r.prefix,s=this.getEncoder(i);return o=>{ve(r.count===-1||r.count===o.length,`array length mismatch; expected length ${r.count}`,"value",o);let a=o.map(s);return Q(this,qf).has(i)&&(a=a.map(gr)),gr(qr(a))}}const n=this.types[e];if(n){const i=Oo(Q(this,qf).get(e));return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return Q(this,qf).has(c)?gr(l):l});return o.unshift(i),qr(o)}}ve(!1,`unknown type: ${e}`,"type",e)};let uh=Ua;function Js(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const D4e="external public payable override",N4e=Js(D4e.split(" ")),HQ="constant external internal payable private public pure view override",B4e=Js(HQ.split(" ")),GQ="constructor error event fallback function receive struct",WQ=Js(GQ.split(" ")),KQ="calldata memory storage payable indexed",L4e=Js(KQ.split(" ")),F4e="tuple returns",j4e=[GQ,KQ,F4e,HQ].join(" "),U4e=Js(j4e.split(" ")),$4e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},q4e=new RegExp("^(\\s*)"),V4e=new RegExp("^([0-9]+)"),z4e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),YQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),QQ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Yi,Fc,jw,f_;const m4=class m4{constructor(e){Ie(this,jw);Ie(this,Yi);Ie(this,Fc);ue(this,Yi,0),ue(this,Fc,e.slice())}get offset(){return Q(this,Yi)}get length(){return Q(this,Fc).length-Q(this,Yi)}clone(){return new m4(Q(this,Fc))}reset(){ue(this,Yi,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=qe(this,jw,f_).call(this,Q(this,Yi)+1,e.match+1);return ue(this,Yi,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;Q(this,Yi)=Q(this,Fc).length)throw new Error("out-of-bounds");return Q(this,Fc)[Q(this,Yi)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return dm(this,Yi)._++,e}toString(){const e=[];for(let r=Q(this,Yi);r`}};Yi=new WeakMap,Fc=new WeakMap,jw=new WeakSet,f_=function(e=0,r=0){return new m4(Q(this,Fc).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Jc=m4;function Rh(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;f=u+f,e[e.length-1].value=or(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(z4e),a){if(c.text=a[1],s+=c.text.length,U4e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(QQ)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(V4e),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Jc(e.map(o=>Object.freeze(o)))}function YL(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function F8(t,e){if(e.peekKeyword(WQ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function xu(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function JQ(t){let e=xu(t,B4e);return YL(e,Js("constant payable nonpayable".split(" "))),YL(e,Js("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function cu(t,e){return t.popParams().map(r=>ss.from(r,e))}function ZQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Pt(t.pop().text);throw new Error("invalid gas")}return null}function Pp(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const H4e=new RegExp(/^(.*)\[([0-9]*)\]$/);function QL(t){const e=t.match(QQ);if(ve(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);ve(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);ve(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const Rn={},Do=Symbol.for("_ethers_internal"),JL="_ParamTypeInternal",ZL="_ErrorInternal",XL="_EventInternal",eF="_ConstructorInternal",tF="_FallbackInternal",rF="_FunctionInternal",nF="_StructInternal";var gg,f3;const $a=class $a{constructor(e,r,n,i,s,o,a,c){Ie(this,gg);de(this,"name");de(this,"type");de(this,"baseType");de(this,"indexed");de(this,"components");de(this,"arrayLength");de(this,"arrayChildren");if(kh(e,Rn,"ParamType"),Object.defineProperty(this,Do,{value:JL}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Ot(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return qe(this,gg,f3).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if($a.isParamType(e))return e;if(typeof e=="string")try{return $a.from(Rh(e),r)}catch{ve(!1,"invalid param type","obj",e)}else if(e instanceof Jc){let a="",c="",l=null;xu(e,Js(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(b=>$a.from(b)),a=`tuple(${l.map(b=>b.format()).join(",")})`):(a=QL(e.popType("TYPE")),c=a);let f=null,u=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new $a(Rn,"",a,c,null,l,u,f),u=b.value,a+=b.text,c="array",l=null}let p=null;if(xu(e,L4e).has("indexed")){if(!r)throw new Error("");p=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new $a(Rn,y,a,c,p,l,u,f)}const n=e.name;ve(!n||typeof n=="string"&&n.match(YQ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(ve(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(H4e);if(o){const a=parseInt(o[2]||"-1"),c=$a.from({type:o[1],components:e.components});return new $a(Rn,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(l=>$a.from(l)):null;return new $a(Rn,n||"",s,"tuple",i,a,null,null)}return s=QL(e.type),new $a(Rn,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Do]===JL}};gg=new WeakSet,f3=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((c,l)=>{var f;qe(f=o,gg,f3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,l)=>{var f;qe(f=o[l],gg,f3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let ss=$a;class kp{constructor(e,r,n){de(this,"type");de(this,"inputs");kh(e,Rn,"Fragment"),n=Object.freeze(n.slice()),Ot(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{kp.from(JSON.parse(e))}catch{}return kp.from(Rh(e))}if(e instanceof Jc)switch(e.peekKeyword(WQ)){case"constructor":return Xf.from(e);case"error":return Io.from(e);case"event":return Nl.from(e);case"fallback":case"receive":return Nf.from(e);case"function":return Bl.from(e);case"struct":return hp.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Xf.from(e);case"error":return Io.from(e);case"event":return Nl.from(e);case"fallback":case"receive":return Nf.from(e);case"function":return Bl.from(e);case"struct":return hp.from(e)}Le(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}ve(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Xf.isFragment(e)}static isError(e){return Io.isFragment(e)}static isEvent(e){return Nl.isFragment(e)}static isFunction(e){return Bl.isFragment(e)}static isStruct(e){return hp.isFragment(e)}}class j8 extends kp{constructor(r,n,i,s){super(r,n,s);de(this,"name");ve(typeof i=="string"&&i.match(YQ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Ot(this,{name:i})}}function xw(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Io extends j8{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Do,{value:ZL})}get selector(){return Oo(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+xw(e,this.inputs)),r.join(" ")}static from(e){if(Io.isFragment(e))return e;if(typeof e=="string")return Io.from(Rh(e));if(e instanceof Jc){const r=F8("error",e),n=cu(e);return Pp(e),new Io(Rn,r,n)}return new Io(Rn,e.name,e.inputs?e.inputs.map(ss.from):[])}static isFragment(e){return e&&e[Do]===ZL}}class Nl extends j8{constructor(r,n,i,s){super(r,"event",n,i);de(this,"anonymous");Object.defineProperty(this,Do,{value:XL}),Ot(this,{anonymous:s})}get topicHash(){return Oo(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+xw(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>ss.from(s)),new Nl(Rn,r,n,!1).topicHash}static from(r){if(Nl.isFragment(r))return r;if(typeof r=="string")try{return Nl.from(Rh(r))}catch{ve(!1,"invalid event fragment","obj",r)}else if(r instanceof Jc){const n=F8("event",r),i=cu(r,!0),s=!!xu(r,Js(["anonymous"])).has("anonymous");return Pp(r),new Nl(Rn,n,i,s)}return new Nl(Rn,r.name,r.inputs?r.inputs.map(n=>ss.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[Do]===XL}}class Xf extends kp{constructor(r,n,i,s,o){super(r,n,i);de(this,"payable");de(this,"gas");Object.defineProperty(this,Do,{value:eF}),Ot(this,{payable:s,gas:o})}format(r){if(Le(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${xw(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(Xf.isFragment(r))return r;if(typeof r=="string")try{return Xf.from(Rh(r))}catch{ve(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof Jc){xu(r,Js(["constructor"]));const n=cu(r),i=!!xu(r,N4e).has("payable"),s=ZQ(r);return Pp(r),new Xf(Rn,"constructor",n,i,s)}return new Xf(Rn,"constructor",r.inputs?r.inputs.map(ss.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===eF}}class Nf extends kp{constructor(r,n,i){super(r,"fallback",n);de(this,"payable");Object.defineProperty(this,Do,{value:tF}),Ot(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Nf.isFragment(r))return r;if(typeof r=="string")try{return Nf.from(Rh(r))}catch{ve(!1,"invalid fallback fragment","obj",r)}else if(r instanceof Jc){const n=r.toString(),i=r.peekKeyword(Js(["fallback","receive"]));if(ve(i,"type must be fallback or receive","obj",n),r.popKeyword(Js(["fallback","receive"]))==="receive"){const c=cu(r);return ve(c.length===0,"receive cannot have arguments","obj.inputs",c),xu(r,Js(["payable"])),Pp(r),new Nf(Rn,[],!0)}let o=cu(r);o.length?ve(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[ss.from("bytes")];const a=JQ(r);if(ve(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),xu(r,Js(["returns"])).has("returns")){const c=cu(r);ve(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Pp(r),new Nf(Rn,o,a==="payable")}if(r.type==="receive")return new Nf(Rn,[],!0);if(r.type==="fallback"){const n=[ss.from("bytes")],i=r.stateMutability==="payable";return new Nf(Rn,n,i)}ve(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[Do]===tF}}class Bl extends j8{constructor(r,n,i,s,o,a){super(r,"function",n,s);de(this,"constant");de(this,"outputs");de(this,"stateMutability");de(this,"payable");de(this,"gas");Object.defineProperty(this,Do,{value:rF}),o=Object.freeze(o.slice()),Ot(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Oo(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+xw(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(xw(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>ss.from(s)),new Bl(Rn,r,"view",n,[],null).selector}static from(r){if(Bl.isFragment(r))return r;if(typeof r=="string")try{return Bl.from(Rh(r))}catch{ve(!1,"invalid function fragment","obj",r)}else if(r instanceof Jc){const i=F8("function",r),s=cu(r),o=JQ(r);let a=[];xu(r,Js(["returns"])).has("returns")&&(a=cu(r));const c=ZQ(r);return Pp(r),new Bl(Rn,i,o,s,a,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Bl(Rn,r.name,n,r.inputs?r.inputs.map(ss.from):[],r.outputs?r.outputs.map(ss.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Do]===rF}}class hp extends j8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Do,{value:nF})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return hp.from(Rh(e))}catch{ve(!1,"invalid struct fragment","obj",e)}else if(e instanceof Jc){const r=F8("struct",e),n=cu(e);return Pp(e),new hp(Rn,r,n)}return new hp(Rn,e.name,e.inputs?e.inputs.map(ss.from):[])}static isFragment(e){return e&&e[Do]===nF}}const tl=new Map;tl.set(0,"GENERIC_PANIC");tl.set(1,"ASSERT_FALSE");tl.set(17,"OVERFLOW");tl.set(18,"DIVIDE_BY_ZERO");tl.set(33,"ENUM_RANGE_ERROR");tl.set(34,"BAD_STORAGE_DATA");tl.set(49,"STACK_UNDERFLOW");tl.set(50,"ARRAY_RANGE_ERROR");tl.set(65,"OUT_OF_MEMORY");tl.set(81,"UNINITIALIZED_FUNCTION_CALL");const G4e=new RegExp(/^bytes([0-9]*)$/),W4e=new RegExp(/^(u?int)([0-9]*)$/);let l9=null,iF=1024;function K4e(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const l=Ue(r);if(r=Me(r),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Me(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Me(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${tl.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?Qt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=Qt(e.from)),zn(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var Ed,V1;const b4=class b4{constructor(){Ie(this,Ed)}getDefaultValue(e){const r=e.map(i=>qe(this,Ed,V1).call(this,ss.from(i)));return new w6(r,"_").defaultValue()}encode(e,r){rY(r.length,e.length,"types/values length mismatch");const n=e.map(o=>qe(this,Ed,V1).call(this,ss.from(o))),i=new w6(n,"_"),s=new Q7;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>qe(this,Ed,V1).call(this,ss.from(o)));return new w6(i,"_").decode(new J7(r,n,iF))}static _setDefaultMaxInflation(e){ve(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),iF=e}static defaultAbiCoder(){return l9==null&&(l9=new b4),l9}static getBuiltinCallException(e,r,n){return K4e(e,r,n,b4.defaultAbiCoder())}};Ed=new WeakSet,V1=function(e){if(e.isArray())return new v5e(qe(this,Ed,V1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new w6(e.components.map(n=>qe(this,Ed,V1).call(this,n)),e.name);switch(e.baseType){case"address":return new h5e(e.name);case"bool":return new g5e(e.name);case"string":return new S5e(e.name);case"bytes":return new y5e(e.name);case"":return new w5e(e.name)}let r=e.type.match(W4e);if(r){let n=parseInt(r[2]||"256");return ve(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new A5e(n/8,r[1]==="int",e.name)}if(r=e.type.match(G4e),r){let n=parseInt(r[1]);return ve(n!==0&&n<=32,"invalid bytes length","param",e),new m5e(n,e.name)}ve(!1,"invalid type","type",e.type)};let Ns=b4;class Y4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"signature");de(this,"topic");de(this,"args");const i=e.name,s=e.format();Ot(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class Q4e{constructor(e,r,n,i){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");de(this,"value");const s=e.name,o=e.format();Ot(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class J4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");const i=e.name,s=e.format();Ot(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class sF{constructor(e){de(this,"hash");de(this,"_isIndexed");Ot(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const oF={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},aF={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&oF[t.toString()]&&(e=oF[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Il,Tl,Pl,ws,Kl,u3,d3;const A0=class A0{constructor(e){Ie(this,Kl);de(this,"fragments");de(this,"deploy");de(this,"fallback");de(this,"receive");Ie(this,Il);Ie(this,Tl);Ie(this,Pl);Ie(this,ws);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ue(this,Pl,new Map),ue(this,Il,new Map),ue(this,Tl,new Map);const n=[];for(const o of r)try{n.push(kp.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Ot(this,{fragments:Object.freeze(n)});let i=null,s=!1;ue(this,ws,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ot(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(ve(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=Q(this,Pl);break;case"event":c=Q(this,Tl);break;case"error":c=Q(this,Il);break;default:return}const l=o.format();c.has(l)||c.set(l,o)}),this.deploy||Ot(this,{deploy:Xf.from("constructor()")}),Ot(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Ns.defaultAbiCoder()}getFunctionName(e){const r=qe(this,Kl,u3).call(this,e,null,!1);return ve(r,"no matching function","key",e),r.name}hasFunction(e){return!!qe(this,Kl,u3).call(this,e,null,!1)}getFunction(e,r){return qe(this,Kl,u3).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(Q(this,Pl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");ve(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=Io.from(e).format(),e==="Error(string)")return Io.from("error Error(string)");if(e==="Panic(uint256)")return Io.from("error Panic(uint256)");const n=Q(this,Il).get(e);return n||null}forEachError(e){const r=Array.from(Q(this,Il).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Oo(o):s.type==="bytes"?gr(Me(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=tc(o):s.type.match(/^bytes/)?o=oY(o,32):s.type==="address"&&Q(this,ws).encode(["address"],[o]),Kc(Me(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){ve(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ve(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);ve(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),ve(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Oo(c));else if(o.type==="bytes")n.push(gr(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(Q(this,ws).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:Q(this,ws).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const g=this.getEvent(e);ve(g,"unknown event","eventFragment",e),e=g}if(n!=null&&!e.anonymous){const g=e.topicHash;ve(Gr(n[0],32)&&n[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((g,y)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(ss.from({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});const a=n!=null?Q(this,ws).decode(i,qr(n)):null,c=Q(this,ws).decode(s,r,!0),l=[],f=[];let u=0,p=0;return e.inputs.forEach((g,y)=>{let b=null;if(g.indexed)if(a==null)b=new sF(null);else if(o[y])b=new sF(a[p++]);else try{b=a[p++]}catch(I){b=I}else try{b=c[u++]}catch(I){b=I}l.push(b),f.push(g.name||null)}),Gg.fromItems(l,f)}parseTransaction(e){const r=Ue(e.data,"tx.data"),n=Pt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Me(r.slice(0,4)));if(!i)return null;const s=Q(this,ws).decode(i.inputs,r.slice(4));return new Q4e(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new Y4e(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=Me(e),n=this.getError(mn(r,0,4));if(!n)return null;const i=Q(this,ws).decode(n.inputs,mn(r,4));return new J4e(n,n.selector,i)}static from(e){return e instanceof A0?e:typeof e=="string"?new A0(JSON.parse(e)):typeof e.formatJson=="function"?new A0(e.formatJson()):typeof e.format=="function"?new A0(e.format("json")):new A0(e)}};Il=new WeakMap,Tl=new WeakMap,Pl=new WeakMap,ws=new WeakMap,Kl=new WeakSet,u3=function(e,r,n){if(Gr(e)){const s=e.toLowerCase();for(const o of Q(this,Pl).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,Pl))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,c=!0;ks.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let l=s.length-1;l>=0;l--){const f=s[l].inputs.length;f!==a&&(!c||f!==a-1)&&s.splice(l,1)}for(let l=s.length-1;l>=0;l--){const f=s[l].inputs;for(let u=0;u=f.length){if(r[u].type==="overrides")continue;s.splice(l,1);break}if(r[u].type!==f[u].baseType){s.splice(l,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ve(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,Pl).get(Bl.from(e).format());return i||null},d3=function(e,r,n){if(Gr(e)){const s=e.toLowerCase();for(const o of Q(this,Tl).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,Tl))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let c=0;c1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ve(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,Tl).get(Nl.from(e).format());return i||null};let $i=A0;const XQ=BigInt(0);function Ov(t){return t??null}function si(t){return t==null?null:t.toString()}class cF{constructor(e,r,n){de(this,"gasPrice");de(this,"maxFeePerGas");de(this,"maxPriorityFeePerGas");Ot(this,{gasPrice:Ov(e),maxFeePerGas:Ov(r),maxPriorityFeePerGas:Ov(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:si(e),maxFeePerGas:si(r),maxPriorityFeePerGas:si(n)}}}function Ew(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Me(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Pt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=or(t[i],`request.${i}`));return t.accessList&&(e.accessList=Wp(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>mu(i)?Me(i):Object.assign({},i))),e}var Vf;class Z4e{constructor(e,r){de(this,"provider");de(this,"number");de(this,"hash");de(this,"timestamp");de(this,"parentHash");de(this,"parentBeaconBlockRoot");de(this,"nonce");de(this,"difficulty");de(this,"gasLimit");de(this,"gasUsed");de(this,"stateRoot");de(this,"receiptsRoot");de(this,"blobGasUsed");de(this,"excessBlobGas");de(this,"miner");de(this,"prevRandao");de(this,"extraData");de(this,"baseFeePerGas");Ie(this,Vf);ue(this,Vf,e.transactions.map(n=>typeof n!="string"?new Cw(n,r):n)),Ot(this,{provider:r,hash:Ov(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Ov(e.prevRandao),extraData:e.extraData,baseFeePerGas:Ov(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return Q(this,Vf).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=Q(this,Vf).slice();return e.length===0?[]:(Le(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,timestamp:b,transactions:I}=this;return{_type:"Block",baseFeePerGas:si(e),difficulty:si(r),extraData:n,gasLimit:si(i),gasUsed:si(s),blobGasUsed:si(this.blobGasUsed),excessBlobGas:si(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,timestamp:b,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,transactions:I}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew bx(i,r))));let n=XQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Ot(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return Q(this,Uw)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:f,root:u}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:si(this.cumulativeGasUsed),from:r,gasPrice:si(this.gasPrice),blobGasUsed:si(this.blobGasUsed),blobGasPrice:si(this.blobGasPrice),gasUsed:si(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:u,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:g}=await vi({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g{if(p==null||p.status!==0)return p;Le(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((p,g)=>{const y=[],b=()=>{y.forEach(C=>C())};if(y.push(()=>{a=!0}),i>0){const C=setTimeout(()=>{b(),g(zn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(C)})}const I=async C=>{if(await C.confirmations()>=n){b();try{p(l(C))}catch(S){g(S)}}};if(y.push(()=>{this.provider.off(this.hash,I)}),this.provider.on(this.hash,I),s>=0){const C=async()=>{try{await c()}catch(S){if(Is(S,"TRANSACTION_REPLACED")){b(),g(S);return}}a||this.provider.once("block",C)};y.push(()=>{this.provider.off("block",C)}),this.provider.once("block",C)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),rJ(this)}reorderedEvent(e){return Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Le(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),tJ(this,e)}replaceableTransaction(e){ve(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new eR(this,this.provider);return ue(r,Cd,e),r}};Cd=new WeakMap;let Cw=eR;function X4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function tJ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function rJ(t){return{orphan:"drop-transaction",tx:t}}function e8e(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class Sk extends bx{constructor(r,n,i){super(r,r.provider);de(this,"interface");de(this,"fragment");de(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Ot(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class nJ extends bx{constructor(r,n){super(r,r.provider);de(this,"error");Ot(this,{error:n})}}var yg;class t8e extends eJ{constructor(r,n,i){super(i,n);Ie(this,yg);ue(this,yg,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?Q(this,yg).getEvent(r.topics[0]):null;if(n)try{return new Sk(r,Q(this,yg),n)}catch(i){return new nJ(r,i)}return r})}}yg=new WeakMap;var $w;class _k extends Cw{constructor(r,n,i){super(i,n);Ie(this,$w);ue(this,$w,r)}async wait(r,n){const i=await super.wait(r,n);return i==null?null:new t8e(Q(this,$w),this.provider,i)}}$w=new WeakMap;class iJ extends cY{constructor(r,n,i,s){super(r,n,i);de(this,"log");Ot(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class r8e extends iJ{constructor(e,r,n,i,s){super(e,r,n,new Sk(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Ot(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const lF=BigInt(0);function sJ(t){return t&&typeof t.call=="function"}function oJ(t){return t&&typeof t.estimateGas=="function"}function U8(t){return t&&typeof t.resolveName=="function"}function aJ(t){return t&&typeof t.sendTransaction=="function"}function cJ(t){if(t!=null){if(U8(t))return t;if(t.provider)return t.provider}}var qw;class n8e{constructor(e,r,n){Ie(this,qw);de(this,"fragment");if(Ot(this,{fragment:r}),r.inputs.lengthn[c]==null?null:a.walkAsync(n[c],(f,u)=>f==="address"?Array.isArray(u)?Promise.all(u.map(p=>rs(p,s))):rs(u,s):u)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return Q(this,qw)}}qw=new WeakMap;function Mp(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function R0(t){return t==null?null:t.provider||null}async function lJ(t,e){const r=ks.dereference(t,"overrides");ve(typeof r=="object","invalid overrides parameter","overrides",t);const n=Ew(r);return ve(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),ve(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function i8e(t,e,r){const n=Mp(t,"resolveName"),i=U8(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=ks.dereference(c,a),a==="address"?rs(c,i):c))))}function s8e(t){const e=async function(o){const a=await lJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await rs(a.from,cJ(t.runner)));const c=t.interface,l=Pt(a.value||lF,"overrides.value")===lF,f=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&ve(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),ve(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const u=c.receive||c.fallback&&c.fallback.payable;return ve(u||l,"cannot send value to non-payable fallback","overrides.value",a.value),ve(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Mp(t.runner,"call");Le(sJ(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(l){throw nk(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Le(aJ(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),l=R0(t.runner);return new _k(t.interface,l,c)},i=async function(o){const a=Mp(t.runner,"estimateGas");return Le(oJ(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Ot(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function o8e(t,e){const r=function(...l){const f=t.interface.getFunction(e,l);return Le(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),f},n=async function(...l){const f=r(...l);let u={};if(f.inputs.length+1===l.length&&(u=await lJ(l.pop()),u.from&&(u.from=await rs(u.from,cJ(t.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await i8e(t.runner,f.inputs,l);return Object.assign({},u,await vi({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...l){const f=await a(...l);return f.length===1?f[0]:f},s=async function(...l){const f=t.runner;Le(aJ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await f.sendTransaction(await n(...l)),p=R0(t.runner);return new _k(t.interface,p,u)},o=async function(...l){const f=Mp(t.runner,"estimateGas");return Le(oJ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},a=async function(...l){const f=Mp(t.runner,"call");Le(sJ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let p="0x";try{p=await f.call(u)}catch(y){throw nk(y)&&y.data?t.interface.makeError(y.data,u):y}const g=r(...l);return t.interface.decodeFunctionResult(g,p)},c=async(...l)=>r(...l).constant?await i(...l):await s(...l);return Ot(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=t.interface.getFunction(e);return Le(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function a8e(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Le(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new n8e(t,r(...i),i)};return Ot(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Le(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const L5=Symbol.for("_ethersInternal_contract"),fJ=new WeakMap;function c8e(t,e){fJ.set(t[L5],e)}function Zo(t){return fJ.get(t[L5])}function l8e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Ik(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Gr(o,32))return o;const a=t.interface.getEvent(o);return ve(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Gr(e,32)?r=[e]:(n=t.interface.getEvent(e),ve(n,"unknown fragment","event",e),r=[n.topicHash]):l8e(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):ve(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Zm(t,e){const{subs:r}=Zo(t);return r.get((await Ik(t,e)).tag)||null}async function fF(t,e,r){const n=R0(t.runner);Le(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Ik(t,r),{addr:a,subs:c}=Zo(t);let l=c.get(s);if(!l){const u={address:a||t,topics:o},p=I=>{let C=i;if(C==null)try{C=t.interface.getEvent(I.topics[0])}catch{}if(C){const S=C,O=i?t.interface.decodeEventLog(i,I.data,I.topics):[];d_(t,r,O,L=>new r8e(t,L,r,S,I))}else d_(t,r,[],S=>new iJ(t,S,r,I))};let g=[];l={tag:s,listeners:[],start:()=>{g.length||g.push(n.on(u,p))},stop:async()=>{if(g.length==0)return;let I=g;g=[],await Promise.all(I),n.off(u,p)}},c.set(s,l)}return l}let u_=Promise.resolve();async function f8e(t,e,r,n){await u_;const i=await Zm(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),Zo(t).subs.delete(i.tag)),s>0}async function d_(t,e,r,n){try{await u_}catch{}const i=f8e(t,e,r,n);return u_=i,await i}const E6=["then"];var $$;$$=L5;const jb=class jb{constructor(e,r,n,i){de(this,"target");de(this,"interface");de(this,"runner");de(this,"filters");de(this,$$);de(this,"fallback");ve(typeof e=="string"||vQ(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=$i.from(r);Ot(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,L5,{value:{}});let o,a=null,c=null;if(i){const u=R0(n);c=new _k(this.interface,u,i)}let l=new Map;if(typeof e=="string")if(Gr(e))a=e,o=Promise.resolve(e);else{const u=Mp(n,"resolveName");if(!U8(u))throw zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=u.resolveName(e).then(p=>{if(p==null)throw zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Zo(this).addr=p,p})}else o=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return Zo(this).addr=u,u});c8e(this,{addrPromise:o,addr:a,deployTx:c,subs:l});const f=new Proxy({},{get:(u,p,g)=>{if(typeof p=="symbol"||E6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return this.getEvent(p)}catch(y){if(!Is(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>E6.indexOf(p)>=0?Reflect.has(u,p):Reflect.has(u,p)||this.interface.hasEvent(String(p))});return Ot(this,{filters:f}),Ot(this,{fallback:s.receive||s.fallback?s8e(this):null}),new Proxy(this,{get:(u,p,g)=>{if(typeof p=="symbol"||p in u||E6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return u.getFunction(p)}catch(y){if(!Is(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>typeof p=="symbol"||p in u||E6.indexOf(p)>=0?Reflect.has(u,p):u.interface.hasFunction(p)})}connect(e){return new jb(this.target,this.interface,e)}attach(e){return new jb(e,this.interface,this.runner)}async getAddress(){return await Zo(this).addrPromise}async getDeployedCode(){const e=R0(this.runner);Le(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=R0(this.runner);return Le(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return Zo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),o8e(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),a8e(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=Zo(this),o=i||await s,{fragment:a,topics:c}=await Ik(this,e),l={address:o,topics:c,fromBlock:r,toBlock:n},f=R0(this.runner);return Le(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(u=>{let p=a;if(p==null)try{p=this.interface.getEvent(u.topics[0])}catch{}if(p)try{return new Sk(u,this.interface,p)}catch(g){return new nJ(u,g)}return new bx(u,f)})}async on(e,r){const n=await fF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await fF(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await d_(this,e,r,null)}async listenerCount(e){if(e){const i=await Zm(this,e);return i?i.listeners.length:0}const{subs:r}=Zo(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Zm(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=Zo(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Zm(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Zo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Zm(this,e);if(!r)return this;r.stop(),Zo(this).subs.delete(r.tag)}else{const{subs:r}=Zo(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends jb{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};let h_=jb;function u8e(){return h_}class Dn extends u8e(){}function f9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ve(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class d8e{constructor(e){de(this,"name");Ot(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const uJ=new RegExp("^(ipfs)://(.*)$","i"),uF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),uJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ad,Y0,Sd,z1,w4,dJ;const mv=class mv{constructor(e,r,n){Ie(this,Sd);de(this,"provider");de(this,"address");de(this,"name");Ie(this,Ad);Ie(this,Y0);Ot(this,{provider:e,address:r,name:n}),ue(this,Ad,null),ue(this,Y0,new Dn(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return Q(this,Ad)==null&&ue(this,Ad,(async()=>{try{return await Q(this,Y0).supportsInterface("0x9061b923")}catch(e){if(Is(e,"CALL_EXCEPTION"))return!1;throw ue(this,Ad,null),e}})()),await Q(this,Ad)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await qe(this,Sd,z1).call(this,"addr(bytes32)");return s==null||s===bu?null:s}catch(s){if(Is(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await qe(this,Sd,z1).call(this,"addr(bytes32,uint)",[s]);if(Gr(o,20))return Qt(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof d8e&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await qe(this,Sd,z1).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Le(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await qe(this,Sd,z1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await qe(this,Sd,z1).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${aY("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Le(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function wx(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Le(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function h8e(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}ve(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function ty(t){return ve(Gr(t,!0),"invalid data","value",t),t}function Xi(t){return ve(Gr(t,32),"invalid hash","value",t),t}const p8e=wx({address:Qt,blockHash:Xi,blockNumber:or,data:ty,index:or,removed:Dr(h8e,!1),topics:$8(Xi),transactionHash:Xi,transactionIndex:or},{index:["logIndex"]});function v8e(t){return p8e(t)}const g8e=wx({hash:Dr(Xi),parentHash:Xi,parentBeaconBlockRoot:Dr(Xi,null),number:or,timestamp:or,nonce:Dr(ty),difficulty:Pt,gasLimit:Pt,gasUsed:Pt,stateRoot:Dr(Xi,null),receiptsRoot:Dr(Xi,null),blobGasUsed:Dr(Pt,null),excessBlobGas:Dr(Pt,null),miner:Dr(Qt),prevRandao:Dr(Xi,null),extraData:ty,baseFeePerGas:Dr(Pt)},{prevRandao:["mixHash"]});function y8e(t){const e=g8e(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:hJ(r)),e}const m8e=wx({transactionIndex:or,blockNumber:or,transactionHash:Xi,address:Qt,topics:$8(Xi),data:ty,index:or,blockHash:Xi},{index:["logIndex"]});function b8e(t){return m8e(t)}const w8e=wx({to:Dr(Qt,null),from:Dr(Qt,null),contractAddress:Dr(Qt,null),index:or,root:Dr(Me),gasUsed:Pt,blobGasUsed:Dr(Pt,null),logsBloom:Dr(ty),blockHash:Xi,hash:Xi,logs:$8(b8e),blockNumber:or,cumulativeGasUsed:Pt,effectiveGasPrice:Dr(Pt),blobGasPrice:Dr(Pt,null),status:Dr(or),type:Dr(or,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function x8e(t){return w8e(t)}function hJ(t){t.to&&Pt(t.to)===dF&&(t.to="0x0000000000000000000000000000000000000000");const e=wx({hash:Xi,index:Dr(or,void 0),type:r=>r==="0x"||r==null?0:or(r),accessList:Dr(Wp,null),blobVersionedHashes:Dr($8(Xi,!0),null),blockHash:Dr(Xi,null),blockNumber:Dr(or,null),transactionIndex:Dr(or,null),from:Qt,gasPrice:Dr(Pt),maxPriorityFeePerGas:Dr(Pt),maxFeePerGas:Dr(Pt),maxFeePerBlobGas:Dr(Pt,null),gasLimit:Pt,to:Dr(Qt,null),value:Pt,nonce:or,data:ty,creates:Dr(Qt,null),chainId:Dr(Pt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=d5e(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=wu.from(t.signature):e.signature=wu.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Pt(e.blockHash)===dF&&(e.blockHash=null),e}const E8e="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class xx{constructor(e){de(this,"name");Ot(this,{name:e})}clone(){return new xx(this.name)}}class q8 extends xx{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);de(this,"effectiveBlock");de(this,"txBase");de(this,"txCreate");de(this,"txDataZero");de(this,"txDataNonzero");de(this,"txAccessListStorageKey");de(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let c=(n||{})[o];c==null&&(c=a),ve(typeof c=="number",`invalud value for ${o}`,"costs",n),i[o]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Ot(this,i)}clone(){return new q8(this.effectiveBlock,this)}}class V8 extends xx{constructor(r,n){super("org.ethers.plugins.network.Ens");de(this,"address");de(this,"targetNetwork");Ot(this,{address:r||E8e,targetNetwork:n??1})}clone(){return new V8(this.address,this.targetNetwork)}}var Vw,zw;class C8e extends xx{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ie(this,Vw);Ie(this,zw);ue(this,Vw,r),ue(this,zw,n)}get url(){return Q(this,Vw)}get processFunc(){return Q(this,zw)}clone(){return this}}Vw=new WeakMap,zw=new WeakMap;const u9=new Map;var mg,bg,_d;const bv=class bv{constructor(e,r){Ie(this,mg);Ie(this,bg);Ie(this,_d);ue(this,mg,e),ue(this,bg,Pt(r)),ue(this,_d,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Q(this,mg)}set name(e){ue(this,mg,e)}get chainId(){return Q(this,bg)}set chainId(e){ue(this,bg,Pt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Pt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Pt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Pt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(Q(this,_d).values())}attachPlugin(e){if(Q(this,_d).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,_d).set(e.name,e.clone()),this}getPlugin(e){return Q(this,_d).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new bv(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new q8;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function pF(t){return new C8e(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:hF(a.maxFee,9),maxPriorityFeePerGas:hF(a.maxPriorityFee,9)}}catch(s){Le(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let vF=!1;function A8e(){if(vF)return;vF=!0;function t(e,r,n){const i=function(){const s=new ca(e,r);return n.ensNetwork!=null&&s.attachPlugin(new V8(null,n.ensNetwork)),s.attachPlugin(new q8),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};ca.register(e,i),ca.register(r,i),n.altNames&&n.altNames.forEach(s=>{ca.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[pF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[pF("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function p_(t){return JSON.parse(JSON.stringify(t))}var zf,qa,Id,kl,wg,h3;class S8e{constructor(e){Ie(this,wg);Ie(this,zf);Ie(this,qa);Ie(this,Id);Ie(this,kl);ue(this,zf,e),ue(this,qa,null),ue(this,Id,4e3),ue(this,kl,-2)}get pollingInterval(){return Q(this,Id)}set pollingInterval(e){ue(this,Id,e)}start(){Q(this,qa)||(ue(this,qa,Q(this,zf)._setTimeout(qe(this,wg,h3).bind(this),Q(this,Id))),qe(this,wg,h3).call(this))}stop(){Q(this,qa)&&(Q(this,zf)._clearTimeout(Q(this,qa)),ue(this,qa,null))}pause(e){this.stop(),e&&ue(this,kl,-2)}resume(){this.start()}}zf=new WeakMap,qa=new WeakMap,Id=new WeakMap,kl=new WeakMap,wg=new WeakSet,h3=async function(){try{const e=await Q(this,zf).getBlockNumber();if(Q(this,kl)===-2){ue(this,kl,e);return}if(e!==Q(this,kl)){for(let r=Q(this,kl)+1;r<=e;r++){if(Q(this,qa)==null)return;await Q(this,zf).emit("block",r)}ue(this,kl,e)}}catch{}Q(this,qa)!=null&&ue(this,qa,Q(this,zf)._setTimeout(qe(this,wg,h3).bind(this),Q(this,Id)))};var Q0,J0,Td;class Tk{constructor(e){Ie(this,Q0);Ie(this,J0);Ie(this,Td);ue(this,Q0,e),ue(this,Td,!1),ue(this,J0,r=>{this._poll(r,Q(this,Q0))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){Q(this,Td)||(ue(this,Td,!0),Q(this,J0).call(this,-2),Q(this,Q0).on("block",Q(this,J0)))}stop(){Q(this,Td)&&(ue(this,Td,!1),Q(this,Q0).off("block",Q(this,J0)))}pause(e){this.stop()}resume(){this.start()}}Q0=new WeakMap,J0=new WeakMap,Td=new WeakMap;var xg,Hf;class _8e extends Tk{constructor(r,n){super(r);Ie(this,xg);Ie(this,Hf);ue(this,xg,n),ue(this,Hf,-2)}pause(r){r&&ue(this,Hf,-2),super.pause(r)}async _poll(r,n){const i=await n.getBlock(Q(this,xg));i!=null&&(Q(this,Hf)===-2?ue(this,Hf,i.number):i.number>Q(this,Hf)&&(n.emit(Q(this,xg),i.number),ue(this,Hf,i.number)))}}xg=new WeakMap,Hf=new WeakMap;var x4;class I8e extends Tk{constructor(r,n){super(r);Ie(this,x4);ue(this,x4,p_(n))}async _poll(r,n){throw new Error("@TODO")}}x4=new WeakMap;var Eg;class T8e extends Tk{constructor(r,n){super(r);Ie(this,Eg);ue(this,Eg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(Q(this,Eg));i&&n.emit(Q(this,Eg),i)}}Eg=new WeakMap;var Gf,Cg,Ag,Pd,Va,E4,pJ;class Pk{constructor(e,r){Ie(this,E4);Ie(this,Gf);Ie(this,Cg);Ie(this,Ag);Ie(this,Pd);Ie(this,Va);ue(this,Gf,e),ue(this,Cg,p_(r)),ue(this,Ag,qe(this,E4,pJ).bind(this)),ue(this,Pd,!1),ue(this,Va,-2)}start(){Q(this,Pd)||(ue(this,Pd,!0),Q(this,Va)===-2&&Q(this,Gf).getBlockNumber().then(e=>{ue(this,Va,e)}),Q(this,Gf).on("block",Q(this,Ag)))}stop(){Q(this,Pd)&&(ue(this,Pd,!1),Q(this,Gf).off("block",Q(this,Ag)))}pause(e){this.stop(),e&&ue(this,Va,-2)}resume(){this.start()}}Gf=new WeakMap,Cg=new WeakMap,Ag=new WeakMap,Pd=new WeakMap,Va=new WeakMap,E4=new WeakSet,pJ=async function(e){if(Q(this,Va)===-2)return;const r=p_(Q(this,Cg));r.fromBlock=Q(this,Va)+1,r.toBlock=e;const n=await Q(this,Gf).getLogs(r);if(n.length===0){Q(this,Va){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class vJ{constructor(e){de(this,"name");Ot(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function M8e(t){return JSON.parse(JSON.stringify(t))}function v_(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function d9(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(Gr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:p3("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:p3("orphan",r),filter:M8e(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?v_(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Gr(a)?i.push(a):s.push((async()=>{i.push(await rs(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=v_(i.map(a=>a.toLowerCase()))}return{filter:n,tag:p3("event",n),type:"event"}}ve(!1,"unknown ProviderEvent","event",t)}function h9(){return new Date().getTime()}const R8e={cacheTimeout:250,pollingInterval:4e3};var xs,kd,Es,Sg,ra,Z0,Md,Wf,Hw,za,_g,Ig,br,Jo,g_,y_,Xm,m_,eb,v3;class gJ{constructor(e,r){Ie(this,br);Ie(this,xs);Ie(this,kd);Ie(this,Es);Ie(this,Sg);Ie(this,ra);Ie(this,Z0);Ie(this,Md);Ie(this,Wf);Ie(this,Hw);Ie(this,za);Ie(this,_g);Ie(this,Ig);if(ue(this,Ig,Object.assign({},R8e,r||{})),e==="any")ue(this,Z0,!0),ue(this,ra,null);else if(e){const n=ca.from(e);ue(this,Z0,!1),ue(this,ra,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ue(this,Z0,!1),ue(this,ra,null);ue(this,Wf,-1),ue(this,Md,new Map),ue(this,xs,new Map),ue(this,kd,new Map),ue(this,Es,null),ue(this,Sg,!1),ue(this,Hw,1),ue(this,za,new Map),ue(this,_g,!1)}get pollingInterval(){return Q(this,Ig).pollingInterval}get provider(){return this}get plugins(){return Array.from(Q(this,kd).values())}attachPlugin(e){if(Q(this,kd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,kd).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,kd).get(e)||null}get disableCcipRead(){return Q(this,_g)}set disableCcipRead(e){ue(this,_g,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),o.push(u)}Le(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new Z4e(y8e(e),this)}_wrapLog(e,r){return new bx(v8e(e),this)}_wrapTransactionReceipt(e,r){return new eJ(x8e(e),this)}_wrapTransactionResponse(e,r){return new Cw(hJ(e),this)}_detectNetwork(){Le(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Le(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=or(await qe(this,br,Jo).call(this,{method:"getBlockNumber"}),"%response");return Q(this,Wf)>=0&&ue(this,Wf,e),e}_getAddress(e){return rs(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Gr(e))return Gr(e,32)?e:zc(e);if(typeof e=="bigint"&&(e=or(e,"blockTag")),typeof e=="number")return e>=0?zc(e):Q(this,Wf)>=0?zc(Q(this,Wf)+e):this.getBlockNumber().then(r=>zc(r+e));ve(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?v_(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,f)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||f!=null))throw new Error("invalid filter");const p={};return u&&(p.address=u),r.length&&(p.topics=r),l&&(p.fromBlock=l),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=Ew(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=rs(r[i],this);C6(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);C6(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(Q(this,ra)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw Q(this,ra)===i&&ue(this,ra,null),s}})();return ue(this,ra,i),(await i).clone()}const e=Q(this,ra),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(Q(this,Z0)?(this.emit("network",n,r),Q(this,ra)===e&&ue(this,ra,Promise.resolve(n))):Le(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await vi({_block:qe(this,br,m_).call(this,"latest",!1),gasPrice:(async()=>{try{const f=await qe(this,br,Jo).call(this,{method:"getGasPrice"});return Pt(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const f=await qe(this,br,Jo).call(this,{method:"getPriorityFee"});return Pt(f,"%response")}catch{}return null})()});let a=null,c=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*P8e+c),new cF(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Jl(n.url),s=await n.processFunc(r,this,i);return new cF(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return C6(r)&&(r=await r),Pt(await qe(this,br,Jo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await vi({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await qe(this,br,y_).call(this,qe(this,br,g_).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Pt(await qe(this,br,Xm).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return or(await qe(this,br,Xm).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return Me(await qe(this,br,Xm).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Pt(r,"position");return Me(await qe(this,br,Xm).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await vi({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=ww.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await vi({network:this.getNetwork(),params:qe(this,br,m_).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await vi({network:this.getNetwork(),params:qe(this,br,Jo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await vi({network:this.getNetwork(),params:qe(this,br,Jo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await qe(this,br,Jo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await vi({network:this.getNetwork(),result:qe(this,br,Jo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:Me(r)}async getLogs(e){let r=this._getFilter(e);C6(r)&&(r=await r);const{network:n,params:i}=await vi({network:this.getNetwork(),params:qe(this,br,Jo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Le(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await F5.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Qt(e);const r=l_(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await F5.getEnsAddress(this),s=await new Dn(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===bu)return null;const a=await new Dn(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(Is(n,"BAD_DATA")&&n.value==="0x"||Is(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async l=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&l-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(zn("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){Le(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=Q(this,za).get(e);r&&(r.timer&&clearTimeout(r.timer),Q(this,za).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=dm(this,Hw)._++,i=()=>{Q(this,za).delete(n),e()};if(this.paused)Q(this,za).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);Q(this,za).set(n,{timer:s,func:i,time:h9()})}return n}_forEachSubscriber(e){for(const r of Q(this,xs).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new vJ(e.type);case"block":{const r=new S8e(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new _8e(this,e.type);case"event":return new Pk(this,e.filter);case"transaction":return new T8e(this,e.hash);case"orphan":return new I8e(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of Q(this,xs).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),Q(this,Es)!=null&&r.pause(Q(this,Es));break}}async on(e,r){const n=await qe(this,br,v3).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,Q(this,Es)!=null&&n.subscriber.pause(Q(this,Es))),this}async once(e,r){const n=await qe(this,br,v3).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,Q(this,Es)!=null&&n.subscriber.pause(Q(this,Es))),this}async emit(e,...r){const n=await qe(this,br,eb).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new cY(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),Q(this,xs).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await qe(this,br,eb).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of Q(this,xs).values())r+=n.length;return r}async listeners(e){if(e){const n=await qe(this,br,eb).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of Q(this,xs).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await qe(this,br,eb).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),Q(this,xs).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await qe(this,br,v3).call(this,e);n&&i.stop(),Q(this,xs).delete(r)}else for(const[r,{started:n,subscriber:i}]of Q(this,xs))n&&i.stop(),Q(this,xs).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return Q(this,Sg)}destroy(){this.removeAllListeners();for(const e of Q(this,za).keys())this._clearTimeout(e);ue(this,Sg,!0)}get paused(){return Q(this,Es)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ue(this,Wf,-1),Q(this,Es)!=null){if(Q(this,Es)==!!e)return;Le(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ue(this,Es,!!e);for(const r of Q(this,za).values())r.timer&&clearTimeout(r.timer),r.time=h9()-r.time}resume(){if(Q(this,Es)!=null){this._forEachSubscriber(e=>e.resume()),ue(this,Es,null);for(const e of Q(this,za).values()){let r=e.time;r<0&&(r=0),e.time=h9(),setTimeout(e.func,r)}}}}xs=new WeakMap,kd=new WeakMap,Es=new WeakMap,Sg=new WeakMap,ra=new WeakMap,Z0=new WeakMap,Md=new WeakMap,Wf=new WeakMap,Hw=new WeakMap,za=new WeakMap,_g=new WeakMap,Ig=new WeakMap,br=new WeakSet,Jo=async function(e){const r=Q(this,Ig).cacheTimeout;if(r<0)return await this._perform(e);const n=p3(e.method,e);let i=Q(this,Md).get(n);return i||(i=this._perform(e),Q(this,Md).set(n,i),setTimeout(()=>{Q(this,Md).get(n)===i&&Q(this,Md).delete(n)},r)),await i},g_=async function(e,r,n){Le(n=0&&r==="latest"&&i.to!=null&&mn(s.data,0,4)==="0x556f1830"){const o=s.data,a=await rs(i.to,this);let c;try{c=L8e(mn(s.data,4))}catch(u){Le(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Le(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(i,c.calldata,c.urls);Le(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const f={to:a,data:qr([c.selector,B8e([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const u=await qe(this,br,g_).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:u}),u}}throw s}},y_=async function(e){const{value:r}=await vi({network:this.getNetwork(),value:e});return r},Xm=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await qe(this,br,y_).call(this,qe(this,br,Jo).call(this,Object.assign(e,{address:i,blockTag:s})))},m_=async function(e,r){if(Gr(e,32))return await qe(this,br,Jo).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await qe(this,br,Jo).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},eb=async function(e,r){let n=await d9(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await d9({orphan:"drop-log",log:r[0]},this)),Q(this,xs).get(n.tag)||null},v3=async function(e){const r=await d9(e,this),n=r.tag;let i=Q(this,xs).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},Q(this,xs).set(n,i)),i};function O8e(t,e){try{const r=b_(t,e);if(r)return Ip(r)}catch{}return null}function b_(t,e){if(t==="0x")return null;try{const r=or(mn(t,e,e+32)),n=or(mn(t,r,r+32));return mn(t,r+32,r+32+n)}catch{}return null}function gF(t){const e=ts(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function D8e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const N8e=new Uint8Array([]);function B8e(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=mn(t,0,32);Le(mn(r,0,12)===mn(yF,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=mn(r,12);try{const n=[],i=or(mn(t,32,64)),s=or(mn(t,i,i+32)),o=mn(t,i+32);for(let a=0;ae[n]),e}function D1(t,e){if(t.provider)return t.provider;Le(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function mF(t,e){let r=Ew(e);if(r.to!=null&&(r.to=rs(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),rs(n,t)]).then(([i,s])=>(ve(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await vi(r)}class z8{constructor(e){de(this,"provider");Ot(this,{provider:e||null})}async getNonce(e){return D1(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await mF(this,e)}async populateTransaction(e){const r=D1(this,"populateTransaction"),n=await mF(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Pt(n.chainId);ve(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?ve(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&ve(!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){const o=await r.getFeeData();Le(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Le(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Le(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await vi(n)}async estimateGas(e){return D1(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return D1(this,"call").call(await this.populateCall(e))}async resolveName(e){return await D1(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=D1(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=ww.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Tg,g3;const tR=class tR extends z8{constructor(r,n){super(n);Ie(this,Tg);de(this,"address");Ot(this,{address:r})}async getAddress(){return this.address}connect(r){return new tR(this.address,r)}async signTransaction(r){qe(this,Tg,g3).call(this,"transactions","signTransaction")}async signMessage(r){qe(this,Tg,g3).call(this,"messages","signMessage")}async signTypedData(r,n,i){qe(this,Tg,g3).call(this,"typed-data","signTypedData")}};Tg=new WeakSet,g3=function(r,n){Le(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let w_=tR;function F8e(t){return JSON.parse(JSON.stringify(t))}var Ws,Ml,X0,Rd,ep,Pg,mh,x_,E_;class yJ{constructor(e){Ie(this,mh);Ie(this,Ws);Ie(this,Ml);Ie(this,X0);Ie(this,Rd);Ie(this,ep);Ie(this,Pg);ue(this,Ws,e),ue(this,Ml,null),ue(this,X0,qe(this,mh,x_).bind(this)),ue(this,Rd,!1),ue(this,ep,null),ue(this,Pg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){Q(this,Rd)||(ue(this,Rd,!0),qe(this,mh,x_).call(this,-2))}stop(){Q(this,Rd)&&(ue(this,Rd,!1),ue(this,Pg,!0),qe(this,mh,E_).call(this),Q(this,Ws).off("block",Q(this,X0)))}pause(e){e&&qe(this,mh,E_).call(this),Q(this,Ws).off("block",Q(this,X0))}resume(){this.start()}}Ws=new WeakMap,Ml=new WeakMap,X0=new WeakMap,Rd=new WeakMap,ep=new WeakMap,Pg=new WeakMap,mh=new WeakSet,x_=async function(e){try{Q(this,Ml)==null&&ue(this,Ml,this._subscribe(Q(this,Ws)));let r=null;try{r=await Q(this,Ml)}catch(s){if(!Is(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){ue(this,Ml,null),Q(this,Ws)._recoverSubscriber(this,this._recover(Q(this,Ws)));return}const n=await Q(this,Ws).getNetwork();if(Q(this,ep)||ue(this,ep,n),Q(this,ep).chainId!==n.chainId)throw new Error("chaid changed");if(Q(this,Pg))return;const i=await Q(this,Ws).send("eth_getFilterChanges",[r]);await this._emitResults(Q(this,Ws),i)}catch(r){console.log("@TODO",r)}Q(this,Ws).once("block",Q(this,X0))},E_=function(){const e=Q(this,Ml);e&&(ue(this,Ml,null),e.then(r=>{Q(this,Ws).destroyed||Q(this,Ws).send("eth_uninstallFilter",[r])}))};var tp;class j8e extends yJ{constructor(r,n){super(r);Ie(this,tp);ue(this,tp,F8e(n))}_recover(r){return new Pk(r,Q(this,tp))}async _subscribe(r){return await r.send("eth_newFilter",[Q(this,tp)])}async _emitResults(r,n){for(const i of n)r.emit(Q(this,tp),r._wrapLog(i,r._network))}}tp=new WeakMap;class U8e extends yJ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const $8e="bigint,boolean,function,number,string,symbol".split(/,/g);function y3(t){if(t==null||$8e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(y3);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function q8e(t){return new Promise(e=>{setTimeout(e,t)})}function N1(t){return t&&t.toLowerCase()}function bF(t){return t&&typeof t.pollingInterval=="number"}const mJ={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class p9 extends z8{constructor(r,n){super(r);de(this,"address");n=Qt(n),Ot(this,{address:n})}connect(r){Le(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=y3(r),i=[];if(n.from){const o=n.from;i.push((async()=>{const a=await rs(o,this.provider);ve(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const o=n.to;i.push((async()=>{n.to=await rs(o,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,o)=>{const a=[1e3,100];let c=0;const l=async()=>{try{const f=await this.provider.getTransaction(i);if(f!=null){s(f.replaceableTransaction(n));return}}catch(f){if(Is(f,"CANCELLED")||Is(f,"BAD_DATA")||Is(f,"NETWORK_ERROR")){f.info==null&&(f.info={}),f.info.sendTransactionHash=i,o(f);return}if(Is(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=i,c>10)){o(f);return}this.provider.emit("error",zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(r){const n=y3(r);if(n.from){const s=await rs(n.from,this.provider);ve(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Ii(r):r;return await this.provider.send("personal_sign",[Me(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=y3(i),o=await uh.resolveNames(r,n,s,async a=>{const c=await rs(a);return ve(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(uh.getPayload(o.domain,n,o.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Ii(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Me(n)])}}var rp,kg,Kf,Rl,jc,Ha,Co,Gw,C_;class V8e extends gJ{constructor(r,n){super(r,n);Ie(this,Gw);Ie(this,rp);Ie(this,kg);Ie(this,Kf);Ie(this,Rl);Ie(this,jc);Ie(this,Ha);Ie(this,Co);ue(this,kg,1),ue(this,rp,Object.assign({},mJ,n||{})),ue(this,Kf,[]),ue(this,Rl,null),ue(this,Ha,null),ue(this,Co,null);{let s=null;const o=new Promise(a=>{s=a});ue(this,jc,{promise:o,resolve:s})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(ve(!i||r!=="any","staticNetwork cannot be used on special network 'any'","options",n),i&&r!=null&&ue(this,Ha,ca.from(r))):i&&(ve(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),ue(this,Ha,i))}_getOption(r){return Q(this,rp)[r]}get _network(){return Le(Q(this,Ha),"network is not available yet","NETWORK_ERROR"),Q(this,Ha)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&Pt(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)if(r===!0){if(Q(this,Ha))return Q(this,Ha)}else return r;return Q(this,Co)?await Q(this,Co):this.ready?(ue(this,Co,(async()=>{try{const n=ca.from(Pt(await this.send("eth_chainId",[])));return ue(this,Co,null),n}catch(n){throw ue(this,Co,null),n}})()),await Q(this,Co)):(ue(this,Co,(async()=>{const n={id:dm(this,kg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0],ue(this,Co,null)}catch(s){throw ue(this,Co,null),this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ca.from(Pt(i.result));throw this.getRpcError(n,i)})()),await Q(this,Co))}_start(){Q(this,jc)==null||Q(this,jc).resolve==null||(Q(this,jc).resolve(),ue(this,jc,null),(async()=>{for(;Q(this,Ha)==null&&!this.destroyed;)try{ue(this,Ha,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await q8e(1e3)}qe(this,Gw,C_).call(this)})())}async _waitUntilReady(){if(Q(this,jc)!=null)return await Q(this,jc).promise}_getSubscriber(r){return r.type==="pending"?new U8e(this):r.type==="event"?this._getOption("polling")?new Pk(this,r.filter):new j8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new vJ("orphan"):super._getSubscriber(r)}get ready(){return Q(this,jc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=zc(Pt(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=Me(r[i]))}),r.accessList&&(n.accessList=Wp(r.accessList)),r.blobVersionedHashes&&(n.blobVersionedHashes=r.blobVersionedHashes.map(i=>i.toLowerCase())),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[N1(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[N1(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[N1(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[N1(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(N1):r.filter.address=N1(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=A_(s),l=Ns.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return l.info={error:s,payload:r},l}const o=JSON.stringify(H8e(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return zn("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(o.match(/only replay-protected/i))return zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let a=!!o.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):zn("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=dm(this,kg)._++,s=new Promise((o,a)=>{Q(this,Kf).push({resolve:o,reject:a,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return qe(this,Gw,C_).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new p9(this,s[r])}const{accounts:i}=await vi({network:this.getNetwork(),accounts:n});r=Qt(r);for(const s of i)if(Qt(s)===r)return new p9(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new p9(this,n))}destroy(){Q(this,Rl)&&(clearTimeout(Q(this,Rl)),ue(this,Rl,null));for(const{payload:r,reject:n}of Q(this,Kf))n(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));ue(this,Kf,[]),super.destroy()}}rp=new WeakMap,kg=new WeakMap,Kf=new WeakMap,Rl=new WeakMap,jc=new WeakMap,Ha=new WeakMap,Co=new WeakMap,Gw=new WeakSet,C_=function(){if(Q(this,Rl))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");ue(this,Rl,setTimeout(()=>{ue(this,Rl,null);const n=Q(this,Kf);for(ue(this,Kf,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==Q(this,rp).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(o=>o.payload)).length>Q(this,rp).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const o=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:c,payload:l}of i){if(this.destroyed){c(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const f=o.filter(u=>u.id===l.id)[0];if(f==null){const u=zn("missing response for request","BAD_DATA",{value:o,info:{payload:l}});this.emit("error",u),c(u);continue}if("error"in f){c(this.getRpcError(l,f));continue}a(f.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of i)a(o)}})()}},r))};var Od;class z8e extends V8e{constructor(r,n){super(r,n);Ie(this,Od);let i=this._getOption("pollingInterval");i==null&&(i=mJ.pollingInterval),ue(this,Od,i)}_getSubscriber(r){const n=super._getSubscriber(r);return bF(n)&&(n.pollingInterval=Q(this,Od)),n}get pollingInterval(){return Q(this,Od)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");ue(this,Od,r),this._forEachSubscriber(n=>{bF(n)&&(n.pollingInterval=Q(this,Od))})}}Od=new WeakMap;var Mg,q$;let Iy=(q$=class extends z8e{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);Ie(this,Mg);typeof r=="string"?ue(this,Mg,new Jl(r)):ue(this,Mg,r.clone())}_getConnection(){return Q(this,Mg).clone()}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){const n=this._getConnection();n.body=JSON.stringify(r),n.setHeader("content-type","application/json");const i=await n.send();i.assertOk();let s=i.bodyJson;return Array.isArray(s)||(s=[s]),s}},Mg=new WeakMap,q$);function A_(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&Gr(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=A_(t[e]);if(r)return r}return null}if(typeof t=="string")try{return A_(JSON.parse(t))}catch{}return null}function S_(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)S_(t[r],e);if(typeof t=="string")try{return S_(JSON.parse(t),e)}catch{}}}function H8e(t){const e=[];return S_(t,e),e}var Rg;const rR=class rR extends z8{constructor(r,n){super(n);de(this,"address");Ie(this,Rg);ve(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),ue(this,Rg,r);const i=yx(this.signingKey.publicKey);Ot(this,{address:i})}get signingKey(){return Q(this,Rg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new rR(Q(this,Rg),r)}async signTransaction(r){r=Ew(r);const{to:n,from:i}=await vi({to:r.to?rs(r.to,this.provider):void 0,from:r.from?rs(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(ve(Qt(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const s=ww.from(r);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(Ak(r)).serialized}async signTypedData(r,n,i){const s=await uh.resolveNames(r,n,i,async o=>{Le(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return Le(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(uh.hash(s.domain,n,s.value)).serialized}};Rg=new WeakMap;let j5=rR;const U5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",G8e=/^[a-z]*$/i;function wF(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(G8e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function W8e(t,e){for(let i=U5.length-1;i>=0;i--)t=t.split(U5[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return wF(wF(r,";"),":")}function K8e(t){return ve(t[0]==="0","unsupported auwl data","data",t),W8e(t.substring(1+2*U5.length),t.substring(1,1+2*U5.length))}class Y8e{constructor(e){de(this,"locale");Ot(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Og,Ww,np,Kw,__;class Q8e extends Y8e{constructor(r,n,i){super(r);Ie(this,Kw);Ie(this,Og);Ie(this,Ww);Ie(this,np);ue(this,Og,n),ue(this,Ww,i),ue(this,np,null)}get _data(){return Q(this,Og)}_decodeWords(){return K8e(Q(this,Og))}getWord(r){const n=qe(this,Kw,__).call(this);return ve(r>=0&&r=0)&&(r[i]=t[i]);return r}function _2e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function I2e(t,e){return t.button===0&&(!e||e==="_self")&&!_2e(t)}const T2e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],P2e="6";try{window.__reactRouterVersion=P2e}catch{}const k2e="startTransition",tL=J$[k2e];function M2e(t){let{basename:e,children:r,future:n,window:i}=t,s=D.useRef();s.current==null&&(s.current=Lxe({window:i,v5Compat:!0}));let o=s.current,[a,c]=D.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},f=D.useCallback(u=>{l&&tL?tL(()=>c(u)):c(u)},[c,l]);return D.useLayoutEffect(()=>o.listen(f),[o,f]),D.createElement(C2e,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const R2e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",O2e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,JK=D.forwardRef(function(e,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:a,target:c,to:l,preventScrollReset:f,unstable_viewTransition:u}=e,p=S2e(e,T2e),{basename:g}=D.useContext(_h),y,b=!1;if(typeof l=="string"&&O2e.test(l)&&(y=l,R2e))try{let O=new URL(window.location.href),L=l.startsWith("//")?new URL(O.protocol+l):new URL(l),F=YP(L.pathname,g);L.origin===O.origin&&F!=null?l=F+L.search+L.hash:b=!0}catch{}let I=l2e(l,{relative:i}),C=D2e(l,{replace:o,state:a,target:c,preventScrollReset:f,relative:i,unstable_viewTransition:u});function S(O){n&&n(O),O.defaultPrevented||C(O)}return D.createElement("a",F7({},p,{href:y||I,onClick:b||s?n:S,ref:r,target:c}))});var rL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(rL||(rL={}));var nL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(nL||(nL={}));function D2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=XP(),l=hx(),f=KK(t,{relative:o});return D.useCallback(u=>{if(I2e(u,r)){u.preventDefault();let p=n!==void 0?n:x5(l)===x5(f);c(t,{replace:p,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a})}},[l,c,f,n,i,r,t,s,o,a])}const N2e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var B2e=Object.freeze({__proto__:null,abi:N2e});const L2e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],F2e={isValidSignatureBytes32:"0x1626ba7e"};var j2e=Object.freeze({__proto__:null,abi:L2e,returns:F2e});const U2e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var $2e=Object.freeze({__proto__:null,abi:U2e});const q2e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var V2e=Object.freeze({__proto__:null,abi:q2e});const z2e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var H2e=Object.freeze({__proto__:null,abi:z2e});const G2e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var W2e=Object.freeze({__proto__:null,abi:G2e});const K2e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var Y2e=Object.freeze({__proto__:null,abi:K2e});const Q2e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var J2e=Object.freeze({__proto__:null,abi:Q2e});const Ms={erc6492:$2e,erc5719:B2e,erc1271:j2e,factory:V2e,mainModule:H2e,mainModuleUpgradable:W2e,sequenceUtils:Y2e,requireFreshSigner:J2e},ZK="6.13.2";function Z2e(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Rt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&Z2e(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function hv(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(hv).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return hv(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${hv(r)}: ${hv(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Ps(t,e){return t&&t.code===e}function ek(t){return Ps(t,"CALL_EXCEPTION")}function zn(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${hv(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+hv(a))}}s.push(`code=${e}`),s.push(`version=${ZK}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Rt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Rt(i,{shortMessage:n}),i}function Le(t,e,r,n){if(!t)throw zn(e,r,n)}function pe(t,e,r,n){Le(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function XK(t,e,r){r==null&&(r=""),r&&(r=": "+r),Le(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Le(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const X2e=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function eY(t){Le(X2e.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Th(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Le(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function tY(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s>4]+iL[i&15]}return r}function Vr(t){return"0x"+t.map(e=>Me(e).substring(2)).join("")}function fp(t){return Wr(t,!0)?(t.length-2)/2:Ue(t).length}function mn(t,e,r){const n=Ue(t);return r!=null&&r>n.length&&Le(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Me(n.slice(e??0,r??n.length))}function rY(t,e,r){const n=Ue(t);Le(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),Me(i)}function qc(t,e){return rY(t,e,!0)}function nY(t,e){return rY(t,e,!1)}const A8=BigInt(0),Lc=BigInt(1),pv=9007199254740991;function C5(t,e){const r=S8(t,"value"),n=BigInt(cr(e,"width"));if(Le(r>>n===A8,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Lc){const i=(Lc<=-pv&&t<=pv,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){pe(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}pe(!1,"invalid BigNumberish value",e||"value",t)}function S8(t,e){const r=Tt(t,e);return Le(r>=A8,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const sL="0123456789abcdef";function px(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=sL[r>>4],e+=sL[r&15];return BigInt(e)}return Tt(t)}function cr(t,e){switch(typeof t){case"bigint":return pe(t>=-pv&&t<=pv,"overflow",e||"value",t),Number(t);case"number":return pe(Number.isInteger(t),"underflow",e||"value",t),pe(t>=-pv&&t<=pv,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return cr(BigInt(t),e)}catch(r){pe(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}pe(!1,"invalid numeric value",e||"value",t)}function e6e(t){return cr(px(t))}function Ya(t,e){let n=S8(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=cr(e,"width");for(Le(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function a6e(t,e,r,n,i){return t==="OVERLONG"?(pe(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),oY(t,e,r))}const c6e=Object.freeze({error:o6e,ignore:oY,replace:a6e});function l6e(t,e){e==null&&(e=c6e.error);const r=Ue(t,"bytes"),n=[];let i=0;for(;i>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Ai(t,e){pe(typeof t=="string","invalid string value","str",t),e!=null&&(eY(e),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);pe(n>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function f6e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ip(t,e){return f6e(l6e(t,e))}function aY(t){async function e(r,n){Le(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();Le(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Le(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=zn("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=zn("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let l;try{l=await fetch(r.url,c)}catch(g){throw clearTimeout(a),s||g}clearTimeout(a);const f={};l.headers.forEach((g,y)=>{f[y.toLowerCase()]=g});const u=await l.arrayBuffer(),p=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:f,body:p}}return e}const u6e=12,d6e=250;let oL=aY();const h6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let YA=!1;async function cY(t,e){try{const r=t.match(h6e);if(!r)throw new Error("invalid data");return new Kd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?i6e(r[3]):g6e(r[3]))}catch{return new Kd(599,"BAD REQUEST (invalid data: URI)",{},null,new Hl(t))}}function lY(t){async function e(r,n){try{const i=r.match(p6e);if(!i)throw new Error("invalid link");return new Hl(`${t}${i[2]}`)}catch{return new Kd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hl(r))}}return e}const c6={data:cY,ipfs:lY("https://gateway.ipfs.io/ipfs/")},fY=new WeakMap;var L0,vd;class v6e{constructor(e){Ie(this,L0);Ie(this,vd);ue(this,L0,[]),ue(this,vd,!1),fY.set(e,()=>{if(!Q(this,vd)){ue(this,vd,!0);for(const r of Q(this,L0))setTimeout(()=>{r()},0);ue(this,L0,[])}})}addListener(e){Le(!Q(this,vd),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,L0).push(e)}get cancelled(){return Q(this,vd)}checkSignal(){Le(!this.cancelled,"cancelled","CANCELLED",{})}}L0=new WeakMap,vd=new WeakMap;function l6(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Kv,Yv,Pc,Bf,Qv,Jv,Pi,Yo,Lf,F0,j0,U0,bl,kc,gd,$0,Ym;const u4=class u4{constructor(e){Ie(this,$0);Ie(this,Kv);Ie(this,Yv);Ie(this,Pc);Ie(this,Bf);Ie(this,Qv);Ie(this,Jv);Ie(this,Pi);Ie(this,Yo);Ie(this,Lf);Ie(this,F0);Ie(this,j0);Ie(this,U0);Ie(this,bl);Ie(this,kc);Ie(this,gd);ue(this,Jv,String(e)),ue(this,Kv,!1),ue(this,Yv,!0),ue(this,Pc,{}),ue(this,Bf,""),ue(this,Qv,3e5),ue(this,kc,{slotInterval:d6e,maxAttempts:u6e}),ue(this,gd,null)}get url(){return Q(this,Jv)}set url(e){ue(this,Jv,String(e))}get body(){return Q(this,Pi)==null?null:new Uint8Array(Q(this,Pi))}set body(e){if(e==null)ue(this,Pi,void 0),ue(this,Yo,void 0);else if(typeof e=="string")ue(this,Pi,Ai(e)),ue(this,Yo,"text/plain");else if(e instanceof Uint8Array)ue(this,Pi,e),ue(this,Yo,"application/octet-stream");else if(typeof e=="object")ue(this,Pi,Ai(JSON.stringify(e))),ue(this,Yo,"application/json");else throw new Error("invalid body")}hasBody(){return Q(this,Pi)!=null}get method(){return Q(this,Bf)?Q(this,Bf):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ue(this,Bf,String(e).toUpperCase())}get headers(){const e=Object.assign({},Q(this,Pc));return Q(this,Lf)&&(e.authorization=`Basic ${s6e(Ai(Q(this,Lf)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&Q(this,Yo)&&(e["content-type"]=Q(this,Yo)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){Q(this,Pc)[String(e).toLowerCase()]=String(r)}clearHeaders(){ue(this,Pc,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),ue(this,Qv,e)}get preflightFunc(){return Q(this,F0)||null}set preflightFunc(e){ue(this,F0,e)}get processFunc(){return Q(this,j0)||null}set processFunc(e){ue(this,j0,e)}get retryFunc(){return Q(this,U0)||null}set retryFunc(e){ue(this,U0,e)}get getUrlFunc(){return Q(this,gd)||oL}set getUrlFunc(e){ue(this,gd,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(Q(this,kc).slotInterval=e.slotInterval),e.maxAttempts!=null&&(Q(this,kc).maxAttempts=e.maxAttempts)}send(){return Le(Q(this,bl)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ue(this,bl,new v6e(this)),$e(this,$0,Ym).call(this,0,aL()+this.timeout,0,this,new Kd(0,"",{},null,this))}cancel(){Le(Q(this,bl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=fY.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Le(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new u4(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ue(i,Pc,Object.assign({},Q(this,Pc))),Q(this,Pi)&&ue(i,Pi,new Uint8Array(Q(this,Pi))),ue(i,Yo,Q(this,Yo)),i}clone(){const e=new u4(this.url);return ue(e,Bf,Q(this,Bf)),Q(this,Pi)&&ue(e,Pi,Q(this,Pi)),ue(e,Yo,Q(this,Yo)),ue(e,Pc,Object.assign({},Q(this,Pc))),ue(e,Lf,Q(this,Lf)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ue(e,F0,Q(this,F0)),ue(e,j0,Q(this,j0)),ue(e,U0,Q(this,U0)),ue(e,kc,Object.assign({},Q(this,kc))),ue(e,gd,Q(this,gd)),e}static lockConfig(){YA=!0}static getGateway(e){return c6[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(YA)throw new Error("gateways locked");c6[e]=r}static registerGetUrl(e){if(YA)throw new Error("gateways locked");oL=e}static createGetUrlFunc(e){return aY()}static createDataGateway(){return cY}static createIpfsGatewayFunc(e){return lY(e)}};Kv=new WeakMap,Yv=new WeakMap,Pc=new WeakMap,Bf=new WeakMap,Qv=new WeakMap,Jv=new WeakMap,Pi=new WeakMap,Yo=new WeakMap,Lf=new WeakMap,F0=new WeakMap,j0=new WeakMap,U0=new WeakMap,bl=new WeakMap,kc=new WeakMap,gd=new WeakMap,$0=new WeakSet,Ym=async function(e,r,n,i,s){var f,u,p;if(e>=Q(this,kc).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Le(aL()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await y6e(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in c6){const g=await c6[a](o.url,l6(Q(i,bl)));if(g instanceof Kd){let y=g;if(this.processFunc){l6(Q(i,bl));try{y=await this.processFunc(o,y)}catch(b){(b.throttle==null||typeof b.stall!="number")&&y.makeServerError("error in post-processing function",b).assertOk()}}return y}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,l6(Q(i,bl)));let l=new Kd(c.statusCode,c.statusMessage,c.headers,c.body,i);if(l.statusCode===301||l.statusCode===302){try{const g=l.headers.location||"";return $e(f=o.redirect(g),$0,Ym).call(f,e+1,r,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,e))){const g=l.headers["retry-after"];let y=Q(this,kc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(y=parseInt(g)),$e(u=o.clone(),$0,Ym).call(u,e+1,r,y,i,l)}if(this.processFunc){l6(Q(i,bl));try{l=await this.processFunc(o,l)}catch(g){(g.throttle==null||typeof g.stall!="number")&&l.makeServerError("error in post-processing function",g).assertOk();let y=Q(this,kc).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return g.stall>=0&&(y=g.stall),$e(p=o.clone(),$0,Ym).call(p,e+1,r,y,i,l)}}return l};let Hl=u4;var Dw,Nw,Bw,Qo,Zv,q0;const YM=class YM{constructor(e,r,n,i,s){Ie(this,Dw);Ie(this,Nw);Ie(this,Bw);Ie(this,Qo);Ie(this,Zv);Ie(this,q0);ue(this,Dw,e),ue(this,Nw,r),ue(this,Bw,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ue(this,Qo,i==null?null:new Uint8Array(i)),ue(this,Zv,s||null),ue(this,q0,{message:""})}toString(){return``}get statusCode(){return Q(this,Dw)}get statusMessage(){return Q(this,Nw)}get headers(){return Object.assign({},Q(this,Bw))}get body(){return Q(this,Qo)==null?null:new Uint8Array(Q(this,Qo))}get bodyText(){try{return Q(this,Qo)==null?"":Ip(Q(this,Qo))}catch{Le(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Le(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Rt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return Q(this,Qo)!=null}get request(){return Q(this,Zv)}ok(){return Q(this,q0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=Q(this,q0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{Q(this,Qo)&&(i=Ip(Q(this,Qo)))}catch{}Le(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Dw=new WeakMap,Nw=new WeakMap,Bw=new WeakMap,Qo=new WeakMap,Zv=new WeakMap,q0=new WeakMap;let Kd=YM;function aL(){return new Date().getTime()}function g6e(t){return Ai(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function y6e(t){return new Promise(e=>setTimeout(e,t))}const m6e=BigInt(-1),Ac=BigInt(0),vv=BigInt(1),b6e=BigInt(5),O1={};let Mv="0000";for(;Mv.length<80;)Mv+=Mv;function i0(t){let e=Mv;for(;e.length=-i&&tAc?t=C5(P0(t,n),n):t=-C5(P0(-t,n),n)}else{const i=vv<=0&&ts[a]==null?l:(pe(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}pe(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),pe(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function w6e(t,e){let r="";t0?n*=i0(i):i<0&&(r*=i0(-i)),rn?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=Q(this,un);return Q(this,un)Ac&&(e+=Q(this,Ys)-vv),e=Q(this,un)/Q(this,Ys)*Q(this,Ys),$e(this,en,Af).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=b6e*i0(r-1);let i=this.value+n;const s=i0(r);return i=i/s*s,Am(i,Q(this,Mc),"round"),new ud(O1,i,Q(this,Mc))}isZero(){return Q(this,un)===Ac}isNegative(){return Q(this,un)0){const c=i0(a);Le(o%c===Ac,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=i0(-a));return Am(o,s,"fromValue"),new ud(O1,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);pe(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=QA(r);let s=n[2]||"0",o=n[3]||"";for(;o.length{Le(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=cL(t,e+1,n);return r(e+1+n+i),lL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),lL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=cL(t,e+1,n);r(e+1+n+i);const s=Me(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=Me(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:x6e(t[e])}}function _8(t){const e=Ue(t,"data"),r=uY(e,0);return pe(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function fL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function dY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(dY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=fL(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Ue(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=fL(e.length);return r.unshift(183+r.length),r.concat(e)}const uL="0123456789abcdef";function Tp(t){let e="0x";for(const r of dY(t))e+=uL[r>>4],e+=uL[r&15];return e}const hY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function ch(t,e){let r=18;if(typeof e=="string"){const n=hY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return S5.fromValue(t,r,{decimals:r,width:512}).toString()}function z7(t,e){pe(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=hY.indexOf(e);pe(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=cr(e,"unit"));return S5.fromString(t,{decimals:r,width:512}).value}function E6e(t){return z7(t,18)}function C6e(t){const e=Ue(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Me(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Xs=32,H7=new Uint8Array(Xs),A6e=["then"],f6={},pY=new WeakMap;function m0(t){return pY.get(t)}function dL(t,e){pY.set(t,e)}function Sm(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function G7(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Wg?G7(m0(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Wg&&(o=G7(m0(o),o,r)),n[i]=o),n},{})}var Xv;const mv=class mv extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==f6&&(i=r,s=[],o=!1);super(i.length);Ie(this,Xv);i.forEach((l,f)=>{this[f]=l});const a=s.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(dL(this,Object.freeze(i.map((l,f)=>{const u=s[f];return u!=null&&a.get(u)===1?u:null}))),ue(this,Xv,[]),Q(this,Xv)==null&&Q(this,Xv),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,u)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const g=cr(f,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const y=l[g];return y instanceof Error&&Sm(`index ${g}`,y),y}if(A6e.indexOf(f)>=0)return Reflect.get(l,f,u);const p=l[f];if(p instanceof Function)return function(...g){return p.apply(this===u?l:this,g)};if(!(f in l))return l.getValue.apply(this===u?l:this,[f])}return Reflect.get(l,f,u)}});return dL(c,m0(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&Sm(`index ${s}`,i),r&&i instanceof mv&&(i=i.toArray(r)),n.push(i)}),n}toObject(r){const n=m0(this);return n.reduce((i,s,o)=>(Le(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),G7(n,this,r)),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=m0(this),s=[],o=[];for(let a=r;a{Q(this,Ff)[e]=hL(r)}}}Ff=new WeakMap,V0=new WeakMap,eg=new WeakSet,e3=function(e){return Q(this,Ff).push(e),ue(this,V0,Q(this,V0)+e.length),e.length};var Co,Jo,z0,H0,yd,Up,Y7,vY;const QM=class QM{constructor(e,r,n){Ie(this,Up);de(this,"allowLoose");Ie(this,Co);Ie(this,Jo);Ie(this,z0);Ie(this,H0);Ie(this,yd);Rt(this,{allowLoose:!!r}),ue(this,Co,Xi(e)),ue(this,z0,0),ue(this,H0,null),ue(this,yd,n??1024),ue(this,Jo,0)}get data(){return Me(Q(this,Co))}get dataLength(){return Q(this,Co).length}get consumed(){return Q(this,Jo)}get bytes(){return new Uint8Array(Q(this,Co))}subReader(e){const r=new QM(Q(this,Co).slice(Q(this,Jo)+e),this.allowLoose,Q(this,yd));return ue(r,H0,this),r}readBytes(e,r){let n=$e(this,Up,vY).call(this,0,e,!!r);return $e(this,Up,Y7).call(this,e),ue(this,Jo,Q(this,Jo)+n.length),n.slice(0,e)}readValue(){return px(this.readBytes(Xs))}readIndex(){return e6e(this.readBytes(Xs))}};Co=new WeakMap,Jo=new WeakMap,z0=new WeakMap,H0=new WeakMap,yd=new WeakMap,Up=new WeakSet,Y7=function(e){var r;if(Q(this,H0))return $e(r=Q(this,H0),Up,Y7).call(r,e);ue(this,z0,Q(this,z0)+e),Le(Q(this,yd)<1||Q(this,z0)<=Q(this,yd)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,yd)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),offset:Q(this,Jo),length:e,info:{bytesRead:Q(this,z0),dataLength:this.dataLength}})},vY=function(e,r,n){let i=Math.ceil(r/Xs)*Xs;return Q(this,Jo)+i>Q(this,Co).length&&(this.allowLoose&&n&&Q(this,Jo)+r<=Q(this,Co).length?i=r:Le(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Xi(Q(this,Co)),length:Q(this,Co).length,offset:Q(this,Jo)+i})),Q(this,Co).slice(Q(this,Jo),Q(this,Jo)+i)};let K7=QM;function ra(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function rk(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function gY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ra(t.outputLen),ra(t.blockLen)}function Kg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function yY(t,e){rk(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,t3=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),r3=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),al=(t,e)=>t<<32-e|t>>>e,S6e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!S6e)throw new Error("Non little-endian hardware is not supported");const _6e=async()=>{};async function pL(t,e,r){let n=Date.now();for(let i=0;i=0&&sn+i.length,0));let r=0;return t.forEach(n=>{if(!mY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class nk{clone(){return this._cloneInto()}}const P6e={}.toString;function bY(t,e){if(e!==void 0&&P6e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function I8(t){const e=n=>t().update(Yg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function k6e(t=32){if(JA&&typeof JA.getRandomValues=="function")return JA.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let wY=class extends nk{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,gY(e);const n=Yg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew wY(t,e).update(r).digest();T8.create=(t,e)=>new wY(t,e);function M6e(t,e,r,n){gY(t);const i=bY({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if(ra(s),ra(o),ra(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Yg(e),l=Yg(r),f=new Uint8Array(o),u=T8.create(t,c),p=u._cloneInto().update(l);return{c:s,dkLen:o,asyncTick:a,DK:f,PRF:u,PRFSalt:p}}function R6e(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function ik(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:c}=M6e(t,e,r,n);let l;const f=new Uint8Array(4),u=r3(f),p=new Uint8Array(a.outputLen);for(let g=1,y=0;y>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class sk extends nk{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=r3(this.buffer)}update(e){Kg(this);const{view:r,buffer:n,blockLen:i}=this;e=Yg(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let u=o;uf.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ut&e^~t&r,N6e=(t,e,r)=>t&e^t&r^e&r,B6e=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]),Ju=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Zu=new Uint32Array(64);let L6e=class extends sk{constructor(){super(64,32,8,!1),this.A=Ju[0]|0,this.B=Ju[1]|0,this.C=Ju[2]|0,this.D=Ju[3]|0,this.E=Ju[4]|0,this.F=Ju[5]|0,this.G=Ju[6]|0,this.H=Ju[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let u=0;u<16;u++,r+=4)Zu[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=Zu[u-15],g=Zu[u-2],y=al(p,7)^al(p,18)^p>>>3,b=al(g,17)^al(g,19)^g>>>10;Zu[u]=b+Zu[u-7]+y+Zu[u-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:f}=this;for(let u=0;u<64;u++){const p=al(a,6)^al(a,11)^al(a,25),g=f+p+D6e(a,c,l)+B6e[u]+Zu[u]|0,b=(al(n,2)^al(n,13)^al(n,22))+N6e(n,i,s)|0;f=l,l=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,c,l,f)}roundClean(){Zu.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Cy=I8(()=>new L6e),u6=BigInt(2**32-1),Q7=BigInt(32);function xY(t,e=!1){return e?{h:Number(t&u6),l:Number(t>>Q7&u6)}:{h:Number(t>>Q7&u6)|0,l:Number(t&u6)|0}}function EY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),j6e=(t,e,r)=>t>>>r,U6e=(t,e,r)=>t<<32-r|e>>>r,$6e=(t,e,r)=>t>>>r|e<<32-r,q6e=(t,e,r)=>t<<32-r|e>>>r,V6e=(t,e,r)=>t<<64-r|e>>>r-32,z6e=(t,e,r)=>t>>>r-32|e<<64-r,H6e=(t,e)=>e,G6e=(t,e)=>t,CY=(t,e,r)=>t<>>32-r,AY=(t,e,r)=>e<>>32-r,SY=(t,e,r)=>e<>>64-r,_Y=(t,e,r)=>t<>>64-r;function W6e(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const K6e=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Y6e=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Q6e=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),J6e=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Z6e=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),X6e=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,vr={fromBig:xY,split:EY,toBig:F6e,shrSH:j6e,shrSL:U6e,rotrSH:$6e,rotrSL:q6e,rotrBH:V6e,rotrBL:z6e,rotr32H:H6e,rotr32L:G6e,rotlSH:CY,rotlSL:AY,rotlBH:SY,rotlBL:_Y,add:W6e,add3L:K6e,add3H:Y6e,add4L:Q6e,add4H:J6e,add5H:X6e,add5L:Z6e},[e3e,t3e]=vr.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"].map(t=>BigInt(t))),Xu=new Uint32Array(80),ed=new Uint32Array(80);let r3e=class extends sk{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(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:f,Fh:u,Fl:p,Gh:g,Gl:y,Hh:b,Hl:I}=this;return[e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I]}set(e,r,n,i,s,o,a,c,l,f,u,p,g,y,b,I){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=f|0,this.Fh=u|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=b|0,this.Hl=I|0}process(e,r){for(let O=0;O<16;O++,r+=4)Xu[O]=e.getUint32(r),ed[O]=e.getUint32(r+=4);for(let O=16;O<80;O++){const L=Xu[O-15]|0,F=ed[O-15]|0,z=vr.rotrSH(L,F,1)^vr.rotrSH(L,F,8)^vr.shrSH(L,F,7),_=vr.rotrSL(L,F,1)^vr.rotrSL(L,F,8)^vr.shrSL(L,F,7),$=Xu[O-2]|0,ie=ed[O-2]|0,ce=vr.rotrSH($,ie,19)^vr.rotrBH($,ie,61)^vr.shrSH($,ie,6),K=vr.rotrSL($,ie,19)^vr.rotrBL($,ie,61)^vr.shrSL($,ie,6),P=vr.add4L(_,K,ed[O-7],ed[O-16]),M=vr.add4H(P,z,ce,Xu[O-7],Xu[O-16]);Xu[O]=M|0,ed[O]=P|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:f,Eh:u,El:p,Fh:g,Fl:y,Gh:b,Gl:I,Hh:C,Hl:S}=this;for(let O=0;O<80;O++){const L=vr.rotrSH(u,p,14)^vr.rotrSH(u,p,18)^vr.rotrBH(u,p,41),F=vr.rotrSL(u,p,14)^vr.rotrSL(u,p,18)^vr.rotrBL(u,p,41),z=u&g^~u&b,_=p&y^~p&I,$=vr.add5L(S,F,_,t3e[O],ed[O]),ie=vr.add5H($,C,L,z,e3e[O],Xu[O]),ce=$|0,K=vr.rotrSH(n,i,28)^vr.rotrBH(n,i,34)^vr.rotrBH(n,i,39),P=vr.rotrSL(n,i,28)^vr.rotrBL(n,i,34)^vr.rotrBL(n,i,39),M=n&s^n&a^s&a,v=i&o^i&c^o&c;C=b|0,S=I|0,b=g|0,I=y|0,g=u|0,y=p|0,{h:u,l:p}=vr.add(l|0,f|0,ie|0,ce|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=vr.add3L(ce,P,v);n=vr.add3H(m,ie,K,M),i=m|0}({h:n,l:i}=vr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=vr.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=vr.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:f}=vr.add(this.Dh|0,this.Dl|0,l|0,f|0),{h:u,l:p}=vr.add(this.Eh|0,this.El|0,u|0,p|0),{h:g,l:y}=vr.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:b,l:I}=vr.add(this.Gh|0,this.Gl|0,b|0,I|0),{h:C,l:S}=vr.add(this.Hh|0,this.Hl|0,C|0,S|0),this.set(n,i,s,o,a,c,l,f,u,p,g,y,b,I,C,S)}roundClean(){Xu.fill(0),ed.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)}};const ok=I8(()=>new r3e);function n3e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const vL=n3e(),gL=vL.crypto||vL.msCrypto;function i3e(t){switch(t){case"sha256":return Cy.create();case"sha512":return ok.create()}pe(!1,"invalid hashing algorithm name","algorithm",t)}function s3e(t,e){const r={sha256:Cy,sha512:ok}[t];return pe(r!=null,"invalid hmac algorithm","algorithm",t),T8.create(r,e)}function o3e(t,e,r,n,i){const s={sha256:Cy,sha512:ok}[i];return pe(s!=null,"invalid pbkdf2 algorithm","algorithm",i),ik(s,t,e,{c:r,dkLen:n})}function a3e(t){Le(gL!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),pe(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return gL.getRandomValues(e),e}let IY=!1;const TY=function(t,e,r){return s3e(t,e).update(r).digest()};let PY=TY;function Ay(t,e,r){const n=Ue(e,"key"),i=Ue(r,"data");return Me(PY(t,n,i))}Ay._=TY;Ay.lock=function(){IY=!0};Ay.register=function(t){if(IY)throw new Error("computeHmac is locked");PY=t};Object.freeze(Ay);const[kY,MY,RY]=[[],[],[]],c3e=BigInt(0),_m=BigInt(1),l3e=BigInt(2),f3e=BigInt(7),u3e=BigInt(256),d3e=BigInt(113);for(let t=0,e=_m,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],kY.push(2*(5*n+r)),MY.push((t+1)*(t+2)/2%64);let i=c3e;for(let s=0;s<7;s++)e=(e<<_m^(e>>f3e)*d3e)%u3e,e&l3e&&(i^=_m<<(_m<r>32?SY(t,e,r):CY(t,e,r),mL=(t,e,r)=>r>32?_Y(t,e,r):AY(t,e,r);function v3e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],f=r[c+1],u=yL(l,f,1)^r[a],p=mL(l,f,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=u,t[o+g+1]^=p}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=MY[o],c=yL(i,s,a),l=mL(i,s,a),f=kY[o];i=t[f],s=t[f+1],t[f]=c,t[f+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=h3e[n],t[1]^=p3e[n]}r.fill(0)}class ak extends nk{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ra(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=t3(this.state)}keccak(){v3e(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Kg(this);const{blockLen:r,state:n}=this;e=Yg(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ra(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(yY(e,this),this.finished)throw new 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(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new ak(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const g3e=(t,e,r)=>I8(()=>new ak(e,t,r)),y3e=g3e(1,136,256/8);let OY=!1;const DY=function(t){return y3e(t)};let NY=DY;function br(t){const e=Ue(t,"data");return Me(NY(e))}br._=DY;br.lock=function(){OY=!0};br.register=function(t){if(OY)throw new TypeError("keccak256 is locked");NY=t};Object.freeze(br);const m3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),BY=Uint8Array.from({length:16},(t,e)=>e),b3e=BY.map(t=>(9*t+5)%16);let ck=[BY],lk=[b3e];for(let t=0;t<4;t++)for(let e of[ck,lk])e.push(e[t].map(r=>m3e[r]));const LY=[[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(t=>new Uint8Array(t)),w3e=ck.map((t,e)=>t.map(r=>LY[e][r])),x3e=lk.map((t,e)=>t.map(r=>LY[e][r])),E3e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),C3e=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),d6=(t,e)=>t<>>32-e;function bL(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const h6=new Uint32Array(16);let A3e=class extends sk{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let g=0;g<16;g++,r+=4)h6[g]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,c=a,l=this.h3|0,f=l,u=this.h4|0,p=u;for(let g=0;g<5;g++){const y=4-g,b=E3e[g],I=C3e[g],C=ck[g],S=lk[g],O=w3e[g],L=x3e[g];for(let F=0;F<16;F++){const z=d6(n+bL(g,s,a,l)+h6[C[F]]+b,O[F])+u|0;n=u,u=l,l=d6(a,10)|0,a=s,s=z}for(let F=0;F<16;F++){const z=d6(i+bL(y,o,c,f)+h6[S[F]]+I,L[F])+p|0;i=p,p=f,f=d6(c,10)|0,c=o,o=z}}this.set(this.h1+a+f|0,this.h2+l+p|0,this.h3+u+i|0,this.h4+n+o|0,this.h0+s+c|0)}roundClean(){h6.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};const S3e=I8(()=>new A3e);let FY=!1;const jY=function(t){return S3e(t)};let UY=jY;function Sy(t){const e=Ue(t,"data");return Me(UY(e))}Sy._=jY;Sy.lock=function(){FY=!0};Sy.register=function(t){if(FY)throw new TypeError("ripemd160 is locked");UY=t};Object.freeze(Sy);let $Y=!1;const qY=function(t,e,r,n,i){return o3e(t,e,r,n,i)};let VY=qY;function Ph(t,e,r,n,i){const s=Ue(t,"password"),o=Ue(e,"salt");return Me(VY(s,o,r,n,i))}Ph._=qY;Ph.lock=function(){$Y=!0};Ph.register=function(t){if($Y)throw new Error("pbkdf2 is locked");VY=t};Object.freeze(Ph);let zY=!1;const HY=function(t){return new Uint8Array(a3e(t))};let GY=HY;function ca(t){return GY(t)}ca._=HY;ca.lock=function(){zY=!0};ca.register=function(t){if(zY)throw new Error("randomBytes is locked");GY=t};Object.freeze(ca);const jr=(t,e)=>t<>>32-e;function wL(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],f=t[e++]^r[n++],u=t[e++]^r[n++],p=t[e++]^r[n++],g=t[e++]^r[n++],y=t[e++]^r[n++],b=t[e++]^r[n++],I=t[e++]^r[n++],C=t[e++]^r[n++],S=t[e++]^r[n++],O=t[e++]^r[n++],L=t[e++]^r[n++],F=t[e++]^r[n++],z=o,_=a,$=c,ie=l,ce=f,K=u,P=p,M=g,v=y,m=b,R=I,B=C,E=S,x=O,w=L,T=F;for(let k=0;k<8;k+=2)ce^=jr(z+E|0,7),v^=jr(ce+z|0,9),E^=jr(v+ce|0,13),z^=jr(E+v|0,18),m^=jr(K+_|0,7),x^=jr(m+K|0,9),_^=jr(x+m|0,13),K^=jr(_+x|0,18),w^=jr(R+P|0,7),$^=jr(w+R|0,9),P^=jr($+w|0,13),R^=jr(P+$|0,18),ie^=jr(T+B|0,7),M^=jr(ie+T|0,9),B^=jr(M+ie|0,13),T^=jr(B+M|0,18),_^=jr(z+ie|0,7),$^=jr(_+z|0,9),ie^=jr($+_|0,13),z^=jr(ie+$|0,18),P^=jr(K+ce|0,7),M^=jr(P+K|0,9),ce^=jr(M+P|0,13),K^=jr(ce+M|0,18),B^=jr(R+m|0,7),v^=jr(B+R|0,9),m^=jr(v+B|0,13),R^=jr(m+v|0,18),E^=jr(T+w|0,7),x^=jr(E+T|0,9),w^=jr(x+E|0,13),T^=jr(w+x|0,18);i[s++]=o+z|0,i[s++]=a+_|0,i[s++]=c+$|0,i[s++]=l+ie|0,i[s++]=f+ce|0,i[s++]=u+K|0,i[s++]=p+P|0,i[s++]=g+M|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+R|0,i[s++]=C+B|0,i[s++]=S+E|0,i[s++]=O+x|0,i[s++]=L+w|0,i[s++]=F+T|0}function Rv(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a0&&(o+=16),wL(r,s,t,e+=16,r,o)}function WY(t,e,r){const n=bY({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:f}=n;if(ra(i),ra(s),ra(o),ra(a),ra(c),ra(l),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const u=128*s,p=u/4;if(i<=1||i&i-1||i>=2**(u/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/u)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=u*(i+o);if(g>l)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${l} (maxmem)`);const y=ik(Cy,t,e,{c:1,dkLen:u*o}),b=t3(y),I=t3(new Uint8Array(u*i)),C=t3(new Uint8Array(u));let S=()=>{};if(f){const O=2*i*o,L=Math.max(Math.floor(O/1e4),1);let F=0;S=()=>{F++,f&&(!(F%L)||F===O)&&f(F/O)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:p,V:I,B32:b,B:y,tmp:C,blockMixCb:S,asyncTick:c}}function KY(t,e,r,n,i){const s=ik(Cy,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function _3e(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:f,tmp:u,blockMixCb:p}=WY(t,e,r);for(let g=0;g{Rv(c,I,c,I+=a,i),p()}),Rv(c,(n-1)*a,l,b,i),p(),await pL(n,g,()=>{const C=l[b+a-16]%n;for(let S=0;St instanceof Uint8Array,P3e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Qg(t){if(!k8(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0));let r=0;return t.forEach(n=>{if(!k8(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function M3e(t,e){if(t.length!==e.length)return!1;for(let r=0;riQ;t>>=P8,e+=1);return e}function D3e(t,e){return t>>BigInt(e)&P8}const N3e=(t,e,r)=>t|(r?P8:iQ)<(T3e<new Uint8Array(t),xL=t=>Uint8Array.from(t);function oQ(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=ZA(t),i=ZA(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...u)=>r(i,n,...u),c=(u=ZA())=>{i=a(xL([0]),u),n=a(),u.length!==0&&(i=a(xL([1]),u),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const p=[];for(;u{o(),c(u);let g;for(;!(g=p(l()));)c();return o(),g}}const B3e={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function vx(t,e,r={}){const n=(i,s,o)=>{const a=B3e[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const L3e=Object.freeze(Object.defineProperty({__proto__:null,bitGet:D3e,bitLen:O3e,bitMask:hk,bitSet:N3e,bytesToHex:Qg,bytesToNumberBE:up,bytesToNumberLE:uk,concatBytes:hw,createHmacDrbg:oQ,ensureBytes:Ic,equalBytes:M3e,hexToBytes:Jg,hexToNumber:fk,numberToBytesBE:Zg,numberToBytesLE:dk,numberToHexUnpadded:sQ,numberToVarBytesBE:k3e,utf8ToBytes:R3e,validateObject:vx},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Oi=BigInt(0),si=BigInt(1),b0=BigInt(2),F3e=BigInt(3),J7=BigInt(4),EL=BigInt(5),CL=BigInt(8);BigInt(9);BigInt(16);function _o(t,e){const r=t%e;return r>=Oi?r:e+r}function j3e(t,e,r){if(r<=Oi||e 0");if(r===si)return Oi;let n=si;for(;e>Oi;)e&si&&(n=n*t%r),t=t*t%r,e>>=si;return n}function _a(t,e,r){let n=t;for(;e-- >Oi;)n*=n,n%=r;return n}function Z7(t,e){if(t===Oi||e<=Oi)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=_o(t,e),n=e,i=Oi,s=si;for(;r!==Oi;){const a=n/r,c=n%r,l=i-s*a;n=r,r=c,i=s,s=l}if(n!==si)throw new Error("invert: does not exist");return _o(i,e)}function U3e(t){const e=(t-si)/b0;let r,n,i;for(r=t-si,n=0;r%b0===Oi;r/=b0,n++);for(i=b0;i(n[i]="function",n),e);return vx(t,r)}function z3e(t,e,r){if(r 0");if(r===Oi)return t.ONE;if(r===si)return e;let n=t.ONE,i=e;for(;r>Oi;)r&si&&(n=t.mul(n,i)),i=t.sqr(i),r>>=si;return n}function H3e(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function aQ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function G3e(t,e,r=!1,n={}){if(t<=Oi)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=aQ(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=$3e(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:hk(i),ZERO:Oi,ONE:si,create:c=>_o(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Oi<=c&&cc===Oi,isOdd:c=>(c&si)===si,neg:c=>_o(-c,t),eql:(c,l)=>c===l,sqr:c=>_o(c*c,t),add:(c,l)=>_o(c+l,t),sub:(c,l)=>_o(c-l,t),mul:(c,l)=>_o(c*l,t),pow:(c,l)=>z3e(a,c,l),div:(c,l)=>_o(c*Z7(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Z7(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>H3e(a,c),cmov:(c,l,f)=>f?l:c,toBytes:c=>r?dk(c,s):Zg(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?uk(c):up(c)}});return Object.freeze(a)}function cQ(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function lQ(t){const e=cQ(t);return e+Math.ceil(e/2)}function W3e(t,e,r=!1){const n=t.length,i=cQ(e),s=lQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?up(t):uk(t),a=_o(o,e-si)+si;return r?dk(a,i):Zg(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const K3e=BigInt(0),XA=BigInt(1);function Y3e(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>K3e;)s&XA&&(o=o.add(a)),a=a.double(),s>>=XA;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let l=i,f=l;for(let u=0;u>=g,I>c&&(I-=p,o+=XA);const C=b,S=b+Math.abs(I)-1,O=y%2!==0,L=I<0;I===0?f=f.add(r(O,s[C])):l=l.add(r(L,s[S]))}return{p:l,f}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function fQ(t){return V3e(t.Fp),vx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...aQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q3e(t){const e=fQ(t);vx(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:J3e,hexToBytes:Z3e}=L3e,k0={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=k0;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:J3e(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=k0,r=typeof t=="string"?Z3e(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=k0._parseInt(r.subarray(2)),{d:o,l:a}=k0._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,r=l=>{const f=l.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Kf=BigInt(0),Ua=BigInt(1);BigInt(2);const AL=BigInt(3);BigInt(4);function X3e(t){const e=Q3e(t),{Fp:r}=e,n=e.toBytes||((y,b,I)=>{const C=b.toAffine();return hw(Uint8Array.from([4]),r.toBytes(C.x),r.toBytes(C.y))}),i=e.fromBytes||(y=>{const b=y.subarray(1),I=r.fromBytes(b.subarray(0,r.BYTES)),C=r.fromBytes(b.subarray(r.BYTES,2*r.BYTES));return{x:I,y:C}});function s(y){const{a:b,b:I}=e,C=r.sqr(y),S=r.mul(C,y);return r.add(r.add(S,r.mul(y,b)),I)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(y){return typeof y=="bigint"&&Kfr.eql(O,r.ZERO);return S(I)&&S(C)?u.ZERO:new u(I,C,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){const I=r.invertBatch(b.map(C=>C.pz));return b.map((C,S)=>C.toAffine(I[S])).map(u.fromAffine)}static fromHex(b){const I=u.fromAffine(i(Ic("pointHex",b)));return I.assertValidity(),I}static fromPrivateKey(b){return u.BASE.multiply(c(b))}_setWindowSize(b){this._WINDOW_SIZE=b,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:b,y:I}=this.toAffine();if(!r.isValid(b)||!r.isValid(I))throw new Error("bad point: x or y not FE");const C=r.sqr(I),S=s(b);if(!r.eql(C,S))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){f(b);const{px:I,py:C,pz:S}=this,{px:O,py:L,pz:F}=b,z=r.eql(r.mul(I,F),r.mul(O,S)),_=r.eql(r.mul(C,F),r.mul(L,S));return z&&_}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:b,b:I}=e,C=r.mul(I,AL),{px:S,py:O,pz:L}=this;let F=r.ZERO,z=r.ZERO,_=r.ZERO,$=r.mul(S,S),ie=r.mul(O,O),ce=r.mul(L,L),K=r.mul(S,O);return K=r.add(K,K),_=r.mul(S,L),_=r.add(_,_),F=r.mul(b,_),z=r.mul(C,ce),z=r.add(F,z),F=r.sub(ie,z),z=r.add(ie,z),z=r.mul(F,z),F=r.mul(K,F),_=r.mul(C,_),ce=r.mul(b,ce),K=r.sub($,ce),K=r.mul(b,K),K=r.add(K,_),_=r.add($,$),$=r.add(_,$),$=r.add($,ce),$=r.mul($,K),z=r.add(z,$),ce=r.mul(O,L),ce=r.add(ce,ce),$=r.mul(ce,K),F=r.sub(F,$),_=r.mul(ce,ie),_=r.add(_,_),_=r.add(_,_),new u(F,z,_)}add(b){f(b);const{px:I,py:C,pz:S}=this,{px:O,py:L,pz:F}=b;let z=r.ZERO,_=r.ZERO,$=r.ZERO;const ie=e.a,ce=r.mul(e.b,AL);let K=r.mul(I,O),P=r.mul(C,L),M=r.mul(S,F),v=r.add(I,C),m=r.add(O,L);v=r.mul(v,m),m=r.add(K,P),v=r.sub(v,m),m=r.add(I,S);let R=r.add(O,F);return m=r.mul(m,R),R=r.add(K,M),m=r.sub(m,R),R=r.add(C,S),z=r.add(L,F),R=r.mul(R,z),z=r.add(P,M),R=r.sub(R,z),$=r.mul(ie,m),z=r.mul(ce,M),$=r.add(z,$),z=r.sub(P,$),$=r.add(P,$),_=r.mul(z,$),P=r.add(K,K),P=r.add(P,K),M=r.mul(ie,M),m=r.mul(ce,m),P=r.add(P,M),M=r.sub(K,M),M=r.mul(ie,M),m=r.add(m,M),K=r.mul(P,m),_=r.add(_,K),K=r.mul(R,m),z=r.mul(v,z),z=r.sub(z,K),K=r.mul(v,P),$=r.mul(R,$),$=r.add($,K),new u(z,_,$)}subtract(b){return this.add(b.negate())}is0(){return this.equals(u.ZERO)}wNAF(b){return g.wNAFCached(this,l,b,I=>{const C=r.invertBatch(I.map(S=>S.pz));return I.map((S,O)=>S.toAffine(C[O])).map(u.fromAffine)})}multiplyUnsafe(b){const I=u.ZERO;if(b===Kf)return I;if(a(b),b===Ua)return this;const{endo:C}=e;if(!C)return g.unsafeLadder(this,b);let{k1neg:S,k1:O,k2neg:L,k2:F}=C.splitScalar(b),z=I,_=I,$=this;for(;O>Kf||F>Kf;)O&Ua&&(z=z.add($)),F&Ua&&(_=_.add($)),$=$.double(),O>>=Ua,F>>=Ua;return S&&(z=z.negate()),L&&(_=_.negate()),_=new u(r.mul(_.px,C.beta),_.py,_.pz),z.add(_)}multiply(b){a(b);let I=b,C,S;const{endo:O}=e;if(O){const{k1neg:L,k1:F,k2neg:z,k2:_}=O.splitScalar(I);let{p:$,f:ie}=this.wNAF(F),{p:ce,f:K}=this.wNAF(_);$=g.constTimeNegate(L,$),ce=g.constTimeNegate(z,ce),ce=new u(r.mul(ce.px,O.beta),ce.py,ce.pz),C=$.add(ce),S=ie.add(K)}else{const{p:L,f:F}=this.wNAF(I);C=L,S=F}return u.normalizeZ([C,S])[0]}multiplyAndAddUnsafe(b,I,C){const S=u.BASE,O=(F,z)=>z===Kf||z===Ua||!F.equals(S)?F.multiplyUnsafe(z):F.multiply(z),L=O(this,I).add(O(b,C));return L.is0()?void 0:L}toAffine(b){const{px:I,py:C,pz:S}=this,O=this.is0();b==null&&(b=O?r.ONE:r.inv(S));const L=r.mul(I,b),F=r.mul(C,b),z=r.mul(S,b);if(O)return{x:r.ZERO,y:r.ZERO};if(!r.eql(z,r.ONE))throw new Error("invZ was invalid");return{x:L,y:F}}isTorsionFree(){const{h:b,isTorsionFree:I}=e;if(b===Ua)return!0;if(I)return I(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:b,clearCofactor:I}=e;return b===Ua?this:I?I(u,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(u,this,b)}toHex(b=!0){return Qg(this.toRawBytes(b))}}u.BASE=new u(e.Gx,e.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const p=e.nBitLength,g=Y3e(u,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function e5e(t){const e=fQ(t);return vx(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function t5e(t){const e=e5e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(m){return KfQg(Zg(m,e.nByteLength));function y(m){const R=n>>Ua;return m>R}function b(m){return y(m)?a(-m):m}const I=(m,R,B)=>up(m.slice(R,B));class C{constructor(R,B,E){this.r=R,this.s=B,this.recovery=E,this.assertValidity()}static fromCompact(R){const B=e.nByteLength;return R=Ic("compactSignature",R,B*2),new C(I(R,0,B),I(R,B,2*B))}static fromDER(R){const{r:B,s:E}=k0.toSig(Ic("DER",R));return new C(B,E)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(R){return new C(this.r,this.s,R)}recoverPublicKey(R){const{r:B,s:E,recovery:x}=this,w=_(Ic("msgHash",R));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const T=x===2||x===3?B+e.n:B;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const k=x&1?"03":"02",H=l.fromHex(k+g(T)),oe=c(T),j=a(-w*oe),X=a(E*oe),G=l.BASE.multiplyAndAddUnsafe(H,j,X);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Jg(this.toDERHex())}toDERHex(){return k0.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Jg(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const S={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=lQ(e.n);return W3e(e.randomBytes(m),e.n)},precompute(m=8,R=l.BASE){return R._setWindowSize(m),R.multiply(BigInt(3)),R}};function O(m,R=!0){return l.fromPrivateKey(m).toRawBytes(R)}function L(m){const R=m instanceof Uint8Array,B=typeof m=="string",E=(R||B)&&m.length;return R?E===i||E===s:B?E===2*i||E===2*s:m instanceof l}function F(m,R,B=!0){if(L(m))throw new Error("first arg must be private key");if(!L(R))throw new Error("second arg must be public key");return l.fromHex(R).multiply(f(m)).toRawBytes(B)}const z=e.bits2int||function(m){const R=up(m),B=m.length*8-e.nBitLength;return B>0?R>>BigInt(B):R},_=e.bits2int_modN||function(m){return a(z(m))},$=hk(e.nBitLength);function ie(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(Kf<=m&&m<$))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Zg(m,e.nByteLength)}function ce(m,R,B=K){if(["recovered","canonical"].some(ee=>ee in B))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=e;let{lowS:w,prehash:T,extraEntropy:k}=B;w==null&&(w=!0),m=Ic("msgHash",m),T&&(m=Ic("prehashed msgHash",E(m)));const H=_(m),oe=f(R),j=[ie(oe),ie(H)];if(k!=null){const ee=k===!0?x(r.BYTES):k;j.push(Ic("extraEntropy",ee))}const X=hw(...j),G=H;function Z(ee){const N=z(ee);if(!p(N))return;const te=c(N),fe=l.BASE.multiply(N).toAffine(),Ee=a(fe.x);if(Ee===Kf)return;const _e=a(te*a(G+Ee*oe));if(_e===Kf)return;let Re=(fe.x===Ee?0:2)|Number(fe.y&Ua),Te=_e;return w&&y(_e)&&(Te=b(_e),Re^=1),new C(Ee,Te,Re)}return{seed:X,k2sig:Z}}const K={lowS:e.lowS,prehash:!1},P={lowS:e.lowS,prehash:!1};function M(m,R,B=K){const{seed:E,k2sig:x}=ce(m,R,B),w=e;return oQ(w.hash.outputLen,w.nByteLength,w.hmac)(E,x)}l.BASE._setWindowSize(8);function v(m,R,B,E=P){var fe;const x=m;if(R=Ic("msgHash",R),B=Ic("publicKey",B),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=E;let k,H;try{if(typeof x=="string"||x instanceof Uint8Array)try{k=C.fromDER(x)}catch(Ee){if(!(Ee instanceof k0.Err))throw Ee;k=C.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:Ee,s:_e}=x;k=new C(Ee,_e)}else throw new Error("PARSE");H=l.fromHex(B)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&k.hasHighS())return!1;T&&(R=e.hash(R));const{r:oe,s:j}=k,X=_(R),G=c(j),Z=a(X*G),ee=a(oe*G),N=(fe=l.BASE.multiplyAndAddUnsafe(H,Z,ee))==null?void 0:fe.toAffine();return N?a(N.x)===oe:!1}return{CURVE:e,getPublicKey:O,getSharedSecret:F,sign:M,verify:v,ProjectivePoint:l,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function r5e(t){return{hash:t,hmac:(e,...r)=>T8(t,e,T6e(...r)),randomBytes:k6e}}function n5e(t,e){const r=n=>t5e({...t,...r5e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),SL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),i5e=BigInt(1),X7=BigInt(2),_L=(t,e)=>(t+e/X7)/e;function s5e(t){const e=uQ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,f=l*l*t%e,u=_a(f,r,e)*f%e,p=_a(u,r,e)*f%e,g=_a(p,X7,e)*l%e,y=_a(g,i,e)*g%e,b=_a(y,s,e)*y%e,I=_a(b,a,e)*b%e,C=_a(I,c,e)*I%e,S=_a(C,a,e)*b%e,O=_a(S,r,e)*f%e,L=_a(O,o,e)*y%e,F=_a(L,n,e)*l%e,z=_a(F,X7,e);if(!e_.eql(e_.sqr(z),t))throw new Error("Cannot find square root");return z}const e_=G3e(uQ,void 0,void 0,{sqrt:s5e}),id=n5e({a:BigInt(0),b:BigInt(7),Fp:e_,n:SL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=SL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=_L(s*t,e),c=_L(-n*t,e);let l=_o(t-a*r-c*i,e),f=_o(-a*n-c*s,e);const u=l>o,p=f>o;if(u&&(l=e-l),p&&(f=e-f),l>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:l,k2neg:p,k2:f}}}},Cy);BigInt(0);id.ProjectivePoint;const mu="0x0000000000000000000000000000000000000000",Xg="0x0000000000000000000000000000000000000000000000000000000000000000",o5e=`Ethereum Signed Message: +`,IL=BigInt(0),TL=BigInt(1),PL=BigInt(2),kL=BigInt(27),ML=BigInt(28),p6=BigInt(35),D1={};function RL(t){return qc(es(t),32)}var tg,rg,ng,G0,So;let bu=(So=class{constructor(e,r,n,i){Ie(this,tg);Ie(this,rg);Ie(this,ng);Ie(this,G0);Th(e,D1,"Signature"),ue(this,tg,r),ue(this,rg,n),ue(this,ng,i),ue(this,G0,null)}get r(){return Q(this,tg)}set r(e){pe(fp(e)===32,"invalid r","value",e),ue(this,tg,Me(e))}get s(){return Q(this,rg)}set s(e){pe(fp(e)===32,"invalid s","value",e);const r=Me(e);pe(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ue(this,rg,r)}get v(){return Q(this,ng)}set v(e){const r=cr(e,"value");pe(r===27||r===28,"invalid v","v",e),ue(this,ng,r)}get networkV(){return Q(this,G0)}get legacyChainId(){const e=this.networkV;return e==null?null:So.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ue(this.s);return this.yParity&&(e[0]|=128),Me(e)}get compactSerialized(){return Vr([this.r,this.yParityAndS])}get serialized(){return Vr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new So(D1,this.r,this.s,this.v);return this.networkV&&ue(e,G0,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Tt(e,"v");return r==kL||r==ML?IL:(pe(r>=p6,"invalid EIP-155 v","v",e),(r-p6)/PL)}static getChainIdV(e,r){return Tt(e)*PL+BigInt(35+r-27)}static getNormalizedV(e){const r=Tt(e);return r===IL||r===kL?27:r===TL||r===ML?28:(pe(r>=p6,"invalid v","v",e),r&TL?27:28)}static from(e){function r(l,f){pe(l,f,"signature",e)}if(e==null)return new So(D1,Xg,Xg,27);if(typeof e=="string"){const l=Ue(e,"signature");if(l.length===64){const f=Me(l.slice(0,32)),u=l.slice(32,64),p=u[0]&128?28:27;return u[0]&=127,new So(D1,f,Me(u),p)}if(l.length===65){const f=Me(l.slice(0,32)),u=l.slice(32,64);r((u[0]&128)===0,"non-canonical s");const p=So.getNormalizedV(l[64]);return new So(D1,f,Me(u),p)}r(!1,"invalid raw signature length")}if(e instanceof So)return e.clone();const n=e.r;r(n!=null,"missing r");const i=RL(n),s=function(l,f){if(l!=null)return RL(l);if(f!=null){r(Wr(f,32),"invalid yParityAndS");const u=Ue(f);return u[0]&=127,Me(u)}r(!1,"missing s")}(e.s,e.yParityAndS);r((Ue(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(l,f,u){if(l!=null){const p=Tt(l);return{networkV:p>=p6?p:void 0,v:So.getNormalizedV(p)}}if(f!=null)return r(Wr(f,32),"invalid yParityAndS"),{v:Ue(f)[0]&128?28:27};if(u!=null){switch(cr(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new So(D1,i,s,a);return o&&ue(c,G0,o),r(e.yParity==null||cr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},tg=new WeakMap,rg=new WeakMap,ng=new WeakMap,G0=new WeakMap,So);var jf,Ml;let Yd=(Ml=class{constructor(e){Ie(this,jf);pe(fp(e)===32,"invalid private key","privateKey","[REDACTED]"),ue(this,jf,Me(e))}get privateKey(){return Q(this,jf)}get publicKey(){return Ml.computePublicKey(Q(this,jf))}get compressedPublicKey(){return Ml.computePublicKey(Q(this,jf),!0)}sign(e){pe(fp(e)===32,"invalid digest length","digest",e);const r=id.sign(Xi(e),Xi(Q(this,jf)),{lowS:!0});return bu.from({r:Ya(r.r,32),s:Ya(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Ml.computePublicKey(e);return Me(id.getSharedSecret(Xi(Q(this,jf)),Ue(r),!1))}static computePublicKey(e,r){let n=Ue(e,"key");if(n.length===32){const s=id.getPublicKey(n,!!r);return Me(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=id.ProjectivePoint.fromHex(n);return Me(i.toRawBytes(r))}static recoverPublicKey(e,r){pe(fp(e)===32,"invalid digest length","digest",e);const n=bu.from(r);let i=id.Signature.fromCompact(Xi(Vr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Xi(e));return pe(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=id.ProjectivePoint.fromHex(Ml.computePublicKey(e).substring(2)),s=id.ProjectivePoint.fromHex(Ml.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}},jf=new WeakMap,Ml);const a5e=BigInt(0),c5e=BigInt(36);function OL(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ue(br(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const pk={};for(let t=0;t<10;t++)pk[String(t)]=String(t);for(let t=0;t<26;t++)pk[String.fromCharCode(65+t)]=String(10+t);const DL=15;function l5e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>pk[n]).join("");for(;e.length>=DL;){let n=e.substring(0,DL);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const f5e=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function u5e(t){t=t.toLowerCase();let e=a5e;for(let r=0;re.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return Q(this,W0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return Q(this,W0)===!0?-1:Q(this,W0)===!1?this.value.length:null}static from(e,r){return new Mf(kf,e,r)}static uint8(e){return At(e,8)}static uint16(e){return At(e,16)}static uint24(e){return At(e,24)}static uint32(e){return At(e,32)}static uint40(e){return At(e,40)}static uint48(e){return At(e,48)}static uint56(e){return At(e,56)}static uint64(e){return At(e,64)}static uint72(e){return At(e,72)}static uint80(e){return At(e,80)}static uint88(e){return At(e,88)}static uint96(e){return At(e,96)}static uint104(e){return At(e,104)}static uint112(e){return At(e,112)}static uint120(e){return At(e,120)}static uint128(e){return At(e,128)}static uint136(e){return At(e,136)}static uint144(e){return At(e,144)}static uint152(e){return At(e,152)}static uint160(e){return At(e,160)}static uint168(e){return At(e,168)}static uint176(e){return At(e,176)}static uint184(e){return At(e,184)}static uint192(e){return At(e,192)}static uint200(e){return At(e,200)}static uint208(e){return At(e,208)}static uint216(e){return At(e,216)}static uint224(e){return At(e,224)}static uint232(e){return At(e,232)}static uint240(e){return At(e,240)}static uint248(e){return At(e,248)}static uint256(e){return At(e,256)}static uint(e){return At(e,256)}static int8(e){return At(e,-8)}static int16(e){return At(e,-16)}static int24(e){return At(e,-24)}static int32(e){return At(e,-32)}static int40(e){return At(e,-40)}static int48(e){return At(e,-48)}static int56(e){return At(e,-56)}static int64(e){return At(e,-64)}static int72(e){return At(e,-72)}static int80(e){return At(e,-80)}static int88(e){return At(e,-88)}static int96(e){return At(e,-96)}static int104(e){return At(e,-104)}static int112(e){return At(e,-112)}static int120(e){return At(e,-120)}static int128(e){return At(e,-128)}static int136(e){return At(e,-136)}static int144(e){return At(e,-144)}static int152(e){return At(e,-152)}static int160(e){return At(e,-160)}static int168(e){return At(e,-168)}static int176(e){return At(e,-176)}static int184(e){return At(e,-184)}static int192(e){return At(e,-192)}static int200(e){return At(e,-200)}static int208(e){return At(e,-208)}static int216(e){return At(e,-216)}static int224(e){return At(e,-224)}static int232(e){return At(e,-232)}static int240(e){return At(e,-240)}static int248(e){return At(e,-248)}static int256(e){return At(e,-256)}static int(e){return At(e,-256)}static bytes1(e){return Ur(e,1)}static bytes2(e){return Ur(e,2)}static bytes3(e){return Ur(e,3)}static bytes4(e){return Ur(e,4)}static bytes5(e){return Ur(e,5)}static bytes6(e){return Ur(e,6)}static bytes7(e){return Ur(e,7)}static bytes8(e){return Ur(e,8)}static bytes9(e){return Ur(e,9)}static bytes10(e){return Ur(e,10)}static bytes11(e){return Ur(e,11)}static bytes12(e){return Ur(e,12)}static bytes13(e){return Ur(e,13)}static bytes14(e){return Ur(e,14)}static bytes15(e){return Ur(e,15)}static bytes16(e){return Ur(e,16)}static bytes17(e){return Ur(e,17)}static bytes18(e){return Ur(e,18)}static bytes19(e){return Ur(e,19)}static bytes20(e){return Ur(e,20)}static bytes21(e){return Ur(e,21)}static bytes22(e){return Ur(e,22)}static bytes23(e){return Ur(e,23)}static bytes24(e){return Ur(e,24)}static bytes25(e){return Ur(e,25)}static bytes26(e){return Ur(e,26)}static bytes27(e){return Ur(e,27)}static bytes28(e){return Ur(e,28)}static bytes29(e){return Ur(e,29)}static bytes30(e){return Ur(e,30)}static bytes31(e){return Ur(e,31)}static bytes32(e){return Ur(e,32)}static address(e){return new Mf(kf,"address",e)}static bool(e){return new Mf(kf,"bool",!!e)}static bytes(e){return new Mf(kf,"bytes",e)}static string(e){return new Mf(kf,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Mf(kf,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===NL}static dereference(e,r){if(Mf.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};W0=new WeakMap;let Rs=Mf;class h5e extends Tu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Rs.dereference(r,"string");try{n=Jt(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Jt(Ya(e.readValue(),20))}}class p5e extends Tu{constructor(r){super(r.name,r.type,"_",r.dynamic);de(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function hQ(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const f=l.localName;return Le(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),Le(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),c[f]=!0,r[f]})}else pe(!1,"invalid tuple value","tuple",r);pe(e.length===n.length,"types/value length mismatch","tuple",r);let i=new W7,s=new W7,o=[];e.forEach((c,l)=>{let f=n[l];if(c.dynamic){let u=s.length;c.encode(s,f);let p=i.writeUpdatableValue();o.push(g=>{p(g+u)})}else c.encode(i,f)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function pQ(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(Ps(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(Ps(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Wg.fromItems(r,n)}class v5e extends Tu{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);de(this,"coder");de(this,"length");Rt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;io||i<-(o+E5e))&&this._throwError("value out-of-bounds",n),i=tk(i,8*Xs)}else(iP0(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=P0(r.readValue(),this.size*8);return this.signed&&(n=C5(n,this.size*8)),n}}class S5e extends vQ{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Ai(Rs.dereference(r,"string")))}decode(e){return Ip(super.decode(e))}}class v6 extends Tu{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);de(this,"coders");Rt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=Rs.dereference(n,"tuple");return hQ(r,this.coders,i)}decode(r){return pQ(r,this.coders)}}function Do(t){return br(Ai(t))}var _5e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const BL=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),LL=4;function I5e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let F=1;F>--c&1}const u=31,p=2**u,g=p>>>1,y=g>>1,b=p-1;let I=0;for(let F=0;F1;){let ce=z+_>>>1;F>>1|f(),$=$<<1^g,ie=(ie^g)<<1|g|1;S=$,O=1+ie-$}let L=n-4;return C.map(F=>{switch(F-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return F-1}})}function T5e(t){let e=0;return()=>t[e++]}function gQ(t){return T5e(I5e(P5e(t)))}function P5e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function k5e(t){return t&1?~t>>1:t>>1}function M5e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=vw(t);if(e.length)return e})}function mQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(R5e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(O5e(r,t))}return e.flat()}function gw(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function bQ(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function R5e(t,e){let r=1+e(),n=e(),i=gw(e);return bQ(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((f,u)=>{let p=u*n;return[c+u*r,l.map(g=>g+p)]})})}function O5e(t,e){let r=1+e();return bQ(r,1+t,e).map(i=>[i[0],i.slice(1)])}function D5e(t){let e=[],r=vw(t);return i(n([]),[]),e;function n(s){let o=t(),a=gw(()=>{let c=vw(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let f of l.Q)i(l,[...a,f],c)}}}function N5e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function wQ(t){return`{${N5e(t)}}`}function B5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function CQ(t){return t&16777215}let t_,FL,r_,n3;function z5e(){let t=gQ(F5e);t_=new Map(yQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),FL=new Set(vw(t)),r_=new Map,n3=new Map;for(let[e,r]of mQ(t)){if(!FL.has(e)&&r.length==2){let[n,i]=r,s=n3.get(n);s||(s=new Map,n3.set(n,s)),s.set(i,e)}r_.set(e,r.reverse())}}function AQ(t){return t>=yw&&t=_5&&t<$5e&&e>=I5&&eT5&&e0&&i(T5+l)}else{let o=r_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Qm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=H5e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function _Q(t){return SQ(t).map(CQ)}function W5e(t){return G5e(SQ(t))}const jL=45,IQ=".",TQ=65039,PQ=1,k5=t=>Array.from(t);function mw(t,e){return t.P.has(e)||t.Q.has(e)}class K5e extends Array{get is_emoji(){return!0}}let n_,kQ,M0,i_,MQ,Ov,t9,V1,v0,UL,s_;function vk(){if(n_)return;let t=gQ(_5e);const e=()=>vw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));n_=new Map(mQ(t)),kQ=r(),M0=e(),i_=new Set(e().map(f=>M0[f])),M0=new Set(M0),MQ=r(),r();let i=yQ(t),s=t();const o=()=>{let f=new Set;return e().forEach(u=>n(f,i[u])),n(f,e()),f};Ov=gw(f=>{let u=gw(t).map(p=>p+96);if(u.length){let p=f>=s;u[0]-=32,u=ey(u),p&&(u=`Restricted[${u}]`);let g=o(),y=o(),b=!t();return{N:u,P:g,Q:y,M:b,R:p}}}),t9=r(),V1=new Map;let a=e().concat(k5(t9)).sort((f,u)=>f-u);a.forEach((f,u)=>{let p=t(),g=a[u]=p?a[u-p]:{V:[],M:new Map};g.V.push(f),t9.has(f)||V1.set(f,g)});for(let{V:f,M:u}of new Set(V1.values())){let p=[];for(let y of f){let b=Ov.filter(C=>mw(C,y)),I=p.find(({G:C})=>b.some(S=>C.has(S)));I||(I={G:new Set,V:[]},p.push(I)),I.V.push(y),n(I.G,b)}let g=p.flatMap(y=>k5(y.G));for(let{G:y,V:b}of p){let I=new Set(g.filter(C=>!y.has(C)));for(let C of b)u.set(C,I)}}v0=new Set;let c=new Set;const l=f=>v0.has(f)?c.add(f):v0.add(f);for(let f of Ov){for(let u of f.P)l(u);for(let u of f.Q)l(u)}for(let f of v0)!V1.has(f)&&!c.has(f)&&V1.set(f,PQ);n(v0,_Q(v0)),UL=D5e(t).map(f=>K5e.from(f)).sort(L5e),s_=new Map;for(let f of UL){let u=[s_];for(let p of f){let g=u.map(y=>{let b=y.get(p);return b||(b=new Map,y.set(p,b)),b});p===TQ?u.push(...g):u=g}for(let p of u)p.V=f}}function gk(t){return(RQ(t)?"":`${yk(M8([t]))} `)+wQ(t)}function yk(t){return`"${t}"‎`}function Y5e(t){if(t.length>=4&&t[2]==jL&&t[3]==jL)throw new Error(`invalid label extension: "${ey(t.slice(0,4))}"`)}function Q5e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function J5e(t){let e=t[0],r=BL.get(e);if(r)throw Cb(`leading ${r}`);let n=t.length,i=-1;for(let s=1;se&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o{let s=B5e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=s4e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let f=o.output=a.flat();if(Q5e(f),!(o.emoji=c>1||a[0].is_emoji)&&f.every(p=>p<128))Y5e(f),l="ASCII";else{let p=a.flatMap(g=>g.is_emoji?[]:g);if(!p.length)l="Emoji";else{if(M0.has(f[0]))throw Cb("leading combining mark");for(let b=1;bo.has(a)):k5(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>mw(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function r4e(t){let e=Ov;for(let r of t){let n=e.filter(i=>mw(i,r));if(!n.length)throw Ov.some(i=>mw(i,r))?DQ(e[0],r):OQ(r);if(e=n,n.length==1)break}return e}function n4e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${yk(M8(e,63))}: ${i}`)}return ey(n)}).join(IQ)}function OQ(t){return new Error(`disallowed character: ${gk(t)}`)}function DQ(t,e){let r=gk(e),n=Ov.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Cb(t){return new Error(`illegal placement: ${t}`)}function i4e(t,e){for(let r of e)if(!mw(t,r))throw DQ(t,r);if(t.M){let r=_Q(e);for(let n=1,i=r.length;nLL)throw new Error(`excessive non-spacing marks: ${yk(M8(r.slice(n-1,s)))} (${s-n}/${LL})`);n=s}}}function s4e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=a4e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(v0.has(o))i.push(o);else{let a=n_.get(o);if(a)i.push(...a);else if(!kQ.has(o))throw OQ(o)}}}return i.length&&n.push(e(i)),n}function o4e(t){return t.filter(e=>e!=TQ)}function a4e(t,e){let r=s_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const NQ=new Uint8Array(32);NQ.fill(0);function $L(t){return pe(t.length!==0,"invalid ENS name; empty component","comp",t),t}function BQ(t){const e=Ai(c4e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i{pe(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function r9(t,e){return{address:Jt(t),storageKeys:e.map((r,n)=>(pe(Wr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Wp(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(pe(r.length===2,"invalid slot set",`value[${n}]`,r),r9(r[0],r[1])):(pe(r!=null&&typeof r=="object","invalid address-slot set","value",t),r9(r.address,r.storageKeys)));pe(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return r9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function gx(t){let e;return typeof t=="string"?e=Yd.computePublicKey(t,!1):e=t.publicKey,Jt(br("0x"+e.substring(4)).substring(26))}function M5(t,e){return gx(Yd.recoverPublicKey(t,e))}const Mi=BigInt(0),f4e=BigInt(2),u4e=BigInt(27),d4e=BigInt(28),h4e=BigInt(35),p4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n9=4096*32;function qL(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=Xa(e).substring(4),"0x"+r}function R8(t){return t==="0x"?null:Jt(t)}function mk(t,e){try{return Wp(t)}catch(r){pe(!1,r.message,e,t)}}function yx(t,e){return t==="0x"?0:cr(t,e)}function oi(t,e){if(t==="0x")return Mi;const r=Tt(t,e);return pe(r<=p4e,"value exceeds uint size",e,r),r}function An(t,e){const r=Tt(t,"value"),n=es(r);return pe(n.length<=32,"value too large",`tx.${e}`,r),n}function bk(t){return Wp(t).map(e=>[e.address,e.storageKeys])}function v4e(t,e){pe(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;ri.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):Vr(["0x03",Tp(n)])}var wl,ig,sg,og,ag,cg,lg,fg,ug,dg,hg,pg,K0,md,Uf,bd,vg,i3;const Rf=class Rf{constructor(){Ie(this,vg);Ie(this,wl);Ie(this,ig);Ie(this,sg);Ie(this,og);Ie(this,ag);Ie(this,cg);Ie(this,lg);Ie(this,fg);Ie(this,ug);Ie(this,dg);Ie(this,hg);Ie(this,pg);Ie(this,K0);Ie(this,md);Ie(this,Uf);Ie(this,bd);ue(this,wl,null),ue(this,ig,null),ue(this,og,0),ue(this,ag,Mi),ue(this,cg,null),ue(this,lg,null),ue(this,fg,null),ue(this,sg,"0x"),ue(this,ug,Mi),ue(this,dg,Mi),ue(this,hg,null),ue(this,pg,null),ue(this,K0,null),ue(this,md,null),ue(this,bd,null),ue(this,Uf,null)}get type(){return Q(this,wl)}set type(e){switch(e){case null:ue(this,wl,null);break;case 0:case"legacy":ue(this,wl,0);break;case 1:case"berlin":case"eip-2930":ue(this,wl,1);break;case 2:case"london":case"eip-1559":ue(this,wl,2);break;case 3:case"cancun":case"eip-4844":ue(this,wl,3);break;default:pe(!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"}return null}get to(){const e=Q(this,ig);return e==null&&this.type===3?mu:e}set to(e){ue(this,ig,e==null?null:Jt(e))}get nonce(){return Q(this,og)}set nonce(e){ue(this,og,cr(e,"value"))}get gasLimit(){return Q(this,ag)}set gasLimit(e){ue(this,ag,Tt(e))}get gasPrice(){const e=Q(this,cg);return e==null&&(this.type===0||this.type===1)?Mi:e}set gasPrice(e){ue(this,cg,e==null?null:Tt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Q(this,lg);return e??(this.type===2||this.type===3?Mi:null)}set maxPriorityFeePerGas(e){ue(this,lg,e==null?null:Tt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Q(this,fg);return e??(this.type===2||this.type===3?Mi:null)}set maxFeePerGas(e){ue(this,fg,e==null?null:Tt(e,"maxFeePerGas"))}get data(){return Q(this,sg)}set data(e){ue(this,sg,Me(e))}get value(){return Q(this,ug)}set value(e){ue(this,ug,Tt(e,"value"))}get chainId(){return Q(this,dg)}set chainId(e){ue(this,dg,Tt(e))}get signature(){return Q(this,hg)||null}set signature(e){ue(this,hg,e==null?null:bu.from(e))}get accessList(){const e=Q(this,pg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){ue(this,pg,e==null?null:Wp(e))}get maxFeePerBlobGas(){const e=Q(this,K0);return e==null&&this.type===3?Mi:e}set maxFeePerBlobGas(e){ue(this,K0,e==null?null:Tt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=Q(this,md);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){pe(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;rObject.assign({},e))}set blobs(e){if(e==null){ue(this,bd,null);return}const r=[],n=[];for(let i=0;i=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=Q(this,K0)!=null||Q(this,md);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Le(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Le(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Le(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Rf.from(this)}toJSON(){const e=r=>r==null?null:r.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}}static from(e){if(e==null)return new Rf;if(typeof e=="string"){const n=Ue(e);if(n[0]>=127)return Rf.from(g4e(n));switch(n[0]){case 1:return Rf.from(w4e(n));case 2:return Rf.from(m4e(n));case 3:return Rf.from(E4e(n))}Le(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Rf;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=bu.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),pe(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(pe(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),pe(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};wl=new WeakMap,ig=new WeakMap,sg=new WeakMap,og=new WeakMap,ag=new WeakMap,cg=new WeakMap,lg=new WeakMap,fg=new WeakMap,ug=new WeakMap,dg=new WeakMap,hg=new WeakMap,pg=new WeakMap,K0=new WeakMap,md=new WeakMap,Uf=new WeakMap,bd=new WeakMap,vg=new WeakSet,i3=function(e,r){Le(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return y4e(this,n);case 1:return x4e(this,n);case 2:return b4e(this,n);case 3:return C4e(this,n,r?this.blobs:null)}Le(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let bw=Rf;function xk(t){return typeof t=="string"&&(t=Ai(t)),br(Vr([Ai(o5e),Ai(String(t.length)),t]))}function A4e(t,e){const r=xk(t);return M5(r,e)}const S4e=new RegExp("^bytes([0-9]+)$"),_4e=new RegExp("^(u?int)([0-9]*)$"),I4e=new RegExp("^(.*)\\[([0-9]*)\\]$");function LQ(t,e,r){switch(t){case"address":return Ue(r?qc(e,32):Jt(e));case"string":return Ai(e);case"bytes":return Ue(e);case"bool":return e=e?"0x01":"0x00",Ue(r?qc(e,32):e)}let n=t.match(_4e);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return pe((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=tk(e,s)),Ue(qc(es(e),s/8))}if(n=t.match(S4e),n){const i=parseInt(n[1]);return pe(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),pe(fp(e)===i,`invalid value for ${t}`,"value",e),r?Ue(nY(e,32)):e}if(n=t.match(I4e),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));pe(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(LQ(i,a,!0))}),Ue(Vr(o))}pe(!1,"invalid type","type",t)}function Sr(t,e){pe(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(LQ(n,e[i]))}),Me(Vr(r))}function dp(t,e){return br(Sr(t,e))}const FQ=new Uint8Array(32);FQ.fill(0);const T4e=BigInt(-1),jQ=BigInt(0),UQ=BigInt(1),P4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function k4e(t){const e=Ue(t),r=e.length%32;return r?Vr([e,FQ.slice(r)]):Me(e)}const M4e=Ya(UQ,32),R4e=Ya(jQ,32),VL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},i9=["name","version","chainId","verifyingContract","salt"];function zL(t){return function(e){return pe(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const O4e={name:zL("name"),version:zL("version"),chainId:function(t){const e=Tt(t,"domain.chainId");return pe(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fc(e)},verifyingContract:function(t){try{return Jt(t).toLowerCase()}catch{}pe(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ue(t,"domain.salt");return pe(e.length===32,'invalid domain value "salt"',"domain.salt",t),Me(e)}};function s9(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);pe(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=P0(P4e,r?n-1:n),s=r?(i+UQ)*T4e:jQ;return function(o){const a=Tt(o,"value");return pe(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Ya(r?tk(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return pe(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=Ue(n);return pe(i.length===r,`invalid length for ${t}`,"value",n),k4e(n)}}}switch(t){case"address":return function(e){return qc(Jt(e),32)};case"bool":return function(e){return e?M4e:R4e};case"bytes":return function(e){return br(e)};case"string":return function(e){return Do(e)}}return null}function HL(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function g6(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var Lw,$f,gg,d4,$Q;const Da=class Da{constructor(e){Ie(this,d4);de(this,"primaryType");Ie(this,Lw);Ie(this,$f);Ie(this,gg);ue(this,$f,new Map),ue(this,gg,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:f})=>{let{base:u,index:p}=g6(f);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(p||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),ue(this,Lw,JSON.stringify(s));for(const c in s){const l=new Set;for(const f of s[c]){pe(!l.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),l.add(f.name);const u=g6(f.type).base;pe(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!s9(u)&&(pe(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),r.get(c).add(u))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);pe(o.length!==0,"missing primary type","types",e),pe(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Rt(this,{primaryType:o[0]});function a(c,l){pe(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const f of r.get(c))if(n.has(f)){a(f,l);for(const u of l)i.get(u).add(f)}l.delete(c)}a(this.primaryType,new Set);for(const[c,l]of i){const f=Array.from(l);f.sort(),Q(this,$f).set(c,HL(c,s[c])+f.map(u=>HL(u,s[u])).join(""))}}get types(){return JSON.parse(Q(this,Lw))}getEncoder(e){let r=Q(this,gg).get(e);return r||(r=$e(this,d4,$Q).call(this,e),Q(this,gg).set(e,r)),r}encodeType(e){const r=Q(this,$f).get(e);return pe(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return br(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(s9(e))return n(e,r);const i=g6(e).array;if(i)return pe(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});pe(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Da(e)}static getPrimaryType(e){return Da.from(e).primaryType}static hashStruct(e,r,n){return Da.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=VL[n];pe(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>i9.indexOf(n.name)-i9.indexOf(i.name)),Da.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Vr(["0x1901",Da.hashDomain(e),Da.from(r).hash(n)])}static hash(e,r,n){return br(Da.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!Wr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Da.from(r);o.visit(n,(a,c)=>(a==="address"&&!Wr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){Da.hashDomain(e);const i={},s=[];i9.forEach(c=>{const l=e[c];l!=null&&(i[c]=O4e[c](l),s.push({name:c,type:VL[c]}))});const o=Da.from(r);r=o.types;const a=Object.assign({},r);return pe(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Me(Ue(l));if(c.match(/^u?int/))return Tt(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return pe(typeof l=="string","invalid string","value",l),l}pe(!1,"unsupported type","type",c)})}}};Lw=new WeakMap,$f=new WeakMap,gg=new WeakMap,d4=new WeakSet,$Q=function(e){{const i=s9(e);if(i)return i}const r=g6(e).array;if(r){const i=r.prefix,s=this.getEncoder(i);return o=>{pe(r.count===-1||r.count===o.length,`array length mismatch; expected length ${r.count}`,"value",o);let a=o.map(s);return Q(this,$f).has(i)&&(a=a.map(br)),br(Vr(a))}}const n=this.types[e];if(n){const i=Do(Q(this,$f).get(e));return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return Q(this,$f).has(c)?br(l):l});return o.unshift(i),Vr(o)}}pe(!1,`unknown type: ${e}`,"type",e)};let lh=Da;function eo(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const D4e="external public payable override",N4e=eo(D4e.split(" ")),qQ="constant external internal payable private public pure view override",B4e=eo(qQ.split(" ")),VQ="constructor error event fallback function receive struct",zQ=eo(VQ.split(" ")),HQ="calldata memory storage payable indexed",L4e=eo(HQ.split(" ")),F4e="tuple returns",j4e=[VQ,HQ,F4e,qQ].join(" "),U4e=eo(j4e.split(" ")),$4e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},q4e=new RegExp("^(\\s*)"),V4e=new RegExp("^([0-9]+)"),z4e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),GQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),WQ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Ki,Rc,Fw,a_;const h4=class h4{constructor(e){Ie(this,Fw);Ie(this,Ki);Ie(this,Rc);ue(this,Ki,0),ue(this,Rc,e.slice())}get offset(){return Q(this,Ki)}get length(){return Q(this,Rc).length-Q(this,Ki)}clone(){return new h4(Q(this,Rc))}reset(){ue(this,Ki,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=$e(this,Fw,a_).call(this,Q(this,Ki)+1,e.match+1);return ue(this,Ki,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;Q(this,Ki)=Q(this,Rc).length)throw new Error("out-of-bounds");return Q(this,Rc)[Q(this,Ki)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return um(this,Ki)._++,e}toString(){const e=[];for(let r=Q(this,Ki);r`}};Ki=new WeakMap,Rc=new WeakMap,Fw=new WeakSet,a_=function(e=0,r=0){return new h4(Q(this,Rc).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Hc=h4;function kh(t){const e=[],r=o=>{const a=s0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;f=u+f,e[e.length-1].value=cr(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(a=o.match(z4e),a){if(c.text=a[1],s+=c.text.length,U4e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(WQ)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(V4e),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Hc(e.map(o=>Object.freeze(o)))}function GL(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function O8(t,e){if(e.peekKeyword(zQ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function wu(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function KQ(t){let e=wu(t,B4e);return GL(e,eo("constant payable nonpayable".split(" "))),GL(e,eo("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function au(t,e){return t.popParams().map(r=>is.from(r,e))}function YQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Tt(t.pop().text);throw new Error("invalid gas")}return null}function Pp(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const H4e=new RegExp(/^(.*)\[([0-9]*)\]$/);function WL(t){const e=t.match(WQ);if(pe(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);pe(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);pe(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const On={},No=Symbol.for("_ethers_internal"),KL="_ParamTypeInternal",YL="_ErrorInternal",QL="_EventInternal",JL="_ConstructorInternal",ZL="_FallbackInternal",XL="_FunctionInternal",eF="_StructInternal";var yg,s3;const Na=class Na{constructor(e,r,n,i,s,o,a,c){Ie(this,yg);de(this,"name");de(this,"type");de(this,"baseType");de(this,"indexed");de(this,"components");de(this,"arrayLength");de(this,"arrayChildren");if(Th(e,On,"ParamType"),Object.defineProperty(this,No,{value:KL}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Rt(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return $e(this,yg,s3).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(Na.isParamType(e))return e;if(typeof e=="string")try{return Na.from(kh(e),r)}catch{pe(!1,"invalid param type","obj",e)}else if(e instanceof Hc){let a="",c="",l=null;wu(e,eo(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(b=>Na.from(b)),a=`tuple(${l.map(b=>b.format()).join(",")})`):(a=WL(e.popType("TYPE")),c=a);let f=null,u=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();f=new Na(On,"",a,c,null,l,u,f),u=b.value,a+=b.text,c="array",l=null}let p=null;if(wu(e,L4e).has("indexed")){if(!r)throw new Error("");p=!0}const y=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Na(On,y,a,c,p,l,u,f)}const n=e.name;pe(!n||typeof n=="string"&&n.match(GQ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(pe(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(H4e);if(o){const a=parseInt(o[2]||"-1"),c=Na.from({type:o[1],components:e.components});return new Na(On,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(l=>Na.from(l)):null;return new Na(On,n||"",s,"tuple",i,a,null,null)}return s=WL(e.type),new Na(On,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[No]===KL}};yg=new WeakSet,s3=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((c,l)=>{var f;$e(f=o,yg,s3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,l)=>{var f;$e(f=o[l],yg,s3).call(f,e,c,n,u=>{a[l]=u})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let is=Na;class kp{constructor(e,r,n){de(this,"type");de(this,"inputs");Th(e,On,"Fragment"),n=Object.freeze(n.slice()),Rt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{kp.from(JSON.parse(e))}catch{}return kp.from(kh(e))}if(e instanceof Hc)switch(e.peekKeyword(zQ)){case"constructor":return Zf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return hp.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Zf.from(e);case"error":return To.from(e);case"event":return Pl.from(e);case"fallback":case"receive":return Df.from(e);case"function":return kl.from(e);case"struct":return hp.from(e)}Le(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}pe(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Zf.isFragment(e)}static isError(e){return To.isFragment(e)}static isEvent(e){return Pl.isFragment(e)}static isFunction(e){return kl.isFragment(e)}static isStruct(e){return hp.isFragment(e)}}class D8 extends kp{constructor(r,n,i,s){super(r,n,s);de(this,"name");pe(typeof i=="string"&&i.match(GQ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Rt(this,{name:i})}}function ww(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class To extends D8{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,No,{value:YL})}get selector(){return Do(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+ww(e,this.inputs)),r.join(" ")}static from(e){if(To.isFragment(e))return e;if(typeof e=="string")return To.from(kh(e));if(e instanceof Hc){const r=O8("error",e),n=au(e);return Pp(e),new To(On,r,n)}return new To(On,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[No]===YL}}class Pl extends D8{constructor(r,n,i,s){super(r,"event",n,i);de(this,"anonymous");Object.defineProperty(this,No,{value:QL}),Rt(this,{anonymous:s})}get topicHash(){return Do(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+ww(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>is.from(s)),new Pl(On,r,n,!1).topicHash}static from(r){if(Pl.isFragment(r))return r;if(typeof r=="string")try{return Pl.from(kh(r))}catch{pe(!1,"invalid event fragment","obj",r)}else if(r instanceof Hc){const n=O8("event",r),i=au(r,!0),s=!!wu(r,eo(["anonymous"])).has("anonymous");return Pp(r),new Pl(On,n,i,s)}return new Pl(On,r.name,r.inputs?r.inputs.map(n=>is.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[No]===QL}}class Zf extends kp{constructor(r,n,i,s,o){super(r,n,i);de(this,"payable");de(this,"gas");Object.defineProperty(this,No,{value:JL}),Rt(this,{payable:s,gas:o})}format(r){if(Le(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${ww(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(Zf.isFragment(r))return r;if(typeof r=="string")try{return Zf.from(kh(r))}catch{pe(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof Hc){wu(r,eo(["constructor"]));const n=au(r),i=!!wu(r,N4e).has("payable"),s=YQ(r);return Pp(r),new Zf(On,"constructor",n,i,s)}return new Zf(On,"constructor",r.inputs?r.inputs.map(is.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[No]===JL}}class Df extends kp{constructor(r,n,i){super(r,"fallback",n);de(this,"payable");Object.defineProperty(this,No,{value:ZL}),Rt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Df.isFragment(r))return r;if(typeof r=="string")try{return Df.from(kh(r))}catch{pe(!1,"invalid fallback fragment","obj",r)}else if(r instanceof Hc){const n=r.toString(),i=r.peekKeyword(eo(["fallback","receive"]));if(pe(i,"type must be fallback or receive","obj",n),r.popKeyword(eo(["fallback","receive"]))==="receive"){const c=au(r);return pe(c.length===0,"receive cannot have arguments","obj.inputs",c),wu(r,eo(["payable"])),Pp(r),new Df(On,[],!0)}let o=au(r);o.length?pe(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[is.from("bytes")];const a=KQ(r);if(pe(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),wu(r,eo(["returns"])).has("returns")){const c=au(r);pe(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Pp(r),new Df(On,o,a==="payable")}if(r.type==="receive")return new Df(On,[],!0);if(r.type==="fallback"){const n=[is.from("bytes")],i=r.stateMutability==="payable";return new Df(On,n,i)}pe(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[No]===ZL}}class kl extends D8{constructor(r,n,i,s,o,a){super(r,"function",n,s);de(this,"constant");de(this,"outputs");de(this,"stateMutability");de(this,"payable");de(this,"gas");Object.defineProperty(this,No,{value:XL}),o=Object.freeze(o.slice()),Rt(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Do(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+ww(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(ww(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>is.from(s)),new kl(On,r,"view",n,[],null).selector}static from(r){if(kl.isFragment(r))return r;if(typeof r=="string")try{return kl.from(kh(r))}catch{pe(!1,"invalid function fragment","obj",r)}else if(r instanceof Hc){const i=O8("function",r),s=au(r),o=KQ(r);let a=[];wu(r,eo(["returns"])).has("returns")&&(a=au(r));const c=YQ(r);return Pp(r),new kl(On,i,o,s,a,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new kl(On,r.name,n,r.inputs?r.inputs.map(is.from):[],r.outputs?r.outputs.map(is.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[No]===XL}}class hp extends D8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,No,{value:eF})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return hp.from(kh(e))}catch{pe(!1,"invalid struct fragment","obj",e)}else if(e instanceof Hc){const r=O8("struct",e),n=au(e);return Pp(e),new hp(On,r,n)}return new hp(On,e.name,e.inputs?e.inputs.map(is.from):[])}static isFragment(e){return e&&e[No]===eF}}const Yc=new Map;Yc.set(0,"GENERIC_PANIC");Yc.set(1,"ASSERT_FALSE");Yc.set(17,"OVERFLOW");Yc.set(18,"DIVIDE_BY_ZERO");Yc.set(33,"ENUM_RANGE_ERROR");Yc.set(34,"BAD_STORAGE_DATA");Yc.set(49,"STACK_UNDERFLOW");Yc.set(50,"ARRAY_RANGE_ERROR");Yc.set(65,"OUT_OF_MEMORY");Yc.set(81,"UNINITIALIZED_FUNCTION_CALL");const G4e=new RegExp(/^bytes([0-9]*)$/),W4e=new RegExp(/^(u?int)([0-9]*)$/);let o9=null,tF=1024;function K4e(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const l=Ue(r);if(r=Me(r),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Me(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Me(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${Yc.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?Jt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=Jt(e.from)),zn(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var wd,z1;const p4=class p4{constructor(){Ie(this,wd)}getDefaultValue(e){const r=e.map(i=>$e(this,wd,z1).call(this,is.from(i)));return new v6(r,"_").defaultValue()}encode(e,r){XK(r.length,e.length,"types/values length mismatch");const n=e.map(o=>$e(this,wd,z1).call(this,is.from(o))),i=new v6(n,"_"),s=new W7;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>$e(this,wd,z1).call(this,is.from(o)));return new v6(i,"_").decode(new K7(r,n,tF))}static _setDefaultMaxInflation(e){pe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),tF=e}static defaultAbiCoder(){return o9==null&&(o9=new p4),o9}static getBuiltinCallException(e,r,n){return K4e(e,r,n,p4.defaultAbiCoder())}};wd=new WeakSet,z1=function(e){if(e.isArray())return new v5e($e(this,wd,z1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new v6(e.components.map(n=>$e(this,wd,z1).call(this,n)),e.name);switch(e.baseType){case"address":return new h5e(e.name);case"bool":return new g5e(e.name);case"string":return new S5e(e.name);case"bytes":return new y5e(e.name);case"":return new w5e(e.name)}let r=e.type.match(W4e);if(r){let n=parseInt(r[2]||"256");return pe(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new A5e(n/8,r[1]==="int",e.name)}if(r=e.type.match(G4e),r){let n=parseInt(r[1]);return pe(n!==0&&n<=32,"invalid bytes length","param",e),new m5e(n,e.name)}pe(!1,"invalid type","type",e.type)};let Ls=p4;class Y4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"signature");de(this,"topic");de(this,"args");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class Q4e{constructor(e,r,n,i){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");de(this,"value");const s=e.name,o=e.format();Rt(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class J4e{constructor(e,r,n){de(this,"fragment");de(this,"name");de(this,"args");de(this,"signature");de(this,"selector");const i=e.name,s=e.format();Rt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class rF{constructor(e){de(this,"hash");de(this,"_isIndexed");Rt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const nF={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},iF={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&nF[t.toString()]&&(e=nF[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var xl,El,Cl,Es,ql,o3,a3;const A0=class A0{constructor(e){Ie(this,ql);de(this,"fragments");de(this,"deploy");de(this,"fallback");de(this,"receive");Ie(this,xl);Ie(this,El);Ie(this,Cl);Ie(this,Es);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ue(this,Cl,new Map),ue(this,xl,new Map),ue(this,El,new Map);const n=[];for(const o of r)try{n.push(kp.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Rt(this,{fragments:Object.freeze(n)});let i=null,s=!1;ue(this,Es,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Rt(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(pe(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=Q(this,Cl);break;case"event":c=Q(this,El);break;case"error":c=Q(this,xl);break;default:return}const l=o.format();c.has(l)||c.set(l,o)}),this.deploy||Rt(this,{deploy:Zf.from("constructor()")}),Rt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Ls.defaultAbiCoder()}getFunctionName(e){const r=$e(this,ql,o3).call(this,e,null,!1);return pe(r,"no matching function","key",e),r.name}hasFunction(e){return!!$e(this,ql,o3).call(this,e,null,!1)}getFunction(e,r){return $e(this,ql,o3).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(Q(this,Cl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;nn.localeCompare(i));for(let n=0;n1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");pe(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=To.from(e).format(),e==="Error(string)")return To.from("error Error(string)");if(e==="Panic(uint256)")return To.from("error Panic(uint256)");const n=Q(this,xl).get(e);return n||null}forEachError(e){const r=Array.from(Q(this,xl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;ns.type==="string"?Do(o):s.type==="bytes"?br(Me(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Ya(o):s.type.match(/^bytes/)?o=nY(o,32):s.type==="address"&&Q(this,Es).encode(["address"],[o]),qc(Me(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){pe(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?pe(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);pe(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),pe(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Do(c));else if(o.type==="bytes")n.push(br(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(Q(this,Es).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:Q(this,Es).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const g=this.getEvent(e);pe(g,"unknown event","eventFragment",e),e=g}if(n!=null&&!e.anonymous){const g=e.topicHash;pe(Wr(n[0],32)&&n[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((g,y)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(is.from({type:"bytes32",name:g.name})),o.push(!0)):(i.push(g),o.push(!1)):(s.push(g),o.push(!1))});const a=n!=null?Q(this,Es).decode(i,Vr(n)):null,c=Q(this,Es).decode(s,r,!0),l=[],f=[];let u=0,p=0;return e.inputs.forEach((g,y)=>{let b=null;if(g.indexed)if(a==null)b=new rF(null);else if(o[y])b=new rF(a[p++]);else try{b=a[p++]}catch(I){b=I}else try{b=c[u++]}catch(I){b=I}l.push(b),f.push(g.name||null)}),Wg.fromItems(l,f)}parseTransaction(e){const r=Ue(e.data,"tx.data"),n=Tt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Me(r.slice(0,4)));if(!i)return null;const s=Q(this,Es).decode(i.inputs,r.slice(4));return new Q4e(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new Y4e(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=Me(e),n=this.getError(mn(r,0,4));if(!n)return null;const i=Q(this,Es).decode(n.inputs,mn(r,4));return new J4e(n,n.selector,i)}static from(e){return e instanceof A0?e:typeof e=="string"?new A0(JSON.parse(e)):typeof e.formatJson=="function"?new A0(e.formatJson()):typeof e.format=="function"?new A0(e.format("json")):new A0(e)}};xl=new WeakMap,El=new WeakMap,Cl=new WeakMap,Es=new WeakMap,ql=new WeakSet,o3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,Cl).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,Cl))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,c=!0;Rs.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let l=s.length-1;l>=0;l--){const f=s[l].inputs.length;f!==a&&(!c||f!==a-1)&&s.splice(l,1)}for(let l=s.length-1;l>=0;l--){const f=s[l].inputs;for(let u=0;u=f.length){if(r[u].type==="overrides")continue;s.splice(l,1);break}if(r[u].type!==f[u].baseType){s.splice(l,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,Cl).get(kl.from(e).format());return i||null},a3=function(e,r,n){if(Wr(e)){const s=e.toLowerCase();for(const o of Q(this,El).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of Q(this,El))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length=0;o--){const a=s[o].inputs;for(let c=0;c1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");pe(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=Q(this,El).get(Pl.from(e).format());return i||null};let Fi=A0;const QQ=BigInt(0);function Dv(t){return t??null}function ni(t){return t==null?null:t.toString()}class sF{constructor(e,r,n){de(this,"gasPrice");de(this,"maxFeePerGas");de(this,"maxPriorityFeePerGas");Rt(this,{gasPrice:Dv(e),maxFeePerGas:Dv(r),maxPriorityFeePerGas:Dv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:ni(e),maxFeePerGas:ni(r),maxPriorityFeePerGas:ni(n)}}}function xw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Me(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Tt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=cr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Wp(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>yu(i)?Me(i):Object.assign({},i))),e}var qf;class Z4e{constructor(e,r){de(this,"provider");de(this,"number");de(this,"hash");de(this,"timestamp");de(this,"parentHash");de(this,"parentBeaconBlockRoot");de(this,"nonce");de(this,"difficulty");de(this,"gasLimit");de(this,"gasUsed");de(this,"stateRoot");de(this,"receiptsRoot");de(this,"blobGasUsed");de(this,"excessBlobGas");de(this,"miner");de(this,"prevRandao");de(this,"extraData");de(this,"baseFeePerGas");Ie(this,qf);ue(this,qf,e.transactions.map(n=>typeof n!="string"?new Ew(n,r):n)),Rt(this,{provider:r,hash:Dv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Dv(e.prevRandao),extraData:e.extraData,baseFeePerGas:Dv(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return Q(this,qf).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=Q(this,qf).slice();return e.length===0?[]:(Le(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,timestamp:b,transactions:I}=this;return{_type:"Block",baseFeePerGas:ni(e),difficulty:ni(r),extraData:n,gasLimit:ni(i),gasUsed:ni(s),blobGasUsed:ni(this.blobGasUsed),excessBlobGas:ni(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:f,parentHash:u,timestamp:b,parentBeaconBlockRoot:p,stateRoot:g,receiptsRoot:y,transactions:I}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>enew mx(i,r))));let n=QQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Rt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return Q(this,jw)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:f,root:u}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:ni(this.cumulativeGasUsed),from:r,gasPrice:ni(this.gasPrice),blobGasUsed:ni(this.blobGasUsed),blobGasPrice:ni(this.blobGasPrice),gasUsed:ni(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:u,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(a)return null;const{blockNumber:p,nonce:g}=await ui({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g{if(p==null||p.status!==0)return p;Le(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((p,g)=>{const y=[],b=()=>{y.forEach(C=>C())};if(y.push(()=>{a=!0}),i>0){const C=setTimeout(()=>{b(),g(zn("wait for transaction timeout","TIMEOUT"))},i);y.push(()=>{clearTimeout(C)})}const I=async C=>{if(await C.confirmations()>=n){b();try{p(l(C))}catch(S){g(S)}}};if(y.push(()=>{this.provider.off(this.hash,I)}),this.provider.on(this.hash,I),s>=0){const C=async()=>{try{await c()}catch(S){if(Ps(S,"TRANSACTION_REPLACED")){b(),g(S);return}}a||this.provider.once("block",C)};y.push(()=>{this.provider.off("block",C)}),this.provider.once("block",C)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),XQ(this)}reorderedEvent(e){return Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Le(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ZQ(this,e)}replaceableTransaction(e){pe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new JM(this,this.provider);return ue(r,xd,e),r}};xd=new WeakMap;let Ew=JM;function X4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function ZQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function XQ(t){return{orphan:"drop-transaction",tx:t}}function e8e(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class Ek extends mx{constructor(r,n,i){super(r,r.provider);de(this,"interface");de(this,"fragment");de(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Rt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class eJ extends mx{constructor(r,n){super(r,r.provider);de(this,"error");Rt(this,{error:n})}}var mg;class t8e extends JQ{constructor(r,n,i){super(i,n);Ie(this,mg);ue(this,mg,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?Q(this,mg).getEvent(r.topics[0]):null;if(n)try{return new Ek(r,Q(this,mg),n)}catch(i){return new eJ(r,i)}return r})}}mg=new WeakMap;var Uw;class Ck extends Ew{constructor(r,n,i){super(i,n);Ie(this,Uw);ue(this,Uw,r)}async wait(r,n){const i=await super.wait(r,n);return i==null?null:new t8e(Q(this,Uw),this.provider,i)}}Uw=new WeakMap;class tJ extends sY{constructor(r,n,i,s){super(r,n,i);de(this,"log");Rt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class r8e extends tJ{constructor(e,r,n,i,s){super(e,r,n,new Ek(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Rt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const oF=BigInt(0);function rJ(t){return t&&typeof t.call=="function"}function nJ(t){return t&&typeof t.estimateGas=="function"}function N8(t){return t&&typeof t.resolveName=="function"}function iJ(t){return t&&typeof t.sendTransaction=="function"}function sJ(t){if(t!=null){if(N8(t))return t;if(t.provider)return t.provider}}var $w;class n8e{constructor(e,r,n){Ie(this,$w);de(this,"fragment");if(Rt(this,{fragment:r}),r.inputs.lengthn[c]==null?null:a.walkAsync(n[c],(f,u)=>f==="address"?Array.isArray(u)?Promise.all(u.map(p=>ts(p,s))):ts(u,s):u)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return Q(this,$w)}}$w=new WeakMap;function Mp(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function R0(t){return t==null?null:t.provider||null}async function oJ(t,e){const r=Rs.dereference(t,"overrides");pe(typeof r=="object","invalid overrides parameter","overrides",t);const n=xw(r);return pe(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),pe(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function i8e(t,e,r){const n=Mp(t,"resolveName"),i=N8(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=Rs.dereference(c,a),a==="address"?ts(c,i):c))))}function s8e(t){const e=async function(o){const a=await oJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ts(a.from,sJ(t.runner)));const c=t.interface,l=Tt(a.value||oF,"overrides.value")===oF,f=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&pe(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data);const u=c.receive||c.fallback&&c.fallback.payable;return pe(u||l,"cannot send value to non-payable fallback","overrides.value",a.value),pe(c.fallback||f,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Mp(t.runner,"call");Le(rJ(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(l){throw ek(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Le(iJ(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),l=R0(t.runner);return new Ck(t.interface,l,c)},i=async function(o){const a=Mp(t.runner,"estimateGas");return Le(nJ(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Rt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function o8e(t,e){const r=function(...l){const f=t.interface.getFunction(e,l);return Le(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),f},n=async function(...l){const f=r(...l);let u={};if(f.inputs.length+1===l.length&&(u=await oJ(l.pop()),u.from&&(u.from=await ts(u.from,sJ(t.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const p=await i8e(t.runner,f.inputs,l);return Object.assign({},u,await ui({to:t.getAddress(),data:t.interface.encodeFunctionData(f,p)}))},i=async function(...l){const f=await a(...l);return f.length===1?f[0]:f},s=async function(...l){const f=t.runner;Le(iJ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await f.sendTransaction(await n(...l)),p=R0(t.runner);return new Ck(t.interface,p,u)},o=async function(...l){const f=Mp(t.runner,"estimateGas");return Le(nJ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},a=async function(...l){const f=Mp(t.runner,"call");Le(rJ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let p="0x";try{p=await f.call(u)}catch(y){throw ek(y)&&y.data?t.interface.makeError(y.data,u):y}const g=r(...l);return t.interface.decodeFunctionResult(g,p)},c=async(...l)=>r(...l).constant?await i(...l):await s(...l);return Rt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=t.interface.getFunction(e);return Le(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function a8e(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Le(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new n8e(t,r(...i),i)};return Rt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Le(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const R5=Symbol.for("_ethersInternal_contract"),aJ=new WeakMap;function c8e(t,e){aJ.set(t[R5],e)}function Ko(t){return aJ.get(t[R5])}function l8e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Ak(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(Wr(o,32))return o;const a=t.interface.getEvent(o);return pe(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?Wr(e,32)?r=[e]:(n=t.interface.getEvent(e),pe(n,"unknown fragment","event",e),r=[n.topicHash]):l8e(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):pe(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Jm(t,e){const{subs:r}=Ko(t);return r.get((await Ak(t,e)).tag)||null}async function aF(t,e,r){const n=R0(t.runner);Le(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await Ak(t,r),{addr:a,subs:c}=Ko(t);let l=c.get(s);if(!l){const u={address:a||t,topics:o},p=I=>{let C=i;if(C==null)try{C=t.interface.getEvent(I.topics[0])}catch{}if(C){const S=C,O=i?t.interface.decodeEventLog(i,I.data,I.topics):[];l_(t,r,O,L=>new r8e(t,L,r,S,I))}else l_(t,r,[],S=>new tJ(t,S,r,I))};let g=[];l={tag:s,listeners:[],start:()=>{g.length||g.push(n.on(u,p))},stop:async()=>{if(g.length==0)return;let I=g;g=[],await Promise.all(I),n.off(u,p)}},c.set(s,l)}return l}let c_=Promise.resolve();async function f8e(t,e,r,n){await c_;const i=await Jm(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),Ko(t).subs.delete(i.tag)),s>0}async function l_(t,e,r,n){try{await c_}catch{}const i=f8e(t,e,r,n);return c_=i,await i}const y6=["then"];var F$;F$=R5;const Fb=class Fb{constructor(e,r,n,i){de(this,"target");de(this,"interface");de(this,"runner");de(this,"filters");de(this,F$);de(this,"fallback");pe(typeof e=="string"||dQ(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=Fi.from(r);Rt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,R5,{value:{}});let o,a=null,c=null;if(i){const u=R0(n);c=new Ck(this.interface,u,i)}let l=new Map;if(typeof e=="string")if(Wr(e))a=e,o=Promise.resolve(e);else{const u=Mp(n,"resolveName");if(!N8(u))throw zn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=u.resolveName(e).then(p=>{if(p==null)throw zn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ko(this).addr=p,p})}else o=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return Ko(this).addr=u,u});c8e(this,{addrPromise:o,addr:a,deployTx:c,subs:l});const f=new Proxy({},{get:(u,p,g)=>{if(typeof p=="symbol"||y6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return this.getEvent(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>y6.indexOf(p)>=0?Reflect.has(u,p):Reflect.has(u,p)||this.interface.hasEvent(String(p))});return Rt(this,{filters:f}),Rt(this,{fallback:s.receive||s.fallback?s8e(this):null}),new Proxy(this,{get:(u,p,g)=>{if(typeof p=="symbol"||p in u||y6.indexOf(p)>=0)return Reflect.get(u,p,g);try{return u.getFunction(p)}catch(y){if(!Ps(y,"INVALID_ARGUMENT")||y.argument!=="key")throw y}},has:(u,p)=>typeof p=="symbol"||p in u||y6.indexOf(p)>=0?Reflect.has(u,p):u.interface.hasFunction(p)})}connect(e){return new Fb(this.target,this.interface,e)}attach(e){return new Fb(e,this.interface,this.runner)}async getAddress(){return await Ko(this).addrPromise}async getDeployedCode(){const e=R0(this.runner);Le(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=R0(this.runner);return Le(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return Ko(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),o8e(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),a8e(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=Ko(this),o=i||await s,{fragment:a,topics:c}=await Ak(this,e),l={address:o,topics:c,fromBlock:r,toBlock:n},f=R0(this.runner);return Le(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(u=>{let p=a;if(p==null)try{p=this.interface.getEvent(u.topics[0])}catch{}if(p)try{return new Ek(u,this.interface,p)}catch(g){return new eJ(u,g)}return new mx(u,f)})}async on(e,r){const n=await aF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await aF(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await l_(this,e,r,null)}async listenerCount(e){if(e){const i=await Jm(this,e);return i?i.listeners.length:0}const{subs:r}=Ko(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Jm(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=Ko(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Jm(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Ko(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Jm(this,e);if(!r)return this;r.stop(),Ko(this).subs.delete(r.tag)}else{const{subs:r}=Ko(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Fb{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};let f_=Fb;function u8e(){return f_}class Nn extends u8e(){}function a9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):pe(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class d8e{constructor(e){de(this,"name");Rt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const cJ=new RegExp("^(ipfs)://(.*)$","i"),cF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),cJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ed,Y0,Cd,H1,v4,lJ;const bv=class bv{constructor(e,r,n){Ie(this,Cd);de(this,"provider");de(this,"address");de(this,"name");Ie(this,Ed);Ie(this,Y0);Rt(this,{provider:e,address:r,name:n}),ue(this,Ed,null),ue(this,Y0,new Nn(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return Q(this,Ed)==null&&ue(this,Ed,(async()=>{try{return await Q(this,Y0).supportsInterface("0x9061b923")}catch(e){if(Ps(e,"CALL_EXCEPTION"))return!1;throw ue(this,Ed,null),e}})()),await Q(this,Ed)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await $e(this,Cd,H1).call(this,"addr(bytes32)");return s==null||s===mu?null:s}catch(s){if(Ps(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await $e(this,Cd,H1).call(this,"addr(bytes32,uint)",[s]);if(Wr(o,20))return Jt(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof d8e&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await $e(this,Cd,H1).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Le(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await $e(this,Cd,H1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await $e(this,Cd,H1).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${iY("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Le(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function bx(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Le(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function h8e(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}pe(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function ry(t){return pe(Wr(t,!0),"invalid data","value",t),t}function Zi(t){return pe(Wr(t,32),"invalid hash","value",t),t}const p8e=bx({address:Jt,blockHash:Zi,blockNumber:cr,data:ry,index:cr,removed:Br(h8e,!1),topics:B8(Zi),transactionHash:Zi,transactionIndex:cr},{index:["logIndex"]});function v8e(t){return p8e(t)}const g8e=bx({hash:Br(Zi),parentHash:Zi,parentBeaconBlockRoot:Br(Zi,null),number:cr,timestamp:cr,nonce:Br(ry),difficulty:Tt,gasLimit:Tt,gasUsed:Tt,stateRoot:Br(Zi,null),receiptsRoot:Br(Zi,null),blobGasUsed:Br(Tt,null),excessBlobGas:Br(Tt,null),miner:Br(Jt),prevRandao:Br(Zi,null),extraData:ry,baseFeePerGas:Br(Tt)},{prevRandao:["mixHash"]});function y8e(t){const e=g8e(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:fJ(r)),e}const m8e=bx({transactionIndex:cr,blockNumber:cr,transactionHash:Zi,address:Jt,topics:B8(Zi),data:ry,index:cr,blockHash:Zi},{index:["logIndex"]});function b8e(t){return m8e(t)}const w8e=bx({to:Br(Jt,null),from:Br(Jt,null),contractAddress:Br(Jt,null),index:cr,root:Br(Me),gasUsed:Tt,blobGasUsed:Br(Tt,null),logsBloom:Br(ry),blockHash:Zi,hash:Zi,logs:B8(b8e),blockNumber:cr,cumulativeGasUsed:Tt,effectiveGasPrice:Br(Tt),blobGasPrice:Br(Tt,null),status:Br(cr),type:Br(cr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function x8e(t){return w8e(t)}function fJ(t){t.to&&Tt(t.to)===lF&&(t.to="0x0000000000000000000000000000000000000000");const e=bx({hash:Zi,index:Br(cr,void 0),type:r=>r==="0x"||r==null?0:cr(r),accessList:Br(Wp,null),blobVersionedHashes:Br(B8(Zi,!0),null),blockHash:Br(Zi,null),blockNumber:Br(cr,null),transactionIndex:Br(cr,null),from:Jt,gasPrice:Br(Tt),maxPriorityFeePerGas:Br(Tt),maxFeePerGas:Br(Tt),maxFeePerBlobGas:Br(Tt,null),gasLimit:Tt,to:Br(Jt,null),value:Tt,nonce:cr,data:ry,creates:Br(Jt,null),chainId:Br(Tt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=d5e(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=bu.from(t.signature):e.signature=bu.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Tt(e.blockHash)===lF&&(e.blockHash=null),e}const E8e="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class wx{constructor(e){de(this,"name");Rt(this,{name:e})}clone(){return new wx(this.name)}}class L8 extends wx{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);de(this,"effectiveBlock");de(this,"txBase");de(this,"txCreate");de(this,"txDataZero");de(this,"txDataNonzero");de(this,"txAccessListStorageKey");de(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let c=(n||{})[o];c==null&&(c=a),pe(typeof c=="number",`invalud value for ${o}`,"costs",n),i[o]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Rt(this,i)}clone(){return new L8(this.effectiveBlock,this)}}class F8 extends wx{constructor(r,n){super("org.ethers.plugins.network.Ens");de(this,"address");de(this,"targetNetwork");Rt(this,{address:r||E8e,targetNetwork:n??1})}clone(){return new F8(this.address,this.targetNetwork)}}var qw,Vw;class C8e extends wx{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ie(this,qw);Ie(this,Vw);ue(this,qw,r),ue(this,Vw,n)}get url(){return Q(this,qw)}get processFunc(){return Q(this,Vw)}clone(){return this}}qw=new WeakMap,Vw=new WeakMap;const c9=new Map;var bg,wg,Ad;const wv=class wv{constructor(e,r){Ie(this,bg);Ie(this,wg);Ie(this,Ad);ue(this,bg,e),ue(this,wg,Tt(r)),ue(this,Ad,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Q(this,bg)}set name(e){ue(this,bg,e)}get chainId(){return Q(this,wg)}set chainId(e){ue(this,wg,Tt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Tt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Tt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Tt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(Q(this,Ad).values())}attachPlugin(e){if(Q(this,Ad).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Ad).set(e.name,e.clone()),this}getPlugin(e){return Q(this,Ad).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new wv(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new L8;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function uF(t){return new C8e(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:fF(a.maxFee,9),maxPriorityFeePerGas:fF(a.maxPriorityFee,9)}}catch(s){Le(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let dF=!1;function A8e(){if(dF)return;dF=!0;function t(e,r,n){const i=function(){const s=new ia(e,r);return n.ensNetwork!=null&&s.attachPlugin(new F8(null,n.ensNetwork)),s.attachPlugin(new L8),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};ia.register(e,i),ia.register(r,i),n.altNames&&n.altNames.forEach(s=>{ia.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[uF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[uF("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function u_(t){return JSON.parse(JSON.stringify(t))}var Vf,Ba,Sd,Al,xg,c3;class S8e{constructor(e){Ie(this,xg);Ie(this,Vf);Ie(this,Ba);Ie(this,Sd);Ie(this,Al);ue(this,Vf,e),ue(this,Ba,null),ue(this,Sd,4e3),ue(this,Al,-2)}get pollingInterval(){return Q(this,Sd)}set pollingInterval(e){ue(this,Sd,e)}start(){Q(this,Ba)||(ue(this,Ba,Q(this,Vf)._setTimeout($e(this,xg,c3).bind(this),Q(this,Sd))),$e(this,xg,c3).call(this))}stop(){Q(this,Ba)&&(Q(this,Vf)._clearTimeout(Q(this,Ba)),ue(this,Ba,null))}pause(e){this.stop(),e&&ue(this,Al,-2)}resume(){this.start()}}Vf=new WeakMap,Ba=new WeakMap,Sd=new WeakMap,Al=new WeakMap,xg=new WeakSet,c3=async function(){try{const e=await Q(this,Vf).getBlockNumber();if(Q(this,Al)===-2){ue(this,Al,e);return}if(e!==Q(this,Al)){for(let r=Q(this,Al)+1;r<=e;r++){if(Q(this,Ba)==null)return;await Q(this,Vf).emit("block",r)}ue(this,Al,e)}}catch{}Q(this,Ba)!=null&&ue(this,Ba,Q(this,Vf)._setTimeout($e(this,xg,c3).bind(this),Q(this,Sd)))};var Q0,J0,_d;class Sk{constructor(e){Ie(this,Q0);Ie(this,J0);Ie(this,_d);ue(this,Q0,e),ue(this,_d,!1),ue(this,J0,r=>{this._poll(r,Q(this,Q0))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){Q(this,_d)||(ue(this,_d,!0),Q(this,J0).call(this,-2),Q(this,Q0).on("block",Q(this,J0)))}stop(){Q(this,_d)&&(ue(this,_d,!1),Q(this,Q0).off("block",Q(this,J0)))}pause(e){this.stop()}resume(){this.start()}}Q0=new WeakMap,J0=new WeakMap,_d=new WeakMap;var Eg,zf;class _8e extends Sk{constructor(r,n){super(r);Ie(this,Eg);Ie(this,zf);ue(this,Eg,n),ue(this,zf,-2)}pause(r){r&&ue(this,zf,-2),super.pause(r)}async _poll(r,n){const i=await n.getBlock(Q(this,Eg));i!=null&&(Q(this,zf)===-2?ue(this,zf,i.number):i.number>Q(this,zf)&&(n.emit(Q(this,Eg),i.number),ue(this,zf,i.number)))}}Eg=new WeakMap,zf=new WeakMap;var g4;class I8e extends Sk{constructor(r,n){super(r);Ie(this,g4);ue(this,g4,u_(n))}async _poll(r,n){throw new Error("@TODO")}}g4=new WeakMap;var Cg;class T8e extends Sk{constructor(r,n){super(r);Ie(this,Cg);ue(this,Cg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(Q(this,Cg));i&&n.emit(Q(this,Cg),i)}}Cg=new WeakMap;var Hf,Ag,Sg,Id,La,y4,uJ;class _k{constructor(e,r){Ie(this,y4);Ie(this,Hf);Ie(this,Ag);Ie(this,Sg);Ie(this,Id);Ie(this,La);ue(this,Hf,e),ue(this,Ag,u_(r)),ue(this,Sg,$e(this,y4,uJ).bind(this)),ue(this,Id,!1),ue(this,La,-2)}start(){Q(this,Id)||(ue(this,Id,!0),Q(this,La)===-2&&Q(this,Hf).getBlockNumber().then(e=>{ue(this,La,e)}),Q(this,Hf).on("block",Q(this,Sg)))}stop(){Q(this,Id)&&(ue(this,Id,!1),Q(this,Hf).off("block",Q(this,Sg)))}pause(e){this.stop(),e&&ue(this,La,-2)}resume(){this.start()}}Hf=new WeakMap,Ag=new WeakMap,Sg=new WeakMap,Id=new WeakMap,La=new WeakMap,y4=new WeakSet,uJ=async function(e){if(Q(this,La)===-2)return;const r=u_(Q(this,Ag));r.fromBlock=Q(this,La)+1,r.toBlock=e;const n=await Q(this,Hf).getLogs(r);if(n.length===0){Q(this,La){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class dJ{constructor(e){de(this,"name");Rt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function M8e(t){return JSON.parse(JSON.stringify(t))}function d_(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function l9(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(Wr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:l3("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:l3("orphan",r),filter:M8e(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?d_(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{Wr(a)?i.push(a):s.push((async()=>{i.push(await ts(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=d_(i.map(a=>a.toLowerCase()))}return{filter:n,tag:l3("event",n),type:"event"}}pe(!1,"unknown ProviderEvent","event",t)}function f9(){return new Date().getTime()}const R8e={cacheTimeout:250,pollingInterval:4e3};var Cs,Td,As,_g,Zo,Z0,Pd,Gf,zw,Fa,Ig,Tg,xr,Wo,h_,p_,Zm,v_,Xm,f3;class hJ{constructor(e,r){Ie(this,xr);Ie(this,Cs);Ie(this,Td);Ie(this,As);Ie(this,_g);Ie(this,Zo);Ie(this,Z0);Ie(this,Pd);Ie(this,Gf);Ie(this,zw);Ie(this,Fa);Ie(this,Ig);Ie(this,Tg);if(ue(this,Tg,Object.assign({},R8e,r||{})),e==="any")ue(this,Z0,!0),ue(this,Zo,null);else if(e){const n=ia.from(e);ue(this,Z0,!1),ue(this,Zo,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ue(this,Z0,!1),ue(this,Zo,null);ue(this,Gf,-1),ue(this,Pd,new Map),ue(this,Cs,new Map),ue(this,Td,new Map),ue(this,As,null),ue(this,_g,!1),ue(this,zw,1),ue(this,Fa,new Map),ue(this,Ig,!1)}get pollingInterval(){return Q(this,Tg).pollingInterval}get provider(){return this}get plugins(){return Array.from(Q(this,Td).values())}attachPlugin(e){if(Q(this,Td).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Td).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,Td).get(e)||null}get disableCcipRead(){return Q(this,Ig)}set disableCcipRead(e){ue(this,Ig,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),o.push(u)}Le(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new Z4e(y8e(e),this)}_wrapLog(e,r){return new mx(v8e(e),this)}_wrapTransactionReceipt(e,r){return new JQ(x8e(e),this)}_wrapTransactionResponse(e,r){return new Ew(fJ(e),this)}_detectNetwork(){Le(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Le(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=cr(await $e(this,xr,Wo).call(this,{method:"getBlockNumber"}),"%response");return Q(this,Gf)>=0&&ue(this,Gf,e),e}_getAddress(e){return ts(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Wr(e))return Wr(e,32)?e:Fc(e);if(typeof e=="bigint"&&(e=cr(e,"blockTag")),typeof e=="number")return e>=0?Fc(e):Q(this,Gf)>=0?Fc(Q(this,Gf)+e):this.getBlockNumber().then(r=>Fc(r+e));pe(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?d_(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,f)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||f!=null))throw new Error("invalid filter");const p={};return u&&(p.address=u),r.length&&(p.topics=r),l&&(p.fromBlock=l),f&&(p.toBlock=f),n&&(p.blockHash=n),p};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=xw(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=ts(r[i],this);m6(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);m6(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(Q(this,Zo)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw Q(this,Zo)===i&&ue(this,Zo,null),s}})();return ue(this,Zo,i),(await i).clone()}const e=Q(this,Zo),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(Q(this,Z0)?(this.emit("network",n,r),Q(this,Zo)===e&&ue(this,Zo,Promise.resolve(n))):Le(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await ui({_block:$e(this,xr,v_).call(this,"latest",!1),gasPrice:(async()=>{try{const f=await $e(this,xr,Wo).call(this,{method:"getGasPrice"});return Tt(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const f=await $e(this,xr,Wo).call(this,{method:"getPriorityFee"});return Tt(f,"%response")}catch{}return null})()});let a=null,c=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*P8e+c),new sF(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Hl(n.url),s=await n.processFunc(r,this,i);return new sF(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return m6(r)&&(r=await r),Tt(await $e(this,xr,Wo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await ui({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await $e(this,xr,p_).call(this,$e(this,xr,h_).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Tt(await $e(this,xr,Zm).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return cr(await $e(this,xr,Zm).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return Me(await $e(this,xr,Zm).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Tt(r,"position");return Me(await $e(this,xr,Zm).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await ui({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=bw.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await ui({network:this.getNetwork(),params:$e(this,xr,v_).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await ui({network:this.getNetwork(),params:$e(this,xr,Wo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await ui({network:this.getNetwork(),params:$e(this,xr,Wo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await $e(this,xr,Wo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await ui({network:this.getNetwork(),result:$e(this,xr,Wo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:Me(r)}async getLogs(e){let r=this._getFilter(e);m6(r)&&(r=await r);const{network:n,params:i}=await ui({network:this.getNetwork(),params:$e(this,xr,Wo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Le(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await O5.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Jt(e);const r=o_(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await O5.getEnsAddress(this),s=await new Nn(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===mu)return null;const a=await new Nn(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(Ps(n,"BAD_DATA")&&n.value==="0x"||Ps(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async l=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&l-f.blockNumber+1>=i){s(f),a&&(clearTimeout(a),a=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(zn("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){Le(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=Q(this,Fa).get(e);r&&(r.timer&&clearTimeout(r.timer),Q(this,Fa).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=um(this,zw)._++,i=()=>{Q(this,Fa).delete(n),e()};if(this.paused)Q(this,Fa).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);Q(this,Fa).set(n,{timer:s,func:i,time:f9()})}return n}_forEachSubscriber(e){for(const r of Q(this,Cs).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new dJ(e.type);case"block":{const r=new S8e(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new _8e(this,e.type);case"event":return new _k(this,e.filter);case"transaction":return new T8e(this,e.hash);case"orphan":return new I8e(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of Q(this,Cs).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),Q(this,As)!=null&&r.pause(Q(this,As));break}}async on(e,r){const n=await $e(this,xr,f3).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async once(e,r){const n=await $e(this,xr,f3).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,Q(this,As)!=null&&n.subscriber.pause(Q(this,As))),this}async emit(e,...r){const n=await $e(this,xr,Xm).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new sY(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await $e(this,xr,Xm).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of Q(this,Cs).values())r+=n.length;return r}async listeners(e){if(e){const n=await $e(this,xr,Xm).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of Q(this,Cs).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await $e(this,xr,Xm).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),Q(this,Cs).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await $e(this,xr,f3).call(this,e);n&&i.stop(),Q(this,Cs).delete(r)}else for(const[r,{started:n,subscriber:i}]of Q(this,Cs))n&&i.stop(),Q(this,Cs).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return Q(this,_g)}destroy(){this.removeAllListeners();for(const e of Q(this,Fa).keys())this._clearTimeout(e);ue(this,_g,!0)}get paused(){return Q(this,As)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ue(this,Gf,-1),Q(this,As)!=null){if(Q(this,As)==!!e)return;Le(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ue(this,As,!!e);for(const r of Q(this,Fa).values())r.timer&&clearTimeout(r.timer),r.time=f9()-r.time}resume(){if(Q(this,As)!=null){this._forEachSubscriber(e=>e.resume()),ue(this,As,null);for(const e of Q(this,Fa).values()){let r=e.time;r<0&&(r=0),e.time=f9(),setTimeout(e.func,r)}}}}Cs=new WeakMap,Td=new WeakMap,As=new WeakMap,_g=new WeakMap,Zo=new WeakMap,Z0=new WeakMap,Pd=new WeakMap,Gf=new WeakMap,zw=new WeakMap,Fa=new WeakMap,Ig=new WeakMap,Tg=new WeakMap,xr=new WeakSet,Wo=async function(e){const r=Q(this,Tg).cacheTimeout;if(r<0)return await this._perform(e);const n=l3(e.method,e);let i=Q(this,Pd).get(n);return i||(i=this._perform(e),Q(this,Pd).set(n,i),setTimeout(()=>{Q(this,Pd).get(n)===i&&Q(this,Pd).delete(n)},r)),await i},h_=async function(e,r,n){Le(n=0&&r==="latest"&&i.to!=null&&mn(s.data,0,4)==="0x556f1830"){const o=s.data,a=await ts(i.to,this);let c;try{c=L8e(mn(s.data,4))}catch(u){Le(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Le(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(i,c.calldata,c.urls);Le(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const f={to:a,data:Vr([c.selector,B8e([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const u=await $e(this,xr,h_).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:u}),u}}throw s}},p_=async function(e){const{value:r}=await ui({network:this.getNetwork(),value:e});return r},Zm=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await $e(this,xr,p_).call(this,$e(this,xr,Wo).call(this,Object.assign(e,{address:i,blockTag:s})))},v_=async function(e,r){if(Wr(e,32))return await $e(this,xr,Wo).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await $e(this,xr,Wo).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},Xm=async function(e,r){let n=await l9(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await l9({orphan:"drop-log",log:r[0]},this)),Q(this,Cs).get(n.tag)||null},f3=async function(e){const r=await l9(e,this),n=r.tag;let i=Q(this,Cs).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},Q(this,Cs).set(n,i)),i};function O8e(t,e){try{const r=g_(t,e);if(r)return Ip(r)}catch{}return null}function g_(t,e){if(t==="0x")return null;try{const r=cr(mn(t,e,e+32)),n=cr(mn(t,r,r+32));return mn(t,r+32,r+32+n)}catch{}return null}function hF(t){const e=es(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function D8e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const N8e=new Uint8Array([]);function B8e(t){const e=[];let r=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=mn(t,0,32);Le(mn(r,0,12)===mn(pF,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=mn(r,12);try{const n=[],i=cr(mn(t,32,64)),s=cr(mn(t,i,i+32)),o=mn(t,i+32);for(let a=0;ae[n]),e}function N1(t,e){if(t.provider)return t.provider;Le(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function vF(t,e){let r=xw(e);if(r.to!=null&&(r.to=ts(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),ts(n,t)]).then(([i,s])=>(pe(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await ui(r)}class j8{constructor(e){de(this,"provider");Rt(this,{provider:e||null})}async getNonce(e){return N1(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await vF(this,e)}async populateTransaction(e){const r=N1(this,"populateTransaction"),n=await vF(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Tt(n.chainId);pe(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?pe(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&pe(!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){const o=await r.getFeeData();Le(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Le(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Le(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ui(n)}async estimateGas(e){return N1(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return N1(this,"call").call(await this.populateCall(e))}async resolveName(e){return await N1(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=N1(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=bw.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var Pg,u3;const ZM=class ZM extends j8{constructor(r,n){super(n);Ie(this,Pg);de(this,"address");Rt(this,{address:r})}async getAddress(){return this.address}connect(r){return new ZM(this.address,r)}async signTransaction(r){$e(this,Pg,u3).call(this,"transactions","signTransaction")}async signMessage(r){$e(this,Pg,u3).call(this,"messages","signMessage")}async signTypedData(r,n,i){$e(this,Pg,u3).call(this,"typed-data","signTypedData")}};Pg=new WeakSet,u3=function(r,n){Le(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let y_=ZM;function F8e(t){return JSON.parse(JSON.stringify(t))}var Qs,Sl,X0,kd,ep,kg,gh,m_,b_;class pJ{constructor(e){Ie(this,gh);Ie(this,Qs);Ie(this,Sl);Ie(this,X0);Ie(this,kd);Ie(this,ep);Ie(this,kg);ue(this,Qs,e),ue(this,Sl,null),ue(this,X0,$e(this,gh,m_).bind(this)),ue(this,kd,!1),ue(this,ep,null),ue(this,kg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){Q(this,kd)||(ue(this,kd,!0),$e(this,gh,m_).call(this,-2))}stop(){Q(this,kd)&&(ue(this,kd,!1),ue(this,kg,!0),$e(this,gh,b_).call(this),Q(this,Qs).off("block",Q(this,X0)))}pause(e){e&&$e(this,gh,b_).call(this),Q(this,Qs).off("block",Q(this,X0))}resume(){this.start()}}Qs=new WeakMap,Sl=new WeakMap,X0=new WeakMap,kd=new WeakMap,ep=new WeakMap,kg=new WeakMap,gh=new WeakSet,m_=async function(e){try{Q(this,Sl)==null&&ue(this,Sl,this._subscribe(Q(this,Qs)));let r=null;try{r=await Q(this,Sl)}catch(s){if(!Ps(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){ue(this,Sl,null),Q(this,Qs)._recoverSubscriber(this,this._recover(Q(this,Qs)));return}const n=await Q(this,Qs).getNetwork();if(Q(this,ep)||ue(this,ep,n),Q(this,ep).chainId!==n.chainId)throw new Error("chaid changed");if(Q(this,kg))return;const i=await Q(this,Qs).send("eth_getFilterChanges",[r]);await this._emitResults(Q(this,Qs),i)}catch(r){console.log("@TODO",r)}Q(this,Qs).once("block",Q(this,X0))},b_=function(){const e=Q(this,Sl);e&&(ue(this,Sl,null),e.then(r=>{Q(this,Qs).destroyed||Q(this,Qs).send("eth_uninstallFilter",[r])}))};var tp;class j8e extends pJ{constructor(r,n){super(r);Ie(this,tp);ue(this,tp,F8e(n))}_recover(r){return new _k(r,Q(this,tp))}async _subscribe(r){return await r.send("eth_newFilter",[Q(this,tp)])}async _emitResults(r,n){for(const i of n)r.emit(Q(this,tp),r._wrapLog(i,r._network))}}tp=new WeakMap;class U8e extends pJ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const $8e="bigint,boolean,function,number,string,symbol".split(/,/g);function d3(t){if(t==null||$8e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(d3);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function q8e(t){return new Promise(e=>{setTimeout(e,t)})}function B1(t){return t&&t.toLowerCase()}function gF(t){return t&&typeof t.pollingInterval=="number"}const vJ={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class u9 extends j8{constructor(r,n){super(r);de(this,"address");n=Jt(n),Rt(this,{address:n})}connect(r){Le(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=d3(r),i=[];if(n.from){const o=n.from;i.push((async()=>{const a=await ts(o,this.provider);pe(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const o=n.to;i.push((async()=>{n.to=await ts(o,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,o)=>{const a=[1e3,100];let c=0;const l=async()=>{try{const f=await this.provider.getTransaction(i);if(f!=null){s(f.replaceableTransaction(n));return}}catch(f){if(Ps(f,"CANCELLED")||Ps(f,"BAD_DATA")||Ps(f,"NETWORK_ERROR")){f.info==null&&(f.info={}),f.info.sendTransactionHash=i,o(f);return}if(Ps(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=i,c>10)){o(f);return}this.provider.emit("error",zn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(r){const n=d3(r);if(n.from){const s=await ts(n.from,this.provider);pe(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Ai(r):r;return await this.provider.send("personal_sign",[Me(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=d3(i),o=await lh.resolveNames(r,n,s,async a=>{const c=await ts(a);return pe(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(lh.getPayload(o.domain,n,o.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Ai(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Me(n)])}}var rp,Mg,Wf,_l,Oc,ja,Ao,Hw,w_;class V8e extends hJ{constructor(r,n){super(r,n);Ie(this,Hw);Ie(this,rp);Ie(this,Mg);Ie(this,Wf);Ie(this,_l);Ie(this,Oc);Ie(this,ja);Ie(this,Ao);ue(this,Mg,1),ue(this,rp,Object.assign({},vJ,n||{})),ue(this,Wf,[]),ue(this,_l,null),ue(this,ja,null),ue(this,Ao,null);{let s=null;const o=new Promise(a=>{s=a});ue(this,Oc,{promise:o,resolve:s})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(pe(!i||r!=="any","staticNetwork cannot be used on special network 'any'","options",n),i&&r!=null&&ue(this,ja,ia.from(r))):i&&(pe(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),ue(this,ja,i))}_getOption(r){return Q(this,rp)[r]}get _network(){return Le(Q(this,ja),"network is not available yet","NETWORK_ERROR"),Q(this,ja)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&Tt(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)if(r===!0){if(Q(this,ja))return Q(this,ja)}else return r;return Q(this,Ao)?await Q(this,Ao):this.ready?(ue(this,Ao,(async()=>{try{const n=ia.from(Tt(await this.send("eth_chainId",[])));return ue(this,Ao,null),n}catch(n){throw ue(this,Ao,null),n}})()),await Q(this,Ao)):(ue(this,Ao,(async()=>{const n={id:um(this,Mg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0],ue(this,Ao,null)}catch(s){throw ue(this,Ao,null),this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ia.from(Tt(i.result));throw this.getRpcError(n,i)})()),await Q(this,Ao))}_start(){Q(this,Oc)==null||Q(this,Oc).resolve==null||(Q(this,Oc).resolve(),ue(this,Oc,null),(async()=>{for(;Q(this,ja)==null&&!this.destroyed;)try{ue(this,ja,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",zn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await q8e(1e3)}$e(this,Hw,w_).call(this)})())}async _waitUntilReady(){if(Q(this,Oc)!=null)return await Q(this,Oc).promise}_getSubscriber(r){return r.type==="pending"?new U8e(this):r.type==="event"?this._getOption("polling")?new _k(this,r.filter):new j8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new dJ("orphan"):super._getSubscriber(r)}get ready(){return Q(this,Oc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=Fc(Tt(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=Me(r[i]))}),r.accessList&&(n.accessList=Wp(r.accessList)),r.blobVersionedHashes&&(n.blobVersionedHashes=r.blobVersionedHashes.map(i=>i.toLowerCase())),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[B1(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[B1(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[B1(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[B1(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(B1):r.filter.address=B1(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return zn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=x_(s),l=Ls.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return l.info={error:s,payload:r},l}const o=JSON.stringify(H8e(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return zn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return zn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return zn("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return zn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(o.match(/only replay-protected/i))return zn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let a=!!o.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?zn("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):zn("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=um(this,Mg)._++,s=new Promise((o,a)=>{Q(this,Wf).push({resolve:o,reject:a,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return $e(this,Hw,w_).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new u9(this,s[r])}const{accounts:i}=await ui({network:this.getNetwork(),accounts:n});r=Jt(r);for(const s of i)if(Jt(s)===r)return new u9(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new u9(this,n))}destroy(){Q(this,_l)&&(clearTimeout(Q(this,_l)),ue(this,_l,null));for(const{payload:r,reject:n}of Q(this,Wf))n(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));ue(this,Wf,[]),super.destroy()}}rp=new WeakMap,Mg=new WeakMap,Wf=new WeakMap,_l=new WeakMap,Oc=new WeakMap,ja=new WeakMap,Ao=new WeakMap,Hw=new WeakSet,w_=function(){if(Q(this,_l))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");ue(this,_l,setTimeout(()=>{ue(this,_l,null);const n=Q(this,Wf);for(ue(this,Wf,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==Q(this,rp).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(o=>o.payload)).length>Q(this,rp).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const o=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:c,payload:l}of i){if(this.destroyed){c(zn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const f=o.filter(u=>u.id===l.id)[0];if(f==null){const u=zn("missing response for request","BAD_DATA",{value:o,info:{payload:l}});this.emit("error",u),c(u);continue}if("error"in f){c(this.getRpcError(l,f));continue}a(f.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of i)a(o)}})()}},r))};var Md;class z8e extends V8e{constructor(r,n){super(r,n);Ie(this,Md);let i=this._getOption("pollingInterval");i==null&&(i=vJ.pollingInterval),ue(this,Md,i)}_getSubscriber(r){const n=super._getSubscriber(r);return gF(n)&&(n.pollingInterval=Q(this,Md)),n}get pollingInterval(){return Q(this,Md)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");ue(this,Md,r),this._forEachSubscriber(n=>{gF(n)&&(n.pollingInterval=Q(this,Md))})}}Md=new WeakMap;var Rg,j$;let Ty=(j$=class extends z8e{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);Ie(this,Rg);typeof r=="string"?ue(this,Rg,new Hl(r)):ue(this,Rg,r.clone())}_getConnection(){return Q(this,Rg).clone()}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){const n=this._getConnection();n.body=JSON.stringify(r),n.setHeader("content-type","application/json");const i=await n.send();i.assertOk();let s=i.bodyJson;return Array.isArray(s)||(s=[s]),s}},Rg=new WeakMap,j$);function x_(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&Wr(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=x_(t[e]);if(r)return r}return null}if(typeof t=="string")try{return x_(JSON.parse(t))}catch{}return null}function E_(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)E_(t[r],e);if(typeof t=="string")try{return E_(JSON.parse(t),e)}catch{}}}function H8e(t){const e=[];return E_(t,e),e}var Og;const XM=class XM extends j8{constructor(r,n){super(n);de(this,"address");Ie(this,Og);pe(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),ue(this,Og,r);const i=gx(this.signingKey.publicKey);Rt(this,{address:i})}get signingKey(){return Q(this,Og)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new XM(Q(this,Og),r)}async signTransaction(r){r=xw(r);const{to:n,from:i}=await ui({to:r.to?ts(r.to,this.provider):void 0,from:r.from?ts(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(pe(Jt(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const s=bw.from(r);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(xk(r)).serialized}async signTypedData(r,n,i){const s=await lh.resolveNames(r,n,i,async o=>{Le(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const a=await this.provider.resolveName(o);return Le(a!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),a});return this.signingKey.sign(lh.hash(s.domain,n,s.value)).serialized}};Og=new WeakMap;let D5=XM;const N5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",G8e=/^[a-z]*$/i;function yF(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(G8e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function W8e(t,e){for(let i=N5.length-1;i>=0;i--)t=t.split(N5[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return yF(yF(r,";"),":")}function K8e(t){return pe(t[0]==="0","unsupported auwl data","data",t),W8e(t.substring(1+2*N5.length),t.substring(1,1+2*N5.length))}class Y8e{constructor(e){de(this,"locale");Rt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Dg,Gw,np,Ww,C_;class Q8e extends Y8e{constructor(r,n,i){super(r);Ie(this,Ww);Ie(this,Dg);Ie(this,Gw);Ie(this,np);ue(this,Dg,n),ue(this,Gw,i),ue(this,np,null)}get _data(){return Q(this,Dg)}_decodeWords(){return K8e(Q(this,Dg))}getWord(r){const n=$e(this,Ww,C_).call(this);return pe(r>=0&&r=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let l=0;l=0,`invalid mnemonic word at index ${l}`,"mnemonic","[ REDACTED ]");for(let u=0;u<11;u++)f&1<<10-u&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=bJ(o),c=Ue(sc(n.slice(0,s/8)))[0]&a;return ve(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Me(n.slice(0,s/8))}function y9(t,e){ve(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Rp.wordlist());const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&X8e(8-n)),n+=3);const i=t.length/4,s=parseInt(sc(t).substring(2,4),16)&bJ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const m9={};class ry{constructor(e,r,n,i,s){de(this,"phrase");de(this,"password");de(this,"wordlist");de(this,"entropy");i==null&&(i=""),s==null&&(s=Rp.wordlist()),kh(e,m9,"Mnemonic"),Ot(this,{phrase:n,password:i,wordlist:s,entropy:r})}computeSeed(){const e=Ii("mnemonic"+this.password,"NFKD");return Mh(Ii(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=g9(e,n);return e=y9(Ue(i),n),new ry(m9,i,e,r,n)}static fromEntropy(e,r,n){const i=Ue(e,"entropy"),s=y9(i,n);return new ry(m9,Me(i),s,r,n)}static entropyToPhrase(e,r){const n=Ue(e,"entropy");return y9(n,r)}static phraseToEntropy(e,r){return g9(e,r)}static isValidMnemonic(e,r){try{return g9(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */var Ki=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},b9=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},m3,Ba,gl;const eEe={16:10,24:12,32:14},tEe=[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],Oa=[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],A6=[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],rEe=[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],nEe=[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],iEe=[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],sEe=[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],oEe=[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],aEe=[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],cEe=[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],lEe=[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],fEe=[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],uEe=[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],dEe=[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],hEe=[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 w9(t){const e=[];for(let r=0;r>2,Ki(this,gl,"f")[o][f%4]=s[f],Ki(this,Ba,"f")[r-o][f%4]=s[f];let a=0,c=i,l;for(;c>16&255]<<24^Oa[l>>8&255]<<16^Oa[l&255]<<8^Oa[l>>24&255]^tEe[a]<<24,a+=1,i!=8)for(let g=1;g>8&255]<<8^Oa[l>>16&255]<<16^Oa[l>>24&255]<<24;for(let g=i/2+1;g>2,p=c%4,Ki(this,gl,"f")[u][p]=s[f],Ki(this,Ba,"f")[r-u][p]=s[f++],c++}for(let f=1;f>24&255]^uEe[l>>16&255]^dEe[l>>8&255]^hEe[l&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Ki(this,gl,"f").length-1,n=[0,0,0,0];let i=w9(e);for(let a=0;a<4;a++)i[a]^=Ki(this,gl,"f")[0][a];for(let a=1;a>24&255]^nEe[i[(c+1)%4]>>16&255]^iEe[i[(c+2)%4]>>8&255]^sEe[i[(c+3)%4]&255]^Ki(this,gl,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Ki(this,gl,"f")[r][a],s[4*a]=(Oa[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(Oa[i[(a+1)%4]>>16&255]^o>>16)&255,s[4*a+2]=(Oa[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(Oa[i[(a+3)%4]&255]^o)&255;return s}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Ki(this,Ba,"f").length-1,n=[0,0,0,0];let i=w9(e);for(let a=0;a<4;a++)i[a]^=Ki(this,Ba,"f")[0][a];for(let a=1;a>24&255]^aEe[i[(c+3)%4]>>16&255]^cEe[i[(c+2)%4]>>8&255]^lEe[i[(c+1)%4]&255]^Ki(this,Ba,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Ki(this,Ba,"f")[r][a],s[4*a]=(A6[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(A6[i[(a+3)%4]>>16&255]^o>>16)&255,s[4*a+2]=(A6[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(A6[i[(a+1)%4]&255]^o)&255;return s}}m3=new WeakMap,Ba=new WeakMap,gl=new WeakMap;class wJ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new kk(r)},name:{enumerable:!0,value:e}})}}var S6=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},B1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tb,_f;class Mk extends wJ{constructor(e,r){if(super("ECC",e,Mk),tb.set(this,void 0),_f.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");S6(this,tb,new Uint8Array(r),"f")}else S6(this,tb,new Uint8Array(16),"f");S6(this,_f,this.iv,"f")}get iv(){return new Uint8Array(B1(this,tb,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)Da(this,La,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Da(this,La,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Da(this,La,"f")[e]===255)Da(this,La,"f")[e]=0;else{Da(this,La,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let s=0;s16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),ve(i>0&&s>0,"invalid kdf","kdf",e);const o=ni(t,"crypto.kdfparams.dklen:int!");return ve(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=ni(t,"crypto.kdfparams.salt:data!"),n=ni(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();ve(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const s=ni(t,"crypto.kdfparams.c:int!"),o=ni(t,"crypto.kdfparams.dklen:int!");return ve(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:r,count:s,dkLen:o,algorithm:i}}}ve(!1,"unsupported key-derivation function","kdf",e)}function gEe(t,e){const r=JSON.parse(t),n=Ex(e),i=CJ(r);if(i.name==="pbkdf2"){const{salt:u,count:p,dkLen:g,algorithm:y}=i,b=Mh(n,u,p,g,y);return $5(r,b)}Le(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:s,N:o,r:a,p:c,dkLen:l}=i,f=_y(n,s,o,a,c,l);return $5(r,f)}function EF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function yEe(t,e,r){const n=JSON.parse(t),i=Ex(e),s=CJ(n);if(s.name==="pbkdf2"){r&&(r(0),await EF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=Mh(i,p,g,y,b);return r&&(r(1),await EF(0)),$5(n,I)}Le(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:a,r:c,p:l,dkLen:f}=s,u=await Sy(i,o,a,c,l,f,r);return $5(n,u)}function AJ(t){const e=t.salt!=null?Ue(t.salt,"options.salt"):da(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),ve(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),ve(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),ve(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function SJ(t,e,r,n){const i=Ue(r.privateKey,"privateKey"),s=n.iv!=null?Ue(n.iv,"options.iv"):da(16);ve(s.length===16,"invalid options.iv length","options.iv",n.iv);const o=n.uuid!=null?Ue(n.uuid,"options.uuid"):da(16);ve(o.length===16,"invalid options.uuid length","options.uuid",n.iv);const a=t.slice(0,16),c=t.slice(16,32),l=new ny(a,s),f=Ue(l.encrypt(i)),u=gr(qr([c,f])),p={address:r.address.substring(2).toLowerCase(),id:C6e(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Me(s).substring(2)},ciphertext:Me(f).substring(2),kdf:"scrypt",kdfparams:{salt:Me(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:u.substring(2)}};if(r.mnemonic){const g=n.client!=null?n.client:`ethers/${tY}`,y=r.mnemonic.path||EJ,b=r.mnemonic.locale||"en",I=t.slice(32,64),C=Ue(r.mnemonic.entropy,"account.mnemonic.entropy"),S=da(16),O=new ny(I,S),L=Ue(O.encrypt(C)),F=new Date,_="UTC--"+(F.getUTCFullYear()+"-"+Tm(F.getUTCMonth()+1,2)+"-"+Tm(F.getUTCDate(),2)+"T"+Tm(F.getUTCHours(),2)+"-"+Tm(F.getUTCMinutes(),2)+"-"+Tm(F.getUTCSeconds(),2)+".0Z")+"--"+p.address;p["x-ethers"]={client:g,gethFilename:_,path:y,locale:b,mnemonicCounter:Me(S).substring(2),mnemonicCiphertext:Me(L).substring(2),version:"0.1"}}return JSON.stringify(p)}function _J(t,e,r){r==null&&(r={});const n=Ex(e),i=AJ(r),s=_y(n,i.salt,i.N,i.r,i.p,64);return SJ(Ue(s),i,t,r)}async function IJ(t,e,r){r==null&&(r={});const n=Ex(e),i=AJ(r),s=await Sy(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return SJ(Ue(s),i,t,r)}const x9="m/44'/60'/0'/0/0",mEe=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Zd=2147483648,bEe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),wEe="0123456789abcdef";function q5(t,e){let r="";for(;t;)r=wEe[t%16]+r,t=Math.trunc(t/16);for(;r.length=0;o-=8)i[33+(o>>3)]=t>>24-o&255;const s=Ue(Cy("sha512",e,i));return{IL:s.slice(0,32),IR:s.slice(32)}}function PJ(t,e){const r=e.split("/");ve(r.length>0,"invalid path","path",e),r[0]==="m"&&(ve(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),r.shift());let n=t;for(let i=0;i=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=Ue(Cy("sha512",mEe,i)),o=new Jd(Me(s.slice(0,32)));return new Mc(Cl,o,"0x00000000",Me(s.slice(32)),"m",0,0,n,null)},Ie(Mc,ip);let Sb=Mc;class Aw extends w_{constructor(r,n,i,s,o,a,c,l,f){super(n,f);de(this,"publicKey");de(this,"fingerprint");de(this,"parentFingerprint");de(this,"chainCode");de(this,"path");de(this,"index");de(this,"depth");kh(r,Cl,"HDNodeVoidWallet"),Ot(this,{publicKey:i});const u=mn(Ay(sc(i)),0,4);Ot(this,{publicKey:i,fingerprint:u,parentFingerprint:s,chainCode:o,path:a,index:c,depth:l})}connect(r){return new Aw(Cl,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return Le(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),I_(qr(["0x0488B21E",q5(this.depth,1),this.parentFingerprint,q5(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=or(r,"index");ve(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Zd),n&Zd&&(i+="'"));const{IR:s,IL:o}=TJ(n,this.chainCode,this.publicKey,null),a=Jd.addPoints(o,this.publicKey,!0),c=yx(a);return new Aw(Cl,c,a,this.fingerprint,Me(s),i,n,this.depth+1,this.provider)}derivePath(r){return PJ(this,r)}}function CF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function AF(t,e){const r=JSON.parse(t),n=Ex(e),i=Qt(ni(r,"ethaddr:string!")),s=xJ(ni(r,"encseed:string!"));ve(s&&s.length%16===0,"invalid encseed","json",t);const o=Ue(Mh(n,n,2e3,32,"sha256")).slice(0,16),a=s.slice(0,16),c=s.slice(16),l=new Mk(o,a),f=pEe(Ue(l.decrypt(c)));let u="";for(let p=0;p{setTimeout(()=>{e()},t)})}var Qw,jl,P_;let V5=(jl=class extends j5{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Jd(e):e;super(n,r)}connect(e){return new jl(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await IJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return _J(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return xF(e)?i=await yEe(e,r,n):CF(e)&&(n&&(n(0),await SF(0)),i=AF(e,r),n&&(n(1),await SF(0))),qe(s=jl,Qw,P_).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return xF(e)?n=gEe(e,r):CF(e)?n=AF(e,r):ve(!1,"invalid JSON wallet","json","[ REDACTED ]"),qe(i=jl,Qw,P_).call(i,n)}static createRandom(e){const r=Sb.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=Sb.fromPhrase(e);return r?n.connect(r):n}},Qw=new WeakSet,P_=function(e){if(ve(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=ry.fromEntropy(e.mnemonic.entropy),i=Sb.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new jl(e.privateKey);return ve(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Ie(jl,Qw),jl);const kJ="3.7.7",xEe=kJ,Ty=typeof Buffer=="function",_F=typeof TextDecoder=="function"?new TextDecoder:void 0,IF=typeof TextEncoder=="function"?new TextEncoder:void 0,EEe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ib=Array.prototype.slice.call(EEe),_6=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ib),CEe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Zi=String.fromCharCode.bind(String),TF=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),MJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),RJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),OJ=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=ib[e>>18&63]+ib[e>>12&63]+ib[e>>6&63]+ib[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},Rk=typeof btoa=="function"?t=>btoa(t):Ty?t=>Buffer.from(t,"binary").toString("base64"):OJ,k_=Ty?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?MJ(k_(t)):k_(t),AEe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Zi(192|e>>>6)+Zi(128|e&63):Zi(224|e>>>12&15)+Zi(128|e>>>6&63)+Zi(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Zi(240|e>>>18&7)+Zi(128|e>>>12&63)+Zi(128|e>>>6&63)+Zi(128|e&63)}},SEe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,DJ=t=>t.replace(SEe,AEe),PF=Ty?t=>Buffer.from(t,"utf8").toString("base64"):IF?t=>k_(IF.encode(t)):t=>Rk(DJ(t)),Dv=(t,e=!1)=>e?MJ(PF(t)):PF(t),kF=t=>Dv(t,!0),_Ee=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,IEe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Zi((r>>>10)+55296)+Zi((r&1023)+56320);case 3:return Zi((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Zi((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},NJ=t=>t.replace(_Ee,IEe),BJ=t=>{if(t=t.replace(/\s+/g,""),!CEe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Zi(e>>16&255,e>>8&255):Zi(e>>16&255,e>>8&255,e&255);return r},Ok=typeof atob=="function"?t=>atob(RJ(t)):Ty?t=>Buffer.from(t,"base64").toString("binary"):BJ,LJ=Ty?t=>TF(Buffer.from(t,"base64")):t=>TF(Ok(t).split("").map(e=>e.charCodeAt(0))),FJ=t=>LJ(jJ(t)),TEe=Ty?t=>Buffer.from(t,"base64").toString("utf8"):_F?t=>_F.decode(LJ(t)):t=>NJ(Ok(t)),jJ=t=>RJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),M_=t=>TEe(jJ(t)),PEe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},UJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),$J=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,UJ(r));t("fromBase64",function(){return M_(this)}),t("toBase64",function(e){return Dv(this,e)}),t("toBase64URI",function(){return Dv(this,!0)}),t("toBase64URL",function(){return Dv(this,!0)}),t("toUint8Array",function(){return FJ(this)})},qJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,UJ(r));t("toBase64",function(e){return b3(this,e)}),t("toBase64URI",function(){return b3(this,!0)}),t("toBase64URL",function(){return b3(this,!0)})},kEe=()=>{$J(),qJ()},MF={version:kJ,VERSION:xEe,atob:Ok,atobPolyfill:BJ,btoa:Rk,btoaPolyfill:OJ,fromBase64:M_,toBase64:Dv,encode:Dv,encodeURI:kF,encodeURL:kF,utob:DJ,btou:NJ,decode:M_,isValid:PEe,fromUint8Array:b3,toUint8Array:FJ,extendString:$J,extendUint8Array:qJ,extendBuiltins:kEe},MEe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),REe=t=>t!=null&&(typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Gr(t)||typeof t=="bigint"),Nv=t=>{const e=t.toString(16);return`${e.length%2===0?"0x":"0x0"}${e}`},sb=(t,e)=>typeof e=="bigint"?{$bigint:e.toString()}:e,OEe=t=>Ue(typeof t=="string"?Oo(t):gr(t)),DEe=(t,e,r)=>Cr(["string","uint256","address","bytes32"],["",e,t,r]),RF=(t,e,r)=>gr(DEe(t,e,r));function z5(){return z5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const n=new Jl(t);return r&&n.setHeader("Authorization",`BEARER ${r}`),e&&n.setHeader("X-Access-Key",e),n},BEe=t=>{const e=z5({},t.types);return delete e.EIP712Domain,uh.hash(t.domain,e,t.message)},Dk=t=>Ue(BEe(t));function ns(){return ns=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Bk(i))return Cr(["uint8","uint8","address"],[pp.Address,i.weight,i.address]);if(i.isDynamic){const s=Ue(i.signature);return Cr(["uint8","uint8","address","uint16","bytes"],[pp.DynamicSignature,i.weight,i.address,s.length,s])}return Cr(["uint8","uint8","bytes"],[pp.EOASignature,i.weight,i.signature])});return Cr(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function YJ(t,e,r){const n=Cx(e),i=await Promise.all(t.signers.map(async s=>{if(Bk(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Nk(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:Ax(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function _b(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=0n;const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=Ue(c.signature);return i+=BigInt(a.weight),c.isDynamic||l.length!==66?ns({},a,{isDynamic:!0,signature:c.signature,address:a.address}):ns({},a,{isDynamic:!1,signature:c.signature})});return{encoded:Lk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Fk={decode:t=>KJ(t),encode:t=>Lk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>YJ(t,e,r),encodeSigners:(t,e,r,n)=>_b(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Fk.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var zEe=Object.freeze({__proto__:null,SignaturePartType:pp,isAddressMember:Bk,isUnrecoveredSignatureMember:GJ,isUnrecoveredSignature:WJ,decodeSignature:KJ,encodeSignature:Lk,recoverSignature:YJ,encodeSigners:_b,SignatureCoder:Fk});const jk={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>gr(Ns.defaultAbiCoder().encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Cr(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>0n,signersOf:t=>t.signers.map(e=>({address:e.address,weight:Number(e.weight)})),fromSimple:t=>{if(BigInt(t.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new $i([...Ps.mainModule.abi,...Ps.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[jk.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:BigInt(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:BigInt(n.weight),address:n.address}));return{version:e.version,threshold:BigInt(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&BigInt(e.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=_b(t,r,[]);if(a>=BigInt(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>Number(s)-Number(o))){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=_b(t,r,[]);if(a>=BigInt(t.threshold))return o}return _b(t,r,[]).encoded}};var HEe=Object.freeze({__proto__:null,ConfigCoder:jk}),GEe=Object.freeze({__proto__:null});const QJ=1,JJ={version:QJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var w0=Object.freeze({__proto__:null,config:HEe,context:GEe,signature:zEe,version:QJ,DeployedWalletContext:JJ});const Uk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function ZJ(t){return gr(XJ(t))}function XJ(t){return Cr(["bytes32","bytes32"],[Uk,t])}function eZ(t){const e=Ue(t);if(e.length===64&&Me(e.slice(0,32))===Uk)return Me(e.slice(32,64))}function WEe(t){return eZ(t)!==void 0}var KEe=Object.freeze({__proto__:null,SetImageHashPrefix:Uk,hashSetImageHash:ZJ,messageSetImageHash:XJ,decodeMessageSetImageHash:eZ,isMessageSetImageHash:WEe});let Ni=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),Gn=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const H5=66;function Op(t){return t.left!==void 0&&t.right!==void 0}function Py(t){return t.tree!==void 0}function Sx(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function G5(t){let e=Ue(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case Gn.Signature:{const s=e[0],o=Me(e.slice(1,H5+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(H5+1)}break;case Gn.Address:{const s=e[0],o=Qt(Me(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case Gn.DynamicSignature:{const s=e[0],o=Qt(Me(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=Me(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case Gn.Node:{const s=Me(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case Gn.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=G5(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case Gn.Subdigest:{const s=Me(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case Gn.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=G5(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${Me(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class tZ extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function vp(t,e,r){if(Op(t)){const[n,i]=await Promise.all([vp(t.left,e,r),vp(t.right,e,r)]);return{left:n,right:i}}if(Py(t))return{weight:t.weight,threshold:t.threshold,tree:await vp(t.tree,e,r)};if(Sx(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await Nk(t.address,e,t.signature,r))throw new tZ(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:Ax(e,t.signature),signature:t.signature,subdigest:e};return t}const bs={concat:(t,e)=>Cr(["bytes","bytes"],[t,e]),node:t=>Cr(["uint8","bytes32"],[Gn.Node,t]),branch:t=>{const e=Ue(t);return Cr(["uint8","uint24","bytes"],[Gn.Branch,e.length,e])},nested:(t,e,r)=>{const n=Ue(r);return Cr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t,e,n.length,n])},subdigest:t=>Cr(["uint8","bytes32"],[Gn.Subdigest,t]),signature:(t,e)=>Cr(["uint8","uint8","bytes"],[Gn.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=Ue(r);return Cr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Cr(["uint8","uint8","address"],[Gn.Address,t,e])};function Ib(t,e,r,n,i={}){const s=Tb(t.tree,e,r,i);return BigInt(n)===0n?{encoded:Cr(["uint8","uint16","uint32","bytes"],[Ni.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:BigInt(t.threshold)>255n?{encoded:Cr(["uint8","uint16","uint32","bytes"],[Ni.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Cr(["uint8","uint8","uint32","bytes"],[Ni.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Tb(t,e,r,n={}){const i=!n.disableTrim;if(Zc(t)){const s=Tb(t.left,e,r),o=Tb(t.right,e,r),a=Xs(t.left),c=Xs(t.right);return i&&s.weight===0n&&o.weight===0n&&!a&&!c?{encoded:bs.node(Qa(t)),weight:0n}:i&&o.weight===0n&&!c?{encoded:bs.concat(s.encoded,bs.node(Qa(t.right))),weight:s.weight}:i&&s.weight===0n&&!a?{encoded:bs.concat(bs.node(Qa(t.left)),bs.branch(o.encoded)),weight:o.weight}:{encoded:bs.concat(s.encoded,bs.branch(o.encoded)),weight:s.weight+o.weight}}if(Mu(t)){const s=Tb(t.tree,e,r);return i&&s.weight===0n?{encoded:bs.node(Qa(t)),weight:0n}:{encoded:bs.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Ru(t))return{encoded:bs.node(Qa(t)),weight:0n};if(ku(t)){const s=r.includes(t.subdigest);return{encoded:bs.subdigest(t.subdigest),weight:s?MEe:0n}}if(Xs(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:bs.dynamicSignature(t.weight,t.address,a),weight:BigInt(t.weight)}:{encoded:bs.signature(t.weight,a),weight:BigInt(t.weight)}}else return{encoded:bs.address(t.weight,t.address),weight:0n};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function $k(t){return Vk(t)?$k(t.suffix[t.suffix.length-1]):t.config}function qk(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function _x(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(qk)}function rZ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function Vk(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(rZ)}function H8(t){const e=Ue(t),r=e[0];switch(r){case Ni.Legacy:return{version:2,type:Ni.Legacy,decoded:w3(e)};case Ni.Dynamic:return{version:2,type:Ni.Dynamic,decoded:w3(e.slice(1))};case Ni.NoChainIdDynamic:return{version:2,type:Ni.NoChainIdDynamic,decoded:w3(e.slice(1))};case Ni.Chained:return nZ(e);default:throw new Error(`Invalid signature type: ${r}`)}}function w3(t){const e=Ue(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=G5(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function nZ(t){const e=Ue(t),r=e[0];if(r!==Ni.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;iUe(eh(s))),i=Cr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Cr(["uint8","bytes"],[Ni.Chained,i])}function eh(t){if(mu(t))return Me(t);if(_x(t)||Vk(t))return G8(eh(t),(t.suffix||[]).map(eh));const e=qk(t)?t.decoded:t.config;switch(t.type){case Ni.Legacy:if(BigInt(e.threshold)>255n)throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return R_(e);case Ni.NoChainIdDynamic:case Ni.Dynamic:return Cr(["uint8","bytes"],[t.type,R_(e)]);case Ni.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function R_(t){return Cr(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,Pb(t.tree)])}function Pb(t){if(Zc(t)||Op(t)){const e=Ue(Pb(t.right)),r=Ue(Pb(t.left));return Zc(t.right)||Op(t.right)?Cr(["bytes","uint8","uint24","bytes"],[r,Gn.Branch,e.length,e]):Cr(["bytes","bytes"],[r,e])}if(Mu(t)||Py(t)){const e=Ue(Pb(t.tree));return Cr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t.weight,t.threshold,e.length,e])}if(Sx(t)||Xs(t)&&t.signature!==void 0){const e=Ue(t.signature);if(t.isDynamic||e.length!==H5){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Cr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t.weight,t.address,e.length,e])}else return Cr(["uint8","uint8","bytes"],[Gn.Signature,t.weight,e])}if(Xs(t))return Cr(["uint8","uint8","address"],[Gn.Address,t.weight,t.address]);if(Ru(t))return Cr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(ku(t))return Cr(["uint8","bytes32"],[Gn.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function kb(t){return Zc(t)?[...kb(t.left),...kb(t.right)]:Mu(t)?kb(t.tree):Xs(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Mb(t){return Op(t)?[...Mb(t.left),...Mb(t.right)]:Py(t)?Mb(t.tree):Sx(t)?[t.signature]:[]}function x3(t){return Op(t)?[...x3(t.left),...x3(t.right)]:Py(t)?x3(t.tree):ku(t)?[t.subdigest]:[]}async function W5(t){const e=typeof t=="string"?H8(t):t;if(_x(e)){const n=await Promise.all([W5(ns({},e,{suffix:void 0})),...e.suffix.map(i=>W5(i))]);return G8(n[0],n.slice(1))}const{trimmed:r}=await Rb(e.decoded.tree);return eh(ns({},e,{decoded:ns({},e.decoded,{tree:r})}))}async function Rb(t,e=!0){if(Op(t)){const[r,n]=await Promise.all([Rb(t.left),Rb(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await vp(t,Zg,void 0);return{weight:0,trimmed:{nodeHash:Qa(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Py(t)){const r=await Rb(t.tree);if(r.weight===0)try{const n=await vp(t,Zg,void 0);return{weight:0,trimmed:{nodeHash:Qa(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Ru(t)&&aZ(t.nodeHash)?{weight:0,trimmed:ns({},oZ(t.nodeHash))}:Sx(t)||Xs(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&ku(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const W8={decode:t=>H8(t),encode:t=>eh(t),trim:t=>W5(t),supportsNoChainId:!0,recover:(t,e,r)=>zk(t,e,r),encodeSigners:(t,e,r,n)=>Ib(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=W8.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=mu(t)?t:eh(t),i=r.map(s=>mu(s)?s:eh(s));return G8(n,i)},hashSetImageHash:function(t){return ZJ(t)},signaturesOf(t){return kb(t.tree)},signaturesOfDecoded:function(t){return Mb(t.decoded.tree)}};var YEe=Object.freeze({__proto__:null,SignatureType:Ni,SignaturePartType:Gn,SignaturePartTypeLength:H5,isUnrecoveredNode:Op,isUnrecoveredNestedLeaf:Py,isUnrecoveredSignatureLeaf:Sx,decodeSignatureTree:G5,InvalidSignatureLeafError:tZ,recoverTopology:vp,partEncoder:bs,encodeSigners:Ib,encodeTree:Tb,deepestConfigOfSignature:$k,isUnrecoveredSignature:qk,isUnrecoveredChainedSignature:_x,isSignature:rZ,isChainedSignature:Vk,decodeSignature:H8,decodeSignatureBody:w3,decodeChainedSignature:nZ,setImageHashStruct:iZ,recoverSignature:zk,encodeChain:G8,encodeSignature:eh,encodeSignatureBody:R_,encodeSignatureTree:Pb,signaturesOf:kb,signaturesOfDecoded:Mb,subdigestsOfDecoded:x3,trimSignature:W5,trimUnrecoveredTree:Rb,SignatureCoder:W8});function Xs(t){return t.address!==void 0&&t.weight!==void 0}function ku(t){return t.subdigest!==void 0&&t.address===void 0}function Ob(t){return Zc(t)?JSON.stringify({left:Ob(t.left),right:Ob(t.right)}):Mu(t)?JSON.stringify({weight:BigInt(t.weight).toString(),threshold:BigInt(t.threshold).toString(),tree:Ob(t.tree)}):Xs(t)?JSON.stringify({address:t.address,weight:BigInt(t.weight).toString()}):JSON.stringify(t)}function Db(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Db(e.left),right:Db(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:BigInt(e.weight),threshold:BigInt(e.threshold),tree:Db(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:BigInt(e.weight)}:e}function Mu(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Ru(t){return t.nodeHash!==void 0}function Hk(t){return Xs(t)||ku(t)||Mu(t)||Ru(t)}function Zc(t){return t.left!==void 0&&t.right!==void 0}function QEe(t){return Zc(t)||Hk(t)}function sZ(t){return Cr(["uint96","address"],[t.weight,t.address])}function oZ(t){const e=Ue(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=BigInt(Me(e.slice(0,12))),n=Qt(Me(e.slice(12)));return{weight:r,address:n}}function aZ(t){const e=Ue(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Qa(t){if(Xs(t))return sZ(t);if(ku(t))return dp(["string","bytes32"],[`Sequence static digest: -`,t.subdigest]);if(Mu(t)){const e=Qa(t.tree);return dp(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return Ru(t)?t.nodeHash:dp(["bytes32","bytes32"],[Qa(t.left),Qa(t.right)])}function JEe(t){const e=[];let r=t;for(;!Hk(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function ZEe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function Gk(t){return dp(["bytes32","uint256"],[dp(["bytes32","uint256"],[Qa(t.tree),t.threshold]),t.checkpoint])}function cZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Bv(t){return Xs(t)||ku(t)?[t]:Mu(t)?[{threshold:t.threshold,weight:t.weight,members:Bv(t.tree)}]:Ru(t)?[]:[...Bv(t.left),...Bv(t.right)]}function O_(t){return Ru(t)?!0:Zc(t)?O_(t.left)||O_(t.right):!1}function XEe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Bv(t.tree)}}const lZ=(t,e)=>t.map(r=>cZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function Wk(t){if(t.length===0)throw new Error("Empty members array");return lZ(t,Wk).reduce((r,n)=>({left:r,right:n}))}function Kk(t){if(t.length===0)throw new Error("Empty members array");const e=lZ(t,Kk);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function Yk(t){return t.length>8?Kk(t):Wk(t)}function fZ(t,e=Yk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function K5(t,e){return ku(t)?t.subdigest===e:Zc(t)?K5(t.left,e)||K5(t.right,e):!1}function D_(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();Mu(n)?e.push(n.tree):Zc(n)?(e.push(n.left),e.push(n.right)):Xs(n)&&r.add({address:n.address,weight:Number(n.weight)})}return Array.from(r)}function Y5(t){return Zc(t)?Y5(t.left)&&Y5(t.right):!Ru(t)}const K8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>Gk(t),hasSubdigest:(t,e)=>K5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>D_(t.tree),fromSimple:t=>{var e;return fZ(ns({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>Y5(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new $i(Ps.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[K8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new $i(Ps.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(BigInt((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");if(BigInt((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),checkpoint:BigInt(t.checkpoint).toString(),tree:Ob(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:BigInt(e.threshold),checkpoint:BigInt(e.checkpoint),tree:Db(e.tree)}},editConfig:function(t,e){var r,n;const i=Bv(t.tree);if(e.add)for(const s of e.add)i.find(o=>Xs(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Xs(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:Yk(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Ib(t,r,[],0);if(a>=BigInt(t.threshold))return o}const n=D_(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Ib(t,r,[],0);if(a>=BigInt(t.threshold))return o}return Ib(t,r,[],0).encoded}};var eCe=Object.freeze({__proto__:null,isSignerLeaf:Xs,isSubdigestLeaf:ku,topologyToJSON:Ob,topologyFromJSON:Db,isNestedLeaf:Mu,isNodeLeaf:Ru,isLeaf:Hk,isNode:Zc,isTopology:QEe,encodeSignerLeaf:sZ,decodeSignerLeaf:oZ,isEncodedSignerLeaf:aZ,hashNode:Qa,leftFace:JEe,isWalletConfig:ZEe,imageHash:Gk,isSimpleNestedMember:cZ,topologyToMembers:Bv,hasUnknownNodes:O_,toSimpleWalletConfig:XEe,legacyTopologyBuilder:Wk,merkleTopologyBuilder:Kk,optimized2SignersTopologyBuilder:Yk,toWalletConfig:fZ,hasSubdigest:K5,signersOf:D_,isComplete:Y5,ConfigCoder:K8}),tCe=Object.freeze({__proto__:null});const rCe={config:K8,signature:W8},uZ=2,dZ={version:uZ,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var ir=Object.freeze({__proto__:null,config:eCe,signature:YEe,context:tCe,chained:KEe,coders:rCe,version:uZ,DeployedWalletContext:dZ}),nCe=Object.freeze({__proto__:null});function N_(t,e){const r=gr(Cr(["bytes","bytes32"],[t.walletCreationCode,Kc(t.mainModule,32)])),n=gr(Cr(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Qt(mn(n,12))}async function iCe(t,e,r,n,i,s){return(await Promise.all(_Ce.map(async a=>{try{const c=a.signature.SignatureCoder.decode(Me(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),f=a.config.ConfigCoder.imageHashOf(l.config);if(N_(s[a.version],f).toLowerCase()===t.toLowerCase())return!0;const p=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),g=a.config.ConfigCoder.imageHashOf(p.config);return N_(s[a.version],g).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function sCe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function oCe(t){const e=Object.keys(t).length;return t[e]}const aCe={1:JJ,2:dZ};var cCe=Object.freeze({__proto__:null,addressOf:N_,isValidCounterfactual:iCe,isValidVersionedContext:sCe,latestContext:oCe,defaultContexts:aCe});const Y8=`tuple( +`)!==Q(this,Gw))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);ue(this,np,r)}return Q(this,np)};const J8e="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_{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 M3AgramAlAm#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-EgSe0B?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-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory: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(Vious0CurEAyEa'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)IdeIghtImOgAyEakEelEmEpE*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~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO",Z8e="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let d9=null;class Rp extends Q8e{constructor(){super("en",J8e,Z8e)}static wordlist(){return d9==null&&(d9=new Rp),d9}}function gJ(t){return(1<=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let l=0;l=0,`invalid mnemonic word at index ${l}`,"mnemonic","[ REDACTED ]");for(let u=0;u<11;u++)f&1<<10-u&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=gJ(o),c=Ue(Xa(n.slice(0,s/8)))[0]&a;return pe(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Me(n.slice(0,s/8))}function p9(t,e){pe(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Rp.wordlist());const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&X8e(8-n)),n+=3);const i=t.length/4,s=parseInt(Xa(t).substring(2,4),16)&gJ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}const v9={};class ny{constructor(e,r,n,i,s){de(this,"phrase");de(this,"password");de(this,"wordlist");de(this,"entropy");i==null&&(i=""),s==null&&(s=Rp.wordlist()),Th(e,v9,"Mnemonic"),Rt(this,{phrase:n,password:i,wordlist:s,entropy:r})}computeSeed(){const e=Ai("mnemonic"+this.password,"NFKD");return Ph(Ai(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=h9(e,n);return e=p9(Ue(i),n),new ny(v9,i,e,r,n)}static fromEntropy(e,r,n){const i=Ue(e,"entropy"),s=p9(i,n);return new ny(v9,Me(i),s,r,n)}static entropyToPhrase(e,r){const n=Ue(e,"entropy");return p9(n,r)}static phraseToEntropy(e,r){return h9(e,r)}static isValidMnemonic(e,r){try{return h9(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */var Wi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},g9=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h3,ka,fl;const eEe={16:10,24:12,32:14},tEe=[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],Ia=[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],b6=[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],rEe=[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],nEe=[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],iEe=[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],sEe=[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],oEe=[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],aEe=[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],cEe=[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],lEe=[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],fEe=[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],uEe=[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],dEe=[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],hEe=[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 y9(t){const e=[];for(let r=0;r>2,Wi(this,fl,"f")[o][f%4]=s[f],Wi(this,ka,"f")[r-o][f%4]=s[f];let a=0,c=i,l;for(;c>16&255]<<24^Ia[l>>8&255]<<16^Ia[l&255]<<8^Ia[l>>24&255]^tEe[a]<<24,a+=1,i!=8)for(let g=1;g>8&255]<<8^Ia[l>>16&255]<<16^Ia[l>>24&255]<<24;for(let g=i/2+1;g>2,p=c%4,Wi(this,fl,"f")[u][p]=s[f],Wi(this,ka,"f")[r-u][p]=s[f++],c++}for(let f=1;f>24&255]^uEe[l>>16&255]^dEe[l>>8&255]^hEe[l&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Wi(this,fl,"f").length-1,n=[0,0,0,0];let i=y9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,fl,"f")[0][a];for(let a=1;a>24&255]^nEe[i[(c+1)%4]>>16&255]^iEe[i[(c+2)%4]>>8&255]^sEe[i[(c+3)%4]&255]^Wi(this,fl,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,fl,"f")[r][a],s[4*a]=(Ia[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(Ia[i[(a+1)%4]>>16&255]^o>>16)&255,s[4*a+2]=(Ia[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(Ia[i[(a+3)%4]&255]^o)&255;return s}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Wi(this,ka,"f").length-1,n=[0,0,0,0];let i=y9(e);for(let a=0;a<4;a++)i[a]^=Wi(this,ka,"f")[0][a];for(let a=1;a>24&255]^aEe[i[(c+3)%4]>>16&255]^cEe[i[(c+2)%4]>>8&255]^lEe[i[(c+1)%4]&255]^Wi(this,ka,"f")[a][c];i=n.slice()}const s=new Uint8Array(16);let o=0;for(let a=0;a<4;a++)o=Wi(this,ka,"f")[r][a],s[4*a]=(b6[i[a]>>24&255]^o>>24)&255,s[4*a+1]=(b6[i[(a+3)%4]>>16&255]^o>>16)&255,s[4*a+2]=(b6[i[(a+2)%4]>>8&255]^o>>8)&255,s[4*a+3]=(b6[i[(a+1)%4]&255]^o)&255;return s}}h3=new WeakMap,ka=new WeakMap,fl=new WeakMap;class yJ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ik(r)},name:{enumerable:!0,value:e}})}}var w6=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},L1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},eb,Sf;class Tk extends yJ{constructor(e,r){if(super("ECC",e,Tk),eb.set(this,void 0),Sf.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");w6(this,eb,new Uint8Array(r),"f")}else w6(this,eb,new Uint8Array(16),"f");w6(this,Sf,this.iv,"f")}get iv(){return new Uint8Array(L1(this,eb,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;nNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)Ta(this,Ma,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Ta(this,Ma,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Ta(this,Ma,"f")[e]===255)Ta(this,Ma,"f")[e]=0;else{Ta(this,Ma,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let s=0;s16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),pe(i>0&&s>0,"invalid kdf","kdf",e);const o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=ti(t,"crypto.kdfparams.salt:data!"),n=ti(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();pe(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const s=ti(t,"crypto.kdfparams.c:int!"),o=ti(t,"crypto.kdfparams.dklen:int!");return pe(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:r,count:s,dkLen:o,algorithm:i}}}pe(!1,"unsupported key-derivation function","kdf",e)}function gEe(t,e){const r=JSON.parse(t),n=xx(e),i=wJ(r);if(i.name==="pbkdf2"){const{salt:u,count:p,dkLen:g,algorithm:y}=i,b=Ph(n,u,p,g,y);return B5(r,b)}Le(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:s,N:o,r:a,p:c,dkLen:l}=i,f=Iy(n,s,o,a,c,l);return B5(r,f)}function bF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function yEe(t,e,r){const n=JSON.parse(t),i=xx(e),s=wJ(n);if(s.name==="pbkdf2"){r&&(r(0),await bF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=Ph(i,p,g,y,b);return r&&(r(1),await bF(0)),B5(n,I)}Le(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:a,r:c,p:l,dkLen:f}=s,u=await _y(i,o,a,c,l,f,r);return B5(n,u)}function xJ(t){const e=t.salt!=null?Ue(t.salt,"options.salt"):ca(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),pe(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),pe(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),pe(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function EJ(t,e,r,n){const i=Ue(r.privateKey,"privateKey"),s=n.iv!=null?Ue(n.iv,"options.iv"):ca(16);pe(s.length===16,"invalid options.iv length","options.iv",n.iv);const o=n.uuid!=null?Ue(n.uuid,"options.uuid"):ca(16);pe(o.length===16,"invalid options.uuid length","options.uuid",n.iv);const a=t.slice(0,16),c=t.slice(16,32),l=new iy(a,s),f=Ue(l.encrypt(i)),u=br(Vr([c,f])),p={address:r.address.substring(2).toLowerCase(),id:C6e(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Me(s).substring(2)},ciphertext:Me(f).substring(2),kdf:"scrypt",kdfparams:{salt:Me(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:u.substring(2)}};if(r.mnemonic){const g=n.client!=null?n.client:`ethers/${ZK}`,y=r.mnemonic.path||bJ,b=r.mnemonic.locale||"en",I=t.slice(32,64),C=Ue(r.mnemonic.entropy,"account.mnemonic.entropy"),S=ca(16),O=new iy(I,S),L=Ue(O.encrypt(C)),F=new Date,_="UTC--"+(F.getUTCFullYear()+"-"+Im(F.getUTCMonth()+1,2)+"-"+Im(F.getUTCDate(),2)+"T"+Im(F.getUTCHours(),2)+"-"+Im(F.getUTCMinutes(),2)+"-"+Im(F.getUTCSeconds(),2)+".0Z")+"--"+p.address;p["x-ethers"]={client:g,gethFilename:_,path:y,locale:b,mnemonicCounter:Me(S).substring(2),mnemonicCiphertext:Me(L).substring(2),version:"0.1"}}return JSON.stringify(p)}function CJ(t,e,r){r==null&&(r={});const n=xx(e),i=xJ(r),s=Iy(n,i.salt,i.N,i.r,i.p,64);return EJ(Ue(s),i,t,r)}async function AJ(t,e,r){r==null&&(r={});const n=xx(e),i=xJ(r),s=await _y(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return EJ(Ue(s),i,t,r)}const m9="m/44'/60'/0'/0/0",mEe=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Qd=2147483648,bEe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),wEe="0123456789abcdef";function L5(t,e){let r="";for(;t;)r=wEe[t%16]+r,t=Math.trunc(t/16);for(;r.length=0;o-=8)i[33+(o>>3)]=t>>24-o&255;const s=Ue(Ay("sha512",e,i));return{IL:s.slice(0,32),IR:s.slice(32)}}function _J(t,e){const r=e.split("/");pe(r.length>0,"invalid path","path",e),r[0]==="m"&&(pe(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),r.shift());let n=t;for(let i=0;i=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=Ue(Ay("sha512",mEe,i)),o=new Yd(Me(s.slice(0,32)));return new Sc(yl,o,"0x00000000",Me(s.slice(32)),"m",0,0,n,null)},Ie(Sc,ip);let Ab=Sc;class Cw extends y_{constructor(r,n,i,s,o,a,c,l,f){super(n,f);de(this,"publicKey");de(this,"fingerprint");de(this,"parentFingerprint");de(this,"chainCode");de(this,"path");de(this,"index");de(this,"depth");Th(r,yl,"HDNodeVoidWallet"),Rt(this,{publicKey:i});const u=mn(Sy(Xa(i)),0,4);Rt(this,{publicKey:i,fingerprint:u,parentFingerprint:s,chainCode:o,path:a,index:c,depth:l})}connect(r){return new Cw(yl,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return Le(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),A_(Vr(["0x0488B21E",L5(this.depth,1),this.parentFingerprint,L5(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=cr(r,"index");pe(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Qd),n&Qd&&(i+="'"));const{IR:s,IL:o}=SJ(n,this.chainCode,this.publicKey,null),a=Yd.addPoints(o,this.publicKey,!0),c=gx(a);return new Cw(yl,c,a,this.fingerprint,Me(s),i,n,this.depth+1,this.provider)}derivePath(r){return _J(this,r)}}function wF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function xF(t,e){const r=JSON.parse(t),n=xx(e),i=Jt(ti(r,"ethaddr:string!")),s=mJ(ti(r,"encseed:string!"));pe(s&&s.length%16===0,"invalid encseed","json",t);const o=Ue(Ph(n,n,2e3,32,"sha256")).slice(0,16),a=s.slice(0,16),c=s.slice(16),l=new Tk(o,a),f=pEe(Ue(l.decrypt(c)));let u="";for(let p=0;p{setTimeout(()=>{e()},t)})}var Yw,Ol,__;let F5=(Ol=class extends D5{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Yd(e):e;super(n,r)}connect(e){return new Ol(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await AJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return CJ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return mF(e)?i=await yEe(e,r,n):wF(e)&&(n&&(n(0),await EF(0)),i=xF(e,r),n&&(n(1),await EF(0))),$e(s=Ol,Yw,__).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return mF(e)?n=gEe(e,r):wF(e)?n=xF(e,r):pe(!1,"invalid JSON wallet","json","[ REDACTED ]"),$e(i=Ol,Yw,__).call(i,n)}static createRandom(e){const r=Ab.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=Ab.fromPhrase(e);return r?n.connect(r):n}},Yw=new WeakSet,__=function(e){if(pe(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=ny.fromEntropy(e.mnemonic.entropy),i=Ab.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new Ol(e.privateKey);return pe(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Ie(Ol,Yw),Ol);const IJ="3.7.7",xEe=IJ,Py=typeof Buffer=="function",CF=typeof TextDecoder=="function"?new TextDecoder:void 0,AF=typeof TextEncoder=="function"?new TextEncoder:void 0,EEe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nb=Array.prototype.slice.call(EEe),x6=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(nb),CEe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ji=String.fromCharCode.bind(String),SF=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),TJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),PJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),kJ=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=nb[e>>18&63]+nb[e>>12&63]+nb[e>>6&63]+nb[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},Pk=typeof btoa=="function"?t=>btoa(t):Py?t=>Buffer.from(t,"binary").toString("base64"):kJ,I_=Py?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?TJ(I_(t)):I_(t),AEe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Ji(192|e>>>6)+Ji(128|e&63):Ji(224|e>>>12&15)+Ji(128|e>>>6&63)+Ji(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Ji(240|e>>>18&7)+Ji(128|e>>>12&63)+Ji(128|e>>>6&63)+Ji(128|e&63)}},SEe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,MJ=t=>t.replace(SEe,AEe),_F=Py?t=>Buffer.from(t,"utf8").toString("base64"):AF?t=>I_(AF.encode(t)):t=>Pk(MJ(t)),Nv=(t,e=!1)=>e?TJ(_F(t)):_F(t),IF=t=>Nv(t,!0),_Ee=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,IEe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Ji((r>>>10)+55296)+Ji((r&1023)+56320);case 3:return Ji((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Ji((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},RJ=t=>t.replace(_Ee,IEe),OJ=t=>{if(t=t.replace(/\s+/g,""),!CEe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Ji(e>>16&255,e>>8&255):Ji(e>>16&255,e>>8&255,e&255);return r},kk=typeof atob=="function"?t=>atob(PJ(t)):Py?t=>Buffer.from(t,"base64").toString("binary"):OJ,DJ=Py?t=>SF(Buffer.from(t,"base64")):t=>SF(kk(t).split("").map(e=>e.charCodeAt(0))),NJ=t=>DJ(BJ(t)),TEe=Py?t=>Buffer.from(t,"base64").toString("utf8"):CF?t=>CF.decode(DJ(t)):t=>RJ(kk(t)),BJ=t=>PJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),T_=t=>TEe(BJ(t)),PEe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},LJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),FJ=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,LJ(r));t("fromBase64",function(){return T_(this)}),t("toBase64",function(e){return Nv(this,e)}),t("toBase64URI",function(){return Nv(this,!0)}),t("toBase64URL",function(){return Nv(this,!0)}),t("toUint8Array",function(){return NJ(this)})},jJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,LJ(r));t("toBase64",function(e){return p3(this,e)}),t("toBase64URI",function(){return p3(this,!0)}),t("toBase64URL",function(){return p3(this,!0)})},kEe=()=>{FJ(),jJ()},TF={version:IJ,VERSION:xEe,atob:kk,atobPolyfill:OJ,btoa:Pk,btoaPolyfill:kJ,fromBase64:T_,toBase64:Nv,encode:Nv,encodeURI:IF,encodeURL:IF,utob:MJ,btou:RJ,decode:T_,isValid:PEe,fromUint8Array:p3,toUint8Array:NJ,extendString:FJ,extendUint8Array:jJ,extendBuiltins:kEe},MEe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),REe=t=>t!=null&&(typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Wr(t)||typeof t=="bigint"),Bv=t=>{const e=t.toString(16);return`${e.length%2===0?"0x":"0x0"}${e}`},ib=(t,e)=>typeof e=="bigint"?{$bigint:e.toString()}:e,OEe=t=>Ue(typeof t=="string"?Do(t):br(t)),DEe=(t,e,r)=>Sr(["string","uint256","address","bytes32"],["",e,t,r]),PF=(t,e,r)=>br(DEe(t,e,r));function j5(){return j5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const n=new Hl(t);return r&&n.setHeader("Authorization",`BEARER ${r}`),e&&n.setHeader("X-Access-Key",e),n},BEe=t=>{const e=j5({},t.types);return delete e.EIP712Domain,lh.hash(t.domain,e,t.message)},Mk=t=>Ue(BEe(t));function rs(){return rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Ok(i))return Sr(["uint8","uint8","address"],[pp.Address,i.weight,i.address]);if(i.isDynamic){const s=Ue(i.signature);return Sr(["uint8","uint8","address","uint16","bytes"],[pp.DynamicSignature,i.weight,i.address,s.length,s])}return Sr(["uint8","uint8","bytes"],[pp.EOASignature,i.weight,i.signature])});return Sr(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function GJ(t,e,r){const n=Ex(e),i=await Promise.all(t.signers.map(async s=>{if(Ok(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Rk(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:Cx(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function Sb(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=0n;const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=Ue(c.signature);return i+=BigInt(a.weight),c.isDynamic||l.length!==66?rs({},a,{isDynamic:!0,signature:c.signature,address:a.address}):rs({},a,{isDynamic:!1,signature:c.signature})});return{encoded:Dk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Nk={decode:t=>HJ(t),encode:t=>Dk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>GJ(t,e,r),encodeSigners:(t,e,r,n)=>Sb(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Nk.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var zEe=Object.freeze({__proto__:null,SignaturePartType:pp,isAddressMember:Ok,isUnrecoveredSignatureMember:VJ,isUnrecoveredSignature:zJ,decodeSignature:HJ,encodeSignature:Dk,recoverSignature:GJ,encodeSigners:Sb,SignatureCoder:Nk});const Bk={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>br(Ls.defaultAbiCoder().encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Sr(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>0n,signersOf:t=>t.signers.map(e=>({address:e.address,weight:Number(e.weight)})),fromSimple:t=>{if(BigInt(t.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi([...Ms.mainModule.abi,...Ms.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[Bk.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:BigInt(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:BigInt(n.weight),address:n.address}));return{version:e.version,threshold:BigInt(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&BigInt(e.checkpoint)!==0n)throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Sb(t,r,[]);if(a>=BigInt(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>Number(s)-Number(o))){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=Sb(t,r,[]);if(a>=BigInt(t.threshold))return o}return Sb(t,r,[]).encoded}};var HEe=Object.freeze({__proto__:null,ConfigCoder:Bk}),GEe=Object.freeze({__proto__:null});const WJ=1,KJ={version:WJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var w0=Object.freeze({__proto__:null,config:HEe,context:GEe,signature:zEe,version:WJ,DeployedWalletContext:KJ});const Lk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function YJ(t){return br(QJ(t))}function QJ(t){return Sr(["bytes32","bytes32"],[Lk,t])}function JJ(t){const e=Ue(t);if(e.length===64&&Me(e.slice(0,32))===Lk)return Me(e.slice(32,64))}function WEe(t){return JJ(t)!==void 0}var KEe=Object.freeze({__proto__:null,SetImageHashPrefix:Lk,hashSetImageHash:YJ,messageSetImageHash:QJ,decodeMessageSetImageHash:JJ,isMessageSetImageHash:WEe});let Ri=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),Gn=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const U5=66;function Op(t){return t.left!==void 0&&t.right!==void 0}function ky(t){return t.tree!==void 0}function Ax(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function $5(t){let e=Ue(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case Gn.Signature:{const s=e[0],o=Me(e.slice(1,U5+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(U5+1)}break;case Gn.Address:{const s=e[0],o=Jt(Me(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case Gn.DynamicSignature:{const s=e[0],o=Jt(Me(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=Me(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case Gn.Node:{const s=Me(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case Gn.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=$5(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case Gn.Subdigest:{const s=Me(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case Gn.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=$5(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${Me(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class ZJ extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function vp(t,e,r){if(Op(t)){const[n,i]=await Promise.all([vp(t.left,e,r),vp(t.right,e,r)]);return{left:n,right:i}}if(ky(t))return{weight:t.weight,threshold:t.threshold,tree:await vp(t.tree,e,r)};if(Ax(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await Rk(t.address,e,t.signature,r))throw new ZJ(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:Cx(e,t.signature),signature:t.signature,subdigest:e};return t}const xs={concat:(t,e)=>Sr(["bytes","bytes"],[t,e]),node:t=>Sr(["uint8","bytes32"],[Gn.Node,t]),branch:t=>{const e=Ue(t);return Sr(["uint8","uint24","bytes"],[Gn.Branch,e.length,e])},nested:(t,e,r)=>{const n=Ue(r);return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t,e,n.length,n])},subdigest:t=>Sr(["uint8","bytes32"],[Gn.Subdigest,t]),signature:(t,e)=>Sr(["uint8","uint8","bytes"],[Gn.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=Ue(r);return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Sr(["uint8","uint8","address"],[Gn.Address,t,e])};function _b(t,e,r,n,i={}){const s=Ib(t.tree,e,r,i);return BigInt(n)===0n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[Ri.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:BigInt(t.threshold)>255n?{encoded:Sr(["uint8","uint16","uint32","bytes"],[Ri.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Sr(["uint8","uint8","uint32","bytes"],[Ri.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Ib(t,e,r,n={}){const i=!n.disableTrim;if(Gc(t)){const s=Ib(t.left,e,r),o=Ib(t.right,e,r),a=ro(t.left),c=ro(t.right);return i&&s.weight===0n&&o.weight===0n&&!a&&!c?{encoded:xs.node(za(t)),weight:0n}:i&&o.weight===0n&&!c?{encoded:xs.concat(s.encoded,xs.node(za(t.right))),weight:s.weight}:i&&s.weight===0n&&!a?{encoded:xs.concat(xs.node(za(t.left)),xs.branch(o.encoded)),weight:o.weight}:{encoded:xs.concat(s.encoded,xs.branch(o.encoded)),weight:s.weight+o.weight}}if(ku(t)){const s=Ib(t.tree,e,r);return i&&s.weight===0n?{encoded:xs.node(za(t)),weight:0n}:{encoded:xs.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Mu(t))return{encoded:xs.node(za(t)),weight:0n};if(Pu(t)){const s=r.includes(t.subdigest);return{encoded:xs.subdigest(t.subdigest),weight:s?MEe:0n}}if(ro(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:xs.dynamicSignature(t.weight,t.address,a),weight:BigInt(t.weight)}:{encoded:xs.signature(t.weight,a),weight:BigInt(t.weight)}}else return{encoded:xs.address(t.weight,t.address),weight:0n};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function Fk(t){return Uk(t)?Fk(t.suffix[t.suffix.length-1]):t.config}function jk(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function Sx(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(jk)}function XJ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function Uk(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(XJ)}function U8(t){const e=Ue(t),r=e[0];switch(r){case Ri.Legacy:return{version:2,type:Ri.Legacy,decoded:v3(e)};case Ri.Dynamic:return{version:2,type:Ri.Dynamic,decoded:v3(e.slice(1))};case Ri.NoChainIdDynamic:return{version:2,type:Ri.NoChainIdDynamic,decoded:v3(e.slice(1))};case Ri.Chained:return eZ(e);default:throw new Error(`Invalid signature type: ${r}`)}}function v3(t){const e=Ue(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=$5(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function eZ(t){const e=Ue(t),r=e[0];if(r!==Ri.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;iUe(Zd(s))),i=Sr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Sr(["uint8","bytes"],[Ri.Chained,i])}function Zd(t){if(yu(t))return Me(t);if(Sx(t)||Uk(t))return $8(Zd(t),(t.suffix||[]).map(Zd));const e=jk(t)?t.decoded:t.config;switch(t.type){case Ri.Legacy:if(BigInt(e.threshold)>255n)throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return P_(e);case Ri.NoChainIdDynamic:case Ri.Dynamic:return Sr(["uint8","bytes"],[t.type,P_(e)]);case Ri.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function P_(t){return Sr(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,Tb(t.tree)])}function Tb(t){if(Gc(t)||Op(t)){const e=Ue(Tb(t.right)),r=Ue(Tb(t.left));return Gc(t.right)||Op(t.right)?Sr(["bytes","uint8","uint24","bytes"],[r,Gn.Branch,e.length,e]):Sr(["bytes","bytes"],[r,e])}if(ku(t)||ky(t)){const e=Ue(Tb(t.tree));return Sr(["uint8","uint8","uint16","uint24","bytes"],[Gn.Nested,t.weight,t.threshold,e.length,e])}if(Ax(t)||ro(t)&&t.signature!==void 0){const e=Ue(t.signature);if(t.isDynamic||e.length!==U5){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Sr(["uint8","uint8","address","uint24","bytes"],[Gn.DynamicSignature,t.weight,t.address,e.length,e])}else return Sr(["uint8","uint8","bytes"],[Gn.Signature,t.weight,e])}if(ro(t))return Sr(["uint8","uint8","address"],[Gn.Address,t.weight,t.address]);if(Mu(t))return Sr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(Pu(t))return Sr(["uint8","bytes32"],[Gn.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Pb(t){return Gc(t)?[...Pb(t.left),...Pb(t.right)]:ku(t)?Pb(t.tree):ro(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function kb(t){return Op(t)?[...kb(t.left),...kb(t.right)]:ky(t)?kb(t.tree):Ax(t)?[t.signature]:[]}function g3(t){return Op(t)?[...g3(t.left),...g3(t.right)]:ky(t)?g3(t.tree):Pu(t)?[t.subdigest]:[]}async function q5(t){const e=typeof t=="string"?U8(t):t;if(Sx(e)){const n=await Promise.all([q5(rs({},e,{suffix:void 0})),...e.suffix.map(i=>q5(i))]);return $8(n[0],n.slice(1))}const{trimmed:r}=await Mb(e.decoded.tree);return Zd(rs({},e,{decoded:rs({},e.decoded,{tree:r})}))}async function Mb(t,e=!0){if(Op(t)){const[r,n]=await Promise.all([Mb(t.left),Mb(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await vp(t,Xg,void 0);return{weight:0,trimmed:{nodeHash:za(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(ky(t)){const r=await Mb(t.tree);if(r.weight===0)try{const n=await vp(t,Xg,void 0);return{weight:0,trimmed:{nodeHash:za(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Mu(t)&&iZ(t.nodeHash)?{weight:0,trimmed:rs({},nZ(t.nodeHash))}:Ax(t)||ro(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&Pu(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const q8={decode:t=>U8(t),encode:t=>Zd(t),trim:t=>q5(t),supportsNoChainId:!0,recover:(t,e,r)=>$k(t,e,r),encodeSigners:(t,e,r,n)=>_b(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=q8.encodeSigners(t,e,[],0);return r>=BigInt(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=yu(t)?t:Zd(t),i=r.map(s=>yu(s)?s:Zd(s));return $8(n,i)},hashSetImageHash:function(t){return YJ(t)},signaturesOf(t){return Pb(t.tree)},signaturesOfDecoded:function(t){return kb(t.decoded.tree)}};var YEe=Object.freeze({__proto__:null,SignatureType:Ri,SignaturePartType:Gn,SignaturePartTypeLength:U5,isUnrecoveredNode:Op,isUnrecoveredNestedLeaf:ky,isUnrecoveredSignatureLeaf:Ax,decodeSignatureTree:$5,InvalidSignatureLeafError:ZJ,recoverTopology:vp,partEncoder:xs,encodeSigners:_b,encodeTree:Ib,deepestConfigOfSignature:Fk,isUnrecoveredSignature:jk,isUnrecoveredChainedSignature:Sx,isSignature:XJ,isChainedSignature:Uk,decodeSignature:U8,decodeSignatureBody:v3,decodeChainedSignature:eZ,setImageHashStruct:tZ,recoverSignature:$k,encodeChain:$8,encodeSignature:Zd,encodeSignatureBody:P_,encodeSignatureTree:Tb,signaturesOf:Pb,signaturesOfDecoded:kb,subdigestsOfDecoded:g3,trimSignature:q5,trimUnrecoveredTree:Mb,SignatureCoder:q8});function ro(t){return t.address!==void 0&&t.weight!==void 0}function Pu(t){return t.subdigest!==void 0&&t.address===void 0}function Rb(t){return Gc(t)?JSON.stringify({left:Rb(t.left),right:Rb(t.right)}):ku(t)?JSON.stringify({weight:BigInt(t.weight).toString(),threshold:BigInt(t.threshold).toString(),tree:Rb(t.tree)}):ro(t)?JSON.stringify({address:t.address,weight:BigInt(t.weight).toString()}):JSON.stringify(t)}function Ob(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Ob(e.left),right:Ob(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:BigInt(e.weight),threshold:BigInt(e.threshold),tree:Ob(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:BigInt(e.weight)}:e}function ku(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Mu(t){return t.nodeHash!==void 0}function qk(t){return ro(t)||Pu(t)||ku(t)||Mu(t)}function Gc(t){return t.left!==void 0&&t.right!==void 0}function QEe(t){return Gc(t)||qk(t)}function rZ(t){return Sr(["uint96","address"],[t.weight,t.address])}function nZ(t){const e=Ue(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=BigInt(Me(e.slice(0,12))),n=Jt(Me(e.slice(12)));return{weight:r,address:n}}function iZ(t){const e=Ue(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function za(t){if(ro(t))return rZ(t);if(Pu(t))return dp(["string","bytes32"],[`Sequence static digest: +`,t.subdigest]);if(ku(t)){const e=za(t.tree);return dp(["string","bytes32","uint256","uint256"],[`Sequence nested config: +`,e,t.threshold,t.weight])}return Mu(t)?t.nodeHash:dp(["bytes32","bytes32"],[za(t.left),za(t.right)])}function JEe(t){const e=[];let r=t;for(;!qk(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function ZEe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function Vk(t){return dp(["bytes32","uint256"],[dp(["bytes32","uint256"],[za(t.tree),t.threshold]),t.checkpoint])}function sZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Lv(t){return ro(t)||Pu(t)?[t]:ku(t)?[{threshold:t.threshold,weight:t.weight,members:Lv(t.tree)}]:Mu(t)?[]:[...Lv(t.left),...Lv(t.right)]}function k_(t){return Mu(t)?!0:Gc(t)?k_(t.left)||k_(t.right):!1}function XEe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Lv(t.tree)}}const oZ=(t,e)=>t.map(r=>sZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function zk(t){if(t.length===0)throw new Error("Empty members array");return oZ(t,zk).reduce((r,n)=>({left:r,right:n}))}function Hk(t){if(t.length===0)throw new Error("Empty members array");const e=oZ(t,Hk);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function Gk(t){return t.length>8?Hk(t):zk(t)}function aZ(t,e=Gk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function V5(t,e){return Pu(t)?t.subdigest===e:Gc(t)?V5(t.left,e)||V5(t.right,e):!1}function M_(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();ku(n)?e.push(n.tree):Gc(n)?(e.push(n.left),e.push(n.right)):ro(n)&&r.add({address:n.address,weight:Number(n.weight)})}return Array.from(r)}function z5(t){return Gc(t)?z5(t.left)&&z5(t.right):!Mu(t)}const V8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>Vk(t),hasSubdigest:(t,e)=>V5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>M_(t.tree),fromSimple:t=>{var e;return aZ(rs({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>z5(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Fi(Ms.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[V8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new Fi(Ms.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(BigInt((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");if(BigInt((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0)!==0n)throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:BigInt(t.threshold).toString(),checkpoint:BigInt(t.checkpoint).toString(),tree:Rb(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:BigInt(e.threshold),checkpoint:BigInt(e.checkpoint),tree:Ob(e.tree)}},editConfig:function(t,e){var r,n;const i=Lv(t.tree);if(e.add)for(const s of e.add)i.find(o=>ro(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>ro(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:Gk(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=_b(t,r,[],0);if(a>=BigInt(t.threshold))return o}const n=M_(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=_b(t,r,[],0);if(a>=BigInt(t.threshold))return o}return _b(t,r,[],0).encoded}};var eCe=Object.freeze({__proto__:null,isSignerLeaf:ro,isSubdigestLeaf:Pu,topologyToJSON:Rb,topologyFromJSON:Ob,isNestedLeaf:ku,isNodeLeaf:Mu,isLeaf:qk,isNode:Gc,isTopology:QEe,encodeSignerLeaf:rZ,decodeSignerLeaf:nZ,isEncodedSignerLeaf:iZ,hashNode:za,leftFace:JEe,isWalletConfig:ZEe,imageHash:Vk,isSimpleNestedMember:sZ,topologyToMembers:Lv,hasUnknownNodes:k_,toSimpleWalletConfig:XEe,legacyTopologyBuilder:zk,merkleTopologyBuilder:Hk,optimized2SignersTopologyBuilder:Gk,toWalletConfig:aZ,hasSubdigest:V5,signersOf:M_,isComplete:z5,ConfigCoder:V8}),tCe=Object.freeze({__proto__:null});const rCe={config:V8,signature:q8},cZ=2,lZ={version:cZ,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var or=Object.freeze({__proto__:null,config:eCe,signature:YEe,context:tCe,chained:KEe,coders:rCe,version:cZ,DeployedWalletContext:lZ}),nCe=Object.freeze({__proto__:null});function R_(t,e){const r=br(Sr(["bytes","bytes32"],[t.walletCreationCode,qc(t.mainModule,32)])),n=br(Sr(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Jt(mn(n,12))}async function iCe(t,e,r,n,i,s){return(await Promise.all(_Ce.map(async a=>{try{const c=a.signature.SignatureCoder.decode(Me(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),f=a.config.ConfigCoder.imageHashOf(l.config);if(R_(s[a.version],f).toLowerCase()===t.toLowerCase())return!0;const p=await a.signature.SignatureCoder.recover(c,{address:t,digest:Me(e),chainId:n},i),g=a.config.ConfigCoder.imageHashOf(p.config);return R_(s[a.version],g).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function sCe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function oCe(t){const e=Object.keys(t).length;return t[e]}const aCe={1:KJ,2:lZ};var cCe=Object.freeze({__proto__:null,addressOf:R_,isValidCounterfactual:iCe,isValidVersionedContext:sCe,latestContext:oCe,defaultContexts:aCe});const z8=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`;function lCe(t,e,r,n){return ns({},t,{chainId:r,intent:{id:n,wallet:e}})}function fCe(t){return gr(Ns.defaultAbiCoder().encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function uCe(t){const e=Ns.defaultAbiCoder().decode(["uint256",Y8],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function hZ(t,e){return Ns.defaultAbiCoder().encode(["uint256",Y8],[t,Sw(e)])}function pZ(t,e){return gr(hZ(t,e))}function dCe(t,e,r,n){return Cx({address:t,chainId:e,digest:pZ(r,n)})}function hCe(t,e,r){return Cx({address:t,chainId:e,digest:gr(Ns.defaultAbiCoder().encode(["string",Y8],["guest:",Sw(r)]))})}function vZ(t,e){return e.map(r=>Qk(t,r))}function Qk(t,e){if(e.to&&e.to!==bu)return{nonce:Nb(e.nonce)?void 0:BigInt(e.nonce),transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Nb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:e.to,value:BigInt(e.value||0),data:e.data||"0x"}};{const r=new $i(Ps.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:typeof e.nonce=="number"?BigInt(e.nonce):void 0,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Nb(e.gasLimit)?void 0:BigInt(e.gasLimit),to:t,value:BigInt(e.value||0),data:n}}}}function Q8(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function gZ(t){return t.every(Q8)}function Sw(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:Nb(e.gasLimit)?0n:BigInt(e.gasLimit),target:(r=e.to)!=null?r:bu,value:Nb(e.value)?0n:e.value,data:e.data||"0x"}})}function pCe(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function vCe(t,e){const r=BigInt(t),n=BigInt(e),i=2n**96n;if(n/i!==0n)throw new Error("Space already encoded");return n+r*i}function gCe(t){const e=BigInt(t),r=2n**96n;return[e/r,e%r]}function yCe(t,e){return Array.isArray(e)?gZ(e)?e:vZ(t,e).map(n=>n.transaction):Q8(e)?[e]:[Qk(t,e).transaction]}function yZ(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&Q8(r),!0)}function mZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&yZ(t)}function mCe(t){const e=new $i(Ps.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),mZ(t)?[Sw(t.transactions),t.nonce,t.signature]:[Sw(t.transactions),0,new Uint8Array([])])}const bZ="0x61c2926c",wZ=`tuple( +)[]`;function lCe(t,e,r,n){return rs({},t,{chainId:r,intent:{id:n,wallet:e}})}function fCe(t){return br(Ls.defaultAbiCoder().encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function uCe(t){const e=Ls.defaultAbiCoder().decode(["uint256",z8],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function fZ(t,e){return Ls.defaultAbiCoder().encode(["uint256",z8],[t,Aw(e)])}function uZ(t,e){return br(fZ(t,e))}function dCe(t,e,r,n){return Ex({address:t,chainId:e,digest:uZ(r,n)})}function hCe(t,e,r){return Ex({address:t,chainId:e,digest:br(Ls.defaultAbiCoder().encode(["string",z8],["guest:",Aw(r)]))})}function dZ(t,e){return e.map(r=>Wk(t,r))}function Wk(t,e){if(e.to&&e.to!==mu)return{nonce:Db(e.nonce)?void 0:BigInt(e.nonce),transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Db(e.gasLimit)?void 0:BigInt(e.gasLimit),to:e.to,value:BigInt(e.value||0),data:e.data||"0x"}};{const r=new Fi(Ms.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:typeof e.nonce=="number"?BigInt(e.nonce):void 0,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:Db(e.gasLimit)?void 0:BigInt(e.gasLimit),to:t,value:BigInt(e.value||0),data:n}}}}function H8(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function hZ(t){return t.every(H8)}function Aw(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:Db(e.gasLimit)?0n:BigInt(e.gasLimit),target:(r=e.to)!=null?r:mu,value:Db(e.value)?0n:e.value,data:e.data||"0x"}})}function pCe(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function vCe(t,e){const r=BigInt(t),n=BigInt(e),i=2n**96n;if(n/i!==0n)throw new Error("Space already encoded");return n+r*i}function gCe(t){const e=BigInt(t),r=2n**96n;return[e/r,e%r]}function yCe(t,e){return Array.isArray(e)?hZ(e)?e:dZ(t,e).map(n=>n.transaction):H8(e)?[e]:[Wk(t,e).transaction]}function pZ(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&H8(r),!0)}function vZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&pZ(t)}function mCe(t){const e=new Fi(Ms.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),vZ(t)?[Aw(t.transactions),t.nonce,t.signature]:[Aw(t.transactions),0,new Uint8Array([])])}const gZ="0x61c2926c",yZ=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`,B_=(t,e)=>{const r=[],n=new $i(Ps.mainModule.abi);for(const i of e){const s=Ue(i.data||"0x");if(i.to===t&&Me(s.slice(0,4))===bZ){const o=s.slice(4),a=Ns.defaultAbiCoder().decode([wZ],o)[0];r.push(...B_(i.to,a.map(c=>ns({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=B_(t,o.map(c=>ns({},c.toObject(),{to:c.target})));r.push(...a)}catch{r.push(i)}}return r},Nb=t=>t==null;var bCe=Object.freeze({__proto__:null,MetaTransactionsType:Y8,intendTransactionBundle:lCe,intendedTransactionID:fCe,unpackMetaTransactionsData:uCe,packMetaTransactionsData:hZ,digestOfTransactions:pZ,subdigestOfTransactions:dCe,subdigestOfGuestModuleTransactions:hCe,toSequenceTransactions:vZ,toSequenceTransaction:Qk,isSequenceTransaction:Q8,hasSequenceTransactions:gZ,sequenceTxAbiEncode:Sw,fromTxAbiEncode:pCe,encodeNonce:vCe,decodeNonce:gCe,fromTransactionish:yCe,isTransactionBundle:yZ,isSignedTransactionBundle:mZ,encodeBundleExecData:mCe,selfExecuteSelector:bZ,selfExecuteAbi:wZ,unwind:B_});const xZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",wCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function EZ(t,e,r,n){try{return await t.call({data:qr([xZ,Ns.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var xCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:xZ,EIP_6492_SUFFIX:wCe,validateEIP6492Offchain:EZ});class ECe{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Dn(e,[...Ps.mainModuleUpgradable.abi,...Ps.mainModule.abi,...Ps.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>Ue(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Ns.defaultAbiCoder().encode(["address"],[e]),n=await this.provider.getStorage(e,r).then(i=>Ue(i));if(n.length===20)return Qt(Me(n));if(n.length===32)return Ns.defaultAbiCoder().decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return EZ(this.provider,e,r,n)}}var CCe=Object.freeze({__proto__:null,OnChainReader:ECe});function ACe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var mt=Object.freeze({__proto__:null,config:nCe,signature:LEe,context:cCe,signer:VEe,EIP1271:UEe,transaction:bCe,reader:CCe,EIP6492:xCe,isWalletSignRequestMetadata:ACe});const L_=[{config:jk,signature:Fk},{config:K8,signature:W8}];function CZ(t){const e=t-1;if(e<0||e>=L_.length)throw new Error(`No coder for version: ${t}`);return L_[e]}function SCe(t){return CZ(t)}var As=Object.freeze({__proto__:null,ALL_CODERS:L_,coderFor:CZ,genericCoderFor:SCe});const _Ce=[w0,ir];function ICe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let f=1;fUe(s).length===0))return NF;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:Number(i),gasLimit:Number(i)}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Dn(e,Ps.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return mt.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=mt.transaction.intendedTransactionID(e));let o=!1;const a=async function(f,u){let p=0;for(;!o;){try{return await f()}catch(g){if(p++,i!==void 0&&p>=i)throw Ci.error(`giving up after ${p} failed attempts${u?`: ${u}`:""}`,g),g;Ci.warn(`attempt #${p} failed${u?`: ${u}`:""}`,g)}n>0&&await new Promise(g=>setTimeout(g,n))}throw new Error(`timed out after ${p} failed attempts${u?`: ${u}`:""}`)},c=async function(){let f=s.fromBlockLog;if(f<0&&(f=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+f),typeof e!="string")throw new Error("impossible");const u=e.replace("0x","");for(;!o;){const p=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),g=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,f-s.deltaBlocksLog),toBlock:p,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,f-s.deltaBlocksLog)} to ${p}`);f=p;const b=(await Promise.all(g.map(I=>a(()=>s.provider.getTransactionReceipt(I.transactionHash),`unable to get receipt for transaction ${I.transactionHash}`)))).find(I=>I==null?void 0:I.logs.find(C=>C.topics.length===0&&C.data.replace("0x","")===u||C.topics.length===1&&C.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&C.data.length>=64&&C.data.replace("0x","").startsWith(u)));if(b){const I=await a(()=>s.provider.getTransaction(b.hash),`unable to get transaction ${b.hash}`);if(!I)throw new Error(`Transaction response not found for ${e}`);const C=I;return C.receipt=b,C}o||await new Promise(I=>setTimeout(I,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}class BF extends NCe{constructor(e){if(super(LF(e)?{provider:e.provider}:Dp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=LF(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&Ci.warn("LocalRelayer doesn't accept fee quotes");const i=mt.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Dp({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}function LF(t){return t&&typeof t=="object"&&typeof t.provider=="object"&&typeof t.getAddress=="function"&&typeof t.connect=="function"}const BCe="v1",LCe="v0.4.1",FCe="1e27d0fd295aa5897878939595ef0c6adc54b1a3";let Ld=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),jCe=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),UCe=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),$Ce=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class SZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=(n,i)=>this.fetch(this.url("Ping"),Qr({},n,i)).then(s=>Jr(s).then(o=>({status:o.status})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.version=(n,i)=>this.fetch(this.url("Version"),Qr({},n,i)).then(s=>Jr(s).then(o=>({version:o.version})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.runtimeStatus=(n,i)=>this.fetch(this.url("RuntimeStatus"),Qr({},n,i)).then(s=>Jr(s).then(o=>({status:o.status})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.getSequenceContext=(n,i)=>this.fetch(this.url("GetSequenceContext"),Qr({},n,i)).then(s=>Jr(s).then(o=>({data:o.data})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.getChainID=(n,i)=>this.fetch(this.url("GetChainID"),Qr({},n,i)).then(s=>Jr(s).then(o=>({chainID:o.chainID})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.sendMetaTxn=(n,i,s)=>this.fetch(this.url("SendMetaTxn"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,txnHash:a.txnHash})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNonce=(n,i,s)=>this.fetch(this.url("GetMetaTxnNonce"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({nonce:a.nonce})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnReceipt=(n,i,s)=>this.fetch(this.url("GetMetaTxnReceipt"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({receipt:a.receipt})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.simulate=(n,i,s)=>this.fetch(this.url("Simulate"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({results:a.results})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.updateMetaTxnGasLimits=(n,i,s)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({payload:a.payload})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.feeTokens=(n,i)=>this.fetch(this.url("FeeTokens"),Qr({},n,i)).then(s=>Jr(s).then(o=>({isFeeRequired:o.isFeeRequired,tokens:o.tokens})),s=>{throw Ur.new({cause:`fetch(): ${s.message||""}`})}),this.feeOptions=(n,i,s)=>this.fetch(this.url("FeeOptions"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({options:a.options,sponsored:a.sponsored,quote:a.quote})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNetworkFeeOptions=(n,i,s)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({options:a.options})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTransactions=(n,i,s)=>this.fetch(this.url("GetMetaTransactions"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.sentTransactions=(n,i,s)=>this.fetch(this.url("SentTransactions"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.pendingTransactions=(n,i,s)=>this.fetch(this.url("PendingTransactions"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTank=(n,i,s)=>this.fetch(this.url("GetGasTank"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({gasTank:a.gasTank})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.addGasTank=(n,i,s)=>this.fetch(this.url("AddGasTank"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasTank=(n,i,s)=>this.fetch(this.url("UpdateGasTank"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getGasSponsor=(n,i,s)=>this.fetch(this.url("GetGasSponsor"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({gasSponsor:a.gasSponsor})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.addressGasSponsors=(n,i,s)=>this.fetch(this.url("AddressGasSponsors"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.listGasSponsors=(n,i,s)=>this.fetch(this.url("ListGasSponsors"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.addGasSponsor=(n,i,s)=>this.fetch(this.url("AddGasSponsor"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasSponsor=(n,i,s)=>this.fetch(this.url("UpdateGasSponsor"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.removeGasSponsor=(n,i,s)=>this.fetch(this.url("RemoveGasSponsor"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.reportGasSponsorUsage=(n,i,s)=>this.fetch(this.url("ReportGasSponsorUsage"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({gasSponsorUsage:a.gasSponsorUsage})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.nextGasTankBalanceAdjustmentNonce=(n,i,s)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({nonce:a.nonce})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.adjustGasTankBalance=(n,i,s)=>this.fetch(this.url("AdjustGasTankBalance"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({status:a.status,adjustment:a.adjustment})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTankBalanceAdjustment=(n,i,s)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({adjustment:a.adjustment})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.listGasTankBalanceAdjustments=(n,i,s)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),Qr(n,i,s)).then(o=>Jr(o).then(a=>({page:a.page,adjustments:a.adjustments})),o=>{throw Ur.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Qr=(t={},e={},r=null)=>({method:"POST",headers:Dp({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Jr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),Jk.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(VCe[n]||ui).new(r)}return r});let ui=class _Z extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,_Z.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},IZ=class TZ extends ui{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,TZ.prototype)}},Ur=class PZ extends ui{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PZ.prototype)}},kZ=class MZ extends ui{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MZ.prototype)}},RZ=class OZ extends ui{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,OZ.prototype)}},DZ=class NZ extends ui{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,NZ.prototype)}},Jk=class BZ extends ui{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BZ.prototype)}},LZ=class FZ extends ui{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FZ.prototype)}},jZ=class UZ extends ui{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UZ.prototype)}},$Z=class qZ extends ui{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qZ.prototype)}},VZ=class zZ extends ui{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zZ.prototype)}},HZ=class GZ extends ui{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GZ.prototype)}};class J8 extends ui{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,J8.prototype)}}class Z8 extends ui{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Z8.prototype)}}class X8 extends ui{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,X8.prototype)}}class eE extends ui{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eE.prototype)}}let WZ=class KZ extends ui{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,KZ.prototype)}};class tE extends ui{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tE.prototype)}}class rE extends ui{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rE.prototype)}}let YZ=class QZ extends ui{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,QZ.prototype)}},qCe=function(t){return t.WebrpcEndpoint="WebrpcEndpoint",t.WebrpcRequestFailed="WebrpcRequestFailed",t.WebrpcBadRoute="WebrpcBadRoute",t.WebrpcBadMethod="WebrpcBadMethod",t.WebrpcBadRequest="WebrpcBadRequest",t.WebrpcBadResponse="WebrpcBadResponse",t.WebrpcServerPanic="WebrpcServerPanic",t.WebrpcInternalError="WebrpcInternalError",t.WebrpcClientDisconnected="WebrpcClientDisconnected",t.WebrpcStreamLost="WebrpcStreamLost",t.WebrpcStreamFinished="WebrpcStreamFinished",t.Unauthorized="Unauthorized",t.PermissionDenied="PermissionDenied",t.MethodNotFound="MethodNotFound",t.Aborted="Aborted",t.InvalidArgument="InvalidArgument",t.Unavailable="Unavailable",t.QueryFailed="QueryFailed",t.NotFound="NotFound",t}({});const VCe={0:IZ,[-1]:Ur,[-2]:kZ,[-3]:RZ,[-4]:DZ,[-5]:Jk,[-6]:LZ,[-7]:jZ,[-8]:$Z,[-9]:VZ,[-10]:HZ,1e3:J8,1001:Z8,1003:X8,1005:eE,2001:WZ,2002:tE,2003:rE,3e3:YZ};var Q5=Object.freeze({__proto__:null,WebRPCVersion:BCe,WebRPCSchemaVersion:LCe,WebRPCSchemaHash:FCe,ETHTxnStatus:Ld,TransferType:jCe,FeeTokenType:UCe,SortOrder:$Ce,Relayer:SZ,WebrpcError:ui,WebrpcEndpointError:IZ,WebrpcRequestFailedError:Ur,WebrpcBadRouteError:kZ,WebrpcBadMethodError:RZ,WebrpcBadRequestError:DZ,WebrpcBadResponseError:Jk,WebrpcServerPanicError:LZ,WebrpcInternalErrorError:jZ,WebrpcClientDisconnectedError:$Z,WebrpcStreamLostError:VZ,WebrpcStreamFinishedError:HZ,UnauthorizedError:J8,PermissionDeniedError:Z8,MethodNotFoundError:X8,AbortedError:eE,InvalidArgumentError:WZ,UnavailableError:tE,QueryFailedError:rE,NotFoundError:YZ,errors:qCe});const zCe=[Ld.DROPPED,Ld.SUCCEEDED,Ld.PARTIALLY_FAILED,Ld.FAILED],HCe=[Ld.DROPPED,Ld.PARTIALLY_FAILED,Ld.FAILED],GCe=globalThis.fetch;class WCe{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Dp({},n.headers,i),GCe(r,n)},this.service=new SZ(e.url,this._fetch),YCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=VJ(e.provider.url,n,r);this.provider=new Iy(i,void 0,{staticNetwork:!0})}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=mt.transaction.intendedTransactionID(e)),Ci.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&zCe.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Ns.defaultAbiCoder().encode([mt.transaction.MetaTransactionsType],[mt.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");Ci.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw Ci.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:mt.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return Ci.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o,sb)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return Ci.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:Me(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){Ci.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?Nv(BigInt(r)):void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=BigInt(i.nonce),[o,a]=mt.transaction.decodeNonce(s);return Ci.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;Ci.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e,sb)} with quote ${JSON.stringify(r,sb)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:Ci.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw Ci.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=mt.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(Ci.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a,sb)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:f=>Promise.reject(new Error("impossible"))},l=async function(u){var p;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const g=await i.wait(e.intent.id),y=(p=g.receipt)==null?void 0:p.transactionHash;if(!y)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,g),i.provider.waitForTransaction(y,u)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||HCe.includes(a.status))throw new KCe(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:Number(c.blockNumber),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class KCe{constructor(e){this.receipt=e}}function YCe(t){return t&&typeof t=="object"&&typeof t.getNetwork=="function"&&typeof t.getBlockNumber=="function"}function QCe(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}function JCe(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class ZCe{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return new Uint8Array([2])}}let O0=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function XCe(t){return t===void 0||t.state===O0.INITIAL||t.state===O0.SIGNING}class nE{constructor(e,r=nE.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${Me(da(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>JCe(r)?r:new ZCe(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let f=o??{};const u=b=>{f=b,r.notifyObservers(n,l,f)},p=()=>{try{r.notifyObservers(n,l,f);const b=Object.entries(l.signers).filter(([I,C])=>XCe(C));if(a&&a(l,u)||b.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,f);return}}catch(b){console.error("Error while notifying observers",b)}};let g=r.signers;if(c){const b=await Promise.all(r.signers.map(async function(I){return I.getAddress()}));g=r.signers.filter((I,C)=>c.includes(b[C]))}const y=await Promise.allSettled(g.map(async function(b){const I=await b.getAddress();l.signers[I]={state:O0.SIGNING,request:b.sign(s,o??{}).then(C=>{const S=b.suffix();return l.signers[I]={state:O0.SIGNED,signature:C,suffix:S},p(),C}).catch(C=>{throw l.signers[I]={state:O0.ERROR,error:C},p(),C})}}));for(let b=0;bvi(e))):vi(t)}const jF=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===O0.SIGNED){const i=Ue(n.suffix),s=Cr(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};let UF=class E3 extends z8{constructor(e){var r;if(BigInt(e.chainId)===0n&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super((r=e.provider)!=null?r:null),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=mt.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new E3(ld({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new mt.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:mt.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(mt.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=E3.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(ld({},r,{chainId:this.chainId,intent:{id:Me(da(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new $i(Ps.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return Number(r)}async signDigest(e,r){const n=RF(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=ld({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=Ue(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const f=jF(c),u=ld({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=jF(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(gr(e),{message:e})}signTypedData(e,r,n){const i=Dk({domain:e,types:r,message:n});return this.signDigest(i)}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=BigInt(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return mt.transaction.encodeNonce(r,n)}randomNonce(){const e=BigInt(Me(da(12)));return mt.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await FF(e),s=mt.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=mt.transaction.digestOfTransactions(o,s),c=ld({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:RF(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await FF(e),n=mt.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?Number(o.gasLimit):s[a].gasLimit;return ld({},o,s[a],{gasLimit:c})})}connect(e,r){return new E3({coders:this.coders,context:this.context,config:this.config,chainId:this.chainId,address:this.address,orchestrator:this.orchestrator,reader:this._reader,provider:e,relayer:r??this.relayer})}signTransaction(e){throw new Error("Method not implemented.")}};function Al(){return Al=Object.assign?Object.assign.bind():function(t){for(var e=1;e=BigInt(i.value))return i}else if(i.token.contractAddress&&i.token.type===Q5.FeeTokenType.ERC20_TOKEN&&await new Dn(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)>=BigInt(i.value))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=await this.account.prepareTransactions({txs:e,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(e,c.feeOptions),u=[...c.transactions,...eAe(f)];return this.account.sendTransaction(u,this.chainId,c.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(Al({},e,{blockTag:r}))}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(Number(this.chainId))}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}getNonce(e){throw new Error("Method not implemented.")}populateCall(e){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}async populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class rAe{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return 0n}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Ix{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Qt(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||DF.DefaultMigrations,this.migrator=new OF.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new tAe(this,e,r)}static async new(e){var r;const i=new OF.Migrator(e.tracker,(r=e.migrations)!=null?r:DF.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=mt.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Ix({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=BigInt(e),n=this.networks.find(i=>r===BigInt(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);const n=new ca(r.name,r.chainId);return r.provider||new Iy(VJ(r.rpcUrl,this.projectAccessKey,this.jwt),n,{staticNetwork:n})}reader(e){return BigInt(e)===0n?new rAe:new mt.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return QCe(r.relayer)?r.relayer:new WCe(Al({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=As.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=BigInt(e)===0n;return new UF({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(F=>{if(!F)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return F}),o=s.then(F=>TCe.counterfactualVersion(this.address,F.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const z=await n.reader(e).implementation(n.address);if(!z)throw new Error(`Implementation not found for wallet ${n.address}`);const _=Object.values(n.contexts);for(let $=0;$<_.length;$++)if(_[$].mainModule===z||_[$].mainModuleUpgradable===z)return _[$].version;throw new Error(`Version not found for implementation ${z}`)}(),c=async function(){const F=await n.reader(e).imageHash(n.address);if(F)return F;const z=await s;if(z)return z.imageHash;throw new Error(`On-chain imageHash not found for wallet ${n.address}`)}(),l=async function(){const F=await c,z=await n.tracker.configOfImageHash({imageHash:F});if(z)return z;throw new Error(`On-chain config not found for imageHash ${F}`)}(),f=await a,u=await c;let p=u,g=f,y=[];if(f!==this.version){const F=await this.migrator.getAllMigratePresignedTransaction({address:this.address,fromImageHash:u,fromVersion:f,chainId:e});p=F.lastImageHash,g=F.lastVersion,y=F.signedMigrations}const b=await this.tracker.loadPresignedConfiguration({wallet:this.address,fromImageHash:p,longestPath:r}),I=b&&b.length>0?b[b.length-1].nextImageHash:p,C=await this.tracker.configOfImageHash({imageHash:I});if(!C)throw new Error(`Config not found for imageHash ${I}`);const S=await i,O=await s,L=As.coderFor(g).config.checkpointOf(C);return{original:Al({},O,{version:await o}),onChain:{imageHash:u,config:await l,version:f,deployed:S},fullyMigrated:g===this.version,signedMigrations:y,version:g,presignedConfigurations:b,imageHash:I,config:C,checkpoint:L,canOnchainValidate:f===this.version&&S}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return mt.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(f=>({to:f.entrypoint,data:mt.transaction.encodeBundleExecData(f),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const f=mt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:f,wallet:this.address}:l.intent.id=f}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitnessFor(e,r=0){const n=Oo(`This is a Sequence account woo! ${Date.now()}`),i=await this.status(r),s=this.coders.config.fromSimple({threshold:e.length,checkpoint:0,signers:e.map(f=>({address:f,weight:1}))}),a=await this.walletFor(r,i.original.context,s,this.coders).signDigest(n),c=this.coders.signature.decode(a),l=this.coders.signature.signaturesOfDecoded(c);if(l.length===0)throw new Error("No signatures found");return this.tracker.saveWitnesses({wallet:this.address,digest:n,chainId:r,signatures:l})}async publishWitness(){const e=Oo(`This is a Sequence account woo! ${Date.now()}`),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=BigInt(r)===0n?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),f=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return f;case"eip6492":return this.buildEIP6492Signature(await f,a,r)}return f}buildOnChainSignature(e){const r=mt.signature.subdigestOf({digest:Me(e),chainId:0,address:this.address}),n=Me(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new $i(Ps.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Ns.defaultAbiCoder().encode(["address","bytes","bytes"],[i.entrypoint,mt.transaction.encodeBundleExecData(i),e]);return Cr(["bytes","bytes32"],[s,mt.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,Al({},e,{checkpoint:this.coders.config.checkpointOf(r)+1n}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=UF.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:mt.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:mt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(Al({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(gr(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return Al({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=As.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=mt.transaction.fromTransactionish(this.address,c),f=a.coders.config.buildStubSignature(a.config,n),u=Me(da(32)),p={chainId:r,intent:{id:u,wallet:this.address},signature:f,transactions:l,entrypoint:this.address,nonce:0},g=await this.decorateTransactions(p,o),y=mt.transaction.encodeBundleExecData(g),b=await this.relayer(r).getFeeOptionsRaw(g.entrypoint,y,s);return Al({},b,{decorated:g})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=mt.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),f=mt.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,u=await this.orchestrator.predecorateSignedTransactions({chainId:r}),p=[];return f!==void 0&&f.transactions.length>0&&p.push(f),p.push(...u.filter(g=>g.transactions.length>0)),this.sendSignedTransactions(p,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Dk({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const u=r(o.signedMigrations);if(u){const{toVersion:p,toConfig:g}=u;a=As.genericCoderFor(p).config.imageHashOf(g)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return As.genericCoderFor(c.version).config.signersOf(c).map(u=>Al({},u,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>As.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,f=await e.tracker.configOfImageHash({imageHash:a});if(!f){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}As.genericCoderFor(f.version).config.signersOf(f).forEach(g=>{const y=r.find(b=>b.address===g.address&&b.network===i);if(y&&l&&y.flaggedForRemoval){y.flaggedForRemoval=!1;return}y||r.push({address:g.address,weight:g.weight,network:i,flaggedForRemoval:!l})})}))})),r}}const nAe=async()=>window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),$F=async(t,e)=>{const n=new TextEncoder().encode(t),i=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]);return await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:31e4,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])},qF=t=>Ue(t),VF=async(t,e)=>{const n=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(12)),s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},t,n);return{iv:i,data:s}},zF=async(t,e)=>{const{iv:r,data:n}=e;try{const i=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,n);return new TextDecoder().decode(i)}catch{throw new Error("Could not decrypt data")}},U_=(t,e)=>e.some(r=>t instanceof r);let HF,GF;function iAe(){return HF||(HF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sAe(){return GF||(GF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const $_=new WeakMap,E9=new WeakMap,iE=new WeakMap;function oAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(gp(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return iE.set(e,t),e}function aAe(t){if($_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});$_.set(t,e)}let q_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return $_.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return gp(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function JZ(t){q_=t(q_)}function cAe(t){return sAe().includes(t)?function(...e){return t.apply(V_(this),e),gp(this.request)}:function(...e){return gp(t.apply(V_(this),e))}}function lAe(t){return typeof t=="function"?cAe(t):(t instanceof IDBTransaction&&aAe(t),U_(t,iAe())?new Proxy(t,q_):t)}function gp(t){if(t instanceof IDBRequest)return oAe(t);if(E9.has(t))return E9.get(t);const e=lAe(t);return e!==t&&(E9.set(t,e),iE.set(e,t)),e}const V_=t=>iE.get(t);function fAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=gp(o);return n&&o.addEventListener("upgradeneeded",c=>{n(gp(o.result),c.oldVersion,c.newVersion,gp(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const uAe=["get","getKey","getAll","getAllKeys","count"],dAe=["put","add","delete","clear"],C9=new Map;function WF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(C9.get(e))return C9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=dAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||uAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return C9.set(e,s),s}JZ(t=>({...t,get:(e,r,n)=>WF(e,r)||t.get(e,r,n),has:(e,r)=>!!WF(e,r)||t.has(e,r)}));const hAe=["continue","continuePrimaryKey","advance"],KF={},z_=new WeakMap,ZZ=new WeakMap,pAe={get(t,e){if(!hAe.includes(e))return t[e];let r=KF[e];return r||(r=KF[e]=function(...n){z_.set(this,ZZ.get(this)[e](...n))}),r}};async function*vAe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const r=new Proxy(e,pAe);for(ZZ.set(r,e),iE.set(r,V_(e));e;)yield r,e=await(z_.get(r)||e.continue()),z_.delete(r)}function YF(t,e){return e===Symbol.asyncIterator&&U_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&U_(t,[IDBIndex,IDBObjectStore])}JZ(t=>({...t,get(e,r,n){return YF(e,r)?vAe:t.get(e,r,n)},has(e,r){return YF(e,r)||t.has(e,r)}}));const gAe="@sequence-recovery",yAe=1,C3=async t=>fAe(gAe,yAe,{upgrade:e=>{e.createObjectStore(t)}}),mAe=async t=>{await(await C3(t)).clear("security")};function bAe(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function wAe(t){return t.startsWith("ipfs://")}class XZ{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(mt.signer.canRecover(n)){const c=mt.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await mt.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await EAe(xAe(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=Me(await(i||new CAe).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===Me(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return eX(t,e,r,a,i,s+1)}class CAe{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>wAe(n)?bAe(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const AAe=(t,e)=>e.some(r=>t instanceof r);let QF,JF;function SAe(){return QF||(QF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _Ae(){return JF||(JF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const tX=new WeakMap,H_=new WeakMap,rX=new WeakMap,A9=new WeakMap,Zk=new WeakMap;function IAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(th(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&tX.set(r,t)}).catch(()=>{}),Zk.set(e,t),e}function TAe(t){if(H_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});H_.set(t,e)}let G_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return H_.get(t);if(e==="objectStoreNames")return t.objectStoreNames||rX.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return th(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function PAe(t){G_=t(G_)}function kAe(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(S9(this),e,...r);return rX.set(n,e.sort?e.sort():[e]),th(n)}:_Ae().includes(t)?function(...e){return t.apply(S9(this),e),th(tX.get(this))}:function(...e){return th(t.apply(S9(this),e))}}function MAe(t){return typeof t=="function"?kAe(t):(t instanceof IDBTransaction&&TAe(t),AAe(t,SAe())?new Proxy(t,G_):t)}function th(t){if(t instanceof IDBRequest)return IAe(t);if(A9.has(t))return A9.get(t);const e=MAe(t);return e!==t&&(A9.set(t,e),Zk.set(e,t)),e}const S9=t=>Zk.get(t);function RAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=th(o);return n&&o.addEventListener("upgradeneeded",c=>{n(th(o.result),c.oldVersion,c.newVersion,th(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const OAe=["get","getKey","getAll","getAllKeys","count"],DAe=["put","add","delete","clear"],_9=new Map;function ZF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(_9.get(e))return _9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=DAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||OAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return _9.set(e,s),s}PAe(t=>({...t,get:(e,r,n)=>ZF(e,r)||t.get(e,r,n),has:(e,r)=>!!ZF(e,r)||t.has(e,r)}));function Zl(){return Zl=Object.assign?Object.assign.bind():function(t){for(var e=1;e{try{const{Signer:p,Subdigest:g,Digest:y,"To-Config":b}=u;let I;switch(u["Signature-Type"]){case"eip-712":case"eth_sign":case"erc-1271":I=u["Signature-Type"];break;default:throw new Error(`unknown signature type ${u["Signature-Type"]}`)}let C;try{C=BigInt(u["To-Checkpoint"])}catch{throw new Error(`to checkpoint is not a number: ${u["To-Checkpoint"]}`)}if(C<=s)return[];if(!vw(p))throw new Error(`signer is not an address: ${p}`);if(!Gr(g,32))throw new Error(`subdigest is not a hash: ${g}`);if(!Gr(y,32))throw new Error(`digest is not a hash: ${y}`);let S;try{S=BigInt(u["Chain-ID"])}catch{throw new Error(`chain id is not a number: ${u["Chain-ID"]}`)}if(!Gr(b,32))throw new Error(`to config is not a hash: ${b}`);return[{id:f,signatureType:I,signer:p,subdigest:g,digest:y,chainId:S,toImageHash:b,toCheckpoint:C}]}catch(p){return console.warn(`invalid wallet ${n} config update ${f}:`,p),[]}}),a=new Map;let c=[];for(const f of o){let u=a.get(f.toImageHash);u||(u=new Map,a.set(f.toImageHash,u),c.push(f)),u.set(f.signer,f)}e.longestPath?c.sort(({toCheckpoint:f},{toCheckpoint:u})=>f===u?0:ff===u?0:f[S,{signature:"0x",isDynamic:!1}])),[],0);if(C>=BigInt(f.threshold)){p=I;break}}if(!p){console.warn(`unreachable configs with checkpoint > ${f.checkpoint} from config ${u}`);break}const b=p.toImageHash;try{const I=await this.configOfImageHash({imageHash:b});if(!I)throw new Error(`unable to find config ${b}`);if(!ir.config.isWalletConfig(I))throw new Error(`config ${b} is not v2`);const C=new Map((await Promise.all(y.map(async function(L){const{id:F,subdigest:z,signatureType:_}=g.get(L);try{let $=await(await I6(F,r.options.rateLimitRetryDelayMs)).text();switch(_){case"eip-712":$+="01";break;case"eth_sign":$+="02";break;case"erc-1271":$+="03";break}if(r.eip5719)try{$=Me(await r.eip5719.runByEIP5719(L,z,$))}catch{console.warn(`unable to run eip-5719 on config update ${F}`)}const ie=mt.signer.tryRecoverSigner(z,$);return[[L,{signature:$,isDynamic:ie!==L}]]}catch($){return console.warn(`unable to fetch signer ${L} config update ${F}:`,$),[]}}))).flat()),{encoded:S,weight:O}=ir.signature.encodeSigners(f,C,[],0);if(OL>BigInt(f.checkpoint))}catch(I){console.warn(`unable to reconstruct wallet ${n} update from config ${u} to config ${b}:`,I),c=c.filter(({toImageHash:C})=>C!==b)}}return l}savePresignedConfiguration(e){throw new Error("arweave backend does not support saving config updates")}saveWitnesses(e){throw new Error("arweave backend does not support saving signatures")}async configOfImageHash(e){var r=this;if(!e.noCache){const i=this.configs.get(e.imageHash);if(i)try{return await i}catch{const o=this.configs.get(e.imageHash);if(o)return o}}const n=async function(i){const s=Object.entries(await Pm({Type:"config",Config:i},r.options)).flatMap(([o,a])=>{try{const c=Number(a.Version);if(!c)throw new Error(`invalid version: ${a.Version}`);return[{id:o,version:c}]}catch(c){return console.warn(`config ${i} at ${o} invalid:`,c),[]}});switch(s.length){case 0:r.configs.set(i,Promise.resolve(void 0));return;case 1:break;default:console.warn(`multiple configs ${i} at ${s.map(({id:o})=>o).join(", ")}`);break}for(const{id:o,version:a}of s)try{const c=Zl({},await(await I6(o,r.options.rateLimitRetryDelayMs)).json(),{version:a});c.tree&&(c.tree=H1(c.tree));const l=As.coderFor(a).config.imageHashOf(c);if(l!==i)throw new Error(`image hash is ${l}, expected ${i}`);return r.configs.set(i,Promise.resolve(c)),c}catch(c){console.warn(`config at ${o} invalid:`,c)}r.configs.set(i,Promise.resolve(void 0))}(e.imageHash);return e.noCache||this.configs.set(e.imageHash,n),n}saveWalletConfig(e){throw new Error("arweave backend does not support saving configs")}async imageHashOfCounterfactualWallet(e){const r=Qt(e.wallet),n=Object.entries(await Pm({Type:"wallet",Wallet:r},this.options)).flatMap(([i,s])=>{try{const{"Deploy-Config":o}=s,a=Number(s["Deploy-Version"]);if(!a)throw new Error(`invalid version: ${s["Deploy-Version"]}`);if(!o)throw new Error("no deploy config");const c=mt.context.defaultContexts[a];if(!c)throw new Error(`unknown version: ${a}`);if(mt.context.addressOf(c,o)!==r)throw new Error(`incorrect v${a} deploy config: ${o}`);return[{id:i,imageHash:o,context:c}]}catch(o){return console.warn(`wallet ${r} at ${i} invalid:`,o),[]}});switch(n.length){case 0:return;case 1:break;default:console.warn(`multiple deploy configs for wallet ${r} at ${n.map(({id:i})=>i).join(", ")}, using first`);break}return n[0]}saveCounterfactualWallet(e){throw new Error("arweave backend does not support saving wallets")}async walletsOfSigner(e){var r=this;const n=Qt(e.signer),i=new Map;for(const[s,o]of Object.entries(await Pm({Type:["signature","config update"],Signer:n,Witness:e.allSignatures?void 0:"true"},this.options))){const{Wallet:a,Subdigest:c,Digest:l,"Chain-ID":f}=o;try{if(i.has(a))continue;let u;switch(o["Signature-Type"]){case"eip-712":u="01";break;case"eth_sign":u="02";break;case"erc-1271":u="03";break;default:throw new Error(`unknown signature type ${o["Signature-Type"]}`)}if(c!==mt.signature.subdigestOf({digest:l,chainId:f,address:a}))throw new Error("incorrect subdigest");const p=I6(s,this.options.rateLimitRetryDelayMs).then(async function(g){const y=await g.text()+u;if(r.eip5719)try{return Me(await r.eip5719.runByEIP5719(n,c,y))}catch{console.warn(`unable to run eip-5719 on signature ${s}`)}return y});i.set(a,{digest:l,chainId:BigInt(f),signature:p})}catch(u){console.warn(`signer ${n} signature ${s} of wallet ${a} invalid:`,u)}}return Promise.all([...i.entries()].map(async function([s,{digest:o,chainId:a,signature:c}]){return{wallet:s,proof:{digest:o,chainId:a,signature:await c}}}))}async getMigration(e,r,n,i){const s=Qt(e),o=Object.entries(await Pm({Type:"migration",Migration:s,"Chain-ID":BigInt(i).toString(),"From-Version":`${n}`,"From-Config":r},this.options)).flatMap(([O,L])=>{try{const{"To-Config":F,Executor:z}=L,_=Number(L["To-Version"]);if(!_)throw new Error(`invalid version: ${L["To-Version"]}`);if(!Gr(F,32))throw new Error(`to config is not a hash: ${F}`);if(!vw(z))throw new Error(`executor is not an address: ${z}`);return{id:O,toVersion:_,toImageHash:F,executor:z}}catch(F){return console.warn(`chain ${i} migration ${O} for v${n} wallet ${s} from config ${r} invalid:`,F),[]}});switch(o.length){case 0:return;case 1:break;default:console.warn(`multiple chain ${i} migrations for v${n} wallet ${s} from config ${r} at ${o.map(({id:O})=>O).join(", ")}, using first`);break}const{id:a,toVersion:c,toImageHash:l,executor:f}=o[0],[u,p]=await Promise.all([I6(a,this.options.rateLimitRetryDelayMs).then(O=>O.text()),this.configOfImageHash({imageHash:l})]);if(!p)throw new Error(`unable to find to config ${l} for migration`);const g=new $i(NAe),[y,b,I]=g.decodeFunctionData("execute",u),C=mt.transaction.fromTxAbiEncode(y),S=mt.transaction.subdigestOfTransactions(s,i,b,C);return{tx:{entrypoint:f,transactions:C,nonce:b,chainId:i,intent:{id:S,wallet:s},signature:I},fromVersion:n,toVersion:Number(c),toConfig:p}}saveMigration(e,r,n){throw new Error("arweave backend does not support saving migrations")}}async function Pm(t,e){var r,n,i,s;const o=(r=e==null?void 0:e.namespace)!=null?r:Lv.namespace,a=e==null?void 0:e.owners,c=(n=e==null?void 0:e.graphqlUrl)!=null?n:Lv.graphqlUrl,l=(i=e==null?void 0:e.rateLimitRetryDelayMs)!=null?i:Lv.rateLimitRetryDelayMs,f=(s=e==null?void 0:e.pageSize)!=null?s:100,u=e==null?void 0:e.maxResults,p=Object.entries(t).flatMap(([y,b])=>b===void 0?[]:[`{ name: "${o?`${o}-${y}`:y}", values: [${typeof b=="string"?`"${b}"`:b.map(I=>`"${I}"`).join(", ")}] }`]),g=[];for(let y=!0;y&&(u===void 0||g.length{const r=[],n=new Fi(Ms.mainModule.abi);for(const i of e){const s=Ue(i.data||"0x");if(i.to===t&&Me(s.slice(0,4))===gZ){const o=s.slice(4),a=Ls.defaultAbiCoder().decode([yZ],o)[0];r.push(...O_(i.to,a.map(c=>rs({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=O_(t,o.map(c=>rs({},c.toObject(),{to:c.target})));r.push(...a)}catch{r.push(i)}}return r},Db=t=>t==null;var bCe=Object.freeze({__proto__:null,MetaTransactionsType:z8,intendTransactionBundle:lCe,intendedTransactionID:fCe,unpackMetaTransactionsData:uCe,packMetaTransactionsData:fZ,digestOfTransactions:uZ,subdigestOfTransactions:dCe,subdigestOfGuestModuleTransactions:hCe,toSequenceTransactions:dZ,toSequenceTransaction:Wk,isSequenceTransaction:H8,hasSequenceTransactions:hZ,sequenceTxAbiEncode:Aw,fromTxAbiEncode:pCe,encodeNonce:vCe,decodeNonce:gCe,fromTransactionish:yCe,isTransactionBundle:pZ,isSignedTransactionBundle:vZ,encodeBundleExecData:mCe,selfExecuteSelector:gZ,selfExecuteAbi:yZ,unwind:O_});const mZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",wCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function bZ(t,e,r,n){try{return await t.call({data:Vr([mZ,Ls.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var xCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:mZ,EIP_6492_SUFFIX:wCe,validateEIP6492Offchain:bZ});class ECe{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Nn(e,[...Ms.mainModuleUpgradable.abi,...Ms.mainModule.abi,...Ms.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>Ue(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Ls.defaultAbiCoder().encode(["address"],[e]),n=await this.provider.getStorage(e,r).then(i=>Ue(i));if(n.length===20)return Jt(Me(n));if(n.length===32)return Ls.defaultAbiCoder().decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return bZ(this.provider,e,r,n)}}var CCe=Object.freeze({__proto__:null,OnChainReader:ECe});function ACe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var yt=Object.freeze({__proto__:null,config:nCe,signature:LEe,context:cCe,signer:VEe,EIP1271:UEe,transaction:bCe,reader:CCe,EIP6492:xCe,isWalletSignRequestMetadata:ACe});const D_=[{config:Bk,signature:Nk},{config:V8,signature:q8}];function wZ(t){const e=t-1;if(e<0||e>=D_.length)throw new Error(`No coder for version: ${t}`);return D_[e]}function SCe(t){return wZ(t)}var _s=Object.freeze({__proto__:null,ALL_CODERS:D_,coderFor:wZ,genericCoderFor:SCe});const _Ce=[w0,or];function ICe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let f=1;fUe(s).length===0))return RF;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:Number(i),gasLimit:Number(i)}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Nn(e,Ms.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return yt.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e));let o=!1;const a=async function(f,u){let p=0;for(;!o;){try{return await f()}catch(g){if(p++,i!==void 0&&p>=i)throw wi.error(`giving up after ${p} failed attempts${u?`: ${u}`:""}`,g),g;wi.warn(`attempt #${p} failed${u?`: ${u}`:""}`,g)}n>0&&await new Promise(g=>setTimeout(g,n))}throw new Error(`timed out after ${p} failed attempts${u?`: ${u}`:""}`)},c=async function(){let f=s.fromBlockLog;if(f<0&&(f=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+f),typeof e!="string")throw new Error("impossible");const u=e.replace("0x","");for(;!o;){const p=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),g=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,f-s.deltaBlocksLog),toBlock:p,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,f-s.deltaBlocksLog)} to ${p}`);f=p;const b=(await Promise.all(g.map(I=>a(()=>s.provider.getTransactionReceipt(I.transactionHash),`unable to get receipt for transaction ${I.transactionHash}`)))).find(I=>I==null?void 0:I.logs.find(C=>C.topics.length===0&&C.data.replace("0x","")===u||C.topics.length===1&&C.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&C.data.length>=64&&C.data.replace("0x","").startsWith(u)));if(b){const I=await a(()=>s.provider.getTransaction(b.hash),`unable to get transaction ${b.hash}`);if(!I)throw new Error(`Transaction response not found for ${e}`);const C=I;return C.receipt=b,C}o||await new Promise(I=>setTimeout(I,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}class OF extends NCe{constructor(e){if(super(DF(e)?{provider:e.provider}:Dp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=DF(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&wi.warn("LocalRelayer doesn't accept fee quotes");const i=yt.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Dp({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}function DF(t){return t&&typeof t=="object"&&typeof t.provider=="object"&&typeof t.getAddress=="function"&&typeof t.connect=="function"}const BCe="v1",LCe="v0.4.1",FCe="1e27d0fd295aa5897878939595ef0c6adc54b1a3";let Nd=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),jCe=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),UCe=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),$Ce=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class EZ{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=(n,i)=>this.fetch(this.url("Ping"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.version=(n,i)=>this.fetch(this.url("Version"),Jr({},n,i)).then(s=>Zr(s).then(o=>({version:o.version})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.runtimeStatus=(n,i)=>this.fetch(this.url("RuntimeStatus"),Jr({},n,i)).then(s=>Zr(s).then(o=>({status:o.status})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getSequenceContext=(n,i)=>this.fetch(this.url("GetSequenceContext"),Jr({},n,i)).then(s=>Zr(s).then(o=>({data:o.data})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.getChainID=(n,i)=>this.fetch(this.url("GetChainID"),Jr({},n,i)).then(s=>Zr(s).then(o=>({chainID:o.chainID})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.sendMetaTxn=(n,i,s)=>this.fetch(this.url("SendMetaTxn"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,txnHash:a.txnHash})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNonce=(n,i,s)=>this.fetch(this.url("GetMetaTxnNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnReceipt=(n,i,s)=>this.fetch(this.url("GetMetaTxnReceipt"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({receipt:a.receipt})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.simulate=(n,i,s)=>this.fetch(this.url("Simulate"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({results:a.results})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateMetaTxnGasLimits=(n,i,s)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({payload:a.payload})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.feeTokens=(n,i)=>this.fetch(this.url("FeeTokens"),Jr({},n,i)).then(s=>Zr(s).then(o=>({isFeeRequired:o.isFeeRequired,tokens:o.tokens})),s=>{throw $r.new({cause:`fetch(): ${s.message||""}`})}),this.feeOptions=(n,i,s)=>this.fetch(this.url("FeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options,sponsored:a.sponsored,quote:a.quote})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTxnNetworkFeeOptions=(n,i,s)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({options:a.options})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getMetaTransactions=(n,i,s)=>this.fetch(this.url("GetMetaTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.sentTransactions=(n,i,s)=>this.fetch(this.url("SentTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.pendingTransactions=(n,i,s)=>this.fetch(this.url("PendingTransactions"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,transactions:a.transactions})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTank=(n,i,s)=>this.fetch(this.url("GetGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasTank=(n,i,s)=>this.fetch(this.url("AddGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasTank=(n,i,s)=>this.fetch(this.url("UpdateGasTank"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasTank:a.gasTank})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasSponsor=(n,i,s)=>this.fetch(this.url("GetGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addressGasSponsors=(n,i,s)=>this.fetch(this.url("AddressGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasSponsors=(n,i,s)=>this.fetch(this.url("ListGasSponsors"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,gasSponsors:a.gasSponsors})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.addGasSponsor=(n,i,s)=>this.fetch(this.url("AddGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.updateGasSponsor=(n,i,s)=>this.fetch(this.url("UpdateGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,gasSponsor:a.gasSponsor})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.removeGasSponsor=(n,i,s)=>this.fetch(this.url("RemoveGasSponsor"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.reportGasSponsorUsage=(n,i,s)=>this.fetch(this.url("ReportGasSponsorUsage"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({gasSponsorUsage:a.gasSponsorUsage})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.nextGasTankBalanceAdjustmentNonce=(n,i,s)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({nonce:a.nonce})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.adjustGasTankBalance=(n,i,s)=>this.fetch(this.url("AdjustGasTankBalance"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({status:a.status,adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.getGasTankBalanceAdjustment=(n,i,s)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({adjustment:a.adjustment})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.listGasTankBalanceAdjustments=(n,i,s)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),Jr(n,i,s)).then(o=>Zr(o).then(a=>({page:a.page,adjustments:a.adjustments})),o=>{throw $r.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Jr=(t={},e={},r=null)=>({method:"POST",headers:Dp({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Zr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),Kk.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(VCe[n]||li).new(r)}return r});let li=class CZ extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,CZ.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},AZ=class SZ extends li{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,SZ.prototype)}},$r=class _Z extends li{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_Z.prototype)}},IZ=class TZ extends li{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,TZ.prototype)}},PZ=class kZ extends li{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kZ.prototype)}},MZ=class RZ extends li{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,RZ.prototype)}},Kk=class OZ extends li{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,OZ.prototype)}},DZ=class NZ extends li{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,NZ.prototype)}},BZ=class LZ extends li{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,LZ.prototype)}},FZ=class jZ extends li{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,jZ.prototype)}},UZ=class $Z extends li{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$Z.prototype)}},qZ=class VZ extends li{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,VZ.prototype)}};class G8 extends li{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,G8.prototype)}}class W8 extends li{constructor(e="PermissionDenied",r=1001,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,W8.prototype)}}class K8 extends li{constructor(e="MethodNotFound",r=1003,n="Method not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,K8.prototype)}}class Y8 extends li{constructor(e="Aborted",r=1005,n="Request aborted",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Y8.prototype)}}let zZ=class HZ extends li{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,HZ.prototype)}};class Q8 extends li{constructor(e="Unavailable",r=2002,n="Unavailable resource",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Q8.prototype)}}class J8 extends li{constructor(e="QueryFailed",r=2003,n="Query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,J8.prototype)}}let GZ=class WZ extends li{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,WZ.prototype)}},qCe=function(t){return t.WebrpcEndpoint="WebrpcEndpoint",t.WebrpcRequestFailed="WebrpcRequestFailed",t.WebrpcBadRoute="WebrpcBadRoute",t.WebrpcBadMethod="WebrpcBadMethod",t.WebrpcBadRequest="WebrpcBadRequest",t.WebrpcBadResponse="WebrpcBadResponse",t.WebrpcServerPanic="WebrpcServerPanic",t.WebrpcInternalError="WebrpcInternalError",t.WebrpcClientDisconnected="WebrpcClientDisconnected",t.WebrpcStreamLost="WebrpcStreamLost",t.WebrpcStreamFinished="WebrpcStreamFinished",t.Unauthorized="Unauthorized",t.PermissionDenied="PermissionDenied",t.MethodNotFound="MethodNotFound",t.Aborted="Aborted",t.InvalidArgument="InvalidArgument",t.Unavailable="Unavailable",t.QueryFailed="QueryFailed",t.NotFound="NotFound",t}({});const VCe={0:AZ,[-1]:$r,[-2]:IZ,[-3]:PZ,[-4]:MZ,[-5]:Kk,[-6]:DZ,[-7]:BZ,[-8]:FZ,[-9]:UZ,[-10]:qZ,1e3:G8,1001:W8,1003:K8,1005:Y8,2001:zZ,2002:Q8,2003:J8,3e3:GZ};var H5=Object.freeze({__proto__:null,WebRPCVersion:BCe,WebRPCSchemaVersion:LCe,WebRPCSchemaHash:FCe,ETHTxnStatus:Nd,TransferType:jCe,FeeTokenType:UCe,SortOrder:$Ce,Relayer:EZ,WebrpcError:li,WebrpcEndpointError:AZ,WebrpcRequestFailedError:$r,WebrpcBadRouteError:IZ,WebrpcBadMethodError:PZ,WebrpcBadRequestError:MZ,WebrpcBadResponseError:Kk,WebrpcServerPanicError:DZ,WebrpcInternalErrorError:BZ,WebrpcClientDisconnectedError:FZ,WebrpcStreamLostError:UZ,WebrpcStreamFinishedError:qZ,UnauthorizedError:G8,PermissionDeniedError:W8,MethodNotFoundError:K8,AbortedError:Y8,InvalidArgumentError:zZ,UnavailableError:Q8,QueryFailedError:J8,NotFoundError:GZ,errors:qCe});const zCe=[Nd.DROPPED,Nd.SUCCEEDED,Nd.PARTIALLY_FAILED,Nd.FAILED],HCe=[Nd.DROPPED,Nd.PARTIALLY_FAILED,Nd.FAILED],GCe=globalThis.fetch;class WCe{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Dp({},n.headers,i),GCe(r,n)},this.service=new EZ(e.url,this._fetch),YCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=UJ(e.provider.url,n,r);this.provider=new Ty(i,void 0,{staticNetwork:!0})}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=yt.transaction.intendedTransactionID(e)),wi.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&zCe.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Ls.defaultAbiCoder().encode([yt.transaction.MetaTransactionsType],[yt.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");wi.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw wi.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:yt.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return wi.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o,ib)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return wi.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:Me(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){wi.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?Bv(BigInt(r)):void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=BigInt(i.nonce),[o,a]=yt.transaction.decodeNonce(s);return wi.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;wi.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e,ib)} with quote ${JSON.stringify(r,ib)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:wi.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw wi.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=yt.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(wi.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a,ib)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:f=>Promise.reject(new Error("impossible"))},l=async function(u){var p;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const g=await i.wait(e.intent.id),y=(p=g.receipt)==null?void 0:p.transactionHash;if(!y)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,g),i.provider.waitForTransaction(y,u)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,f)=>setTimeout(()=>{o=!0,f(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||HCe.includes(a.status))throw new KCe(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:Number(c.blockNumber),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class KCe{constructor(e){this.receipt=e}}function YCe(t){return t&&typeof t=="object"&&typeof t.getNetwork=="function"&&typeof t.getBlockNumber=="function"}function QCe(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}function JCe(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class ZCe{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return new Uint8Array([2])}}let O0=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function XCe(t){return t===void 0||t.state===O0.INITIAL||t.state===O0.SIGNING}class Z8{constructor(e,r=Z8.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${Me(ca(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>JCe(r)?r:new ZCe(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let f=o??{};const u=b=>{f=b,r.notifyObservers(n,l,f)},p=()=>{try{r.notifyObservers(n,l,f);const b=Object.entries(l.signers).filter(([I,C])=>XCe(C));if(a&&a(l,u)||b.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,f);return}}catch(b){console.error("Error while notifying observers",b)}};let g=r.signers;if(c){const b=await Promise.all(r.signers.map(async function(I){return I.getAddress()}));g=r.signers.filter((I,C)=>c.includes(b[C]))}const y=await Promise.allSettled(g.map(async function(b){const I=await b.getAddress();l.signers[I]={state:O0.SIGNING,request:b.sign(s,o??{}).then(C=>{const S=b.suffix();return l.signers[I]={state:O0.SIGNED,signature:C,suffix:S},p(),C}).catch(C=>{throw l.signers[I]={state:O0.ERROR,error:C},p(),C})}}));for(let b=0;bui(e))):ui(t)}const BF=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===O0.SIGNED){const i=Ue(n.suffix),s=Sr(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};let LF=class y3 extends j8{constructor(e){var r;if(BigInt(e.chainId)===0n&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super((r=e.provider)!=null?r:null),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=yt.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new y3(ad({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new yt.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:yt.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(yt.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=y3.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(ad({},r,{chainId:this.chainId,intent:{id:Me(ca(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new Fi(Ms.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return Number(r)}async signDigest(e,r){const n=PF(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=ad({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=Ue(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const f=BF(c),u=ad({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=BF(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(br(e),{message:e})}signTypedData(e,r,n){const i=Mk({domain:e,types:r,message:n});return this.signDigest(i)}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=BigInt(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return yt.transaction.encodeNonce(r,n)}randomNonce(){const e=BigInt(Me(ca(12)));return yt.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await NF(e),s=yt.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=yt.transaction.digestOfTransactions(o,s),c=ad({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:PF(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await NF(e),n=yt.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?Number(o.gasLimit):s[a].gasLimit;return ad({},o,s[a],{gasLimit:c})})}connect(e,r){return new y3({coders:this.coders,context:this.context,config:this.config,chainId:this.chainId,address:this.address,orchestrator:this.orchestrator,reader:this._reader,provider:e,relayer:r??this.relayer})}signTransaction(e){throw new Error("Method not implemented.")}};function ml(){return ml=Object.assign?Object.assign.bind():function(t){for(var e=1;e=BigInt(i.value))return i}else if(i.token.contractAddress&&i.token.type===H5.FeeTokenType.ERC20_TOKEN&&await new Nn(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)>=BigInt(i.value))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=await this.account.prepareTransactions({txs:e,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(e,c.feeOptions),u=[...c.transactions,...eAe(f)];return this.account.sendTransaction(u,this.chainId,c.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(ml({},e,{blockTag:r}))}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(Number(this.chainId))}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}getNonce(e){throw new Error("Method not implemented.")}populateCall(e){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}async populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class rAe{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return 0n}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class _x{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Jt(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||MF.DefaultMigrations,this.migrator=new kF.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new tAe(this,e,r)}static async new(e){var r;const i=new kF.Migrator(e.tracker,(r=e.migrations)!=null?r:MF.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=yt.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new _x({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=BigInt(e),n=this.networks.find(i=>r===BigInt(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);const n=new ia(r.name,r.chainId);return r.provider||new Ty(UJ(r.rpcUrl,this.projectAccessKey,this.jwt),n,{staticNetwork:n})}reader(e){return BigInt(e)===0n?new rAe:new yt.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return QCe(r.relayer)?r.relayer:new WCe(ml({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=_s.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=BigInt(e)===0n;return new LF({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(F=>{if(!F)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return F}),o=s.then(F=>TCe.counterfactualVersion(this.address,F.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const z=await n.reader(e).implementation(n.address);if(!z)throw new Error(`Implementation not found for wallet ${n.address}`);const _=Object.values(n.contexts);for(let $=0;$<_.length;$++)if(_[$].mainModule===z||_[$].mainModuleUpgradable===z)return _[$].version;throw new Error(`Version not found for implementation ${z}`)}(),c=async function(){const F=await n.reader(e).imageHash(n.address);if(F)return F;const z=await s;if(z)return z.imageHash;throw new Error(`On-chain imageHash not found for wallet ${n.address}`)}(),l=async function(){const F=await c,z=await n.tracker.configOfImageHash({imageHash:F});if(z)return z;throw new Error(`On-chain config not found for imageHash ${F}`)}(),f=await a,u=await c;let p=u,g=f,y=[];if(f!==this.version){const F=await this.migrator.getAllMigratePresignedTransaction({address:this.address,fromImageHash:u,fromVersion:f,chainId:e});p=F.lastImageHash,g=F.lastVersion,y=F.signedMigrations}const b=await this.tracker.loadPresignedConfiguration({wallet:this.address,fromImageHash:p,longestPath:r}),I=b&&b.length>0?b[b.length-1].nextImageHash:p,C=await this.tracker.configOfImageHash({imageHash:I});if(!C)throw new Error(`Config not found for imageHash ${I}`);const S=await i,O=await s,L=_s.coderFor(g).config.checkpointOf(C);return{original:ml({},O,{version:await o}),onChain:{imageHash:u,config:await l,version:f,deployed:S},fullyMigrated:g===this.version,signedMigrations:y,version:g,presignedConfigurations:b,imageHash:I,config:C,checkpoint:L,canOnchainValidate:f===this.version&&S}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return yt.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(f=>({to:f.entrypoint,data:yt.transaction.encodeBundleExecData(f),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const f=yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:f,wallet:this.address}:l.intent.id=f}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitnessFor(e,r=0){const n=Do(`This is a Sequence account woo! ${Date.now()}`),i=await this.status(r),s=this.coders.config.fromSimple({threshold:e.length,checkpoint:0,signers:e.map(f=>({address:f,weight:1}))}),a=await this.walletFor(r,i.original.context,s,this.coders).signDigest(n),c=this.coders.signature.decode(a),l=this.coders.signature.signaturesOfDecoded(c);if(l.length===0)throw new Error("No signatures found");return this.tracker.saveWitnesses({wallet:this.address,digest:n,chainId:r,signatures:l})}async publishWitness(){const e=Do(`This is a Sequence account woo! ${Date.now()}`),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=BigInt(r)===0n?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),f=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return f;case"eip6492":return this.buildEIP6492Signature(await f,a,r)}return f}buildOnChainSignature(e){const r=yt.signature.subdigestOf({digest:Me(e),chainId:0,address:this.address}),n=Me(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new Fi(Ms.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Ls.defaultAbiCoder().encode(["address","bytes","bytes"],[i.entrypoint,yt.transaction.encodeBundleExecData(i),e]);return Sr(["bytes","bytes32"],[s,yt.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,ml({},e,{checkpoint:this.coders.config.checkpointOf(r)+1n}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=LF.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:yt.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:yt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(ml({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(br(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return ml({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=_s.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=yt.transaction.fromTransactionish(this.address,c),f=a.coders.config.buildStubSignature(a.config,n),u=Me(ca(32)),p={chainId:r,intent:{id:u,wallet:this.address},signature:f,transactions:l,entrypoint:this.address,nonce:0},g=await this.decorateTransactions(p,o),y=yt.transaction.encodeBundleExecData(g),b=await this.relayer(r).getFeeOptionsRaw(g.entrypoint,y,s);return ml({},b,{decorated:g})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=yt.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),f=yt.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,u=await this.orchestrator.predecorateSignedTransactions({chainId:r}),p=[];return f!==void 0&&f.transactions.length>0&&p.push(f),p.push(...u.filter(g=>g.transactions.length>0)),this.sendSignedTransactions(p,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Mk({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const u=r(o.signedMigrations);if(u){const{toVersion:p,toConfig:g}=u;a=_s.genericCoderFor(p).config.imageHashOf(g)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return _s.genericCoderFor(c.version).config.signersOf(c).map(u=>ml({},u,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>_s.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,f=await e.tracker.configOfImageHash({imageHash:a});if(!f){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}_s.genericCoderFor(f.version).config.signersOf(f).forEach(g=>{const y=r.find(b=>b.address===g.address&&b.network===i);if(y&&l&&y.flaggedForRemoval){y.flaggedForRemoval=!1;return}y||r.push({address:g.address,weight:g.weight,network:i,flaggedForRemoval:!l})})}))})),r}}const nAe=async()=>window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),FF=async(t,e)=>{const n=new TextEncoder().encode(t),i=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]);return await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:31e4,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])},jF=t=>Ue(t),UF=async(t,e)=>{const n=new TextEncoder().encode(e),i=window.crypto.getRandomValues(new Uint8Array(12)),s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},t,n);return{iv:i,data:s}},$F=async(t,e)=>{const{iv:r,data:n}=e;try{const i=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,n);return new TextDecoder().decode(i)}catch{throw new Error("Could not decrypt data")}},L_=(t,e)=>e.some(r=>t instanceof r);let qF,VF;function iAe(){return qF||(qF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sAe(){return VF||(VF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F_=new WeakMap,b9=new WeakMap,X8=new WeakMap;function oAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(gp(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return X8.set(e,t),e}function aAe(t){if(F_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});F_.set(t,e)}let j_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return F_.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return gp(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function KZ(t){j_=t(j_)}function cAe(t){return sAe().includes(t)?function(...e){return t.apply(U_(this),e),gp(this.request)}:function(...e){return gp(t.apply(U_(this),e))}}function lAe(t){return typeof t=="function"?cAe(t):(t instanceof IDBTransaction&&aAe(t),L_(t,iAe())?new Proxy(t,j_):t)}function gp(t){if(t instanceof IDBRequest)return oAe(t);if(b9.has(t))return b9.get(t);const e=lAe(t);return e!==t&&(b9.set(t,e),X8.set(e,t)),e}const U_=t=>X8.get(t);function fAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=gp(o);return n&&o.addEventListener("upgradeneeded",c=>{n(gp(o.result),c.oldVersion,c.newVersion,gp(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const uAe=["get","getKey","getAll","getAllKeys","count"],dAe=["put","add","delete","clear"],w9=new Map;function zF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(w9.get(e))return w9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=dAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||uAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return w9.set(e,s),s}KZ(t=>({...t,get:(e,r,n)=>zF(e,r)||t.get(e,r,n),has:(e,r)=>!!zF(e,r)||t.has(e,r)}));const hAe=["continue","continuePrimaryKey","advance"],HF={},$_=new WeakMap,YZ=new WeakMap,pAe={get(t,e){if(!hAe.includes(e))return t[e];let r=HF[e];return r||(r=HF[e]=function(...n){$_.set(this,YZ.get(this)[e](...n))}),r}};async function*vAe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const r=new Proxy(e,pAe);for(YZ.set(r,e),X8.set(r,U_(e));e;)yield r,e=await($_.get(r)||e.continue()),$_.delete(r)}function GF(t,e){return e===Symbol.asyncIterator&&L_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&L_(t,[IDBIndex,IDBObjectStore])}KZ(t=>({...t,get(e,r,n){return GF(e,r)?vAe:t.get(e,r,n)},has(e,r){return GF(e,r)||t.has(e,r)}}));const gAe="@sequence-recovery",yAe=1,m3=async t=>fAe(gAe,yAe,{upgrade:e=>{e.createObjectStore(t)}}),mAe=async t=>{await(await m3(t)).clear("security")};function bAe(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function wAe(t){return t.startsWith("ipfs://")}class QZ{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(yt.signer.canRecover(n)){const c=yt.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await yt.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await EAe(xAe(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=Me(await(i||new CAe).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===Me(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return JZ(t,e,r,a,i,s+1)}class CAe{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>wAe(n)?bAe(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const AAe=(t,e)=>e.some(r=>t instanceof r);let WF,KF;function SAe(){return WF||(WF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _Ae(){return KF||(KF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const ZZ=new WeakMap,q_=new WeakMap,XZ=new WeakMap,x9=new WeakMap,Yk=new WeakMap;function IAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(Xd(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&ZZ.set(r,t)}).catch(()=>{}),Yk.set(e,t),e}function TAe(t){if(q_.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});q_.set(t,e)}let V_={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return q_.get(t);if(e==="objectStoreNames")return t.objectStoreNames||XZ.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Xd(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function PAe(t){V_=t(V_)}function kAe(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(E9(this),e,...r);return XZ.set(n,e.sort?e.sort():[e]),Xd(n)}:_Ae().includes(t)?function(...e){return t.apply(E9(this),e),Xd(ZZ.get(this))}:function(...e){return Xd(t.apply(E9(this),e))}}function MAe(t){return typeof t=="function"?kAe(t):(t instanceof IDBTransaction&&TAe(t),AAe(t,SAe())?new Proxy(t,V_):t)}function Xd(t){if(t instanceof IDBRequest)return IAe(t);if(x9.has(t))return x9.get(t);const e=MAe(t);return e!==t&&(x9.set(t,e),Yk.set(e,t)),e}const E9=t=>Yk.get(t);function RAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Xd(o);return n&&o.addEventListener("upgradeneeded",c=>{n(Xd(o.result),c.oldVersion,c.newVersion,Xd(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const OAe=["get","getKey","getAll","getAllKeys","count"],DAe=["put","add","delete","clear"],C9=new Map;function YF(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(C9.get(e))return C9.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=DAe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||OAe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return C9.set(e,s),s}PAe(t=>({...t,get:(e,r,n)=>YF(e,r)||t.get(e,r,n),has:(e,r)=>!!YF(e,r)||t.has(e,r)}));function Gl(){return Gl=Object.assign?Object.assign.bind():function(t){for(var e=1;e{try{const{Signer:p,Subdigest:g,Digest:y,"To-Config":b}=u;let I;switch(u["Signature-Type"]){case"eip-712":case"eth_sign":case"erc-1271":I=u["Signature-Type"];break;default:throw new Error(`unknown signature type ${u["Signature-Type"]}`)}let C;try{C=BigInt(u["To-Checkpoint"])}catch{throw new Error(`to checkpoint is not a number: ${u["To-Checkpoint"]}`)}if(C<=s)return[];if(!pw(p))throw new Error(`signer is not an address: ${p}`);if(!Wr(g,32))throw new Error(`subdigest is not a hash: ${g}`);if(!Wr(y,32))throw new Error(`digest is not a hash: ${y}`);let S;try{S=BigInt(u["Chain-ID"])}catch{throw new Error(`chain id is not a number: ${u["Chain-ID"]}`)}if(!Wr(b,32))throw new Error(`to config is not a hash: ${b}`);return[{id:f,signatureType:I,signer:p,subdigest:g,digest:y,chainId:S,toImageHash:b,toCheckpoint:C}]}catch(p){return console.warn(`invalid wallet ${n} config update ${f}:`,p),[]}}),a=new Map;let c=[];for(const f of o){let u=a.get(f.toImageHash);u||(u=new Map,a.set(f.toImageHash,u),c.push(f)),u.set(f.signer,f)}e.longestPath?c.sort(({toCheckpoint:f},{toCheckpoint:u})=>f===u?0:ff===u?0:f[S,{signature:"0x",isDynamic:!1}])),[],0);if(C>=BigInt(f.threshold)){p=I;break}}if(!p){console.warn(`unreachable configs with checkpoint > ${f.checkpoint} from config ${u}`);break}const b=p.toImageHash;try{const I=await this.configOfImageHash({imageHash:b});if(!I)throw new Error(`unable to find config ${b}`);if(!or.config.isWalletConfig(I))throw new Error(`config ${b} is not v2`);const C=new Map((await Promise.all(y.map(async function(L){const{id:F,subdigest:z,signatureType:_}=g.get(L);try{let $=await(await E6(F,r.options.rateLimitRetryDelayMs)).text();switch(_){case"eip-712":$+="01";break;case"eth_sign":$+="02";break;case"erc-1271":$+="03";break}if(r.eip5719)try{$=Me(await r.eip5719.runByEIP5719(L,z,$))}catch{console.warn(`unable to run eip-5719 on config update ${F}`)}const ie=yt.signer.tryRecoverSigner(z,$);return[[L,{signature:$,isDynamic:ie!==L}]]}catch($){return console.warn(`unable to fetch signer ${L} config update ${F}:`,$),[]}}))).flat()),{encoded:S,weight:O}=or.signature.encodeSigners(f,C,[],0);if(OL>BigInt(f.checkpoint))}catch(I){console.warn(`unable to reconstruct wallet ${n} update from config ${u} to config ${b}:`,I),c=c.filter(({toImageHash:C})=>C!==b)}}return l}savePresignedConfiguration(e){throw new Error("arweave backend does not support saving config updates")}saveWitnesses(e){throw new Error("arweave backend does not support saving signatures")}async configOfImageHash(e){var r=this;if(!e.noCache){const i=this.configs.get(e.imageHash);if(i)try{return await i}catch{const o=this.configs.get(e.imageHash);if(o)return o}}const n=async function(i){const s=Object.entries(await Tm({Type:"config",Config:i},r.options)).flatMap(([o,a])=>{try{const c=Number(a.Version);if(!c)throw new Error(`invalid version: ${a.Version}`);return[{id:o,version:c}]}catch(c){return console.warn(`config ${i} at ${o} invalid:`,c),[]}});switch(s.length){case 0:r.configs.set(i,Promise.resolve(void 0));return;case 1:break;default:console.warn(`multiple configs ${i} at ${s.map(({id:o})=>o).join(", ")}`);break}for(const{id:o,version:a}of s)try{const c=Gl({},await(await E6(o,r.options.rateLimitRetryDelayMs)).json(),{version:a});c.tree&&(c.tree=G1(c.tree));const l=_s.coderFor(a).config.imageHashOf(c);if(l!==i)throw new Error(`image hash is ${l}, expected ${i}`);return r.configs.set(i,Promise.resolve(c)),c}catch(c){console.warn(`config at ${o} invalid:`,c)}r.configs.set(i,Promise.resolve(void 0))}(e.imageHash);return e.noCache||this.configs.set(e.imageHash,n),n}saveWalletConfig(e){throw new Error("arweave backend does not support saving configs")}async imageHashOfCounterfactualWallet(e){const r=Jt(e.wallet),n=Object.entries(await Tm({Type:"wallet",Wallet:r},this.options)).flatMap(([i,s])=>{try{const{"Deploy-Config":o}=s,a=Number(s["Deploy-Version"]);if(!a)throw new Error(`invalid version: ${s["Deploy-Version"]}`);if(!o)throw new Error("no deploy config");const c=yt.context.defaultContexts[a];if(!c)throw new Error(`unknown version: ${a}`);if(yt.context.addressOf(c,o)!==r)throw new Error(`incorrect v${a} deploy config: ${o}`);return[{id:i,imageHash:o,context:c}]}catch(o){return console.warn(`wallet ${r} at ${i} invalid:`,o),[]}});switch(n.length){case 0:return;case 1:break;default:console.warn(`multiple deploy configs for wallet ${r} at ${n.map(({id:i})=>i).join(", ")}, using first`);break}return n[0]}saveCounterfactualWallet(e){throw new Error("arweave backend does not support saving wallets")}async walletsOfSigner(e){var r=this;const n=Jt(e.signer),i=new Map;for(const[s,o]of Object.entries(await Tm({Type:["signature","config update"],Signer:n,Witness:e.allSignatures?void 0:"true"},this.options))){const{Wallet:a,Subdigest:c,Digest:l,"Chain-ID":f}=o;try{if(i.has(a))continue;let u;switch(o["Signature-Type"]){case"eip-712":u="01";break;case"eth_sign":u="02";break;case"erc-1271":u="03";break;default:throw new Error(`unknown signature type ${o["Signature-Type"]}`)}if(c!==yt.signature.subdigestOf({digest:l,chainId:f,address:a}))throw new Error("incorrect subdigest");const p=E6(s,this.options.rateLimitRetryDelayMs).then(async function(g){const y=await g.text()+u;if(r.eip5719)try{return Me(await r.eip5719.runByEIP5719(n,c,y))}catch{console.warn(`unable to run eip-5719 on signature ${s}`)}return y});i.set(a,{digest:l,chainId:BigInt(f),signature:p})}catch(u){console.warn(`signer ${n} signature ${s} of wallet ${a} invalid:`,u)}}return Promise.all([...i.entries()].map(async function([s,{digest:o,chainId:a,signature:c}]){return{wallet:s,proof:{digest:o,chainId:a,signature:await c}}}))}async getMigration(e,r,n,i){const s=Jt(e),o=Object.entries(await Tm({Type:"migration",Migration:s,"Chain-ID":BigInt(i).toString(),"From-Version":`${n}`,"From-Config":r},this.options)).flatMap(([O,L])=>{try{const{"To-Config":F,Executor:z}=L,_=Number(L["To-Version"]);if(!_)throw new Error(`invalid version: ${L["To-Version"]}`);if(!Wr(F,32))throw new Error(`to config is not a hash: ${F}`);if(!pw(z))throw new Error(`executor is not an address: ${z}`);return{id:O,toVersion:_,toImageHash:F,executor:z}}catch(F){return console.warn(`chain ${i} migration ${O} for v${n} wallet ${s} from config ${r} invalid:`,F),[]}});switch(o.length){case 0:return;case 1:break;default:console.warn(`multiple chain ${i} migrations for v${n} wallet ${s} from config ${r} at ${o.map(({id:O})=>O).join(", ")}, using first`);break}const{id:a,toVersion:c,toImageHash:l,executor:f}=o[0],[u,p]=await Promise.all([E6(a,this.options.rateLimitRetryDelayMs).then(O=>O.text()),this.configOfImageHash({imageHash:l})]);if(!p)throw new Error(`unable to find to config ${l} for migration`);const g=new Fi(NAe),[y,b,I]=g.decodeFunctionData("execute",u),C=yt.transaction.fromTxAbiEncode(y),S=yt.transaction.subdigestOfTransactions(s,i,b,C);return{tx:{entrypoint:f,transactions:C,nonce:b,chainId:i,intent:{id:S,wallet:s},signature:I},fromVersion:n,toVersion:Number(c),toConfig:p}}saveMigration(e,r,n){throw new Error("arweave backend does not support saving migrations")}}async function Tm(t,e){var r,n,i,s;const o=(r=e==null?void 0:e.namespace)!=null?r:Fv.namespace,a=e==null?void 0:e.owners,c=(n=e==null?void 0:e.graphqlUrl)!=null?n:Fv.graphqlUrl,l=(i=e==null?void 0:e.rateLimitRetryDelayMs)!=null?i:Fv.rateLimitRetryDelayMs,f=(s=e==null?void 0:e.pageSize)!=null?s:100,u=e==null?void 0:e.maxResults,p=Object.entries(t).flatMap(([y,b])=>b===void 0?[]:[`{ name: "${o?`${o}-${y}`:y}", values: [${typeof b=="string"?`"${b}"`:b.map(I=>`"${I}"`).join(", ")}] }`]),g=[];for(let y=!0;y&&(u===void 0||g.length`"${S}"`).join(", ")}]`}) { pageInfo { @@ -179,8 +179,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } } } - `;let I;for(;I=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b}),redirect:"follow"}),I.status===429;)console.warn(`rate limited by arweave.net, trying again in ${l/1e3} seconds at ${new Date(Date.now()+l).toLocaleTimeString()}`),await new Promise(S=>setTimeout(S,l));const{data:{transactions:C}}=await I.json();g.push(...C.edges),y=C.pageInfo.hasNextPage}return Object.fromEntries(g.map(({node:{id:y,tags:b}})=>[y,Object.fromEntries(b.map(({name:I,value:C})=>[o&&I.startsWith(`${o}-`)?I.slice(o.length+1):I,C]))]))}async function I6(t,e=Lv.rateLimitRetryDelayMs){for(;;){const r=await fetch(`https://arweave.net/${t}`,{redirect:"follow"});if(r.status!==429)return r;console.warn(`rate limited by arweave.net, trying again in ${e/1e3} seconds at ${new Date(Date.now()+e).toLocaleTimeString()}`),await new Promise(n=>setTimeout(n,e))}}function H1(t){return typeof t=="string"?{nodeHash:t}:typeof t=="object"&&(t==null?void 0:t.node)!==void 0?{nodeHash:t.node}:t instanceof Array&&t.length===2?{left:H1(t[0]),right:H1(t[1])}:ir.config.isNode(t)?{left:H1(t.left),right:H1(t.right)}:ir.config.isNestedLeaf(t)?Zl({},t,{tree:H1(t.tree)}):t}var LAe=Object.freeze({__proto__:null,defaults:Lv,ArweaveReader:BAe});class FAe{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Hs(e,"? "),Hs(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Hs(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Hs(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Hs(e,"? "),Hs(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Hs(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Hs(e,"? "),Hs(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Hs(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Hs(e,"? "),Hs(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Hs({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Hs(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Hs({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Hs(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,sb,2).split(` -`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var jAe=Object.freeze({__proto__:null,DebugConfigTracker:FAe});class nX{constructor(){this.configs={},this.v2Nodes={},this.counterfactualWallets={},this.payloads={},this.signatures={},this.migrations={},this.loadConfig=e=>Promise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function Fv(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=BigInt(n._hex):Array.isArray(n)?e[r]=n.map(i=>Fv(i)):typeof n=="object"&&n!==null?e[r]=Fv(n):e[r]=n}return e}class UAe{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>Fv(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>Fv(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>Fv(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await RAe(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function iX(t){return t.left!==void 0&&t.right!==void 0}function sX(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function W_(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var $Ae=Object.freeze({__proto__:null,isPlainNode:iX,isPlainNested:sX,isPlainV2Config:W_,MemoryTrackerStore:nX,recreateBigNumbers:Fv,IndexedDBStore:UAe});class Xk{constructor(e,r=new nX,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(iX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return sX(o)?{weight:BigInt(o.weight),threshold:BigInt(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(ir.config.isNodeLeaf(s))return;const o=ir.config.hashNode(s);if(ir.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:ir.config.hashNode(s.left),right:ir.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(ir.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:BigInt(s.weight).toString(),threshold:BigInt(s.threshold).toString(),tree:ir.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(ir.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(ir.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(w0.config.ConfigCoder.isWalletConfig(o)){const a=w0.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(ir.config.ConfigCoder.isWalletConfig(o)){const a=ir.config.ConfigCoder.imageHashOf(o);if(ir.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!W_(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(W_(a)){const c={version:2,threshold:BigInt(a.threshold),checkpoint:BigInt(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=As.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const f=mt.context.addressOf(l,c);return i.store.saveCounterfactualWallet(f,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=mt.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=ir.signature.SignatureCoder.decode(s.signature),a=As.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=ir.chained.messageSetImageHash(a),l=gr(c),f={message:c,address:s.wallet,chainId:0,digest:l},u=i.savePayload({payload:f}),p=i.saveWalletConfig({config:s.nextConfig}),g=await ir.signature.SignatureCoder.recover(o,f,i.provider),y=ir.signature.signaturesOf(g.config.tree);await Promise.all([u,p,i.saveWalletConfig({config:g.config}),...y.map(b=>i.store.saveSignatureOfSubdigest(b.address,g.subdigest,b.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!ir.config.ConfigCoder.isWalletConfig(l))return[];const f=ir.config.signersOf(l.tree).map(O=>O.address),u=await Promise.all(f.map(O=>i.store.loadSubdigestsOfSigner(O))),p=[...new Set(u.flat())],y=(await Promise.all([...new Set(p)].map(async function(O){return Zl({},await i.payloadOfSubdigest({subdigest:O}),{subdigest:O})}))).filter(O=>(O==null?void 0:O.message)&&(O==null?void 0:O.address)&&O.address===o).map(O=>({payload:O,nextImageHash:ir.chained.decodeMessageSetImageHash(O.message)})).filter(O=>O==null?void 0:O.nextImageHash);let b;const C=(await Promise.all(y.map(async function({nextImageHash:O,payload:L}){const F=await i.configOfImageHash({imageHash:O});if(!F||!ir.config.isWalletConfig(F))return;const z=BigInt(F.checkpoint);return{nextConfig:F,nextCheckpoint:z,nextImageHash:O,payload:L}}))).filter(O=>O!==void 0).filter(O=>O.nextCheckpoint>BigInt(l.checkpoint)).sort((O,L)=>O.nextCheckpoint>L.nextCheckpoint?c?1:-1:c?-1:1);for(const O of C){const{nextConfig:L,nextCheckpoint:F,nextImageHash:z,payload:_}=O;if(b){const ce=b.checkpoint;if(c){if(F>=ce)continue}else if(F<=ce)continue}const $=new Map((await Promise.all(f.map(async function(ce){const K=await i.store.loadSignatureOfSubdigest(ce,_.subdigest);if(!K)return[ce,void 0];const P=Me(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(ce,_.subdigest,K):K),M=mt.signer.tryRecoverSigner(_.subdigest,P)!==ce;return[ce,{isDynamic:M,signature:P}]}))).filter(ce=>!!ce[1]));if($.size===0)continue;const ie=ir.signature.SignatureCoder.encodeSigners(l,$,[],0);ie.weightmt.signer.canRecover(c)).map(c=>{const l=mt.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(f=>f!==void 0)),c=[];for(const l of a){const f=l.address;if(c.find(g=>g.wallet===f))continue;const u=mt.signature.subdigestOf(l),p=await i.store.loadSignatureOfSubdigest(s.signer,u);p&&c.push({wallet:f,proof:{digest:l.digest,chainId:BigInt(l.chainId),signature:Me(p)}})}return c},this.cachedEIP5719=new XZ(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!ir.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=kCe.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(ir.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=mt.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=gr(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},f=mt.signature.subdigestOf(l),u=this.savePayload({payload:l}),p=this.saveWalletConfig({config:r.toConfig}),g=w0.signature.SignatureCoder.decode(r.tx.signature),y=await w0.signature.SignatureCoder.recover(g,l,this.provider),b=w0.signature.SignatureCoder.signaturesOf(y.config);await Promise.all([u,p,this.saveWalletConfig({config:y.config}),this.store.saveMigrationsSubdigest(e,i,i+1,f,s),...b.map(I=>this.store.saveSignatureOfSubdigest(I.address,y.subdigest,I.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=As.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(f){const{subdigest:u,toImageHash:p}=f,g=await s.payloadOfSubdigest({subdigest:u});if(!g||!g.message||BigInt(i)!==BigInt(g.chainId))return;const y=c.config.signersOf(o).map(O=>O.address),b=new Map((await Promise.all(y.map(async function(O){const L=await s.store.loadSignatureOfSubdigest(O,u);if(!L)return[O,void 0];const F=Me(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(O,u,L):L),z=mt.signer.tryRecoverSigner(u,F)!==O;return[O,{isDynamic:z,signature:F}]}))).filter(O=>!!O[1])),I=c.signature.encodeSigners(o,b,[],i);if(!I||I.weightf.filter(u=>u!==void 0)))[0]}updateProvider(e){this.provider=e}}var qAe=Object.freeze({__proto__:null,LocalConfigTracker:Xk});let I9=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class VAe{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=(n,i)=>this.fetch(this.url("Ping"),Ec({},n,i)).then(s=>Cc(s).then(o=>({})),s=>{throw wo.new({cause:`fetch(): ${s.message||""}`})}),this.config=(n,i,s)=>this.fetch(this.url("Config"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({version:a.version,config:a.config})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.wallets=(n,i,s)=>this.fetch(this.url("Wallets"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({wallets:a.wallets})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.deployHash=(n,i,s)=>this.fetch(this.url("DeployHash"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({deployHash:a.deployHash,context:a.context})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.configUpdates=(n,i,s)=>this.fetch(this.url("ConfigUpdates"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({updates:a.updates})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.migrations=(n,i,s)=>this.fetch(this.url("Migrations"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({migrations:a.migrations})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.saveConfig=(n,i,s)=>this.fetch(this.url("SaveConfig"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.saveWallet=(n,i,s)=>this.fetch(this.url("SaveWallet"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignature=(n,i,s)=>this.fetch(this.url("SaveSignature"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.saveMigration=(n,i,s)=>this.fetch(this.url("SaveMigration"),Ec(n,i,s)).then(o=>Cc(o).then(a=>({})),o=>{throw wo.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ec=(t={},e={},r=null)=>({method:"POST",headers:Zl({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),Cc=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),sE.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(zAe[n]||Ls).new(r)}return r});class Ls extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,Ls.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class eM extends Ls{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eM.prototype)}}class wo extends Ls{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,wo.prototype)}}class tM extends Ls{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tM.prototype)}}class rM extends Ls{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.prototype)}}class nM extends Ls{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class sE extends Ls{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sE.prototype)}}class iM extends Ls{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends Ls{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class oM extends Ls{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends Ls{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}class cM extends Ls{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cM.prototype)}}class lM extends Ls{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lM.prototype)}}class fM extends Ls{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,fM.prototype)}}const zAe={0:eM,[-1]:wo,[-2]:tM,[-3]:rM,[-4]:nM,[-5]:sE,[-6]:iM,[-7]:sM,[-8]:oM,[-9]:aM,[-10]:cM,1:lM,2:fM};class HAe{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new VAe(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(T9(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=As.genericCoderFor(r.version).config.imageHashOf(r),i=ir.signature.setImageHashStruct(n),s=gr(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:T6(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>mt.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:vv(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return GAe(r,n)}catch(r){if(T9(r))return;throw r}}async saveWalletConfig(e){const r=T6(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(T9(r))return;throw r}}async saveCounterfactualWallet(e){const r=T6(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case I9.EIP712:a+=tc(mt.signer.SigType.EIP712).slice(2);break;case I9.EthSign:a+=tc(mt.signer.SigType.ETH_SIGN).slice(2);break;case I9.EIP1271:a+=tc(mt.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:BigInt(s)}}})}async getMigration(e,r,n,i){var s=this;const o=vv(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(u){const p=a[u];if(p){const g=Object.keys(p).map(Number).sort((y,b)=>b-y);for(const y of g)for(const[b,I]of Object.entries(p[y]))try{const C=await s.configOfImageHash({imageHash:b});if(C)return{fromVersion:n,toVersion:y,toConfig:C,tx:{entrypoint:I.executor,transactions:I.transactions,nonce:I.nonce,signature:I.signature,chainId:u,intent:{id:mt.transaction.subdigestOfTransactions(e,u,I.nonce,I.transactions),wallet:e}}}}catch(C){console.error(C)}}},l=await c(o);if(l)return l;for(const f in a)if(f!==o){const u=await c(f);if(u)return u}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:T6(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(WAe),nonce:vv(r.tx.nonce),signature:r.tx.signature,chainID:vv(r.tx.chainId)})}}function T6(t){switch(t.version){case 1:if(w0.config.ConfigCoder.isWalletConfig(t))return{threshold:D0(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:D0(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(ir.config.ConfigCoder.isWalletConfig(t))return{threshold:D0(t.threshold),checkpoint:D0(t.checkpoint),tree:A3(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function A3(t){return ir.config.isNode(t)?{left:A3(t.left),right:A3(t.right)}:ir.config.isSignerLeaf(t)?{weight:D0(t.weight),address:t.address}:ir.config.isNestedLeaf(t)?{weight:D0(t.weight),threshold:D0(t.threshold),tree:A3(t.tree)}:ir.config.isNodeLeaf(t)?{node:t.nodeHash}:Zl({},t)}function GAe(t,e){switch(t){case 1:return Zl({},e,{version:t});case 2:return Zl({},e,{version:t,tree:S3(e.tree)});default:throw new Error(`unknown version ${t}`)}}function S3(t){switch(typeof t){case"object":const e=Zl({},t);return e.left!==void 0&&(e.left=S3(e.left)),e.right!==void 0&&(e.right=S3(e.right)),e.tree!==void 0&&(e.tree=S3(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function WAe(t){return{to:t.to,value:t.value!==void 0?vv(t.value):void 0,data:t.data!==void 0?Me(t.data):void 0,gasLimit:t.gasLimit!==void 0?vv(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function D0(t){return Number(t)}function vv(t){return BigInt(t).toString()}function T9(t){return typeof t=="object"&&t.status===404}var KAe=Object.freeze({__proto__:null,RemoteConfigTracker:HAe});function K_(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function ob(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class YAe{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await K_(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:As.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new Xk(void 0),s=await ob(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await K_(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await ob(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const f=`${o}-${a}-${c}`;let u=s.get(f);u||(u={wallet:o,digest:a,chainId:c,signatures:[]},s.set(f,u)),u.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await ob(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await ob(n.map(async function(c){const l=c[c.length-1],f=await r.configOfImageHash({imageHash:l.nextImageHash});if(f)return{checkpoint:As.genericCoderFor(f.version).config.checkpointOf(f),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint>c.checkpoint)?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class QAe{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthu&&(!f||u.checkpoint>f.checkpoint)?u:f))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class XF{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Oo(JSON.stringify(i,JAe))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function JAe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):typeof e=="bigint"?e.toString():e}function ZAe(t){return t instanceof oX}class oX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new XF}invalidateCache(){this.cache=new XF}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof Xk&&this.tracker.updateProvider(e)}}var aX=Object.freeze({__proto__:null,arweave:LAe,debug:jAe,local:qAe,remote:KAe,stores:$Ae,raceUntil:K_,allSafe:ob,MultipleTracker:YAe,CachedTracker:QAe,isDedupedTracker:ZAe,DedupedTracker:oX});const Y_=new aX.arweave.ArweaveReader({graphqlUrl:"https://arweave-search.goldsky.com/graphql"});var dh=(t=>(t.NETWORKS_USER_EDITS="@sequence-recovery.networks-user-edits",t.NETWORKS_USER_ADDITIONS="@sequence-recovery.networks-user-additions",t.TOKENS_USER_ADDITIONS="@sequence-recovery.tokens-user-additions",t.COLLECTIBLES="@sequence-recovery.collectibles",t.GATEWAY_ADDRESS="@sequence-recovery.gateway-address",t.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO="@sequence-recovery.last-connected-external-provider-info",t.DEFAULT_NETWORK="@sequence-recovery.default-network",t))(dh||{}),yl=(t=>(t.SECURITY="security",t))(yl||{});const ej="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",cX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:ej},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:ej}},lX="95777495732e7317ec3fd92b88a1b19c";let ge=function(t){return t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t.GOERLI=5]="GOERLI",t[t.KOVAN=42]="KOVAN",t[t.SEPOLIA=11155111]="SEPOLIA",t[t.POLYGON=137]="POLYGON",t[t.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",t[t.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",t[t.POLYGON_AMOY=80002]="POLYGON_AMOY",t[t.BSC=56]="BSC",t[t.BSC_TESTNET=97]="BSC_TESTNET",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_KOVAN=69]="OPTIMISM_KOVAN",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.OPTIMISM_SEPOLIA=11155420]="OPTIMISM_SEPOLIA",t[t.ARBITRUM=42161]="ARBITRUM",t[t.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",t[t.ARBITRUM_SEPOLIA=421614]="ARBITRUM_SEPOLIA",t[t.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",t[t.AVALANCHE=43114]="AVALANCHE",t[t.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",t[t.GNOSIS=100]="GNOSIS",t[t.BASE=8453]="BASE",t[t.BASE_GOERLI=84531]="BASE_GOERLI",t[t.BASE_SEPOLIA=84532]="BASE_SEPOLIA",t[t.HOMEVERSE_TESTNET=40875]="HOMEVERSE_TESTNET",t[t.HOMEVERSE=19011]="HOMEVERSE",t[t.XAI=660279]="XAI",t[t.XAI_SEPOLIA=37714555429]="XAI_SEPOLIA",t[t.XR_SEPOLIA=2730]="XR_SEPOLIA",t[t.TELOS=40]="TELOS",t[t.B3=8333]="B3",t[t.B3_SEPOLIA=1993]="B3_SEPOLIA",t[t.APECHAIN=33139]="APECHAIN",t[t.APECHAIN_TESTNET=33111]="APECHAIN_TESTNET",t[t.BLAST=81457]="BLAST",t[t.BLAST_SEPOLIA=168587773]="BLAST_SEPOLIA",t[t.BORNE_TESTNET=94984]="BORNE_TESTNET",t[t.SKALE_NEBULA=1482601649]="SKALE_NEBULA",t[t.SKALE_NEBULA_TESTNET=37084624]="SKALE_NEBULA_TESTNET",t[t.SONEIUM_MINATO=1946]="SONEIUM_MINATO",t[t.TOY_TESTNET=21e6]="TOY_TESTNET",t[t.IMMUTABLE_ZKEVM=13371]="IMMUTABLE_ZKEVM",t[t.IMMUTABLE_ZKEVM_TESTNET=13473]="IMMUTABLE_ZKEVM_TESTNET",t[t.HARDHAT=31337]="HARDHAT",t[t.HARDHAT_2=31338]="HARDHAT_2",t}({}),Ft=function(t){return t.MAINNET="mainnet",t.TESTNET="testnet",t}({});const _w={[ge.MAINNET]:{chainId:ge.MAINNET,type:Ft.MAINNET,name:"mainnet",title:"Ethereum",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.MAINNET}.webp`,blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[ge.ROPSTEN]:{chainId:ge.ROPSTEN,type:Ft.TESTNET,name:"ropsten",title:"Ropsten",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ROPSTEN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},nativeToken:{symbol:"roETH",name:"Ropsten Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.RINKEBY]:{chainId:ge.RINKEBY,type:Ft.TESTNET,name:"rinkeby",title:"Rinkeby",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.RINKEBY}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},nativeToken:{symbol:"rETH",name:"Rinkeby Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.GOERLI]:{chainId:ge.GOERLI,type:Ft.TESTNET,name:"goerli",title:"Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.KOVAN]:{chainId:ge.KOVAN,type:Ft.TESTNET,name:"kovan",title:"Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"},nativeToken:{symbol:"kETH",name:"Kovan Ether",decimals:18},deprecated:!0},[ge.SEPOLIA]:{chainId:ge.SEPOLIA,type:Ft.TESTNET,name:"sepolia",title:"Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Sepolia)",rootUrl:"https://sepolia.etherscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.POLYGON]:{chainId:ge.POLYGON,type:Ft.MAINNET,name:"polygon",title:"Polygon",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON}.webp`,blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"},nativeToken:{symbol:"POL",name:"POL",decimals:18}},[ge.POLYGON_MUMBAI]:{chainId:ge.POLYGON_MUMBAI,type:Ft.TESTNET,name:"mumbai",title:"Polygon Mumbai",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_MUMBAI}.webp`,testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"},nativeToken:{symbol:"mMATIC",name:"Mumbai Polygon",decimals:18},deprecated:!0},[ge.POLYGON_AMOY]:{chainId:ge.POLYGON_AMOY,type:Ft.TESTNET,name:"amoy",title:"Polygon Amoy",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_AMOY}.webp`,testnet:!0,blockExplorer:{name:"OKLink (Amoy)",rootUrl:"https://www.oklink.com/amoy/"},nativeToken:{symbol:"aPOL",name:"Amoy POL",decimals:18}},[ge.POLYGON_ZKEVM]:{chainId:ge.POLYGON_ZKEVM,type:Ft.MAINNET,name:"polygon-zkevm",title:"Polygon zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_ZKEVM}.webp`,blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BSC]:{chainId:ge.BSC,type:Ft.MAINNET,name:"bsc",title:"BNB Smart Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BSC}.webp`,blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"},nativeToken:{symbol:"BNB",name:"BNB",decimals:18}},[ge.BSC_TESTNET]:{chainId:ge.BSC_TESTNET,type:Ft.TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BSC_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"},nativeToken:{symbol:"tBNB",name:"Testnet BNB",decimals:18}},[ge.OPTIMISM]:{chainId:ge.OPTIMISM,type:Ft.MAINNET,name:"optimism",title:"Optimism",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM}.webp`,blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.OPTIMISM_KOVAN]:{chainId:ge.OPTIMISM_KOVAN,type:Ft.TESTNET,name:"optimism-kovan",title:"Optimism Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Kovan)",rootUrl:"https://kovan-optimistic.etherscan.io/"},nativeToken:{symbol:"kETH",name:"Kovan Ether",decimals:18},deprecated:!0},[ge.OPTIMISM_GOERLI]:{chainId:ge.OPTIMISM_GOERLI,type:Ft.TESTNET,name:"optimism-goerli",title:"Optimism Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Goerli)",rootUrl:"https://goerli-optimistic.etherscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.OPTIMISM_SEPOLIA]:{chainId:ge.OPTIMISM_SEPOLIA,type:Ft.TESTNET,name:"optimism-sepolia",title:"Optimism Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Sepolia)",rootUrl:"https://sepolia-optimistic.etherscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.ARBITRUM]:{chainId:ge.ARBITRUM,type:Ft.MAINNET,name:"arbitrum",title:"Arbitrum One",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM}.webp`,blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.ARBITRUM_GOERLI]:{chainId:ge.ARBITRUM_GOERLI,type:Ft.TESTNET,name:"arbitrum-goerli",title:"Arbitrum Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Goerli Testnet)",rootUrl:"https://testnet.arbiscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.ARBITRUM_SEPOLIA]:{chainId:ge.ARBITRUM_SEPOLIA,type:Ft.TESTNET,name:"arbitrum-sepolia",title:"Arbitrum Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Sepolia Testnet)",rootUrl:"https://sepolia.arbiscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.ARBITRUM_NOVA]:{chainId:ge.ARBITRUM_NOVA,type:Ft.MAINNET,name:"arbitrum-nova",title:"Arbitrum Nova",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_NOVA}.webp`,blockExplorer:{name:"Arbiscan Nova",rootUrl:"https://nova.arbiscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.AVALANCHE]:{chainId:ge.AVALANCHE,type:Ft.MAINNET,name:"avalanche",title:"Avalanche",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.AVALANCHE}.webp`,blockExplorer:{name:"Snowtrace",rootUrl:"https://subnets.avax.network/c-chain/"},nativeToken:{symbol:"AVAX",name:"AVAX",decimals:18}},[ge.AVALANCHE_TESTNET]:{chainId:ge.AVALANCHE_TESTNET,type:Ft.TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.AVALANCHE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://subnets-test.avax.network/c-chain/"},nativeToken:{symbol:"tAVAX",name:"Testnet AVAX",decimals:18}},[ge.GNOSIS]:{chainId:ge.GNOSIS,type:Ft.MAINNET,name:"gnosis",title:"Gnosis Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.GNOSIS}.webp`,blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"},nativeToken:{symbol:"XDAI",name:"XDAI",decimals:18}},[ge.BASE]:{chainId:ge.BASE,type:Ft.MAINNET,name:"base",title:"Base (Coinbase)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE}.webp`,blockExplorer:{name:"Base Explorer",rootUrl:"https://basescan.org/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BASE_GOERLI]:{chainId:ge.BASE_GOERLI,type:Ft.TESTNET,name:"base-goerli",title:"Base Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.BASE_SEPOLIA]:{chainId:ge.BASE_SEPOLIA,type:Ft.TESTNET,name:"base-sepolia",title:"Base Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Base Sepolia Explorer",rootUrl:"https://base-sepolia.blockscout.com/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.HOMEVERSE]:{chainId:ge.HOMEVERSE,type:Ft.MAINNET,name:"homeverse",title:"Oasys Homeverse",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.HOMEVERSE}.webp`,blockExplorer:{name:"Oasys Homeverse Explorer",rootUrl:"https://explorer.oasys.homeverse.games/"},nativeToken:{symbol:"OAS",name:"OAS",decimals:18}},[ge.HOMEVERSE_TESTNET]:{chainId:ge.HOMEVERSE_TESTNET,type:Ft.TESTNET,name:"homeverse-testnet",title:"Oasys Homeverse Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.HOMEVERSE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Oasys Homeverse Explorer (Testnet)",rootUrl:"https://explorer.testnet.oasys.homeverse.games/"},nativeToken:{symbol:"tOAS",name:"Testnet OAS",decimals:18}},[ge.XAI]:{chainId:ge.XAI,type:Ft.MAINNET,name:"xai",title:"Xai",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XAI}.webp`,blockExplorer:{name:"Xai Explorer",rootUrl:"https://explorer.xai-chain.net/"},nativeToken:{symbol:"XAI",name:"XAI",decimals:18}},[ge.XAI_SEPOLIA]:{chainId:ge.XAI_SEPOLIA,type:Ft.TESTNET,name:"xai-sepolia",title:"Xai Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XAI_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Xai Sepolia Explorer",rootUrl:"https://testnet-explorer-v2.xai-chain.net/"},nativeToken:{symbol:"sXAI",name:"Sepolia XAI",decimals:18}},[ge.XR_SEPOLIA]:{chainId:ge.XR_SEPOLIA,type:Ft.TESTNET,name:"xr-sepolia",title:"XR Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XR_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"XR Sepolia Explorer",rootUrl:"https://xr-sepolia-testnet.explorer.caldera.xyz/"},nativeToken:{symbol:"tXR",name:"Sepolia XR",decimals:18}},[ge.B3]:{chainId:ge.B3,type:Ft.MAINNET,name:"b3",title:"B3",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.B3}.webp`,testnet:!1,blockExplorer:{name:"B3 Explorer",rootUrl:"https://explorer.b3.fun/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.B3_SEPOLIA]:{chainId:ge.B3_SEPOLIA,type:Ft.TESTNET,name:"b3-sepolia",title:"B3 Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.B3_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"B3 Sepolia Explorer",rootUrl:"https://sepolia.explorer.b3.fun/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.APECHAIN]:{chainId:ge.APECHAIN,type:Ft.MAINNET,name:"apechain",title:"APE Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.APECHAIN}.webp`,testnet:!1,blockExplorer:{name:"APE Chain Explorer",rootUrl:"https://apechain.calderaexplorer.xyz/"},nativeToken:{symbol:"APE",name:"ApeCoin",decimals:18}},[ge.APECHAIN_TESTNET]:{chainId:ge.APECHAIN_TESTNET,type:Ft.TESTNET,name:"apechain-testnet",title:"APE Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.APECHAIN_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"APE Chain Explorer",rootUrl:"https://curtis.explorer.caldera.xyz/"},nativeToken:{symbol:"APE",name:"ApeCoin",decimals:18}},[ge.BLAST]:{chainId:ge.BLAST,type:Ft.MAINNET,name:"blast",title:"Blast",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BLAST}.webp`,blockExplorer:{name:"Blast Explorer",rootUrl:"https://blastscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BLAST_SEPOLIA]:{chainId:ge.BLAST_SEPOLIA,type:Ft.TESTNET,name:"blast-sepolia",title:"Blast Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BLAST_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Blast Sepolia Explorer",rootUrl:"https://sepolia.blastexplorer.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.TELOS]:{chainId:ge.TELOS,type:Ft.MAINNET,name:"telos",title:"Telos",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.TELOS}.webp`,blockExplorer:{name:"Telos Explorer",rootUrl:"https://explorer.telos.net/network/"},nativeToken:{symbol:"TLOS",name:"TLOS",decimals:18}},[ge.BORNE_TESTNET]:{chainId:ge.BORNE_TESTNET,type:Ft.TESTNET,name:"borne-testnet",title:"Borne Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BORNE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Borne Testnet Explorer",rootUrl:"https://subnets-test.avax.network/bornegfdn"},nativeToken:{symbol:"BORNE",name:"BORNE",decimals:18}},[ge.SKALE_NEBULA]:{chainId:ge.SKALE_NEBULA,type:Ft.MAINNET,name:"skale-nebula",title:"SKALE Nebula Gaming Hub",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SKALE_NEBULA}.webp`,testnet:!1,blockExplorer:{name:"SKALE Nebula Gaming Hub Explorer",rootUrl:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com/"},nativeToken:{symbol:"sFUEL",name:"SKALE Fuel",decimals:18}},[ge.SKALE_NEBULA_TESTNET]:{chainId:ge.SKALE_NEBULA_TESTNET,type:Ft.TESTNET,name:"skale-nebula-testnet",title:"SKALE Nebula Gaming Hub Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SKALE_NEBULA_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"SKALE Nebula Gaming Hub Testnet Explorer",rootUrl:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com/"},nativeToken:{symbol:"sFUEL",name:"SKALE Fuel",decimals:18}},[ge.SONEIUM_MINATO]:{chainId:ge.SONEIUM_MINATO,type:Ft.TESTNET,name:"soneium-minato",title:"Soneium Minato (Testnet)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SONEIUM_MINATO}.webp`,testnet:!0,blockExplorer:{name:"Soneium Minato Explorer",rootUrl:"https://explorer-testnet.soneium.org/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.TOY_TESTNET]:{chainId:ge.TOY_TESTNET,type:Ft.TESTNET,name:"toy-testnet",title:"TOY (Testnet)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.TOY_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"TOY Testnet Explorer",rootUrl:"https://toy-chain-testnet.explorer.caldera.xyz/"},nativeToken:{symbol:"TOY",name:"TOY",decimals:18}},[ge.IMMUTABLE_ZKEVM]:{chainId:ge.IMMUTABLE_ZKEVM,type:Ft.MAINNET,name:"immutable-zkevm",title:"Immutable zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.IMMUTABLE_ZKEVM}.webp`,testnet:!1,blockExplorer:{name:"Immutable zkEVM Explorer",rootUrl:"https://explorer.immutable.com/"},nativeToken:{symbol:"IMX",name:"IMX",decimals:18}},[ge.IMMUTABLE_ZKEVM_TESTNET]:{chainId:ge.IMMUTABLE_ZKEVM_TESTNET,type:Ft.TESTNET,name:"immutable-zkevm-testnet",title:"Immutable zkEVM Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.IMMUTABLE_ZKEVM_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Immutable zkEVM Testnet Explorer",rootUrl:"https://explorer.testnet.immutable.com/"},nativeToken:{symbol:"IMX",name:"IMX",decimals:18}},[ge.HARDHAT]:{chainId:ge.HARDHAT,name:"hardhat",title:"Hardhat (local testnet)",nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.HARDHAT_2]:{chainId:ge.HARDHAT_2,name:"hardhat2",title:"Hardhat (local testnet)",nativeToken:{symbol:"ETH",name:"Ether",decimals:18}}};function iy(){return iy=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:Number(t),e9e=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,f)=>i.indexOf(l)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,f)=>o.indexOf(l)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(e9e(t,!0,e),t),r9e=t=>t9e(n9e(t)),Iw=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=Number(e);return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(typeof e=="bigint"){const r=Number(e);return t.find(n=>n.chainId===r)}else return}},n9e=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},uM=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",i9e=t=>uM("https://${network}-indexer.sequence.app",{network:t}),s9e=t=>uM("https://${network}-relayer.sequence.app",{network:t}),o9e=t=>uM("https://nodes.sequence.app/${network}",{network:t});function a9e(t){return Iw(dM,t)}function c9e(t){return typeof t=="bigint"?t:REe(t)?BigInt(t):BigInt(t.chainId)}const vr=(t,e)=>{const r=_w[t];if(!r)throw new Error(`Network with chainId ${t} not found`);const n=o9e(r.name);return iy({},r,{rpcUrl:n,indexerUrl:i9e(r.name),relayer:{url:s9e(r.name),provider:{url:n}}},e)},l9e=[iy({},_w[ge.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),iy({},_w[ge.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})],dM=r9e([iy({},vr(ge.POLYGON),{isDefaultChain:!0,isAuthChain:!0}),vr(ge.MAINNET),vr(ge.BSC),vr(ge.AVALANCHE),vr(ge.ARBITRUM),vr(ge.ARBITRUM_NOVA),vr(ge.OPTIMISM),vr(ge.OPTIMISM_SEPOLIA),vr(ge.POLYGON_ZKEVM),vr(ge.GNOSIS),vr(ge.RINKEBY,{disabled:!0}),vr(ge.GOERLI,{disabled:!0}),vr(ge.SEPOLIA),vr(ge.POLYGON_MUMBAI,{disabled:!0}),vr(ge.POLYGON_AMOY),vr(ge.BSC_TESTNET),vr(ge.ARBITRUM_SEPOLIA),vr(ge.BASE),vr(ge.BASE_SEPOLIA),vr(ge.HOMEVERSE),vr(ge.HOMEVERSE_TESTNET),vr(ge.XAI),vr(ge.XAI_SEPOLIA),vr(ge.AVALANCHE_TESTNET),vr(ge.XR_SEPOLIA),vr(ge.B3),vr(ge.B3_SEPOLIA),vr(ge.APECHAIN),vr(ge.APECHAIN_TESTNET),vr(ge.BLAST),vr(ge.BLAST_SEPOLIA),vr(ge.TELOS),vr(ge.BORNE_TESTNET),vr(ge.SKALE_NEBULA),vr(ge.SKALE_NEBULA_TESTNET),vr(ge.SONEIUM_MINATO),vr(ge.TOY_TESTNET),vr(ge.IMMUTABLE_ZKEVM),vr(ge.IMMUTABLE_ZKEVM_TESTNET),...l9e]),f9e=new Map([[1,"https://ethereum-rpc.publicnode.com"],[11155111,"https://ethereum-sepolia-rpc.publicnode.com"],[137,"https://polygon-bor-rpc.publicnode.com"],[80002,"https://rpc-amoy.polygon.technology"],[1101,"https://zkevm-rpc.com"],[56,"https://bsc-rpc.publicnode.com"],[97,"https://bsc-testnet-rpc.publicnode.com"],[10,"https://optimism-rpc.publicnode.com"],[11155420,"https://sepolia.optimism.io"],[42161,"https://arb1.arbitrum.io/rpc"],[421614,"https://sepolia-rollup.arbitrum.io/rpc"],[42170,"https://arbitrum-nova.publicnode.com"],[43114,"https://avalanche-c-chain-rpc.publicnode.com"],[43113,"https://avalanche-fuji-c-chain-rpc.publicnode.com"],[100,"https://gnosis-pokt.nodies.app"],[8453,"https://mainnet.base.org"],[84532,"https://base-sepolia-rpc.publicnode.com"],[19011,"https://rpc.mainnet.oasys.homeverse.games"],[40875,"https://rpc.testnet.oasys.homeverse.games"],[660279,"https://xai-chain.net/rpc"],[37714555429,"https://testnet-v2.xai-chain.net/rpc"],[3776,"https://rpc.startale.com/astar-zkevm"],[6038361,"https://rpc.startale.com/zkyoto"],[2730,"https://xr-sepolia-testnet.rpc.caldera.xyz/http"],[40,"https://mainnet-asia.telos.net/evm"]]),u9e=new Set([31337,31338]);class Np{constructor(e,r){de(this,"_observable");de(this,"key");this.def=r,this.key=e}get observable(){return this._observable===void 0&&(this._observable=Or(this.get()),window.addEventListener("storage",e=>{var r;e.key===this.key&&((r=this._observable)==null||r.set(this.get()))})),this._observable}get(){const e=window.localStorage.getItem(this.key);if(e===null)return this.def;try{return JSON.parse(e)}catch(r){console.error(r)}}set(e){var r;e!==void 0?window.localStorage.setItem(this.key,JSON.stringify(e)):window.localStorage.removeItem(this.key),(r=this._observable)==null||r.set(e)}del(){var e;window.localStorage.removeItem(this.key),(e=this._observable)==null||e.set(this.def)}}const d9e="0xa9e1f06cb24d160e02bd6ea84d6ffd0b3457b53d1177382eee85f4d8013419b8",_3=t=>{const e=new V5(d9e);return typeof t=="string"?new BF(e.connect(new Iy(t))):new BF(e.connect(t))};class Nn{constructor(e){de(this,"networks",Or([]));de(this,"editedNetworkChainIds",Or([]));de(this,"userAdditionNetworkChainIds",Or([]));de(this,"accountLoaded",Or(!1));de(this,"local",{networksUserEdits:new Np(dh.NETWORKS_USER_EDITS),networksUserAdditions:new Np(dh.NETWORKS_USER_ADDITIONS)});this.prepareNetworks(),this.accountLoaded.subscribe(r=>{r&&this.networks.get().length===0&&this.prepareNetworks()})}async prepareNetworks(){var n,i;const e=[],r=this.local.networksUserEdits.get();for(const[s,o]of Object.entries(_w)){if(u9e.has(Number(s))||o.deprecated)continue;const a=o,c=r==null?void 0:r.find(f=>f.chainId===a.chainId);if(c){c.relayer=_3(c.rpcUrl),e.push(c);continue}const l=f9e.get(Number(s));l?(a.rpcUrl=l,a.relayer=_3(l),e.push(a)):console.warn(`No RPC found for network ${o.name} - chain ID ${s}. You can ignore this warning if the network is deprecated.`)}(n=this.local.networksUserAdditions.get())==null||n.forEach(s=>{s.relayer=_3(s.rpcUrl),e.push(s)}),this.editedNetworkChainIds.set((r==null?void 0:r.map(s=>s.chainId))??[]),this.userAdditionNetworkChainIds.set(((i=this.local.networksUserAdditions.get())==null?void 0:i.map(s=>s.chainId))??[]),this.networks.set(e)}networkForChainId(e){return this.networks.get().find(r=>r.chainId===e)}providerForChainId(e){var i;const r=(i=this.networkForChainId(e))==null?void 0:i.rpcUrl;if(!r)throw new Error(`No network found for chainId ${e}`);const n=new Iy(r);if(!n)throw new Error(`No provider found for chainId ${e}`);return n}editNetwork(e){const r=this.local.networksUserEdits.get()??[];if(r.some(n=>n.chainId===e.chainId)){const n=r.map(i=>i.chainId!==e.chainId?i:e);this.local.networksUserEdits.set(n)}else r.push(e),this.local.networksUserEdits.set(r);this.prepareNetworks()}resetNetworkEdit(e){const r=this.local.networksUserEdits.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserEdits.set(n),this.prepareNetworks()}async addNetwork(e){const r=this.local.networksUserAdditions.get()??[];if(this.networks.get().some(i=>i.chainId===e.chainId))throw new Error(`Network with chainId ${e.chainId} already exists`);r.push(e),this.local.networksUserAdditions.set(r),this.prepareNetworks()}removeNetwork(e){const r=this.local.networksUserAdditions.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserAdditions.set(n),this.prepareNetworks()}clear(){this.local.networksUserAdditions.set([]),this.local.networksUserEdits.set([]),this.networks.set([]),this.editedNetworkChainIds.set([]),this.userAdditionNetworkChainIds.set([]),this.accountLoaded.set(!1)}}let hh=function(t){return t.UNKNOWN="UNKNOWN",t.NATIVE="NATIVE",t.ERC20="ERC20",t.ERC721="ERC721",t.ERC1155="ERC1155",t.SEQUENCE_WALLET="SEQUENCE_WALLET",t.ERC20_BRIDGE="ERC20_BRIDGE",t.ERC721_BRIDGE="ERC721_BRIDGE",t.ERC1155_BRIDGE="ERC1155_BRIDGE",t.SEQ_MARKETPLACE="SEQ_MARKETPLACE",t}({});const ky=t=>{const e=_w[t];return(e==null?void 0:e.title)??(e==null?void 0:e.name)??"Unknown"},Eu=bu,ml={chainId:ge.MAINNET,address:Eu,symbol:"ETH",name:"Ethereum",decimals:18,logoURI:"",type:"NATIVE",deployed:!0,bytecodeHash:"",extensions:{description:"Ethereum is a global, open-source platform for decentralized applications. In other words, the vision is to create a world computer that anyone can build applications in a decentralized manner; while all states and data are distributed and publicly accessible. Ethereum supports smart contracts in which developers can write code in order to program digital value. Examples of decentralized apps (dapps) that are built on Ethereum includes token, non-fungible tokens, decentralized finance apps, lending protocol, decentralized exchanges, and much more.",link:"https://ethereum.org/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},h9e={...ml,chainId:ge.SEPOLIA,symbol:"sETH",name:"Sepolia Ethereum"},fX={chainId:ge.POLYGON,address:Eu,symbol:"POL",name:"Polygon",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Polygon provides scalable, secure and instant Ethereum transactions.",link:"https://polygon.technology/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},p9e={chainId:ge.AVALANCHE,address:Eu,symbol:"AVAX",name:"AVAX",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Avalanche is a high throughput smart contract blockchain platform. Validators secure the network through a proof-of-stake consensus protocol. It is said to be fast, low cost, and environmental friendly.",link:"https://avax.network",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},v9e={chainId:ge.GNOSIS,address:Eu,symbol:"XDAI",name:"XDAI",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"xDai is the native stable token of the Gnosis chain blockchain. Each xDai token is worth ~ 1 US dollar.",link:"https://gnosischain.com",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},g9e={...fX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},uX={chainId:ge.BSC,address:Eu,name:"BNB",type:"NATIVE",symbol:"BNB",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.binance.com/",description:"BNB is the native asset on Binance Chain, a blockchain software system developed by Binance and the community. BNB has multiple forms of utility and powers the Binance Ecosystem as its underlying gas.",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},y9e={...uX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},dX={chainId:ge.XAI,address:Eu,symbol:"XAI",name:"XAI",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xai.games/",description:"XAI is the native asset on the XAI chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-02-28T20:00:00.000000000Z"},m9e={...dX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},hX={chainId:ge.HOMEVERSE,address:Eu,symbol:"OAS",name:"OAS",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.oasys.games/",description:"OAS is the native asset on the OASYS chain, its also the native asset on the HomeVerse chain",ogImage:"",originChainId:9372,originAddress:Eu,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},b9e={...hX,chainId:ge.HOMEVERSE_TESTNET,name:"Testnet OAS"},w9e={chainId:ge.XR_SEPOLIA,address:Eu,symbol:"tXR",name:"Sepolia XR",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xr-one.gitbook.io/xr",description:"tXR is the native asset on the XR sepolia chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-04-09T11:46:00.000000000Z"},x9e={[ge.MAINNET]:ml,[ge.SEPOLIA]:h9e,[ge.POLYGON]:fX,[ge.POLYGON_AMOY]:g9e,[ge.POLYGON_ZKEVM]:{...ml,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:uX,[ge.BSC_TESTNET]:y9e,[ge.AVALANCHE]:p9e,[ge.GNOSIS]:v9e,[ge.ARBITRUM]:{...ml,chainId:ge.ARBITRUM},[ge.ARBITRUM_NOVA]:{...ml,chainId:ge.ARBITRUM_NOVA},[ge.ARBITRUM_SEPOLIA]:{...ml,chainId:ge.ARBITRUM_SEPOLIA},[ge.OPTIMISM]:{...ml,chainId:ge.OPTIMISM},[ge.OPTIMISM_SEPOLIA]:{...ml,chainId:ge.OPTIMISM_SEPOLIA},[ge.BASE]:{...ml,chainId:ge.BASE},[ge.BASE_SEPOLIA]:{...ml,chainId:ge.BASE_SEPOLIA},[ge.XAI]:dX,[ge.XAI_SEPOLIA]:m9e,[ge.HOMEVERSE]:hX,[ge.HOMEVERSE_TESTNET]:b9e,[ge.XR_SEPOLIA]:w9e},E9e=t=>x9e[t]||null;function pX(t,e){e(t.get()),t.subscribe(e)}const jv=`[ + `;let I;for(;I=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:b}),redirect:"follow"}),I.status===429;)console.warn(`rate limited by arweave.net, trying again in ${l/1e3} seconds at ${new Date(Date.now()+l).toLocaleTimeString()}`),await new Promise(S=>setTimeout(S,l));const{data:{transactions:C}}=await I.json();g.push(...C.edges),y=C.pageInfo.hasNextPage}return Object.fromEntries(g.map(({node:{id:y,tags:b}})=>[y,Object.fromEntries(b.map(({name:I,value:C})=>[o&&I.startsWith(`${o}-`)?I.slice(o.length+1):I,C]))]))}async function E6(t,e=Fv.rateLimitRetryDelayMs){for(;;){const r=await fetch(`https://arweave.net/${t}`,{redirect:"follow"});if(r.status!==429)return r;console.warn(`rate limited by arweave.net, trying again in ${e/1e3} seconds at ${new Date(Date.now()+e).toLocaleTimeString()}`),await new Promise(n=>setTimeout(n,e))}}function G1(t){return typeof t=="string"?{nodeHash:t}:typeof t=="object"&&(t==null?void 0:t.node)!==void 0?{nodeHash:t.node}:t instanceof Array&&t.length===2?{left:G1(t[0]),right:G1(t[1])}:or.config.isNode(t)?{left:G1(t.left),right:G1(t.right)}:or.config.isNestedLeaf(t)?Gl({},t,{tree:G1(t.tree)}):t}var LAe=Object.freeze({__proto__:null,defaults:Fv,ArweaveReader:BAe});class FAe{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Ks(e,"? "),Ks(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Ks(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Ks(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Ks(e,"? "),Ks(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Ks(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Ks(e,"? "),Ks(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Ks(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Ks(e,"? "),Ks(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Ks({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Ks(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Ks({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Ks(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,ib,2).split(` +`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var jAe=Object.freeze({__proto__:null,DebugConfigTracker:FAe});class eX{constructor(){this.configs={},this.v2Nodes={},this.counterfactualWallets={},this.payloads={},this.signatures={},this.migrations={},this.loadConfig=e=>Promise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function jv(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=BigInt(n._hex):Array.isArray(n)?e[r]=n.map(i=>jv(i)):typeof n=="object"&&n!==null?e[r]=jv(n):e[r]=n}return e}class UAe{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>jv(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>jv(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>jv(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await RAe(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function tX(t){return t.left!==void 0&&t.right!==void 0}function rX(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function z_(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var $Ae=Object.freeze({__proto__:null,isPlainNode:tX,isPlainNested:rX,isPlainV2Config:z_,MemoryTrackerStore:eX,recreateBigNumbers:jv,IndexedDBStore:UAe});class Qk{constructor(e,r=new eX,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(tX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return rX(o)?{weight:BigInt(o.weight),threshold:BigInt(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(or.config.isNodeLeaf(s))return;const o=or.config.hashNode(s);if(or.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:or.config.hashNode(s.left),right:or.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(or.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:BigInt(s.weight).toString(),threshold:BigInt(s.threshold).toString(),tree:or.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(or.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(or.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(w0.config.ConfigCoder.isWalletConfig(o)){const a=w0.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(or.config.ConfigCoder.isWalletConfig(o)){const a=or.config.ConfigCoder.imageHashOf(o);if(or.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!z_(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(z_(a)){const c={version:2,threshold:BigInt(a.threshold),checkpoint:BigInt(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=_s.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const f=yt.context.addressOf(l,c);return i.store.saveCounterfactualWallet(f,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=yt.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=or.signature.SignatureCoder.decode(s.signature),a=_s.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=or.chained.messageSetImageHash(a),l=br(c),f={message:c,address:s.wallet,chainId:0,digest:l},u=i.savePayload({payload:f}),p=i.saveWalletConfig({config:s.nextConfig}),g=await or.signature.SignatureCoder.recover(o,f,i.provider),y=or.signature.signaturesOf(g.config.tree);await Promise.all([u,p,i.saveWalletConfig({config:g.config}),...y.map(b=>i.store.saveSignatureOfSubdigest(b.address,g.subdigest,b.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!or.config.ConfigCoder.isWalletConfig(l))return[];const f=or.config.signersOf(l.tree).map(O=>O.address),u=await Promise.all(f.map(O=>i.store.loadSubdigestsOfSigner(O))),p=[...new Set(u.flat())],y=(await Promise.all([...new Set(p)].map(async function(O){return Gl({},await i.payloadOfSubdigest({subdigest:O}),{subdigest:O})}))).filter(O=>(O==null?void 0:O.message)&&(O==null?void 0:O.address)&&O.address===o).map(O=>({payload:O,nextImageHash:or.chained.decodeMessageSetImageHash(O.message)})).filter(O=>O==null?void 0:O.nextImageHash);let b;const C=(await Promise.all(y.map(async function({nextImageHash:O,payload:L}){const F=await i.configOfImageHash({imageHash:O});if(!F||!or.config.isWalletConfig(F))return;const z=BigInt(F.checkpoint);return{nextConfig:F,nextCheckpoint:z,nextImageHash:O,payload:L}}))).filter(O=>O!==void 0).filter(O=>O.nextCheckpoint>BigInt(l.checkpoint)).sort((O,L)=>O.nextCheckpoint>L.nextCheckpoint?c?1:-1:c?-1:1);for(const O of C){const{nextConfig:L,nextCheckpoint:F,nextImageHash:z,payload:_}=O;if(b){const ce=b.checkpoint;if(c){if(F>=ce)continue}else if(F<=ce)continue}const $=new Map((await Promise.all(f.map(async function(ce){const K=await i.store.loadSignatureOfSubdigest(ce,_.subdigest);if(!K)return[ce,void 0];const P=Me(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(ce,_.subdigest,K):K),M=yt.signer.tryRecoverSigner(_.subdigest,P)!==ce;return[ce,{isDynamic:M,signature:P}]}))).filter(ce=>!!ce[1]));if($.size===0)continue;const ie=or.signature.SignatureCoder.encodeSigners(l,$,[],0);ie.weightyt.signer.canRecover(c)).map(c=>{const l=yt.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(f=>f!==void 0)),c=[];for(const l of a){const f=l.address;if(c.find(g=>g.wallet===f))continue;const u=yt.signature.subdigestOf(l),p=await i.store.loadSignatureOfSubdigest(s.signer,u);p&&c.push({wallet:f,proof:{digest:l.digest,chainId:BigInt(l.chainId),signature:Me(p)}})}return c},this.cachedEIP5719=new QZ(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!or.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=kCe.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(or.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=yt.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=br(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},f=yt.signature.subdigestOf(l),u=this.savePayload({payload:l}),p=this.saveWalletConfig({config:r.toConfig}),g=w0.signature.SignatureCoder.decode(r.tx.signature),y=await w0.signature.SignatureCoder.recover(g,l,this.provider),b=w0.signature.SignatureCoder.signaturesOf(y.config);await Promise.all([u,p,this.saveWalletConfig({config:y.config}),this.store.saveMigrationsSubdigest(e,i,i+1,f,s),...b.map(I=>this.store.saveSignatureOfSubdigest(I.address,y.subdigest,I.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=_s.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(f){const{subdigest:u,toImageHash:p}=f,g=await s.payloadOfSubdigest({subdigest:u});if(!g||!g.message||BigInt(i)!==BigInt(g.chainId))return;const y=c.config.signersOf(o).map(O=>O.address),b=new Map((await Promise.all(y.map(async function(O){const L=await s.store.loadSignatureOfSubdigest(O,u);if(!L)return[O,void 0];const F=Me(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(O,u,L):L),z=yt.signer.tryRecoverSigner(u,F)!==O;return[O,{isDynamic:z,signature:F}]}))).filter(O=>!!O[1])),I=c.signature.encodeSigners(o,b,[],i);if(!I||I.weightf.filter(u=>u!==void 0)))[0]}updateProvider(e){this.provider=e}}var qAe=Object.freeze({__proto__:null,LocalConfigTracker:Qk});let A9=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class VAe{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=(n,i)=>this.fetch(this.url("Ping"),gc({},n,i)).then(s=>yc(s).then(o=>({})),s=>{throw xo.new({cause:`fetch(): ${s.message||""}`})}),this.config=(n,i,s)=>this.fetch(this.url("Config"),gc(n,i,s)).then(o=>yc(o).then(a=>({version:a.version,config:a.config})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.wallets=(n,i,s)=>this.fetch(this.url("Wallets"),gc(n,i,s)).then(o=>yc(o).then(a=>({wallets:a.wallets})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.deployHash=(n,i,s)=>this.fetch(this.url("DeployHash"),gc(n,i,s)).then(o=>yc(o).then(a=>({deployHash:a.deployHash,context:a.context})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.configUpdates=(n,i,s)=>this.fetch(this.url("ConfigUpdates"),gc(n,i,s)).then(o=>yc(o).then(a=>({updates:a.updates})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.migrations=(n,i,s)=>this.fetch(this.url("Migrations"),gc(n,i,s)).then(o=>yc(o).then(a=>({migrations:a.migrations})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.saveConfig=(n,i,s)=>this.fetch(this.url("SaveConfig"),gc(n,i,s)).then(o=>yc(o).then(a=>({})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.saveWallet=(n,i,s)=>this.fetch(this.url("SaveWallet"),gc(n,i,s)).then(o=>yc(o).then(a=>({})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignature=(n,i,s)=>this.fetch(this.url("SaveSignature"),gc(n,i,s)).then(o=>yc(o).then(a=>({})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.saveSignerSignatures=(n,i,s)=>this.fetch(this.url("SaveSignerSignatures"),gc(n,i,s)).then(o=>yc(o).then(a=>({})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.saveMigration=(n,i,s)=>this.fetch(this.url("SaveMigration"),gc(n,i,s)).then(o=>yc(o).then(a=>({})),o=>{throw xo.new({cause:`fetch(): ${o.message||""}`})}),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const gc=(t={},e={},r=null)=>({method:"POST",headers:Gl({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{}),signal:r}),yc=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),eE.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(zAe[n]||js).new(r)}return r});class js extends Error{constructor(e,r,n,i,s){super(n),this.name=void 0,this.code=void 0,this.message=void 0,this.status=void 0,this.cause=void 0,this.msg=void 0,this.name=e||"WebrpcError",this.code=typeof r=="number"?r:0,this.message=n||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof i=="number"?i:0,this.cause=s,Object.setPrototypeOf(this,js.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}}class Jk extends js{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Jk.prototype)}}class xo extends js{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,xo.prototype)}}class Zk extends js{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Zk.prototype)}}class Xk extends js{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Xk.prototype)}}class eM extends js{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eM.prototype)}}class eE extends js{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eE.prototype)}}class tM extends js{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tM.prototype)}}class rM extends js{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.prototype)}}class nM extends js{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class iM extends js{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends js{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class oM extends js{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends js{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}const zAe={0:Jk,[-1]:xo,[-2]:Zk,[-3]:Xk,[-4]:eM,[-5]:eE,[-6]:tM,[-7]:rM,[-8]:nM,[-9]:iM,[-10]:sM,1:oM,2:aM};class HAe{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new VAe(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(S9(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=_s.genericCoderFor(r.version).config.imageHashOf(r),i=or.signature.setImageHashStruct(n),s=br(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:C6(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>yt.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:gv(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return GAe(r,n)}catch(r){if(S9(r))return;throw r}}async saveWalletConfig(e){const r=C6(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(S9(r))return;throw r}}async saveCounterfactualWallet(e){const r=C6(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case A9.EIP712:a+=Ya(yt.signer.SigType.EIP712).slice(2);break;case A9.EthSign:a+=Ya(yt.signer.SigType.ETH_SIGN).slice(2);break;case A9.EIP1271:a+=Ya(yt.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:BigInt(s)}}})}async getMigration(e,r,n,i){var s=this;const o=gv(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(u){const p=a[u];if(p){const g=Object.keys(p).map(Number).sort((y,b)=>b-y);for(const y of g)for(const[b,I]of Object.entries(p[y]))try{const C=await s.configOfImageHash({imageHash:b});if(C)return{fromVersion:n,toVersion:y,toConfig:C,tx:{entrypoint:I.executor,transactions:I.transactions,nonce:I.nonce,signature:I.signature,chainId:u,intent:{id:yt.transaction.subdigestOfTransactions(e,u,I.nonce,I.transactions),wallet:e}}}}catch(C){console.error(C)}}},l=await c(o);if(l)return l;for(const f in a)if(f!==o){const u=await c(f);if(u)return u}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:C6(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(WAe),nonce:gv(r.tx.nonce),signature:r.tx.signature,chainID:gv(r.tx.chainId)})}}function C6(t){switch(t.version){case 1:if(w0.config.ConfigCoder.isWalletConfig(t))return{threshold:D0(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:D0(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(or.config.ConfigCoder.isWalletConfig(t))return{threshold:D0(t.threshold),checkpoint:D0(t.checkpoint),tree:b3(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function b3(t){return or.config.isNode(t)?{left:b3(t.left),right:b3(t.right)}:or.config.isSignerLeaf(t)?{weight:D0(t.weight),address:t.address}:or.config.isNestedLeaf(t)?{weight:D0(t.weight),threshold:D0(t.threshold),tree:b3(t.tree)}:or.config.isNodeLeaf(t)?{node:t.nodeHash}:Gl({},t)}function GAe(t,e){switch(t){case 1:return Gl({},e,{version:t});case 2:return Gl({},e,{version:t,tree:w3(e.tree)});default:throw new Error(`unknown version ${t}`)}}function w3(t){switch(typeof t){case"object":const e=Gl({},t);return e.left!==void 0&&(e.left=w3(e.left)),e.right!==void 0&&(e.right=w3(e.right)),e.tree!==void 0&&(e.tree=w3(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function WAe(t){return{to:t.to,value:t.value!==void 0?gv(t.value):void 0,data:t.data!==void 0?Me(t.data):void 0,gasLimit:t.gasLimit!==void 0?gv(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function D0(t){return Number(t)}function gv(t){return BigInt(t).toString()}function S9(t){return typeof t=="object"&&t.status===404}var KAe=Object.freeze({__proto__:null,RemoteConfigTracker:HAe});function H_(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function sb(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class YAe{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await H_(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:_s.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new Qk(void 0),s=await sb(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await H_(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await sb(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const f=`${o}-${a}-${c}`;let u=s.get(f);u||(u={wallet:o,digest:a,chainId:c,signatures:[]},s.set(f,u)),u.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await sb(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await sb(n.map(async function(c){const l=c[c.length-1],f=await r.configOfImageHash({imageHash:l.nextImageHash});if(f)return{checkpoint:_s.genericCoderFor(f.version).config.checkpointOf(f),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint>c.checkpoint)?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class QAe{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthu&&(!f||u.checkpoint>f.checkpoint)?u:f))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class QF{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Do(JSON.stringify(i,JAe))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function JAe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):typeof e=="bigint"?e.toString():e}function ZAe(t){return t instanceof nX}class nX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new QF}invalidateCache(){this.cache=new QF}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof Qk&&this.tracker.updateProvider(e)}}var iX=Object.freeze({__proto__:null,arweave:LAe,debug:jAe,local:qAe,remote:KAe,stores:$Ae,raceUntil:H_,allSafe:sb,MultipleTracker:YAe,CachedTracker:QAe,isDedupedTracker:ZAe,DedupedTracker:nX});const G_=new iX.arweave.ArweaveReader({graphqlUrl:"https://arweave-search.goldsky.com/graphql"});var fh=(t=>(t.NETWORKS_USER_EDITS="@sequence-recovery.networks-user-edits",t.NETWORKS_USER_ADDITIONS="@sequence-recovery.networks-user-additions",t.TOKENS_USER_ADDITIONS="@sequence-recovery.tokens-user-additions",t.COLLECTIBLES="@sequence-recovery.collectibles",t.GATEWAY_ADDRESS="@sequence-recovery.gateway-address",t.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO="@sequence-recovery.last-connected-external-provider-info",t.DEFAULT_NETWORK="@sequence-recovery.default-network",t))(fh||{}),ul=(t=>(t.SECURITY="security",t))(ul||{});const JF="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",sX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:JF},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:JF}},oX="95777495732e7317ec3fd92b88a1b19c";let ge=function(t){return t[t.MAINNET=1]="MAINNET",t[t.ROPSTEN=3]="ROPSTEN",t[t.RINKEBY=4]="RINKEBY",t[t.GOERLI=5]="GOERLI",t[t.KOVAN=42]="KOVAN",t[t.SEPOLIA=11155111]="SEPOLIA",t[t.POLYGON=137]="POLYGON",t[t.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",t[t.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",t[t.POLYGON_AMOY=80002]="POLYGON_AMOY",t[t.BSC=56]="BSC",t[t.BSC_TESTNET=97]="BSC_TESTNET",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_KOVAN=69]="OPTIMISM_KOVAN",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.OPTIMISM_SEPOLIA=11155420]="OPTIMISM_SEPOLIA",t[t.ARBITRUM=42161]="ARBITRUM",t[t.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",t[t.ARBITRUM_SEPOLIA=421614]="ARBITRUM_SEPOLIA",t[t.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",t[t.AVALANCHE=43114]="AVALANCHE",t[t.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",t[t.GNOSIS=100]="GNOSIS",t[t.BASE=8453]="BASE",t[t.BASE_GOERLI=84531]="BASE_GOERLI",t[t.BASE_SEPOLIA=84532]="BASE_SEPOLIA",t[t.HOMEVERSE_TESTNET=40875]="HOMEVERSE_TESTNET",t[t.HOMEVERSE=19011]="HOMEVERSE",t[t.XAI=660279]="XAI",t[t.XAI_SEPOLIA=37714555429]="XAI_SEPOLIA",t[t.XR_SEPOLIA=2730]="XR_SEPOLIA",t[t.TELOS=40]="TELOS",t[t.B3=8333]="B3",t[t.B3_SEPOLIA=1993]="B3_SEPOLIA",t[t.APECHAIN=33139]="APECHAIN",t[t.APECHAIN_TESTNET=33111]="APECHAIN_TESTNET",t[t.BLAST=81457]="BLAST",t[t.BLAST_SEPOLIA=168587773]="BLAST_SEPOLIA",t[t.BORNE_TESTNET=94984]="BORNE_TESTNET",t[t.SKALE_NEBULA=1482601649]="SKALE_NEBULA",t[t.SKALE_NEBULA_TESTNET=37084624]="SKALE_NEBULA_TESTNET",t[t.SONEIUM_MINATO=1946]="SONEIUM_MINATO",t[t.TOY_TESTNET=21e6]="TOY_TESTNET",t[t.IMMUTABLE_ZKEVM=13371]="IMMUTABLE_ZKEVM",t[t.IMMUTABLE_ZKEVM_TESTNET=13473]="IMMUTABLE_ZKEVM_TESTNET",t[t.HARDHAT=31337]="HARDHAT",t[t.HARDHAT_2=31338]="HARDHAT_2",t}({}),Ft=function(t){return t.MAINNET="mainnet",t.TESTNET="testnet",t}({});const Sw={[ge.MAINNET]:{chainId:ge.MAINNET,type:Ft.MAINNET,name:"mainnet",title:"Ethereum",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.MAINNET}.webp`,blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[ge.ROPSTEN]:{chainId:ge.ROPSTEN,type:Ft.TESTNET,name:"ropsten",title:"Ropsten",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ROPSTEN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},nativeToken:{symbol:"roETH",name:"Ropsten Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.RINKEBY]:{chainId:ge.RINKEBY,type:Ft.TESTNET,name:"rinkeby",title:"Rinkeby",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.RINKEBY}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},nativeToken:{symbol:"rETH",name:"Rinkeby Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.GOERLI]:{chainId:ge.GOERLI,type:Ft.TESTNET,name:"goerli",title:"Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",deprecated:!0},[ge.KOVAN]:{chainId:ge.KOVAN,type:Ft.TESTNET,name:"kovan",title:"Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"},nativeToken:{symbol:"kETH",name:"Kovan Ether",decimals:18},deprecated:!0},[ge.SEPOLIA]:{chainId:ge.SEPOLIA,type:Ft.TESTNET,name:"sepolia",title:"Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Sepolia)",rootUrl:"https://sepolia.etherscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.POLYGON]:{chainId:ge.POLYGON,type:Ft.MAINNET,name:"polygon",title:"Polygon",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON}.webp`,blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"},nativeToken:{symbol:"POL",name:"POL",decimals:18}},[ge.POLYGON_MUMBAI]:{chainId:ge.POLYGON_MUMBAI,type:Ft.TESTNET,name:"mumbai",title:"Polygon Mumbai",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_MUMBAI}.webp`,testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"},nativeToken:{symbol:"mMATIC",name:"Mumbai Polygon",decimals:18},deprecated:!0},[ge.POLYGON_AMOY]:{chainId:ge.POLYGON_AMOY,type:Ft.TESTNET,name:"amoy",title:"Polygon Amoy",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_AMOY}.webp`,testnet:!0,blockExplorer:{name:"OKLink (Amoy)",rootUrl:"https://www.oklink.com/amoy/"},nativeToken:{symbol:"aPOL",name:"Amoy POL",decimals:18}},[ge.POLYGON_ZKEVM]:{chainId:ge.POLYGON_ZKEVM,type:Ft.MAINNET,name:"polygon-zkevm",title:"Polygon zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.POLYGON_ZKEVM}.webp`,blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BSC]:{chainId:ge.BSC,type:Ft.MAINNET,name:"bsc",title:"BNB Smart Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BSC}.webp`,blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"},nativeToken:{symbol:"BNB",name:"BNB",decimals:18}},[ge.BSC_TESTNET]:{chainId:ge.BSC_TESTNET,type:Ft.TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BSC_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"},nativeToken:{symbol:"tBNB",name:"Testnet BNB",decimals:18}},[ge.OPTIMISM]:{chainId:ge.OPTIMISM,type:Ft.MAINNET,name:"optimism",title:"Optimism",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM}.webp`,blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.OPTIMISM_KOVAN]:{chainId:ge.OPTIMISM_KOVAN,type:Ft.TESTNET,name:"optimism-kovan",title:"Optimism Kovan",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_KOVAN}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Kovan)",rootUrl:"https://kovan-optimistic.etherscan.io/"},nativeToken:{symbol:"kETH",name:"Kovan Ether",decimals:18},deprecated:!0},[ge.OPTIMISM_GOERLI]:{chainId:ge.OPTIMISM_GOERLI,type:Ft.TESTNET,name:"optimism-goerli",title:"Optimism Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Goerli)",rootUrl:"https://goerli-optimistic.etherscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.OPTIMISM_SEPOLIA]:{chainId:ge.OPTIMISM_SEPOLIA,type:Ft.TESTNET,name:"optimism-sepolia",title:"Optimism Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.OPTIMISM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Etherscan (Optimism Sepolia)",rootUrl:"https://sepolia-optimistic.etherscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.ARBITRUM]:{chainId:ge.ARBITRUM,type:Ft.MAINNET,name:"arbitrum",title:"Arbitrum One",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM}.webp`,blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.ARBITRUM_GOERLI]:{chainId:ge.ARBITRUM_GOERLI,type:Ft.TESTNET,name:"arbitrum-goerli",title:"Arbitrum Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Goerli Testnet)",rootUrl:"https://testnet.arbiscan.io/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.ARBITRUM_SEPOLIA]:{chainId:ge.ARBITRUM_SEPOLIA,type:Ft.TESTNET,name:"arbitrum-sepolia",title:"Arbitrum Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Arbiscan (Sepolia Testnet)",rootUrl:"https://sepolia.arbiscan.io/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.ARBITRUM_NOVA]:{chainId:ge.ARBITRUM_NOVA,type:Ft.MAINNET,name:"arbitrum-nova",title:"Arbitrum Nova",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.ARBITRUM_NOVA}.webp`,blockExplorer:{name:"Arbiscan Nova",rootUrl:"https://nova.arbiscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.AVALANCHE]:{chainId:ge.AVALANCHE,type:Ft.MAINNET,name:"avalanche",title:"Avalanche",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.AVALANCHE}.webp`,blockExplorer:{name:"Snowtrace",rootUrl:"https://subnets.avax.network/c-chain/"},nativeToken:{symbol:"AVAX",name:"AVAX",decimals:18}},[ge.AVALANCHE_TESTNET]:{chainId:ge.AVALANCHE_TESTNET,type:Ft.TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.AVALANCHE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://subnets-test.avax.network/c-chain/"},nativeToken:{symbol:"tAVAX",name:"Testnet AVAX",decimals:18}},[ge.GNOSIS]:{chainId:ge.GNOSIS,type:Ft.MAINNET,name:"gnosis",title:"Gnosis Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.GNOSIS}.webp`,blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"},nativeToken:{symbol:"XDAI",name:"XDAI",decimals:18}},[ge.BASE]:{chainId:ge.BASE,type:Ft.MAINNET,name:"base",title:"Base (Coinbase)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE}.webp`,blockExplorer:{name:"Base Explorer",rootUrl:"https://basescan.org/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BASE_GOERLI]:{chainId:ge.BASE_GOERLI,type:Ft.TESTNET,name:"base-goerli",title:"Base Goerli",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE_GOERLI}.webp`,testnet:!0,blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"},nativeToken:{symbol:"gETH",name:"Goerli Ether",decimals:18},deprecated:!0},[ge.BASE_SEPOLIA]:{chainId:ge.BASE_SEPOLIA,type:Ft.TESTNET,name:"base-sepolia",title:"Base Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BASE_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Base Sepolia Explorer",rootUrl:"https://base-sepolia.blockscout.com/"},nativeToken:{symbol:"sETH",name:"Sepolia Ether",decimals:18}},[ge.HOMEVERSE]:{chainId:ge.HOMEVERSE,type:Ft.MAINNET,name:"homeverse",title:"Oasys Homeverse",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.HOMEVERSE}.webp`,blockExplorer:{name:"Oasys Homeverse Explorer",rootUrl:"https://explorer.oasys.homeverse.games/"},nativeToken:{symbol:"OAS",name:"OAS",decimals:18}},[ge.HOMEVERSE_TESTNET]:{chainId:ge.HOMEVERSE_TESTNET,type:Ft.TESTNET,name:"homeverse-testnet",title:"Oasys Homeverse Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.HOMEVERSE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Oasys Homeverse Explorer (Testnet)",rootUrl:"https://explorer.testnet.oasys.homeverse.games/"},nativeToken:{symbol:"tOAS",name:"Testnet OAS",decimals:18}},[ge.XAI]:{chainId:ge.XAI,type:Ft.MAINNET,name:"xai",title:"Xai",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XAI}.webp`,blockExplorer:{name:"Xai Explorer",rootUrl:"https://explorer.xai-chain.net/"},nativeToken:{symbol:"XAI",name:"XAI",decimals:18}},[ge.XAI_SEPOLIA]:{chainId:ge.XAI_SEPOLIA,type:Ft.TESTNET,name:"xai-sepolia",title:"Xai Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XAI_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Xai Sepolia Explorer",rootUrl:"https://testnet-explorer-v2.xai-chain.net/"},nativeToken:{symbol:"sXAI",name:"Sepolia XAI",decimals:18}},[ge.XR_SEPOLIA]:{chainId:ge.XR_SEPOLIA,type:Ft.TESTNET,name:"xr-sepolia",title:"XR Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.XR_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"XR Sepolia Explorer",rootUrl:"https://xr-sepolia-testnet.explorer.caldera.xyz/"},nativeToken:{symbol:"tXR",name:"Sepolia XR",decimals:18}},[ge.B3]:{chainId:ge.B3,type:Ft.MAINNET,name:"b3",title:"B3",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.B3}.webp`,testnet:!1,blockExplorer:{name:"B3 Explorer",rootUrl:"https://explorer.b3.fun/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.B3_SEPOLIA]:{chainId:ge.B3_SEPOLIA,type:Ft.TESTNET,name:"b3-sepolia",title:"B3 Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.B3_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"B3 Sepolia Explorer",rootUrl:"https://sepolia.explorer.b3.fun/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.APECHAIN]:{chainId:ge.APECHAIN,type:Ft.MAINNET,name:"apechain",title:"APE Chain",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.APECHAIN}.webp`,testnet:!1,blockExplorer:{name:"APE Chain Explorer",rootUrl:"https://apechain.calderaexplorer.xyz/"},nativeToken:{symbol:"APE",name:"ApeCoin",decimals:18}},[ge.APECHAIN_TESTNET]:{chainId:ge.APECHAIN_TESTNET,type:Ft.TESTNET,name:"apechain-testnet",title:"APE Chain Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.APECHAIN_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"APE Chain Explorer",rootUrl:"https://curtis.explorer.caldera.xyz/"},nativeToken:{symbol:"APE",name:"ApeCoin",decimals:18}},[ge.BLAST]:{chainId:ge.BLAST,type:Ft.MAINNET,name:"blast",title:"Blast",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BLAST}.webp`,blockExplorer:{name:"Blast Explorer",rootUrl:"https://blastscan.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.BLAST_SEPOLIA]:{chainId:ge.BLAST_SEPOLIA,type:Ft.TESTNET,name:"blast-sepolia",title:"Blast Sepolia",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BLAST_SEPOLIA}.webp`,testnet:!0,blockExplorer:{name:"Blast Sepolia Explorer",rootUrl:"https://sepolia.blastexplorer.io/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.TELOS]:{chainId:ge.TELOS,type:Ft.MAINNET,name:"telos",title:"Telos",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.TELOS}.webp`,blockExplorer:{name:"Telos Explorer",rootUrl:"https://explorer.telos.net/network/"},nativeToken:{symbol:"TLOS",name:"TLOS",decimals:18}},[ge.BORNE_TESTNET]:{chainId:ge.BORNE_TESTNET,type:Ft.TESTNET,name:"borne-testnet",title:"Borne Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.BORNE_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Borne Testnet Explorer",rootUrl:"https://subnets-test.avax.network/bornegfdn"},nativeToken:{symbol:"BORNE",name:"BORNE",decimals:18}},[ge.SKALE_NEBULA]:{chainId:ge.SKALE_NEBULA,type:Ft.MAINNET,name:"skale-nebula",title:"SKALE Nebula Gaming Hub",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SKALE_NEBULA}.webp`,testnet:!1,blockExplorer:{name:"SKALE Nebula Gaming Hub Explorer",rootUrl:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com/"},nativeToken:{symbol:"sFUEL",name:"SKALE Fuel",decimals:18}},[ge.SKALE_NEBULA_TESTNET]:{chainId:ge.SKALE_NEBULA_TESTNET,type:Ft.TESTNET,name:"skale-nebula-testnet",title:"SKALE Nebula Gaming Hub Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SKALE_NEBULA_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"SKALE Nebula Gaming Hub Testnet Explorer",rootUrl:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com/"},nativeToken:{symbol:"sFUEL",name:"SKALE Fuel",decimals:18}},[ge.SONEIUM_MINATO]:{chainId:ge.SONEIUM_MINATO,type:Ft.TESTNET,name:"soneium-minato",title:"Soneium Minato (Testnet)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.SONEIUM_MINATO}.webp`,testnet:!0,blockExplorer:{name:"Soneium Minato Explorer",rootUrl:"https://explorer-testnet.soneium.org/"},nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.TOY_TESTNET]:{chainId:ge.TOY_TESTNET,type:Ft.TESTNET,name:"toy-testnet",title:"TOY (Testnet)",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.TOY_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"TOY Testnet Explorer",rootUrl:"https://toy-chain-testnet.explorer.caldera.xyz/"},nativeToken:{symbol:"TOY",name:"TOY",decimals:18}},[ge.IMMUTABLE_ZKEVM]:{chainId:ge.IMMUTABLE_ZKEVM,type:Ft.MAINNET,name:"immutable-zkevm",title:"Immutable zkEVM",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.IMMUTABLE_ZKEVM}.webp`,testnet:!1,blockExplorer:{name:"Immutable zkEVM Explorer",rootUrl:"https://explorer.immutable.com/"},nativeToken:{symbol:"IMX",name:"IMX",decimals:18}},[ge.IMMUTABLE_ZKEVM_TESTNET]:{chainId:ge.IMMUTABLE_ZKEVM_TESTNET,type:Ft.TESTNET,name:"immutable-zkevm-testnet",title:"Immutable zkEVM Testnet",logoURI:`https://assets.sequence.info/images/networks/medium/${ge.IMMUTABLE_ZKEVM_TESTNET}.webp`,testnet:!0,blockExplorer:{name:"Immutable zkEVM Testnet Explorer",rootUrl:"https://explorer.testnet.immutable.com/"},nativeToken:{symbol:"IMX",name:"IMX",decimals:18}},[ge.HARDHAT]:{chainId:ge.HARDHAT,name:"hardhat",title:"Hardhat (local testnet)",nativeToken:{symbol:"ETH",name:"Ether",decimals:18}},[ge.HARDHAT_2]:{chainId:ge.HARDHAT_2,name:"hardhat2",title:"Hardhat (local testnet)",nativeToken:{symbol:"ETH",name:"Ether",decimals:18}}};function sy(){return sy=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:Number(t),e9e=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,f)=>i.indexOf(l)!==f);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,f)=>o.indexOf(l)!==f);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(e9e(t,!0,e),t),r9e=t=>t9e(n9e(t)),_w=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=Number(e);return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(typeof e=="bigint"){const r=Number(e);return t.find(n=>n.chainId===r)}else return}},n9e=t=>{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},cM=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",i9e=t=>cM("https://${network}-indexer.sequence.app",{network:t}),s9e=t=>cM("https://${network}-relayer.sequence.app",{network:t}),o9e=t=>cM("https://nodes.sequence.app/${network}",{network:t});function a9e(t){return _w(lM,t)}function c9e(t){return typeof t=="bigint"?t:REe(t)?BigInt(t):BigInt(t.chainId)}const mr=(t,e)=>{const r=Sw[t];if(!r)throw new Error(`Network with chainId ${t} not found`);const n=o9e(r.name);return sy({},r,{rpcUrl:n,indexerUrl:i9e(r.name),relayer:{url:s9e(r.name),provider:{url:n}}},e)},l9e=[sy({},Sw[ge.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),sy({},Sw[ge.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})],lM=r9e([sy({},mr(ge.POLYGON),{isDefaultChain:!0,isAuthChain:!0}),mr(ge.MAINNET),mr(ge.BSC),mr(ge.AVALANCHE),mr(ge.ARBITRUM),mr(ge.ARBITRUM_NOVA),mr(ge.OPTIMISM),mr(ge.OPTIMISM_SEPOLIA),mr(ge.POLYGON_ZKEVM),mr(ge.GNOSIS),mr(ge.RINKEBY,{disabled:!0}),mr(ge.GOERLI,{disabled:!0}),mr(ge.SEPOLIA),mr(ge.POLYGON_MUMBAI,{disabled:!0}),mr(ge.POLYGON_AMOY),mr(ge.BSC_TESTNET),mr(ge.ARBITRUM_SEPOLIA),mr(ge.BASE),mr(ge.BASE_SEPOLIA),mr(ge.HOMEVERSE),mr(ge.HOMEVERSE_TESTNET),mr(ge.XAI),mr(ge.XAI_SEPOLIA),mr(ge.AVALANCHE_TESTNET),mr(ge.XR_SEPOLIA),mr(ge.B3),mr(ge.B3_SEPOLIA),mr(ge.APECHAIN),mr(ge.APECHAIN_TESTNET),mr(ge.BLAST),mr(ge.BLAST_SEPOLIA),mr(ge.TELOS),mr(ge.BORNE_TESTNET),mr(ge.SKALE_NEBULA),mr(ge.SKALE_NEBULA_TESTNET),mr(ge.SONEIUM_MINATO),mr(ge.TOY_TESTNET),mr(ge.IMMUTABLE_ZKEVM),mr(ge.IMMUTABLE_ZKEVM_TESTNET),...l9e]),f9e=new Map([[1,"https://ethereum-rpc.publicnode.com"],[11155111,"https://ethereum-sepolia-rpc.publicnode.com"],[137,"https://polygon-bor-rpc.publicnode.com"],[80002,"https://rpc-amoy.polygon.technology"],[1101,"https://zkevm-rpc.com"],[56,"https://bsc-rpc.publicnode.com"],[97,"https://bsc-testnet-rpc.publicnode.com"],[10,"https://optimism-rpc.publicnode.com"],[11155420,"https://sepolia.optimism.io"],[42161,"https://arb1.arbitrum.io/rpc"],[421614,"https://sepolia-rollup.arbitrum.io/rpc"],[42170,"https://arbitrum-nova.publicnode.com"],[43114,"https://avalanche-c-chain-rpc.publicnode.com"],[43113,"https://avalanche-fuji-c-chain-rpc.publicnode.com"],[100,"https://gnosis-pokt.nodies.app"],[8453,"https://mainnet.base.org"],[84532,"https://base-sepolia-rpc.publicnode.com"],[19011,"https://rpc.mainnet.oasys.homeverse.games"],[40875,"https://rpc.testnet.oasys.homeverse.games"],[660279,"https://xai-chain.net/rpc"],[37714555429,"https://testnet-v2.xai-chain.net/rpc"],[3776,"https://rpc.startale.com/astar-zkevm"],[6038361,"https://rpc.startale.com/zkyoto"],[2730,"https://xr-sepolia-testnet.rpc.caldera.xyz/http"],[40,"https://mainnet-asia.telos.net/evm"]]),u9e=new Set([31337,31338]);class Np{constructor(e,r){de(this,"_observable");de(this,"key");this.def=r,this.key=e}get observable(){return this._observable===void 0&&(this._observable=Nr(this.get()),window.addEventListener("storage",e=>{var r;e.key===this.key&&((r=this._observable)==null||r.set(this.get()))})),this._observable}get(){const e=window.localStorage.getItem(this.key);if(e===null)return this.def;try{return JSON.parse(e)}catch(r){console.error(r)}}set(e){var r;e!==void 0?window.localStorage.setItem(this.key,JSON.stringify(e)):window.localStorage.removeItem(this.key),(r=this._observable)==null||r.set(e)}del(){var e;window.localStorage.removeItem(this.key),(e=this._observable)==null||e.set(this.def)}}const d9e="0xa9e1f06cb24d160e02bd6ea84d6ffd0b3457b53d1177382eee85f4d8013419b8",x3=t=>{const e=new F5(d9e);return typeof t=="string"?new OF(e.connect(new Ty(t))):new OF(e.connect(t))};class Bn{constructor(e){de(this,"networks",Nr([]));de(this,"editedNetworkChainIds",Nr([]));de(this,"userAdditionNetworkChainIds",Nr([]));de(this,"accountLoaded",Nr(!1));de(this,"local",{networksUserEdits:new Np(fh.NETWORKS_USER_EDITS),networksUserAdditions:new Np(fh.NETWORKS_USER_ADDITIONS)});this.prepareNetworks(),this.accountLoaded.subscribe(r=>{r&&this.networks.get().length===0&&this.prepareNetworks()})}async prepareNetworks(){var n,i;const e=[],r=this.local.networksUserEdits.get();for(const[s,o]of Object.entries(Sw)){if(u9e.has(Number(s))||o.deprecated)continue;const a=o,c=r==null?void 0:r.find(f=>f.chainId===a.chainId);if(c){c.relayer=x3(c.rpcUrl),e.push(c);continue}const l=f9e.get(Number(s));l?(a.rpcUrl=l,a.relayer=x3(l),e.push(a)):console.warn(`No RPC found for network ${o.name} - chain ID ${s}. You can ignore this warning if the network is deprecated.`)}(n=this.local.networksUserAdditions.get())==null||n.forEach(s=>{s.relayer=x3(s.rpcUrl),e.push(s)}),this.editedNetworkChainIds.set((r==null?void 0:r.map(s=>s.chainId))??[]),this.userAdditionNetworkChainIds.set(((i=this.local.networksUserAdditions.get())==null?void 0:i.map(s=>s.chainId))??[]),this.networks.set(e)}networkForChainId(e){return this.networks.get().find(r=>r.chainId===e)}providerForChainId(e){var i;const r=(i=this.networkForChainId(e))==null?void 0:i.rpcUrl;if(!r)throw new Error(`No network found for chainId ${e}`);const n=new Ty(r);if(!n)throw new Error(`No provider found for chainId ${e}`);return n}editNetwork(e){const r=this.local.networksUserEdits.get()??[];if(r.some(n=>n.chainId===e.chainId)){const n=r.map(i=>i.chainId!==e.chainId?i:e);this.local.networksUserEdits.set(n)}else r.push(e),this.local.networksUserEdits.set(r);this.prepareNetworks()}resetNetworkEdit(e){const r=this.local.networksUserEdits.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserEdits.set(n),this.prepareNetworks()}async addNetwork(e){const r=this.local.networksUserAdditions.get()??[];if(this.networks.get().some(i=>i.chainId===e.chainId))throw new Error(`Network with chainId ${e.chainId} already exists`);r.push(e),this.local.networksUserAdditions.set(r),this.prepareNetworks()}removeNetwork(e){const r=this.local.networksUserAdditions.get(),n=r==null?void 0:r.filter(i=>i.chainId!==e);this.local.networksUserAdditions.set(n),this.prepareNetworks()}clear(){this.local.networksUserAdditions.set([]),this.local.networksUserEdits.set([]),this.networks.set([]),this.editedNetworkChainIds.set([]),this.userAdditionNetworkChainIds.set([]),this.accountLoaded.set(!1)}}let uh=function(t){return t.UNKNOWN="UNKNOWN",t.NATIVE="NATIVE",t.ERC20="ERC20",t.ERC721="ERC721",t.ERC1155="ERC1155",t.SEQUENCE_WALLET="SEQUENCE_WALLET",t.ERC20_BRIDGE="ERC20_BRIDGE",t.ERC721_BRIDGE="ERC721_BRIDGE",t.ERC1155_BRIDGE="ERC1155_BRIDGE",t.SEQ_MARKETPLACE="SEQ_MARKETPLACE",t}({});const My=t=>{const e=Sw[t];return(e==null?void 0:e.title)??(e==null?void 0:e.name)??"Unknown"},xu=mu,dl={chainId:ge.MAINNET,address:xu,symbol:"ETH",name:"Ethereum",decimals:18,logoURI:"",type:"NATIVE",deployed:!0,bytecodeHash:"",extensions:{description:"Ethereum is a global, open-source platform for decentralized applications. In other words, the vision is to create a world computer that anyone can build applications in a decentralized manner; while all states and data are distributed and publicly accessible. Ethereum supports smart contracts in which developers can write code in order to program digital value. Examples of decentralized apps (dapps) that are built on Ethereum includes token, non-fungible tokens, decentralized finance apps, lending protocol, decentralized exchanges, and much more.",link:"https://ethereum.org/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},h9e={...dl,chainId:ge.SEPOLIA,symbol:"sETH",name:"Sepolia Ethereum"},aX={chainId:ge.POLYGON,address:xu,symbol:"POL",name:"Polygon",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Polygon provides scalable, secure and instant Ethereum transactions.",link:"https://polygon.technology/",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},p9e={chainId:ge.AVALANCHE,address:xu,symbol:"AVAX",name:"AVAX",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"Avalanche is a high throughput smart contract blockchain platform. Validators secure the network through a proof-of-stake consensus protocol. It is said to be fast, low cost, and environmental friendly.",link:"https://avax.network",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},v9e={chainId:ge.GNOSIS,address:xu,symbol:"XDAI",name:"XDAI",decimals:18,type:"NATIVE",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{description:"xDai is the native stable token of the Gnosis chain blockchain. Each xDai token is worth ~ 1 US dollar.",link:"https://gnosischain.com",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},g9e={...aX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},cX={chainId:ge.BSC,address:xu,name:"BNB",type:"NATIVE",symbol:"BNB",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.binance.com/",description:"BNB is the native asset on Binance Chain, a blockchain software system developed by Binance and the community. BNB has multiple forms of utility and powers the Binance Ecosystem as its underlying gas.",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},y9e={...cX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},lX={chainId:ge.XAI,address:xu,symbol:"XAI",name:"XAI",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xai.games/",description:"XAI is the native asset on the XAI chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-02-28T20:00:00.000000000Z"},m9e={...lX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},fX={chainId:ge.HOMEVERSE,address:xu,symbol:"OAS",name:"OAS",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://www.oasys.games/",description:"OAS is the native asset on the OASYS chain, its also the native asset on the HomeVerse chain",ogImage:"",originChainId:9372,originAddress:xu,blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2023-11-20T20:00:00.000000000Z"},b9e={...fX,chainId:ge.HOMEVERSE_TESTNET,name:"Testnet OAS"},w9e={chainId:ge.XR_SEPOLIA,address:xu,symbol:"tXR",name:"Sepolia XR",type:"NATIVE",decimals:18,logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"https://xr-one.gitbook.io/xr",description:"tXR is the native asset on the XR sepolia chain",ogImage:"",originChainId:0,originAddress:"",blacklist:!1,verified:!0,verifiedBy:"Sequence",featured:!1},updatedAt:"2024-04-09T11:46:00.000000000Z"},x9e={[ge.MAINNET]:dl,[ge.SEPOLIA]:h9e,[ge.POLYGON]:aX,[ge.POLYGON_AMOY]:g9e,[ge.POLYGON_ZKEVM]:{...dl,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:cX,[ge.BSC_TESTNET]:y9e,[ge.AVALANCHE]:p9e,[ge.GNOSIS]:v9e,[ge.ARBITRUM]:{...dl,chainId:ge.ARBITRUM},[ge.ARBITRUM_NOVA]:{...dl,chainId:ge.ARBITRUM_NOVA},[ge.ARBITRUM_SEPOLIA]:{...dl,chainId:ge.ARBITRUM_SEPOLIA},[ge.OPTIMISM]:{...dl,chainId:ge.OPTIMISM},[ge.OPTIMISM_SEPOLIA]:{...dl,chainId:ge.OPTIMISM_SEPOLIA},[ge.BASE]:{...dl,chainId:ge.BASE},[ge.BASE_SEPOLIA]:{...dl,chainId:ge.BASE_SEPOLIA},[ge.XAI]:lX,[ge.XAI_SEPOLIA]:m9e,[ge.HOMEVERSE]:fX,[ge.HOMEVERSE_TESTNET]:b9e,[ge.XR_SEPOLIA]:w9e},E9e=t=>x9e[t]||null;function uX(t,e){e(t.get()),t.subscribe(e)}const Uv=`[ { "constant": true, "inputs": [], @@ -401,7 +401,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho "name": "Transfer", "type": "event" } -]`,hM=`[ +]`,fM=`[ { "anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "owner", "type": "address"}, { @@ -558,7 +558,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho "stateMutability": "nonpayable", "type": "function" } - ]`,pM=`[ + ]`,uM=`[ { "anonymous": false, "inputs": [ @@ -890,7 +890,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho "stateMutability": "view", "type": "function" } -]`;class Tx{constructor(e){de(this,"isFetchingBalances",Or(!1));de(this,"isFetchingTokenInfo",Or(!1));de(this,"balances",Or([]));de(this,"userAddedTokens",Or([]));de(this,"local",{userAddedTokens:new Np(dh.TOKENS_USER_ADDITIONS)});this.store=e;const r=this.store.get(Nn);pX(r.networks,n=>{const i=this.store.get(li).accountAddress.get();i&&n.length>0&&this.loadBalances(i,n)})}async loadBalances(e,r){const n=r.filter(o=>o.type===Ft.MAINNET),i=[];this.isFetchingBalances.set(!0),await Promise.allSettled(n.map(async o=>{if(!o.rpcUrl){console.warn(`No RPC URL found for network ${o.name}`);return}const a=new Iy(o.rpcUrl);try{const c=await a.getBalance(e);i.push({contractType:hh.NATIVE,contractAddress:bu,tokenID:"",accountAddress:e,balance:c.toString(),chainId:o.chainId,blockHash:Zg,blockNumber:0,contractInfo:E9e(XAe(o.chainId)),uniqueCollectibles:"0",isSummary:!0})}catch(c){console.error(c)}})),this.balances.set(i);const s=this.local.userAddedTokens.get()??[];this.userAddedTokens.set(s),s.length>0&&await Promise.allSettled(s.map(async o=>{await this.loadUserAddedTokenBalance(e,o)})),this.isFetchingBalances.set(!1)}async loadUserAddedTokenBalance(e,r){const n=this.store.get(Nn).providerForChainId(r.chainId);try{const s=await new Dn(r.address,jv,n).balanceOf(e),o=this.balances.get();if(!s){this.removeToken(r);return}o.push({contractType:r.contractType,contractAddress:r.address,tokenID:"",accountAddress:e,balance:s.toString(),chainId:r.chainId,blockHash:Zg,blockNumber:0,contractInfo:{address:r.address,chainId:r.chainId,decimals:r.decimals,name:r.symbol,symbol:r.symbol,type:"ERC20",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"",description:"",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"User",featured:!1},updatedAt:"0"},uniqueCollectibles:"0",isSummary:!0}),this.balances.set(o)}catch(i){console.error(i)}}async updateTokenBalance(e){const r=this.store.get(Nn).providerForChainId(e.chainId);this.isFetchingBalances.set(!0);const n=this.store.get(li).accountAddress.get();if(!n){console.warn("No account found");return}const i=this.balances.get();try{let s;e.contractType===hh.NATIVE?s=await r.getBalance(n):s=await new Dn(e.contractAddress,jv,r).balanceOf(n),i.map(o=>{o.contractAddress===e.contractAddress&&o.chainId===e.chainId&&(o.balance=s.toString())}),this.balances.set(i)}catch(s){console.error(s)}this.isFetchingBalances.set(!1)}async addToken(e){const r=this.local.userAddedTokens.get()??[];if(r.some(s=>s.chainId===e.chainId&&s.address===e.address))throw new Error(`Token with chainId ${e.chainId} and address ${e.address} already exists`);r.push(e),this.local.userAddedTokens.set(r),this.userAddedTokens.set(r);const i=this.store.get(li).accountAddress.get();i&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(i,e),this.isFetchingBalances.set(!1))}async removeToken(e){const r=this.local.userAddedTokens.get(),n=(r==null?void 0:r.filter(o=>!(o.chainId===e.chainId&&o.address===e.address)))??[];this.local.userAddedTokens.set(n),this.userAddedTokens.set(n);const i=this.balances.get().filter(o=>!(o.chainId===e.chainId&&o.contractAddress===e.address));this.balances.set(i);const s=this.store.get(li).accountAddress.get();s&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(s,e),this.isFetchingBalances.set(!1))}async getTokenInfo(e,r){const n=this.store.get(Nn).providerForChainId(e);this.isFetchingTokenInfo.set(!0);try{const i=new Dn(r,jv,n),s=await i.decimals(),o=await i.symbol();if(this.isFetchingTokenInfo.set(!1),s&&o)return{decimals:Number(s),symbol:o};throw new Error(`Could not get decimals and symbol for token at ${r}`)}catch(i){throw console.error(i),new Error(`Error getting token info ${JSON.stringify(i)}`)}}clear(){this.local.userAddedTokens.set([]),this.isFetchingBalances.set(!1),this.isFetchingTokenInfo.set(!1),this.balances.set([])}}class li{constructor(e){de(this,"isLoadingAccount",Or(!0));de(this,"account");de(this,"accountAddress",Or(void 0));de(this,"isPromptingForPassword",Or(!1));this.store=e,this.loadAccount(),this.store.get(Nn).networks.subscribe(n=>{this.account&&this.loadAccount()}),this.accountAddress.subscribe(n=>{n&&this.store.get(Nn).accountLoaded.set(!0)})}async signInWithRecoveryMnemonic(e,r,n){try{this.isLoadingAccount.set(!0);const i=V5.fromPhrase(r),s=new nE([i]),a=this.store.get(Nn).networks.get(),c=new Ix({address:e,tracker:Y_,contexts:cX,orchestrator:s,networks:a});n?await this.encryptRecoveryMnemonicWithPassword(r,c.address,n):await this.encryptRecoveryMnemonic(r,c.address),this.account=c,this.accountAddress.set(c.address)}catch(i){console.warn(i)}this.isLoadingAccount.set(!1)}async loadAccount(e){const r=await C3(yl.SECURITY),n=await r.get(yl.SECURITY,"mnemonic");var i=await r.get(yl.SECURITY,"key");let s;if(n&&!i&&!e){this.isPromptingForPassword.set(!0);return}n&&(i?s=await this.decryptRecoveryMnemonic(n,i):s=await this.decryptRecoveryMnemonicWithPassword(n,e)),s?e?this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic,e):this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic):setTimeout(()=>{this.isLoadingAccount.set(!1)},200)}async encryptRecoveryMnemonic(e,r){const n=await nAe(),i=JSON.stringify({wallet:r,mnemonic:e}),s=await VF(n,i);s.salt=qF(r);const o=await C3(yl.SECURITY);await o.put(yl.SECURITY,n,"key"),await o.put(yl.SECURITY,s,"mnemonic")}async encryptRecoveryMnemonicWithPassword(e,r,n){const i=qF(r),s=await $F(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await VF(s,o);a.salt=i,await(await C3(yl.SECURITY)).put(yl.SECURITY,a,"mnemonic")}async decryptRecoveryMnemonic(e,r){const n=await zF(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await $F(r,n),s=await zF(i,e);return JSON.parse(s)}logout(){this.account=void 0,this.accountAddress.set(void 0),mAe(yl.SECURITY);const e=this.store.get(Nn),r=this.store.get(Tx);e.clear(),r.clear(),localStorage.clear()}}const A9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M3.98%208.223A10.477%2010.477%200%200%200%201.934%2012C3.226%2016.338%207.244%2019.5%2012%2019.5c.993%200%201.953-.138%202.863-.395M6.228%206.228A10.451%2010.451%200%200%201%2012%204.5c4.756%200%208.773%203.162%2010.065%207.498a10.522%2010.522%200%200%201-4.293%205.774M6.228%206.228%203%203m3.228%203.228%203.65%203.65m7.894%207.894L21%2021m-3.228-3.228-3.65-3.65m0%200a3%203%200%201%200-4.243-4.243m4.242%204.242L9.88%209.88'%20/%3e%3c/svg%3e",S9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.036%2012.322a1.012%201.012%200%200%201%200-.639C3.423%207.51%207.36%204.5%2012%204.5c4.638%200%208.573%203.007%209.963%207.178.07.207.07.431%200%20.639C20.577%2016.49%2016.64%2019.5%2012%2019.5c-4.638%200-8.573-3.007-9.963-7.178Z'%20/%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%201%201-6%200%203%203%200%200%201%206%200Z'%20/%3e%3c/svg%3e",vX=({label:t,labelLocation:e="top",value:r,onChange:n})=>{const[i,s]=D.useState(!1),o=()=>{s(!i)};return W.jsxs("div",{style:{position:"relative",width:"100%"},children:[W.jsx(Wn,{type:i?"text":"password",name:"password",label:t,labelLocation:e,value:r,onChange:n}),W.jsx("button",{type:"button",onClick:o,style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(5%)",background:"none",border:"none",cursor:"pointer"},children:i?W.jsx("img",{src:A9e,style:{width:"25px",height:"25px"}}):W.jsx("img",{src:S9e,style:{width:"25px",height:"25px"}})})]})},vM="/assets/sequence-logo-B9LB7ao9.svg";function _9e(){const t=Ir(li),e=yn(t.isLoadingAccount),r=yn(t.isPromptingForPassword),[n,i]=D.useState(""),[s,o]=D.useState(!1),[a,c]=D.useState(!1),l=async()=>{try{await t.loadAccount(n)}catch(p){console.warn(p),c(!0)}},f=()=>{o(!0)},u=()=>{t.logout(),o(!1),t.isLoadingAccount.set(!1)};return W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:vM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Ge,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{marginTop:"8",children:W.jsxs($r,{flexDirection:"column",gap:"6",children:[W.jsx(Ge,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(Ge,{variant:"normal",color:"text100",marginBottom:"4",children:"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."})]})}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(xe,{children:W.jsx(Zt,{as:eY,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Zt,{variant:"text",size:"lg",shape:"square",label:"Learn more",width:"full",marginTop:"6"})})]})]}),e&&W.jsx(W.Fragment,{children:r?W.jsxs(xe,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(Ge,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(vX,{label:"Password",value:n,onChange:p=>{i(p.target.value),c(!1)}}),W.jsx(xe,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})}),W.jsx(Zt,{marginBottom:"3",variant:"primary",size:"lg",shape:"square",label:"Unlock",onClick:()=>{l()}}),W.jsx(xe,{children:W.jsx(Zt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{f()}})})]}):W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx($r,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})})})})]}),s&&W.jsx(Tc,{size:"md",onClose:()=>o(!1),children:W.jsxs($r,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{o(!1)},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Reset",onClick:()=>{u()},"data-id":"signingContinue"})]})]})})]})}const I9e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};function T9e(t,e=6,r=4){if(t.length<=e+r+3)return t;const n=t.slice(0,e),i=t.slice(-r);return`${n}...${i}`}function P9e(){const t=Ir(li),r=Ir(Nn).networks.get(),[n,i]=D.useState(""),[s,o]=D.useState([]),[a,c]=D.useState(""),[l,f]=D.useState(""),[u,p]=D.useState(!1),[g,y]=D.useState(!1),[b,I]=D.useState(!1),[C,S]=D.useState(!1),O=yn(t.isLoadingAccount);D.useEffect(()=>{if(y(!1),!vw(n))return;S(!0);const ce=Qt(n);ie(ce)},[n]);const L=()=>{const ce=Qt(n);u?t.signInWithRecoveryMnemonic(ce,a.trim(),l):t.signInWithRecoveryMnemonic(ce,a.trim())},F=()=>a&&a.replace(/\s+/g," ").trim().split(" ").length!==12,z=()=>l&&l.length<8,_=async ce=>{if(i(""),o([]),c(ce),I(!1),!F()){S(!0);try{const K=V5.fromPhrase(ce),P=[...(await Y_.walletsOfSigner({signer:K.address})).map(({wallet:M})=>M),...(I9e[K.address]??[]).map(({wallet:M})=>M)];o(P),P.length===1&&i(P[0])}catch(K){console.error(K)}S(!1)}},$=async ce=>{i(ce),I(!1)},ie=async ce=>{try{const K=V5.fromPhrase(a),P=new nE([K]),m=(await new Ix({address:ce,tracker:Y_,contexts:cX,orchestrator:P,networks:r}).status(ge.MAINNET)).config,E=As.genericCoderFor(m.version).config.signersOf(m).some(x=>x.address===K.address);I(E),E||y(!0)}catch(K){y(!0),console.error(K)}S(!1)};return W.jsx(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:vM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Ge,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(xe,{marginTop:"12",children:[W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(Ge,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(Ge,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(Ge,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(xe,{flexDirection:"column",marginTop:"12",gap:"8",children:[W.jsxs(xe,{children:[W.jsx(Kwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:ce=>_(ce.target.value)}),F()&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),W.jsx(eP,{labelLocation:"right",label:"Use Password to Encrypt Mnemonic (Optional)",checked:u,onCheckedChange:ce=>{p(ce===!0)}}),u&&W.jsxs(xe,{children:[W.jsx(vX,{label:"Create Password (min 8 characters)",value:l,onChange:ce=>f(ce.target.value)}),z()&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(xe,{children:[W.jsx(Wn,{name:"wallet",label:"Sequence Wallet Address",labelLocation:"left",value:n,onChange:ce=>$(ce.target.value)}),g&&W.jsx(xe,{justifyContent:"center",marginTop:"2",children:W.jsx(Ge,{variant:"small",color:"negative",children:"Wallet does not match recovery phrase"})})]}),s.length>=1&&W.jsxs(xe,{flexDirection:"column",gap:"4",children:[W.jsx(Ge,{variant:"normal",marginTop:"4",color:"text100",textAlign:"center",children:"Select your wallet"}),W.jsx(xe,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(ce=>W.jsx(Zt,{size:"lg",shape:"square",label:T9e(ce,18,4),onClick:()=>{i(ce)}},ce))})]}),C&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx($r,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})})})]})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[O&&W.jsx(xe,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx($r,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})})}),!O&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{children:W.jsx(Zt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!vw(n)||u&&(!l||l.length<8)||b===!1,onClick:()=>{L()},width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Zt,{as:eY,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]})})}const k9e="modulepreload",M9e=function(t){return"/"+t},tj={},R9e=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=M9e(c),c in tj)return;tj[c]=!0;const l=c.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":k9e,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((p,g)=>{u.addEventListener("load",p),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};var gM={exports:{}},Uv=typeof Reflect=="object"?Reflect:null,rj=Uv&&typeof Uv.apply=="function"?Uv.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},I3;Uv&&typeof Uv.ownKeys=="function"?I3=Uv.ownKeys:Object.getOwnPropertySymbols?I3=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:I3=function(e){return Object.getOwnPropertyNames(e)};function O9e(t){console&&console.warn&&console.warn(t)}var gX=Number.isNaN||function(e){return e!==e};function cn(){cn.init.call(this)}gM.exports=cn;gM.exports.once=L9e;cn.EventEmitter=cn;cn.prototype._events=void 0;cn.prototype._eventsCount=0;cn.prototype._maxListeners=void 0;var nj=10;function oE(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(cn,"defaultMaxListeners",{enumerable:!0,get:function(){return nj},set:function(t){if(typeof t!="number"||t<0||gX(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");nj=t}});cn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};cn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||gX(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function yX(t){return t._maxListeners===void 0?cn.defaultMaxListeners:t._maxListeners}cn.prototype.getMaxListeners=function(){return yX(this)};cn.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")rj(c,this,r);else for(var l=c.length,f=EX(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,O9e(a)}return t}cn.prototype.addListener=function(e,r){return mX(this,e,r,!1)};cn.prototype.on=cn.prototype.addListener;cn.prototype.prependListener=function(e,r){return mX(this,e,r,!0)};function D9e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bX(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=D9e.bind(n);return i.listener=r,n.wrapFn=i,i}cn.prototype.once=function(e,r){return oE(r),this.on(e,bX(this,e,r)),this};cn.prototype.prependOnceListener=function(e,r){return oE(r),this.prependListener(e,bX(this,e,r)),this};cn.prototype.removeListener=function(e,r){var n,i,s,o,a;if(oE(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():N9e(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};cn.prototype.off=cn.prototype.removeListener;cn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function wX(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?B9e(i):EX(i,i.length)}cn.prototype.listeners=function(e){return wX(this,e,!0)};cn.prototype.rawListeners=function(e){return wX(this,e,!1)};cn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):xX.call(t,e)};cn.prototype.listenerCount=xX;function xX(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}cn.prototype.eventNames=function(){return this._eventsCount>0?I3(this._events):[]};function EX(t,e){for(var r=new Array(e),n=0;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new V9e:typeof navigator<"u"?Y9e(navigator.userAgent):J9e()}function K9e(t){return t!==""&&G9e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function Y9e(t){var e=K9e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new q9e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length{const i=this.store.get(ai).accountAddress.get();i&&n.length>0&&this.loadBalances(i,n)})}async loadBalances(e,r){const n=r.filter(o=>o.type===Ft.MAINNET),i=[];this.isFetchingBalances.set(!0),await Promise.allSettled(n.map(async o=>{if(!o.rpcUrl){console.warn(`No RPC URL found for network ${o.name}`);return}const a=new Ty(o.rpcUrl);try{const c=await a.getBalance(e);i.push({contractType:uh.NATIVE,contractAddress:mu,tokenID:"",accountAddress:e,balance:c.toString(),chainId:o.chainId,blockHash:Xg,blockNumber:0,contractInfo:E9e(XAe(o.chainId)),uniqueCollectibles:"0",isSummary:!0})}catch(c){console.error(c)}})),this.balances.set(i);const s=this.local.userAddedTokens.get()??[];this.userAddedTokens.set(s),s.length>0&&await Promise.allSettled(s.map(async o=>{await this.loadUserAddedTokenBalance(e,o)})),this.isFetchingBalances.set(!1)}async loadUserAddedTokenBalance(e,r){const n=this.store.get(Bn).providerForChainId(r.chainId);try{const s=await new Nn(r.address,Uv,n).balanceOf(e),o=this.balances.get();if(!s){this.removeToken(r);return}o.push({contractType:r.contractType,contractAddress:r.address,tokenID:"",accountAddress:e,balance:s.toString(),chainId:r.chainId,blockHash:Xg,blockNumber:0,contractInfo:{address:r.address,chainId:r.chainId,decimals:r.decimals,name:r.symbol,symbol:r.symbol,type:"ERC20",logoURI:"",deployed:!0,bytecodeHash:"",extensions:{link:"",description:"",ogImage:"",originAddress:"",originChainId:0,blacklist:!1,verified:!0,verifiedBy:"User",featured:!1},updatedAt:"0"},uniqueCollectibles:"0",isSummary:!0}),this.balances.set(o)}catch(i){console.error(i)}}async updateTokenBalance(e){const r=this.store.get(Bn).providerForChainId(e.chainId);this.isFetchingBalances.set(!0);const n=this.store.get(ai).accountAddress.get();if(!n){console.warn("No account found");return}const i=this.balances.get();try{let s;e.contractType===uh.NATIVE?s=await r.getBalance(n):s=await new Nn(e.contractAddress,Uv,r).balanceOf(n),i.map(o=>{o.contractAddress===e.contractAddress&&o.chainId===e.chainId&&(o.balance=s.toString())}),this.balances.set(i)}catch(s){console.error(s)}this.isFetchingBalances.set(!1)}async addToken(e){const r=this.local.userAddedTokens.get()??[];if(r.some(s=>s.chainId===e.chainId&&s.address===e.address))throw new Error(`Token with chainId ${e.chainId} and address ${e.address} already exists`);r.push(e),this.local.userAddedTokens.set(r),this.userAddedTokens.set(r);const i=this.store.get(ai).accountAddress.get();i&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(i,e),this.isFetchingBalances.set(!1))}async removeToken(e){const r=this.local.userAddedTokens.get(),n=(r==null?void 0:r.filter(o=>!(o.chainId===e.chainId&&o.address===e.address)))??[];this.local.userAddedTokens.set(n),this.userAddedTokens.set(n);const i=this.balances.get().filter(o=>!(o.chainId===e.chainId&&o.contractAddress===e.address));this.balances.set(i);const s=this.store.get(ai).accountAddress.get();s&&(this.isFetchingBalances.set(!0),await this.loadUserAddedTokenBalance(s,e),this.isFetchingBalances.set(!1))}async getTokenInfo(e,r){const n=this.store.get(Bn).providerForChainId(e);this.isFetchingTokenInfo.set(!0);try{const i=new Nn(r,Uv,n),s=await i.decimals(),o=await i.symbol();if(this.isFetchingTokenInfo.set(!1),s&&o)return{decimals:Number(s),symbol:o};throw new Error(`Could not get decimals and symbol for token at ${r}`)}catch(i){throw console.error(i),new Error(`Error getting token info ${JSON.stringify(i)}`)}}clear(){this.local.userAddedTokens.set([]),this.isFetchingBalances.set(!1),this.isFetchingTokenInfo.set(!1),this.balances.set([])}}class ai{constructor(e){de(this,"isLoadingAccount",Nr(!0));de(this,"account");de(this,"accountAddress",Nr(void 0));de(this,"isPromptingForPassword",Nr(!1));this.store=e,this.loadAccount(),this.store.get(Bn).networks.subscribe(n=>{this.account&&this.loadAccount()}),this.accountAddress.subscribe(n=>{n&&this.store.get(Bn).accountLoaded.set(!0)})}async signInWithRecoveryMnemonic(e,r,n){try{this.isLoadingAccount.set(!0);const i=F5.fromPhrase(r),s=new Z8([i]),a=this.store.get(Bn).networks.get(),c=new _x({address:e,tracker:G_,contexts:sX,orchestrator:s,networks:a});n?await this.encryptRecoveryMnemonicWithPassword(r,c.address,n):await this.encryptRecoveryMnemonic(r,c.address),this.account=c,this.accountAddress.set(c.address)}catch(i){console.warn(i)}this.isLoadingAccount.set(!1)}async loadAccount(e){const r=await m3(ul.SECURITY),n=await r.get(ul.SECURITY,"mnemonic");var i=await r.get(ul.SECURITY,"key");let s;if(n&&!i&&!e){this.isPromptingForPassword.set(!0);return}n&&(i?s=await this.decryptRecoveryMnemonic(n,i):s=await this.decryptRecoveryMnemonicWithPassword(n,e)),s?e?this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic,e):this.signInWithRecoveryMnemonic(s.wallet,s.mnemonic):setTimeout(()=>{this.isLoadingAccount.set(!1)},200)}async encryptRecoveryMnemonic(e,r){const n=await nAe(),i=JSON.stringify({wallet:r,mnemonic:e}),s=await UF(n,i);s.salt=jF(r);const o=await m3(ul.SECURITY);await o.put(ul.SECURITY,n,"key"),await o.put(ul.SECURITY,s,"mnemonic")}async encryptRecoveryMnemonicWithPassword(e,r,n){const i=jF(r),s=await FF(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await UF(s,o);a.salt=i,await(await m3(ul.SECURITY)).put(ul.SECURITY,a,"mnemonic")}async decryptRecoveryMnemonic(e,r){const n=await $F(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await FF(r,n),s=await $F(i,e);return JSON.parse(s)}logout(){this.account=void 0,this.accountAddress.set(void 0),mAe(ul.SECURITY);const e=this.store.get(Bn),r=this.store.get(Ix);e.clear(),r.clear(),localStorage.clear()}}const A9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M3.98%208.223A10.477%2010.477%200%200%200%201.934%2012C3.226%2016.338%207.244%2019.5%2012%2019.5c.993%200%201.953-.138%202.863-.395M6.228%206.228A10.451%2010.451%200%200%201%2012%204.5c4.756%200%208.773%203.162%2010.065%207.498a10.522%2010.522%200%200%201-4.293%205.774M6.228%206.228%203%203m3.228%203.228%203.65%203.65m7.894%207.894L21%2021m-3.228-3.228-3.65-3.65m0%200a3%203%200%201%200-4.243-4.243m4.242%204.242L9.88%209.88'%20/%3e%3c/svg%3e",S9e="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='dimgray'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.036%2012.322a1.012%201.012%200%200%201%200-.639C3.423%207.51%207.36%204.5%2012%204.5c4.638%200%208.573%203.007%209.963%207.178.07.207.07.431%200%20.639C20.577%2016.49%2016.64%2019.5%2012%2019.5c-4.638%200-8.573-3.007-9.963-7.178Z'%20/%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%201%201-6%200%203%203%200%200%201%206%200Z'%20/%3e%3c/svg%3e",dX=({label:t,labelLocation:e="top",value:r,onChange:n})=>{const[i,s]=D.useState(!1),o=()=>{s(!i)};return W.jsxs("div",{style:{position:"relative",width:"100%"},children:[W.jsx(Wn,{type:i?"text":"password",name:"password",label:t,labelLocation:e,value:r,onChange:n}),W.jsx("button",{type:"button",onClick:o,style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(5%)",background:"none",border:"none",cursor:"pointer"},children:i?W.jsx("img",{src:A9e,style:{width:"25px",height:"25px"}}):W.jsx("img",{src:S9e,style:{width:"25px",height:"25px"}})})]})},dM="/assets/sequence-logo-B9LB7ao9.svg";function _9e(){const t=Pr(ai),e=yn(t.isLoadingAccount),r=yn(t.isPromptingForPassword),[n,i]=D.useState(""),[s,o]=D.useState(!1),[a,c]=D.useState(!1),l=async()=>{try{await t.loadAccount(n)}catch(p){console.warn(p),c(!0)}},f=()=>{o(!0)},u=()=>{t.logout(),o(!1),t.isLoadingAccount.set(!1)};return W.jsxs(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:dM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Ge,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{marginTop:"8",children:W.jsxs(qr,{flexDirection:"column",gap:"6",children:[W.jsx(Ge,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(Ge,{variant:"normal",color:"text100",marginBottom:"4",children:"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."})]})}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(xe,{children:W.jsx(Xt,{as:JK,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Xt,{variant:"text",size:"lg",shape:"square",label:"Learn more",width:"full",marginTop:"6"})})]})]}),e&&W.jsx(W.Fragment,{children:r?W.jsxs(xe,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(Ge,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(dX,{label:"Password",value:n,onChange:p=>{i(p.target.value),c(!1)}}),W.jsx(xe,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"2",marginTop:"1",children:"Incorrect password"})}),W.jsx(Xt,{marginBottom:"3",variant:"primary",size:"lg",shape:"square",label:"Unlock",onClick:()=>{l()}}),W.jsx(xe,{children:W.jsx(Xt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{f()}})})]}):W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})})})})]}),s&&W.jsx(Ec,{size:"md",onClose:()=>o(!1),children:W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Xt,{width:"full",label:"Cancel",onClick:()=>{o(!1)},"data-id":"signingCancel"}),W.jsx(Xt,{width:"full",variant:"primary",label:"Reset",onClick:()=>{u()},"data-id":"signingContinue"})]})]})})]})}const I9e={"0x087Aa00C1f09464D1D6a9Ff0eE2377dBB7c7B324":[{wallet:"0xaf39AE56e001250FaCBd122b11A90d32A0aD6686",subdigest:"0x0f4490a7aa40f15929635252953ce594ba3342401c2c53eff56451dc147475da"}],"0x09A820a9109E5EC82DCfF24484b2047739a92Abc":[{wallet:"0xcF47342c7064AAA5BA0F4163bEA0c7545756b8BF",subdigest:"0xa598ddbe6372b985f60367a1a9c12cb99e20e38c782d9bc941ddaa9f4c9296e5"}],"0x0aBb5b9d20f06DAdF752CEeBe4df26E585A1d897":[{wallet:"0x3F00C5A7fEadD358429645b29b3d776C5f61892d",subdigest:"0x7c33d7864e6e6f92e39328b407fc8fa0206c6ebdb5a31d9056dcc96bba5eb108"}],"0x0f286489b5b85EAcC4E00e1902e138b5Aa662F1c":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x76009a037ebbb28a9f71f1e68c38291e3b2b1a4bf772a56a79e1a6336cbbc7ab"}],"0x1A535D13c62F240cC7985B05a0229182D546550e":[{wallet:"0x46Ba18e7eCB93362A1804cC47EaD90244945016D",subdigest:"0x0acff6ca38c72b9287ba8163569a452ce12c9ffd64c082feba8a5f7300546579"}],"0x1B9498d7177a09d98ABE532e472e1b9f32dAc9B8":[{wallet:"0x848045071DbdBa2F352dF2f0335e02ba61f205aC"}],"0x253ff3Dd87c440A9565814756f85219F487e2FFe":[{wallet:"0xd18a46E40b29FA6CFC0D9f5A930E72cD0EC1e4D2",subdigest:"0x12822b7fde91535103ee7757fe362bfdca0dc2e25211c6ca7c133c20a66d604f"}],"0x27D263a5707510378823fa496674EeC7656780B6":[{wallet:"0xBc4f7bB193ac09D7eC53eF0a499B073A296A94f0",subdigest:"0xbf3913760753e93aba2f40235dd03e693f85853d7c9f9c5f1f62ce7ee91c6313"}],"0x36fA6B68007575C100c1C2916942ee857dE0778E":[{wallet:"0x52CE3cab58639223cf870A73942175e6C7BA9A0C",subdigest:"0x455b01f5c47ece34a3f4dee5d9b3d3b590d524029f4e845b2d4eccb7e8d9472b"}],"0x3Ed9724712417687eb0eaBc2cA2e452E3d2DCdEc":[{wallet:"0x4955338954fFF19396Fe4bA17D93370cA8b77d2B",subdigest:"0x96c4ddf36a03af12b56cf6dc618ab83d814b86a01c69464f1b94bfca826e47fa"}],"0x3F0c7e32678Bc6dCf9dEfB6368EcaE7B88C69036":[{wallet:"0x592625C316A2F184F0C6a4b2952e9b40Ef111a26",subdigest:"0x5e9cf684e8dcf38d5b079a89ff4644de144c85ca16e3b618ab4ae490becff25f"},{wallet:"0xEBB418588FFc0785B6a2559a281A37c117679D6F",subdigest:"0x98be9228917ad8193e14102ed0a989689ec6af1f04bd731f3cca43c02c1abc07"}],"0x4577CAF3A5caBcaF2038863d361cb32f423d5d53":[{wallet:"0xF68f5A97abAAa940A9Ad3AeD723C2179F8551502",subdigest:"0x336448a71e4188cd95c39b278d6d26144d51dc5b3edfdd2af67c3b0425a2e2d3"}],"0x50d27302c45FE4FC8d7cc435920a22D477d3DEB2":[{wallet:"0x97692217ca8e06D7156ef7f4606faB4624bd10C0",subdigest:"0x898993e7c2394c1c9b63b2cfa637a8a2c7b04ce9387c9ecc9c56ef1f56ae58be"}],"0x57160B380fF4Edf3DA3b1c27e723dc2AB3f057Be":[{wallet:"0xD1Dda66401B40c7e9924200f5f9913C00c638f79",subdigest:"0x89f982d77ae08a8ea17d6755d297615f5756e5363db8a9b95758d5a981f8e4ae"}],"0x6647b94603e0D90265d8869a3656C1b0F9B6caC5":[{wallet:"0x6cDe6f20610FF172Cd838CDF69Aae3c27521CBa4",subdigest:"0xab2d0dbda84cffb9a3934412172236a9d98fd3d6b80d47b35956cc5f935c69de"}],"0x69DD1F76595E8a49252F16DDa69474c3a818E3c0":[{wallet:"0x756F9E22591e0aC2Aa0C365708aF0a516F269979",subdigest:"0x261126c464ac19bb769c407ec28fe026f297357938ba9024bd66bb5a48ca9349"}],"0x6Ae23160FBB280Ae4eE78C476ca9FDb51bBcC444":[{wallet:"0xDfA3338DD0147b5e7793cE040F92462177e00024",subdigest:"0xae67c59800e8dd98b955a5fb857c39971fe5fb29e3e5083246fd122b37c4ee88"}],"0x6B917b4459Db2C9cb774e0a9B0eee668273e191a":[{wallet:"0x676b5FaCD2380F51d4EB1A2492057A31FfB100c5",subdigest:"0x60a62db58b5be8277ff22e8104ead5c4d87d6d1173fd7b2b0174978e663974c7"}],"0x6b593de1F2c6cEf51693323edc4467c2A4D5B78B":[{wallet:"0xD9DF096A66A89e63eE977C5Fda59a65f872a6901",subdigest:"0x8ef909db0fd633cac1445a89dace09c5b2fa1bda2d85e5915f6afc2d547f6a87"}],"0x6c77214450C1060f2f6a093c8054278b77E8769b":[{wallet:"0x16b47E837ff421382D516cA5A79b76aFd8473675",subdigest:"0x67521db115964b2559b99d5854ab07bae09e6e6cb0c1cd3de3d1f553c31c515f"}],"0x70F2E179c95a6e3b9a2Fe742B88568a12FFF7f8B":[{wallet:"0x649ba7F76D856aB021C9EEB8bac3B46f3e72EfD0",subdigest:"0x178be5e2d834d0224794dfbe49cf9621127d3396b75246a32093a21e6db320eb"}],"0x77fCC4D33ae477f217a09Ec8dBEBC22E7e8F5e33":[{wallet:"0xD09C7A6Af7046F45343978A1620391D6237c3762",subdigest:"0xca780c4505a811222e215eceeb2b28f222c1a6b126e9ccc86560f5199c34d5da"}],"0x78C22edc81d7a7A1D690e6C91824Cf9Eff2760c8":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xd84553d4372b26e3eb96fa77bd157e4e1b593bff1c54c7e69ad8857673d2266e"}],"0x79621cB0c2c8FbB8Ca20E4177b7DF0Aa7a931e73":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0xbd64f6f75e64b49c6a4f46b2715ca3bf11e21a7e07702b89ea1607e3884e9d40"}],"0x79A7DF6E89da1AEa293bFa11987d7CE828223a7A":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x858235d87309c9e2d72dca9bfa41b61fbb635ac6d9e099b868ff8a8c99bf8c37"}],"0x7b1A301155c0Fad8e5b95055e2A100333D464eA3":[{wallet:"0x76799a33838A6E0d1160D26e8C47EA9f0e65AF1A",subdigest:"0x31001033b765a3cc9407304daeafeeda015d318e73be3de8832a9dc1377f9340"}],"0x85c5B1f9464723A2cC81F69A71a11dA528E0CBCe":[{wallet:"0xF178cE73DB2bA1C575D5c63ecA490b09ec31949b",subdigest:"0x65e9c76ef7e14697c6fd1822fbd39719b43091f13d2d051c911d1373175c2c42"}],"0x943237FFB0024Bf758A79db00e043789FD8299f0":[{wallet:"0x639b6017C4b8F8a5322205A68a1331A817Dd46e2",subdigest:"0xa3bc90cafcccb0fe0b8c0939fa908216ddc667d6b022fe54efca05ec815c163c"}],"0x9EeA332285d7B3755CB46f7D0D49CF0edcC112Ef":[{wallet:"0x04EfBe99e49001b78bB68c35B0354CD4a2Ac4Fd8",subdigest:"0xd3c43ef36d4347d1b5323fa188cf8482de05631a86bc05b12b8ce3b661f4d2f9"}],"0x9b704574e65F8b785FD125F5f3C4F7E34690Bd02":[{wallet:"0xBA9498300dFE650a2b59A42271ec771B6Ed6a091",subdigest:"0x9894f57b20f78245e02d424a21f0d361038905285f53c51c1949e27f39a9fbb8"}],"0xA923984d96b7327c60f246da366b2525B34C6984":[{wallet:"0x7ae10aA190513577D9Ac9ae146128d97df4F4fF0",subdigest:"0x3b849360d50831070d92bec368b63cf0725525cd7b60f406cee5357731b75457"}],"0xACFC6D1DB5875Cb72E1b6BaddaCe28F45044ee6a":[{wallet:"0xAdAf943368aB95208763ccAcCD5ecB9a7772de40",subdigest:"0xb0d0da150a42bca8103e1c40e5e99c7a190043b3121f52c6d41ae473597d0ebe"}],"0xB278dd7c9FC754dBc82Ac29C6f78B6301BE8E8C6":[{wallet:"0xeCc653CB03a9B6587Bcb58A8372535b6Ea5a17d6",subdigest:"0x6fd9bb4768107b4bd0f3c8e11b00027ee5e6417b1d4ab3d5e56c1724eeb2e3b2"}],"0xBaA9D704C8244071e6B9bF6BcbC2c2281dB75096":[{wallet:"0xb547CcA265A91f7a92d9a97804807962B2A4D7d8",subdigest:"0xfca7ea635bf9e89d7034ce6d9378ff6948eaa340ab2d428e5b157efc82b9f8d5"}],"0xC29fD04F9079c36dC15549e8AAF8F058214F0Dae":[{wallet:"0xB7005885711d54BD3594Be1955266d37470BD053",subdigest:"0xb0bc66ea204ea2cb93ca190189471392b59fb8608cb75a69a7b01b7096338428"}],"0xD2751030a5007895968414443efae561BdCB1Af2":[{wallet:"0x3c7eCbe20caf91F377F021560a13D53ef3a1BA11",subdigest:"0x2872f961dd02e7b3fabd4a7bed036259085de28fe2f1c0f49a5d1be6ae4c7b07"}],"0xD721d5849fDE7862E77D251B6fA711114f4579Ab":[{wallet:"0x77415fb6aFe8A13275b088f1e197Bd9EDa1AA95C",subdigest:"0xc775316600b59750707446a7915cf88cc6f1827ce931dd688bf5990a7b95ec29"}],"0xE1B6c2c194dF83A8E01F8C582ddA58840fE46318":[{wallet:"0xFbBFA86B877EAFa40699078E4eC1B544D2168dFC",subdigest:"0xde7ebed8b2c62552e8ff5a08d2e5b33d336d709e6cf2812b9874cd7b5fd5189e"}],"0xE5Ed2A916971Fa6fe07EbD4564DeAaF2c20A7684":[{wallet:"0xFDB7922bA08BAbad2e3e36b66e0521c7EEA0faEF"}],"0xF9ED1e54dc86Bf248FBe059D4aEfD8183F0A816F":[{wallet:"0xCdFdaDB6F2b2f3c7db93521AbD05a3C32aF6b226",subdigest:"0x0433c483ced183cee562b8061788fc93d0c9f666af896096a5e184076f787eac"}],"0xa3CF0b935AccFd8bbE569B984D9Bc7Ec775ce22d":[{wallet:"0x23C6B8E47fa9f40e73E6627598d13085130f3ed6",subdigest:"0x13e9cd21769bc2a4f779b0f73c1cc7ca6c96c6af3262721eec17ac72104fef32"}],"0xbe9f4fB13fbC98042a32dC8354A339258abf1456":[{wallet:"0x81fF1aD4232671403e0f3CC85D021144511E3B6e",subdigest:"0x130c5b993a04ab84b0b074ea69241d6f3c040eced24dbe7c2015263718526670"}],"0xd4b26195aD1487DE6a42Fd69bC81CEbc8b86f0b5":[{wallet:"0xF36A0bd53d85307b35f90756263984329FBfA176",subdigest:"0x13d918ac4e97df0477fcab1c210ef1f96a999abe64dd07e48017b96c4902f50b"}],"0xdaD0038b8BBf78Ac84a4566E75269339Daa0dEdC":[{wallet:"0x8Fd48EB1ecDc0652306de1A0A8BA5561Ba733351",subdigest:"0x3541d7b2f07d87fa8b30c9ef1594da2353d45c40830f0c8e01126e3c89b9b508"}],"0xe7d51Cd5097A287a3B63014dc453Cfb8D9A03152":[{wallet:"0x4E5B1F98F81372BD4B763Be9bF50Aa6C5B7b9913",subdigest:"0x818fbd74398f446b4d7fcb207bf6377393fa923732243995d8464844ec8d42ce"}],"0xed7F28464630398E06e0Fa0Fc04FEa2fe40427aB":[{wallet:"0x6D0f613C239ed1d409C4e41758ACd55E0b1Cb410",subdigest:"0xe6baef08a191785d5d3897cb3e96f3473585d2f034657a4134754c5206b87268"}],"0xf24d3aFE0768827EAe9f671F3C1c283BfFAF0C19":[{wallet:"0xf03Bf61943e00fa3557E496409e1E9c95a1c24E4",subdigest:"0x3d1192dcd531e9ec60795b4129b03eb54b9226bc2d08be3f2b2524ae80244afb"}],"0xf3bf75114bEf71abE4E87f8CA4dD82E372b948A9":[{wallet:"0x3e270820e36EC3C29903C2635B0f53f192Dc29ab",subdigest:"0x70f563cb3ba62214e88d61e55450a8f4245bc5666aa006c93802ad2e96d3ac05"}],"0xf95C86e3a52dEbf8b984983852CAc5d8652C8A9A":[{wallet:"0xb07d236F2B5d1f4AB12236e94ac8049dE40321F4",subdigest:"0x877c04b91ea48703e9cc936f4506d89943ed8b9ec32b15990eea41ce0c59dde7"}],"0xfed1D937a8708001A23AFD8AEd02f9E05de9f251":[{wallet:"0x6743b60A94898E228c5aa642A2e11cb595dCB1fB"}]};function T9e(t,e=6,r=4){if(t.length<=e+r+3)return t;const n=t.slice(0,e),i=t.slice(-r);return`${n}...${i}`}function P9e(){const t=Pr(ai),r=Pr(Bn).networks.get(),[n,i]=D.useState(""),[s,o]=D.useState([]),[a,c]=D.useState(""),[l,f]=D.useState(""),[u,p]=D.useState(!1),[g,y]=D.useState(!1),[b,I]=D.useState(!1),[C,S]=D.useState(!1),O=yn(t.isLoadingAccount);D.useEffect(()=>{if(y(!1),!pw(n))return;S(!0);const ce=Jt(n);ie(ce)},[n]);const L=()=>{const ce=Jt(n);u?t.signInWithRecoveryMnemonic(ce,a.trim(),l):t.signInWithRecoveryMnemonic(ce,a.trim())},F=()=>a&&a.replace(/\s+/g," ").trim().split(" ").length!==12,z=()=>l&&l.length<8,_=async ce=>{if(i(""),o([]),c(ce),I(!1),!F()){S(!0);try{const K=F5.fromPhrase(ce),P=[...(await G_.walletsOfSigner({signer:K.address})).map(({wallet:M})=>M),...(I9e[K.address]??[]).map(({wallet:M})=>M)];o(P),P.length===1&&i(P[0])}catch(K){console.error(K)}S(!1)}},$=async ce=>{i(ce),I(!1)},ie=async ce=>{try{const K=F5.fromPhrase(a),P=new Z8([K]),m=(await new _x({address:ce,tracker:G_,contexts:sX,orchestrator:P,networks:r}).status(ge.MAINNET)).config,E=_s.genericCoderFor(m.version).config.signersOf(m).some(x=>x.address===K.address);I(E),E||y(!0)}catch(K){y(!0),console.error(K)}S(!1)};return W.jsx(xe,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:W.jsxs(xe,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(xe,{padding:"6",marginTop:"16",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:dM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(Ge,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(xe,{marginTop:"12",children:[W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(Ge,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(Ge,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(Ge,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(xe,{flexDirection:"column",marginTop:"12",gap:"8",children:[W.jsxs(xe,{children:[W.jsx(Kwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:ce=>_(ce.target.value)}),F()&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),W.jsx(JT,{labelLocation:"right",label:"Use Password to Encrypt Mnemonic (Optional)",checked:u,onCheckedChange:ce=>{p(ce===!0)}}),u&&W.jsxs(xe,{children:[W.jsx(dX,{label:"Create Password (min 8 characters)",value:l,onChange:ce=>f(ce.target.value)}),z()&&W.jsx(Ge,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(xe,{children:[W.jsx(Wn,{name:"wallet",label:"Sequence Wallet Address",labelLocation:"left",value:n,onChange:ce=>$(ce.target.value)}),g&&W.jsx(xe,{justifyContent:"center",marginTop:"2",children:W.jsx(Ge,{variant:"small",color:"negative",children:"Wallet does not match recovery phrase"})})]}),s.length>=1&&W.jsxs(xe,{flexDirection:"column",gap:"4",children:[W.jsx(Ge,{variant:"normal",marginTop:"4",color:"text100",textAlign:"center",children:"Select your wallet"}),W.jsx(xe,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(ce=>W.jsx(Xt,{size:"lg",shape:"square",label:T9e(ce,18,4),onClick:()=>{i(ce)}},ce))})]}),C&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})})})]})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[O&&W.jsx(xe,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})})}),!O&&W.jsxs(W.Fragment,{children:[W.jsx(xe,{children:W.jsx(Xt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!pw(n)||u&&(!l||l.length<8)||b===!1,onClick:()=>{L()},width:"full",marginTop:"16"})}),W.jsx(xe,{children:W.jsx(Xt,{as:JK,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]})})}const k9e="modulepreload",M9e=function(t){return"/"+t},ZF={},R9e=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=M9e(c),c in ZF)return;ZF[c]=!0;const l=c.endsWith(".css"),f=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":k9e,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((p,g)=>{u.addEventListener("load",p),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};var hM={exports:{}},$v=typeof Reflect=="object"?Reflect:null,XF=$v&&typeof $v.apply=="function"?$v.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},E3;$v&&typeof $v.ownKeys=="function"?E3=$v.ownKeys:Object.getOwnPropertySymbols?E3=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:E3=function(e){return Object.getOwnPropertyNames(e)};function O9e(t){console&&console.warn&&console.warn(t)}var hX=Number.isNaN||function(e){return e!==e};function dn(){dn.init.call(this)}hM.exports=dn;hM.exports.once=L9e;dn.EventEmitter=dn;dn.prototype._events=void 0;dn.prototype._eventsCount=0;dn.prototype._maxListeners=void 0;var ej=10;function tE(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(dn,"defaultMaxListeners",{enumerable:!0,get:function(){return ej},set:function(t){if(typeof t!="number"||t<0||hX(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ej=t}});dn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};dn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||hX(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function pX(t){return t._maxListeners===void 0?dn.defaultMaxListeners:t._maxListeners}dn.prototype.getMaxListeners=function(){return pX(this)};dn.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")XF(c,this,r);else for(var l=c.length,f=bX(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,O9e(a)}return t}dn.prototype.addListener=function(e,r){return vX(this,e,r,!1)};dn.prototype.on=dn.prototype.addListener;dn.prototype.prependListener=function(e,r){return vX(this,e,r,!0)};function D9e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function gX(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=D9e.bind(n);return i.listener=r,n.wrapFn=i,i}dn.prototype.once=function(e,r){return tE(r),this.on(e,gX(this,e,r)),this};dn.prototype.prependOnceListener=function(e,r){return tE(r),this.prependListener(e,gX(this,e,r)),this};dn.prototype.removeListener=function(e,r){var n,i,s,o,a;if(tE(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():N9e(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};dn.prototype.off=dn.prototype.removeListener;dn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function yX(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?B9e(i):bX(i,i.length)}dn.prototype.listeners=function(e){return yX(this,e,!0)};dn.prototype.rawListeners=function(e){return yX(this,e,!1)};dn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):mX.call(t,e)};dn.prototype.listenerCount=mX;function mX(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}dn.prototype.eventNames=function(){return this._eventsCount>0?E3(this._events):[]};function bX(t,e){for(var r=new Array(e),n=0;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new V9e:typeof navigator<"u"?Y9e(navigator.userAgent):J9e()}function K9e(t){return t!==""&&G9e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function Y9e(t){var e=K9e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new q9e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function rSe(t,e){return function(r,n){e(r,n,t)}}function nSe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function iSe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{l(n.next(f))}catch(u){o(u)}}function c(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){f.done?s(f.value):i(f.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function sSe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function AX(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function cSe(){for(var t=[],e=0;e1||a(p,g)})})}function a(p,g){try{c(n[p](g))}catch(y){u(s[0][3],y)}}function c(p){p.value instanceof Tw?Promise.resolve(p.value.v).then(l,f):u(s[0][2],p)}function l(p){a("next",p)}function f(p){a("throw",p)}function u(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function uSe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Tw(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function dSe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Z_=="function"?Z_(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function hSe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function pSe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function vSe(t){return t&&t.__esModule?t:{default:t}}function gSe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function ySe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const mSe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return J_},__asyncDelegator:uSe,__asyncGenerator:fSe,__asyncValues:dSe,__await:Tw,__awaiter:iSe,__classPrivateFieldGet:gSe,__classPrivateFieldSet:ySe,__createBinding:oSe,__decorate:tSe,__exportStar:aSe,__extends:X9e,__generator:sSe,__importDefault:vSe,__importStar:pSe,__makeTemplateObject:hSe,__metadata:nSe,__param:rSe,__read:AX,__rest:eSe,__spread:cSe,__spreadArrays:lSe,__values:Z_},Symbol.toStringTag,{value:"Module"})),Px=V$(mSe);var P9={},km={},aj;function bSe(){if(aj)return km;aj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return km.delay=t,km}var s0={},k9={},o0={},cj;function wSe(){return cj||(cj=1,Object.defineProperty(o0,"__esModule",{value:!0}),o0.ONE_THOUSAND=o0.ONE_HUNDRED=void 0,o0.ONE_HUNDRED=100,o0.ONE_THOUSAND=1e3),o0}var M9={},lj;function xSe(){return lj||(lj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(M9)),M9}var fj;function SX(){return fj||(fj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(wSe(),t),e.__exportStar(xSe(),t)}(k9)),k9}var uj;function ESe(){if(uj)return s0;uj=1,Object.defineProperty(s0,"__esModule",{value:!0}),s0.fromMiliseconds=s0.toMiliseconds=void 0;const t=SX();function e(n){return n*t.ONE_THOUSAND}s0.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return s0.fromMiliseconds=r,s0}var dj;function CSe(){return dj||(dj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(bSe(),t),e.__exportStar(ESe(),t)}(P9)),P9}var F1={},hj;function ASe(){if(hj)return F1;hj=1,Object.defineProperty(F1,"__esModule",{value:!0}),F1.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return F1.Watch=t,F1.default=t,F1}var R9={},Mm={},pj;function SSe(){if(pj)return Mm;pj=1,Object.defineProperty(Mm,"__esModule",{value:!0}),Mm.IWatch=void 0;class t{}return Mm.IWatch=t,Mm}var vj;function _Se(){return vj||(vj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Px.__exportStar(SSe(),t)}(R9)),R9}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(CSe(),t),e.__exportStar(ASe(),t),e.__exportStar(_Se(),t),e.__exportStar(SX(),t)})(at);var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.getLocalStorage=gn.getLocalStorageOrThrow=gn.getCrypto=gn.getCryptoOrThrow=_X=gn.getLocation=gn.getLocationOrThrow=mM=gn.getNavigator=gn.getNavigatorOrThrow=kx=gn.getDocument=gn.getDocumentOrThrow=gn.getFromWindowOrThrow=gn.getFromWindow=void 0;function Kp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}gn.getFromWindow=Kp;function My(t){const e=Kp(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}gn.getFromWindowOrThrow=My;function ISe(){return My("document")}gn.getDocumentOrThrow=ISe;function TSe(){return Kp("document")}var kx=gn.getDocument=TSe;function PSe(){return My("navigator")}gn.getNavigatorOrThrow=PSe;function kSe(){return Kp("navigator")}var mM=gn.getNavigator=kSe;function MSe(){return My("location")}gn.getLocationOrThrow=MSe;function RSe(){return Kp("location")}var _X=gn.getLocation=RSe;function OSe(){return My("crypto")}gn.getCryptoOrThrow=OSe;function DSe(){return Kp("crypto")}gn.getCrypto=DSe;function NSe(){return My("localStorage")}gn.getLocalStorageOrThrow=NSe;function BSe(){return Kp("localStorage")}gn.getLocalStorage=BSe;var bM={};Object.defineProperty(bM,"__esModule",{value:!0});var IX=bM.getWindowMetadata=void 0;const gj=gn;function LSe(){let t,e;try{t=gj.getDocumentOrThrow(),e=gj.getLocationOrThrow()}catch{return null}function r(){const u=t.getElementsByTagName("link"),p=[];for(let g=0;g-1){const I=y.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const S=e.pathname.split("/");S.pop();const O=S.join("/");C+=O+"/"+I}p.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;p.push(C)}else p.push(I)}}return p}function n(...u){const p=t.getElementsByTagName("meta");for(let g=0;gy.getAttribute(I)).filter(I=>I?u.includes(I):!1);if(b.length&&b){const I=y.getAttribute("content");if(I)return I}}return""}function i(){let u=n("name","og:site_name","og:title","twitter:title");return u||(u=t.title),u}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}IX=bM.getWindowMetadata=LSe;var Pw={},FSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),TX="%[a-f0-9]{2}",yj=new RegExp("("+TX+")|([^%]+?)","gi"),mj=new RegExp("("+TX+")+","gi");function X_(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],X_(r),X_(n))}function jSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(yj)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},VSe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sS==null,o=Symbol("encodeFragmentIdentifier");function a(S){switch(S.arrayFormat){case"index":return O=>(L,F)=>{const z=L.length;return F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),"[",z,"]"].join("")]:[...L,[f(O,S),"[",f(z,S),"]=",f(F,S)].join("")]};case"bracket":return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),"[]"].join("")]:[...L,[f(O,S),"[]=",f(F,S)].join("")];case"colon-list-separator":return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),":list="].join("")]:[...L,[f(O,S),":list=",f(F,S)].join("")];case"comma":case"separator":case"bracket-separator":{const O=S.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(F,z)=>z===void 0||S.skipNull&&z===null||S.skipEmptyString&&z===""?F:(z=z===null?"":z,F.length===0?[[f(L,S),O,f(z,S)].join("")]:[[F,f(z,S)].join(S.arrayFormatSeparator)])}default:return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,f(O,S)]:[...L,[f(O,S),"=",f(F,S)].join("")]}}function c(S){let O;switch(S.arrayFormat){case"index":return(L,F,z)=>{if(O=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!O){z[L]=F;return}z[L]===void 0&&(z[L]={}),z[L][O[1]]=F};case"bracket":return(L,F,z)=>{if(O=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!O){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"colon-list-separator":return(L,F,z)=>{if(O=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!O){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"comma":case"separator":return(L,F,z)=>{const _=typeof F=="string"&&F.includes(S.arrayFormatSeparator),$=typeof F=="string"&&!_&&u(F,S).includes(S.arrayFormatSeparator);F=$?u(F,S):F;const ie=_||$?F.split(S.arrayFormatSeparator).map(ce=>u(ce,S)):F===null?F:u(F,S);z[L]=ie};case"bracket-separator":return(L,F,z)=>{const _=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!_){z[L]=F&&u(F,S);return}const $=F===null?[]:F.split(S.arrayFormatSeparator).map(ie=>u(ie,S));if(z[L]===void 0){z[L]=$;return}z[L]=[].concat(z[L],$)};default:return(L,F,z)=>{if(z[L]===void 0){z[L]=F;return}z[L]=[].concat(z[L],F)}}}function l(S){if(typeof S!="string"||S.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(S,O){return O.encode?O.strict?e(S):encodeURIComponent(S):S}function u(S,O){return O.decode?r(S):S}function p(S){return Array.isArray(S)?S.sort():typeof S=="object"?p(Object.keys(S)).sort((O,L)=>Number(O)-Number(L)).map(O=>S[O]):S}function g(S){const O=S.indexOf("#");return O!==-1&&(S=S.slice(0,O)),S}function y(S){let O="";const L=S.indexOf("#");return L!==-1&&(O=S.slice(L)),O}function b(S){S=g(S);const O=S.indexOf("?");return O===-1?"":S.slice(O+1)}function I(S,O){return O.parseNumbers&&!Number.isNaN(Number(S))&&typeof S=="string"&&S.trim()!==""?S=Number(S):O.parseBooleans&&S!==null&&(S.toLowerCase()==="true"||S.toLowerCase()==="false")&&(S=S.toLowerCase()==="true"),S}function C(S,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const L=c(O),F=Object.create(null);if(typeof S!="string"||(S=S.trim().replace(/^[?#&]/,""),!S))return F;for(const z of S.split("&")){if(z==="")continue;let[_,$]=n(O.decode?z.replace(/\+/g," "):z,"=");$=$===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?$:u($,O),L(u(_,O),$,F)}for(const z of Object.keys(F)){const _=F[z];if(typeof _=="object"&&_!==null)for(const $ of Object.keys(_))_[$]=I(_[$],O);else F[z]=I(_,O)}return O.sort===!1?F:(O.sort===!0?Object.keys(F).sort():Object.keys(F).sort(O.sort)).reduce((z,_)=>{const $=F[_];return $&&typeof $=="object"&&!Array.isArray($)?z[_]=p($):z[_]=$,z},Object.create(null))}t.extract=b,t.parse=C,t.stringify=(S,O)=>{if(!S)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const L=$=>O.skipNull&&s(S[$])||O.skipEmptyString&&S[$]==="",F=a(O),z={};for(const $ of Object.keys(S))L($)||(z[$]=S[$]);const _=Object.keys(z);return O.sort!==!1&&_.sort(O.sort),_.map($=>{const ie=S[$];return ie===void 0?"":ie===null?f($,O):Array.isArray(ie)?ie.length===0&&O.arrayFormat==="bracket-separator"?f($,O)+"[]":ie.reduce(F($),[]).join("&"):f($,O)+"="+f(ie,O)}).filter($=>$.length>0).join("&")},t.parseUrl=(S,O)=>{O=Object.assign({decode:!0},O);const[L,F]=n(S,"#");return Object.assign({url:L.split("?")[0]||"",query:C(b(S),O)},O&&O.parseFragmentIdentifier&&F?{fragmentIdentifier:u(F,O)}:{})},t.stringifyUrl=(S,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const L=g(S.url).split("?")[0]||"",F=t.extract(S.url),z=t.parse(F,{sort:!1}),_=Object.assign(z,S.query);let $=t.stringify(_,O);$&&($=`?${$}`);let ie=y(S.url);return S.fragmentIdentifier&&(ie=`#${O[o]?f(S.fragmentIdentifier,O):S.fragmentIdentifier}`),`${L}${$}${ie}`},t.pick=(S,O,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:F,query:z,fragmentIdentifier:_}=t.parseUrl(S,L);return t.stringifyUrl({url:F,query:i(z,O),fragmentIdentifier:_},L)},t.exclude=(S,O,L)=>{const F=Array.isArray(O)?z=>!O.includes(z):(z,_)=>!O(z,_);return t.pick(S,F,L)}})(Pw);var PX={exports:{}};/** +***************************************************************************** */var W_=function(t,e){return W_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},W_(t,e)};function X9e(t,e){W_(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var K_=function(){return K_=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function rSe(t,e){return function(r,n){e(r,n,t)}}function nSe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function iSe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{l(n.next(f))}catch(u){o(u)}}function c(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){f.done?s(f.value):i(f.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function sSe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function xX(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function cSe(){for(var t=[],e=0;e1||a(p,g)})})}function a(p,g){try{c(n[p](g))}catch(y){u(s[0][3],y)}}function c(p){p.value instanceof Iw?Promise.resolve(p.value.v).then(l,f):u(s[0][2],p)}function l(p){a("next",p)}function f(p){a("throw",p)}function u(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function uSe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Iw(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function dSe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Y_=="function"?Y_(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function hSe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function pSe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function vSe(t){return t&&t.__esModule?t:{default:t}}function gSe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function ySe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const mSe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return K_},__asyncDelegator:uSe,__asyncGenerator:fSe,__asyncValues:dSe,__await:Iw,__awaiter:iSe,__classPrivateFieldGet:gSe,__classPrivateFieldSet:ySe,__createBinding:oSe,__decorate:tSe,__exportStar:aSe,__extends:X9e,__generator:sSe,__importDefault:vSe,__importStar:pSe,__makeTemplateObject:hSe,__metadata:nSe,__param:rSe,__read:xX,__rest:eSe,__spread:cSe,__spreadArrays:lSe,__values:Y_},Symbol.toStringTag,{value:"Module"})),Tx=U$(mSe);var _9={},Pm={},ij;function bSe(){if(ij)return Pm;ij=1,Object.defineProperty(Pm,"__esModule",{value:!0}),Pm.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Pm.delay=t,Pm}var s0={},I9={},o0={},sj;function wSe(){return sj||(sj=1,Object.defineProperty(o0,"__esModule",{value:!0}),o0.ONE_THOUSAND=o0.ONE_HUNDRED=void 0,o0.ONE_HUNDRED=100,o0.ONE_THOUSAND=1e3),o0}var T9={},oj;function xSe(){return oj||(oj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(T9)),T9}var aj;function EX(){return aj||(aj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(wSe(),t),e.__exportStar(xSe(),t)}(I9)),I9}var cj;function ESe(){if(cj)return s0;cj=1,Object.defineProperty(s0,"__esModule",{value:!0}),s0.fromMiliseconds=s0.toMiliseconds=void 0;const t=EX();function e(n){return n*t.ONE_THOUSAND}s0.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return s0.fromMiliseconds=r,s0}var lj;function CSe(){return lj||(lj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(bSe(),t),e.__exportStar(ESe(),t)}(_9)),_9}var j1={},fj;function ASe(){if(fj)return j1;fj=1,Object.defineProperty(j1,"__esModule",{value:!0}),j1.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return j1.Watch=t,j1.default=t,j1}var P9={},km={},uj;function SSe(){if(uj)return km;uj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.IWatch=void 0;class t{}return km.IWatch=t,km}var dj;function _Se(){return dj||(dj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Tx.__exportStar(SSe(),t)}(P9)),P9}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(CSe(),t),e.__exportStar(ASe(),t),e.__exportStar(_Se(),t),e.__exportStar(EX(),t)})(at);var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.getLocalStorage=gn.getLocalStorageOrThrow=gn.getCrypto=gn.getCryptoOrThrow=CX=gn.getLocation=gn.getLocationOrThrow=vM=gn.getNavigator=gn.getNavigatorOrThrow=Px=gn.getDocument=gn.getDocumentOrThrow=gn.getFromWindowOrThrow=gn.getFromWindow=void 0;function Kp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}gn.getFromWindow=Kp;function Ry(t){const e=Kp(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}gn.getFromWindowOrThrow=Ry;function ISe(){return Ry("document")}gn.getDocumentOrThrow=ISe;function TSe(){return Kp("document")}var Px=gn.getDocument=TSe;function PSe(){return Ry("navigator")}gn.getNavigatorOrThrow=PSe;function kSe(){return Kp("navigator")}var vM=gn.getNavigator=kSe;function MSe(){return Ry("location")}gn.getLocationOrThrow=MSe;function RSe(){return Kp("location")}var CX=gn.getLocation=RSe;function OSe(){return Ry("crypto")}gn.getCryptoOrThrow=OSe;function DSe(){return Kp("crypto")}gn.getCrypto=DSe;function NSe(){return Ry("localStorage")}gn.getLocalStorageOrThrow=NSe;function BSe(){return Kp("localStorage")}gn.getLocalStorage=BSe;var gM={};Object.defineProperty(gM,"__esModule",{value:!0});var AX=gM.getWindowMetadata=void 0;const hj=gn;function LSe(){let t,e;try{t=hj.getDocumentOrThrow(),e=hj.getLocationOrThrow()}catch{return null}function r(){const u=t.getElementsByTagName("link"),p=[];for(let g=0;g-1){const I=y.getAttribute("href");if(I)if(I.toLowerCase().indexOf("https:")===-1&&I.toLowerCase().indexOf("http:")===-1&&I.indexOf("//")!==0){let C=e.protocol+"//"+e.host;if(I.indexOf("/")===0)C+=I;else{const S=e.pathname.split("/");S.pop();const O=S.join("/");C+=O+"/"+I}p.push(C)}else if(I.indexOf("//")===0){const C=e.protocol+I;p.push(C)}else p.push(I)}}return p}function n(...u){const p=t.getElementsByTagName("meta");for(let g=0;gy.getAttribute(I)).filter(I=>I?u.includes(I):!1);if(b.length&&b){const I=y.getAttribute("content");if(I)return I}}return""}function i(){let u=n("name","og:site_name","og:title","twitter:title");return u||(u=t.title),u}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}AX=gM.getWindowMetadata=LSe;var Tw={},FSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),SX="%[a-f0-9]{2}",pj=new RegExp("("+SX+")|([^%]+?)","gi"),vj=new RegExp("("+SX+")+","gi");function Q_(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Q_(r),Q_(n))}function jSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(pj)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},VSe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sS==null,o=Symbol("encodeFragmentIdentifier");function a(S){switch(S.arrayFormat){case"index":return O=>(L,F)=>{const z=L.length;return F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),"[",z,"]"].join("")]:[...L,[f(O,S),"[",f(z,S),"]=",f(F,S)].join("")]};case"bracket":return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),"[]"].join("")]:[...L,[f(O,S),"[]=",f(F,S)].join("")];case"colon-list-separator":return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,[f(O,S),":list="].join("")]:[...L,[f(O,S),":list=",f(F,S)].join("")];case"comma":case"separator":case"bracket-separator":{const O=S.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(F,z)=>z===void 0||S.skipNull&&z===null||S.skipEmptyString&&z===""?F:(z=z===null?"":z,F.length===0?[[f(L,S),O,f(z,S)].join("")]:[[F,f(z,S)].join(S.arrayFormatSeparator)])}default:return O=>(L,F)=>F===void 0||S.skipNull&&F===null||S.skipEmptyString&&F===""?L:F===null?[...L,f(O,S)]:[...L,[f(O,S),"=",f(F,S)].join("")]}}function c(S){let O;switch(S.arrayFormat){case"index":return(L,F,z)=>{if(O=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!O){z[L]=F;return}z[L]===void 0&&(z[L]={}),z[L][O[1]]=F};case"bracket":return(L,F,z)=>{if(O=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!O){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"colon-list-separator":return(L,F,z)=>{if(O=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!O){z[L]=F;return}if(z[L]===void 0){z[L]=[F];return}z[L]=[].concat(z[L],F)};case"comma":case"separator":return(L,F,z)=>{const _=typeof F=="string"&&F.includes(S.arrayFormatSeparator),$=typeof F=="string"&&!_&&u(F,S).includes(S.arrayFormatSeparator);F=$?u(F,S):F;const ie=_||$?F.split(S.arrayFormatSeparator).map(ce=>u(ce,S)):F===null?F:u(F,S);z[L]=ie};case"bracket-separator":return(L,F,z)=>{const _=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!_){z[L]=F&&u(F,S);return}const $=F===null?[]:F.split(S.arrayFormatSeparator).map(ie=>u(ie,S));if(z[L]===void 0){z[L]=$;return}z[L]=[].concat(z[L],$)};default:return(L,F,z)=>{if(z[L]===void 0){z[L]=F;return}z[L]=[].concat(z[L],F)}}}function l(S){if(typeof S!="string"||S.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(S,O){return O.encode?O.strict?e(S):encodeURIComponent(S):S}function u(S,O){return O.decode?r(S):S}function p(S){return Array.isArray(S)?S.sort():typeof S=="object"?p(Object.keys(S)).sort((O,L)=>Number(O)-Number(L)).map(O=>S[O]):S}function g(S){const O=S.indexOf("#");return O!==-1&&(S=S.slice(0,O)),S}function y(S){let O="";const L=S.indexOf("#");return L!==-1&&(O=S.slice(L)),O}function b(S){S=g(S);const O=S.indexOf("?");return O===-1?"":S.slice(O+1)}function I(S,O){return O.parseNumbers&&!Number.isNaN(Number(S))&&typeof S=="string"&&S.trim()!==""?S=Number(S):O.parseBooleans&&S!==null&&(S.toLowerCase()==="true"||S.toLowerCase()==="false")&&(S=S.toLowerCase()==="true"),S}function C(S,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const L=c(O),F=Object.create(null);if(typeof S!="string"||(S=S.trim().replace(/^[?#&]/,""),!S))return F;for(const z of S.split("&")){if(z==="")continue;let[_,$]=n(O.decode?z.replace(/\+/g," "):z,"=");$=$===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?$:u($,O),L(u(_,O),$,F)}for(const z of Object.keys(F)){const _=F[z];if(typeof _=="object"&&_!==null)for(const $ of Object.keys(_))_[$]=I(_[$],O);else F[z]=I(_,O)}return O.sort===!1?F:(O.sort===!0?Object.keys(F).sort():Object.keys(F).sort(O.sort)).reduce((z,_)=>{const $=F[_];return $&&typeof $=="object"&&!Array.isArray($)?z[_]=p($):z[_]=$,z},Object.create(null))}t.extract=b,t.parse=C,t.stringify=(S,O)=>{if(!S)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const L=$=>O.skipNull&&s(S[$])||O.skipEmptyString&&S[$]==="",F=a(O),z={};for(const $ of Object.keys(S))L($)||(z[$]=S[$]);const _=Object.keys(z);return O.sort!==!1&&_.sort(O.sort),_.map($=>{const ie=S[$];return ie===void 0?"":ie===null?f($,O):Array.isArray(ie)?ie.length===0&&O.arrayFormat==="bracket-separator"?f($,O)+"[]":ie.reduce(F($),[]).join("&"):f($,O)+"="+f(ie,O)}).filter($=>$.length>0).join("&")},t.parseUrl=(S,O)=>{O=Object.assign({decode:!0},O);const[L,F]=n(S,"#");return Object.assign({url:L.split("?")[0]||"",query:C(b(S),O)},O&&O.parseFragmentIdentifier&&F?{fragmentIdentifier:u(F,O)}:{})},t.stringifyUrl=(S,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const L=g(S.url).split("?")[0]||"",F=t.extract(S.url),z=t.parse(F,{sort:!1}),_=Object.assign(z,S.query);let $=t.stringify(_,O);$&&($=`?${$}`);let ie=y(S.url);return S.fragmentIdentifier&&(ie=`#${O[o]?f(S.fragmentIdentifier,O):S.fragmentIdentifier}`),`${L}${$}${ie}`},t.pick=(S,O,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:F,query:z,fragmentIdentifier:_}=t.parseUrl(S,L);return t.stringifyUrl({url:F,query:i(z,O),fragmentIdentifier:_},L)},t.exclude=(S,O,L)=>{const F=Array.isArray(O)?z=>!O.includes(z):(z,_)=>!O(z,_);return t.pick(S,F,L)}})(Tw);var _X={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=Si:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],y=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],I=[224,256,384,512],C=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],O={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(j){return Object.prototype.toString.call(j)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(j){return typeof j=="object"&&j.buffer&&j.buffer.constructor===ArrayBuffer});for(var L=function(j,X,G){return function(Z){return new k(j,X,j).update(Z)[G]()}},F=function(j,X,G){return function(Z,ee){return new k(j,X,ee).update(Z)[G]()}},z=function(j,X,G){return function(Z,ee,N,te){return v["cshake"+j].update(Z,ee,N,te)[G]()}},_=function(j,X,G){return function(Z,ee,N,te){return v["kmac"+j].update(Z,ee,N,te)[G]()}},$=function(j,X,G,Z){for(var ee=0;ee>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var Z=0;Z<50;++Z)this.s[Z]=0}k.prototype.update=function(j){if(this.finalized)throw new Error(r);var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}for(var Z=this.blocks,ee=this.byteCount,N=j.length,te=this.blockCount,fe=0,Ee=this.s,_e,Re;fe>2]|=j[fe]<>2]|=Re<>2]|=(192|Re>>6)<>2]|=(128|Re&63)<=57344?(Z[_e>>2]|=(224|Re>>12)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<>2]|=(240|Re>>18)<>2]|=(128|Re>>12&63)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<=ee){for(this.start=_e-ee,this.block=Z[te],_e=0;_e>8,G=j&255;G>0;)ee.unshift(G),j=j>>8,G=j&255,++Z;return X?ee.push(Z):ee.unshift(Z),this.update(ee),ee.length},k.prototype.encodeString=function(j){var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}var Z=0,ee=j.length;if(X)Z=ee;else for(var N=0;N=57344?Z+=3:(te=65536+((te&1023)<<10|j.charCodeAt(++N)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},k.prototype.bytepad=function(j,X){for(var G=this.encode(X),Z=0;Z>2]|=this.padding[X&3],this.lastByteIndex===this.byteCount)for(j[0]=j[G],X=1;X>4&15]+l[fe&15]+l[fe>>12&15]+l[fe>>8&15]+l[fe>>20&15]+l[fe>>16&15]+l[fe>>28&15]+l[fe>>24&15];N%j===0&&(oe(X),ee=0)}return Z&&(fe=X[ee],te+=l[fe>>4&15]+l[fe&15],Z>1&&(te+=l[fe>>12&15]+l[fe>>8&15]),Z>2&&(te+=l[fe>>20&15]+l[fe>>16&15])),te},k.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,X=this.s,G=this.outputBlocks,Z=this.extraBytes,ee=0,N=0,te=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(te);for(var Ee=new Uint32Array(fe);N>8&255,te[fe+2]=Ee>>16&255,te[fe+3]=Ee>>24&255;N%j===0&&oe(X)}return Z&&(fe=N<<2,Ee=X[ee],te[fe]=Ee&255,Z>1&&(te[fe+1]=Ee>>8&255),Z>2&&(te[fe+2]=Ee>>16&255)),te};function H(j,X,G){k.call(this,j,X,G)}H.prototype=new k,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),k.prototype.finalize.call(this)};var oe=function(j){var X,G,Z,ee,N,te,fe,Ee,_e,Re,Te,De,ze,et,Je,ke,Ne,tt,Ze,st,nt,We,lt,vt,Ke,gt,wt,rt,It,At,Tt,Xt,lr,xt,ar,rr,kt,Dt,Nt,dt,Lt,Mt,ut,Vt,zt,ht,Et,Bt,He,$t,Ct,ct,Ht,Rr,Ut,Sr,er,kr,bi,wi,xi,Ti,Sn;for(Z=0;Z<48;Z+=2)ee=j[0]^j[10]^j[20]^j[30]^j[40],N=j[1]^j[11]^j[21]^j[31]^j[41],te=j[2]^j[12]^j[22]^j[32]^j[42],fe=j[3]^j[13]^j[23]^j[33]^j[43],Ee=j[4]^j[14]^j[24]^j[34]^j[44],_e=j[5]^j[15]^j[25]^j[35]^j[45],Re=j[6]^j[16]^j[26]^j[36]^j[46],Te=j[7]^j[17]^j[27]^j[37]^j[47],De=j[8]^j[18]^j[28]^j[38]^j[48],ze=j[9]^j[19]^j[29]^j[39]^j[49],X=De^(te<<1|fe>>>31),G=ze^(fe<<1|te>>>31),j[0]^=X,j[1]^=G,j[10]^=X,j[11]^=G,j[20]^=X,j[21]^=G,j[30]^=X,j[31]^=G,j[40]^=X,j[41]^=G,X=ee^(Ee<<1|_e>>>31),G=N^(_e<<1|Ee>>>31),j[2]^=X,j[3]^=G,j[12]^=X,j[13]^=G,j[22]^=X,j[23]^=G,j[32]^=X,j[33]^=G,j[42]^=X,j[43]^=G,X=te^(Re<<1|Te>>>31),G=fe^(Te<<1|Re>>>31),j[4]^=X,j[5]^=G,j[14]^=X,j[15]^=G,j[24]^=X,j[25]^=G,j[34]^=X,j[35]^=G,j[44]^=X,j[45]^=G,X=Ee^(De<<1|ze>>>31),G=_e^(ze<<1|De>>>31),j[6]^=X,j[7]^=G,j[16]^=X,j[17]^=G,j[26]^=X,j[27]^=G,j[36]^=X,j[37]^=G,j[46]^=X,j[47]^=G,X=Re^(ee<<1|N>>>31),G=Te^(N<<1|ee>>>31),j[8]^=X,j[9]^=G,j[18]^=X,j[19]^=G,j[28]^=X,j[29]^=G,j[38]^=X,j[39]^=G,j[48]^=X,j[49]^=G,et=j[0],Je=j[1],ht=j[11]<<4|j[10]>>>28,Et=j[10]<<4|j[11]>>>28,rt=j[20]<<3|j[21]>>>29,It=j[21]<<3|j[20]>>>29,wi=j[31]<<9|j[30]>>>23,xi=j[30]<<9|j[31]>>>23,Mt=j[40]<<18|j[41]>>>14,ut=j[41]<<18|j[40]>>>14,xt=j[2]<<1|j[3]>>>31,ar=j[3]<<1|j[2]>>>31,ke=j[13]<<12|j[12]>>>20,Ne=j[12]<<12|j[13]>>>20,Bt=j[22]<<10|j[23]>>>22,He=j[23]<<10|j[22]>>>22,At=j[33]<<13|j[32]>>>19,Tt=j[32]<<13|j[33]>>>19,Ti=j[42]<<2|j[43]>>>30,Sn=j[43]<<2|j[42]>>>30,Rr=j[5]<<30|j[4]>>>2,Ut=j[4]<<30|j[5]>>>2,rr=j[14]<<6|j[15]>>>26,kt=j[15]<<6|j[14]>>>26,tt=j[25]<<11|j[24]>>>21,Ze=j[24]<<11|j[25]>>>21,$t=j[34]<<15|j[35]>>>17,Ct=j[35]<<15|j[34]>>>17,Xt=j[45]<<29|j[44]>>>3,lr=j[44]<<29|j[45]>>>3,vt=j[6]<<28|j[7]>>>4,Ke=j[7]<<28|j[6]>>>4,Sr=j[17]<<23|j[16]>>>9,er=j[16]<<23|j[17]>>>9,Dt=j[26]<<25|j[27]>>>7,Nt=j[27]<<25|j[26]>>>7,st=j[36]<<21|j[37]>>>11,nt=j[37]<<21|j[36]>>>11,ct=j[47]<<24|j[46]>>>8,Ht=j[46]<<24|j[47]>>>8,Vt=j[8]<<27|j[9]>>>5,zt=j[9]<<27|j[8]>>>5,gt=j[18]<<20|j[19]>>>12,wt=j[19]<<20|j[18]>>>12,kr=j[29]<<7|j[28]>>>25,bi=j[28]<<7|j[29]>>>25,dt=j[38]<<8|j[39]>>>24,Lt=j[39]<<8|j[38]>>>24,We=j[48]<<14|j[49]>>>18,lt=j[49]<<14|j[48]>>>18,j[0]=et^~ke&tt,j[1]=Je^~Ne&Ze,j[10]=vt^~gt&rt,j[11]=Ke^~wt&It,j[20]=xt^~rr&Dt,j[21]=ar^~kt&Nt,j[30]=Vt^~ht&Bt,j[31]=zt^~Et&He,j[40]=Rr^~Sr&kr,j[41]=Ut^~er&bi,j[2]=ke^~tt&st,j[3]=Ne^~Ze&nt,j[12]=gt^~rt&At,j[13]=wt^~It&Tt,j[22]=rr^~Dt&dt,j[23]=kt^~Nt&Lt,j[32]=ht^~Bt&$t,j[33]=Et^~He&Ct,j[42]=Sr^~kr&wi,j[43]=er^~bi&xi,j[4]=tt^~st&We,j[5]=Ze^~nt<,j[14]=rt^~At&Xt,j[15]=It^~Tt&lr,j[24]=Dt^~dt&Mt,j[25]=Nt^~Lt&ut,j[34]=Bt^~$t&ct,j[35]=He^~Ct&Ht,j[44]=kr^~wi&Ti,j[45]=bi^~xi&Sn,j[6]=st^~We&et,j[7]=nt^~lt&Je,j[16]=At^~Xt&vt,j[17]=Tt^~lr&Ke,j[26]=dt^~Mt&xt,j[27]=Lt^~ut&ar,j[36]=$t^~ct&Vt,j[37]=Ct^~Ht&zt,j[46]=wi^~Ti&Rr,j[47]=xi^~Sn&Ut,j[8]=We^~et&ke,j[9]=lt^~Je&Ne,j[18]=Xt^~vt>,j[19]=lr^~Ke&wt,j[28]=Mt^~xt&rr,j[29]=ut^~ar&kt,j[38]=ct^~Vt&ht,j[39]=Ht^~zt&Et,j[48]=Ti^~Rr&Sr,j[49]=Sn^~Ut&er,j[0]^=b[Z],j[1]^=b[Z+1]};if(a)t.exports=v;else for(R=0;R{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Ej=WSe();var eI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(eI||(eI={}));var Dc;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Dc||(Dc={}));const Cj="0123456789abcdef";class En{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();T3[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(xj>T3[n])&&console.log.apply(console,r)}debug(...e){this._log(En.levels.DEBUG,e)}info(...e){this._log(En.levels.INFO,e)}warn(...e){this._log(En.levels.WARNING,e)}makeError(e,r,n){if(wj)return this.makeError("censored error",r,{});r||(r=En.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let f="";for(let u=0;u>4],f+=Cj[l[u]&15];i.push(c+"=Uint8Array(0x"+f+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Dc.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Dc.CALL_EXCEPTION:case Dc.INSUFFICIENT_FUNDS:case Dc.MISSING_NEW:case Dc.NONCE_EXPIRED:case Dc.REPLACEMENT_UNDERPRICED:case Dc.TRANSACTION_REPLACED:case Dc.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,En.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Ej&&this.throwError("platform missing String.prototype.normalize",En.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ej})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,En.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,En.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,En.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",En.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",En.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",En.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return O9||(O9=new En(GSe)),O9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",En.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),bj){if(!e)return;this.globalLogger().throwError("error censorship permanent",En.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}wj=!!e,bj=!!r}static setLogLevel(e){const r=T3[e.toLowerCase()];if(r==null){En.globalLogger().warn("invalid log level - "+e);return}xj=r}static from(e){return new En(e)}}En.errors=Dc;En.levels=eI;const KSe="bytes/5.7.0",ri=new En(KSe);function kX(t){return!!t.toHexString}function $v(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return $v(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function YSe(t){return Vl(t)&&!(t.length%2)||wM(t)}function Aj(t){return typeof t=="number"&&t==t&&t%1===0}function wM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Aj(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function gi(t,e){if(e||(e={}),typeof t=="number"){ri.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),$v(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),kX(t)&&(t=t.toHexString()),Vl(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ri.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;igi(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),$v(n)}function JSe(t,e){t=gi(t),t.length>e&&ri.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),$v(r)}function Vl(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const D9="0123456789abcdef";function ia(t,e){if(e||(e={}),typeof t=="number"){ri.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=D9[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),kX(t))return t.toHexString();if(Vl(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ri.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(wM(t)){let r="0x";for(let n=0;n>4]+D9[i&15]}return r}return ri.throwArgumentError("invalid hexlify value","value",t)}function ZSe(t){if(typeof t!="string")t=ia(t);else if(!Vl(t)||t.length%2)return null;return(t.length-2)/2}function Sj(t,e,r){return typeof t!="string"?t=ia(t):(!Vl(t)||t.length%2)&&ri.throwArgumentError("invalid hexData","value",t),e=2+2*e,"0x"+t.substring(e)}function qv(t,e){for(typeof t!="string"?t=ia(t):Vl(t)||ri.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ri.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function MX(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(YSe(t)){let r=gi(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ia(r.slice(0,32)),e.s=ia(r.slice(32,64))):r.length===65?(e.r=ia(r.slice(0,32)),e.s=ia(r.slice(32,64)),e.v=r[64]):ri.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ri.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ia(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=JSe(gi(e._vs),32);e._vs=ia(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&ri.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=ia(i);e.s==null?e.s=o:e.s!==o&&ri.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ri.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ri.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Vl(e.r)?ri.throwArgumentError("signature missing or invalid r","signature",t):e.r=qv(e.r,32),e.s==null||!Vl(e.s)?ri.throwArgumentError("signature missing or invalid s","signature",t):e.s=qv(e.s,32);const r=gi(e.s);r[0]>=128&&ri.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=ia(r);e._vs&&(Vl(e._vs)||ri.throwArgumentError("signature invalid _vs","signature",t),e._vs=qv(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ri.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function xM(t){return"0x"+HSe.keccak_256(gi(t))}var EM={exports:{}};const XSe={},e7e=Object.freeze(Object.defineProperty({__proto__:null,default:XSe},Symbol.toStringTag,{value:"Module"})),aE=V$(e7e);EM.exports;(function(t){(function(e,r){function n(M,v){if(!M)throw new Error(v||"Assertion failed")}function i(M,v){M.super_=v;var m=function(){};m.prototype=v.prototype,M.prototype=new m,M.prototype.constructor=M}function s(M,v,m){if(s.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(M||0,v||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=aE.Buffer}catch{}s.isBN=function(v){return v instanceof s?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===s.wordSize&&Array.isArray(v.words)},s.max=function(v,m){return v.cmp(m)>0?v:m},s.min=function(v,m){return v.cmp(m)<0?v:m},s.prototype._init=function(v,m,R){if(typeof v=="number")return this._initNumber(v,m,R);if(typeof v=="object")return this._initArray(v,m,R);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var B=0;v[0]==="-"&&(B++,this.negative=1),B=0;B-=3)x=v[B]|v[B-1]<<8|v[B-2]<<16,this.words[E]|=x<>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);else if(R==="le")for(B=0,E=0;B>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);return this._strip()};function a(M,v){var m=M.charCodeAt(v);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+M)}function c(M,v,m){var R=a(M,m);return m-1>=v&&(R|=a(M,m-1)<<4),R}s.prototype._parseHex=function(v,m,R){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var B=0;B=m;B-=2)w=c(v,m,B)<=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8;else{var T=v.length-m;for(B=T%2===0?m+1:m;B=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8}this._strip()};function l(M,v,m,R){for(var B=0,E=0,x=Math.min(M.length,m),w=v;w=49?E=T-49+10:T>=17?E=T-17+10:E=T,n(T>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(v,m){v=v||10,m=m|0||1;var R;if(v===16||v==="hex"){R="";for(var B=0,E=0,x=0;x>>24-B&16777215,B+=2,B>=26&&(B-=26,x--),E!==0||x!==this.length-1?R=p[6-T.length]+T+R:R=T+R}for(E!==0&&(R=E.toString(16)+R);R.length%m!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(v===(v|0)&&v>=2&&v<=36){var k=g[v],H=y[v];R="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(H).toString(v);oe=oe.idivn(H),oe.isZero()?R=j+R:R=p[k-j.length]+j+R}for(this.isZero()&&(R="0"+R);R.length%m!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(v,m){return this.toArrayLike(o,v,m)}),s.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};var b=function(v,m){return v.allocUnsafe?v.allocUnsafe(m):new v(m)};s.prototype.toArrayLike=function(v,m,R){this._strip();var B=this.byteLength(),E=R||Math.max(1,B);n(B<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var x=b(v,E),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](x,B),x},s.prototype._toArrayLikeLE=function(v,m){for(var R=0,B=0,E=0,x=0;E>8&255),R>16&255),x===6?(R>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(R=0&&(v[R--]=w>>8&255),R>=0&&(v[R--]=w>>16&255),x===6?(R>=0&&(v[R--]=w>>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(R>=0)for(v[R--]=B;R>=0;)v[R--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,R=0;return m>=4096&&(R+=13,m>>>=13),m>=64&&(R+=7,m>>>=7),m>=8&&(R+=4,m>>>=4),m>=2&&(R+=2,m>>>=2),R+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,R=0;return m&8191||(R+=13,m>>>=13),m&127||(R+=7,m>>>=7),m&15||(R+=4,m>>>=4),m&3||(R+=2,m>>>=2),m&1||R++,R},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(M){for(var v=new Array(M.bitLength()),m=0;m>>B&1}return v}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},s.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},s.prototype.iuand=function(v){var m;this.length>v.length?m=v:m=this;for(var R=0;Rv.length?this.clone().iand(v):v.clone().iand(this)},s.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},s.prototype.iuxor=function(v){var m,R;this.length>v.length?(m=this,R=v):(m=v,R=this);for(var B=0;Bv.length?this.clone().ixor(v):v.clone().ixor(this)},s.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},s.prototype.inotn=function(v){n(typeof v=="number"&&v>=0);var m=Math.ceil(v/26)|0,R=v%26;this._expand(m),R>0&&m--;for(var B=0;B0&&(this.words[B]=~this.words[B]&67108863>>26-R),this._strip()},s.prototype.notn=function(v){return this.clone().inotn(v)},s.prototype.setn=function(v,m){n(typeof v=="number"&&v>=0);var R=v/26|0,B=v%26;return this._expand(R+1),m?this.words[R]=this.words[R]|1<v.length?(R=this,B=v):(R=v,B=this);for(var E=0,x=0;x>>26;for(;E!==0&&x>>26;if(this.length=R.length,E!==0)this.words[this.length]=E,this.length++;else if(R!==this)for(;xv.length?this.clone().iadd(v):v.clone().iadd(this)},s.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var R=this.cmp(v);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,E;R>0?(B=this,E=v):(B=v,E=this);for(var x=0,w=0;w>26,this.words[w]=m&67108863;for(;x!==0&&w>26,this.words[w]=m&67108863;if(x===0&&w>>26,oe=T&67108863,j=Math.min(k,v.length-1),X=Math.max(0,k-M.length+1);X<=j;X++){var G=k-X|0;B=M.words[G]|0,E=v.words[X]|0,x=B*E+oe,H+=x/67108864|0,oe=x&67108863}m.words[k]=oe|0,T=H|0}return T!==0?m.words[k]=T|0:m.length--,m._strip()}var S=function(v,m,R){var B=v.words,E=m.words,x=R.words,w=0,T,k,H,oe=B[0]|0,j=oe&8191,X=oe>>>13,G=B[1]|0,Z=G&8191,ee=G>>>13,N=B[2]|0,te=N&8191,fe=N>>>13,Ee=B[3]|0,_e=Ee&8191,Re=Ee>>>13,Te=B[4]|0,De=Te&8191,ze=Te>>>13,et=B[5]|0,Je=et&8191,ke=et>>>13,Ne=B[6]|0,tt=Ne&8191,Ze=Ne>>>13,st=B[7]|0,nt=st&8191,We=st>>>13,lt=B[8]|0,vt=lt&8191,Ke=lt>>>13,gt=B[9]|0,wt=gt&8191,rt=gt>>>13,It=E[0]|0,At=It&8191,Tt=It>>>13,Xt=E[1]|0,lr=Xt&8191,xt=Xt>>>13,ar=E[2]|0,rr=ar&8191,kt=ar>>>13,Dt=E[3]|0,Nt=Dt&8191,dt=Dt>>>13,Lt=E[4]|0,Mt=Lt&8191,ut=Lt>>>13,Vt=E[5]|0,zt=Vt&8191,ht=Vt>>>13,Et=E[6]|0,Bt=Et&8191,He=Et>>>13,$t=E[7]|0,Ct=$t&8191,ct=$t>>>13,Ht=E[8]|0,Rr=Ht&8191,Ut=Ht>>>13,Sr=E[9]|0,er=Sr&8191,kr=Sr>>>13;R.negative=v.negative^m.negative,R.length=19,T=Math.imul(j,At),k=Math.imul(j,Tt),k=k+Math.imul(X,At)|0,H=Math.imul(X,Tt);var bi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(bi>>>26)|0,bi&=67108863,T=Math.imul(Z,At),k=Math.imul(Z,Tt),k=k+Math.imul(ee,At)|0,H=Math.imul(ee,Tt),T=T+Math.imul(j,lr)|0,k=k+Math.imul(j,xt)|0,k=k+Math.imul(X,lr)|0,H=H+Math.imul(X,xt)|0;var wi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(wi>>>26)|0,wi&=67108863,T=Math.imul(te,At),k=Math.imul(te,Tt),k=k+Math.imul(fe,At)|0,H=Math.imul(fe,Tt),T=T+Math.imul(Z,lr)|0,k=k+Math.imul(Z,xt)|0,k=k+Math.imul(ee,lr)|0,H=H+Math.imul(ee,xt)|0,T=T+Math.imul(j,rr)|0,k=k+Math.imul(j,kt)|0,k=k+Math.imul(X,rr)|0,H=H+Math.imul(X,kt)|0;var xi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(xi>>>26)|0,xi&=67108863,T=Math.imul(_e,At),k=Math.imul(_e,Tt),k=k+Math.imul(Re,At)|0,H=Math.imul(Re,Tt),T=T+Math.imul(te,lr)|0,k=k+Math.imul(te,xt)|0,k=k+Math.imul(fe,lr)|0,H=H+Math.imul(fe,xt)|0,T=T+Math.imul(Z,rr)|0,k=k+Math.imul(Z,kt)|0,k=k+Math.imul(ee,rr)|0,H=H+Math.imul(ee,kt)|0,T=T+Math.imul(j,Nt)|0,k=k+Math.imul(j,dt)|0,k=k+Math.imul(X,Nt)|0,H=H+Math.imul(X,dt)|0;var Ti=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,T=Math.imul(De,At),k=Math.imul(De,Tt),k=k+Math.imul(ze,At)|0,H=Math.imul(ze,Tt),T=T+Math.imul(_e,lr)|0,k=k+Math.imul(_e,xt)|0,k=k+Math.imul(Re,lr)|0,H=H+Math.imul(Re,xt)|0,T=T+Math.imul(te,rr)|0,k=k+Math.imul(te,kt)|0,k=k+Math.imul(fe,rr)|0,H=H+Math.imul(fe,kt)|0,T=T+Math.imul(Z,Nt)|0,k=k+Math.imul(Z,dt)|0,k=k+Math.imul(ee,Nt)|0,H=H+Math.imul(ee,dt)|0,T=T+Math.imul(j,Mt)|0,k=k+Math.imul(j,ut)|0,k=k+Math.imul(X,Mt)|0,H=H+Math.imul(X,ut)|0;var Sn=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,T=Math.imul(Je,At),k=Math.imul(Je,Tt),k=k+Math.imul(ke,At)|0,H=Math.imul(ke,Tt),T=T+Math.imul(De,lr)|0,k=k+Math.imul(De,xt)|0,k=k+Math.imul(ze,lr)|0,H=H+Math.imul(ze,xt)|0,T=T+Math.imul(_e,rr)|0,k=k+Math.imul(_e,kt)|0,k=k+Math.imul(Re,rr)|0,H=H+Math.imul(Re,kt)|0,T=T+Math.imul(te,Nt)|0,k=k+Math.imul(te,dt)|0,k=k+Math.imul(fe,Nt)|0,H=H+Math.imul(fe,dt)|0,T=T+Math.imul(Z,Mt)|0,k=k+Math.imul(Z,ut)|0,k=k+Math.imul(ee,Mt)|0,H=H+Math.imul(ee,ut)|0,T=T+Math.imul(j,zt)|0,k=k+Math.imul(j,ht)|0,k=k+Math.imul(X,zt)|0,H=H+Math.imul(X,ht)|0;var di=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(di>>>26)|0,di&=67108863,T=Math.imul(tt,At),k=Math.imul(tt,Tt),k=k+Math.imul(Ze,At)|0,H=Math.imul(Ze,Tt),T=T+Math.imul(Je,lr)|0,k=k+Math.imul(Je,xt)|0,k=k+Math.imul(ke,lr)|0,H=H+Math.imul(ke,xt)|0,T=T+Math.imul(De,rr)|0,k=k+Math.imul(De,kt)|0,k=k+Math.imul(ze,rr)|0,H=H+Math.imul(ze,kt)|0,T=T+Math.imul(_e,Nt)|0,k=k+Math.imul(_e,dt)|0,k=k+Math.imul(Re,Nt)|0,H=H+Math.imul(Re,dt)|0,T=T+Math.imul(te,Mt)|0,k=k+Math.imul(te,ut)|0,k=k+Math.imul(fe,Mt)|0,H=H+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,k=k+Math.imul(Z,ht)|0,k=k+Math.imul(ee,zt)|0,H=H+Math.imul(ee,ht)|0,T=T+Math.imul(j,Bt)|0,k=k+Math.imul(j,He)|0,k=k+Math.imul(X,Bt)|0,H=H+Math.imul(X,He)|0;var Fs=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,T=Math.imul(nt,At),k=Math.imul(nt,Tt),k=k+Math.imul(We,At)|0,H=Math.imul(We,Tt),T=T+Math.imul(tt,lr)|0,k=k+Math.imul(tt,xt)|0,k=k+Math.imul(Ze,lr)|0,H=H+Math.imul(Ze,xt)|0,T=T+Math.imul(Je,rr)|0,k=k+Math.imul(Je,kt)|0,k=k+Math.imul(ke,rr)|0,H=H+Math.imul(ke,kt)|0,T=T+Math.imul(De,Nt)|0,k=k+Math.imul(De,dt)|0,k=k+Math.imul(ze,Nt)|0,H=H+Math.imul(ze,dt)|0,T=T+Math.imul(_e,Mt)|0,k=k+Math.imul(_e,ut)|0,k=k+Math.imul(Re,Mt)|0,H=H+Math.imul(Re,ut)|0,T=T+Math.imul(te,zt)|0,k=k+Math.imul(te,ht)|0,k=k+Math.imul(fe,zt)|0,H=H+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Bt)|0,k=k+Math.imul(Z,He)|0,k=k+Math.imul(ee,Bt)|0,H=H+Math.imul(ee,He)|0,T=T+Math.imul(j,Ct)|0,k=k+Math.imul(j,ct)|0,k=k+Math.imul(X,Ct)|0,H=H+Math.imul(X,ct)|0;var hi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(hi>>>26)|0,hi&=67108863,T=Math.imul(vt,At),k=Math.imul(vt,Tt),k=k+Math.imul(Ke,At)|0,H=Math.imul(Ke,Tt),T=T+Math.imul(nt,lr)|0,k=k+Math.imul(nt,xt)|0,k=k+Math.imul(We,lr)|0,H=H+Math.imul(We,xt)|0,T=T+Math.imul(tt,rr)|0,k=k+Math.imul(tt,kt)|0,k=k+Math.imul(Ze,rr)|0,H=H+Math.imul(Ze,kt)|0,T=T+Math.imul(Je,Nt)|0,k=k+Math.imul(Je,dt)|0,k=k+Math.imul(ke,Nt)|0,H=H+Math.imul(ke,dt)|0,T=T+Math.imul(De,Mt)|0,k=k+Math.imul(De,ut)|0,k=k+Math.imul(ze,Mt)|0,H=H+Math.imul(ze,ut)|0,T=T+Math.imul(_e,zt)|0,k=k+Math.imul(_e,ht)|0,k=k+Math.imul(Re,zt)|0,H=H+Math.imul(Re,ht)|0,T=T+Math.imul(te,Bt)|0,k=k+Math.imul(te,He)|0,k=k+Math.imul(fe,Bt)|0,H=H+Math.imul(fe,He)|0,T=T+Math.imul(Z,Ct)|0,k=k+Math.imul(Z,ct)|0,k=k+Math.imul(ee,Ct)|0,H=H+Math.imul(ee,ct)|0,T=T+Math.imul(j,Rr)|0,k=k+Math.imul(j,Ut)|0,k=k+Math.imul(X,Rr)|0,H=H+Math.imul(X,Ut)|0;var jo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(jo>>>26)|0,jo&=67108863,T=Math.imul(wt,At),k=Math.imul(wt,Tt),k=k+Math.imul(rt,At)|0,H=Math.imul(rt,Tt),T=T+Math.imul(vt,lr)|0,k=k+Math.imul(vt,xt)|0,k=k+Math.imul(Ke,lr)|0,H=H+Math.imul(Ke,xt)|0,T=T+Math.imul(nt,rr)|0,k=k+Math.imul(nt,kt)|0,k=k+Math.imul(We,rr)|0,H=H+Math.imul(We,kt)|0,T=T+Math.imul(tt,Nt)|0,k=k+Math.imul(tt,dt)|0,k=k+Math.imul(Ze,Nt)|0,H=H+Math.imul(Ze,dt)|0,T=T+Math.imul(Je,Mt)|0,k=k+Math.imul(Je,ut)|0,k=k+Math.imul(ke,Mt)|0,H=H+Math.imul(ke,ut)|0,T=T+Math.imul(De,zt)|0,k=k+Math.imul(De,ht)|0,k=k+Math.imul(ze,zt)|0,H=H+Math.imul(ze,ht)|0,T=T+Math.imul(_e,Bt)|0,k=k+Math.imul(_e,He)|0,k=k+Math.imul(Re,Bt)|0,H=H+Math.imul(Re,He)|0,T=T+Math.imul(te,Ct)|0,k=k+Math.imul(te,ct)|0,k=k+Math.imul(fe,Ct)|0,H=H+Math.imul(fe,ct)|0,T=T+Math.imul(Z,Rr)|0,k=k+Math.imul(Z,Ut)|0,k=k+Math.imul(ee,Rr)|0,H=H+Math.imul(ee,Ut)|0,T=T+Math.imul(j,er)|0,k=k+Math.imul(j,kr)|0,k=k+Math.imul(X,er)|0,H=H+Math.imul(X,kr)|0;var Uo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,T=Math.imul(wt,lr),k=Math.imul(wt,xt),k=k+Math.imul(rt,lr)|0,H=Math.imul(rt,xt),T=T+Math.imul(vt,rr)|0,k=k+Math.imul(vt,kt)|0,k=k+Math.imul(Ke,rr)|0,H=H+Math.imul(Ke,kt)|0,T=T+Math.imul(nt,Nt)|0,k=k+Math.imul(nt,dt)|0,k=k+Math.imul(We,Nt)|0,H=H+Math.imul(We,dt)|0,T=T+Math.imul(tt,Mt)|0,k=k+Math.imul(tt,ut)|0,k=k+Math.imul(Ze,Mt)|0,H=H+Math.imul(Ze,ut)|0,T=T+Math.imul(Je,zt)|0,k=k+Math.imul(Je,ht)|0,k=k+Math.imul(ke,zt)|0,H=H+Math.imul(ke,ht)|0,T=T+Math.imul(De,Bt)|0,k=k+Math.imul(De,He)|0,k=k+Math.imul(ze,Bt)|0,H=H+Math.imul(ze,He)|0,T=T+Math.imul(_e,Ct)|0,k=k+Math.imul(_e,ct)|0,k=k+Math.imul(Re,Ct)|0,H=H+Math.imul(Re,ct)|0,T=T+Math.imul(te,Rr)|0,k=k+Math.imul(te,Ut)|0,k=k+Math.imul(fe,Rr)|0,H=H+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,er)|0,k=k+Math.imul(Z,kr)|0,k=k+Math.imul(ee,er)|0,H=H+Math.imul(ee,kr)|0;var pi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(pi>>>26)|0,pi&=67108863,T=Math.imul(wt,rr),k=Math.imul(wt,kt),k=k+Math.imul(rt,rr)|0,H=Math.imul(rt,kt),T=T+Math.imul(vt,Nt)|0,k=k+Math.imul(vt,dt)|0,k=k+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,dt)|0,T=T+Math.imul(nt,Mt)|0,k=k+Math.imul(nt,ut)|0,k=k+Math.imul(We,Mt)|0,H=H+Math.imul(We,ut)|0,T=T+Math.imul(tt,zt)|0,k=k+Math.imul(tt,ht)|0,k=k+Math.imul(Ze,zt)|0,H=H+Math.imul(Ze,ht)|0,T=T+Math.imul(Je,Bt)|0,k=k+Math.imul(Je,He)|0,k=k+Math.imul(ke,Bt)|0,H=H+Math.imul(ke,He)|0,T=T+Math.imul(De,Ct)|0,k=k+Math.imul(De,ct)|0,k=k+Math.imul(ze,Ct)|0,H=H+Math.imul(ze,ct)|0,T=T+Math.imul(_e,Rr)|0,k=k+Math.imul(_e,Ut)|0,k=k+Math.imul(Re,Rr)|0,H=H+Math.imul(Re,Ut)|0,T=T+Math.imul(te,er)|0,k=k+Math.imul(te,kr)|0,k=k+Math.imul(fe,er)|0,H=H+Math.imul(fe,kr)|0;var oo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(oo>>>26)|0,oo&=67108863,T=Math.imul(wt,Nt),k=Math.imul(wt,dt),k=k+Math.imul(rt,Nt)|0,H=Math.imul(rt,dt),T=T+Math.imul(vt,Mt)|0,k=k+Math.imul(vt,ut)|0,k=k+Math.imul(Ke,Mt)|0,H=H+Math.imul(Ke,ut)|0,T=T+Math.imul(nt,zt)|0,k=k+Math.imul(nt,ht)|0,k=k+Math.imul(We,zt)|0,H=H+Math.imul(We,ht)|0,T=T+Math.imul(tt,Bt)|0,k=k+Math.imul(tt,He)|0,k=k+Math.imul(Ze,Bt)|0,H=H+Math.imul(Ze,He)|0,T=T+Math.imul(Je,Ct)|0,k=k+Math.imul(Je,ct)|0,k=k+Math.imul(ke,Ct)|0,H=H+Math.imul(ke,ct)|0,T=T+Math.imul(De,Rr)|0,k=k+Math.imul(De,Ut)|0,k=k+Math.imul(ze,Rr)|0,H=H+Math.imul(ze,Ut)|0,T=T+Math.imul(_e,er)|0,k=k+Math.imul(_e,kr)|0,k=k+Math.imul(Re,er)|0,H=H+Math.imul(Re,kr)|0;var ao=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(ao>>>26)|0,ao&=67108863,T=Math.imul(wt,Mt),k=Math.imul(wt,ut),k=k+Math.imul(rt,Mt)|0,H=Math.imul(rt,ut),T=T+Math.imul(vt,zt)|0,k=k+Math.imul(vt,ht)|0,k=k+Math.imul(Ke,zt)|0,H=H+Math.imul(Ke,ht)|0,T=T+Math.imul(nt,Bt)|0,k=k+Math.imul(nt,He)|0,k=k+Math.imul(We,Bt)|0,H=H+Math.imul(We,He)|0,T=T+Math.imul(tt,Ct)|0,k=k+Math.imul(tt,ct)|0,k=k+Math.imul(Ze,Ct)|0,H=H+Math.imul(Ze,ct)|0,T=T+Math.imul(Je,Rr)|0,k=k+Math.imul(Je,Ut)|0,k=k+Math.imul(ke,Rr)|0,H=H+Math.imul(ke,Ut)|0,T=T+Math.imul(De,er)|0,k=k+Math.imul(De,kr)|0,k=k+Math.imul(ze,er)|0,H=H+Math.imul(ze,kr)|0;var _n=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(wt,zt),k=Math.imul(wt,ht),k=k+Math.imul(rt,zt)|0,H=Math.imul(rt,ht),T=T+Math.imul(vt,Bt)|0,k=k+Math.imul(vt,He)|0,k=k+Math.imul(Ke,Bt)|0,H=H+Math.imul(Ke,He)|0,T=T+Math.imul(nt,Ct)|0,k=k+Math.imul(nt,ct)|0,k=k+Math.imul(We,Ct)|0,H=H+Math.imul(We,ct)|0,T=T+Math.imul(tt,Rr)|0,k=k+Math.imul(tt,Ut)|0,k=k+Math.imul(Ze,Rr)|0,H=H+Math.imul(Ze,Ut)|0,T=T+Math.imul(Je,er)|0,k=k+Math.imul(Je,kr)|0,k=k+Math.imul(ke,er)|0,H=H+Math.imul(ke,kr)|0;var $o=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+($o>>>26)|0,$o&=67108863,T=Math.imul(wt,Bt),k=Math.imul(wt,He),k=k+Math.imul(rt,Bt)|0,H=Math.imul(rt,He),T=T+Math.imul(vt,Ct)|0,k=k+Math.imul(vt,ct)|0,k=k+Math.imul(Ke,Ct)|0,H=H+Math.imul(Ke,ct)|0,T=T+Math.imul(nt,Rr)|0,k=k+Math.imul(nt,Ut)|0,k=k+Math.imul(We,Rr)|0,H=H+Math.imul(We,Ut)|0,T=T+Math.imul(tt,er)|0,k=k+Math.imul(tt,kr)|0,k=k+Math.imul(Ze,er)|0,H=H+Math.imul(Ze,kr)|0;var Gi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,T=Math.imul(wt,Ct),k=Math.imul(wt,ct),k=k+Math.imul(rt,Ct)|0,H=Math.imul(rt,ct),T=T+Math.imul(vt,Rr)|0,k=k+Math.imul(vt,Ut)|0,k=k+Math.imul(Ke,Rr)|0,H=H+Math.imul(Ke,Ut)|0,T=T+Math.imul(nt,er)|0,k=k+Math.imul(nt,kr)|0,k=k+Math.imul(We,er)|0,H=H+Math.imul(We,kr)|0;var qo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(qo>>>26)|0,qo&=67108863,T=Math.imul(wt,Rr),k=Math.imul(wt,Ut),k=k+Math.imul(rt,Rr)|0,H=Math.imul(rt,Ut),T=T+Math.imul(vt,er)|0,k=k+Math.imul(vt,kr)|0,k=k+Math.imul(Ke,er)|0,H=H+Math.imul(Ke,kr)|0;var Ca=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,T=Math.imul(wt,er),k=Math.imul(wt,kr),k=k+Math.imul(rt,er)|0,H=Math.imul(rt,kr);var co=(w+T|0)+((k&8191)<<13)|0;return w=(H+(k>>>13)|0)+(co>>>26)|0,co&=67108863,x[0]=bi,x[1]=wi,x[2]=xi,x[3]=Ti,x[4]=Sn,x[5]=di,x[6]=Fs,x[7]=hi,x[8]=jo,x[9]=Uo,x[10]=pi,x[11]=oo,x[12]=ao,x[13]=_n,x[14]=$o,x[15]=Gi,x[16]=qo,x[17]=Ca,x[18]=co,w!==0&&(x[19]=w,R.length++),R};Math.imul||(S=C);function O(M,v,m){m.negative=v.negative^M.negative,m.length=M.length+v.length;for(var R=0,B=0,E=0;E>>26)|0,B+=x>>>26,x&=67108863}m.words[E]=w,R=x,x=B}return R!==0?m.words[E]=R:m.length--,m._strip()}function L(M,v,m){return O(M,v,m)}s.prototype.mulTo=function(v,m){var R,B=this.length+v.length;return this.length===10&&v.length===10?R=S(this,v,m):B<63?R=C(this,v,m):B<1024?R=O(this,v,m):R=L(this,v,m),R},s.prototype.mul=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},s.prototype.mulf=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),L(this,v,m)},s.prototype.imul=function(v){return this.clone().mulTo(v,this)},s.prototype.imuln=function(v){var m=v<0;m&&(v=-v),n(typeof v=="number"),n(v<67108864);for(var R=0,B=0;B>=26,R+=E/67108864|0,R+=x>>>26,this.words[B]=x&67108863}return R!==0&&(this.words[B]=R,this.length++),m?this.ineg():this},s.prototype.muln=function(v){return this.clone().imuln(v)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(v){var m=I(v);if(m.length===0)return new s(1);for(var R=this,B=0;B=0);var m=v%26,R=(v-m)/26,B=67108863>>>26-m<<26-m,E;if(m!==0){var x=0;for(E=0;E>>26-m}x&&(this.words[E]=x,this.length++)}if(R!==0){for(E=this.length-1;E>=0;E--)this.words[E+R]=this.words[E];for(E=0;E=0);var B;m?B=(m-m%26)/26:B=0;var E=v%26,x=Math.min((v-E)/26,this.length),w=67108863^67108863>>>E<x)for(this.length-=x,k=0;k=0&&(H!==0||k>=B);k--){var oe=this.words[k]|0;this.words[k]=H<<26-E|oe>>>E,H=oe&w}return T&&H!==0&&(T.words[T.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(v,m,R){return n(this.negative===0),this.iushrn(v,m,R)},s.prototype.shln=function(v){return this.clone().ishln(v)},s.prototype.ushln=function(v){return this.clone().iushln(v)},s.prototype.shrn=function(v){return this.clone().ishrn(v)},s.prototype.ushrn=function(v){return this.clone().iushrn(v)},s.prototype.testn=function(v){n(typeof v=="number"&&v>=0);var m=v%26,R=(v-m)/26,B=1<=0);var m=v%26,R=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(m!==0&&R++,this.length=Math.min(R,this.length),m!==0){var B=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(v){if(n(typeof v=="number"),n(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(T/67108864|0),this.words[E+R]=x&67108863}for(;E>26,this.words[E+R]=x&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,E=0;E>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var R=this.length-v.length,B=this.clone(),E=v,x=E.words[E.length-1]|0,w=this._countBits(x);R=26-w,R!==0&&(E=E.ushln(R),B.iushln(R),x=E.words[E.length-1]|0);var T=B.length-E.length,k;if(m!=="mod"){k=new s(null),k.length=T+1,k.words=new Array(k.length);for(var H=0;H=0;j--){var X=(B.words[E.length+j]|0)*67108864+(B.words[E.length+j-1]|0);for(X=Math.min(X/x|0,67108863),B._ishlnsubmul(E,X,j);B.negative!==0;)X--,B.negative=0,B._ishlnsubmul(E,1,j),B.isZero()||(B.negative^=1);k&&(k.words[j]=X)}return k&&k._strip(),B._strip(),m!=="div"&&R!==0&&B.iushrn(R),{div:k||null,mod:B}},s.prototype.divmod=function(v,m,R){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var B,E,x;return this.negative!==0&&v.negative===0?(x=this.neg().divmod(v,m),m!=="mod"&&(B=x.div.neg()),m!=="div"&&(E=x.mod.neg(),R&&E.negative!==0&&E.iadd(v)),{div:B,mod:E}):this.negative===0&&v.negative!==0?(x=this.divmod(v.neg(),m),m!=="mod"&&(B=x.div.neg()),{div:B,mod:x.mod}):this.negative&v.negative?(x=this.neg().divmod(v.neg(),m),m!=="div"&&(E=x.mod.neg(),R&&E.negative!==0&&E.isub(v)),{div:x.div,mod:E}):v.length>this.length||this.cmp(v)<0?{div:new s(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new s(this.modrn(v.words[0]))}:this._wordDiv(v,m)},s.prototype.div=function(v){return this.divmod(v,"div",!1).div},s.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},s.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},s.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var R=m.div.negative!==0?m.mod.isub(v):m.mod,B=v.ushrn(1),E=v.andln(1),x=R.cmp(B);return x<0||E===1&&x===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var R=(1<<26)%v,B=0,E=this.length-1;E>=0;E--)B=(R*B+(this.words[E]|0))%v;return m?-B:B},s.prototype.modn=function(v){return this.modrn(v)},s.prototype.idivn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var R=0,B=this.length-1;B>=0;B--){var E=(this.words[B]|0)+R*67108864;this.words[B]=E/v|0,R=E%v}return this._strip(),m?this.ineg():this},s.prototype.divn=function(v){return this.clone().idivn(v)},s.prototype.egcd=function(v){n(v.negative===0),n(!v.isZero());var m=this,R=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=new s(0),w=new s(1),T=0;m.isEven()&&R.isEven();)m.iushrn(1),R.iushrn(1),++T;for(var k=R.clone(),H=m.clone();!m.isZero();){for(var oe=0,j=1;!(m.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(m.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(k),E.isub(H)),B.iushrn(1),E.iushrn(1);for(var X=0,G=1;!(R.words[0]&G)&&X<26;++X,G<<=1);if(X>0)for(R.iushrn(X);X-- >0;)(x.isOdd()||w.isOdd())&&(x.iadd(k),w.isub(H)),x.iushrn(1),w.iushrn(1);m.cmp(R)>=0?(m.isub(R),B.isub(x),E.isub(w)):(R.isub(m),x.isub(B),w.isub(E))}return{a:x,b:w,gcd:R.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,R=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=R.clone();m.cmpn(1)>0&&R.cmpn(1)>0;){for(var w=0,T=1;!(m.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(m.iushrn(w);w-- >0;)B.isOdd()&&B.iadd(x),B.iushrn(1);for(var k=0,H=1;!(R.words[0]&H)&&k<26;++k,H<<=1);if(k>0)for(R.iushrn(k);k-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);m.cmp(R)>=0?(m.isub(R),B.isub(E)):(R.isub(m),E.isub(B))}var oe;return m.cmpn(1)===0?oe=B:oe=E,oe.cmpn(0)<0&&oe.iadd(v),oe},s.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),R=v.clone();m.negative=0,R.negative=0;for(var B=0;m.isEven()&&R.isEven();B++)m.iushrn(1),R.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;R.isEven();)R.iushrn(1);var E=m.cmp(R);if(E<0){var x=m;m=R,R=x}else if(E===0||R.cmpn(1)===0)break;m.isub(R)}while(!0);return R.iushln(B)},s.prototype.invm=function(v){return this.egcd(v).a.umod(v)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(v){return this.words[0]&v},s.prototype.bincn=function(v){n(typeof v=="number");var m=v%26,R=(v-m)/26,B=1<>>26,w&=67108863,this.words[x]=w}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(v){var m=v<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var R;if(this.length>1)R=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var B=this.words[0]|0;R=B===v?0:Bv.length)return 1;if(this.length=0;R--){var B=this.words[R]|0,E=v.words[R]|0;if(B!==E){BE&&(m=1);break}}return m},s.prototype.gtn=function(v){return this.cmpn(v)===1},s.prototype.gt=function(v){return this.cmp(v)===1},s.prototype.gten=function(v){return this.cmpn(v)>=0},s.prototype.gte=function(v){return this.cmp(v)>=0},s.prototype.ltn=function(v){return this.cmpn(v)===-1},s.prototype.lt=function(v){return this.cmp(v)===-1},s.prototype.lten=function(v){return this.cmpn(v)<=0},s.prototype.lte=function(v){return this.cmp(v)<=0},s.prototype.eqn=function(v){return this.cmpn(v)===0},s.prototype.eq=function(v){return this.cmp(v)===0},s.red=function(v){return new K(v)},s.prototype.toRed=function(v){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(v){return this.red=v,this},s.prototype.forceRed=function(v){return n(!this.red,"Already a number in reduction context"),this._forceRed(v)},s.prototype.redAdd=function(v){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},s.prototype.redIAdd=function(v){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},s.prototype.redSub=function(v){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},s.prototype.redISub=function(v){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},s.prototype.redShl=function(v){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},s.prototype.redMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},s.prototype.redIMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(v){return n(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var F={k256:null,p224:null,p192:null,p25519:null};function z(M,v){this.name=M,this.p=new s(v,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var v=new s(null);return v.words=new Array(Math.ceil(this.n/13)),v},z.prototype.ireduce=function(v){var m=v,R;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),R=m.bitLength();while(R>this.n);var B=R0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},z.prototype.split=function(v,m){v.iushrn(this.n,0,m)},z.prototype.imulK=function(v){return v.imul(this.k)};function _(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(_,z),_.prototype.split=function(v,m){for(var R=4194303,B=Math.min(v.length,9),E=0;E>>22,x=w}x>>>=22,v.words[E-10]=x,x===0&&v.length>10?v.length-=10:v.length-=9},_.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,R=0;R>>=26,v.words[R]=E,m=B}return m!==0&&(v.words[v.length++]=m),v},s._prime=function(v){if(F[v])return F[v];var m;if(v==="k256")m=new _;else if(v==="p224")m=new $;else if(v==="p192")m=new ie;else if(v==="p25519")m=new ce;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(M){if(typeof M=="string"){var v=s._prime(M);this.m=v.p,this.prime=v}else n(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}K.prototype._verify1=function(v){n(v.negative===0,"red works only with positives"),n(v.red,"red works only with red numbers")},K.prototype._verify2=function(v,m){n((v.negative|m.negative)===0,"red works only with positives"),n(v.red&&v.red===m.red,"red works only with red numbers")},K.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(f(v,v.umod(this.m)._forceRed(this)),v)},K.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},K.prototype.add=function(v,m){this._verify2(v,m);var R=v.add(m);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var R=v.iadd(m);return R.cmp(this.m)>=0&&R.isub(this.m),R},K.prototype.sub=function(v,m){this._verify2(v,m);var R=v.sub(m);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var R=v.isub(m);return R.cmpn(0)<0&&R.iadd(this.m),R},K.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},K.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},K.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},K.prototype.isqr=function(v){return this.imul(v,v.clone())},K.prototype.sqr=function(v){return this.mul(v,v)},K.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var R=this.m.add(new s(1)).iushrn(2);return this.pow(v,R)}for(var B=this.m.subn(1),E=0;!B.isZero()&&B.andln(1)===0;)E++,B.iushrn(1);n(!B.isZero());var x=new s(1).toRed(this),w=x.redNeg(),T=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new s(2*k*k).toRed(this);this.pow(k,T).cmp(w)!==0;)k.redIAdd(w);for(var H=this.pow(k,B),oe=this.pow(v,B.addn(1).iushrn(1)),j=this.pow(v,B),X=E;j.cmp(x)!==0;){for(var G=j,Z=0;G.cmp(x)!==0;Z++)G=G.redSqr();n(Z=0;E--){for(var H=m.words[E],oe=k-1;oe>=0;oe--){var j=H>>oe&1;if(x!==B[0]&&(x=this.sqr(x)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==R&&(E!==0||oe!==0))&&(x=this.mul(x,B[w]),T=0,w=0)}k=26}return x},K.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},K.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},s.mont=function(v){return new P(v)};function P(M){K.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(P,K),P.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},P.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},P.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var R=v.imul(m),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=R.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},P.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var R=v.mul(m),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=R.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},P.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,Si)})(EM);var t7e=EM.exports;const sr=_u(t7e);var r7e=sr.BN;function n7e(t){return new r7e(t,36).toString(16)}const i7e="strings/5.7.0",s7e=new En(i7e);var J5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(J5||(J5={}));var _j;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(_j||(_j={}));function N9(t,e=J5.current){e!=J5.current&&(s7e.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return gi(r)}const o7e=`Ethereum Signed Message: -`;function RX(t){return typeof t=="string"&&(t=N9(t)),xM(QSe([N9(o7e),N9(String(t.length)),t]))}const a7e="address/5.7.0",ab=new En(a7e);function Ij(t){Vl(t,20)||ab.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=gi(xM(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const c7e=9007199254740991;function l7e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const CM={};for(let t=0;t<10;t++)CM[String(t)]=String(t);for(let t=0;t<26;t++)CM[String.fromCharCode(65+t)]=String(10+t);const Tj=Math.floor(l7e(c7e));function f7e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>CM[n]).join("");for(;e.length>=Tj;){let n=e.substring(0,Tj);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function u7e(t){let e=null;if(typeof t!="string"&&ab.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Ij(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ab.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==f7e(t)&&ab.throwArgumentError("bad icap checksum","address",t),e=n7e(t.substring(4));e.length<40;)e="0"+e;e=Ij("0x"+e)}else ab.throwArgumentError("invalid address","address",t);return e}function Rm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}var Mx={},Pr={},Yp=OX;function OX(t,e){if(!t)throw new Error(e||"Assertion failed")}OX.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var tI={exports:{}};typeof Object.create=="function"?tI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:tI.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var cE=tI.exports,d7e=Yp,h7e=cE;Pr.inherits=h7e;function p7e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function v7e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):p7e(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Pr.htonl=DX;function y7e(t,e){for(var r="",n=0;n>>0}return s}Pr.join32=m7e;function b7e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Pr.split32=b7e;function w7e(t,e){return t>>>e|t<<32-e}Pr.rotr32=w7e;function x7e(t,e){return t<>>32-e}Pr.rotl32=x7e;function E7e(t,e){return t+e>>>0}Pr.sum32=E7e;function C7e(t,e,r){return t+e+r>>>0}Pr.sum32_3=C7e;function A7e(t,e,r,n){return t+e+r+n>>>0}Pr.sum32_4=A7e;function S7e(t,e,r,n,i){return t+e+r+n+i>>>0}Pr.sum32_5=S7e;function _7e(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Pr.sum64=_7e;function I7e(t,e,r,n){var i=e+n>>>0,s=(i>>0}Pr.sum64_hi=I7e;function T7e(t,e,r,n){var i=e+n;return i>>>0}Pr.sum64_lo=T7e;function P7e(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}Pr.sum64_4_hi=P7e;function k7e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Pr.sum64_4_lo=k7e;function M7e(t,e,r,n,i,s,o,a,c,l){var f=0,u=e;u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0,f+=u>>0}Pr.sum64_5_hi=M7e;function R7e(t,e,r,n,i,s,o,a,c,l){var f=e+n+s+a+l;return f>>>0}Pr.sum64_5_lo=R7e;function O7e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Pr.rotr64_hi=O7e;function D7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Pr.rotr64_lo=D7e;function N7e(t,e,r){return t>>>r}Pr.shr64_hi=N7e;function B7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Pr.shr64_lo=B7e;var Ry={},Pj=Pr,L7e=Yp;function lE(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ry.BlockHash=lE;lE.prototype.update=function(e,r){if(e=Pj.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Pj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}sf.g0_256=q7e;function V7e(t){return zl(t,17)^zl(t,19)^t>>>10}sf.g1_256=V7e;var sy=Pr,z7e=Ry,H7e=sf,B9=sy.rotl32,Om=sy.sum32,G7e=sy.sum32_5,W7e=H7e.ft_1,UX=z7e.BlockHash,K7e=[1518500249,1859775393,2400959708,3395469782];function Xl(){if(!(this instanceof Xl))return new Xl;UX.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}sy.inherits(Xl,UX);var Y7e=Xl;Xl.blockSize=512;Xl.outSize=160;Xl.hmacStrength=80;Xl.padLength=64;Xl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),B_e(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;u?c.push(u,p):c.push(p)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(p>>1)-1?b=(p>>1)-I:b=I,g.isubn(b)):b=0,u[y]=b,g.iushrn(1)}return u}r.getNAF=n;function i(c,l){var f=[[],[]];c=c.clone(),l=l.clone();for(var u=0,p=0,g;c.cmpn(-u)>0||l.cmpn(-p)>0;){var y=c.andln(3)+u&3,b=l.andln(3)+p&3;y===3&&(y=-1),b===3&&(b=-1);var I;y&1?(g=c.andln(7)+u&7,(g===3||g===5)&&b===2?I=-y:I=y):I=0,f[0].push(I);var C;b&1?(g=l.andln(7)+p&7,(g===3||g===5)&&y===2?C=-b:C=b):C=0,f[1].push(C),2*u===I+1&&(u=1-u),2*p===C+1&&(p=1-p),c.iushrn(1),l.iushrn(1)}return f}r.getJSF=i;function s(c,l,f){var u="_"+l;c.prototype[l]=function(){return this[u]!==void 0?this[u]:this[u]=f.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new sr(c,"hex","le")}r.intFromLE=a}),Z5=wa.getNAF,j_e=wa.getJSF,X5=wa.assert;function Oh(t,e){this.type=t,this.p=new sr(e.p,16),this.red=e.prime?sr.red(e.prime):sr.mont(this.p),this.zero=new sr(0).toRed(this.red),this.one=new sr(1).toRed(this.red),this.two=new sr(2).toRed(this.red),this.n=e.n&&new sr(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Qp=Oh;Oh.prototype.point=function(){throw new Error("Not implemented")};Oh.prototype.validate=function(){throw new Error("Not implemented")};Oh.prototype._fixedNafMul=function(e,r){X5(e.precomputed);var n=e._getDoubles(),i=Z5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];X5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Oh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=Z5(n[y],o[y],this._bitLength),c[b]=Z5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=j_e(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var $=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};cc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};lc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};lc.prototype.pointFromX=function(e,r){e=new sr(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};lc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};lc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};zi.prototype.isInfinity=function(){return this.inf};zi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};zi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};zi.prototype.getX=function(){return this.x.fromRed()};zi.prototype.getY=function(){return this.y.fromRed()};zi.prototype.mul=function(e){return e=new sr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};zi.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};zi.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};zi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};zi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};zi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function cs(t,e,r,n){Qp.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new sr(0)):(this.x=new sr(e,16),this.y=new sr(r,16),this.z=new sr(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}SM(cs,Qp.BasePoint);lc.prototype.jpoint=function(e,r,n){return new cs(this,e,r,n)};cs.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};cs.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};cs.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};cs.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};cs.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};cs.prototype.inspect=function(){return this.isInfinity()?"":""};cs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var P3=Ny(function(t,e){var r=e;r.base=Qp,r.short=$_e,r.mont=null,r.edwards=null}),k3=Ny(function(t,e){var r=e,n=wa.assert;function i(a){a.type==="short"?this.curve=new P3.short(a):a.type==="edwards"?this.curve=new P3.edwards(a):this.curve=new P3.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:If.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:If.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:If.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:If.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:If.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:If.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:If.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function ph(t){if(!(this instanceof ph))return new ph(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Hc.toArray(t.entropy,t.entropyEnc||"hex"),r=Hc.toArray(t.nonce,t.nonceEnc||"hex"),n=Hc.toArray(t.pers,t.persEnc||"hex");AM(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var ZX=ph;ph.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};ph.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Hc.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var q_e=wa.assert;function fE(t,e){if(t instanceof fE)return t;this._importDER(t,e)||(q_e(t.r&&t.s,"Signature without r or s"),this.r=new sr(t.r,16),this.s=new sr(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var uE=fE;function V_e(){this.place=0}function j9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function Oj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}fE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Oj(r),n=Oj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];U9(i,r.length),i=i.concat(r),i.push(2),U9(i,n.length);var s=i.concat(n),o=[48];return U9(o,s.length),o=o.concat(s),wa.encode(o,e)};var z_e=function(){throw new Error("unsupported")},XX=wa.assert;function oc(t){if(!(this instanceof oc))return new oc(t);typeof t=="string"&&(XX(Object.prototype.hasOwnProperty.call(k3,t),"Unknown curve "+t),t=k3[t]),t instanceof k3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var H_e=oc;oc.prototype.keyPair=function(e){return new _M(this,e)};oc.prototype.keyFromPrivate=function(e,r){return _M.fromPrivate(this,e,r)};oc.prototype.keyFromPublic=function(e,r){return _M.fromPublic(this,e,r)};oc.prototype.genKeyPair=function(e){e||(e={});for(var r=new ZX({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||z_e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new sr(2));;){var s=new sr(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};oc.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};oc.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new sr(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new ZX({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new sr(1)),f=0;;f++){var u=i.k?i.k(f):new sr(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new uE({r:y,s:b,recoveryParam:I})}}}}}};oc.prototype.verify=function(e,r,n,i){e=this._truncateToN(new sr(e,16)),n=this.keyFromPublic(n,i),r=new uE(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};oc.prototype.recoverPubKey=function(t,e,r,n){XX((3&r)===r,"The recovery param is more than two bits"),e=new uE(e,n);var i=this.n,s=new sr(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};oc.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new uE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var G_e=Ny(function(t,e){var r=e;r.version="6.5.4",r.utils=wa,r.rand=function(){throw new Error("unsupported")},r.curve=P3,r.curves=k3,r.ec=H_e,r.eddsa=null}),W_e=G_e.ec;const K_e="signing-key/5.7.0",sI=new En(K_e);let $9=null;function fd(){return $9||($9=new W_e("secp256k1")),$9}class Y_e{constructor(e){Rm(this,"curve","secp256k1"),Rm(this,"privateKey",ia(e)),ZSe(this.privateKey)!==32&&sI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=fd().keyFromPrivate(gi(this.privateKey));Rm(this,"publicKey","0x"+r.getPublic(!1,"hex")),Rm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Rm(this,"_isSigningKey",!0)}_addPoint(e){const r=fd().keyFromPublic(gi(this.publicKey)),n=fd().keyFromPublic(gi(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=fd().keyFromPrivate(gi(this.privateKey)),n=gi(e);n.length!==32&&sI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return MX({recoveryParam:i.recoveryParam,r:qv("0x"+i.r.toString(16),32),s:qv("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=fd().keyFromPrivate(gi(this.privateKey)),n=fd().keyFromPublic(gi(eee(e)));return qv("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Q_e(t,e){const r=MX(e),n={r:gi(r.r),s:gi(r.s)};return"0x"+fd().recoverPubKey(gi(t),n,r.recoveryParam).encode("hex",!1)}function eee(t,e){const r=gi(t);return r.length===32?new Y_e(r).publicKey:r.length===33?"0x"+fd().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ia(r):sI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Dj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Dj||(Dj={}));function J_e(t){const e=eee(t);return u7e(Sj(xM(Sj(e,1)),12))}function Z_e(t,e){return J_e(Q_e(gi(t),e))}var IM={},dE={},cr={},tee={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,f=a&65535,u=c>>>16&65535,p=c&65535;return f*p+(l*p+f*u<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(tee);Object.defineProperty(cr,"__esModule",{value:!0});var ree=tee;function X_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}cr.readInt16BE=X_e;function eIe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}cr.readUint16BE=eIe;function tIe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}cr.readInt16LE=tIe;function rIe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}cr.readUint16LE=rIe;function nee(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}cr.writeUint16BE=nee;cr.writeInt16BE=nee;function iee(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}cr.writeUint16LE=iee;cr.writeInt16LE=iee;function oI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}cr.readInt32BE=oI;function aI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}cr.readUint32BE=aI;function cI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}cr.readInt32LE=cI;function lI(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}cr.readUint32LE=lI;function e4(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}cr.writeUint32BE=e4;cr.writeInt32BE=e4;function t4(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}cr.writeUint32LE=t4;cr.writeInt32LE=t4;function nIe(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}cr.readInt64BE=nIe;function iIe(t,e){e===void 0&&(e=0);var r=aI(t,e),n=aI(t,e+4);return r*4294967296+n}cr.readUint64BE=iIe;function sIe(t,e){e===void 0&&(e=0);var r=cI(t,e),n=cI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}cr.readInt64LE=sIe;function oIe(t,e){e===void 0&&(e=0);var r=lI(t,e),n=lI(t,e+4);return n*4294967296+r}cr.readUint64LE=oIe;function see(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),e4(t/4294967296>>>0,e,r),e4(t>>>0,e,r+4),e}cr.writeUint64BE=see;cr.writeInt64BE=see;function oee(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),t4(t>>>0,e,r),t4(t/4294967296>>>0,e,r+4),e}cr.writeUint64LE=oee;cr.writeInt64LE=oee;function aIe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}cr.readUintBE=aIe;function cIe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}cr.writeUintBE=lIe;function fIe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!ree.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|m<<16,K=K+m|0,_^=K,_=_>>>20|_<<12,L=L+$|0,R^=L,R=R>>>16|R<<16,P=P+R|0,$^=P,$=$>>>20|$<<12,F=F+ie|0,B^=F,B=B>>>16|B<<16,M=M+B|0,ie^=M,ie=ie>>>20|ie<<12,z=z+ce|0,E^=z,E=E>>>16|E<<16,v=v+E|0,ce^=v,ce=ce>>>20|ce<<12,F=F+ie|0,B^=F,B=B>>>24|B<<8,M=M+B|0,ie^=M,ie=ie>>>25|ie<<7,z=z+ce|0,E^=z,E=E>>>24|E<<8,v=v+E|0,ce^=v,ce=ce>>>25|ce<<7,L=L+$|0,R^=L,R=R>>>24|R<<8,P=P+R|0,$^=P,$=$>>>25|$<<7,O=O+_|0,m^=O,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,O=O+$|0,E^=O,E=E>>>16|E<<16,M=M+E|0,$^=M,$=$>>>20|$<<12,L=L+ie|0,m^=L,m=m>>>16|m<<16,v=v+m|0,ie^=v,ie=ie>>>20|ie<<12,F=F+ce|0,R^=F,R=R>>>16|R<<16,K=K+R|0,ce^=K,ce=ce>>>20|ce<<12,z=z+_|0,B^=z,B=B>>>16|B<<16,P=P+B|0,_^=P,_=_>>>20|_<<12,F=F+ce|0,R^=F,R=R>>>24|R<<8,K=K+R|0,ce^=K,ce=ce>>>25|ce<<7,z=z+_|0,B^=z,B=B>>>24|B<<8,P=P+B|0,_^=P,_=_>>>25|_<<7,L=L+ie|0,m^=L,m=m>>>24|m<<8,v=v+m|0,ie^=v,ie=ie>>>25|ie<<7,O=O+$|0,E^=O,E=E>>>24|E<<8,M=M+E|0,$^=M,$=$>>>25|$<<7;ms.writeUint32LE(O+n|0,t,0),ms.writeUint32LE(L+i|0,t,4),ms.writeUint32LE(F+s|0,t,8),ms.writeUint32LE(z+o|0,t,12),ms.writeUint32LE(_+a|0,t,16),ms.writeUint32LE($+c|0,t,20),ms.writeUint32LE(ie+l|0,t,24),ms.writeUint32LE(ce+f|0,t,28),ms.writeUint32LE(K+u|0,t,32),ms.writeUint32LE(P+p|0,t,36),ms.writeUint32LE(M+g|0,t,40),ms.writeUint32LE(v+y|0,t,44),ms.writeUint32LE(m+b|0,t,48),ms.writeUint32LE(R+I|0,t,52),ms.writeUint32LE(B+C|0,t,56),ms.writeUint32LE(E+S|0,t,60)}function aee(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var cee={},Dh={};Object.defineProperty(Dh,"__esModule",{value:!0});function AIe(t,e,r){return~(t-1)&e|t-1&r}Dh.select=AIe;function SIe(t,e){return(t|0)-(e|0)-1>>>31&1}Dh.lessOrEqual=SIe;function lee(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Dh.compare=lee;function _Ie(t,e){return t.length===0||e.length===0?!1:lee(t,e)!==0}Dh.equal=_Ie;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Dh,r=xa;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var f=a[4]|a[5]<<8;this._r[2]=(l>>>10|f<<6)&7939;var u=a[6]|a[7]<<8;this._r[3]=(f>>>7|u<<9)&8191;var p=a[8]|a[9]<<8;this._r[4]=(u>>>4|p<<12)&255,this._r[5]=p>>>1&8190;var g=a[10]|a[11]<<8;this._r[6]=(p>>>14|g<<2)&8191;var y=a[12]|a[13]<<8;this._r[7]=(g>>>11|y<<5)&8065;var b=a[14]|a[15]<<8;this._r[8]=(y>>>8|b<<8)&8191,this._r[9]=b>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var f=this._fin?0:2048,u=this._h[0],p=this._h[1],g=this._h[2],y=this._h[3],b=this._h[4],I=this._h[5],C=this._h[6],S=this._h[7],O=this._h[8],L=this._h[9],F=this._r[0],z=this._r[1],_=this._r[2],$=this._r[3],ie=this._r[4],ce=this._r[5],K=this._r[6],P=this._r[7],M=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var R=a[c+2]|a[c+3]<<8;p+=(m>>>13|R<<3)&8191;var B=a[c+4]|a[c+5]<<8;g+=(R>>>10|B<<6)&8191;var E=a[c+6]|a[c+7]<<8;y+=(B>>>7|E<<9)&8191;var x=a[c+8]|a[c+9]<<8;b+=(E>>>4|x<<12)&8191,I+=x>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(x>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var k=a[c+14]|a[c+15]<<8;O+=(T>>>8|k<<8)&8191,L+=k>>>5|f;var H=0,oe=H;oe+=u*F,oe+=p*(5*v),oe+=g*(5*M),oe+=y*(5*P),oe+=b*(5*K),H=oe>>>13,oe&=8191,oe+=I*(5*ce),oe+=C*(5*ie),oe+=S*(5*$),oe+=O*(5*_),oe+=L*(5*z),H+=oe>>>13,oe&=8191;var j=H;j+=u*z,j+=p*F,j+=g*(5*v),j+=y*(5*M),j+=b*(5*P),H=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*ce),j+=S*(5*ie),j+=O*(5*$),j+=L*(5*_),H+=j>>>13,j&=8191;var X=H;X+=u*_,X+=p*z,X+=g*F,X+=y*(5*v),X+=b*(5*M),H=X>>>13,X&=8191,X+=I*(5*P),X+=C*(5*K),X+=S*(5*ce),X+=O*(5*ie),X+=L*(5*$),H+=X>>>13,X&=8191;var G=H;G+=u*$,G+=p*_,G+=g*z,G+=y*F,G+=b*(5*v),H=G>>>13,G&=8191,G+=I*(5*M),G+=C*(5*P),G+=S*(5*K),G+=O*(5*ce),G+=L*(5*ie),H+=G>>>13,G&=8191;var Z=H;Z+=u*ie,Z+=p*$,Z+=g*_,Z+=y*z,Z+=b*F,H=Z>>>13,Z&=8191,Z+=I*(5*v),Z+=C*(5*M),Z+=S*(5*P),Z+=O*(5*K),Z+=L*(5*ce),H+=Z>>>13,Z&=8191;var ee=H;ee+=u*ce,ee+=p*ie,ee+=g*$,ee+=y*_,ee+=b*z,H=ee>>>13,ee&=8191,ee+=I*F,ee+=C*(5*v),ee+=S*(5*M),ee+=O*(5*P),ee+=L*(5*K),H+=ee>>>13,ee&=8191;var N=H;N+=u*K,N+=p*ce,N+=g*ie,N+=y*$,N+=b*_,H=N>>>13,N&=8191,N+=I*z,N+=C*F,N+=S*(5*v),N+=O*(5*M),N+=L*(5*P),H+=N>>>13,N&=8191;var te=H;te+=u*P,te+=p*K,te+=g*ce,te+=y*ie,te+=b*$,H=te>>>13,te&=8191,te+=I*_,te+=C*z,te+=S*F,te+=O*(5*v),te+=L*(5*M),H+=te>>>13,te&=8191;var fe=H;fe+=u*M,fe+=p*P,fe+=g*K,fe+=y*ce,fe+=b*ie,H=fe>>>13,fe&=8191,fe+=I*$,fe+=C*_,fe+=S*z,fe+=O*F,fe+=L*(5*v),H+=fe>>>13,fe&=8191;var Ee=H;Ee+=u*v,Ee+=p*M,Ee+=g*P,Ee+=y*K,Ee+=b*ce,H=Ee>>>13,Ee&=8191,Ee+=I*ie,Ee+=C*$,Ee+=S*_,Ee+=O*z,Ee+=L*F,H+=Ee>>>13,Ee&=8191,H=(H<<2)+H|0,H=H+oe|0,oe=H&8191,H=H>>>13,j+=H,u=oe,p=j,g=X,y=G,b=Z,I=ee,C=N,S=te,O=fe,L=Ee,c+=16,l-=16}this._h[0]=u,this._h[1]=p,this._h[2]=g,this._h[3]=y,this._h[4]=b,this._h[5]=I,this._h[6]=C,this._h[7]=S,this._h[8]=O,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),f,u,p,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=f,f=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,l[0]=this._h[0]+5,f=l[0]>>>13,l[0]&=8191,g=1;g<10;g++)l[g]=this._h[g]+f,f=l[g]>>>13,l[g]&=8191;for(l[9]-=8192,u=(f^1)-1,g=0;g<10;g++)l[g]&=u;for(u=~u,g=0;g<10;g++)this._h[g]=this._h[g]&u|l[g];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,p=this._h[0]+this._pad[0],this._h[0]=p&65535,g=1;g<8;g++)p=(this._h[g]+this._pad[g]|0)+(p>>>16)|0,this._h[g]=p&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,f;if(this._leftover){f=16-this._leftover,f>l&&(f=l);for(var u=0;u=16&&(f=l-l%16,this._blocks(a,c,f),c+=f,l-=f),l){for(var u=0;u16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(l,g.length-l.length);var y=new Uint8Array(32);e.stream(this._key,g,y,4);var b=f.length+this.tagLength,I;if(p){if(p.length!==b)throw new Error("ChaCha20Poly1305: incorrect destination length");I=p}else I=new Uint8Array(b);return e.streamXOR(this._key,g,f,I,4),this._authenticate(I.subarray(I.length-this.tagLength,I.length),y,I.subarray(0,I.length-this.tagLength),u),n.wipe(g),I},c.prototype.open=function(l,f,u,p){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length0&&g.update(o.subarray(p.length%16))),g.update(u),u.length%16>0&&g.update(o.subarray(u.length%16));var y=new Uint8Array(8);p&&i.writeUint64LE(p.length,y),g.update(y),i.writeUint64LE(u.length,y),g.update(y);for(var b=g.digest(),I=0;Ithis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let p="";const g=f.length,y=256-256%g;for(;l>0;){const b=i(Math.ceil(l*256/y),u);for(let I=0;I0;I++){const C=b[I];C0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._temp,this._state,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%64<56?64:128;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(a,c,l,f,u){for(;u>=64;){for(var p=c[0],g=c[1],y=c[2],b=c[3],I=c[4],C=c[5],S=c[6],O=c[7],L=0;L<16;L++){var F=f+L*4;a[L]=e.readUint32BE(l,F)}for(var L=16;L<64;L++){var z=a[L-2],_=(z>>>17|z<<15)^(z>>>19|z<<13)^z>>>10;z=a[L-15];var $=(z>>>7|z<<25)^(z>>>18|z<<14)^z>>>3;a[L]=(_+a[L-7]|0)+($+a[L-16]|0)}for(var L=0;L<64;L++){var _=(((I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7))+(I&C^~I&S)|0)+(O+(i[L]+a[L]|0)|0)|0,$=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&g^p&y^g&y)|0;O=S,S=C,C=I,I=b+_|0,b=y,y=g,g=p,p=_+$|0}c[0]+=p,c[1]+=g,c[2]+=y,c[3]+=b,c[4]+=I,c[5]+=C,c[6]+=S,c[7]+=O,f+=64,u-=64}return f}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Ox);var PM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Nh,r=xa;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const F=new Float64Array(16);if(L)for(let z=0;z>16&1),z[ce-1]&=65535;z[15]=_[15]-32767-(z[14]>>16&1);const ie=z[15]>>16&1;z[14]&=65535,a(_,z,1-ie)}for(let $=0;$<16;$++)L[2*$]=_[$]&255,L[2*$+1]=_[$]>>8}function l(L,F){for(let z=0;z<16;z++)L[z]=F[2*z]+(F[2*z+1]<<8);L[15]&=32767}function f(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]+z[_]}function u(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]-z[_]}function p(L,F,z){let _,$,ie=0,ce=0,K=0,P=0,M=0,v=0,m=0,R=0,B=0,E=0,x=0,w=0,T=0,k=0,H=0,oe=0,j=0,X=0,G=0,Z=0,ee=0,N=0,te=0,fe=0,Ee=0,_e=0,Re=0,Te=0,De=0,ze=0,et=0,Je=z[0],ke=z[1],Ne=z[2],tt=z[3],Ze=z[4],st=z[5],nt=z[6],We=z[7],lt=z[8],vt=z[9],Ke=z[10],gt=z[11],wt=z[12],rt=z[13],It=z[14],At=z[15];_=F[0],ie+=_*Je,ce+=_*ke,K+=_*Ne,P+=_*tt,M+=_*Ze,v+=_*st,m+=_*nt,R+=_*We,B+=_*lt,E+=_*vt,x+=_*Ke,w+=_*gt,T+=_*wt,k+=_*rt,H+=_*It,oe+=_*At,_=F[1],ce+=_*Je,K+=_*ke,P+=_*Ne,M+=_*tt,v+=_*Ze,m+=_*st,R+=_*nt,B+=_*We,E+=_*lt,x+=_*vt,w+=_*Ke,T+=_*gt,k+=_*wt,H+=_*rt,oe+=_*It,j+=_*At,_=F[2],K+=_*Je,P+=_*ke,M+=_*Ne,v+=_*tt,m+=_*Ze,R+=_*st,B+=_*nt,E+=_*We,x+=_*lt,w+=_*vt,T+=_*Ke,k+=_*gt,H+=_*wt,oe+=_*rt,j+=_*It,X+=_*At,_=F[3],P+=_*Je,M+=_*ke,v+=_*Ne,m+=_*tt,R+=_*Ze,B+=_*st,E+=_*nt,x+=_*We,w+=_*lt,T+=_*vt,k+=_*Ke,H+=_*gt,oe+=_*wt,j+=_*rt,X+=_*It,G+=_*At,_=F[4],M+=_*Je,v+=_*ke,m+=_*Ne,R+=_*tt,B+=_*Ze,E+=_*st,x+=_*nt,w+=_*We,T+=_*lt,k+=_*vt,H+=_*Ke,oe+=_*gt,j+=_*wt,X+=_*rt,G+=_*It,Z+=_*At,_=F[5],v+=_*Je,m+=_*ke,R+=_*Ne,B+=_*tt,E+=_*Ze,x+=_*st,w+=_*nt,T+=_*We,k+=_*lt,H+=_*vt,oe+=_*Ke,j+=_*gt,X+=_*wt,G+=_*rt,Z+=_*It,ee+=_*At,_=F[6],m+=_*Je,R+=_*ke,B+=_*Ne,E+=_*tt,x+=_*Ze,w+=_*st,T+=_*nt,k+=_*We,H+=_*lt,oe+=_*vt,j+=_*Ke,X+=_*gt,G+=_*wt,Z+=_*rt,ee+=_*It,N+=_*At,_=F[7],R+=_*Je,B+=_*ke,E+=_*Ne,x+=_*tt,w+=_*Ze,T+=_*st,k+=_*nt,H+=_*We,oe+=_*lt,j+=_*vt,X+=_*Ke,G+=_*gt,Z+=_*wt,ee+=_*rt,N+=_*It,te+=_*At,_=F[8],B+=_*Je,E+=_*ke,x+=_*Ne,w+=_*tt,T+=_*Ze,k+=_*st,H+=_*nt,oe+=_*We,j+=_*lt,X+=_*vt,G+=_*Ke,Z+=_*gt,ee+=_*wt,N+=_*rt,te+=_*It,fe+=_*At,_=F[9],E+=_*Je,x+=_*ke,w+=_*Ne,T+=_*tt,k+=_*Ze,H+=_*st,oe+=_*nt,j+=_*We,X+=_*lt,G+=_*vt,Z+=_*Ke,ee+=_*gt,N+=_*wt,te+=_*rt,fe+=_*It,Ee+=_*At,_=F[10],x+=_*Je,w+=_*ke,T+=_*Ne,k+=_*tt,H+=_*Ze,oe+=_*st,j+=_*nt,X+=_*We,G+=_*lt,Z+=_*vt,ee+=_*Ke,N+=_*gt,te+=_*wt,fe+=_*rt,Ee+=_*It,_e+=_*At,_=F[11],w+=_*Je,T+=_*ke,k+=_*Ne,H+=_*tt,oe+=_*Ze,j+=_*st,X+=_*nt,G+=_*We,Z+=_*lt,ee+=_*vt,N+=_*Ke,te+=_*gt,fe+=_*wt,Ee+=_*rt,_e+=_*It,Re+=_*At,_=F[12],T+=_*Je,k+=_*ke,H+=_*Ne,oe+=_*tt,j+=_*Ze,X+=_*st,G+=_*nt,Z+=_*We,ee+=_*lt,N+=_*vt,te+=_*Ke,fe+=_*gt,Ee+=_*wt,_e+=_*rt,Re+=_*It,Te+=_*At,_=F[13],k+=_*Je,H+=_*ke,oe+=_*Ne,j+=_*tt,X+=_*Ze,G+=_*st,Z+=_*nt,ee+=_*We,N+=_*lt,te+=_*vt,fe+=_*Ke,Ee+=_*gt,_e+=_*wt,Re+=_*rt,Te+=_*It,De+=_*At,_=F[14],H+=_*Je,oe+=_*ke,j+=_*Ne,X+=_*tt,G+=_*Ze,Z+=_*st,ee+=_*nt,N+=_*We,te+=_*lt,fe+=_*vt,Ee+=_*Ke,_e+=_*gt,Re+=_*wt,Te+=_*rt,De+=_*It,ze+=_*At,_=F[15],oe+=_*Je,j+=_*ke,X+=_*Ne,G+=_*tt,Z+=_*Ze,ee+=_*st,N+=_*nt,te+=_*We,fe+=_*lt,Ee+=_*vt,_e+=_*Ke,Re+=_*gt,Te+=_*wt,De+=_*rt,ze+=_*It,et+=_*At,ie+=38*j,ce+=38*X,K+=38*G,P+=38*Z,M+=38*ee,v+=38*N,m+=38*te,R+=38*fe,B+=38*Ee,E+=38*_e,x+=38*Re,w+=38*Te,T+=38*De,k+=38*ze,H+=38*et,$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=ce+$+65535,$=Math.floor(_/65536),ce=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=B+$+65535,$=Math.floor(_/65536),B=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=ce+$+65535,$=Math.floor(_/65536),ce=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=B+$+65535,$=Math.floor(_/65536),B=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),L[0]=ie,L[1]=ce,L[2]=K,L[3]=P,L[4]=M,L[5]=v,L[6]=m,L[7]=R,L[8]=B,L[9]=E,L[10]=x,L[11]=w,L[12]=T,L[13]=k,L[14]=H,L[15]=oe}function g(L,F){p(L,F,F)}function y(L,F){const z=n();for(let _=0;_<16;_++)z[_]=F[_];for(let _=253;_>=0;_--)g(z,z),_!==2&&_!==4&&p(z,z,F);for(let _=0;_<16;_++)L[_]=z[_]}function b(L,F){const z=new Uint8Array(32),_=new Float64Array(80),$=n(),ie=n(),ce=n(),K=n(),P=n(),M=n();for(let B=0;B<31;B++)z[B]=L[B];z[31]=L[31]&127|64,z[0]&=248,l(_,F);for(let B=0;B<16;B++)ie[B]=_[B];$[0]=K[0]=1;for(let B=254;B>=0;--B){const E=z[B>>>3]>>>(B&7)&1;a($,ie,E),a(ce,K,E),f(P,$,ce),u($,$,ce),f(ce,ie,K),u(ie,ie,K),g(K,P),g(M,$),p($,ce,$),p(ce,ie,P),f(P,$,ce),u($,$,ce),g(ie,$),u(ce,K,M),p($,ce,s),f($,$,K),p(ce,ce,$),p($,K,M),p(K,ie,_),g(ie,P),a($,ie,E),a(ce,K,E)}for(let B=0;B<16;B++)_[B+16]=$[B],_[B+32]=ce[B],_[B+48]=ie[B],_[B+64]=K[B];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const R=new Uint8Array(32);return c(R,m),R}t.scalarMult=b;function I(L){return b(L,i)}t.scalarMultBase=I;function C(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const F=new Uint8Array(L);return{publicKey:I(F),secretKey:F}}t.generateKeyPairFromSeed=C;function S(L){const F=(0,e.randomBytes)(32,L),z=C(F);return(0,r.wipe)(F),z}t.generateKeyPair=S;function O(L,F,z=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(F.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=b(L,F);if(z){let $=0;for(let ie=0;ie<_.length;ie++)$|=_[ie];if($===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=O})(PM);function dee(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function M3(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=dee(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function UIe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(O);C!==S;){for(var F=y[C],z=0,_=O-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var $=O-I;$!==O&&L[$]===0;)$++;for(var ie=c.repeat(b);$>>0,O=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,O[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&O[_]===0;)_++;for(var $=new Uint8Array(I+(S-_)),ie=I;_!==S;)$[ie++]=O[_++];return $}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var $Ie=UIe,qIe=$Ie;const VIe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},zIe=t=>new TextEncoder().encode(t),HIe=t=>new TextDecoder().decode(t);class GIe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class WIe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),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 hee(this,e)}}class KIe{constructor(e){this.decoders=e}or(e){return hee(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const hee=(t,e)=>new KIe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class YIe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new GIe(e,r,n),this.decoder=new WIe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gE=({name:t,prefix:e,encode:r,decode:n})=>new YIe(t,e,r,n),Dx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=qIe(r,e);return gE({prefix:t,name:e,encode:n,decode:s=>VIe(i(s))})},QIe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},JIe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<gE({prefix:e,name:t,encode(i){return JIe(i,n,r)},decode(i){return QIe(i,n,r,t)}}),ZIe=gE({prefix:"\0",name:"identity",encode:t=>HIe(t),decode:t=>zIe(t)}),XIe=Object.freeze(Object.defineProperty({__proto__:null,identity:ZIe},Symbol.toStringTag,{value:"Module"})),eTe=ls({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),tTe=Object.freeze(Object.defineProperty({__proto__:null,base2:eTe},Symbol.toStringTag,{value:"Module"})),rTe=ls({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),nTe=Object.freeze(Object.defineProperty({__proto__:null,base8:rTe},Symbol.toStringTag,{value:"Module"})),iTe=Dx({prefix:"9",name:"base10",alphabet:"0123456789"}),sTe=Object.freeze(Object.defineProperty({__proto__:null,base10:iTe},Symbol.toStringTag,{value:"Module"})),oTe=ls({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),aTe=ls({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),cTe=Object.freeze(Object.defineProperty({__proto__:null,base16:oTe,base16upper:aTe},Symbol.toStringTag,{value:"Module"})),lTe=ls({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fTe=ls({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),uTe=ls({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dTe=ls({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hTe=ls({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),pTe=ls({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vTe=ls({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),gTe=ls({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yTe=ls({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),mTe=Object.freeze(Object.defineProperty({__proto__:null,base32:lTe,base32hex:hTe,base32hexpad:vTe,base32hexpadupper:gTe,base32hexupper:pTe,base32pad:uTe,base32padupper:dTe,base32upper:fTe,base32z:yTe},Symbol.toStringTag,{value:"Module"})),bTe=Dx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wTe=Dx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),xTe=Object.freeze(Object.defineProperty({__proto__:null,base36:bTe,base36upper:wTe},Symbol.toStringTag,{value:"Module"})),ETe=Dx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),CTe=Dx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ATe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:ETe,base58flickr:CTe},Symbol.toStringTag,{value:"Module"})),STe=ls({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_Te=ls({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ITe=ls({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TTe=ls({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),PTe=Object.freeze(Object.defineProperty({__proto__:null,base64:STe,base64pad:_Te,base64url:ITe,base64urlpad:TTe},Symbol.toStringTag,{value:"Module"})),pee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),kTe=pee.reduce((t,e,r)=>(t[r]=e,t),[]),MTe=pee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function RTe(t){return t.reduce((e,r)=>(e+=kTe[r],e),"")}function OTe(t){const e=[];for(const r of t){const n=MTe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const DTe=gE({prefix:"🚀",name:"base256emoji",encode:RTe,decode:OTe}),NTe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:DTe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Fj={...XIe,...tTe,...nTe,...sTe,...cTe,...mTe,...xTe,...ATe,...PTe,...NTe};function vee(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const jj=vee("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),q9=vee("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=dee(t.length);for(let r=0;r",HTe="MIT",GTe={url:"https://github.com/indutny/elliptic/issues"},WTe="https://github.com/indutny/elliptic",KTe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},YTe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},QTe={name:BTe,version:LTe,description:FTe,main:jTe,files:UTe,scripts:$Te,repository:qTe,keywords:VTe,author:zTe,license:HTe,bugs:GTe,homepage:WTe,devDependencies:KTe,dependencies:YTe};var Ea={},kM={exports:{}};kM.exports;(function(t){(function(e,r){function n(K,P){if(!K)throw new Error(P||"Assertion failed")}function i(K,P){K.super_=P;var M=function(){};M.prototype=P.prototype,K.prototype=new M,K.prototype.constructor=K}function s(K,P,M){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((P==="le"||P==="be")&&(M=P,P=10),this._init(K||0,P||10,M||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=aE.Buffer}catch{}s.isBN=function(P){return P instanceof s?!0:P!==null&&typeof P=="object"&&P.constructor.wordSize===s.wordSize&&Array.isArray(P.words)},s.max=function(P,M){return P.cmp(M)>0?P:M},s.min=function(P,M){return P.cmp(M)<0?P:M},s.prototype._init=function(P,M,v){if(typeof P=="number")return this._initNumber(P,M,v);if(typeof P=="object")return this._initArray(P,M,v);M==="hex"&&(M=16),n(M===(M|0)&&M>=2&&M<=36),P=P.toString().replace(/\s+/g,"");var m=0;P[0]==="-"&&(m++,this.negative=1),m=0;m-=3)B=P[m]|P[m-1]<<8|P[m-2]<<16,this.words[R]|=B<>>26-E&67108863,E+=24,E>=26&&(E-=26,R++);else if(v==="le")for(m=0,R=0;m>>26-E&67108863,E+=24,E>=26&&(E-=26,R++);return this.strip()};function a(K,P){var M=K.charCodeAt(P);return M>=65&&M<=70?M-55:M>=97&&M<=102?M-87:M-48&15}function c(K,P,M){var v=a(K,M);return M-1>=P&&(v|=a(K,M-1)<<4),v}s.prototype._parseHex=function(P,M,v){this.length=Math.ceil((P.length-M)/6),this.words=new Array(this.length);for(var m=0;m=M;m-=2)E=c(P,M,m)<=18?(R-=18,B+=1,this.words[B]|=E>>>26):R+=8;else{var x=P.length-M;for(m=x%2===0?M+1:M;m=18?(R-=18,B+=1,this.words[B]|=E>>>26):R+=8}this.strip()};function l(K,P,M,v){for(var m=0,R=Math.min(K.length,M),B=P;B=49?m+=E-49+10:E>=17?m+=E-17+10:m+=E}return m}s.prototype._parseBase=function(P,M,v){this.words=[0],this.length=1;for(var m=0,R=1;R<=67108863;R*=M)m++;m--,R=R/M|0;for(var B=P.length-v,E=B%m,x=Math.min(B,B-E)+v,w=0,T=v;T1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(P,M){P=P||10,M=M|0||1;var v;if(P===16||P==="hex"){v="";for(var m=0,R=0,B=0;B>>24-m&16777215,R!==0||B!==this.length-1?v=f[6-x.length]+x+v:v=x+v,m+=2,m>=26&&(m-=26,B--)}for(R!==0&&(v=R.toString(16)+v);v.length%M!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(P===(P|0)&&P>=2&&P<=36){var w=u[P],T=p[P];v="";var k=this.clone();for(k.negative=0;!k.isZero();){var H=k.modn(T).toString(P);k=k.idivn(T),k.isZero()?v=H+v:v=f[w-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%M!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var P=this.words[0];return this.length===2?P+=this.words[1]*67108864:this.length===3&&this.words[2]===1?P+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-P:P},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(P,M){return n(typeof o<"u"),this.toArrayLike(o,P,M)},s.prototype.toArray=function(P,M){return this.toArrayLike(Array,P,M)},s.prototype.toArrayLike=function(P,M,v){var m=this.byteLength(),R=v||Math.max(1,m);n(m<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0"),this.strip();var B=M==="le",E=new P(R),x,w,T=this.clone();if(B){for(w=0;!T.isZero();w++)x=T.andln(255),T.iushrn(8),E[w]=x;for(;w=4096&&(v+=13,M>>>=13),M>=64&&(v+=7,M>>>=7),M>=8&&(v+=4,M>>>=4),M>=2&&(v+=2,M>>>=2),v+M},s.prototype._zeroBits=function(P){if(P===0)return 26;var M=P,v=0;return M&8191||(v+=13,M>>>=13),M&127||(v+=7,M>>>=7),M&15||(v+=4,M>>>=4),M&3||(v+=2,M>>>=2),M&1||v++,v},s.prototype.bitLength=function(){var P=this.words[this.length-1],M=this._countBits(P);return(this.length-1)*26+M};function g(K){for(var P=new Array(K.bitLength()),M=0;M>>m}return P}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var P=0,M=0;MP.length?this.clone().ior(P):P.clone().ior(this)},s.prototype.uor=function(P){return this.length>P.length?this.clone().iuor(P):P.clone().iuor(this)},s.prototype.iuand=function(P){var M;this.length>P.length?M=P:M=this;for(var v=0;vP.length?this.clone().iand(P):P.clone().iand(this)},s.prototype.uand=function(P){return this.length>P.length?this.clone().iuand(P):P.clone().iuand(this)},s.prototype.iuxor=function(P){var M,v;this.length>P.length?(M=this,v=P):(M=P,v=this);for(var m=0;mP.length?this.clone().ixor(P):P.clone().ixor(this)},s.prototype.uxor=function(P){return this.length>P.length?this.clone().iuxor(P):P.clone().iuxor(this)},s.prototype.inotn=function(P){n(typeof P=="number"&&P>=0);var M=Math.ceil(P/26)|0,v=P%26;this._expand(M),v>0&&M--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(P){return this.clone().inotn(P)},s.prototype.setn=function(P,M){n(typeof P=="number"&&P>=0);var v=P/26|0,m=P%26;return this._expand(v+1),M?this.words[v]=this.words[v]|1<P.length?(v=this,m=P):(v=P,m=this);for(var R=0,B=0;B>>26;for(;R!==0&&B>>26;if(this.length=v.length,R!==0)this.words[this.length]=R,this.length++;else if(v!==this)for(;BP.length?this.clone().iadd(P):P.clone().iadd(this)},s.prototype.isub=function(P){if(P.negative!==0){P.negative=0;var M=this.iadd(P);return P.negative=1,M._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(P),this.negative=1,this._normSign();var v=this.cmp(P);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,R;v>0?(m=this,R=P):(m=P,R=this);for(var B=0,E=0;E>26,this.words[E]=M&67108863;for(;B!==0&&E>26,this.words[E]=M&67108863;if(B===0&&E>>26,k=x&67108863,H=Math.min(w,P.length-1),oe=Math.max(0,w-K.length+1);oe<=H;oe++){var j=w-oe|0;m=K.words[j]|0,R=P.words[oe]|0,B=m*R+k,T+=B/67108864|0,k=B&67108863}M.words[w]=k|0,x=T|0}return x!==0?M.words[w]=x|0:M.length--,M.strip()}var b=function(P,M,v){var m=P.words,R=M.words,B=v.words,E=0,x,w,T,k=m[0]|0,H=k&8191,oe=k>>>13,j=m[1]|0,X=j&8191,G=j>>>13,Z=m[2]|0,ee=Z&8191,N=Z>>>13,te=m[3]|0,fe=te&8191,Ee=te>>>13,_e=m[4]|0,Re=_e&8191,Te=_e>>>13,De=m[5]|0,ze=De&8191,et=De>>>13,Je=m[6]|0,ke=Je&8191,Ne=Je>>>13,tt=m[7]|0,Ze=tt&8191,st=tt>>>13,nt=m[8]|0,We=nt&8191,lt=nt>>>13,vt=m[9]|0,Ke=vt&8191,gt=vt>>>13,wt=R[0]|0,rt=wt&8191,It=wt>>>13,At=R[1]|0,Tt=At&8191,Xt=At>>>13,lr=R[2]|0,xt=lr&8191,ar=lr>>>13,rr=R[3]|0,kt=rr&8191,Dt=rr>>>13,Nt=R[4]|0,dt=Nt&8191,Lt=Nt>>>13,Mt=R[5]|0,ut=Mt&8191,Vt=Mt>>>13,zt=R[6]|0,ht=zt&8191,Et=zt>>>13,Bt=R[7]|0,He=Bt&8191,$t=Bt>>>13,Ct=R[8]|0,ct=Ct&8191,Ht=Ct>>>13,Rr=R[9]|0,Ut=Rr&8191,Sr=Rr>>>13;v.negative=P.negative^M.negative,v.length=19,x=Math.imul(H,rt),w=Math.imul(H,It),w=w+Math.imul(oe,rt)|0,T=Math.imul(oe,It);var er=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(er>>>26)|0,er&=67108863,x=Math.imul(X,rt),w=Math.imul(X,It),w=w+Math.imul(G,rt)|0,T=Math.imul(G,It),x=x+Math.imul(H,Tt)|0,w=w+Math.imul(H,Xt)|0,w=w+Math.imul(oe,Tt)|0,T=T+Math.imul(oe,Xt)|0;var kr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(kr>>>26)|0,kr&=67108863,x=Math.imul(ee,rt),w=Math.imul(ee,It),w=w+Math.imul(N,rt)|0,T=Math.imul(N,It),x=x+Math.imul(X,Tt)|0,w=w+Math.imul(X,Xt)|0,w=w+Math.imul(G,Tt)|0,T=T+Math.imul(G,Xt)|0,x=x+Math.imul(H,xt)|0,w=w+Math.imul(H,ar)|0,w=w+Math.imul(oe,xt)|0,T=T+Math.imul(oe,ar)|0;var bi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(bi>>>26)|0,bi&=67108863,x=Math.imul(fe,rt),w=Math.imul(fe,It),w=w+Math.imul(Ee,rt)|0,T=Math.imul(Ee,It),x=x+Math.imul(ee,Tt)|0,w=w+Math.imul(ee,Xt)|0,w=w+Math.imul(N,Tt)|0,T=T+Math.imul(N,Xt)|0,x=x+Math.imul(X,xt)|0,w=w+Math.imul(X,ar)|0,w=w+Math.imul(G,xt)|0,T=T+Math.imul(G,ar)|0,x=x+Math.imul(H,kt)|0,w=w+Math.imul(H,Dt)|0,w=w+Math.imul(oe,kt)|0,T=T+Math.imul(oe,Dt)|0;var wi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(wi>>>26)|0,wi&=67108863,x=Math.imul(Re,rt),w=Math.imul(Re,It),w=w+Math.imul(Te,rt)|0,T=Math.imul(Te,It),x=x+Math.imul(fe,Tt)|0,w=w+Math.imul(fe,Xt)|0,w=w+Math.imul(Ee,Tt)|0,T=T+Math.imul(Ee,Xt)|0,x=x+Math.imul(ee,xt)|0,w=w+Math.imul(ee,ar)|0,w=w+Math.imul(N,xt)|0,T=T+Math.imul(N,ar)|0,x=x+Math.imul(X,kt)|0,w=w+Math.imul(X,Dt)|0,w=w+Math.imul(G,kt)|0,T=T+Math.imul(G,Dt)|0,x=x+Math.imul(H,dt)|0,w=w+Math.imul(H,Lt)|0,w=w+Math.imul(oe,dt)|0,T=T+Math.imul(oe,Lt)|0;var xi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(xi>>>26)|0,xi&=67108863,x=Math.imul(ze,rt),w=Math.imul(ze,It),w=w+Math.imul(et,rt)|0,T=Math.imul(et,It),x=x+Math.imul(Re,Tt)|0,w=w+Math.imul(Re,Xt)|0,w=w+Math.imul(Te,Tt)|0,T=T+Math.imul(Te,Xt)|0,x=x+Math.imul(fe,xt)|0,w=w+Math.imul(fe,ar)|0,w=w+Math.imul(Ee,xt)|0,T=T+Math.imul(Ee,ar)|0,x=x+Math.imul(ee,kt)|0,w=w+Math.imul(ee,Dt)|0,w=w+Math.imul(N,kt)|0,T=T+Math.imul(N,Dt)|0,x=x+Math.imul(X,dt)|0,w=w+Math.imul(X,Lt)|0,w=w+Math.imul(G,dt)|0,T=T+Math.imul(G,Lt)|0,x=x+Math.imul(H,ut)|0,w=w+Math.imul(H,Vt)|0,w=w+Math.imul(oe,ut)|0,T=T+Math.imul(oe,Vt)|0;var Ti=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,x=Math.imul(ke,rt),w=Math.imul(ke,It),w=w+Math.imul(Ne,rt)|0,T=Math.imul(Ne,It),x=x+Math.imul(ze,Tt)|0,w=w+Math.imul(ze,Xt)|0,w=w+Math.imul(et,Tt)|0,T=T+Math.imul(et,Xt)|0,x=x+Math.imul(Re,xt)|0,w=w+Math.imul(Re,ar)|0,w=w+Math.imul(Te,xt)|0,T=T+Math.imul(Te,ar)|0,x=x+Math.imul(fe,kt)|0,w=w+Math.imul(fe,Dt)|0,w=w+Math.imul(Ee,kt)|0,T=T+Math.imul(Ee,Dt)|0,x=x+Math.imul(ee,dt)|0,w=w+Math.imul(ee,Lt)|0,w=w+Math.imul(N,dt)|0,T=T+Math.imul(N,Lt)|0,x=x+Math.imul(X,ut)|0,w=w+Math.imul(X,Vt)|0,w=w+Math.imul(G,ut)|0,T=T+Math.imul(G,Vt)|0,x=x+Math.imul(H,ht)|0,w=w+Math.imul(H,Et)|0,w=w+Math.imul(oe,ht)|0,T=T+Math.imul(oe,Et)|0;var Sn=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,x=Math.imul(Ze,rt),w=Math.imul(Ze,It),w=w+Math.imul(st,rt)|0,T=Math.imul(st,It),x=x+Math.imul(ke,Tt)|0,w=w+Math.imul(ke,Xt)|0,w=w+Math.imul(Ne,Tt)|0,T=T+Math.imul(Ne,Xt)|0,x=x+Math.imul(ze,xt)|0,w=w+Math.imul(ze,ar)|0,w=w+Math.imul(et,xt)|0,T=T+Math.imul(et,ar)|0,x=x+Math.imul(Re,kt)|0,w=w+Math.imul(Re,Dt)|0,w=w+Math.imul(Te,kt)|0,T=T+Math.imul(Te,Dt)|0,x=x+Math.imul(fe,dt)|0,w=w+Math.imul(fe,Lt)|0,w=w+Math.imul(Ee,dt)|0,T=T+Math.imul(Ee,Lt)|0,x=x+Math.imul(ee,ut)|0,w=w+Math.imul(ee,Vt)|0,w=w+Math.imul(N,ut)|0,T=T+Math.imul(N,Vt)|0,x=x+Math.imul(X,ht)|0,w=w+Math.imul(X,Et)|0,w=w+Math.imul(G,ht)|0,T=T+Math.imul(G,Et)|0,x=x+Math.imul(H,He)|0,w=w+Math.imul(H,$t)|0,w=w+Math.imul(oe,He)|0,T=T+Math.imul(oe,$t)|0;var di=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(di>>>26)|0,di&=67108863,x=Math.imul(We,rt),w=Math.imul(We,It),w=w+Math.imul(lt,rt)|0,T=Math.imul(lt,It),x=x+Math.imul(Ze,Tt)|0,w=w+Math.imul(Ze,Xt)|0,w=w+Math.imul(st,Tt)|0,T=T+Math.imul(st,Xt)|0,x=x+Math.imul(ke,xt)|0,w=w+Math.imul(ke,ar)|0,w=w+Math.imul(Ne,xt)|0,T=T+Math.imul(Ne,ar)|0,x=x+Math.imul(ze,kt)|0,w=w+Math.imul(ze,Dt)|0,w=w+Math.imul(et,kt)|0,T=T+Math.imul(et,Dt)|0,x=x+Math.imul(Re,dt)|0,w=w+Math.imul(Re,Lt)|0,w=w+Math.imul(Te,dt)|0,T=T+Math.imul(Te,Lt)|0,x=x+Math.imul(fe,ut)|0,w=w+Math.imul(fe,Vt)|0,w=w+Math.imul(Ee,ut)|0,T=T+Math.imul(Ee,Vt)|0,x=x+Math.imul(ee,ht)|0,w=w+Math.imul(ee,Et)|0,w=w+Math.imul(N,ht)|0,T=T+Math.imul(N,Et)|0,x=x+Math.imul(X,He)|0,w=w+Math.imul(X,$t)|0,w=w+Math.imul(G,He)|0,T=T+Math.imul(G,$t)|0,x=x+Math.imul(H,ct)|0,w=w+Math.imul(H,Ht)|0,w=w+Math.imul(oe,ct)|0,T=T+Math.imul(oe,Ht)|0;var Fs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,x=Math.imul(Ke,rt),w=Math.imul(Ke,It),w=w+Math.imul(gt,rt)|0,T=Math.imul(gt,It),x=x+Math.imul(We,Tt)|0,w=w+Math.imul(We,Xt)|0,w=w+Math.imul(lt,Tt)|0,T=T+Math.imul(lt,Xt)|0,x=x+Math.imul(Ze,xt)|0,w=w+Math.imul(Ze,ar)|0,w=w+Math.imul(st,xt)|0,T=T+Math.imul(st,ar)|0,x=x+Math.imul(ke,kt)|0,w=w+Math.imul(ke,Dt)|0,w=w+Math.imul(Ne,kt)|0,T=T+Math.imul(Ne,Dt)|0,x=x+Math.imul(ze,dt)|0,w=w+Math.imul(ze,Lt)|0,w=w+Math.imul(et,dt)|0,T=T+Math.imul(et,Lt)|0,x=x+Math.imul(Re,ut)|0,w=w+Math.imul(Re,Vt)|0,w=w+Math.imul(Te,ut)|0,T=T+Math.imul(Te,Vt)|0,x=x+Math.imul(fe,ht)|0,w=w+Math.imul(fe,Et)|0,w=w+Math.imul(Ee,ht)|0,T=T+Math.imul(Ee,Et)|0,x=x+Math.imul(ee,He)|0,w=w+Math.imul(ee,$t)|0,w=w+Math.imul(N,He)|0,T=T+Math.imul(N,$t)|0,x=x+Math.imul(X,ct)|0,w=w+Math.imul(X,Ht)|0,w=w+Math.imul(G,ct)|0,T=T+Math.imul(G,Ht)|0,x=x+Math.imul(H,Ut)|0,w=w+Math.imul(H,Sr)|0,w=w+Math.imul(oe,Ut)|0,T=T+Math.imul(oe,Sr)|0;var hi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hi>>>26)|0,hi&=67108863,x=Math.imul(Ke,Tt),w=Math.imul(Ke,Xt),w=w+Math.imul(gt,Tt)|0,T=Math.imul(gt,Xt),x=x+Math.imul(We,xt)|0,w=w+Math.imul(We,ar)|0,w=w+Math.imul(lt,xt)|0,T=T+Math.imul(lt,ar)|0,x=x+Math.imul(Ze,kt)|0,w=w+Math.imul(Ze,Dt)|0,w=w+Math.imul(st,kt)|0,T=T+Math.imul(st,Dt)|0,x=x+Math.imul(ke,dt)|0,w=w+Math.imul(ke,Lt)|0,w=w+Math.imul(Ne,dt)|0,T=T+Math.imul(Ne,Lt)|0,x=x+Math.imul(ze,ut)|0,w=w+Math.imul(ze,Vt)|0,w=w+Math.imul(et,ut)|0,T=T+Math.imul(et,Vt)|0,x=x+Math.imul(Re,ht)|0,w=w+Math.imul(Re,Et)|0,w=w+Math.imul(Te,ht)|0,T=T+Math.imul(Te,Et)|0,x=x+Math.imul(fe,He)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,He)|0,T=T+Math.imul(Ee,$t)|0,x=x+Math.imul(ee,ct)|0,w=w+Math.imul(ee,Ht)|0,w=w+Math.imul(N,ct)|0,T=T+Math.imul(N,Ht)|0,x=x+Math.imul(X,Ut)|0,w=w+Math.imul(X,Sr)|0,w=w+Math.imul(G,Ut)|0,T=T+Math.imul(G,Sr)|0;var jo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(jo>>>26)|0,jo&=67108863,x=Math.imul(Ke,xt),w=Math.imul(Ke,ar),w=w+Math.imul(gt,xt)|0,T=Math.imul(gt,ar),x=x+Math.imul(We,kt)|0,w=w+Math.imul(We,Dt)|0,w=w+Math.imul(lt,kt)|0,T=T+Math.imul(lt,Dt)|0,x=x+Math.imul(Ze,dt)|0,w=w+Math.imul(Ze,Lt)|0,w=w+Math.imul(st,dt)|0,T=T+Math.imul(st,Lt)|0,x=x+Math.imul(ke,ut)|0,w=w+Math.imul(ke,Vt)|0,w=w+Math.imul(Ne,ut)|0,T=T+Math.imul(Ne,Vt)|0,x=x+Math.imul(ze,ht)|0,w=w+Math.imul(ze,Et)|0,w=w+Math.imul(et,ht)|0,T=T+Math.imul(et,Et)|0,x=x+Math.imul(Re,He)|0,w=w+Math.imul(Re,$t)|0,w=w+Math.imul(Te,He)|0,T=T+Math.imul(Te,$t)|0,x=x+Math.imul(fe,ct)|0,w=w+Math.imul(fe,Ht)|0,w=w+Math.imul(Ee,ct)|0,T=T+Math.imul(Ee,Ht)|0,x=x+Math.imul(ee,Ut)|0,w=w+Math.imul(ee,Sr)|0,w=w+Math.imul(N,Ut)|0,T=T+Math.imul(N,Sr)|0;var Uo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,x=Math.imul(Ke,kt),w=Math.imul(Ke,Dt),w=w+Math.imul(gt,kt)|0,T=Math.imul(gt,Dt),x=x+Math.imul(We,dt)|0,w=w+Math.imul(We,Lt)|0,w=w+Math.imul(lt,dt)|0,T=T+Math.imul(lt,Lt)|0,x=x+Math.imul(Ze,ut)|0,w=w+Math.imul(Ze,Vt)|0,w=w+Math.imul(st,ut)|0,T=T+Math.imul(st,Vt)|0,x=x+Math.imul(ke,ht)|0,w=w+Math.imul(ke,Et)|0,w=w+Math.imul(Ne,ht)|0,T=T+Math.imul(Ne,Et)|0,x=x+Math.imul(ze,He)|0,w=w+Math.imul(ze,$t)|0,w=w+Math.imul(et,He)|0,T=T+Math.imul(et,$t)|0,x=x+Math.imul(Re,ct)|0,w=w+Math.imul(Re,Ht)|0,w=w+Math.imul(Te,ct)|0,T=T+Math.imul(Te,Ht)|0,x=x+Math.imul(fe,Ut)|0,w=w+Math.imul(fe,Sr)|0,w=w+Math.imul(Ee,Ut)|0,T=T+Math.imul(Ee,Sr)|0;var pi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(pi>>>26)|0,pi&=67108863,x=Math.imul(Ke,dt),w=Math.imul(Ke,Lt),w=w+Math.imul(gt,dt)|0,T=Math.imul(gt,Lt),x=x+Math.imul(We,ut)|0,w=w+Math.imul(We,Vt)|0,w=w+Math.imul(lt,ut)|0,T=T+Math.imul(lt,Vt)|0,x=x+Math.imul(Ze,ht)|0,w=w+Math.imul(Ze,Et)|0,w=w+Math.imul(st,ht)|0,T=T+Math.imul(st,Et)|0,x=x+Math.imul(ke,He)|0,w=w+Math.imul(ke,$t)|0,w=w+Math.imul(Ne,He)|0,T=T+Math.imul(Ne,$t)|0,x=x+Math.imul(ze,ct)|0,w=w+Math.imul(ze,Ht)|0,w=w+Math.imul(et,ct)|0,T=T+Math.imul(et,Ht)|0,x=x+Math.imul(Re,Ut)|0,w=w+Math.imul(Re,Sr)|0,w=w+Math.imul(Te,Ut)|0,T=T+Math.imul(Te,Sr)|0;var oo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(oo>>>26)|0,oo&=67108863,x=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(gt,ut)|0,T=Math.imul(gt,Vt),x=x+Math.imul(We,ht)|0,w=w+Math.imul(We,Et)|0,w=w+Math.imul(lt,ht)|0,T=T+Math.imul(lt,Et)|0,x=x+Math.imul(Ze,He)|0,w=w+Math.imul(Ze,$t)|0,w=w+Math.imul(st,He)|0,T=T+Math.imul(st,$t)|0,x=x+Math.imul(ke,ct)|0,w=w+Math.imul(ke,Ht)|0,w=w+Math.imul(Ne,ct)|0,T=T+Math.imul(Ne,Ht)|0,x=x+Math.imul(ze,Ut)|0,w=w+Math.imul(ze,Sr)|0,w=w+Math.imul(et,Ut)|0,T=T+Math.imul(et,Sr)|0;var ao=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ao>>>26)|0,ao&=67108863,x=Math.imul(Ke,ht),w=Math.imul(Ke,Et),w=w+Math.imul(gt,ht)|0,T=Math.imul(gt,Et),x=x+Math.imul(We,He)|0,w=w+Math.imul(We,$t)|0,w=w+Math.imul(lt,He)|0,T=T+Math.imul(lt,$t)|0,x=x+Math.imul(Ze,ct)|0,w=w+Math.imul(Ze,Ht)|0,w=w+Math.imul(st,ct)|0,T=T+Math.imul(st,Ht)|0,x=x+Math.imul(ke,Ut)|0,w=w+Math.imul(ke,Sr)|0,w=w+Math.imul(Ne,Ut)|0,T=T+Math.imul(Ne,Sr)|0;var _n=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,x=Math.imul(Ke,He),w=Math.imul(Ke,$t),w=w+Math.imul(gt,He)|0,T=Math.imul(gt,$t),x=x+Math.imul(We,ct)|0,w=w+Math.imul(We,Ht)|0,w=w+Math.imul(lt,ct)|0,T=T+Math.imul(lt,Ht)|0,x=x+Math.imul(Ze,Ut)|0,w=w+Math.imul(Ze,Sr)|0,w=w+Math.imul(st,Ut)|0,T=T+Math.imul(st,Sr)|0;var $o=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+($o>>>26)|0,$o&=67108863,x=Math.imul(Ke,ct),w=Math.imul(Ke,Ht),w=w+Math.imul(gt,ct)|0,T=Math.imul(gt,Ht),x=x+Math.imul(We,Ut)|0,w=w+Math.imul(We,Sr)|0,w=w+Math.imul(lt,Ut)|0,T=T+Math.imul(lt,Sr)|0;var Gi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,x=Math.imul(Ke,Ut),w=Math.imul(Ke,Sr),w=w+Math.imul(gt,Ut)|0,T=Math.imul(gt,Sr);var qo=(E+x|0)+((w&8191)<<13)|0;return E=(T+(w>>>13)|0)+(qo>>>26)|0,qo&=67108863,B[0]=er,B[1]=kr,B[2]=bi,B[3]=wi,B[4]=xi,B[5]=Ti,B[6]=Sn,B[7]=di,B[8]=Fs,B[9]=hi,B[10]=jo,B[11]=Uo,B[12]=pi,B[13]=oo,B[14]=ao,B[15]=_n,B[16]=$o,B[17]=Gi,B[18]=qo,E!==0&&(B[19]=E,v.length++),v};Math.imul||(b=y);function I(K,P,M){M.negative=P.negative^K.negative,M.length=K.length+P.length;for(var v=0,m=0,R=0;R>>26)|0,m+=B>>>26,B&=67108863}M.words[R]=E,v=B,B=m}return v!==0?M.words[R]=v:M.length--,M.strip()}function C(K,P,M){var v=new S;return v.mulp(K,P,M)}s.prototype.mulTo=function(P,M){var v,m=this.length+P.length;return this.length===10&&P.length===10?v=b(this,P,M):m<63?v=y(this,P,M):m<1024?v=I(this,P,M):v=C(this,P,M),v};function S(K,P){this.x=K,this.y=P}S.prototype.makeRBT=function(P){for(var M=new Array(P),v=s.prototype._countBits(P)-1,m=0;m>=1;return m},S.prototype.permute=function(P,M,v,m,R,B){for(var E=0;E>>1)R++;return 1<>>13,v[2*B+1]=R&8191,R=R>>>13;for(B=2*M;B>=26,M+=m/67108864|0,M+=R>>>26,this.words[v]=R&67108863}return M!==0&&(this.words[v]=M,this.length++),this},s.prototype.muln=function(P){return this.clone().imuln(P)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(P){var M=g(P);if(M.length===0)return new s(1);for(var v=this,m=0;m=0);var M=P%26,v=(P-M)/26,m=67108863>>>26-M<<26-M,R;if(M!==0){var B=0;for(R=0;R>>26-M}B&&(this.words[R]=B,this.length++)}if(v!==0){for(R=this.length-1;R>=0;R--)this.words[R+v]=this.words[R];for(R=0;R=0);var m;M?m=(M-M%26)/26:m=0;var R=P%26,B=Math.min((P-R)/26,this.length),E=67108863^67108863>>>R<B)for(this.length-=B,w=0;w=0&&(T!==0||w>=m);w--){var k=this.words[w]|0;this.words[w]=T<<26-R|k>>>R,T=k&E}return x&&T!==0&&(x.words[x.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(P,M,v){return n(this.negative===0),this.iushrn(P,M,v)},s.prototype.shln=function(P){return this.clone().ishln(P)},s.prototype.ushln=function(P){return this.clone().iushln(P)},s.prototype.shrn=function(P){return this.clone().ishrn(P)},s.prototype.ushrn=function(P){return this.clone().iushrn(P)},s.prototype.testn=function(P){n(typeof P=="number"&&P>=0);var M=P%26,v=(P-M)/26,m=1<=0);var M=P%26,v=(P-M)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(M!==0&&v++,this.length=Math.min(v,this.length),M!==0){var m=67108863^67108863>>>M<=67108864;M++)this.words[M]-=67108864,M===this.length-1?this.words[M+1]=1:this.words[M+1]++;return this.length=Math.max(this.length,M+1),this},s.prototype.isubn=function(P){if(n(typeof P=="number"),n(P<67108864),P<0)return this.iaddn(-P);if(this.negative!==0)return this.negative=0,this.iaddn(P),this.negative=1,this;if(this.words[0]-=P,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var M=0;M>26)-(x/67108864|0),this.words[R+v]=B&67108863}for(;R>26,this.words[R+v]=B&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,R=0;R>26,this.words[R]=B&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(P,M){var v=this.length-P.length,m=this.clone(),R=P,B=R.words[R.length-1]|0,E=this._countBits(B);v=26-E,v!==0&&(R=R.ushln(v),m.iushln(v),B=R.words[R.length-1]|0);var x=m.length-R.length,w;if(M!=="mod"){w=new s(null),w.length=x+1,w.words=new Array(w.length);for(var T=0;T=0;H--){var oe=(m.words[R.length+H]|0)*67108864+(m.words[R.length+H-1]|0);for(oe=Math.min(oe/B|0,67108863),m._ishlnsubmul(R,oe,H);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(R,1,H),m.isZero()||(m.negative^=1);w&&(w.words[H]=oe)}return w&&w.strip(),m.strip(),M!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(P,M,v){if(n(!P.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,R,B;return this.negative!==0&&P.negative===0?(B=this.neg().divmod(P,M),M!=="mod"&&(m=B.div.neg()),M!=="div"&&(R=B.mod.neg(),v&&R.negative!==0&&R.iadd(P)),{div:m,mod:R}):this.negative===0&&P.negative!==0?(B=this.divmod(P.neg(),M),M!=="mod"&&(m=B.div.neg()),{div:m,mod:B.mod}):this.negative&P.negative?(B=this.neg().divmod(P.neg(),M),M!=="div"&&(R=B.mod.neg(),v&&R.negative!==0&&R.isub(P)),{div:B.div,mod:R}):P.length>this.length||this.cmp(P)<0?{div:new s(0),mod:this}:P.length===1?M==="div"?{div:this.divn(P.words[0]),mod:null}:M==="mod"?{div:null,mod:new s(this.modn(P.words[0]))}:{div:this.divn(P.words[0]),mod:new s(this.modn(P.words[0]))}:this._wordDiv(P,M)},s.prototype.div=function(P){return this.divmod(P,"div",!1).div},s.prototype.mod=function(P){return this.divmod(P,"mod",!1).mod},s.prototype.umod=function(P){return this.divmod(P,"mod",!0).mod},s.prototype.divRound=function(P){var M=this.divmod(P);if(M.mod.isZero())return M.div;var v=M.div.negative!==0?M.mod.isub(P):M.mod,m=P.ushrn(1),R=P.andln(1),B=v.cmp(m);return B<0||R===1&&B===0?M.div:M.div.negative!==0?M.div.isubn(1):M.div.iaddn(1)},s.prototype.modn=function(P){n(P<=67108863);for(var M=(1<<26)%P,v=0,m=this.length-1;m>=0;m--)v=(M*v+(this.words[m]|0))%P;return v},s.prototype.idivn=function(P){n(P<=67108863);for(var M=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+M*67108864;this.words[v]=m/P|0,M=m%P}return this.strip()},s.prototype.divn=function(P){return this.clone().idivn(P)},s.prototype.egcd=function(P){n(P.negative===0),n(!P.isZero());var M=this,v=P.clone();M.negative!==0?M=M.umod(P):M=M.clone();for(var m=new s(1),R=new s(0),B=new s(0),E=new s(1),x=0;M.isEven()&&v.isEven();)M.iushrn(1),v.iushrn(1),++x;for(var w=v.clone(),T=M.clone();!M.isZero();){for(var k=0,H=1;!(M.words[0]&H)&&k<26;++k,H<<=1);if(k>0)for(M.iushrn(k);k-- >0;)(m.isOdd()||R.isOdd())&&(m.iadd(w),R.isub(T)),m.iushrn(1),R.iushrn(1);for(var oe=0,j=1;!(v.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(v.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(w),E.isub(T)),B.iushrn(1),E.iushrn(1);M.cmp(v)>=0?(M.isub(v),m.isub(B),R.isub(E)):(v.isub(M),B.isub(m),E.isub(R))}return{a:B,b:E,gcd:v.iushln(x)}},s.prototype._invmp=function(P){n(P.negative===0),n(!P.isZero());var M=this,v=P.clone();M.negative!==0?M=M.umod(P):M=M.clone();for(var m=new s(1),R=new s(0),B=v.clone();M.cmpn(1)>0&&v.cmpn(1)>0;){for(var E=0,x=1;!(M.words[0]&x)&&E<26;++E,x<<=1);if(E>0)for(M.iushrn(E);E-- >0;)m.isOdd()&&m.iadd(B),m.iushrn(1);for(var w=0,T=1;!(v.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(v.iushrn(w);w-- >0;)R.isOdd()&&R.iadd(B),R.iushrn(1);M.cmp(v)>=0?(M.isub(v),m.isub(R)):(v.isub(M),R.isub(m))}var k;return M.cmpn(1)===0?k=m:k=R,k.cmpn(0)<0&&k.iadd(P),k},s.prototype.gcd=function(P){if(this.isZero())return P.abs();if(P.isZero())return this.abs();var M=this.clone(),v=P.clone();M.negative=0,v.negative=0;for(var m=0;M.isEven()&&v.isEven();m++)M.iushrn(1),v.iushrn(1);do{for(;M.isEven();)M.iushrn(1);for(;v.isEven();)v.iushrn(1);var R=M.cmp(v);if(R<0){var B=M;M=v,v=B}else if(R===0||v.cmpn(1)===0)break;M.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(P){return this.egcd(P).a.umod(P)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(P){return this.words[0]&P},s.prototype.bincn=function(P){n(typeof P=="number");var M=P%26,v=(P-M)/26,m=1<>>26,E&=67108863,this.words[B]=E}return R!==0&&(this.words[B]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(P){var M=P<0;if(this.negative!==0&&!M)return-1;if(this.negative===0&&M)return 1;this.strip();var v;if(this.length>1)v=1;else{M&&(P=-P),n(P<=67108863,"Number is too big");var m=this.words[0]|0;v=m===P?0:mP.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,R=P.words[v]|0;if(m!==R){mR&&(M=1);break}}return M},s.prototype.gtn=function(P){return this.cmpn(P)===1},s.prototype.gt=function(P){return this.cmp(P)===1},s.prototype.gten=function(P){return this.cmpn(P)>=0},s.prototype.gte=function(P){return this.cmp(P)>=0},s.prototype.ltn=function(P){return this.cmpn(P)===-1},s.prototype.lt=function(P){return this.cmp(P)===-1},s.prototype.lten=function(P){return this.cmpn(P)<=0},s.prototype.lte=function(P){return this.cmp(P)<=0},s.prototype.eqn=function(P){return this.cmpn(P)===0},s.prototype.eq=function(P){return this.cmp(P)===0},s.red=function(P){return new ie(P)},s.prototype.toRed=function(P){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),P.convertTo(this)._forceRed(P)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(P){return this.red=P,this},s.prototype.forceRed=function(P){return n(!this.red,"Already a number in reduction context"),this._forceRed(P)},s.prototype.redAdd=function(P){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,P)},s.prototype.redIAdd=function(P){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,P)},s.prototype.redSub=function(P){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,P)},s.prototype.redISub=function(P){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,P)},s.prototype.redShl=function(P){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,P)},s.prototype.redMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.mul(this,P)},s.prototype.redIMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.imul(this,P)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(P){return n(this.red&&!P.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,P)};var O={k256:null,p224:null,p192:null,p25519:null};function L(K,P){this.name=K,this.p=new s(P,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var P=new s(null);return P.words=new Array(Math.ceil(this.n/13)),P},L.prototype.ireduce=function(P){var M=P,v;do this.split(M,this.tmp),M=this.imulK(M),M=M.iadd(this.tmp),v=M.bitLength();while(v>this.n);var m=v0?M.isub(this.p):M.strip!==void 0?M.strip():M._strip(),M},L.prototype.split=function(P,M){P.iushrn(this.n,0,M)},L.prototype.imulK=function(P){return P.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(P,M){for(var v=4194303,m=Math.min(P.length,9),R=0;R>>22,B=E}B>>>=22,P.words[R-10]=B,B===0&&P.length>10?P.length-=10:P.length-=9},F.prototype.imulK=function(P){P.words[P.length]=0,P.words[P.length+1]=0,P.length+=2;for(var M=0,v=0;v>>=26,P.words[v]=R,M=m}return M!==0&&(P.words[P.length++]=M),P},s._prime=function(P){if(O[P])return O[P];var M;if(P==="k256")M=new F;else if(P==="p224")M=new z;else if(P==="p192")M=new _;else if(P==="p25519")M=new $;else throw new Error("Unknown prime "+P);return O[P]=M,M};function ie(K){if(typeof K=="string"){var P=s._prime(K);this.m=P.p,this.prime=P}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(P){n(P.negative===0,"red works only with positives"),n(P.red,"red works only with red numbers")},ie.prototype._verify2=function(P,M){n((P.negative|M.negative)===0,"red works only with positives"),n(P.red&&P.red===M.red,"red works only with red numbers")},ie.prototype.imod=function(P){return this.prime?this.prime.ireduce(P)._forceRed(this):P.umod(this.m)._forceRed(this)},ie.prototype.neg=function(P){return P.isZero()?P.clone():this.m.sub(P)._forceRed(this)},ie.prototype.add=function(P,M){this._verify2(P,M);var v=P.add(M);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(P,M){this._verify2(P,M);var v=P.iadd(M);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(P,M){this._verify2(P,M);var v=P.sub(M);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(P,M){this._verify2(P,M);var v=P.isub(M);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(P,M){return this._verify1(P),this.imod(P.ushln(M))},ie.prototype.imul=function(P,M){return this._verify2(P,M),this.imod(P.imul(M))},ie.prototype.mul=function(P,M){return this._verify2(P,M),this.imod(P.mul(M))},ie.prototype.isqr=function(P){return this.imul(P,P.clone())},ie.prototype.sqr=function(P){return this.mul(P,P)},ie.prototype.sqrt=function(P){if(P.isZero())return P.clone();var M=this.m.andln(3);if(n(M%2===1),M===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(P,v)}for(var m=this.m.subn(1),R=0;!m.isZero()&&m.andln(1)===0;)R++,m.iushrn(1);n(!m.isZero());var B=new s(1).toRed(this),E=B.redNeg(),x=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,x).cmp(E)!==0;)w.redIAdd(E);for(var T=this.pow(w,m),k=this.pow(P,m.addn(1).iushrn(1)),H=this.pow(P,m),oe=R;H.cmp(B)!==0;){for(var j=H,X=0;j.cmp(B)!==0;X++)j=j.redSqr();n(X=0;R--){for(var T=M.words[R],k=w-1;k>=0;k--){var H=T>>k&1;if(B!==m[0]&&(B=this.sqr(B)),H===0&&E===0){x=0;continue}E<<=1,E|=H,x++,!(x!==v&&(R!==0||k!==0))&&(B=this.mul(B,m[E]),x=0,E=0)}w=26}return B},ie.prototype.convertTo=function(P){var M=P.umod(this.m);return M===P?M.clone():M},ie.prototype.convertFrom=function(P){var M=P.clone();return M.red=null,M},s.mont=function(P){return new ce(P)};function ce(K){ie.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ce,ie),ce.prototype.convertTo=function(P){return this.imod(P.ushln(this.shift))},ce.prototype.convertFrom=function(P){var M=this.imod(P.mul(this.rinv));return M.red=null,M},ce.prototype.imul=function(P,M){if(P.isZero()||M.isZero())return P.words[0]=0,P.length=1,P;var v=P.imul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=v.isub(m).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},ce.prototype.mul=function(P,M){if(P.isZero()||M.isZero())return new s(0)._forceRed(this);var v=P.mul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=v.isub(m).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},ce.prototype.invm=function(P){var M=this.imod(P._invmp(this.m).mul(this.r2));return M._forceRed(this)}})(t,Si)})(kM);var Ou=kM.exports,MM={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var c=0;c>8,u=l&255;f?a.push(f,u):a.push(u)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(b>>1)-1?C=(b>>1)-S:C=S,I.isubn(C)):C=0,g[y]=C,I.iushrn(1)}return g}e.getNAF=s;function o(f,u){var p=[[],[]];f=f.clone(),u=u.clone();for(var g=0,y=0,b;f.cmpn(-g)>0||u.cmpn(-y)>0;){var I=f.andln(3)+g&3,C=u.andln(3)+y&3;I===3&&(I=-1),C===3&&(C=-1);var S;I&1?(b=f.andln(7)+g&7,(b===3||b===5)&&C===2?S=-I:S=I):S=0,p[0].push(S);var O;C&1?(b=u.andln(7)+y&7,(b===3||b===5)&&I===2?O=-C:O=C):O=0,p[1].push(O),2*g===S+1&&(g=1-g),2*y===O+1&&(y=1-y),f.iushrn(1),u.iushrn(1)}return p}e.getJSF=o;function a(f,u,p){var g="_"+u;f.prototype[u]=function(){return this[g]!==void 0?this[g]:this[g]=p.call(this)}}e.cachedProperty=a;function c(f){return typeof f=="string"?e.toArray(f,"hex"):f}e.parseBytes=c;function l(f){return new r(f,"hex","le")}e.intFromLE=l})(Ea);var RM={exports:{}},V9;RM.exports=function(e){return V9||(V9=new Fd(null)),V9.generate(e)};function Fd(t){this.rand=t}RM.exports.Rand=Fd;Fd.prototype.generate=function(e){return this._rand(e)};Fd.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var yE=Bh;Bh.prototype.point=function(){throw new Error("Not implemented")};Bh.prototype.validate=function(){throw new Error("Not implemented")};Bh.prototype._fixedNafMul=function(e,r){n4(e.precomputed);var n=e._getDoubles(),i=r4(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];n4(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Bh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=r4(n[y],o[y],this._bitLength),c[b]=r4(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=JTe(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var $=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};fc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};uc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};uc.prototype.pointFromX=function(e,r){e=new Kn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};uc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};uc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Hi.prototype.isInfinity=function(){return this.inf};Hi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Hi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Hi.prototype.getX=function(){return this.x.fromRed()};Hi.prototype.getY=function(){return this.y.fromRed()};Hi.prototype.mul=function(e){return e=new Kn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Hi.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Hi.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Hi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Hi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Hi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function fs(t,e,r,n){By.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Kn(0)):(this.x=new Kn(e,16),this.y=new Kn(r,16),this.z=new Kn(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}DM(fs,By.BasePoint);uc.prototype.jpoint=function(e,r,n){return new fs(this,e,r,n)};fs.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};fs.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};fs.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};fs.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};fs.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};fs.prototype.inspect=function(){return this.isInfinity()?"":""};fs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var gv=Ou,bee=cE,mE=yE,tPe=Ea;function Ly(t){mE.call(this,"mont",t),this.a=new gv(t.a,16).toRed(this.red),this.b=new gv(t.b,16).toRed(this.red),this.i4=new gv(4).toRed(this.red).redInvm(),this.two=new gv(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}bee(Ly,mE);var rPe=Ly;Ly.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function qi(t,e,r){mE.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new gv(e,16),this.z=new gv(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}bee(qi,mE.BasePoint);Ly.prototype.decodePoint=function(e,r){return this.point(tPe.toArray(e,r),1)};Ly.prototype.point=function(e,r){return new qi(this,e,r)};Ly.prototype.pointFromJSON=function(e){return qi.fromJSON(this,e)};qi.prototype.precompute=function(){};qi.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};qi.fromJSON=function(e,r){return new qi(e,r[0],r[1]||e.one)};qi.prototype.inspect=function(){return this.isInfinity()?"":""};qi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};qi.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};qi.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};qi.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),c=s.redMul(i),l=r.z.redMul(a.redAdd(c).redSqr()),f=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,f)};qi.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};qi.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};qi.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};qi.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};qi.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};qi.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var nPe=Ea,eu=Ou,wee=cE,bE=yE,iPe=nPe.assert;function of(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,bE.call(this,"edwards",t),this.a=new eu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new eu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new eu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),iPe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}wee(of,bE);var sPe=of;of.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};of.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};of.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};of.prototype.pointFromX=function(e,r){e=new eu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)};of.prototype.pointFromY=function(e,r){e=new eu(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};of.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function wn(t,e,r,n,i){bE.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new eu(e,16),this.y=new eu(r,16),this.z=n?new eu(n,16):this.curve.one,this.t=i&&new eu(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}wee(wn,bE.BasePoint);of.prototype.pointFromJSON=function(e){return wn.fromJSON(this,e)};of.prototype.point=function(e,r,n,i){return new wn(this,e,r,n,i)};wn.fromJSON=function(e,r){return new wn(e,r[0],r[1],r[2])};wn.prototype.inspect=function(){return this.isInfinity()?"":""};wn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};wn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),c=i.redSub(r),l=s.redMul(a),f=o.redMul(c),u=s.redMul(c),p=a.redMul(o);return this.curve.point(l,f,p,u)};wn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,c,l;if(this.curve.twisted){a=this.curve._mulA(r);var f=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(f.redSub(this.curve.two)),s=f.redMul(a.redSub(n)),o=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),l=f.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=f.redMul(a.redSub(n)),o=f.redMul(l))}else a=r.redAdd(n),c=this.curve._mulC(this.z).redSqr(),l=a.redSub(c).redSub(c),i=this.curve._mulC(e.redISub(a)).redMul(l),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(l);return this.curve.point(i,s,o)};wn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};wn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),c=s.redAdd(i),l=n.redAdd(r),f=o.redMul(a),u=c.redMul(l),p=o.redMul(l),g=a.redMul(c);return this.curve.point(f,u,g,p)};wn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),c=n.redAdd(o),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),f=r.redMul(a).redMul(l),u,p;return this.curve.twisted?(u=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),p=a.redMul(c)):(u=r.redMul(c).redMul(s.redSub(i)),p=this.curve._mulC(a).redMul(c)),this.curve.point(f,u,p)};wn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};wn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};wn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};wn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};wn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};wn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};wn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};wn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};wn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};wn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};wn.prototype.toP=wn.prototype.normalize;wn.prototype.mixedAdd=wn.prototype.add;(function(t){var e=t;e.base=yE,e.short=ePe,e.mont=rPe,e.edwards=sPe})(OM);var wE={},z9,$j;function oPe(){return $j||($j=1,z9={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),z9}(function(t){var e=t,r=Mx,n=OM,i=Ea,s=i.assert;function o(l){l.type==="short"?this.curve=new n.short(l):l.type==="edwards"?this.curve=new n.edwards(l):this.curve=new n.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(l,f){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var u=new o(f);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=oPe()}catch{c=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})})(wE);var aPe=Mx,yp=MM,xee=Yp;function vh(t){if(!(this instanceof vh))return new vh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=yp.toArray(t.entropy,t.entropyEnc||"hex"),r=yp.toArray(t.nonce,t.nonceEnc||"hex"),n=yp.toArray(t.pers,t.persEnc||"hex");xee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var cPe=vh;vh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};vh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=yp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var i4=Ou,NM=Ea,dPe=NM.assert;function xE(t,e){if(t instanceof xE)return t;this._importDER(t,e)||(dPe(t.r&&t.s,"Signature without r or s"),this.r=new i4(t.r,16),this.s=new i4(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var hPe=xE;function pPe(){this.place=0}function H9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function qj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}xE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=qj(r),n=qj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];G9(i,r.length),i=i.concat(r),i.push(2),G9(i,n.length);var s=i.concat(n),o=[48];return G9(o,s.length),o=o.concat(s),NM.encode(o,e)};var tu=Ou,Eee=cPe,vPe=Ea,W9=wE,gPe=mee,Cee=vPe.assert,BM=uPe,EE=hPe;function ac(t){if(!(this instanceof ac))return new ac(t);typeof t=="string"&&(Cee(Object.prototype.hasOwnProperty.call(W9,t),"Unknown curve "+t),t=W9[t]),t instanceof W9.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var yPe=ac;ac.prototype.keyPair=function(e){return new BM(this,e)};ac.prototype.keyFromPrivate=function(e,r){return BM.fromPrivate(this,e,r)};ac.prototype.keyFromPublic=function(e,r){return BM.fromPublic(this,e,r)};ac.prototype.genKeyPair=function(e){e||(e={});for(var r=new Eee({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||gPe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new tu(2));;){var s=new tu(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ac.prototype._truncateToN=function(e,r,n){var i;if(tu.isBN(e)||typeof e=="number")e=new tu(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new tu(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new tu(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ac.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength);for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new Eee({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new tu(1)),f=0;;f++){var u=i.k?i.k(f):new tu(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new EE({r:y,s:b,recoveryParam:I})}}}}}};ac.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new EE(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.eqXToP(o)):(u=this.g.mulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.getX().umod(this.n).cmp(o)===0)};ac.prototype.recoverPubKey=function(t,e,r,n){Cee((3&r)===r,"The recovery param is more than two bits"),e=new EE(e,n);var i=this.n,s=new tu(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};ac.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new EE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Bx=Ea,Aee=Bx.assert,Vj=Bx.parseBytes,Fy=Bx.cachedProperty;function Ui(t,e){this.eddsa=t,this._secret=Vj(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Vj(e.pub)}Ui.fromPublic=function(e,r){return r instanceof Ui?r:new Ui(e,{pub:r})};Ui.fromSecret=function(e,r){return r instanceof Ui?r:new Ui(e,{secret:r})};Ui.prototype.secret=function(){return this._secret};Fy(Ui,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Fy(Ui,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Fy(Ui,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Fy(Ui,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Fy(Ui,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Fy(Ui,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Ui.prototype.sign=function(e){return Aee(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Ui.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Ui.prototype.getSecret=function(e){return Aee(this._secret,"KeyPair is public only"),Bx.encode(this.secret(),e)};Ui.prototype.getPublic=function(e){return Bx.encode(this.pubBytes(),e)};var mPe=Ui,bPe=Ou,CE=Ea,zj=CE.assert,AE=CE.cachedProperty,wPe=CE.parseBytes;function Jp(t,e){this.eddsa=t,typeof e!="object"&&(e=wPe(e)),Array.isArray(e)&&(zj(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),zj(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof bPe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}AE(Jp,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});AE(Jp,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});AE(Jp,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});AE(Jp,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Jp.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Jp.prototype.toHex=function(){return CE.encode(this.toBytes(),"hex").toUpperCase()};var xPe=Jp,EPe=Mx,CPe=wE,cy=Ea,APe=cy.assert,See=cy.parseBytes,_ee=mPe,Hj=xPe;function Bo(t){if(APe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Bo))return new Bo(t);t=CPe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=EPe.sha512}var SPe=Bo;Bo.prototype.sign=function(e,r){e=See(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:c,Rencoded:o})};Bo.prototype.verify=function(e,r,n){if(e=See(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Bo.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%128<112?128:256;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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 s(a,c,l,f,u,p,g){for(var y=l[0],b=l[1],I=l[2],C=l[3],S=l[4],O=l[5],L=l[6],F=l[7],z=f[0],_=f[1],$=f[2],ie=f[3],ce=f[4],K=f[5],P=f[6],M=f[7],v,m,R,B,E,x,w,T;g>=128;){for(var k=0;k<16;k++){var H=8*k+p;a[k]=e.readUint32BE(u,H),c[k]=e.readUint32BE(u,H+4)}for(var k=0;k<80;k++){var oe=y,j=b,X=I,G=C,Z=S,ee=O,N=L,te=F,fe=z,Ee=_,_e=$,Re=ie,Te=ce,De=K,ze=P,et=M;if(v=F,m=M,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|ce<<18)^(S>>>18|ce<<14)^(ce>>>9|S<<23),m=(ce>>>14|S<<18)^(ce>>>18|S<<14)^(S>>>9|ce<<23),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=S&O^~S&L,m=ce&K^~ce&P,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=i[k*2],m=i[k*2+1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=a[k%16],m=c[k%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,R=w&65535|T<<16,B=E&65535|x<<16,v=R,m=B,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(y>>>28|z<<4)^(z>>>2|y<<30)^(z>>>7|y<<25),m=(z>>>28|y<<4)^(y>>>2|z<<30)^(y>>>7|z<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=z&_^z&$^_&$,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,te=w&65535|T<<16,et=E&65535|x<<16,v=G,m=Re,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=R,m=B,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,G=w&65535|T<<16,Re=E&65535|x<<16,b=oe,I=j,C=X,S=G,O=Z,L=ee,F=N,y=te,_=fe,$=Ee,ie=_e,ce=Re,K=Te,P=De,M=ze,z=et,k%16===15)for(var H=0;H<16;H++)v=a[H],m=c[H],E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=a[(H+9)%16],m=c[(H+9)%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,R=a[(H+1)%16],B=c[(H+1)%16],v=(R>>>1|B<<31)^(R>>>8|B<<24)^R>>>7,m=(B>>>1|R<<31)^(B>>>8|R<<24)^(B>>>7|R<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,R=a[(H+14)%16],B=c[(H+14)%16],v=(R>>>19|B<<13)^(B>>>29|R<<3)^R>>>6,m=(B>>>19|R<<13)^(R>>>29|B<<3)^(B>>>6|R<<26),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,a[H]=w&65535|T<<16,c[H]=E&65535|x<<16}v=y,m=z,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=z=E&65535|x<<16,v=b,m=_,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=E&65535|x<<16,v=I,m=$,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=$=E&65535|x<<16,v=C,m=ie,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=E&65535|x<<16,v=S,m=ce,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=ce=E&65535|x<<16,v=O,m=K,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[5]=O=w&65535|T<<16,f[5]=K=E&65535|x<<16,v=L,m=P,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=P=E&65535|x<<16,v=F,m=M,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=M=E&65535|x<<16,p+=128,g-=128}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Iee);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Nh,r=Iee,n=xa;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(G){const Z=new Float64Array(16);if(G)for(let ee=0;ee>16&1),ee[Ee-1]&=65535;ee[15]=N[15]-32767-(ee[14]>>16&1);const fe=ee[15]>>16&1;ee[14]&=65535,b(N,ee,1-fe)}for(let te=0;te<16;te++)G[2*te]=N[te]&255,G[2*te+1]=N[te]>>8}function C(G,Z){let ee=0;for(let N=0;N<32;N++)ee|=G[N]^Z[N];return(1&ee-1>>>8)-1}function S(G,Z){const ee=new Uint8Array(32),N=new Uint8Array(32);return I(ee,G),I(N,Z),C(ee,N)}function O(G){const Z=new Uint8Array(32);return I(Z,G),Z[0]&1}function L(G,Z){for(let ee=0;ee<16;ee++)G[ee]=Z[2*ee]+(Z[2*ee+1]<<8);G[15]&=32767}function F(G,Z,ee){for(let N=0;N<16;N++)G[N]=Z[N]+ee[N]}function z(G,Z,ee){for(let N=0;N<16;N++)G[N]=Z[N]-ee[N]}function _(G,Z,ee){let N,te,fe=0,Ee=0,_e=0,Re=0,Te=0,De=0,ze=0,et=0,Je=0,ke=0,Ne=0,tt=0,Ze=0,st=0,nt=0,We=0,lt=0,vt=0,Ke=0,gt=0,wt=0,rt=0,It=0,At=0,Tt=0,Xt=0,lr=0,xt=0,ar=0,rr=0,kt=0,Dt=ee[0],Nt=ee[1],dt=ee[2],Lt=ee[3],Mt=ee[4],ut=ee[5],Vt=ee[6],zt=ee[7],ht=ee[8],Et=ee[9],Bt=ee[10],He=ee[11],$t=ee[12],Ct=ee[13],ct=ee[14],Ht=ee[15];N=Z[0],fe+=N*Dt,Ee+=N*Nt,_e+=N*dt,Re+=N*Lt,Te+=N*Mt,De+=N*ut,ze+=N*Vt,et+=N*zt,Je+=N*ht,ke+=N*Et,Ne+=N*Bt,tt+=N*He,Ze+=N*$t,st+=N*Ct,nt+=N*ct,We+=N*Ht,N=Z[1],Ee+=N*Dt,_e+=N*Nt,Re+=N*dt,Te+=N*Lt,De+=N*Mt,ze+=N*ut,et+=N*Vt,Je+=N*zt,ke+=N*ht,Ne+=N*Et,tt+=N*Bt,Ze+=N*He,st+=N*$t,nt+=N*Ct,We+=N*ct,lt+=N*Ht,N=Z[2],_e+=N*Dt,Re+=N*Nt,Te+=N*dt,De+=N*Lt,ze+=N*Mt,et+=N*ut,Je+=N*Vt,ke+=N*zt,Ne+=N*ht,tt+=N*Et,Ze+=N*Bt,st+=N*He,nt+=N*$t,We+=N*Ct,lt+=N*ct,vt+=N*Ht,N=Z[3],Re+=N*Dt,Te+=N*Nt,De+=N*dt,ze+=N*Lt,et+=N*Mt,Je+=N*ut,ke+=N*Vt,Ne+=N*zt,tt+=N*ht,Ze+=N*Et,st+=N*Bt,nt+=N*He,We+=N*$t,lt+=N*Ct,vt+=N*ct,Ke+=N*Ht,N=Z[4],Te+=N*Dt,De+=N*Nt,ze+=N*dt,et+=N*Lt,Je+=N*Mt,ke+=N*ut,Ne+=N*Vt,tt+=N*zt,Ze+=N*ht,st+=N*Et,nt+=N*Bt,We+=N*He,lt+=N*$t,vt+=N*Ct,Ke+=N*ct,gt+=N*Ht,N=Z[5],De+=N*Dt,ze+=N*Nt,et+=N*dt,Je+=N*Lt,ke+=N*Mt,Ne+=N*ut,tt+=N*Vt,Ze+=N*zt,st+=N*ht,nt+=N*Et,We+=N*Bt,lt+=N*He,vt+=N*$t,Ke+=N*Ct,gt+=N*ct,wt+=N*Ht,N=Z[6],ze+=N*Dt,et+=N*Nt,Je+=N*dt,ke+=N*Lt,Ne+=N*Mt,tt+=N*ut,Ze+=N*Vt,st+=N*zt,nt+=N*ht,We+=N*Et,lt+=N*Bt,vt+=N*He,Ke+=N*$t,gt+=N*Ct,wt+=N*ct,rt+=N*Ht,N=Z[7],et+=N*Dt,Je+=N*Nt,ke+=N*dt,Ne+=N*Lt,tt+=N*Mt,Ze+=N*ut,st+=N*Vt,nt+=N*zt,We+=N*ht,lt+=N*Et,vt+=N*Bt,Ke+=N*He,gt+=N*$t,wt+=N*Ct,rt+=N*ct,It+=N*Ht,N=Z[8],Je+=N*Dt,ke+=N*Nt,Ne+=N*dt,tt+=N*Lt,Ze+=N*Mt,st+=N*ut,nt+=N*Vt,We+=N*zt,lt+=N*ht,vt+=N*Et,Ke+=N*Bt,gt+=N*He,wt+=N*$t,rt+=N*Ct,It+=N*ct,At+=N*Ht,N=Z[9],ke+=N*Dt,Ne+=N*Nt,tt+=N*dt,Ze+=N*Lt,st+=N*Mt,nt+=N*ut,We+=N*Vt,lt+=N*zt,vt+=N*ht,Ke+=N*Et,gt+=N*Bt,wt+=N*He,rt+=N*$t,It+=N*Ct,At+=N*ct,Tt+=N*Ht,N=Z[10],Ne+=N*Dt,tt+=N*Nt,Ze+=N*dt,st+=N*Lt,nt+=N*Mt,We+=N*ut,lt+=N*Vt,vt+=N*zt,Ke+=N*ht,gt+=N*Et,wt+=N*Bt,rt+=N*He,It+=N*$t,At+=N*Ct,Tt+=N*ct,Xt+=N*Ht,N=Z[11],tt+=N*Dt,Ze+=N*Nt,st+=N*dt,nt+=N*Lt,We+=N*Mt,lt+=N*ut,vt+=N*Vt,Ke+=N*zt,gt+=N*ht,wt+=N*Et,rt+=N*Bt,It+=N*He,At+=N*$t,Tt+=N*Ct,Xt+=N*ct,lr+=N*Ht,N=Z[12],Ze+=N*Dt,st+=N*Nt,nt+=N*dt,We+=N*Lt,lt+=N*Mt,vt+=N*ut,Ke+=N*Vt,gt+=N*zt,wt+=N*ht,rt+=N*Et,It+=N*Bt,At+=N*He,Tt+=N*$t,Xt+=N*Ct,lr+=N*ct,xt+=N*Ht,N=Z[13],st+=N*Dt,nt+=N*Nt,We+=N*dt,lt+=N*Lt,vt+=N*Mt,Ke+=N*ut,gt+=N*Vt,wt+=N*zt,rt+=N*ht,It+=N*Et,At+=N*Bt,Tt+=N*He,Xt+=N*$t,lr+=N*Ct,xt+=N*ct,ar+=N*Ht,N=Z[14],nt+=N*Dt,We+=N*Nt,lt+=N*dt,vt+=N*Lt,Ke+=N*Mt,gt+=N*ut,wt+=N*Vt,rt+=N*zt,It+=N*ht,At+=N*Et,Tt+=N*Bt,Xt+=N*He,lr+=N*$t,xt+=N*Ct,ar+=N*ct,rr+=N*Ht,N=Z[15],We+=N*Dt,lt+=N*Nt,vt+=N*dt,Ke+=N*Lt,gt+=N*Mt,wt+=N*ut,rt+=N*Vt,It+=N*zt,At+=N*ht,Tt+=N*Et,Xt+=N*Bt,lr+=N*He,xt+=N*$t,ar+=N*Ct,rr+=N*ct,kt+=N*Ht,fe+=38*lt,Ee+=38*vt,_e+=38*Ke,Re+=38*gt,Te+=38*wt,De+=38*rt,ze+=38*It,et+=38*At,Je+=38*Tt,ke+=38*Xt,Ne+=38*lr,tt+=38*xt,Ze+=38*ar,st+=38*rr,nt+=38*kt,te=1,N=fe+te+65535,te=Math.floor(N/65536),fe=N-te*65536,N=Ee+te+65535,te=Math.floor(N/65536),Ee=N-te*65536,N=_e+te+65535,te=Math.floor(N/65536),_e=N-te*65536,N=Re+te+65535,te=Math.floor(N/65536),Re=N-te*65536,N=Te+te+65535,te=Math.floor(N/65536),Te=N-te*65536,N=De+te+65535,te=Math.floor(N/65536),De=N-te*65536,N=ze+te+65535,te=Math.floor(N/65536),ze=N-te*65536,N=et+te+65535,te=Math.floor(N/65536),et=N-te*65536,N=Je+te+65535,te=Math.floor(N/65536),Je=N-te*65536,N=ke+te+65535,te=Math.floor(N/65536),ke=N-te*65536,N=Ne+te+65535,te=Math.floor(N/65536),Ne=N-te*65536,N=tt+te+65535,te=Math.floor(N/65536),tt=N-te*65536,N=Ze+te+65535,te=Math.floor(N/65536),Ze=N-te*65536,N=st+te+65535,te=Math.floor(N/65536),st=N-te*65536,N=nt+te+65535,te=Math.floor(N/65536),nt=N-te*65536,N=We+te+65535,te=Math.floor(N/65536),We=N-te*65536,fe+=te-1+37*(te-1),te=1,N=fe+te+65535,te=Math.floor(N/65536),fe=N-te*65536,N=Ee+te+65535,te=Math.floor(N/65536),Ee=N-te*65536,N=_e+te+65535,te=Math.floor(N/65536),_e=N-te*65536,N=Re+te+65535,te=Math.floor(N/65536),Re=N-te*65536,N=Te+te+65535,te=Math.floor(N/65536),Te=N-te*65536,N=De+te+65535,te=Math.floor(N/65536),De=N-te*65536,N=ze+te+65535,te=Math.floor(N/65536),ze=N-te*65536,N=et+te+65535,te=Math.floor(N/65536),et=N-te*65536,N=Je+te+65535,te=Math.floor(N/65536),Je=N-te*65536,N=ke+te+65535,te=Math.floor(N/65536),ke=N-te*65536,N=Ne+te+65535,te=Math.floor(N/65536),Ne=N-te*65536,N=tt+te+65535,te=Math.floor(N/65536),tt=N-te*65536,N=Ze+te+65535,te=Math.floor(N/65536),Ze=N-te*65536,N=st+te+65535,te=Math.floor(N/65536),st=N-te*65536,N=nt+te+65535,te=Math.floor(N/65536),nt=N-te*65536,N=We+te+65535,te=Math.floor(N/65536),We=N-te*65536,fe+=te-1+37*(te-1),G[0]=fe,G[1]=Ee,G[2]=_e,G[3]=Re,G[4]=Te,G[5]=De,G[6]=ze,G[7]=et,G[8]=Je,G[9]=ke,G[10]=Ne,G[11]=tt,G[12]=Ze,G[13]=st,G[14]=nt,G[15]=We}function $(G,Z){_(G,Z,Z)}function ie(G,Z){const ee=i();let N;for(N=0;N<16;N++)ee[N]=Z[N];for(N=253;N>=0;N--)$(ee,ee),N!==2&&N!==4&&_(ee,ee,Z);for(N=0;N<16;N++)G[N]=ee[N]}function ce(G,Z){const ee=i();let N;for(N=0;N<16;N++)ee[N]=Z[N];for(N=250;N>=0;N--)$(ee,ee),N!==1&&_(ee,ee,Z);for(N=0;N<16;N++)G[N]=ee[N]}function K(G,Z){const ee=i(),N=i(),te=i(),fe=i(),Ee=i(),_e=i(),Re=i(),Te=i(),De=i();z(ee,G[1],G[0]),z(De,Z[1],Z[0]),_(ee,ee,De),F(N,G[0],G[1]),F(De,Z[0],Z[1]),_(N,N,De),_(te,G[3],Z[3]),_(te,te,l),_(fe,G[2],Z[2]),F(fe,fe,fe),z(Ee,N,ee),z(_e,fe,te),F(Re,fe,te),F(Te,N,ee),_(G[0],Ee,_e),_(G[1],Te,Re),_(G[2],Re,_e),_(G[3],Ee,Te)}function P(G,Z,ee){for(let N=0;N<4;N++)b(G[N],Z[N],ee)}function M(G,Z){const ee=i(),N=i(),te=i();ie(te,Z[2]),_(ee,Z[0],te),_(N,Z[1],te),I(G,N),G[31]^=O(ee)<<7}function v(G,Z,ee){g(G[0],o),g(G[1],a),g(G[2],a),g(G[3],o);for(let N=255;N>=0;--N){const te=ee[N/8|0]>>(N&7)&1;P(G,Z,te),K(Z,G),K(G,G),P(G,Z,te)}}function m(G,Z){const ee=[i(),i(),i(),i()];g(ee[0],f),g(ee[1],u),g(ee[2],a),_(ee[3],f,u),v(G,ee,Z)}function R(G){if(G.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Z=(0,r.hash)(G);Z[0]&=248,Z[31]&=127,Z[31]|=64;const ee=new Uint8Array(32),N=[i(),i(),i(),i()];m(N,Z),M(ee,N);const te=new Uint8Array(64);return te.set(G),te.set(ee,32),{publicKey:ee,secretKey:te}}t.generateKeyPairFromSeed=R;function B(G){const Z=(0,e.randomBytes)(32,G),ee=R(Z);return(0,n.wipe)(Z),ee}t.generateKeyPair=B;function E(G){if(G.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(G.subarray(32))}t.extractPublicKeyFromSecretKey=E;const x=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 w(G,Z){let ee,N,te,fe;for(N=63;N>=32;--N){for(ee=0,te=N-32,fe=N-12;te>4)*x[te],ee=Z[te]>>8,Z[te]&=255;for(te=0;te<32;te++)Z[te]-=ee*x[te];for(N=0;N<32;N++)Z[N+1]+=Z[N]>>8,G[N]=Z[N]&255}function T(G){const Z=new Float64Array(64);for(let ee=0;ee<64;ee++)Z[ee]=G[ee];for(let ee=0;ee<64;ee++)G[ee]=0;w(G,Z)}function k(G,Z){const ee=new Float64Array(64),N=[i(),i(),i(),i()],te=(0,r.hash)(G.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const fe=new Uint8Array(64);fe.set(te.subarray(32),32);const Ee=new r.SHA512;Ee.update(fe.subarray(32)),Ee.update(Z);const _e=Ee.digest();Ee.clean(),T(_e),m(N,_e),M(fe,N),Ee.reset(),Ee.update(fe.subarray(0,32)),Ee.update(G.subarray(32)),Ee.update(Z);const Re=Ee.digest();T(Re);for(let Te=0;Te<32;Te++)ee[Te]=_e[Te];for(let Te=0;Te<32;Te++)for(let De=0;De<32;De++)ee[Te+De]+=Re[Te]*te[De];return w(fe.subarray(32),ee),fe}t.sign=k;function H(G,Z){const ee=i(),N=i(),te=i(),fe=i(),Ee=i(),_e=i(),Re=i();return g(G[2],a),L(G[1],Z),$(te,G[1]),_(fe,te,c),z(te,te,G[2]),F(fe,G[2],fe),$(Ee,fe),$(_e,Ee),_(Re,_e,Ee),_(ee,Re,te),_(ee,ee,fe),ce(ee,ee),_(ee,ee,te),_(ee,ee,fe),_(ee,ee,fe),_(G[0],ee,fe),$(N,G[0]),_(N,N,fe),S(N,te)&&_(G[0],G[0],p),$(N,G[0]),_(N,N,fe),S(N,te)?-1:(O(G[0])===Z[31]>>7&&z(G[0],o,G[0]),_(G[3],G[0],G[1]),0)}function oe(G,Z,ee){const N=new Uint8Array(32),te=[i(),i(),i(),i()],fe=[i(),i(),i(),i()];if(ee.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(H(fe,G))return!1;const Ee=new r.SHA512;Ee.update(ee.subarray(0,32)),Ee.update(G),Ee.update(Z);const _e=Ee.digest();return T(_e),v(te,fe,_e),m(fe,ee.subarray(32)),K(te,fe),M(N,te),!C(ee,N)}t.verify=oe;function j(G){let Z=[i(),i(),i(),i()];if(H(Z,G))throw new Error("Ed25519: invalid public key");let ee=i(),N=i(),te=Z[1];F(ee,a,te),z(N,a,te),ie(N,N),_(ee,ee,N);let fe=new Uint8Array(32);return I(fe,ee),fe}t.convertPublicKeyToX25519=j;function X(G){const Z=(0,r.hash)(G.subarray(0,32));Z[0]&=248,Z[31]&=127,Z[31]|=64;const ee=new Uint8Array(Z.subarray(0,32));return(0,n.wipe)(Z),ee}t.convertSecretKeyToX25519=X})(LM);const _Pe="EdDSA",IPe="JWT",s4=".",SE="base64url",Tee="utf8",Pee="utf8",TPe=":",PPe="did",kPe="key",Gj="base58btc",MPe="z",RPe="K36",OPe=32,DPe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),NPe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Lp(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return NPe(t)}catch{return t}}function Su(t){return typeof t=="string"?t:DPe(t)||""}function Wj(t){return Lp(ji(Li(t,SE),Tee))}function o4(t){return ji(Li(Su(t),Tee),SE)}function kee(t){const e=Li(RPe,Gj),r=MPe+ji(M3([e,t]),Gj);return[PPe,kPe,r].join(TPe)}function BPe(t){return ji(t,SE)}function LPe(t){return Li(t,SE)}function FPe(t){return Li([o4(t.header),o4(t.payload)].join(s4),Pee)}function jPe(t){return[o4(t.header),o4(t.payload),BPe(t.signature)].join(s4)}function dI(t){const e=t.split(s4),r=Wj(e[0]),n=Wj(e[1]),i=LPe(e[2]),s=Li(e.slice(0,2).join(s4),Pee);return{header:r,payload:n,signature:i,data:s}}function Kj(t=Nh.randomBytes(OPe)){return LM.generateKeyPairFromSeed(t)}async function UPe(t,e,r,n,i=at.fromMiliseconds(Date.now())){const s={alg:_Pe,typ:IPe},o=kee(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=FPe({header:s,payload:c}),f=LM.sign(n.secretKey,l);return jPe({header:s,payload:c,signature:f})}const $Pe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var qPe={};const VPe=":";function Vv(t){const[e,r]=t.split(VPe);return{namespace:e,reference:r}}function Yj(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Mee(t,e){return t.includes(":")?[t]:e.chains||[]}var zPe=Object.defineProperty,Qj=Object.getOwnPropertySymbols,HPe=Object.prototype.hasOwnProperty,GPe=Object.prototype.propertyIsEnumerable,Jj=(t,e,r)=>e in t?zPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zj=(t,e)=>{for(var r in e||(e={}))HPe.call(e,r)&&Jj(t,r,e[r]);if(Qj)for(var r of Qj(e))GPe.call(e,r)&&Jj(t,r,e[r]);return t};const WPe="ReactNative",la={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},KPe="js";function a4(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function jy(){return!kx()&&!!mM()&&navigator.product===WPe}function Lx(){return!a4()&&!!mM()&&!!kx()}function Fx(){return jy()?la.reactNative:a4()?la.node:Lx()?la.browser:la.unknown}function YPe(){var t;try{return jy()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function QPe(t,e){let r=Pw.parse(t);return r=Zj(Zj({},r),e),t=Pw.stringify(r),t}function Ree(){return IX()||{name:"",description:"",url:"",icons:[""]}}function JPe(){if(Fx()===la.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=W9e();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function ZPe(){var t;const e=Fx();return e===la.browser?[e,((t=_X())==null?void 0:t.host)||"unknown"].join(":"):e}function Oee(t,e,r){const n=JPe(),i=ZPe();return[[t,e].join("-"),[KPe,r].join("-"),n,i].join("/")}function XPe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=Oee(t,e,n),f={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},u=QPe(c[1]||"",f);return c[0]+"?"+u}function N0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Dee(t){return Object.fromEntries(t.entries())}function Nee(t){return new Map(Object.entries(t))}function y0(t=at.FIVE_MINUTES,e){const r=at.toMiliseconds(t||at.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function zv(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function Bee(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function eke(t){return Bee("topic",t)}function tke(t){return Bee("id",t)}function Lee(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Ei(t,e){return at.fromMiliseconds(Date.now()+at.toMiliseconds(t))}function ud(t){return Date.now()>=at.toMiliseconds(t)}function Er(t,e){return`${t}${e?`:${e}`:""}`}function R3(t=[],e=[]){return[...new Set([...t,...e])]}async function rke({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=nke(s,t,e),a=Fx();if(a===la.browser){if(!((n=kx())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,ske()?"_blank":"_self","noreferrer noopener")}else a===la.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function nke(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${oke(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function ike(t,e){let r="";try{if(Lx()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function Xj(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function eU(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function FM(){return typeof process<"u"&&qPe.IS_VITEST==="true"}function ske(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function oke(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Fee(t){return Buffer.from(t,"base64").toString("utf-8")}const ake="https://rpc.walletconnect.org/v1";async function cke(t,e,r,n,i,s){switch(r.t){case"eip191":return lke(t,e,r.s);case"eip1271":return await fke(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function lke(t,e,r){return Z_e(RX(e),r).toLowerCase()===t.toLowerCase()}async function fke(t,e,r,n,i,s){const o=Vv(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",f=r.substring(2),u=RX(e).substring(2),p=a+u+c+l+f,g=await fetch(`${s||ake}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:uke(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:p},"latest"]})}),{result:y}=await g.json();return y?y.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function uke(){return Date.now()+Math.floor(Math.random()*1e3)}var dke=Object.defineProperty,hke=Object.defineProperties,pke=Object.getOwnPropertyDescriptors,tU=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,gke=Object.prototype.propertyIsEnumerable,rU=(t,e,r)=>e in t?dke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yke=(t,e)=>{for(var r in e||(e={}))vke.call(e,r)&&rU(t,r,e[r]);if(tU)for(var r of tU(e))gke.call(e,r)&&rU(t,r,e[r]);return t},mke=(t,e)=>hke(t,pke(e));const bke="did:pkh:",jM=t=>t==null?void 0:t.split(":"),wke=t=>{const e=t&&jM(t);if(e)return t.includes(bke)?e[3]:e[1]},hI=t=>{const e=t&&jM(t);if(e)return e[2]+":"+e[3]},c4=t=>{const e=t&&jM(t);if(e)return e.pop()};async function nU(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=jee(i,i.iss),o=c4(i.iss);return await cke(o,s,n,hI(i.iss),r)}const jee=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=c4(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${wke(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,u=t.nbf?`Not Before: ${t.nbf}`:void 0,p=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(b=>` -- ${b}`).join("")}`:void 0,y=O3(t.resources);if(y){const b=kw(y);i=Pke(i,b)}return[r,n,"",i,"",s,o,a,c,l,f,u,p,g].filter(b=>b!=null).join(` -`)};function xke(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Eke(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Fp(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function Cke(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:Ake(e,r,n)}}}function Ake(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Uee(t){return Fp(t),`urn:recap:${xke(t).replace(/=/g,"")}`}function kw(t){const e=Eke(t.replace("urn:recap:",""));return Fp(e),e}function Ske(t,e,r){const n=Cke(t,e,r);return Uee(n)}function _ke(t){return t&&t.includes("urn:recap:")}function Ike(t,e){const r=kw(t),n=kw(e),i=Tke(r,n);return Uee(i)}function Tke(t,e){Fp(t),Fp(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[i]=mke(yke({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function Pke(t="",e){Fp(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(u=>({ability:u.split("/")[0],action:u.split("/")[1]}));c.sort((u,p)=>u.action.localeCompare(p.action));const l={};c.forEach(u=>{l[u.ability]||(l[u.ability]=[]),l[u.ability].push(u.action)});const f=Object.keys(l).map(u=>(i++,`(${i}) '${u}': '${l[u].join("', '")}' for '${a}'.`));n.push(f.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function iU(t){var e;const r=kw(t);Fp(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function sU(t){const e=kw(t);Fp(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function O3(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return _ke(e)?e:void 0}const $ee="base10",eo="base16",jd="base64pad",Nm="base64url",jx="utf8",qee=0,lu=1,Ux=2,kke=0,oU=1,Bb=12,UM=32;function Mke(){const t=PM.generateKeyPair();return{privateKey:ji(t.secretKey,eo),publicKey:ji(t.publicKey,eo)}}function pI(){const t=Nh.randomBytes(UM);return ji(t,eo)}function Rke(t,e){const r=PM.sharedKey(Li(t,eo),Li(e,eo),!0),n=new RIe(Ox.SHA256,r).expand(UM);return ji(n,eo)}function D3(t){const e=Ox.hash(Li(t,eo));return ji(e,eo)}function Bf(t){const e=Ox.hash(Li(t,jx));return ji(e,eo)}function Vee(t){return Li(`${t}`,$ee)}function jp(t){return Number(ji(t,$ee))}function Oke(t){const e=Vee(typeof t.type<"u"?t.type:qee);if(jp(e)===lu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Li(t.senderPublicKey,eo):void 0,n=typeof t.iv<"u"?Li(t.iv,eo):Nh.randomBytes(Bb),i=new IM.ChaCha20Poly1305(Li(t.symKey,eo)).seal(n,Li(t.message,jx));return zee({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function Dke(t,e){const r=Vee(Ux),n=Nh.randomBytes(Bb),i=Li(t,jx);return zee({type:r,sealed:i,iv:n,encoding:e})}function Nke(t){const e=new IM.ChaCha20Poly1305(Li(t.symKey,eo)),{sealed:r,iv:n}=Mw({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return ji(i,jx)}function Bke(t,e){const{sealed:r}=Mw({encoded:t,encoding:e});return ji(r,jx)}function zee(t){const{encoding:e=jd}=t;if(jp(t.type)===Ux)return ji(M3([t.type,t.sealed]),e);if(jp(t.type)===lu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ji(M3([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return ji(M3([t.type,t.iv,t.sealed]),e)}function Mw(t){const{encoded:e,encoding:r=jd}=t,n=Li(e,r),i=n.slice(kke,oU),s=oU;if(jp(i)===lu){const l=s+UM,f=l+Bb,u=n.slice(s,l),p=n.slice(l,f),g=n.slice(f);return{type:i,sealed:g,iv:p,senderPublicKey:u}}if(jp(i)===Ux){const l=n.slice(s),f=Nh.randomBytes(Bb);return{type:i,sealed:l,iv:f}}const o=s+Bb,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function Lke(t,e){const r=Mw({encoded:t,encoding:e==null?void 0:e.encoding});return Hee({type:jp(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ji(r.senderPublicKey,eo):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Hee(t){const e=(t==null?void 0:t.type)||qee;if(e===lu){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function aU(t){return t.type===lu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function cU(t){return t.type===Ux}function Fke(t){return new yee.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function jke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function Uke(t){return Buffer.from(jke(t),"base64")}function $ke(t,e){const[r,n,i]=t.split("."),s=Uke(i);if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),c=`${r}.${n}`,l=new Ox.SHA256().update(Buffer.from(c)).digest(),f=Fke(e),u=Buffer.from(l).toString("hex");if(!f.verify(u,{r:o,s:a}))throw new Error("Invalid signature");return dI(t).payload}const qke="irn";function vI(t){return(t==null?void 0:t.relay)||{protocol:qke}}function cb(t){const e=$Pe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Vke=Object.defineProperty,zke=Object.defineProperties,Hke=Object.getOwnPropertyDescriptors,lU=Object.getOwnPropertySymbols,Gke=Object.prototype.hasOwnProperty,Wke=Object.prototype.propertyIsEnumerable,fU=(t,e,r)=>e in t?Vke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uU=(t,e)=>{for(var r in e||(e={}))Gke.call(e,r)&&fU(t,r,e[r]);if(lU)for(var r of lU(e))Wke.call(e,r)&&fU(t,r,e[r]);return t},Kke=(t,e)=>zke(t,Hke(e));function Yke(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function dU(t){if(!t.includes("wc:")){const c=Fee(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Pw.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:Qke(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Yke(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Qke(t){return t.startsWith("//")?t.substring(2):t}function Jke(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function hU(t){return`${t.protocol}:${t.topic}@${t.version}?`+Pw.stringify(uU(Kke(uU({symKey:t.symKey},Jke(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function k6(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Uy(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Zke(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Uy(r.accounts))}),e}function Xke(t,e){const r=[];return Object.values(t).forEach(n=>{Uy(n.accounts).includes(e)&&r.push(...n.methods)}),r}function eMe(t,e){const r=[];return Object.values(t).forEach(n=>{Uy(n.accounts).includes(e)&&r.push(...n.events)}),r}function $M(t){return t.includes(":")}function lb(t){return $M(t)?t.split(":")[0]:t}function tMe(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function pU(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=tMe(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=R3(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const rMe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},nMe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function it(t,e){const{message:r,code:n}=nMe[t];return{message:e?`${r} ${e}`:r,code:n}}function rn(t,e){const{message:r,code:n}=rMe[t];return{message:e?`${r} ${e}`:r,code:n}}function rf(t,e){return!!Array.isArray(t)}function Rw(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function To(t){return typeof t>"u"}function ii(t,e){return e&&To(t)?!0:typeof t=="string"&&!!t.trim().length}function qM(t,e){return typeof t=="number"&&!isNaN(t)}function iMe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return N0(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],f=Uy(a),u=r[o];(!N0(Mee(o,u),f)||!N0(u.methods,c)||!N0(u.events,l))&&(s=!1)}),s):!1}function l4(t){return ii(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function sMe(t){if(ii(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&l4(r)}}return!1}function oMe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ii(t,!1)){if(e(t))return!0;const r=Fee(t);return e(r)}}catch{}return!1}function aMe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function cMe(t){return t==null?void 0:t.topic}function lMe(t,e){let r=null;return ii(t==null?void 0:t.publicKey,!1)||(r=it("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function vU(t){let e=!0;return rf(t)?t.length&&(e=t.every(r=>ii(r,!1))):e=!1,e}function fMe(t,e,r){let n=null;return rf(e)&&e.length?e.forEach(i=>{n||l4(i)||(n=rn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):l4(t)||(n=rn("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function uMe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=fMe(i,Mee(i,s),`${e} ${r}`);o&&(n=o)}),n}function dMe(t,e){let r=null;return rf(t)?t.forEach(n=>{r||sMe(n)||(r=rn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=rn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function hMe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=dMe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function pMe(t,e){let r=null;return vU(t==null?void 0:t.methods)?vU(t==null?void 0:t.events)||(r=rn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=rn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Gee(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=pMe(n,`${e}, namespace`);i&&(r=i)}),r}function vMe(t,e,r){let n=null;if(t&&Rw(t)){const i=Gee(t,e);i&&(n=i);const s=uMe(t,e,r);s&&(n=s)}else n=it("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function K9(t,e){let r=null;if(t&&Rw(t)){const n=Gee(t,e);n&&(r=n);const i=hMe(t,e);i&&(r=i)}else r=it("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Wee(t){return ii(t.protocol,!0)}function gMe(t,e){let r=!1;return t?t&&rf(t)&&t.length&&t.forEach(n=>{r=Wee(n)}):r=!0,r}function yMe(t){return typeof t=="number"}function xo(t){return typeof t<"u"&&typeof t!==null}function mMe(t){return!(!t||typeof t!="object"||!t.code||!qM(t.code)||!t.message||!ii(t.message,!1))}function bMe(t){return!(To(t)||!ii(t.method,!1))}function wMe(t){return!(To(t)||To(t.result)&&To(t.error)||!qM(t.id)||!ii(t.jsonrpc,!1))}function xMe(t){return!(To(t)||!ii(t.name,!1))}function gU(t,e){return!(!l4(e)||!Zke(t).includes(e))}function EMe(t,e,r){return ii(r,!1)?Xke(t,e).includes(r):!1}function CMe(t,e,r){return ii(r,!1)?eMe(t,e).includes(r):!1}function yU(t,e,r){let n=null;const i=AMe(t),s=SMe(e),o=Object.keys(i),a=Object.keys(s),c=mU(Object.keys(t)),l=mU(Object.keys(e)),f=c.filter(u=>!l.includes(u));return f.length&&(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=Ei:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],y=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],I=[224,256,384,512],C=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],O={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(j){return Object.prototype.toString.call(j)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(j){return typeof j=="object"&&j.buffer&&j.buffer.constructor===ArrayBuffer});for(var L=function(j,X,G){return function(Z){return new k(j,X,j).update(Z)[G]()}},F=function(j,X,G){return function(Z,ee){return new k(j,X,ee).update(Z)[G]()}},z=function(j,X,G){return function(Z,ee,N,te){return v["cshake"+j].update(Z,ee,N,te)[G]()}},_=function(j,X,G){return function(Z,ee,N,te){return v["kmac"+j].update(Z,ee,N,te)[G]()}},$=function(j,X,G,Z){for(var ee=0;ee>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var Z=0;Z<50;++Z)this.s[Z]=0}k.prototype.update=function(j){if(this.finalized)throw new Error(r);var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}for(var Z=this.blocks,ee=this.byteCount,N=j.length,te=this.blockCount,fe=0,Ee=this.s,_e,Re;fe>2]|=j[fe]<>2]|=Re<>2]|=(192|Re>>6)<>2]|=(128|Re&63)<=57344?(Z[_e>>2]|=(224|Re>>12)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<>2]|=(240|Re>>18)<>2]|=(128|Re>>12&63)<>2]|=(128|Re>>6&63)<>2]|=(128|Re&63)<=ee){for(this.start=_e-ee,this.block=Z[te],_e=0;_e>8,G=j&255;G>0;)ee.unshift(G),j=j>>8,G=j&255,++Z;return X?ee.push(Z):ee.unshift(Z),this.update(ee),ee.length},k.prototype.encodeString=function(j){var X,G=typeof j;if(G!=="string"){if(G==="object"){if(j===null)throw new Error(e);if(c&&j.constructor===ArrayBuffer)j=new Uint8Array(j);else if(!Array.isArray(j)&&(!c||!ArrayBuffer.isView(j)))throw new Error(e)}else throw new Error(e);X=!0}var Z=0,ee=j.length;if(X)Z=ee;else for(var N=0;N=57344?Z+=3:(te=65536+((te&1023)<<10|j.charCodeAt(++N)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},k.prototype.bytepad=function(j,X){for(var G=this.encode(X),Z=0;Z>2]|=this.padding[X&3],this.lastByteIndex===this.byteCount)for(j[0]=j[G],X=1;X>4&15]+l[fe&15]+l[fe>>12&15]+l[fe>>8&15]+l[fe>>20&15]+l[fe>>16&15]+l[fe>>28&15]+l[fe>>24&15];N%j===0&&(oe(X),ee=0)}return Z&&(fe=X[ee],te+=l[fe>>4&15]+l[fe&15],Z>1&&(te+=l[fe>>12&15]+l[fe>>8&15]),Z>2&&(te+=l[fe>>20&15]+l[fe>>16&15])),te},k.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,X=this.s,G=this.outputBlocks,Z=this.extraBytes,ee=0,N=0,te=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(te);for(var Ee=new Uint32Array(fe);N>8&255,te[fe+2]=Ee>>16&255,te[fe+3]=Ee>>24&255;N%j===0&&oe(X)}return Z&&(fe=N<<2,Ee=X[ee],te[fe]=Ee&255,Z>1&&(te[fe+1]=Ee>>8&255),Z>2&&(te[fe+2]=Ee>>16&255)),te};function H(j,X,G){k.call(this,j,X,G)}H.prototype=new k,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),k.prototype.finalize.call(this)};var oe=function(j){var X,G,Z,ee,N,te,fe,Ee,_e,Re,Te,De,ze,Xe,Qe,ke,Ne,et,Je,it,rt,We,lt,pt,Ke,vt,bt,tt,_t,Ct,It,er,ur,wt,lr,ir,Pt,Ot,Dt,dt,Bt,kt,ut,Vt,zt,ht,xt,Nt,He,$t,Et,ct,Ht,Dr,Ut,Ir,tr,Rr,vi,gi,yi,Si,_n;for(Z=0;Z<48;Z+=2)ee=j[0]^j[10]^j[20]^j[30]^j[40],N=j[1]^j[11]^j[21]^j[31]^j[41],te=j[2]^j[12]^j[22]^j[32]^j[42],fe=j[3]^j[13]^j[23]^j[33]^j[43],Ee=j[4]^j[14]^j[24]^j[34]^j[44],_e=j[5]^j[15]^j[25]^j[35]^j[45],Re=j[6]^j[16]^j[26]^j[36]^j[46],Te=j[7]^j[17]^j[27]^j[37]^j[47],De=j[8]^j[18]^j[28]^j[38]^j[48],ze=j[9]^j[19]^j[29]^j[39]^j[49],X=De^(te<<1|fe>>>31),G=ze^(fe<<1|te>>>31),j[0]^=X,j[1]^=G,j[10]^=X,j[11]^=G,j[20]^=X,j[21]^=G,j[30]^=X,j[31]^=G,j[40]^=X,j[41]^=G,X=ee^(Ee<<1|_e>>>31),G=N^(_e<<1|Ee>>>31),j[2]^=X,j[3]^=G,j[12]^=X,j[13]^=G,j[22]^=X,j[23]^=G,j[32]^=X,j[33]^=G,j[42]^=X,j[43]^=G,X=te^(Re<<1|Te>>>31),G=fe^(Te<<1|Re>>>31),j[4]^=X,j[5]^=G,j[14]^=X,j[15]^=G,j[24]^=X,j[25]^=G,j[34]^=X,j[35]^=G,j[44]^=X,j[45]^=G,X=Ee^(De<<1|ze>>>31),G=_e^(ze<<1|De>>>31),j[6]^=X,j[7]^=G,j[16]^=X,j[17]^=G,j[26]^=X,j[27]^=G,j[36]^=X,j[37]^=G,j[46]^=X,j[47]^=G,X=Re^(ee<<1|N>>>31),G=Te^(N<<1|ee>>>31),j[8]^=X,j[9]^=G,j[18]^=X,j[19]^=G,j[28]^=X,j[29]^=G,j[38]^=X,j[39]^=G,j[48]^=X,j[49]^=G,Xe=j[0],Qe=j[1],ht=j[11]<<4|j[10]>>>28,xt=j[10]<<4|j[11]>>>28,tt=j[20]<<3|j[21]>>>29,_t=j[21]<<3|j[20]>>>29,gi=j[31]<<9|j[30]>>>23,yi=j[30]<<9|j[31]>>>23,kt=j[40]<<18|j[41]>>>14,ut=j[41]<<18|j[40]>>>14,wt=j[2]<<1|j[3]>>>31,lr=j[3]<<1|j[2]>>>31,ke=j[13]<<12|j[12]>>>20,Ne=j[12]<<12|j[13]>>>20,Nt=j[22]<<10|j[23]>>>22,He=j[23]<<10|j[22]>>>22,Ct=j[33]<<13|j[32]>>>19,It=j[32]<<13|j[33]>>>19,Si=j[42]<<2|j[43]>>>30,_n=j[43]<<2|j[42]>>>30,Dr=j[5]<<30|j[4]>>>2,Ut=j[4]<<30|j[5]>>>2,ir=j[14]<<6|j[15]>>>26,Pt=j[15]<<6|j[14]>>>26,et=j[25]<<11|j[24]>>>21,Je=j[24]<<11|j[25]>>>21,$t=j[34]<<15|j[35]>>>17,Et=j[35]<<15|j[34]>>>17,er=j[45]<<29|j[44]>>>3,ur=j[44]<<29|j[45]>>>3,pt=j[6]<<28|j[7]>>>4,Ke=j[7]<<28|j[6]>>>4,Ir=j[17]<<23|j[16]>>>9,tr=j[16]<<23|j[17]>>>9,Ot=j[26]<<25|j[27]>>>7,Dt=j[27]<<25|j[26]>>>7,it=j[36]<<21|j[37]>>>11,rt=j[37]<<21|j[36]>>>11,ct=j[47]<<24|j[46]>>>8,Ht=j[46]<<24|j[47]>>>8,Vt=j[8]<<27|j[9]>>>5,zt=j[9]<<27|j[8]>>>5,vt=j[18]<<20|j[19]>>>12,bt=j[19]<<20|j[18]>>>12,Rr=j[29]<<7|j[28]>>>25,vi=j[28]<<7|j[29]>>>25,dt=j[38]<<8|j[39]>>>24,Bt=j[39]<<8|j[38]>>>24,We=j[48]<<14|j[49]>>>18,lt=j[49]<<14|j[48]>>>18,j[0]=Xe^~ke&et,j[1]=Qe^~Ne&Je,j[10]=pt^~vt&tt,j[11]=Ke^~bt&_t,j[20]=wt^~ir&Ot,j[21]=lr^~Pt&Dt,j[30]=Vt^~ht&Nt,j[31]=zt^~xt&He,j[40]=Dr^~Ir&Rr,j[41]=Ut^~tr&vi,j[2]=ke^~et&it,j[3]=Ne^~Je&rt,j[12]=vt^~tt&Ct,j[13]=bt^~_t&It,j[22]=ir^~Ot&dt,j[23]=Pt^~Dt&Bt,j[32]=ht^~Nt&$t,j[33]=xt^~He&Et,j[42]=Ir^~Rr&gi,j[43]=tr^~vi&yi,j[4]=et^~it&We,j[5]=Je^~rt<,j[14]=tt^~Ct&er,j[15]=_t^~It&ur,j[24]=Ot^~dt&kt,j[25]=Dt^~Bt&ut,j[34]=Nt^~$t&ct,j[35]=He^~Et&Ht,j[44]=Rr^~gi&Si,j[45]=vi^~yi&_n,j[6]=it^~We&Xe,j[7]=rt^~lt&Qe,j[16]=Ct^~er&pt,j[17]=It^~ur&Ke,j[26]=dt^~kt&wt,j[27]=Bt^~ut&lr,j[36]=$t^~ct&Vt,j[37]=Et^~Ht&zt,j[46]=gi^~Si&Dr,j[47]=yi^~_n&Ut,j[8]=We^~Xe&ke,j[9]=lt^~Qe&Ne,j[18]=er^~pt&vt,j[19]=ur^~Ke&bt,j[28]=kt^~wt&ir,j[29]=ut^~lr&Pt,j[38]=ct^~Vt&ht,j[39]=Ht^~zt&xt,j[48]=Si^~Dr&Ir,j[49]=_n^~Ut&tr,j[0]^=b[Z],j[1]^=b[Z+1]};if(a)t.exports=v;else for(R=0;R{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const bj=WSe();var J_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(J_||(J_={}));var Tc;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Tc||(Tc={}));const wj="0123456789abcdef";class Cn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();C3[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(mj>C3[n])&&console.log.apply(console,r)}debug(...e){this._log(Cn.levels.DEBUG,e)}info(...e){this._log(Cn.levels.INFO,e)}warn(...e){this._log(Cn.levels.WARNING,e)}makeError(e,r,n){if(yj)return this.makeError("censored error",r,{});r||(r=Cn.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let f="";for(let u=0;u>4],f+=wj[l[u]&15];i.push(c+"=Uint8Array(0x"+f+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Tc.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Tc.CALL_EXCEPTION:case Tc.INSUFFICIENT_FUNDS:case Tc.MISSING_NEW:case Tc.NONCE_EXPIRED:case Tc.REPLACEMENT_UNDERPRICED:case Tc.TRANSACTION_REPLACED:case Tc.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Cn.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){bj&&this.throwError("platform missing String.prototype.normalize",Cn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:bj})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Cn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Cn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Cn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Cn.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return k9||(k9=new Cn(GSe)),k9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gj){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}yj=!!e,gj=!!r}static setLogLevel(e){const r=C3[e.toLowerCase()];if(r==null){Cn.globalLogger().warn("invalid log level - "+e);return}mj=r}static from(e){return new Cn(e)}}Cn.errors=Tc;Cn.levels=J_;const KSe="bytes/5.7.0",ei=new Cn(KSe);function IX(t){return!!t.toHexString}function qv(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return qv(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function YSe(t){return Ll(t)&&!(t.length%2)||yM(t)}function xj(t){return typeof t=="number"&&t==t&&t%1===0}function yM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!xj(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function di(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),qv(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),IX(t)&&(t=t.toHexString()),Ll(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ei.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;idi(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),qv(n)}function JSe(t,e){t=di(t),t.length>e&&ei.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),qv(r)}function Ll(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const M9="0123456789abcdef";function ea(t,e){if(e||(e={}),typeof t=="number"){ei.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=M9[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),IX(t))return t.toHexString();if(Ll(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ei.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(yM(t)){let r="0x";for(let n=0;n>4]+M9[i&15]}return r}return ei.throwArgumentError("invalid hexlify value","value",t)}function ZSe(t){if(typeof t!="string")t=ea(t);else if(!Ll(t)||t.length%2)return null;return(t.length-2)/2}function Ej(t,e,r){return typeof t!="string"?t=ea(t):(!Ll(t)||t.length%2)&&ei.throwArgumentError("invalid hexData","value",t),e=2+2*e,"0x"+t.substring(e)}function Vv(t,e){for(typeof t!="string"?t=ea(t):Ll(t)||ei.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ei.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function TX(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(YSe(t)){let r=di(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ea(r.slice(0,32)),e.s=ea(r.slice(32,64))):r.length===65?(e.r=ea(r.slice(0,32)),e.s=ea(r.slice(32,64)),e.v=r[64]):ei.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ei.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ea(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=JSe(di(e._vs),32);e._vs=ea(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&ei.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=ea(i);e.s==null?e.s=o:e.s!==o&&ei.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ei.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ei.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Ll(e.r)?ei.throwArgumentError("signature missing or invalid r","signature",t):e.r=Vv(e.r,32),e.s==null||!Ll(e.s)?ei.throwArgumentError("signature missing or invalid s","signature",t):e.s=Vv(e.s,32);const r=di(e.s);r[0]>=128&&ei.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=ea(r);e._vs&&(Ll(e._vs)||ei.throwArgumentError("signature invalid _vs","signature",t),e._vs=Vv(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ei.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function mM(t){return"0x"+HSe.keccak_256(di(t))}var bM={exports:{}};const XSe={},e7e=Object.freeze(Object.defineProperty({__proto__:null,default:XSe},Symbol.toStringTag,{value:"Module"})),rE=U$(e7e);bM.exports;(function(t){(function(e,r){function n(M,v){if(!M)throw new Error(v||"Assertion failed")}function i(M,v){M.super_=v;var m=function(){};m.prototype=v.prototype,M.prototype=new m,M.prototype.constructor=M}function s(M,v,m){if(s.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(M||0,v||10,m||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=rE.Buffer}catch{}s.isBN=function(v){return v instanceof s?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===s.wordSize&&Array.isArray(v.words)},s.max=function(v,m){return v.cmp(m)>0?v:m},s.min=function(v,m){return v.cmp(m)<0?v:m},s.prototype._init=function(v,m,R){if(typeof v=="number")return this._initNumber(v,m,R);if(typeof v=="object")return this._initArray(v,m,R);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var B=0;v[0]==="-"&&(B++,this.negative=1),B=0;B-=3)x=v[B]|v[B-1]<<8|v[B-2]<<16,this.words[E]|=x<>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);else if(R==="le")for(B=0,E=0;B>>26-w&67108863,w+=24,w>=26&&(w-=26,E++);return this._strip()};function a(M,v){var m=M.charCodeAt(v);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+M)}function c(M,v,m){var R=a(M,m);return m-1>=v&&(R|=a(M,m-1)<<4),R}s.prototype._parseHex=function(v,m,R){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var B=0;B=m;B-=2)w=c(v,m,B)<=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8;else{var T=v.length-m;for(B=T%2===0?m+1:m;B=18?(E-=18,x+=1,this.words[x]|=w>>>26):E+=8}this._strip()};function l(M,v,m,R){for(var B=0,E=0,x=Math.min(M.length,m),w=v;w=49?E=T-49+10:T>=17?E=T-17+10:E=T,n(T>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(v,m){v=v||10,m=m|0||1;var R;if(v===16||v==="hex"){R="";for(var B=0,E=0,x=0;x>>24-B&16777215,B+=2,B>=26&&(B-=26,x--),E!==0||x!==this.length-1?R=p[6-T.length]+T+R:R=T+R}for(E!==0&&(R=E.toString(16)+R);R.length%m!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(v===(v|0)&&v>=2&&v<=36){var k=g[v],H=y[v];R="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(H).toString(v);oe=oe.idivn(H),oe.isZero()?R=j+R:R=p[k-j.length]+j+R}for(this.isZero()&&(R="0"+R);R.length%m!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(v,m){return this.toArrayLike(o,v,m)}),s.prototype.toArray=function(v,m){return this.toArrayLike(Array,v,m)};var b=function(v,m){return v.allocUnsafe?v.allocUnsafe(m):new v(m)};s.prototype.toArrayLike=function(v,m,R){this._strip();var B=this.byteLength(),E=R||Math.max(1,B);n(B<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var x=b(v,E),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](x,B),x},s.prototype._toArrayLikeLE=function(v,m){for(var R=0,B=0,E=0,x=0;E>8&255),R>16&255),x===6?(R>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(R=0&&(v[R--]=w>>8&255),R>=0&&(v[R--]=w>>16&255),x===6?(R>=0&&(v[R--]=w>>24&255),B=0,x=0):(B=w>>>24,x+=2)}if(R>=0)for(v[R--]=B;R>=0;)v[R--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,R=0;return m>=4096&&(R+=13,m>>>=13),m>=64&&(R+=7,m>>>=7),m>=8&&(R+=4,m>>>=4),m>=2&&(R+=2,m>>>=2),R+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,R=0;return m&8191||(R+=13,m>>>=13),m&127||(R+=7,m>>>=7),m&15||(R+=4,m>>>=4),m&3||(R+=2,m>>>=2),m&1||R++,R},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(M){for(var v=new Array(M.bitLength()),m=0;m>>B&1}return v}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,m=0;mv.length?this.clone().ior(v):v.clone().ior(this)},s.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},s.prototype.iuand=function(v){var m;this.length>v.length?m=v:m=this;for(var R=0;Rv.length?this.clone().iand(v):v.clone().iand(this)},s.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},s.prototype.iuxor=function(v){var m,R;this.length>v.length?(m=this,R=v):(m=v,R=this);for(var B=0;Bv.length?this.clone().ixor(v):v.clone().ixor(this)},s.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},s.prototype.inotn=function(v){n(typeof v=="number"&&v>=0);var m=Math.ceil(v/26)|0,R=v%26;this._expand(m),R>0&&m--;for(var B=0;B0&&(this.words[B]=~this.words[B]&67108863>>26-R),this._strip()},s.prototype.notn=function(v){return this.clone().inotn(v)},s.prototype.setn=function(v,m){n(typeof v=="number"&&v>=0);var R=v/26|0,B=v%26;return this._expand(R+1),m?this.words[R]=this.words[R]|1<v.length?(R=this,B=v):(R=v,B=this);for(var E=0,x=0;x>>26;for(;E!==0&&x>>26;if(this.length=R.length,E!==0)this.words[this.length]=E,this.length++;else if(R!==this)for(;xv.length?this.clone().iadd(v):v.clone().iadd(this)},s.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var m=this.iadd(v);return v.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var R=this.cmp(v);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,E;R>0?(B=this,E=v):(B=v,E=this);for(var x=0,w=0;w>26,this.words[w]=m&67108863;for(;x!==0&&w>26,this.words[w]=m&67108863;if(x===0&&w>>26,oe=T&67108863,j=Math.min(k,v.length-1),X=Math.max(0,k-M.length+1);X<=j;X++){var G=k-X|0;B=M.words[G]|0,E=v.words[X]|0,x=B*E+oe,H+=x/67108864|0,oe=x&67108863}m.words[k]=oe|0,T=H|0}return T!==0?m.words[k]=T|0:m.length--,m._strip()}var S=function(v,m,R){var B=v.words,E=m.words,x=R.words,w=0,T,k,H,oe=B[0]|0,j=oe&8191,X=oe>>>13,G=B[1]|0,Z=G&8191,ee=G>>>13,N=B[2]|0,te=N&8191,fe=N>>>13,Ee=B[3]|0,_e=Ee&8191,Re=Ee>>>13,Te=B[4]|0,De=Te&8191,ze=Te>>>13,Xe=B[5]|0,Qe=Xe&8191,ke=Xe>>>13,Ne=B[6]|0,et=Ne&8191,Je=Ne>>>13,it=B[7]|0,rt=it&8191,We=it>>>13,lt=B[8]|0,pt=lt&8191,Ke=lt>>>13,vt=B[9]|0,bt=vt&8191,tt=vt>>>13,_t=E[0]|0,Ct=_t&8191,It=_t>>>13,er=E[1]|0,ur=er&8191,wt=er>>>13,lr=E[2]|0,ir=lr&8191,Pt=lr>>>13,Ot=E[3]|0,Dt=Ot&8191,dt=Ot>>>13,Bt=E[4]|0,kt=Bt&8191,ut=Bt>>>13,Vt=E[5]|0,zt=Vt&8191,ht=Vt>>>13,xt=E[6]|0,Nt=xt&8191,He=xt>>>13,$t=E[7]|0,Et=$t&8191,ct=$t>>>13,Ht=E[8]|0,Dr=Ht&8191,Ut=Ht>>>13,Ir=E[9]|0,tr=Ir&8191,Rr=Ir>>>13;R.negative=v.negative^m.negative,R.length=19,T=Math.imul(j,Ct),k=Math.imul(j,It),k=k+Math.imul(X,Ct)|0,H=Math.imul(X,It);var vi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(vi>>>26)|0,vi&=67108863,T=Math.imul(Z,Ct),k=Math.imul(Z,It),k=k+Math.imul(ee,Ct)|0,H=Math.imul(ee,It),T=T+Math.imul(j,ur)|0,k=k+Math.imul(j,wt)|0,k=k+Math.imul(X,ur)|0,H=H+Math.imul(X,wt)|0;var gi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(gi>>>26)|0,gi&=67108863,T=Math.imul(te,Ct),k=Math.imul(te,It),k=k+Math.imul(fe,Ct)|0,H=Math.imul(fe,It),T=T+Math.imul(Z,ur)|0,k=k+Math.imul(Z,wt)|0,k=k+Math.imul(ee,ur)|0,H=H+Math.imul(ee,wt)|0,T=T+Math.imul(j,ir)|0,k=k+Math.imul(j,Pt)|0,k=k+Math.imul(X,ir)|0,H=H+Math.imul(X,Pt)|0;var yi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(yi>>>26)|0,yi&=67108863,T=Math.imul(_e,Ct),k=Math.imul(_e,It),k=k+Math.imul(Re,Ct)|0,H=Math.imul(Re,It),T=T+Math.imul(te,ur)|0,k=k+Math.imul(te,wt)|0,k=k+Math.imul(fe,ur)|0,H=H+Math.imul(fe,wt)|0,T=T+Math.imul(Z,ir)|0,k=k+Math.imul(Z,Pt)|0,k=k+Math.imul(ee,ir)|0,H=H+Math.imul(ee,Pt)|0,T=T+Math.imul(j,Dt)|0,k=k+Math.imul(j,dt)|0,k=k+Math.imul(X,Dt)|0,H=H+Math.imul(X,dt)|0;var Si=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Si>>>26)|0,Si&=67108863,T=Math.imul(De,Ct),k=Math.imul(De,It),k=k+Math.imul(ze,Ct)|0,H=Math.imul(ze,It),T=T+Math.imul(_e,ur)|0,k=k+Math.imul(_e,wt)|0,k=k+Math.imul(Re,ur)|0,H=H+Math.imul(Re,wt)|0,T=T+Math.imul(te,ir)|0,k=k+Math.imul(te,Pt)|0,k=k+Math.imul(fe,ir)|0,H=H+Math.imul(fe,Pt)|0,T=T+Math.imul(Z,Dt)|0,k=k+Math.imul(Z,dt)|0,k=k+Math.imul(ee,Dt)|0,H=H+Math.imul(ee,dt)|0,T=T+Math.imul(j,kt)|0,k=k+Math.imul(j,ut)|0,k=k+Math.imul(X,kt)|0,H=H+Math.imul(X,ut)|0;var _n=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(Qe,Ct),k=Math.imul(Qe,It),k=k+Math.imul(ke,Ct)|0,H=Math.imul(ke,It),T=T+Math.imul(De,ur)|0,k=k+Math.imul(De,wt)|0,k=k+Math.imul(ze,ur)|0,H=H+Math.imul(ze,wt)|0,T=T+Math.imul(_e,ir)|0,k=k+Math.imul(_e,Pt)|0,k=k+Math.imul(Re,ir)|0,H=H+Math.imul(Re,Pt)|0,T=T+Math.imul(te,Dt)|0,k=k+Math.imul(te,dt)|0,k=k+Math.imul(fe,Dt)|0,H=H+Math.imul(fe,dt)|0,T=T+Math.imul(Z,kt)|0,k=k+Math.imul(Z,ut)|0,k=k+Math.imul(ee,kt)|0,H=H+Math.imul(ee,ut)|0,T=T+Math.imul(j,zt)|0,k=k+Math.imul(j,ht)|0,k=k+Math.imul(X,zt)|0,H=H+Math.imul(X,ht)|0;var us=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(us>>>26)|0,us&=67108863,T=Math.imul(et,Ct),k=Math.imul(et,It),k=k+Math.imul(Je,Ct)|0,H=Math.imul(Je,It),T=T+Math.imul(Qe,ur)|0,k=k+Math.imul(Qe,wt)|0,k=k+Math.imul(ke,ur)|0,H=H+Math.imul(ke,wt)|0,T=T+Math.imul(De,ir)|0,k=k+Math.imul(De,Pt)|0,k=k+Math.imul(ze,ir)|0,H=H+Math.imul(ze,Pt)|0,T=T+Math.imul(_e,Dt)|0,k=k+Math.imul(_e,dt)|0,k=k+Math.imul(Re,Dt)|0,H=H+Math.imul(Re,dt)|0,T=T+Math.imul(te,kt)|0,k=k+Math.imul(te,ut)|0,k=k+Math.imul(fe,kt)|0,H=H+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,k=k+Math.imul(Z,ht)|0,k=k+Math.imul(ee,zt)|0,H=H+Math.imul(ee,ht)|0,T=T+Math.imul(j,Nt)|0,k=k+Math.imul(j,He)|0,k=k+Math.imul(X,Nt)|0,H=H+Math.imul(X,He)|0;var ds=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(ds>>>26)|0,ds&=67108863,T=Math.imul(rt,Ct),k=Math.imul(rt,It),k=k+Math.imul(We,Ct)|0,H=Math.imul(We,It),T=T+Math.imul(et,ur)|0,k=k+Math.imul(et,wt)|0,k=k+Math.imul(Je,ur)|0,H=H+Math.imul(Je,wt)|0,T=T+Math.imul(Qe,ir)|0,k=k+Math.imul(Qe,Pt)|0,k=k+Math.imul(ke,ir)|0,H=H+Math.imul(ke,Pt)|0,T=T+Math.imul(De,Dt)|0,k=k+Math.imul(De,dt)|0,k=k+Math.imul(ze,Dt)|0,H=H+Math.imul(ze,dt)|0,T=T+Math.imul(_e,kt)|0,k=k+Math.imul(_e,ut)|0,k=k+Math.imul(Re,kt)|0,H=H+Math.imul(Re,ut)|0,T=T+Math.imul(te,zt)|0,k=k+Math.imul(te,ht)|0,k=k+Math.imul(fe,zt)|0,H=H+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Nt)|0,k=k+Math.imul(Z,He)|0,k=k+Math.imul(ee,Nt)|0,H=H+Math.imul(ee,He)|0,T=T+Math.imul(j,Et)|0,k=k+Math.imul(j,ct)|0,k=k+Math.imul(X,Et)|0,H=H+Math.imul(X,ct)|0;var hs=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(hs>>>26)|0,hs&=67108863,T=Math.imul(pt,Ct),k=Math.imul(pt,It),k=k+Math.imul(Ke,Ct)|0,H=Math.imul(Ke,It),T=T+Math.imul(rt,ur)|0,k=k+Math.imul(rt,wt)|0,k=k+Math.imul(We,ur)|0,H=H+Math.imul(We,wt)|0,T=T+Math.imul(et,ir)|0,k=k+Math.imul(et,Pt)|0,k=k+Math.imul(Je,ir)|0,H=H+Math.imul(Je,Pt)|0,T=T+Math.imul(Qe,Dt)|0,k=k+Math.imul(Qe,dt)|0,k=k+Math.imul(ke,Dt)|0,H=H+Math.imul(ke,dt)|0,T=T+Math.imul(De,kt)|0,k=k+Math.imul(De,ut)|0,k=k+Math.imul(ze,kt)|0,H=H+Math.imul(ze,ut)|0,T=T+Math.imul(_e,zt)|0,k=k+Math.imul(_e,ht)|0,k=k+Math.imul(Re,zt)|0,H=H+Math.imul(Re,ht)|0,T=T+Math.imul(te,Nt)|0,k=k+Math.imul(te,He)|0,k=k+Math.imul(fe,Nt)|0,H=H+Math.imul(fe,He)|0,T=T+Math.imul(Z,Et)|0,k=k+Math.imul(Z,ct)|0,k=k+Math.imul(ee,Et)|0,H=H+Math.imul(ee,ct)|0,T=T+Math.imul(j,Dr)|0,k=k+Math.imul(j,Ut)|0,k=k+Math.imul(X,Dr)|0,H=H+Math.imul(X,Ut)|0;var Vi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,T=Math.imul(bt,Ct),k=Math.imul(bt,It),k=k+Math.imul(tt,Ct)|0,H=Math.imul(tt,It),T=T+Math.imul(pt,ur)|0,k=k+Math.imul(pt,wt)|0,k=k+Math.imul(Ke,ur)|0,H=H+Math.imul(Ke,wt)|0,T=T+Math.imul(rt,ir)|0,k=k+Math.imul(rt,Pt)|0,k=k+Math.imul(We,ir)|0,H=H+Math.imul(We,Pt)|0,T=T+Math.imul(et,Dt)|0,k=k+Math.imul(et,dt)|0,k=k+Math.imul(Je,Dt)|0,H=H+Math.imul(Je,dt)|0,T=T+Math.imul(Qe,kt)|0,k=k+Math.imul(Qe,ut)|0,k=k+Math.imul(ke,kt)|0,H=H+Math.imul(ke,ut)|0,T=T+Math.imul(De,zt)|0,k=k+Math.imul(De,ht)|0,k=k+Math.imul(ze,zt)|0,H=H+Math.imul(ze,ht)|0,T=T+Math.imul(_e,Nt)|0,k=k+Math.imul(_e,He)|0,k=k+Math.imul(Re,Nt)|0,H=H+Math.imul(Re,He)|0,T=T+Math.imul(te,Et)|0,k=k+Math.imul(te,ct)|0,k=k+Math.imul(fe,Et)|0,H=H+Math.imul(fe,ct)|0,T=T+Math.imul(Z,Dr)|0,k=k+Math.imul(Z,Ut)|0,k=k+Math.imul(ee,Dr)|0,H=H+Math.imul(ee,Ut)|0,T=T+Math.imul(j,tr)|0,k=k+Math.imul(j,Rr)|0,k=k+Math.imul(X,tr)|0,H=H+Math.imul(X,Rr)|0;var ps=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(ps>>>26)|0,ps&=67108863,T=Math.imul(bt,ur),k=Math.imul(bt,wt),k=k+Math.imul(tt,ur)|0,H=Math.imul(tt,wt),T=T+Math.imul(pt,ir)|0,k=k+Math.imul(pt,Pt)|0,k=k+Math.imul(Ke,ir)|0,H=H+Math.imul(Ke,Pt)|0,T=T+Math.imul(rt,Dt)|0,k=k+Math.imul(rt,dt)|0,k=k+Math.imul(We,Dt)|0,H=H+Math.imul(We,dt)|0,T=T+Math.imul(et,kt)|0,k=k+Math.imul(et,ut)|0,k=k+Math.imul(Je,kt)|0,H=H+Math.imul(Je,ut)|0,T=T+Math.imul(Qe,zt)|0,k=k+Math.imul(Qe,ht)|0,k=k+Math.imul(ke,zt)|0,H=H+Math.imul(ke,ht)|0,T=T+Math.imul(De,Nt)|0,k=k+Math.imul(De,He)|0,k=k+Math.imul(ze,Nt)|0,H=H+Math.imul(ze,He)|0,T=T+Math.imul(_e,Et)|0,k=k+Math.imul(_e,ct)|0,k=k+Math.imul(Re,Et)|0,H=H+Math.imul(Re,ct)|0,T=T+Math.imul(te,Dr)|0,k=k+Math.imul(te,Ut)|0,k=k+Math.imul(fe,Dr)|0,H=H+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,tr)|0,k=k+Math.imul(Z,Rr)|0,k=k+Math.imul(ee,tr)|0,H=H+Math.imul(ee,Rr)|0;var vs=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(vs>>>26)|0,vs&=67108863,T=Math.imul(bt,ir),k=Math.imul(bt,Pt),k=k+Math.imul(tt,ir)|0,H=Math.imul(tt,Pt),T=T+Math.imul(pt,Dt)|0,k=k+Math.imul(pt,dt)|0,k=k+Math.imul(Ke,Dt)|0,H=H+Math.imul(Ke,dt)|0,T=T+Math.imul(rt,kt)|0,k=k+Math.imul(rt,ut)|0,k=k+Math.imul(We,kt)|0,H=H+Math.imul(We,ut)|0,T=T+Math.imul(et,zt)|0,k=k+Math.imul(et,ht)|0,k=k+Math.imul(Je,zt)|0,H=H+Math.imul(Je,ht)|0,T=T+Math.imul(Qe,Nt)|0,k=k+Math.imul(Qe,He)|0,k=k+Math.imul(ke,Nt)|0,H=H+Math.imul(ke,He)|0,T=T+Math.imul(De,Et)|0,k=k+Math.imul(De,ct)|0,k=k+Math.imul(ze,Et)|0,H=H+Math.imul(ze,ct)|0,T=T+Math.imul(_e,Dr)|0,k=k+Math.imul(_e,Ut)|0,k=k+Math.imul(Re,Dr)|0,H=H+Math.imul(Re,Ut)|0,T=T+Math.imul(te,tr)|0,k=k+Math.imul(te,Rr)|0,k=k+Math.imul(fe,tr)|0,H=H+Math.imul(fe,Rr)|0;var Us=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(Us>>>26)|0,Us&=67108863,T=Math.imul(bt,Dt),k=Math.imul(bt,dt),k=k+Math.imul(tt,Dt)|0,H=Math.imul(tt,dt),T=T+Math.imul(pt,kt)|0,k=k+Math.imul(pt,ut)|0,k=k+Math.imul(Ke,kt)|0,H=H+Math.imul(Ke,ut)|0,T=T+Math.imul(rt,zt)|0,k=k+Math.imul(rt,ht)|0,k=k+Math.imul(We,zt)|0,H=H+Math.imul(We,ht)|0,T=T+Math.imul(et,Nt)|0,k=k+Math.imul(et,He)|0,k=k+Math.imul(Je,Nt)|0,H=H+Math.imul(Je,He)|0,T=T+Math.imul(Qe,Et)|0,k=k+Math.imul(Qe,ct)|0,k=k+Math.imul(ke,Et)|0,H=H+Math.imul(ke,ct)|0,T=T+Math.imul(De,Dr)|0,k=k+Math.imul(De,Ut)|0,k=k+Math.imul(ze,Dr)|0,H=H+Math.imul(ze,Ut)|0,T=T+Math.imul(_e,tr)|0,k=k+Math.imul(_e,Rr)|0,k=k+Math.imul(Re,tr)|0,H=H+Math.imul(Re,Rr)|0;var lo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(lo>>>26)|0,lo&=67108863,T=Math.imul(bt,kt),k=Math.imul(bt,ut),k=k+Math.imul(tt,kt)|0,H=Math.imul(tt,ut),T=T+Math.imul(pt,zt)|0,k=k+Math.imul(pt,ht)|0,k=k+Math.imul(Ke,zt)|0,H=H+Math.imul(Ke,ht)|0,T=T+Math.imul(rt,Nt)|0,k=k+Math.imul(rt,He)|0,k=k+Math.imul(We,Nt)|0,H=H+Math.imul(We,He)|0,T=T+Math.imul(et,Et)|0,k=k+Math.imul(et,ct)|0,k=k+Math.imul(Je,Et)|0,H=H+Math.imul(Je,ct)|0,T=T+Math.imul(Qe,Dr)|0,k=k+Math.imul(Qe,Ut)|0,k=k+Math.imul(ke,Dr)|0,H=H+Math.imul(ke,Ut)|0,T=T+Math.imul(De,tr)|0,k=k+Math.imul(De,Rr)|0,k=k+Math.imul(ze,tr)|0,H=H+Math.imul(ze,Rr)|0;var In=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(In>>>26)|0,In&=67108863,T=Math.imul(bt,zt),k=Math.imul(bt,ht),k=k+Math.imul(tt,zt)|0,H=Math.imul(tt,ht),T=T+Math.imul(pt,Nt)|0,k=k+Math.imul(pt,He)|0,k=k+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,He)|0,T=T+Math.imul(rt,Et)|0,k=k+Math.imul(rt,ct)|0,k=k+Math.imul(We,Et)|0,H=H+Math.imul(We,ct)|0,T=T+Math.imul(et,Dr)|0,k=k+Math.imul(et,Ut)|0,k=k+Math.imul(Je,Dr)|0,H=H+Math.imul(Je,Ut)|0,T=T+Math.imul(Qe,tr)|0,k=k+Math.imul(Qe,Rr)|0,k=k+Math.imul(ke,tr)|0,H=H+Math.imul(ke,Rr)|0;var zi=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(zi>>>26)|0,zi&=67108863,T=Math.imul(bt,Nt),k=Math.imul(bt,He),k=k+Math.imul(tt,Nt)|0,H=Math.imul(tt,He),T=T+Math.imul(pt,Et)|0,k=k+Math.imul(pt,ct)|0,k=k+Math.imul(Ke,Et)|0,H=H+Math.imul(Ke,ct)|0,T=T+Math.imul(rt,Dr)|0,k=k+Math.imul(rt,Ut)|0,k=k+Math.imul(We,Dr)|0,H=H+Math.imul(We,Ut)|0,T=T+Math.imul(et,tr)|0,k=k+Math.imul(et,Rr)|0,k=k+Math.imul(Je,tr)|0,H=H+Math.imul(Je,Rr)|0;var fo=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(fo>>>26)|0,fo&=67108863,T=Math.imul(bt,Et),k=Math.imul(bt,ct),k=k+Math.imul(tt,Et)|0,H=Math.imul(tt,ct),T=T+Math.imul(pt,Dr)|0,k=k+Math.imul(pt,Ut)|0,k=k+Math.imul(Ke,Dr)|0,H=H+Math.imul(Ke,Ut)|0,T=T+Math.imul(rt,tr)|0,k=k+Math.imul(rt,Rr)|0,k=k+Math.imul(We,tr)|0,H=H+Math.imul(We,Rr)|0;var $s=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(bt,Dr),k=Math.imul(bt,Ut),k=k+Math.imul(tt,Dr)|0,H=Math.imul(tt,Ut),T=T+Math.imul(pt,tr)|0,k=k+Math.imul(pt,Rr)|0,k=k+Math.imul(Ke,tr)|0,H=H+Math.imul(Ke,Rr)|0;var tf=(w+T|0)+((k&8191)<<13)|0;w=(H+(k>>>13)|0)+(tf>>>26)|0,tf&=67108863,T=Math.imul(bt,tr),k=Math.imul(bt,Rr),k=k+Math.imul(tt,tr)|0,H=Math.imul(tt,Rr);var Jc=(w+T|0)+((k&8191)<<13)|0;return w=(H+(k>>>13)|0)+(Jc>>>26)|0,Jc&=67108863,x[0]=vi,x[1]=gi,x[2]=yi,x[3]=Si,x[4]=_n,x[5]=us,x[6]=ds,x[7]=hs,x[8]=Vi,x[9]=ps,x[10]=vs,x[11]=Us,x[12]=lo,x[13]=In,x[14]=zi,x[15]=fo,x[16]=$s,x[17]=tf,x[18]=Jc,w!==0&&(x[19]=w,R.length++),R};Math.imul||(S=C);function O(M,v,m){m.negative=v.negative^M.negative,m.length=M.length+v.length;for(var R=0,B=0,E=0;E>>26)|0,B+=x>>>26,x&=67108863}m.words[E]=w,R=x,x=B}return R!==0?m.words[E]=R:m.length--,m._strip()}function L(M,v,m){return O(M,v,m)}s.prototype.mulTo=function(v,m){var R,B=this.length+v.length;return this.length===10&&v.length===10?R=S(this,v,m):B<63?R=C(this,v,m):B<1024?R=O(this,v,m):R=L(this,v,m),R},s.prototype.mul=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),this.mulTo(v,m)},s.prototype.mulf=function(v){var m=new s(null);return m.words=new Array(this.length+v.length),L(this,v,m)},s.prototype.imul=function(v){return this.clone().mulTo(v,this)},s.prototype.imuln=function(v){var m=v<0;m&&(v=-v),n(typeof v=="number"),n(v<67108864);for(var R=0,B=0;B>=26,R+=E/67108864|0,R+=x>>>26,this.words[B]=x&67108863}return R!==0&&(this.words[B]=R,this.length++),m?this.ineg():this},s.prototype.muln=function(v){return this.clone().imuln(v)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(v){var m=I(v);if(m.length===0)return new s(1);for(var R=this,B=0;B=0);var m=v%26,R=(v-m)/26,B=67108863>>>26-m<<26-m,E;if(m!==0){var x=0;for(E=0;E>>26-m}x&&(this.words[E]=x,this.length++)}if(R!==0){for(E=this.length-1;E>=0;E--)this.words[E+R]=this.words[E];for(E=0;E=0);var B;m?B=(m-m%26)/26:B=0;var E=v%26,x=Math.min((v-E)/26,this.length),w=67108863^67108863>>>E<x)for(this.length-=x,k=0;k=0&&(H!==0||k>=B);k--){var oe=this.words[k]|0;this.words[k]=H<<26-E|oe>>>E,H=oe&w}return T&&H!==0&&(T.words[T.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(v,m,R){return n(this.negative===0),this.iushrn(v,m,R)},s.prototype.shln=function(v){return this.clone().ishln(v)},s.prototype.ushln=function(v){return this.clone().iushln(v)},s.prototype.shrn=function(v){return this.clone().ishrn(v)},s.prototype.ushrn=function(v){return this.clone().iushrn(v)},s.prototype.testn=function(v){n(typeof v=="number"&&v>=0);var m=v%26,R=(v-m)/26,B=1<=0);var m=v%26,R=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(m!==0&&R++,this.length=Math.min(R,this.length),m!==0){var B=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(v){if(n(typeof v=="number"),n(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(T/67108864|0),this.words[E+R]=x&67108863}for(;E>26,this.words[E+R]=x&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,E=0;E>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var R=this.length-v.length,B=this.clone(),E=v,x=E.words[E.length-1]|0,w=this._countBits(x);R=26-w,R!==0&&(E=E.ushln(R),B.iushln(R),x=E.words[E.length-1]|0);var T=B.length-E.length,k;if(m!=="mod"){k=new s(null),k.length=T+1,k.words=new Array(k.length);for(var H=0;H=0;j--){var X=(B.words[E.length+j]|0)*67108864+(B.words[E.length+j-1]|0);for(X=Math.min(X/x|0,67108863),B._ishlnsubmul(E,X,j);B.negative!==0;)X--,B.negative=0,B._ishlnsubmul(E,1,j),B.isZero()||(B.negative^=1);k&&(k.words[j]=X)}return k&&k._strip(),B._strip(),m!=="div"&&R!==0&&B.iushrn(R),{div:k||null,mod:B}},s.prototype.divmod=function(v,m,R){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var B,E,x;return this.negative!==0&&v.negative===0?(x=this.neg().divmod(v,m),m!=="mod"&&(B=x.div.neg()),m!=="div"&&(E=x.mod.neg(),R&&E.negative!==0&&E.iadd(v)),{div:B,mod:E}):this.negative===0&&v.negative!==0?(x=this.divmod(v.neg(),m),m!=="mod"&&(B=x.div.neg()),{div:B,mod:x.mod}):this.negative&v.negative?(x=this.neg().divmod(v.neg(),m),m!=="div"&&(E=x.mod.neg(),R&&E.negative!==0&&E.isub(v)),{div:x.div,mod:E}):v.length>this.length||this.cmp(v)<0?{div:new s(0),mod:this}:v.length===1?m==="div"?{div:this.divn(v.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new s(this.modrn(v.words[0]))}:this._wordDiv(v,m)},s.prototype.div=function(v){return this.divmod(v,"div",!1).div},s.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},s.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},s.prototype.divRound=function(v){var m=this.divmod(v);if(m.mod.isZero())return m.div;var R=m.div.negative!==0?m.mod.isub(v):m.mod,B=v.ushrn(1),E=v.andln(1),x=R.cmp(B);return x<0||E===1&&x===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var R=(1<<26)%v,B=0,E=this.length-1;E>=0;E--)B=(R*B+(this.words[E]|0))%v;return m?-B:B},s.prototype.modn=function(v){return this.modrn(v)},s.prototype.idivn=function(v){var m=v<0;m&&(v=-v),n(v<=67108863);for(var R=0,B=this.length-1;B>=0;B--){var E=(this.words[B]|0)+R*67108864;this.words[B]=E/v|0,R=E%v}return this._strip(),m?this.ineg():this},s.prototype.divn=function(v){return this.clone().idivn(v)},s.prototype.egcd=function(v){n(v.negative===0),n(!v.isZero());var m=this,R=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=new s(0),w=new s(1),T=0;m.isEven()&&R.isEven();)m.iushrn(1),R.iushrn(1),++T;for(var k=R.clone(),H=m.clone();!m.isZero();){for(var oe=0,j=1;!(m.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(m.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(k),E.isub(H)),B.iushrn(1),E.iushrn(1);for(var X=0,G=1;!(R.words[0]&G)&&X<26;++X,G<<=1);if(X>0)for(R.iushrn(X);X-- >0;)(x.isOdd()||w.isOdd())&&(x.iadd(k),w.isub(H)),x.iushrn(1),w.iushrn(1);m.cmp(R)>=0?(m.isub(R),B.isub(x),E.isub(w)):(R.isub(m),x.isub(B),w.isub(E))}return{a:x,b:w,gcd:R.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,R=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var B=new s(1),E=new s(0),x=R.clone();m.cmpn(1)>0&&R.cmpn(1)>0;){for(var w=0,T=1;!(m.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(m.iushrn(w);w-- >0;)B.isOdd()&&B.iadd(x),B.iushrn(1);for(var k=0,H=1;!(R.words[0]&H)&&k<26;++k,H<<=1);if(k>0)for(R.iushrn(k);k-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);m.cmp(R)>=0?(m.isub(R),B.isub(E)):(R.isub(m),E.isub(B))}var oe;return m.cmpn(1)===0?oe=B:oe=E,oe.cmpn(0)<0&&oe.iadd(v),oe},s.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var m=this.clone(),R=v.clone();m.negative=0,R.negative=0;for(var B=0;m.isEven()&&R.isEven();B++)m.iushrn(1),R.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;R.isEven();)R.iushrn(1);var E=m.cmp(R);if(E<0){var x=m;m=R,R=x}else if(E===0||R.cmpn(1)===0)break;m.isub(R)}while(!0);return R.iushln(B)},s.prototype.invm=function(v){return this.egcd(v).a.umod(v)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(v){return this.words[0]&v},s.prototype.bincn=function(v){n(typeof v=="number");var m=v%26,R=(v-m)/26,B=1<>>26,w&=67108863,this.words[x]=w}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(v){var m=v<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var R;if(this.length>1)R=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var B=this.words[0]|0;R=B===v?0:Bv.length)return 1;if(this.length=0;R--){var B=this.words[R]|0,E=v.words[R]|0;if(B!==E){BE&&(m=1);break}}return m},s.prototype.gtn=function(v){return this.cmpn(v)===1},s.prototype.gt=function(v){return this.cmp(v)===1},s.prototype.gten=function(v){return this.cmpn(v)>=0},s.prototype.gte=function(v){return this.cmp(v)>=0},s.prototype.ltn=function(v){return this.cmpn(v)===-1},s.prototype.lt=function(v){return this.cmp(v)===-1},s.prototype.lten=function(v){return this.cmpn(v)<=0},s.prototype.lte=function(v){return this.cmp(v)<=0},s.prototype.eqn=function(v){return this.cmpn(v)===0},s.prototype.eq=function(v){return this.cmp(v)===0},s.red=function(v){return new K(v)},s.prototype.toRed=function(v){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(v){return this.red=v,this},s.prototype.forceRed=function(v){return n(!this.red,"Already a number in reduction context"),this._forceRed(v)},s.prototype.redAdd=function(v){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},s.prototype.redIAdd=function(v){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},s.prototype.redSub=function(v){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},s.prototype.redISub=function(v){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},s.prototype.redShl=function(v){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},s.prototype.redMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},s.prototype.redIMul=function(v){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(v){return n(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var F={k256:null,p224:null,p192:null,p25519:null};function z(M,v){this.name=M,this.p=new s(v,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var v=new s(null);return v.words=new Array(Math.ceil(this.n/13)),v},z.prototype.ireduce=function(v){var m=v,R;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),R=m.bitLength();while(R>this.n);var B=R0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},z.prototype.split=function(v,m){v.iushrn(this.n,0,m)},z.prototype.imulK=function(v){return v.imul(this.k)};function _(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(_,z),_.prototype.split=function(v,m){for(var R=4194303,B=Math.min(v.length,9),E=0;E>>22,x=w}x>>>=22,v.words[E-10]=x,x===0&&v.length>10?v.length-=10:v.length-=9},_.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var m=0,R=0;R>>=26,v.words[R]=E,m=B}return m!==0&&(v.words[v.length++]=m),v},s._prime=function(v){if(F[v])return F[v];var m;if(v==="k256")m=new _;else if(v==="p224")m=new $;else if(v==="p192")m=new ie;else if(v==="p25519")m=new ce;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(M){if(typeof M=="string"){var v=s._prime(M);this.m=v.p,this.prime=v}else n(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}K.prototype._verify1=function(v){n(v.negative===0,"red works only with positives"),n(v.red,"red works only with red numbers")},K.prototype._verify2=function(v,m){n((v.negative|m.negative)===0,"red works only with positives"),n(v.red&&v.red===m.red,"red works only with red numbers")},K.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):(f(v,v.umod(this.m)._forceRed(this)),v)},K.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},K.prototype.add=function(v,m){this._verify2(v,m);var R=v.add(m);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var R=v.iadd(m);return R.cmp(this.m)>=0&&R.isub(this.m),R},K.prototype.sub=function(v,m){this._verify2(v,m);var R=v.sub(m);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var R=v.isub(m);return R.cmpn(0)<0&&R.iadd(this.m),R},K.prototype.shl=function(v,m){return this._verify1(v),this.imod(v.ushln(m))},K.prototype.imul=function(v,m){return this._verify2(v,m),this.imod(v.imul(m))},K.prototype.mul=function(v,m){return this._verify2(v,m),this.imod(v.mul(m))},K.prototype.isqr=function(v){return this.imul(v,v.clone())},K.prototype.sqr=function(v){return this.mul(v,v)},K.prototype.sqrt=function(v){if(v.isZero())return v.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var R=this.m.add(new s(1)).iushrn(2);return this.pow(v,R)}for(var B=this.m.subn(1),E=0;!B.isZero()&&B.andln(1)===0;)E++,B.iushrn(1);n(!B.isZero());var x=new s(1).toRed(this),w=x.redNeg(),T=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new s(2*k*k).toRed(this);this.pow(k,T).cmp(w)!==0;)k.redIAdd(w);for(var H=this.pow(k,B),oe=this.pow(v,B.addn(1).iushrn(1)),j=this.pow(v,B),X=E;j.cmp(x)!==0;){for(var G=j,Z=0;G.cmp(x)!==0;Z++)G=G.redSqr();n(Z=0;E--){for(var H=m.words[E],oe=k-1;oe>=0;oe--){var j=H>>oe&1;if(x!==B[0]&&(x=this.sqr(x)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==R&&(E!==0||oe!==0))&&(x=this.mul(x,B[w]),T=0,w=0)}k=26}return x},K.prototype.convertTo=function(v){var m=v.umod(this.m);return m===v?m.clone():m},K.prototype.convertFrom=function(v){var m=v.clone();return m.red=null,m},s.mont=function(v){return new P(v)};function P(M){K.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(P,K),P.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},P.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},P.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var R=v.imul(m),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=R.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},P.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var R=v.mul(m),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=R.isub(B).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},P.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,Ei)})(bM);var t7e=bM.exports;const ar=Su(t7e);var r7e=ar.BN;function n7e(t){return new r7e(t,36).toString(16)}const i7e="strings/5.7.0",s7e=new Cn(i7e);var G5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(G5||(G5={}));var Cj;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Cj||(Cj={}));function R9(t,e=G5.current){e!=G5.current&&(s7e.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return di(r)}const o7e=`Ethereum Signed Message: +`;function PX(t){return typeof t=="string"&&(t=R9(t)),mM(QSe([R9(o7e),R9(String(t.length)),t]))}const a7e="address/5.7.0",ob=new Cn(a7e);function Aj(t){Ll(t,20)||ob.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=di(mM(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const c7e=9007199254740991;function l7e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const wM={};for(let t=0;t<10;t++)wM[String(t)]=String(t);for(let t=0;t<26;t++)wM[String.fromCharCode(65+t)]=String(10+t);const Sj=Math.floor(l7e(c7e));function f7e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>wM[n]).join("");for(;e.length>=Sj;){let n=e.substring(0,Sj);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function u7e(t){let e=null;if(typeof t!="string"&&ob.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Aj(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ob.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==f7e(t)&&ob.throwArgumentError("bad icap checksum","address",t),e=n7e(t.substring(4));e.length<40;)e="0"+e;e=Aj("0x"+e)}else ob.throwArgumentError("invalid address","address",t);return e}function Mm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}var kx={},Mr={},Yp=kX;function kX(t,e){if(!t)throw new Error(e||"Assertion failed")}kX.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Z_={exports:{}};typeof Object.create=="function"?Z_.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Z_.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var nE=Z_.exports,d7e=Yp,h7e=nE;Mr.inherits=h7e;function p7e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function v7e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):p7e(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Mr.htonl=MX;function y7e(t,e){for(var r="",n=0;n>>0}return s}Mr.join32=m7e;function b7e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Mr.split32=b7e;function w7e(t,e){return t>>>e|t<<32-e}Mr.rotr32=w7e;function x7e(t,e){return t<>>32-e}Mr.rotl32=x7e;function E7e(t,e){return t+e>>>0}Mr.sum32=E7e;function C7e(t,e,r){return t+e+r>>>0}Mr.sum32_3=C7e;function A7e(t,e,r,n){return t+e+r+n>>>0}Mr.sum32_4=A7e;function S7e(t,e,r,n,i){return t+e+r+n+i>>>0}Mr.sum32_5=S7e;function _7e(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Mr.sum64=_7e;function I7e(t,e,r,n){var i=e+n>>>0,s=(i>>0}Mr.sum64_hi=I7e;function T7e(t,e,r,n){var i=e+n;return i>>>0}Mr.sum64_lo=T7e;function P7e(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}Mr.sum64_4_hi=P7e;function k7e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Mr.sum64_4_lo=k7e;function M7e(t,e,r,n,i,s,o,a,c,l){var f=0,u=e;u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0,f+=u>>0}Mr.sum64_5_hi=M7e;function R7e(t,e,r,n,i,s,o,a,c,l){var f=e+n+s+a+l;return f>>>0}Mr.sum64_5_lo=R7e;function O7e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Mr.rotr64_hi=O7e;function D7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Mr.rotr64_lo=D7e;function N7e(t,e,r){return t>>>r}Mr.shr64_hi=N7e;function B7e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Mr.shr64_lo=B7e;var Oy={},_j=Mr,L7e=Yp;function iE(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Oy.BlockHash=iE;iE.prototype.update=function(e,r){if(e=_j.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=_j.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Zl.g0_256=q7e;function V7e(t){return Fl(t,17)^Fl(t,19)^t>>>10}Zl.g1_256=V7e;var oy=Mr,z7e=Oy,H7e=Zl,O9=oy.rotl32,Rm=oy.sum32,G7e=oy.sum32_5,W7e=H7e.ft_1,LX=z7e.BlockHash,K7e=[1518500249,1859775393,2400959708,3395469782];function Wl(){if(!(this instanceof Wl))return new Wl;LX.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}oy.inherits(Wl,LX);var Y7e=Wl;Wl.blockSize=512;Wl.outSize=160;Wl.hmacStrength=80;Wl.padLength=64;Wl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),B_e(e.length<=this.blockSize);for(var r=e.length;r>8,p=f&255;u?c.push(u,p):c.push(p)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(p>>1)-1?b=(p>>1)-I:b=I,g.isubn(b)):b=0,u[y]=b,g.iushrn(1)}return u}r.getNAF=n;function i(c,l){var f=[[],[]];c=c.clone(),l=l.clone();for(var u=0,p=0,g;c.cmpn(-u)>0||l.cmpn(-p)>0;){var y=c.andln(3)+u&3,b=l.andln(3)+p&3;y===3&&(y=-1),b===3&&(b=-1);var I;y&1?(g=c.andln(7)+u&7,(g===3||g===5)&&b===2?I=-y:I=y):I=0,f[0].push(I);var C;b&1?(g=l.andln(7)+p&7,(g===3||g===5)&&y===2?C=-b:C=b):C=0,f[1].push(C),2*u===I+1&&(u=1-u),2*p===C+1&&(p=1-p),c.iushrn(1),l.iushrn(1)}return f}r.getJSF=i;function s(c,l,f){var u="_"+l;c.prototype[l]=function(){return this[u]!==void 0?this[u]:this[u]=f.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ar(c,"hex","le")}r.intFromLE=a}),W5=ga.getNAF,j_e=ga.getJSF,K5=ga.assert;function Mh(t,e){this.type=t,this.p=new ar(e.p,16),this.red=e.prime?ar.red(e.prime):ar.mont(this.p),this.zero=new ar(0).toRed(this.red),this.one=new ar(1).toRed(this.red),this.two=new ar(2).toRed(this.red),this.n=e.n&&new ar(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Qp=Mh;Mh.prototype.point=function(){throw new Error("Not implemented")};Mh.prototype.validate=function(){throw new Error("Not implemented")};Mh.prototype._fixedNafMul=function(e,r){K5(e.precomputed);var n=e._getDoubles(),i=W5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];K5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Mh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=W5(n[y],o[y],this._bitLength),c[b]=W5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=j_e(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var $=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};rc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};nc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};nc.prototype.pointFromX=function(e,r){e=new ar(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};nc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};nc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};$i.prototype.isInfinity=function(){return this.inf};$i.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};$i.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};$i.prototype.getX=function(){return this.x.fromRed()};$i.prototype.getY=function(){return this.y.fromRed()};$i.prototype.mul=function(e){return e=new ar(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};$i.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};$i.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};$i.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};$i.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};$i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function as(t,e,r,n){Qp.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ar(0)):(this.x=new ar(e,16),this.y=new ar(r,16),this.z=new ar(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}EM(as,Qp.BasePoint);nc.prototype.jpoint=function(e,r,n){return new as(this,e,r,n)};as.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};as.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};as.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};as.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};as.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};as.prototype.inspect=function(){return this.isInfinity()?"":""};as.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var A3=By(function(t,e){var r=e;r.base=Qp,r.short=$_e,r.mont=null,r.edwards=null}),S3=By(function(t,e){var r=e,n=ga.assert;function i(a){a.type==="short"?this.curve=new A3.short(a):a.type==="edwards"?this.curve=new A3.edwards(a):this.curve=new A3.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:_f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:_f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:_f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:_f.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:_f.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:_f.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:_f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:_f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function dh(t){if(!(this instanceof dh))return new dh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=jc.toArray(t.entropy,t.entropyEnc||"hex"),r=jc.toArray(t.nonce,t.nonceEnc||"hex"),n=jc.toArray(t.pers,t.persEnc||"hex");xM(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var YX=dh;dh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};dh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=jc.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var q_e=ga.assert;function sE(t,e){if(t instanceof sE)return t;this._importDER(t,e)||(q_e(t.r&&t.s,"Signature without r or s"),this.r=new ar(t.r,16),this.s=new ar(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var oE=sE;function V_e(){this.place=0}function B9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function kj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}sE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=kj(r),n=kj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];L9(i,r.length),i=i.concat(r),i.push(2),L9(i,n.length);var s=i.concat(n),o=[48];return L9(o,s.length),o=o.concat(s),ga.encode(o,e)};var z_e=function(){throw new Error("unsupported")},QX=ga.assert;function ec(t){if(!(this instanceof ec))return new ec(t);typeof t=="string"&&(QX(Object.prototype.hasOwnProperty.call(S3,t),"Unknown curve "+t),t=S3[t]),t instanceof S3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var H_e=ec;ec.prototype.keyPair=function(e){return new CM(this,e)};ec.prototype.keyFromPrivate=function(e,r){return CM.fromPrivate(this,e,r)};ec.prototype.keyFromPublic=function(e,r){return CM.fromPublic(this,e,r)};ec.prototype.genKeyPair=function(e){e||(e={});for(var r=new YX({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||z_e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ar(2));;){var s=new ar(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ec.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ec.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ar(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new YX({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ar(1)),f=0;;f++){var u=i.k?i.k(f):new ar(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new oE({r:y,s:b,recoveryParam:I})}}}}}};ec.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ar(e,16)),n=this.keyFromPublic(n,i),r=new oE(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),l),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};ec.prototype.recoverPubKey=function(t,e,r,n){QX((3&r)===r,"The recovery param is more than two bits"),e=new oE(e,n);var i=this.n,s=new ar(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};ec.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new oE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var G_e=By(function(t,e){var r=e;r.version="6.5.4",r.utils=ga,r.rand=function(){throw new Error("unsupported")},r.curve=A3,r.curves=S3,r.ec=H_e,r.eddsa=null}),W_e=G_e.ec;const K_e="signing-key/5.7.0",rI=new Cn(K_e);let F9=null;function cd(){return F9||(F9=new W_e("secp256k1")),F9}class Y_e{constructor(e){Mm(this,"curve","secp256k1"),Mm(this,"privateKey",ea(e)),ZSe(this.privateKey)!==32&&rI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=cd().keyFromPrivate(di(this.privateKey));Mm(this,"publicKey","0x"+r.getPublic(!1,"hex")),Mm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Mm(this,"_isSigningKey",!0)}_addPoint(e){const r=cd().keyFromPublic(di(this.publicKey)),n=cd().keyFromPublic(di(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=cd().keyFromPrivate(di(this.privateKey)),n=di(e);n.length!==32&&rI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return TX({recoveryParam:i.recoveryParam,r:Vv("0x"+i.r.toString(16),32),s:Vv("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=cd().keyFromPrivate(di(this.privateKey)),n=cd().keyFromPublic(di(JX(e)));return Vv("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Q_e(t,e){const r=TX(e),n={r:di(r.r),s:di(r.s)};return"0x"+cd().recoverPubKey(di(t),n,r.recoveryParam).encode("hex",!1)}function JX(t,e){const r=di(t);return r.length===32?new Y_e(r).publicKey:r.length===33?"0x"+cd().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ea(r):rI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Mj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Mj||(Mj={}));function J_e(t){const e=JX(t);return u7e(Ej(mM(Ej(e,1)),12))}function Z_e(t,e){return J_e(Q_e(di(t),e))}var AM={},aE={},fr={},ZX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,f=a&65535,u=c>>>16&65535,p=c&65535;return f*p+(l*p+f*u<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(ZX);Object.defineProperty(fr,"__esModule",{value:!0});var XX=ZX;function X_e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}fr.readInt16BE=X_e;function eIe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}fr.readUint16BE=eIe;function tIe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}fr.readInt16LE=tIe;function rIe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}fr.readUint16LE=rIe;function eee(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}fr.writeUint16BE=eee;fr.writeInt16BE=eee;function tee(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}fr.writeUint16LE=tee;fr.writeInt16LE=tee;function nI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}fr.readInt32BE=nI;function iI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}fr.readUint32BE=iI;function sI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}fr.readInt32LE=sI;function oI(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}fr.readUint32LE=oI;function Y5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}fr.writeUint32BE=Y5;fr.writeInt32BE=Y5;function Q5(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}fr.writeUint32LE=Q5;fr.writeInt32LE=Q5;function nIe(t,e){e===void 0&&(e=0);var r=nI(t,e),n=nI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}fr.readInt64BE=nIe;function iIe(t,e){e===void 0&&(e=0);var r=iI(t,e),n=iI(t,e+4);return r*4294967296+n}fr.readUint64BE=iIe;function sIe(t,e){e===void 0&&(e=0);var r=sI(t,e),n=sI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}fr.readInt64LE=sIe;function oIe(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return n*4294967296+r}fr.readUint64LE=oIe;function ree(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Y5(t/4294967296>>>0,e,r),Y5(t>>>0,e,r+4),e}fr.writeUint64BE=ree;fr.writeInt64BE=ree;function nee(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Q5(t>>>0,e,r),Q5(t/4294967296>>>0,e,r+4),e}fr.writeUint64LE=nee;fr.writeInt64LE=nee;function aIe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}fr.readUintBE=aIe;function cIe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}fr.writeUintBE=lIe;function fIe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!XX.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|m<<16,K=K+m|0,_^=K,_=_>>>20|_<<12,L=L+$|0,R^=L,R=R>>>16|R<<16,P=P+R|0,$^=P,$=$>>>20|$<<12,F=F+ie|0,B^=F,B=B>>>16|B<<16,M=M+B|0,ie^=M,ie=ie>>>20|ie<<12,z=z+ce|0,E^=z,E=E>>>16|E<<16,v=v+E|0,ce^=v,ce=ce>>>20|ce<<12,F=F+ie|0,B^=F,B=B>>>24|B<<8,M=M+B|0,ie^=M,ie=ie>>>25|ie<<7,z=z+ce|0,E^=z,E=E>>>24|E<<8,v=v+E|0,ce^=v,ce=ce>>>25|ce<<7,L=L+$|0,R^=L,R=R>>>24|R<<8,P=P+R|0,$^=P,$=$>>>25|$<<7,O=O+_|0,m^=O,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,O=O+$|0,E^=O,E=E>>>16|E<<16,M=M+E|0,$^=M,$=$>>>20|$<<12,L=L+ie|0,m^=L,m=m>>>16|m<<16,v=v+m|0,ie^=v,ie=ie>>>20|ie<<12,F=F+ce|0,R^=F,R=R>>>16|R<<16,K=K+R|0,ce^=K,ce=ce>>>20|ce<<12,z=z+_|0,B^=z,B=B>>>16|B<<16,P=P+B|0,_^=P,_=_>>>20|_<<12,F=F+ce|0,R^=F,R=R>>>24|R<<8,K=K+R|0,ce^=K,ce=ce>>>25|ce<<7,z=z+_|0,B^=z,B=B>>>24|B<<8,P=P+B|0,_^=P,_=_>>>25|_<<7,L=L+ie|0,m^=L,m=m>>>24|m<<8,v=v+m|0,ie^=v,ie=ie>>>25|ie<<7,O=O+$|0,E^=O,E=E>>>24|E<<8,M=M+E|0,$^=M,$=$>>>25|$<<7;ws.writeUint32LE(O+n|0,t,0),ws.writeUint32LE(L+i|0,t,4),ws.writeUint32LE(F+s|0,t,8),ws.writeUint32LE(z+o|0,t,12),ws.writeUint32LE(_+a|0,t,16),ws.writeUint32LE($+c|0,t,20),ws.writeUint32LE(ie+l|0,t,24),ws.writeUint32LE(ce+f|0,t,28),ws.writeUint32LE(K+u|0,t,32),ws.writeUint32LE(P+p|0,t,36),ws.writeUint32LE(M+g|0,t,40),ws.writeUint32LE(v+y|0,t,44),ws.writeUint32LE(m+b|0,t,48),ws.writeUint32LE(R+I|0,t,52),ws.writeUint32LE(B+C|0,t,56),ws.writeUint32LE(E+S|0,t,60)}function iee(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var see={},Rh={};Object.defineProperty(Rh,"__esModule",{value:!0});function AIe(t,e,r){return~(t-1)&e|t-1&r}Rh.select=AIe;function SIe(t,e){return(t|0)-(e|0)-1>>>31&1}Rh.lessOrEqual=SIe;function oee(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Rh.compare=oee;function _Ie(t,e){return t.length===0||e.length===0?!1:oee(t,e)!==0}Rh.equal=_Ie;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Rh,r=ya;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var f=a[4]|a[5]<<8;this._r[2]=(l>>>10|f<<6)&7939;var u=a[6]|a[7]<<8;this._r[3]=(f>>>7|u<<9)&8191;var p=a[8]|a[9]<<8;this._r[4]=(u>>>4|p<<12)&255,this._r[5]=p>>>1&8190;var g=a[10]|a[11]<<8;this._r[6]=(p>>>14|g<<2)&8191;var y=a[12]|a[13]<<8;this._r[7]=(g>>>11|y<<5)&8065;var b=a[14]|a[15]<<8;this._r[8]=(y>>>8|b<<8)&8191,this._r[9]=b>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var f=this._fin?0:2048,u=this._h[0],p=this._h[1],g=this._h[2],y=this._h[3],b=this._h[4],I=this._h[5],C=this._h[6],S=this._h[7],O=this._h[8],L=this._h[9],F=this._r[0],z=this._r[1],_=this._r[2],$=this._r[3],ie=this._r[4],ce=this._r[5],K=this._r[6],P=this._r[7],M=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var R=a[c+2]|a[c+3]<<8;p+=(m>>>13|R<<3)&8191;var B=a[c+4]|a[c+5]<<8;g+=(R>>>10|B<<6)&8191;var E=a[c+6]|a[c+7]<<8;y+=(B>>>7|E<<9)&8191;var x=a[c+8]|a[c+9]<<8;b+=(E>>>4|x<<12)&8191,I+=x>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(x>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var k=a[c+14]|a[c+15]<<8;O+=(T>>>8|k<<8)&8191,L+=k>>>5|f;var H=0,oe=H;oe+=u*F,oe+=p*(5*v),oe+=g*(5*M),oe+=y*(5*P),oe+=b*(5*K),H=oe>>>13,oe&=8191,oe+=I*(5*ce),oe+=C*(5*ie),oe+=S*(5*$),oe+=O*(5*_),oe+=L*(5*z),H+=oe>>>13,oe&=8191;var j=H;j+=u*z,j+=p*F,j+=g*(5*v),j+=y*(5*M),j+=b*(5*P),H=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*ce),j+=S*(5*ie),j+=O*(5*$),j+=L*(5*_),H+=j>>>13,j&=8191;var X=H;X+=u*_,X+=p*z,X+=g*F,X+=y*(5*v),X+=b*(5*M),H=X>>>13,X&=8191,X+=I*(5*P),X+=C*(5*K),X+=S*(5*ce),X+=O*(5*ie),X+=L*(5*$),H+=X>>>13,X&=8191;var G=H;G+=u*$,G+=p*_,G+=g*z,G+=y*F,G+=b*(5*v),H=G>>>13,G&=8191,G+=I*(5*M),G+=C*(5*P),G+=S*(5*K),G+=O*(5*ce),G+=L*(5*ie),H+=G>>>13,G&=8191;var Z=H;Z+=u*ie,Z+=p*$,Z+=g*_,Z+=y*z,Z+=b*F,H=Z>>>13,Z&=8191,Z+=I*(5*v),Z+=C*(5*M),Z+=S*(5*P),Z+=O*(5*K),Z+=L*(5*ce),H+=Z>>>13,Z&=8191;var ee=H;ee+=u*ce,ee+=p*ie,ee+=g*$,ee+=y*_,ee+=b*z,H=ee>>>13,ee&=8191,ee+=I*F,ee+=C*(5*v),ee+=S*(5*M),ee+=O*(5*P),ee+=L*(5*K),H+=ee>>>13,ee&=8191;var N=H;N+=u*K,N+=p*ce,N+=g*ie,N+=y*$,N+=b*_,H=N>>>13,N&=8191,N+=I*z,N+=C*F,N+=S*(5*v),N+=O*(5*M),N+=L*(5*P),H+=N>>>13,N&=8191;var te=H;te+=u*P,te+=p*K,te+=g*ce,te+=y*ie,te+=b*$,H=te>>>13,te&=8191,te+=I*_,te+=C*z,te+=S*F,te+=O*(5*v),te+=L*(5*M),H+=te>>>13,te&=8191;var fe=H;fe+=u*M,fe+=p*P,fe+=g*K,fe+=y*ce,fe+=b*ie,H=fe>>>13,fe&=8191,fe+=I*$,fe+=C*_,fe+=S*z,fe+=O*F,fe+=L*(5*v),H+=fe>>>13,fe&=8191;var Ee=H;Ee+=u*v,Ee+=p*M,Ee+=g*P,Ee+=y*K,Ee+=b*ce,H=Ee>>>13,Ee&=8191,Ee+=I*ie,Ee+=C*$,Ee+=S*_,Ee+=O*z,Ee+=L*F,H+=Ee>>>13,Ee&=8191,H=(H<<2)+H|0,H=H+oe|0,oe=H&8191,H=H>>>13,j+=H,u=oe,p=j,g=X,y=G,b=Z,I=ee,C=N,S=te,O=fe,L=Ee,c+=16,l-=16}this._h[0]=u,this._h[1]=p,this._h[2]=g,this._h[3]=y,this._h[4]=b,this._h[5]=I,this._h[6]=C,this._h[7]=S,this._h[8]=O,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),f,u,p,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=f,f=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,l[0]=this._h[0]+5,f=l[0]>>>13,l[0]&=8191,g=1;g<10;g++)l[g]=this._h[g]+f,f=l[g]>>>13,l[g]&=8191;for(l[9]-=8192,u=(f^1)-1,g=0;g<10;g++)l[g]&=u;for(u=~u,g=0;g<10;g++)this._h[g]=this._h[g]&u|l[g];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,p=this._h[0]+this._pad[0],this._h[0]=p&65535,g=1;g<8;g++)p=(this._h[g]+this._pad[g]|0)+(p>>>16)|0,this._h[g]=p&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,f;if(this._leftover){f=16-this._leftover,f>l&&(f=l);for(var u=0;u=16&&(f=l-l%16,this._blocks(a,c,f),c+=f,l-=f),l){for(var u=0;u16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(l,g.length-l.length);var y=new Uint8Array(32);e.stream(this._key,g,y,4);var b=f.length+this.tagLength,I;if(p){if(p.length!==b)throw new Error("ChaCha20Poly1305: incorrect destination length");I=p}else I=new Uint8Array(b);return e.streamXOR(this._key,g,f,I,4),this._authenticate(I.subarray(I.length-this.tagLength,I.length),y,I.subarray(0,I.length-this.tagLength),u),n.wipe(g),I},c.prototype.open=function(l,f,u,p){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length0&&g.update(o.subarray(p.length%16))),g.update(u),u.length%16>0&&g.update(o.subarray(u.length%16));var y=new Uint8Array(8);p&&i.writeUint64LE(p.length,y),g.update(y),i.writeUint64LE(u.length,y),g.update(y);for(var b=g.digest(),I=0;Ithis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let p="";const g=f.length,y=256-256%g;for(;l>0;){const b=i(Math.ceil(l*256/y),u);for(let I=0;I0;I++){const C=b[I];C0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._temp,this._state,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%64<56?64:128;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(a,c,l,f,u){for(;u>=64;){for(var p=c[0],g=c[1],y=c[2],b=c[3],I=c[4],C=c[5],S=c[6],O=c[7],L=0;L<16;L++){var F=f+L*4;a[L]=e.readUint32BE(l,F)}for(var L=16;L<64;L++){var z=a[L-2],_=(z>>>17|z<<15)^(z>>>19|z<<13)^z>>>10;z=a[L-15];var $=(z>>>7|z<<25)^(z>>>18|z<<14)^z>>>3;a[L]=(_+a[L-7]|0)+($+a[L-16]|0)}for(var L=0;L<64;L++){var _=(((I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7))+(I&C^~I&S)|0)+(O+(i[L]+a[L]|0)|0)|0,$=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&g^p&y^g&y)|0;O=S,S=C,C=I,I=b+_|0,b=y,y=g,g=p,p=_+$|0}c[0]+=p,c[1]+=g,c[2]+=y,c[3]+=b,c[4]+=I,c[5]+=C,c[6]+=S,c[7]+=O,f+=64,u-=64}return f}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Rx);var _M={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Oh,r=ya;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const F=new Float64Array(16);if(L)for(let z=0;z>16&1),z[ce-1]&=65535;z[15]=_[15]-32767-(z[14]>>16&1);const ie=z[15]>>16&1;z[14]&=65535,a(_,z,1-ie)}for(let $=0;$<16;$++)L[2*$]=_[$]&255,L[2*$+1]=_[$]>>8}function l(L,F){for(let z=0;z<16;z++)L[z]=F[2*z]+(F[2*z+1]<<8);L[15]&=32767}function f(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]+z[_]}function u(L,F,z){for(let _=0;_<16;_++)L[_]=F[_]-z[_]}function p(L,F,z){let _,$,ie=0,ce=0,K=0,P=0,M=0,v=0,m=0,R=0,B=0,E=0,x=0,w=0,T=0,k=0,H=0,oe=0,j=0,X=0,G=0,Z=0,ee=0,N=0,te=0,fe=0,Ee=0,_e=0,Re=0,Te=0,De=0,ze=0,Xe=0,Qe=z[0],ke=z[1],Ne=z[2],et=z[3],Je=z[4],it=z[5],rt=z[6],We=z[7],lt=z[8],pt=z[9],Ke=z[10],vt=z[11],bt=z[12],tt=z[13],_t=z[14],Ct=z[15];_=F[0],ie+=_*Qe,ce+=_*ke,K+=_*Ne,P+=_*et,M+=_*Je,v+=_*it,m+=_*rt,R+=_*We,B+=_*lt,E+=_*pt,x+=_*Ke,w+=_*vt,T+=_*bt,k+=_*tt,H+=_*_t,oe+=_*Ct,_=F[1],ce+=_*Qe,K+=_*ke,P+=_*Ne,M+=_*et,v+=_*Je,m+=_*it,R+=_*rt,B+=_*We,E+=_*lt,x+=_*pt,w+=_*Ke,T+=_*vt,k+=_*bt,H+=_*tt,oe+=_*_t,j+=_*Ct,_=F[2],K+=_*Qe,P+=_*ke,M+=_*Ne,v+=_*et,m+=_*Je,R+=_*it,B+=_*rt,E+=_*We,x+=_*lt,w+=_*pt,T+=_*Ke,k+=_*vt,H+=_*bt,oe+=_*tt,j+=_*_t,X+=_*Ct,_=F[3],P+=_*Qe,M+=_*ke,v+=_*Ne,m+=_*et,R+=_*Je,B+=_*it,E+=_*rt,x+=_*We,w+=_*lt,T+=_*pt,k+=_*Ke,H+=_*vt,oe+=_*bt,j+=_*tt,X+=_*_t,G+=_*Ct,_=F[4],M+=_*Qe,v+=_*ke,m+=_*Ne,R+=_*et,B+=_*Je,E+=_*it,x+=_*rt,w+=_*We,T+=_*lt,k+=_*pt,H+=_*Ke,oe+=_*vt,j+=_*bt,X+=_*tt,G+=_*_t,Z+=_*Ct,_=F[5],v+=_*Qe,m+=_*ke,R+=_*Ne,B+=_*et,E+=_*Je,x+=_*it,w+=_*rt,T+=_*We,k+=_*lt,H+=_*pt,oe+=_*Ke,j+=_*vt,X+=_*bt,G+=_*tt,Z+=_*_t,ee+=_*Ct,_=F[6],m+=_*Qe,R+=_*ke,B+=_*Ne,E+=_*et,x+=_*Je,w+=_*it,T+=_*rt,k+=_*We,H+=_*lt,oe+=_*pt,j+=_*Ke,X+=_*vt,G+=_*bt,Z+=_*tt,ee+=_*_t,N+=_*Ct,_=F[7],R+=_*Qe,B+=_*ke,E+=_*Ne,x+=_*et,w+=_*Je,T+=_*it,k+=_*rt,H+=_*We,oe+=_*lt,j+=_*pt,X+=_*Ke,G+=_*vt,Z+=_*bt,ee+=_*tt,N+=_*_t,te+=_*Ct,_=F[8],B+=_*Qe,E+=_*ke,x+=_*Ne,w+=_*et,T+=_*Je,k+=_*it,H+=_*rt,oe+=_*We,j+=_*lt,X+=_*pt,G+=_*Ke,Z+=_*vt,ee+=_*bt,N+=_*tt,te+=_*_t,fe+=_*Ct,_=F[9],E+=_*Qe,x+=_*ke,w+=_*Ne,T+=_*et,k+=_*Je,H+=_*it,oe+=_*rt,j+=_*We,X+=_*lt,G+=_*pt,Z+=_*Ke,ee+=_*vt,N+=_*bt,te+=_*tt,fe+=_*_t,Ee+=_*Ct,_=F[10],x+=_*Qe,w+=_*ke,T+=_*Ne,k+=_*et,H+=_*Je,oe+=_*it,j+=_*rt,X+=_*We,G+=_*lt,Z+=_*pt,ee+=_*Ke,N+=_*vt,te+=_*bt,fe+=_*tt,Ee+=_*_t,_e+=_*Ct,_=F[11],w+=_*Qe,T+=_*ke,k+=_*Ne,H+=_*et,oe+=_*Je,j+=_*it,X+=_*rt,G+=_*We,Z+=_*lt,ee+=_*pt,N+=_*Ke,te+=_*vt,fe+=_*bt,Ee+=_*tt,_e+=_*_t,Re+=_*Ct,_=F[12],T+=_*Qe,k+=_*ke,H+=_*Ne,oe+=_*et,j+=_*Je,X+=_*it,G+=_*rt,Z+=_*We,ee+=_*lt,N+=_*pt,te+=_*Ke,fe+=_*vt,Ee+=_*bt,_e+=_*tt,Re+=_*_t,Te+=_*Ct,_=F[13],k+=_*Qe,H+=_*ke,oe+=_*Ne,j+=_*et,X+=_*Je,G+=_*it,Z+=_*rt,ee+=_*We,N+=_*lt,te+=_*pt,fe+=_*Ke,Ee+=_*vt,_e+=_*bt,Re+=_*tt,Te+=_*_t,De+=_*Ct,_=F[14],H+=_*Qe,oe+=_*ke,j+=_*Ne,X+=_*et,G+=_*Je,Z+=_*it,ee+=_*rt,N+=_*We,te+=_*lt,fe+=_*pt,Ee+=_*Ke,_e+=_*vt,Re+=_*bt,Te+=_*tt,De+=_*_t,ze+=_*Ct,_=F[15],oe+=_*Qe,j+=_*ke,X+=_*Ne,G+=_*et,Z+=_*Je,ee+=_*it,N+=_*rt,te+=_*We,fe+=_*lt,Ee+=_*pt,_e+=_*Ke,Re+=_*vt,Te+=_*bt,De+=_*tt,ze+=_*_t,Xe+=_*Ct,ie+=38*j,ce+=38*X,K+=38*G,P+=38*Z,M+=38*ee,v+=38*N,m+=38*te,R+=38*fe,B+=38*Ee,E+=38*_e,x+=38*Re,w+=38*Te,T+=38*De,k+=38*ze,H+=38*Xe,$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=ce+$+65535,$=Math.floor(_/65536),ce=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=B+$+65535,$=Math.floor(_/65536),B=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=ce+$+65535,$=Math.floor(_/65536),ce=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=B+$+65535,$=Math.floor(_/65536),B=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),L[0]=ie,L[1]=ce,L[2]=K,L[3]=P,L[4]=M,L[5]=v,L[6]=m,L[7]=R,L[8]=B,L[9]=E,L[10]=x,L[11]=w,L[12]=T,L[13]=k,L[14]=H,L[15]=oe}function g(L,F){p(L,F,F)}function y(L,F){const z=n();for(let _=0;_<16;_++)z[_]=F[_];for(let _=253;_>=0;_--)g(z,z),_!==2&&_!==4&&p(z,z,F);for(let _=0;_<16;_++)L[_]=z[_]}function b(L,F){const z=new Uint8Array(32),_=new Float64Array(80),$=n(),ie=n(),ce=n(),K=n(),P=n(),M=n();for(let B=0;B<31;B++)z[B]=L[B];z[31]=L[31]&127|64,z[0]&=248,l(_,F);for(let B=0;B<16;B++)ie[B]=_[B];$[0]=K[0]=1;for(let B=254;B>=0;--B){const E=z[B>>>3]>>>(B&7)&1;a($,ie,E),a(ce,K,E),f(P,$,ce),u($,$,ce),f(ce,ie,K),u(ie,ie,K),g(K,P),g(M,$),p($,ce,$),p(ce,ie,P),f(P,$,ce),u($,$,ce),g(ie,$),u(ce,K,M),p($,ce,s),f($,$,K),p(ce,ce,$),p($,K,M),p(K,ie,_),g(ie,P),a($,ie,E),a(ce,K,E)}for(let B=0;B<16;B++)_[B+16]=$[B],_[B+32]=ce[B],_[B+48]=ie[B],_[B+64]=K[B];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const R=new Uint8Array(32);return c(R,m),R}t.scalarMult=b;function I(L){return b(L,i)}t.scalarMultBase=I;function C(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const F=new Uint8Array(L);return{publicKey:I(F),secretKey:F}}t.generateKeyPairFromSeed=C;function S(L){const F=(0,e.randomBytes)(32,L),z=C(F);return(0,r.wipe)(F),z}t.generateKeyPair=S;function O(L,F,z=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(F.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=b(L,F);if(z){let $=0;for(let ie=0;ie<_.length;ie++)$|=_[ie];if($===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=O})(_M);function lee(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function _3(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=lee(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function UIe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(O);C!==S;){for(var F=y[C],z=0,_=O-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var $=O-I;$!==O&&L[$]===0;)$++;for(var ie=c.repeat(b);$>>0,O=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,O[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&O[_]===0;)_++;for(var $=new Uint8Array(I+(S-_)),ie=I;_!==S;)$[ie++]=O[_++];return $}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var $Ie=UIe,qIe=$Ie;const VIe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},zIe=t=>new TextEncoder().encode(t),HIe=t=>new TextDecoder().decode(t);class GIe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class WIe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),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 fee(this,e)}}class KIe{constructor(e){this.decoders=e}or(e){return fee(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const fee=(t,e)=>new KIe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class YIe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new GIe(e,r,n),this.decoder=new WIe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const uE=({name:t,prefix:e,encode:r,decode:n})=>new YIe(t,e,r,n),Ox=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=qIe(r,e);return uE({prefix:t,name:e,encode:n,decode:s=>VIe(i(s))})},QIe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},JIe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<uE({prefix:e,name:t,encode(i){return JIe(i,n,r)},decode(i){return QIe(i,n,r,t)}}),ZIe=uE({prefix:"\0",name:"identity",encode:t=>HIe(t),decode:t=>zIe(t)}),XIe=Object.freeze(Object.defineProperty({__proto__:null,identity:ZIe},Symbol.toStringTag,{value:"Module"})),eTe=cs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),tTe=Object.freeze(Object.defineProperty({__proto__:null,base2:eTe},Symbol.toStringTag,{value:"Module"})),rTe=cs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),nTe=Object.freeze(Object.defineProperty({__proto__:null,base8:rTe},Symbol.toStringTag,{value:"Module"})),iTe=Ox({prefix:"9",name:"base10",alphabet:"0123456789"}),sTe=Object.freeze(Object.defineProperty({__proto__:null,base10:iTe},Symbol.toStringTag,{value:"Module"})),oTe=cs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),aTe=cs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),cTe=Object.freeze(Object.defineProperty({__proto__:null,base16:oTe,base16upper:aTe},Symbol.toStringTag,{value:"Module"})),lTe=cs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fTe=cs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),uTe=cs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dTe=cs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hTe=cs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),pTe=cs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vTe=cs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),gTe=cs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yTe=cs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),mTe=Object.freeze(Object.defineProperty({__proto__:null,base32:lTe,base32hex:hTe,base32hexpad:vTe,base32hexpadupper:gTe,base32hexupper:pTe,base32pad:uTe,base32padupper:dTe,base32upper:fTe,base32z:yTe},Symbol.toStringTag,{value:"Module"})),bTe=Ox({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wTe=Ox({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),xTe=Object.freeze(Object.defineProperty({__proto__:null,base36:bTe,base36upper:wTe},Symbol.toStringTag,{value:"Module"})),ETe=Ox({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),CTe=Ox({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ATe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:ETe,base58flickr:CTe},Symbol.toStringTag,{value:"Module"})),STe=cs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_Te=cs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ITe=cs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TTe=cs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),PTe=Object.freeze(Object.defineProperty({__proto__:null,base64:STe,base64pad:_Te,base64url:ITe,base64urlpad:TTe},Symbol.toStringTag,{value:"Module"})),uee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),kTe=uee.reduce((t,e,r)=>(t[r]=e,t),[]),MTe=uee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function RTe(t){return t.reduce((e,r)=>(e+=kTe[r],e),"")}function OTe(t){const e=[];for(const r of t){const n=MTe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const DTe=uE({prefix:"🚀",name:"base256emoji",encode:RTe,decode:OTe}),NTe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:DTe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Nj={...XIe,...tTe,...nTe,...sTe,...cTe,...mTe,...xTe,...ATe,...PTe,...NTe};function dee(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Bj=dee("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),j9=dee("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=lee(t.length);for(let r=0;r",HTe="MIT",GTe={url:"https://github.com/indutny/elliptic/issues"},WTe="https://github.com/indutny/elliptic",KTe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},YTe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},QTe={name:BTe,version:LTe,description:FTe,main:jTe,files:UTe,scripts:$Te,repository:qTe,keywords:VTe,author:zTe,license:HTe,bugs:GTe,homepage:WTe,devDependencies:KTe,dependencies:YTe};var ma={},IM={exports:{}};IM.exports;(function(t){(function(e,r){function n(K,P){if(!K)throw new Error(P||"Assertion failed")}function i(K,P){K.super_=P;var M=function(){};M.prototype=P.prototype,K.prototype=new M,K.prototype.constructor=K}function s(K,P,M){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((P==="le"||P==="be")&&(M=P,P=10),this._init(K||0,P||10,M||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=rE.Buffer}catch{}s.isBN=function(P){return P instanceof s?!0:P!==null&&typeof P=="object"&&P.constructor.wordSize===s.wordSize&&Array.isArray(P.words)},s.max=function(P,M){return P.cmp(M)>0?P:M},s.min=function(P,M){return P.cmp(M)<0?P:M},s.prototype._init=function(P,M,v){if(typeof P=="number")return this._initNumber(P,M,v);if(typeof P=="object")return this._initArray(P,M,v);M==="hex"&&(M=16),n(M===(M|0)&&M>=2&&M<=36),P=P.toString().replace(/\s+/g,"");var m=0;P[0]==="-"&&(m++,this.negative=1),m=0;m-=3)B=P[m]|P[m-1]<<8|P[m-2]<<16,this.words[R]|=B<>>26-E&67108863,E+=24,E>=26&&(E-=26,R++);else if(v==="le")for(m=0,R=0;m>>26-E&67108863,E+=24,E>=26&&(E-=26,R++);return this.strip()};function a(K,P){var M=K.charCodeAt(P);return M>=65&&M<=70?M-55:M>=97&&M<=102?M-87:M-48&15}function c(K,P,M){var v=a(K,M);return M-1>=P&&(v|=a(K,M-1)<<4),v}s.prototype._parseHex=function(P,M,v){this.length=Math.ceil((P.length-M)/6),this.words=new Array(this.length);for(var m=0;m=M;m-=2)E=c(P,M,m)<=18?(R-=18,B+=1,this.words[B]|=E>>>26):R+=8;else{var x=P.length-M;for(m=x%2===0?M+1:M;m=18?(R-=18,B+=1,this.words[B]|=E>>>26):R+=8}this.strip()};function l(K,P,M,v){for(var m=0,R=Math.min(K.length,M),B=P;B=49?m+=E-49+10:E>=17?m+=E-17+10:m+=E}return m}s.prototype._parseBase=function(P,M,v){this.words=[0],this.length=1;for(var m=0,R=1;R<=67108863;R*=M)m++;m--,R=R/M|0;for(var B=P.length-v,E=B%m,x=Math.min(B,B-E)+v,w=0,T=v;T1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(P,M){P=P||10,M=M|0||1;var v;if(P===16||P==="hex"){v="";for(var m=0,R=0,B=0;B>>24-m&16777215,R!==0||B!==this.length-1?v=f[6-x.length]+x+v:v=x+v,m+=2,m>=26&&(m-=26,B--)}for(R!==0&&(v=R.toString(16)+v);v.length%M!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(P===(P|0)&&P>=2&&P<=36){var w=u[P],T=p[P];v="";var k=this.clone();for(k.negative=0;!k.isZero();){var H=k.modn(T).toString(P);k=k.idivn(T),k.isZero()?v=H+v:v=f[w-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%M!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var P=this.words[0];return this.length===2?P+=this.words[1]*67108864:this.length===3&&this.words[2]===1?P+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-P:P},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(P,M){return n(typeof o<"u"),this.toArrayLike(o,P,M)},s.prototype.toArray=function(P,M){return this.toArrayLike(Array,P,M)},s.prototype.toArrayLike=function(P,M,v){var m=this.byteLength(),R=v||Math.max(1,m);n(m<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0"),this.strip();var B=M==="le",E=new P(R),x,w,T=this.clone();if(B){for(w=0;!T.isZero();w++)x=T.andln(255),T.iushrn(8),E[w]=x;for(;w=4096&&(v+=13,M>>>=13),M>=64&&(v+=7,M>>>=7),M>=8&&(v+=4,M>>>=4),M>=2&&(v+=2,M>>>=2),v+M},s.prototype._zeroBits=function(P){if(P===0)return 26;var M=P,v=0;return M&8191||(v+=13,M>>>=13),M&127||(v+=7,M>>>=7),M&15||(v+=4,M>>>=4),M&3||(v+=2,M>>>=2),M&1||v++,v},s.prototype.bitLength=function(){var P=this.words[this.length-1],M=this._countBits(P);return(this.length-1)*26+M};function g(K){for(var P=new Array(K.bitLength()),M=0;M>>m}return P}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var P=0,M=0;MP.length?this.clone().ior(P):P.clone().ior(this)},s.prototype.uor=function(P){return this.length>P.length?this.clone().iuor(P):P.clone().iuor(this)},s.prototype.iuand=function(P){var M;this.length>P.length?M=P:M=this;for(var v=0;vP.length?this.clone().iand(P):P.clone().iand(this)},s.prototype.uand=function(P){return this.length>P.length?this.clone().iuand(P):P.clone().iuand(this)},s.prototype.iuxor=function(P){var M,v;this.length>P.length?(M=this,v=P):(M=P,v=this);for(var m=0;mP.length?this.clone().ixor(P):P.clone().ixor(this)},s.prototype.uxor=function(P){return this.length>P.length?this.clone().iuxor(P):P.clone().iuxor(this)},s.prototype.inotn=function(P){n(typeof P=="number"&&P>=0);var M=Math.ceil(P/26)|0,v=P%26;this._expand(M),v>0&&M--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(P){return this.clone().inotn(P)},s.prototype.setn=function(P,M){n(typeof P=="number"&&P>=0);var v=P/26|0,m=P%26;return this._expand(v+1),M?this.words[v]=this.words[v]|1<P.length?(v=this,m=P):(v=P,m=this);for(var R=0,B=0;B>>26;for(;R!==0&&B>>26;if(this.length=v.length,R!==0)this.words[this.length]=R,this.length++;else if(v!==this)for(;BP.length?this.clone().iadd(P):P.clone().iadd(this)},s.prototype.isub=function(P){if(P.negative!==0){P.negative=0;var M=this.iadd(P);return P.negative=1,M._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(P),this.negative=1,this._normSign();var v=this.cmp(P);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,R;v>0?(m=this,R=P):(m=P,R=this);for(var B=0,E=0;E>26,this.words[E]=M&67108863;for(;B!==0&&E>26,this.words[E]=M&67108863;if(B===0&&E>>26,k=x&67108863,H=Math.min(w,P.length-1),oe=Math.max(0,w-K.length+1);oe<=H;oe++){var j=w-oe|0;m=K.words[j]|0,R=P.words[oe]|0,B=m*R+k,T+=B/67108864|0,k=B&67108863}M.words[w]=k|0,x=T|0}return x!==0?M.words[w]=x|0:M.length--,M.strip()}var b=function(P,M,v){var m=P.words,R=M.words,B=v.words,E=0,x,w,T,k=m[0]|0,H=k&8191,oe=k>>>13,j=m[1]|0,X=j&8191,G=j>>>13,Z=m[2]|0,ee=Z&8191,N=Z>>>13,te=m[3]|0,fe=te&8191,Ee=te>>>13,_e=m[4]|0,Re=_e&8191,Te=_e>>>13,De=m[5]|0,ze=De&8191,Xe=De>>>13,Qe=m[6]|0,ke=Qe&8191,Ne=Qe>>>13,et=m[7]|0,Je=et&8191,it=et>>>13,rt=m[8]|0,We=rt&8191,lt=rt>>>13,pt=m[9]|0,Ke=pt&8191,vt=pt>>>13,bt=R[0]|0,tt=bt&8191,_t=bt>>>13,Ct=R[1]|0,It=Ct&8191,er=Ct>>>13,ur=R[2]|0,wt=ur&8191,lr=ur>>>13,ir=R[3]|0,Pt=ir&8191,Ot=ir>>>13,Dt=R[4]|0,dt=Dt&8191,Bt=Dt>>>13,kt=R[5]|0,ut=kt&8191,Vt=kt>>>13,zt=R[6]|0,ht=zt&8191,xt=zt>>>13,Nt=R[7]|0,He=Nt&8191,$t=Nt>>>13,Et=R[8]|0,ct=Et&8191,Ht=Et>>>13,Dr=R[9]|0,Ut=Dr&8191,Ir=Dr>>>13;v.negative=P.negative^M.negative,v.length=19,x=Math.imul(H,tt),w=Math.imul(H,_t),w=w+Math.imul(oe,tt)|0,T=Math.imul(oe,_t);var tr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,x=Math.imul(X,tt),w=Math.imul(X,_t),w=w+Math.imul(G,tt)|0,T=Math.imul(G,_t),x=x+Math.imul(H,It)|0,w=w+Math.imul(H,er)|0,w=w+Math.imul(oe,It)|0,T=T+Math.imul(oe,er)|0;var Rr=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,x=Math.imul(ee,tt),w=Math.imul(ee,_t),w=w+Math.imul(N,tt)|0,T=Math.imul(N,_t),x=x+Math.imul(X,It)|0,w=w+Math.imul(X,er)|0,w=w+Math.imul(G,It)|0,T=T+Math.imul(G,er)|0,x=x+Math.imul(H,wt)|0,w=w+Math.imul(H,lr)|0,w=w+Math.imul(oe,wt)|0,T=T+Math.imul(oe,lr)|0;var vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vi>>>26)|0,vi&=67108863,x=Math.imul(fe,tt),w=Math.imul(fe,_t),w=w+Math.imul(Ee,tt)|0,T=Math.imul(Ee,_t),x=x+Math.imul(ee,It)|0,w=w+Math.imul(ee,er)|0,w=w+Math.imul(N,It)|0,T=T+Math.imul(N,er)|0,x=x+Math.imul(X,wt)|0,w=w+Math.imul(X,lr)|0,w=w+Math.imul(G,wt)|0,T=T+Math.imul(G,lr)|0,x=x+Math.imul(H,Pt)|0,w=w+Math.imul(H,Ot)|0,w=w+Math.imul(oe,Pt)|0,T=T+Math.imul(oe,Ot)|0;var gi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(gi>>>26)|0,gi&=67108863,x=Math.imul(Re,tt),w=Math.imul(Re,_t),w=w+Math.imul(Te,tt)|0,T=Math.imul(Te,_t),x=x+Math.imul(fe,It)|0,w=w+Math.imul(fe,er)|0,w=w+Math.imul(Ee,It)|0,T=T+Math.imul(Ee,er)|0,x=x+Math.imul(ee,wt)|0,w=w+Math.imul(ee,lr)|0,w=w+Math.imul(N,wt)|0,T=T+Math.imul(N,lr)|0,x=x+Math.imul(X,Pt)|0,w=w+Math.imul(X,Ot)|0,w=w+Math.imul(G,Pt)|0,T=T+Math.imul(G,Ot)|0,x=x+Math.imul(H,dt)|0,w=w+Math.imul(H,Bt)|0,w=w+Math.imul(oe,dt)|0,T=T+Math.imul(oe,Bt)|0;var yi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(yi>>>26)|0,yi&=67108863,x=Math.imul(ze,tt),w=Math.imul(ze,_t),w=w+Math.imul(Xe,tt)|0,T=Math.imul(Xe,_t),x=x+Math.imul(Re,It)|0,w=w+Math.imul(Re,er)|0,w=w+Math.imul(Te,It)|0,T=T+Math.imul(Te,er)|0,x=x+Math.imul(fe,wt)|0,w=w+Math.imul(fe,lr)|0,w=w+Math.imul(Ee,wt)|0,T=T+Math.imul(Ee,lr)|0,x=x+Math.imul(ee,Pt)|0,w=w+Math.imul(ee,Ot)|0,w=w+Math.imul(N,Pt)|0,T=T+Math.imul(N,Ot)|0,x=x+Math.imul(X,dt)|0,w=w+Math.imul(X,Bt)|0,w=w+Math.imul(G,dt)|0,T=T+Math.imul(G,Bt)|0,x=x+Math.imul(H,ut)|0,w=w+Math.imul(H,Vt)|0,w=w+Math.imul(oe,ut)|0,T=T+Math.imul(oe,Vt)|0;var Si=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Si>>>26)|0,Si&=67108863,x=Math.imul(ke,tt),w=Math.imul(ke,_t),w=w+Math.imul(Ne,tt)|0,T=Math.imul(Ne,_t),x=x+Math.imul(ze,It)|0,w=w+Math.imul(ze,er)|0,w=w+Math.imul(Xe,It)|0,T=T+Math.imul(Xe,er)|0,x=x+Math.imul(Re,wt)|0,w=w+Math.imul(Re,lr)|0,w=w+Math.imul(Te,wt)|0,T=T+Math.imul(Te,lr)|0,x=x+Math.imul(fe,Pt)|0,w=w+Math.imul(fe,Ot)|0,w=w+Math.imul(Ee,Pt)|0,T=T+Math.imul(Ee,Ot)|0,x=x+Math.imul(ee,dt)|0,w=w+Math.imul(ee,Bt)|0,w=w+Math.imul(N,dt)|0,T=T+Math.imul(N,Bt)|0,x=x+Math.imul(X,ut)|0,w=w+Math.imul(X,Vt)|0,w=w+Math.imul(G,ut)|0,T=T+Math.imul(G,Vt)|0,x=x+Math.imul(H,ht)|0,w=w+Math.imul(H,xt)|0,w=w+Math.imul(oe,ht)|0,T=T+Math.imul(oe,xt)|0;var _n=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,x=Math.imul(Je,tt),w=Math.imul(Je,_t),w=w+Math.imul(it,tt)|0,T=Math.imul(it,_t),x=x+Math.imul(ke,It)|0,w=w+Math.imul(ke,er)|0,w=w+Math.imul(Ne,It)|0,T=T+Math.imul(Ne,er)|0,x=x+Math.imul(ze,wt)|0,w=w+Math.imul(ze,lr)|0,w=w+Math.imul(Xe,wt)|0,T=T+Math.imul(Xe,lr)|0,x=x+Math.imul(Re,Pt)|0,w=w+Math.imul(Re,Ot)|0,w=w+Math.imul(Te,Pt)|0,T=T+Math.imul(Te,Ot)|0,x=x+Math.imul(fe,dt)|0,w=w+Math.imul(fe,Bt)|0,w=w+Math.imul(Ee,dt)|0,T=T+Math.imul(Ee,Bt)|0,x=x+Math.imul(ee,ut)|0,w=w+Math.imul(ee,Vt)|0,w=w+Math.imul(N,ut)|0,T=T+Math.imul(N,Vt)|0,x=x+Math.imul(X,ht)|0,w=w+Math.imul(X,xt)|0,w=w+Math.imul(G,ht)|0,T=T+Math.imul(G,xt)|0,x=x+Math.imul(H,He)|0,w=w+Math.imul(H,$t)|0,w=w+Math.imul(oe,He)|0,T=T+Math.imul(oe,$t)|0;var us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(us>>>26)|0,us&=67108863,x=Math.imul(We,tt),w=Math.imul(We,_t),w=w+Math.imul(lt,tt)|0,T=Math.imul(lt,_t),x=x+Math.imul(Je,It)|0,w=w+Math.imul(Je,er)|0,w=w+Math.imul(it,It)|0,T=T+Math.imul(it,er)|0,x=x+Math.imul(ke,wt)|0,w=w+Math.imul(ke,lr)|0,w=w+Math.imul(Ne,wt)|0,T=T+Math.imul(Ne,lr)|0,x=x+Math.imul(ze,Pt)|0,w=w+Math.imul(ze,Ot)|0,w=w+Math.imul(Xe,Pt)|0,T=T+Math.imul(Xe,Ot)|0,x=x+Math.imul(Re,dt)|0,w=w+Math.imul(Re,Bt)|0,w=w+Math.imul(Te,dt)|0,T=T+Math.imul(Te,Bt)|0,x=x+Math.imul(fe,ut)|0,w=w+Math.imul(fe,Vt)|0,w=w+Math.imul(Ee,ut)|0,T=T+Math.imul(Ee,Vt)|0,x=x+Math.imul(ee,ht)|0,w=w+Math.imul(ee,xt)|0,w=w+Math.imul(N,ht)|0,T=T+Math.imul(N,xt)|0,x=x+Math.imul(X,He)|0,w=w+Math.imul(X,$t)|0,w=w+Math.imul(G,He)|0,T=T+Math.imul(G,$t)|0,x=x+Math.imul(H,ct)|0,w=w+Math.imul(H,Ht)|0,w=w+Math.imul(oe,ct)|0,T=T+Math.imul(oe,Ht)|0;var ds=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ds>>>26)|0,ds&=67108863,x=Math.imul(Ke,tt),w=Math.imul(Ke,_t),w=w+Math.imul(vt,tt)|0,T=Math.imul(vt,_t),x=x+Math.imul(We,It)|0,w=w+Math.imul(We,er)|0,w=w+Math.imul(lt,It)|0,T=T+Math.imul(lt,er)|0,x=x+Math.imul(Je,wt)|0,w=w+Math.imul(Je,lr)|0,w=w+Math.imul(it,wt)|0,T=T+Math.imul(it,lr)|0,x=x+Math.imul(ke,Pt)|0,w=w+Math.imul(ke,Ot)|0,w=w+Math.imul(Ne,Pt)|0,T=T+Math.imul(Ne,Ot)|0,x=x+Math.imul(ze,dt)|0,w=w+Math.imul(ze,Bt)|0,w=w+Math.imul(Xe,dt)|0,T=T+Math.imul(Xe,Bt)|0,x=x+Math.imul(Re,ut)|0,w=w+Math.imul(Re,Vt)|0,w=w+Math.imul(Te,ut)|0,T=T+Math.imul(Te,Vt)|0,x=x+Math.imul(fe,ht)|0,w=w+Math.imul(fe,xt)|0,w=w+Math.imul(Ee,ht)|0,T=T+Math.imul(Ee,xt)|0,x=x+Math.imul(ee,He)|0,w=w+Math.imul(ee,$t)|0,w=w+Math.imul(N,He)|0,T=T+Math.imul(N,$t)|0,x=x+Math.imul(X,ct)|0,w=w+Math.imul(X,Ht)|0,w=w+Math.imul(G,ct)|0,T=T+Math.imul(G,Ht)|0,x=x+Math.imul(H,Ut)|0,w=w+Math.imul(H,Ir)|0,w=w+Math.imul(oe,Ut)|0,T=T+Math.imul(oe,Ir)|0;var hs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(hs>>>26)|0,hs&=67108863,x=Math.imul(Ke,It),w=Math.imul(Ke,er),w=w+Math.imul(vt,It)|0,T=Math.imul(vt,er),x=x+Math.imul(We,wt)|0,w=w+Math.imul(We,lr)|0,w=w+Math.imul(lt,wt)|0,T=T+Math.imul(lt,lr)|0,x=x+Math.imul(Je,Pt)|0,w=w+Math.imul(Je,Ot)|0,w=w+Math.imul(it,Pt)|0,T=T+Math.imul(it,Ot)|0,x=x+Math.imul(ke,dt)|0,w=w+Math.imul(ke,Bt)|0,w=w+Math.imul(Ne,dt)|0,T=T+Math.imul(Ne,Bt)|0,x=x+Math.imul(ze,ut)|0,w=w+Math.imul(ze,Vt)|0,w=w+Math.imul(Xe,ut)|0,T=T+Math.imul(Xe,Vt)|0,x=x+Math.imul(Re,ht)|0,w=w+Math.imul(Re,xt)|0,w=w+Math.imul(Te,ht)|0,T=T+Math.imul(Te,xt)|0,x=x+Math.imul(fe,He)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,He)|0,T=T+Math.imul(Ee,$t)|0,x=x+Math.imul(ee,ct)|0,w=w+Math.imul(ee,Ht)|0,w=w+Math.imul(N,ct)|0,T=T+Math.imul(N,Ht)|0,x=x+Math.imul(X,Ut)|0,w=w+Math.imul(X,Ir)|0,w=w+Math.imul(G,Ut)|0,T=T+Math.imul(G,Ir)|0;var Vi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,x=Math.imul(Ke,wt),w=Math.imul(Ke,lr),w=w+Math.imul(vt,wt)|0,T=Math.imul(vt,lr),x=x+Math.imul(We,Pt)|0,w=w+Math.imul(We,Ot)|0,w=w+Math.imul(lt,Pt)|0,T=T+Math.imul(lt,Ot)|0,x=x+Math.imul(Je,dt)|0,w=w+Math.imul(Je,Bt)|0,w=w+Math.imul(it,dt)|0,T=T+Math.imul(it,Bt)|0,x=x+Math.imul(ke,ut)|0,w=w+Math.imul(ke,Vt)|0,w=w+Math.imul(Ne,ut)|0,T=T+Math.imul(Ne,Vt)|0,x=x+Math.imul(ze,ht)|0,w=w+Math.imul(ze,xt)|0,w=w+Math.imul(Xe,ht)|0,T=T+Math.imul(Xe,xt)|0,x=x+Math.imul(Re,He)|0,w=w+Math.imul(Re,$t)|0,w=w+Math.imul(Te,He)|0,T=T+Math.imul(Te,$t)|0,x=x+Math.imul(fe,ct)|0,w=w+Math.imul(fe,Ht)|0,w=w+Math.imul(Ee,ct)|0,T=T+Math.imul(Ee,Ht)|0,x=x+Math.imul(ee,Ut)|0,w=w+Math.imul(ee,Ir)|0,w=w+Math.imul(N,Ut)|0,T=T+Math.imul(N,Ir)|0;var ps=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(ps>>>26)|0,ps&=67108863,x=Math.imul(Ke,Pt),w=Math.imul(Ke,Ot),w=w+Math.imul(vt,Pt)|0,T=Math.imul(vt,Ot),x=x+Math.imul(We,dt)|0,w=w+Math.imul(We,Bt)|0,w=w+Math.imul(lt,dt)|0,T=T+Math.imul(lt,Bt)|0,x=x+Math.imul(Je,ut)|0,w=w+Math.imul(Je,Vt)|0,w=w+Math.imul(it,ut)|0,T=T+Math.imul(it,Vt)|0,x=x+Math.imul(ke,ht)|0,w=w+Math.imul(ke,xt)|0,w=w+Math.imul(Ne,ht)|0,T=T+Math.imul(Ne,xt)|0,x=x+Math.imul(ze,He)|0,w=w+Math.imul(ze,$t)|0,w=w+Math.imul(Xe,He)|0,T=T+Math.imul(Xe,$t)|0,x=x+Math.imul(Re,ct)|0,w=w+Math.imul(Re,Ht)|0,w=w+Math.imul(Te,ct)|0,T=T+Math.imul(Te,Ht)|0,x=x+Math.imul(fe,Ut)|0,w=w+Math.imul(fe,Ir)|0,w=w+Math.imul(Ee,Ut)|0,T=T+Math.imul(Ee,Ir)|0;var vs=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(vs>>>26)|0,vs&=67108863,x=Math.imul(Ke,dt),w=Math.imul(Ke,Bt),w=w+Math.imul(vt,dt)|0,T=Math.imul(vt,Bt),x=x+Math.imul(We,ut)|0,w=w+Math.imul(We,Vt)|0,w=w+Math.imul(lt,ut)|0,T=T+Math.imul(lt,Vt)|0,x=x+Math.imul(Je,ht)|0,w=w+Math.imul(Je,xt)|0,w=w+Math.imul(it,ht)|0,T=T+Math.imul(it,xt)|0,x=x+Math.imul(ke,He)|0,w=w+Math.imul(ke,$t)|0,w=w+Math.imul(Ne,He)|0,T=T+Math.imul(Ne,$t)|0,x=x+Math.imul(ze,ct)|0,w=w+Math.imul(ze,Ht)|0,w=w+Math.imul(Xe,ct)|0,T=T+Math.imul(Xe,Ht)|0,x=x+Math.imul(Re,Ut)|0,w=w+Math.imul(Re,Ir)|0,w=w+Math.imul(Te,Ut)|0,T=T+Math.imul(Te,Ir)|0;var Us=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(Us>>>26)|0,Us&=67108863,x=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(vt,ut)|0,T=Math.imul(vt,Vt),x=x+Math.imul(We,ht)|0,w=w+Math.imul(We,xt)|0,w=w+Math.imul(lt,ht)|0,T=T+Math.imul(lt,xt)|0,x=x+Math.imul(Je,He)|0,w=w+Math.imul(Je,$t)|0,w=w+Math.imul(it,He)|0,T=T+Math.imul(it,$t)|0,x=x+Math.imul(ke,ct)|0,w=w+Math.imul(ke,Ht)|0,w=w+Math.imul(Ne,ct)|0,T=T+Math.imul(Ne,Ht)|0,x=x+Math.imul(ze,Ut)|0,w=w+Math.imul(ze,Ir)|0,w=w+Math.imul(Xe,Ut)|0,T=T+Math.imul(Xe,Ir)|0;var lo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(lo>>>26)|0,lo&=67108863,x=Math.imul(Ke,ht),w=Math.imul(Ke,xt),w=w+Math.imul(vt,ht)|0,T=Math.imul(vt,xt),x=x+Math.imul(We,He)|0,w=w+Math.imul(We,$t)|0,w=w+Math.imul(lt,He)|0,T=T+Math.imul(lt,$t)|0,x=x+Math.imul(Je,ct)|0,w=w+Math.imul(Je,Ht)|0,w=w+Math.imul(it,ct)|0,T=T+Math.imul(it,Ht)|0,x=x+Math.imul(ke,Ut)|0,w=w+Math.imul(ke,Ir)|0,w=w+Math.imul(Ne,Ut)|0,T=T+Math.imul(Ne,Ir)|0;var In=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(In>>>26)|0,In&=67108863,x=Math.imul(Ke,He),w=Math.imul(Ke,$t),w=w+Math.imul(vt,He)|0,T=Math.imul(vt,$t),x=x+Math.imul(We,ct)|0,w=w+Math.imul(We,Ht)|0,w=w+Math.imul(lt,ct)|0,T=T+Math.imul(lt,Ht)|0,x=x+Math.imul(Je,Ut)|0,w=w+Math.imul(Je,Ir)|0,w=w+Math.imul(it,Ut)|0,T=T+Math.imul(it,Ir)|0;var zi=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(zi>>>26)|0,zi&=67108863,x=Math.imul(Ke,ct),w=Math.imul(Ke,Ht),w=w+Math.imul(vt,ct)|0,T=Math.imul(vt,Ht),x=x+Math.imul(We,Ut)|0,w=w+Math.imul(We,Ir)|0,w=w+Math.imul(lt,Ut)|0,T=T+Math.imul(lt,Ir)|0;var fo=(E+x|0)+((w&8191)<<13)|0;E=(T+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,x=Math.imul(Ke,Ut),w=Math.imul(Ke,Ir),w=w+Math.imul(vt,Ut)|0,T=Math.imul(vt,Ir);var $s=(E+x|0)+((w&8191)<<13)|0;return E=(T+(w>>>13)|0)+($s>>>26)|0,$s&=67108863,B[0]=tr,B[1]=Rr,B[2]=vi,B[3]=gi,B[4]=yi,B[5]=Si,B[6]=_n,B[7]=us,B[8]=ds,B[9]=hs,B[10]=Vi,B[11]=ps,B[12]=vs,B[13]=Us,B[14]=lo,B[15]=In,B[16]=zi,B[17]=fo,B[18]=$s,E!==0&&(B[19]=E,v.length++),v};Math.imul||(b=y);function I(K,P,M){M.negative=P.negative^K.negative,M.length=K.length+P.length;for(var v=0,m=0,R=0;R>>26)|0,m+=B>>>26,B&=67108863}M.words[R]=E,v=B,B=m}return v!==0?M.words[R]=v:M.length--,M.strip()}function C(K,P,M){var v=new S;return v.mulp(K,P,M)}s.prototype.mulTo=function(P,M){var v,m=this.length+P.length;return this.length===10&&P.length===10?v=b(this,P,M):m<63?v=y(this,P,M):m<1024?v=I(this,P,M):v=C(this,P,M),v};function S(K,P){this.x=K,this.y=P}S.prototype.makeRBT=function(P){for(var M=new Array(P),v=s.prototype._countBits(P)-1,m=0;m>=1;return m},S.prototype.permute=function(P,M,v,m,R,B){for(var E=0;E>>1)R++;return 1<>>13,v[2*B+1]=R&8191,R=R>>>13;for(B=2*M;B>=26,M+=m/67108864|0,M+=R>>>26,this.words[v]=R&67108863}return M!==0&&(this.words[v]=M,this.length++),this},s.prototype.muln=function(P){return this.clone().imuln(P)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(P){var M=g(P);if(M.length===0)return new s(1);for(var v=this,m=0;m=0);var M=P%26,v=(P-M)/26,m=67108863>>>26-M<<26-M,R;if(M!==0){var B=0;for(R=0;R>>26-M}B&&(this.words[R]=B,this.length++)}if(v!==0){for(R=this.length-1;R>=0;R--)this.words[R+v]=this.words[R];for(R=0;R=0);var m;M?m=(M-M%26)/26:m=0;var R=P%26,B=Math.min((P-R)/26,this.length),E=67108863^67108863>>>R<B)for(this.length-=B,w=0;w=0&&(T!==0||w>=m);w--){var k=this.words[w]|0;this.words[w]=T<<26-R|k>>>R,T=k&E}return x&&T!==0&&(x.words[x.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(P,M,v){return n(this.negative===0),this.iushrn(P,M,v)},s.prototype.shln=function(P){return this.clone().ishln(P)},s.prototype.ushln=function(P){return this.clone().iushln(P)},s.prototype.shrn=function(P){return this.clone().ishrn(P)},s.prototype.ushrn=function(P){return this.clone().iushrn(P)},s.prototype.testn=function(P){n(typeof P=="number"&&P>=0);var M=P%26,v=(P-M)/26,m=1<=0);var M=P%26,v=(P-M)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(M!==0&&v++,this.length=Math.min(v,this.length),M!==0){var m=67108863^67108863>>>M<=67108864;M++)this.words[M]-=67108864,M===this.length-1?this.words[M+1]=1:this.words[M+1]++;return this.length=Math.max(this.length,M+1),this},s.prototype.isubn=function(P){if(n(typeof P=="number"),n(P<67108864),P<0)return this.iaddn(-P);if(this.negative!==0)return this.negative=0,this.iaddn(P),this.negative=1,this;if(this.words[0]-=P,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var M=0;M>26)-(x/67108864|0),this.words[R+v]=B&67108863}for(;R>26,this.words[R+v]=B&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,R=0;R>26,this.words[R]=B&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(P,M){var v=this.length-P.length,m=this.clone(),R=P,B=R.words[R.length-1]|0,E=this._countBits(B);v=26-E,v!==0&&(R=R.ushln(v),m.iushln(v),B=R.words[R.length-1]|0);var x=m.length-R.length,w;if(M!=="mod"){w=new s(null),w.length=x+1,w.words=new Array(w.length);for(var T=0;T=0;H--){var oe=(m.words[R.length+H]|0)*67108864+(m.words[R.length+H-1]|0);for(oe=Math.min(oe/B|0,67108863),m._ishlnsubmul(R,oe,H);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(R,1,H),m.isZero()||(m.negative^=1);w&&(w.words[H]=oe)}return w&&w.strip(),m.strip(),M!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(P,M,v){if(n(!P.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,R,B;return this.negative!==0&&P.negative===0?(B=this.neg().divmod(P,M),M!=="mod"&&(m=B.div.neg()),M!=="div"&&(R=B.mod.neg(),v&&R.negative!==0&&R.iadd(P)),{div:m,mod:R}):this.negative===0&&P.negative!==0?(B=this.divmod(P.neg(),M),M!=="mod"&&(m=B.div.neg()),{div:m,mod:B.mod}):this.negative&P.negative?(B=this.neg().divmod(P.neg(),M),M!=="div"&&(R=B.mod.neg(),v&&R.negative!==0&&R.isub(P)),{div:B.div,mod:R}):P.length>this.length||this.cmp(P)<0?{div:new s(0),mod:this}:P.length===1?M==="div"?{div:this.divn(P.words[0]),mod:null}:M==="mod"?{div:null,mod:new s(this.modn(P.words[0]))}:{div:this.divn(P.words[0]),mod:new s(this.modn(P.words[0]))}:this._wordDiv(P,M)},s.prototype.div=function(P){return this.divmod(P,"div",!1).div},s.prototype.mod=function(P){return this.divmod(P,"mod",!1).mod},s.prototype.umod=function(P){return this.divmod(P,"mod",!0).mod},s.prototype.divRound=function(P){var M=this.divmod(P);if(M.mod.isZero())return M.div;var v=M.div.negative!==0?M.mod.isub(P):M.mod,m=P.ushrn(1),R=P.andln(1),B=v.cmp(m);return B<0||R===1&&B===0?M.div:M.div.negative!==0?M.div.isubn(1):M.div.iaddn(1)},s.prototype.modn=function(P){n(P<=67108863);for(var M=(1<<26)%P,v=0,m=this.length-1;m>=0;m--)v=(M*v+(this.words[m]|0))%P;return v},s.prototype.idivn=function(P){n(P<=67108863);for(var M=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+M*67108864;this.words[v]=m/P|0,M=m%P}return this.strip()},s.prototype.divn=function(P){return this.clone().idivn(P)},s.prototype.egcd=function(P){n(P.negative===0),n(!P.isZero());var M=this,v=P.clone();M.negative!==0?M=M.umod(P):M=M.clone();for(var m=new s(1),R=new s(0),B=new s(0),E=new s(1),x=0;M.isEven()&&v.isEven();)M.iushrn(1),v.iushrn(1),++x;for(var w=v.clone(),T=M.clone();!M.isZero();){for(var k=0,H=1;!(M.words[0]&H)&&k<26;++k,H<<=1);if(k>0)for(M.iushrn(k);k-- >0;)(m.isOdd()||R.isOdd())&&(m.iadd(w),R.isub(T)),m.iushrn(1),R.iushrn(1);for(var oe=0,j=1;!(v.words[0]&j)&&oe<26;++oe,j<<=1);if(oe>0)for(v.iushrn(oe);oe-- >0;)(B.isOdd()||E.isOdd())&&(B.iadd(w),E.isub(T)),B.iushrn(1),E.iushrn(1);M.cmp(v)>=0?(M.isub(v),m.isub(B),R.isub(E)):(v.isub(M),B.isub(m),E.isub(R))}return{a:B,b:E,gcd:v.iushln(x)}},s.prototype._invmp=function(P){n(P.negative===0),n(!P.isZero());var M=this,v=P.clone();M.negative!==0?M=M.umod(P):M=M.clone();for(var m=new s(1),R=new s(0),B=v.clone();M.cmpn(1)>0&&v.cmpn(1)>0;){for(var E=0,x=1;!(M.words[0]&x)&&E<26;++E,x<<=1);if(E>0)for(M.iushrn(E);E-- >0;)m.isOdd()&&m.iadd(B),m.iushrn(1);for(var w=0,T=1;!(v.words[0]&T)&&w<26;++w,T<<=1);if(w>0)for(v.iushrn(w);w-- >0;)R.isOdd()&&R.iadd(B),R.iushrn(1);M.cmp(v)>=0?(M.isub(v),m.isub(R)):(v.isub(M),R.isub(m))}var k;return M.cmpn(1)===0?k=m:k=R,k.cmpn(0)<0&&k.iadd(P),k},s.prototype.gcd=function(P){if(this.isZero())return P.abs();if(P.isZero())return this.abs();var M=this.clone(),v=P.clone();M.negative=0,v.negative=0;for(var m=0;M.isEven()&&v.isEven();m++)M.iushrn(1),v.iushrn(1);do{for(;M.isEven();)M.iushrn(1);for(;v.isEven();)v.iushrn(1);var R=M.cmp(v);if(R<0){var B=M;M=v,v=B}else if(R===0||v.cmpn(1)===0)break;M.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(P){return this.egcd(P).a.umod(P)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(P){return this.words[0]&P},s.prototype.bincn=function(P){n(typeof P=="number");var M=P%26,v=(P-M)/26,m=1<>>26,E&=67108863,this.words[B]=E}return R!==0&&(this.words[B]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(P){var M=P<0;if(this.negative!==0&&!M)return-1;if(this.negative===0&&M)return 1;this.strip();var v;if(this.length>1)v=1;else{M&&(P=-P),n(P<=67108863,"Number is too big");var m=this.words[0]|0;v=m===P?0:mP.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,R=P.words[v]|0;if(m!==R){mR&&(M=1);break}}return M},s.prototype.gtn=function(P){return this.cmpn(P)===1},s.prototype.gt=function(P){return this.cmp(P)===1},s.prototype.gten=function(P){return this.cmpn(P)>=0},s.prototype.gte=function(P){return this.cmp(P)>=0},s.prototype.ltn=function(P){return this.cmpn(P)===-1},s.prototype.lt=function(P){return this.cmp(P)===-1},s.prototype.lten=function(P){return this.cmpn(P)<=0},s.prototype.lte=function(P){return this.cmp(P)<=0},s.prototype.eqn=function(P){return this.cmpn(P)===0},s.prototype.eq=function(P){return this.cmp(P)===0},s.red=function(P){return new ie(P)},s.prototype.toRed=function(P){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),P.convertTo(this)._forceRed(P)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(P){return this.red=P,this},s.prototype.forceRed=function(P){return n(!this.red,"Already a number in reduction context"),this._forceRed(P)},s.prototype.redAdd=function(P){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,P)},s.prototype.redIAdd=function(P){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,P)},s.prototype.redSub=function(P){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,P)},s.prototype.redISub=function(P){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,P)},s.prototype.redShl=function(P){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,P)},s.prototype.redMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.mul(this,P)},s.prototype.redIMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.imul(this,P)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(P){return n(this.red&&!P.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,P)};var O={k256:null,p224:null,p192:null,p25519:null};function L(K,P){this.name=K,this.p=new s(P,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var P=new s(null);return P.words=new Array(Math.ceil(this.n/13)),P},L.prototype.ireduce=function(P){var M=P,v;do this.split(M,this.tmp),M=this.imulK(M),M=M.iadd(this.tmp),v=M.bitLength();while(v>this.n);var m=v0?M.isub(this.p):M.strip!==void 0?M.strip():M._strip(),M},L.prototype.split=function(P,M){P.iushrn(this.n,0,M)},L.prototype.imulK=function(P){return P.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(P,M){for(var v=4194303,m=Math.min(P.length,9),R=0;R>>22,B=E}B>>>=22,P.words[R-10]=B,B===0&&P.length>10?P.length-=10:P.length-=9},F.prototype.imulK=function(P){P.words[P.length]=0,P.words[P.length+1]=0,P.length+=2;for(var M=0,v=0;v>>=26,P.words[v]=R,M=m}return M!==0&&(P.words[P.length++]=M),P},s._prime=function(P){if(O[P])return O[P];var M;if(P==="k256")M=new F;else if(P==="p224")M=new z;else if(P==="p192")M=new _;else if(P==="p25519")M=new $;else throw new Error("Unknown prime "+P);return O[P]=M,M};function ie(K){if(typeof K=="string"){var P=s._prime(K);this.m=P.p,this.prime=P}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(P){n(P.negative===0,"red works only with positives"),n(P.red,"red works only with red numbers")},ie.prototype._verify2=function(P,M){n((P.negative|M.negative)===0,"red works only with positives"),n(P.red&&P.red===M.red,"red works only with red numbers")},ie.prototype.imod=function(P){return this.prime?this.prime.ireduce(P)._forceRed(this):P.umod(this.m)._forceRed(this)},ie.prototype.neg=function(P){return P.isZero()?P.clone():this.m.sub(P)._forceRed(this)},ie.prototype.add=function(P,M){this._verify2(P,M);var v=P.add(M);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(P,M){this._verify2(P,M);var v=P.iadd(M);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(P,M){this._verify2(P,M);var v=P.sub(M);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(P,M){this._verify2(P,M);var v=P.isub(M);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(P,M){return this._verify1(P),this.imod(P.ushln(M))},ie.prototype.imul=function(P,M){return this._verify2(P,M),this.imod(P.imul(M))},ie.prototype.mul=function(P,M){return this._verify2(P,M),this.imod(P.mul(M))},ie.prototype.isqr=function(P){return this.imul(P,P.clone())},ie.prototype.sqr=function(P){return this.mul(P,P)},ie.prototype.sqrt=function(P){if(P.isZero())return P.clone();var M=this.m.andln(3);if(n(M%2===1),M===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(P,v)}for(var m=this.m.subn(1),R=0;!m.isZero()&&m.andln(1)===0;)R++,m.iushrn(1);n(!m.isZero());var B=new s(1).toRed(this),E=B.redNeg(),x=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,x).cmp(E)!==0;)w.redIAdd(E);for(var T=this.pow(w,m),k=this.pow(P,m.addn(1).iushrn(1)),H=this.pow(P,m),oe=R;H.cmp(B)!==0;){for(var j=H,X=0;j.cmp(B)!==0;X++)j=j.redSqr();n(X=0;R--){for(var T=M.words[R],k=w-1;k>=0;k--){var H=T>>k&1;if(B!==m[0]&&(B=this.sqr(B)),H===0&&E===0){x=0;continue}E<<=1,E|=H,x++,!(x!==v&&(R!==0||k!==0))&&(B=this.mul(B,m[E]),x=0,E=0)}w=26}return B},ie.prototype.convertTo=function(P){var M=P.umod(this.m);return M===P?M.clone():M},ie.prototype.convertFrom=function(P){var M=P.clone();return M.red=null,M},s.mont=function(P){return new ce(P)};function ce(K){ie.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ce,ie),ce.prototype.convertTo=function(P){return this.imod(P.ushln(this.shift))},ce.prototype.convertFrom=function(P){var M=this.imod(P.mul(this.rinv));return M.red=null,M},ce.prototype.imul=function(P,M){if(P.isZero()||M.isZero())return P.words[0]=0,P.length=1,P;var v=P.imul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=v.isub(m).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},ce.prototype.mul=function(P,M){if(P.isZero()||M.isZero())return new s(0)._forceRed(this);var v=P.mul(M),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=v.isub(m).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},ce.prototype.invm=function(P){var M=this.imod(P._invmp(this.m).mul(this.r2));return M._forceRed(this)}})(t,Ei)})(IM);var Ru=IM.exports,TM={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var c=0;c>8,u=l&255;f?a.push(f,u):a.push(u)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(b>>1)-1?C=(b>>1)-S:C=S,I.isubn(C)):C=0,g[y]=C,I.iushrn(1)}return g}e.getNAF=s;function o(f,u){var p=[[],[]];f=f.clone(),u=u.clone();for(var g=0,y=0,b;f.cmpn(-g)>0||u.cmpn(-y)>0;){var I=f.andln(3)+g&3,C=u.andln(3)+y&3;I===3&&(I=-1),C===3&&(C=-1);var S;I&1?(b=f.andln(7)+g&7,(b===3||b===5)&&C===2?S=-I:S=I):S=0,p[0].push(S);var O;C&1?(b=u.andln(7)+y&7,(b===3||b===5)&&I===2?O=-C:O=C):O=0,p[1].push(O),2*g===S+1&&(g=1-g),2*y===O+1&&(y=1-y),f.iushrn(1),u.iushrn(1)}return p}e.getJSF=o;function a(f,u,p){var g="_"+u;f.prototype[u]=function(){return this[g]!==void 0?this[g]:this[g]=p.call(this)}}e.cachedProperty=a;function c(f){return typeof f=="string"?e.toArray(f,"hex"):f}e.parseBytes=c;function l(f){return new r(f,"hex","le")}e.intFromLE=l})(ma);var PM={exports:{}},U9;PM.exports=function(e){return U9||(U9=new Bd(null)),U9.generate(e)};function Bd(t){this.rand=t}PM.exports.Rand=Bd;Bd.prototype.generate=function(e){return this._rand(e)};Bd.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var dE=Dh;Dh.prototype.point=function(){throw new Error("Not implemented")};Dh.prototype.validate=function(){throw new Error("Not implemented")};Dh.prototype._fixedNafMul=function(e,r){Z5(e.precomputed);var n=e._getDoubles(),i=J5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),p=s;p>0;p--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var f=o[c];Z5(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};Dh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,f,u,p;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=J5(n[y],o[y],this._bitLength),c[b]=J5(n[b],o[b],this._bitLength),l=Math.max(c[y].length,l),l=Math.max(c[b].length,l);continue}var I=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(I[1]=r[y].add(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].add(r[b].neg())):(I[1]=r[y].toJ().mixedAdd(r[b]),I[2]=r[y].toJ().mixedAdd(r[b].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],S=JTe(n[y],n[b]);for(l=Math.max(S[0].length,l),c[y]=new Array(l),c[b]=new Array(l),u=0;u=0;f--){for(var _=0;f>=0;){var $=!0;for(u=0;u=0&&_++,F=F.dblp(_),f<0)break;for(u=0;u0?p=a[u][ie-1>>1]:ie<0&&(p=a[u][-ie-1>>1].neg()),p.type==="affine"?F=F.mixedAdd(p):F=F.add(p))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};ic.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(g=l,y=f),u.negative&&(u=u.neg(),p=p.neg()),g.negative&&(g=g.neg(),y=y.neg()),[{a:u,b:p},{a:g,b:y}]};sc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),f=o.mul(i.b),u=e.sub(a).sub(c),p=l.add(f).neg();return{k1:u,k2:p}};sc.prototype.pointFromX=function(e,r){e=new Kn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};sc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};sc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};qi.prototype.isInfinity=function(){return this.inf};qi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};qi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};qi.prototype.getX=function(){return this.x.fromRed()};qi.prototype.getY=function(){return this.y.fromRed()};qi.prototype.mul=function(e){return e=new Kn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};qi.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};qi.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};qi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};qi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};qi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ls(t,e,r,n){Ly.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Kn(0)):(this.x=new Kn(e,16),this.y=new Kn(r,16),this.z=new Kn(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}MM(ls,Ly.BasePoint);sc.prototype.jpoint=function(e,r,n){return new ls(this,e,r,n)};ls.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};ls.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ls.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),p=i.redMul(f),g=l.redSqr().redIAdd(u).redISub(p).redISub(p),y=l.redMul(p.redISub(g)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,y,b)};ls.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),f=l.redMul(a),u=n.redMul(l),p=c.redSqr().redIAdd(f).redISub(u).redISub(u),g=c.redMul(u.redISub(p)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(p,g,y)};ls.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};ls.prototype.inspect=function(){return this.isInfinity()?"":""};ls.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var yv=Ru,gee=nE,hE=dE,tPe=ma;function Fy(t){hE.call(this,"mont",t),this.a=new yv(t.a,16).toRed(this.red),this.b=new yv(t.b,16).toRed(this.red),this.i4=new yv(4).toRed(this.red).redInvm(),this.two=new yv(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}gee(Fy,hE);var rPe=Fy;Fy.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function ji(t,e,r){hE.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new yv(e,16),this.z=new yv(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}gee(ji,hE.BasePoint);Fy.prototype.decodePoint=function(e,r){return this.point(tPe.toArray(e,r),1)};Fy.prototype.point=function(e,r){return new ji(this,e,r)};Fy.prototype.pointFromJSON=function(e){return ji.fromJSON(this,e)};ji.prototype.precompute=function(){};ji.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ji.fromJSON=function(e,r){return new ji(e,r[0],r[1]||e.one)};ji.prototype.inspect=function(){return this.isInfinity()?"":""};ji.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ji.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};ji.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),c=s.redMul(i),l=r.z.redMul(a.redAdd(c).redSqr()),f=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,f)};ji.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};ji.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ji.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ji.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ji.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var nPe=ma,Xf=Ru,yee=nE,pE=dE,iPe=nPe.assert;function Xl(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,pE.call(this,"edwards",t),this.a=new Xf(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Xf(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Xf(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),iPe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}yee(Xl,pE);var sPe=Xl;Xl.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Xl.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Xl.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Xl.prototype.pointFromX=function(e,r){e=new Xf(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)};Xl.prototype.pointFromY=function(e,r){e=new Xf(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};Xl.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function wn(t,e,r,n,i){pE.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Xf(e,16),this.y=new Xf(r,16),this.z=n?new Xf(n,16):this.curve.one,this.t=i&&new Xf(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}yee(wn,pE.BasePoint);Xl.prototype.pointFromJSON=function(e){return wn.fromJSON(this,e)};Xl.prototype.point=function(e,r,n,i){return new wn(this,e,r,n,i)};wn.fromJSON=function(e,r){return new wn(e,r[0],r[1],r[2])};wn.prototype.inspect=function(){return this.isInfinity()?"":""};wn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};wn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),c=i.redSub(r),l=s.redMul(a),f=o.redMul(c),u=s.redMul(c),p=a.redMul(o);return this.curve.point(l,f,p,u)};wn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,c,l;if(this.curve.twisted){a=this.curve._mulA(r);var f=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(f.redSub(this.curve.two)),s=f.redMul(a.redSub(n)),o=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),l=f.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=f.redMul(a.redSub(n)),o=f.redMul(l))}else a=r.redAdd(n),c=this.curve._mulC(this.z).redSqr(),l=a.redSub(c).redSub(c),i=this.curve._mulC(e.redISub(a)).redMul(l),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(l);return this.curve.point(i,s,o)};wn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};wn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),c=s.redAdd(i),l=n.redAdd(r),f=o.redMul(a),u=c.redMul(l),p=o.redMul(l),g=a.redMul(c);return this.curve.point(f,u,g,p)};wn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),c=n.redAdd(o),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),f=r.redMul(a).redMul(l),u,p;return this.curve.twisted?(u=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),p=a.redMul(c)):(u=r.redMul(c).redMul(s.redSub(i)),p=this.curve._mulC(a).redMul(c)),this.curve.point(f,u,p)};wn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};wn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};wn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};wn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};wn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};wn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};wn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};wn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};wn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};wn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};wn.prototype.toP=wn.prototype.normalize;wn.prototype.mixedAdd=wn.prototype.add;(function(t){var e=t;e.base=dE,e.short=ePe,e.mont=rPe,e.edwards=sPe})(kM);var vE={},$9,Fj;function oPe(){return Fj||(Fj=1,$9={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),$9}(function(t){var e=t,r=kx,n=kM,i=ma,s=i.assert;function o(l){l.type==="short"?this.curve=new n.short(l):l.type==="edwards"?this.curve=new n.edwards(l):this.curve=new n.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(l,f){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var u=new o(f);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=oPe()}catch{c=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})})(vE);var aPe=kx,yp=TM,mee=Yp;function hh(t){if(!(this instanceof hh))return new hh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=yp.toArray(t.entropy,t.entropyEnc||"hex"),r=yp.toArray(t.nonce,t.nonceEnc||"hex"),n=yp.toArray(t.pers,t.persEnc||"hex");mee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var cPe=hh;hh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};hh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=yp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var X5=Ru,RM=ma,dPe=RM.assert;function gE(t,e){if(t instanceof gE)return t;this._importDER(t,e)||(dPe(t.r&&t.s,"Signature without r or s"),this.r=new X5(t.r,16),this.s=new X5(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var hPe=gE;function pPe(){this.place=0}function q9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function jj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}gE.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=jj(r),n=jj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];V9(i,r.length),i=i.concat(r),i.push(2),V9(i,n.length);var s=i.concat(n),o=[48];return V9(o,s.length),o=o.concat(s),RM.encode(o,e)};var eu=Ru,bee=cPe,vPe=ma,z9=vE,gPe=vee,wee=vPe.assert,OM=uPe,yE=hPe;function tc(t){if(!(this instanceof tc))return new tc(t);typeof t=="string"&&(wee(Object.prototype.hasOwnProperty.call(z9,t),"Unknown curve "+t),t=z9[t]),t instanceof z9.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var yPe=tc;tc.prototype.keyPair=function(e){return new OM(this,e)};tc.prototype.keyFromPrivate=function(e,r){return OM.fromPrivate(this,e,r)};tc.prototype.keyFromPublic=function(e,r){return OM.fromPublic(this,e,r)};tc.prototype.genKeyPair=function(e){e||(e={});for(var r=new bee({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||gPe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new eu(2));;){var s=new eu(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};tc.prototype._truncateToN=function(e,r,n){var i;if(eu.isBN(e)||typeof e=="number")e=new eu(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new eu(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new eu(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};tc.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength);for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new bee({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new eu(1)),f=0;;f++){var u=i.k?i.k(f):new eu(c.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var p=this.g.mul(u);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(y.cmpn(0)!==0){var b=u.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var I=(p.getY().isOdd()?1:0)|(g.cmp(y)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),I^=1),new yE({r:y,s:b,recoveryParam:I})}}}}}};tc.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new yE(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.eqXToP(o)):(u=this.g.mulAdd(l,n.getPublic(),f),u.isInfinity()?!1:u.getX().umod(this.n).cmp(o)===0)};tc.prototype.recoverPubKey=function(t,e,r,n){wee((3&r)===r,"The recovery param is more than two bits"),e=new yE(e,n);var i=this.n,s=new eu(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),u=i.sub(s).mul(f).umod(i),p=a.mul(f).umod(i);return this.g.mulAdd(u,o,p)};tc.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new yE(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Nx=ma,xee=Nx.assert,Uj=Nx.parseBytes,jy=Nx.cachedProperty;function Li(t,e){this.eddsa=t,this._secret=Uj(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Uj(e.pub)}Li.fromPublic=function(e,r){return r instanceof Li?r:new Li(e,{pub:r})};Li.fromSecret=function(e,r){return r instanceof Li?r:new Li(e,{secret:r})};Li.prototype.secret=function(){return this._secret};jy(Li,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});jy(Li,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});jy(Li,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});jy(Li,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});jy(Li,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});jy(Li,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Li.prototype.sign=function(e){return xee(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Li.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Li.prototype.getSecret=function(e){return xee(this._secret,"KeyPair is public only"),Nx.encode(this.secret(),e)};Li.prototype.getPublic=function(e){return Nx.encode(this.pubBytes(),e)};var mPe=Li,bPe=Ru,mE=ma,$j=mE.assert,bE=mE.cachedProperty,wPe=mE.parseBytes;function Jp(t,e){this.eddsa=t,typeof e!="object"&&(e=wPe(e)),Array.isArray(e)&&($j(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),$j(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof bPe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}bE(Jp,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});bE(Jp,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});bE(Jp,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});bE(Jp,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Jp.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Jp.prototype.toHex=function(){return mE.encode(this.toBytes(),"hex").toUpperCase()};var xPe=Jp,EPe=kx,CPe=vE,ly=ma,APe=ly.assert,Eee=ly.parseBytes,Cee=mPe,qj=xPe;function Lo(t){if(APe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Lo))return new Lo(t);t=CPe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=EPe.sha512}var SPe=Lo;Lo.prototype.sign=function(e,r){e=Eee(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:c,Rencoded:o})};Lo.prototype.verify=function(e,r,n){if(e=Eee(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Lo.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[f++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(f=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,f,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[f++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,f=this._bufferLength,u=l/536870912|0,p=l<<3,g=l%128<112?128:256;this._buffer[f]=128;for(var y=f+1;y0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([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 s(a,c,l,f,u,p,g){for(var y=l[0],b=l[1],I=l[2],C=l[3],S=l[4],O=l[5],L=l[6],F=l[7],z=f[0],_=f[1],$=f[2],ie=f[3],ce=f[4],K=f[5],P=f[6],M=f[7],v,m,R,B,E,x,w,T;g>=128;){for(var k=0;k<16;k++){var H=8*k+p;a[k]=e.readUint32BE(u,H),c[k]=e.readUint32BE(u,H+4)}for(var k=0;k<80;k++){var oe=y,j=b,X=I,G=C,Z=S,ee=O,N=L,te=F,fe=z,Ee=_,_e=$,Re=ie,Te=ce,De=K,ze=P,Xe=M;if(v=F,m=M,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|ce<<18)^(S>>>18|ce<<14)^(ce>>>9|S<<23),m=(ce>>>14|S<<18)^(ce>>>18|S<<14)^(S>>>9|ce<<23),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=S&O^~S&L,m=ce&K^~ce&P,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=i[k*2],m=i[k*2+1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=a[k%16],m=c[k%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,R=w&65535|T<<16,B=E&65535|x<<16,v=R,m=B,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=(y>>>28|z<<4)^(z>>>2|y<<30)^(z>>>7|y<<25),m=(z>>>28|y<<4)^(y>>>2|z<<30)^(y>>>7|z<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=z&_^z&$^_&$,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,te=w&65535|T<<16,Xe=E&65535|x<<16,v=G,m=Re,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=R,m=B,E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,G=w&65535|T<<16,Re=E&65535|x<<16,b=oe,I=j,C=X,S=G,O=Z,L=ee,F=N,y=te,_=fe,$=Ee,ie=_e,ce=Re,K=Te,P=De,M=ze,z=Xe,k%16===15)for(var H=0;H<16;H++)v=a[H],m=c[H],E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=a[(H+9)%16],m=c[(H+9)%16],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,R=a[(H+1)%16],B=c[(H+1)%16],v=(R>>>1|B<<31)^(R>>>8|B<<24)^R>>>7,m=(B>>>1|R<<31)^(B>>>8|R<<24)^(B>>>7|R<<25),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,R=a[(H+14)%16],B=c[(H+14)%16],v=(R>>>19|B<<13)^(B>>>29|R<<3)^R>>>6,m=(B>>>19|R<<13)^(R>>>29|B<<3)^(B>>>6|R<<26),E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,a[H]=w&65535|T<<16,c[H]=E&65535|x<<16}v=y,m=z,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=z=E&65535|x<<16,v=b,m=_,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=E&65535|x<<16,v=I,m=$,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=$=E&65535|x<<16,v=C,m=ie,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=E&65535|x<<16,v=S,m=ce,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=ce=E&65535|x<<16,v=O,m=K,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[5]=O=w&65535|T<<16,f[5]=K=E&65535|x<<16,v=L,m=P,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=P=E&65535|x<<16,v=F,m=M,E=m&65535,x=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],E+=m&65535,x+=m>>>16,w+=v&65535,T+=v>>>16,x+=E>>>16,w+=x>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=M=E&65535|x<<16,p+=128,g-=128}return p}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Aee);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Oh,r=Aee,n=ya;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(G){const Z=new Float64Array(16);if(G)for(let ee=0;ee>16&1),ee[Ee-1]&=65535;ee[15]=N[15]-32767-(ee[14]>>16&1);const fe=ee[15]>>16&1;ee[14]&=65535,b(N,ee,1-fe)}for(let te=0;te<16;te++)G[2*te]=N[te]&255,G[2*te+1]=N[te]>>8}function C(G,Z){let ee=0;for(let N=0;N<32;N++)ee|=G[N]^Z[N];return(1&ee-1>>>8)-1}function S(G,Z){const ee=new Uint8Array(32),N=new Uint8Array(32);return I(ee,G),I(N,Z),C(ee,N)}function O(G){const Z=new Uint8Array(32);return I(Z,G),Z[0]&1}function L(G,Z){for(let ee=0;ee<16;ee++)G[ee]=Z[2*ee]+(Z[2*ee+1]<<8);G[15]&=32767}function F(G,Z,ee){for(let N=0;N<16;N++)G[N]=Z[N]+ee[N]}function z(G,Z,ee){for(let N=0;N<16;N++)G[N]=Z[N]-ee[N]}function _(G,Z,ee){let N,te,fe=0,Ee=0,_e=0,Re=0,Te=0,De=0,ze=0,Xe=0,Qe=0,ke=0,Ne=0,et=0,Je=0,it=0,rt=0,We=0,lt=0,pt=0,Ke=0,vt=0,bt=0,tt=0,_t=0,Ct=0,It=0,er=0,ur=0,wt=0,lr=0,ir=0,Pt=0,Ot=ee[0],Dt=ee[1],dt=ee[2],Bt=ee[3],kt=ee[4],ut=ee[5],Vt=ee[6],zt=ee[7],ht=ee[8],xt=ee[9],Nt=ee[10],He=ee[11],$t=ee[12],Et=ee[13],ct=ee[14],Ht=ee[15];N=Z[0],fe+=N*Ot,Ee+=N*Dt,_e+=N*dt,Re+=N*Bt,Te+=N*kt,De+=N*ut,ze+=N*Vt,Xe+=N*zt,Qe+=N*ht,ke+=N*xt,Ne+=N*Nt,et+=N*He,Je+=N*$t,it+=N*Et,rt+=N*ct,We+=N*Ht,N=Z[1],Ee+=N*Ot,_e+=N*Dt,Re+=N*dt,Te+=N*Bt,De+=N*kt,ze+=N*ut,Xe+=N*Vt,Qe+=N*zt,ke+=N*ht,Ne+=N*xt,et+=N*Nt,Je+=N*He,it+=N*$t,rt+=N*Et,We+=N*ct,lt+=N*Ht,N=Z[2],_e+=N*Ot,Re+=N*Dt,Te+=N*dt,De+=N*Bt,ze+=N*kt,Xe+=N*ut,Qe+=N*Vt,ke+=N*zt,Ne+=N*ht,et+=N*xt,Je+=N*Nt,it+=N*He,rt+=N*$t,We+=N*Et,lt+=N*ct,pt+=N*Ht,N=Z[3],Re+=N*Ot,Te+=N*Dt,De+=N*dt,ze+=N*Bt,Xe+=N*kt,Qe+=N*ut,ke+=N*Vt,Ne+=N*zt,et+=N*ht,Je+=N*xt,it+=N*Nt,rt+=N*He,We+=N*$t,lt+=N*Et,pt+=N*ct,Ke+=N*Ht,N=Z[4],Te+=N*Ot,De+=N*Dt,ze+=N*dt,Xe+=N*Bt,Qe+=N*kt,ke+=N*ut,Ne+=N*Vt,et+=N*zt,Je+=N*ht,it+=N*xt,rt+=N*Nt,We+=N*He,lt+=N*$t,pt+=N*Et,Ke+=N*ct,vt+=N*Ht,N=Z[5],De+=N*Ot,ze+=N*Dt,Xe+=N*dt,Qe+=N*Bt,ke+=N*kt,Ne+=N*ut,et+=N*Vt,Je+=N*zt,it+=N*ht,rt+=N*xt,We+=N*Nt,lt+=N*He,pt+=N*$t,Ke+=N*Et,vt+=N*ct,bt+=N*Ht,N=Z[6],ze+=N*Ot,Xe+=N*Dt,Qe+=N*dt,ke+=N*Bt,Ne+=N*kt,et+=N*ut,Je+=N*Vt,it+=N*zt,rt+=N*ht,We+=N*xt,lt+=N*Nt,pt+=N*He,Ke+=N*$t,vt+=N*Et,bt+=N*ct,tt+=N*Ht,N=Z[7],Xe+=N*Ot,Qe+=N*Dt,ke+=N*dt,Ne+=N*Bt,et+=N*kt,Je+=N*ut,it+=N*Vt,rt+=N*zt,We+=N*ht,lt+=N*xt,pt+=N*Nt,Ke+=N*He,vt+=N*$t,bt+=N*Et,tt+=N*ct,_t+=N*Ht,N=Z[8],Qe+=N*Ot,ke+=N*Dt,Ne+=N*dt,et+=N*Bt,Je+=N*kt,it+=N*ut,rt+=N*Vt,We+=N*zt,lt+=N*ht,pt+=N*xt,Ke+=N*Nt,vt+=N*He,bt+=N*$t,tt+=N*Et,_t+=N*ct,Ct+=N*Ht,N=Z[9],ke+=N*Ot,Ne+=N*Dt,et+=N*dt,Je+=N*Bt,it+=N*kt,rt+=N*ut,We+=N*Vt,lt+=N*zt,pt+=N*ht,Ke+=N*xt,vt+=N*Nt,bt+=N*He,tt+=N*$t,_t+=N*Et,Ct+=N*ct,It+=N*Ht,N=Z[10],Ne+=N*Ot,et+=N*Dt,Je+=N*dt,it+=N*Bt,rt+=N*kt,We+=N*ut,lt+=N*Vt,pt+=N*zt,Ke+=N*ht,vt+=N*xt,bt+=N*Nt,tt+=N*He,_t+=N*$t,Ct+=N*Et,It+=N*ct,er+=N*Ht,N=Z[11],et+=N*Ot,Je+=N*Dt,it+=N*dt,rt+=N*Bt,We+=N*kt,lt+=N*ut,pt+=N*Vt,Ke+=N*zt,vt+=N*ht,bt+=N*xt,tt+=N*Nt,_t+=N*He,Ct+=N*$t,It+=N*Et,er+=N*ct,ur+=N*Ht,N=Z[12],Je+=N*Ot,it+=N*Dt,rt+=N*dt,We+=N*Bt,lt+=N*kt,pt+=N*ut,Ke+=N*Vt,vt+=N*zt,bt+=N*ht,tt+=N*xt,_t+=N*Nt,Ct+=N*He,It+=N*$t,er+=N*Et,ur+=N*ct,wt+=N*Ht,N=Z[13],it+=N*Ot,rt+=N*Dt,We+=N*dt,lt+=N*Bt,pt+=N*kt,Ke+=N*ut,vt+=N*Vt,bt+=N*zt,tt+=N*ht,_t+=N*xt,Ct+=N*Nt,It+=N*He,er+=N*$t,ur+=N*Et,wt+=N*ct,lr+=N*Ht,N=Z[14],rt+=N*Ot,We+=N*Dt,lt+=N*dt,pt+=N*Bt,Ke+=N*kt,vt+=N*ut,bt+=N*Vt,tt+=N*zt,_t+=N*ht,Ct+=N*xt,It+=N*Nt,er+=N*He,ur+=N*$t,wt+=N*Et,lr+=N*ct,ir+=N*Ht,N=Z[15],We+=N*Ot,lt+=N*Dt,pt+=N*dt,Ke+=N*Bt,vt+=N*kt,bt+=N*ut,tt+=N*Vt,_t+=N*zt,Ct+=N*ht,It+=N*xt,er+=N*Nt,ur+=N*He,wt+=N*$t,lr+=N*Et,ir+=N*ct,Pt+=N*Ht,fe+=38*lt,Ee+=38*pt,_e+=38*Ke,Re+=38*vt,Te+=38*bt,De+=38*tt,ze+=38*_t,Xe+=38*Ct,Qe+=38*It,ke+=38*er,Ne+=38*ur,et+=38*wt,Je+=38*lr,it+=38*ir,rt+=38*Pt,te=1,N=fe+te+65535,te=Math.floor(N/65536),fe=N-te*65536,N=Ee+te+65535,te=Math.floor(N/65536),Ee=N-te*65536,N=_e+te+65535,te=Math.floor(N/65536),_e=N-te*65536,N=Re+te+65535,te=Math.floor(N/65536),Re=N-te*65536,N=Te+te+65535,te=Math.floor(N/65536),Te=N-te*65536,N=De+te+65535,te=Math.floor(N/65536),De=N-te*65536,N=ze+te+65535,te=Math.floor(N/65536),ze=N-te*65536,N=Xe+te+65535,te=Math.floor(N/65536),Xe=N-te*65536,N=Qe+te+65535,te=Math.floor(N/65536),Qe=N-te*65536,N=ke+te+65535,te=Math.floor(N/65536),ke=N-te*65536,N=Ne+te+65535,te=Math.floor(N/65536),Ne=N-te*65536,N=et+te+65535,te=Math.floor(N/65536),et=N-te*65536,N=Je+te+65535,te=Math.floor(N/65536),Je=N-te*65536,N=it+te+65535,te=Math.floor(N/65536),it=N-te*65536,N=rt+te+65535,te=Math.floor(N/65536),rt=N-te*65536,N=We+te+65535,te=Math.floor(N/65536),We=N-te*65536,fe+=te-1+37*(te-1),te=1,N=fe+te+65535,te=Math.floor(N/65536),fe=N-te*65536,N=Ee+te+65535,te=Math.floor(N/65536),Ee=N-te*65536,N=_e+te+65535,te=Math.floor(N/65536),_e=N-te*65536,N=Re+te+65535,te=Math.floor(N/65536),Re=N-te*65536,N=Te+te+65535,te=Math.floor(N/65536),Te=N-te*65536,N=De+te+65535,te=Math.floor(N/65536),De=N-te*65536,N=ze+te+65535,te=Math.floor(N/65536),ze=N-te*65536,N=Xe+te+65535,te=Math.floor(N/65536),Xe=N-te*65536,N=Qe+te+65535,te=Math.floor(N/65536),Qe=N-te*65536,N=ke+te+65535,te=Math.floor(N/65536),ke=N-te*65536,N=Ne+te+65535,te=Math.floor(N/65536),Ne=N-te*65536,N=et+te+65535,te=Math.floor(N/65536),et=N-te*65536,N=Je+te+65535,te=Math.floor(N/65536),Je=N-te*65536,N=it+te+65535,te=Math.floor(N/65536),it=N-te*65536,N=rt+te+65535,te=Math.floor(N/65536),rt=N-te*65536,N=We+te+65535,te=Math.floor(N/65536),We=N-te*65536,fe+=te-1+37*(te-1),G[0]=fe,G[1]=Ee,G[2]=_e,G[3]=Re,G[4]=Te,G[5]=De,G[6]=ze,G[7]=Xe,G[8]=Qe,G[9]=ke,G[10]=Ne,G[11]=et,G[12]=Je,G[13]=it,G[14]=rt,G[15]=We}function $(G,Z){_(G,Z,Z)}function ie(G,Z){const ee=i();let N;for(N=0;N<16;N++)ee[N]=Z[N];for(N=253;N>=0;N--)$(ee,ee),N!==2&&N!==4&&_(ee,ee,Z);for(N=0;N<16;N++)G[N]=ee[N]}function ce(G,Z){const ee=i();let N;for(N=0;N<16;N++)ee[N]=Z[N];for(N=250;N>=0;N--)$(ee,ee),N!==1&&_(ee,ee,Z);for(N=0;N<16;N++)G[N]=ee[N]}function K(G,Z){const ee=i(),N=i(),te=i(),fe=i(),Ee=i(),_e=i(),Re=i(),Te=i(),De=i();z(ee,G[1],G[0]),z(De,Z[1],Z[0]),_(ee,ee,De),F(N,G[0],G[1]),F(De,Z[0],Z[1]),_(N,N,De),_(te,G[3],Z[3]),_(te,te,l),_(fe,G[2],Z[2]),F(fe,fe,fe),z(Ee,N,ee),z(_e,fe,te),F(Re,fe,te),F(Te,N,ee),_(G[0],Ee,_e),_(G[1],Te,Re),_(G[2],Re,_e),_(G[3],Ee,Te)}function P(G,Z,ee){for(let N=0;N<4;N++)b(G[N],Z[N],ee)}function M(G,Z){const ee=i(),N=i(),te=i();ie(te,Z[2]),_(ee,Z[0],te),_(N,Z[1],te),I(G,N),G[31]^=O(ee)<<7}function v(G,Z,ee){g(G[0],o),g(G[1],a),g(G[2],a),g(G[3],o);for(let N=255;N>=0;--N){const te=ee[N/8|0]>>(N&7)&1;P(G,Z,te),K(Z,G),K(G,G),P(G,Z,te)}}function m(G,Z){const ee=[i(),i(),i(),i()];g(ee[0],f),g(ee[1],u),g(ee[2],a),_(ee[3],f,u),v(G,ee,Z)}function R(G){if(G.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Z=(0,r.hash)(G);Z[0]&=248,Z[31]&=127,Z[31]|=64;const ee=new Uint8Array(32),N=[i(),i(),i(),i()];m(N,Z),M(ee,N);const te=new Uint8Array(64);return te.set(G),te.set(ee,32),{publicKey:ee,secretKey:te}}t.generateKeyPairFromSeed=R;function B(G){const Z=(0,e.randomBytes)(32,G),ee=R(Z);return(0,n.wipe)(Z),ee}t.generateKeyPair=B;function E(G){if(G.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(G.subarray(32))}t.extractPublicKeyFromSecretKey=E;const x=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 w(G,Z){let ee,N,te,fe;for(N=63;N>=32;--N){for(ee=0,te=N-32,fe=N-12;te>4)*x[te],ee=Z[te]>>8,Z[te]&=255;for(te=0;te<32;te++)Z[te]-=ee*x[te];for(N=0;N<32;N++)Z[N+1]+=Z[N]>>8,G[N]=Z[N]&255}function T(G){const Z=new Float64Array(64);for(let ee=0;ee<64;ee++)Z[ee]=G[ee];for(let ee=0;ee<64;ee++)G[ee]=0;w(G,Z)}function k(G,Z){const ee=new Float64Array(64),N=[i(),i(),i(),i()],te=(0,r.hash)(G.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const fe=new Uint8Array(64);fe.set(te.subarray(32),32);const Ee=new r.SHA512;Ee.update(fe.subarray(32)),Ee.update(Z);const _e=Ee.digest();Ee.clean(),T(_e),m(N,_e),M(fe,N),Ee.reset(),Ee.update(fe.subarray(0,32)),Ee.update(G.subarray(32)),Ee.update(Z);const Re=Ee.digest();T(Re);for(let Te=0;Te<32;Te++)ee[Te]=_e[Te];for(let Te=0;Te<32;Te++)for(let De=0;De<32;De++)ee[Te+De]+=Re[Te]*te[De];return w(fe.subarray(32),ee),fe}t.sign=k;function H(G,Z){const ee=i(),N=i(),te=i(),fe=i(),Ee=i(),_e=i(),Re=i();return g(G[2],a),L(G[1],Z),$(te,G[1]),_(fe,te,c),z(te,te,G[2]),F(fe,G[2],fe),$(Ee,fe),$(_e,Ee),_(Re,_e,Ee),_(ee,Re,te),_(ee,ee,fe),ce(ee,ee),_(ee,ee,te),_(ee,ee,fe),_(ee,ee,fe),_(G[0],ee,fe),$(N,G[0]),_(N,N,fe),S(N,te)&&_(G[0],G[0],p),$(N,G[0]),_(N,N,fe),S(N,te)?-1:(O(G[0])===Z[31]>>7&&z(G[0],o,G[0]),_(G[3],G[0],G[1]),0)}function oe(G,Z,ee){const N=new Uint8Array(32),te=[i(),i(),i(),i()],fe=[i(),i(),i(),i()];if(ee.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(H(fe,G))return!1;const Ee=new r.SHA512;Ee.update(ee.subarray(0,32)),Ee.update(G),Ee.update(Z);const _e=Ee.digest();return T(_e),v(te,fe,_e),m(fe,ee.subarray(32)),K(te,fe),M(N,te),!C(ee,N)}t.verify=oe;function j(G){let Z=[i(),i(),i(),i()];if(H(Z,G))throw new Error("Ed25519: invalid public key");let ee=i(),N=i(),te=Z[1];F(ee,a,te),z(N,a,te),ie(N,N),_(ee,ee,N);let fe=new Uint8Array(32);return I(fe,ee),fe}t.convertPublicKeyToX25519=j;function X(G){const Z=(0,r.hash)(G.subarray(0,32));Z[0]&=248,Z[31]&=127,Z[31]|=64;const ee=new Uint8Array(Z.subarray(0,32));return(0,n.wipe)(Z),ee}t.convertSecretKeyToX25519=X})(DM);const _Pe="EdDSA",IPe="JWT",e4=".",wE="base64url",See="utf8",_ee="utf8",TPe=":",PPe="did",kPe="key",Vj="base58btc",MPe="z",RPe="K36",OPe=32,DPe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),NPe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Lp(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return NPe(t)}catch{return t}}function Au(t){return typeof t=="string"?t:DPe(t)||""}function zj(t){return Lp(Bi(Di(t,wE),See))}function t4(t){return Bi(Di(Au(t),See),wE)}function Iee(t){const e=Di(RPe,Vj),r=MPe+Bi(_3([e,t]),Vj);return[PPe,kPe,r].join(TPe)}function BPe(t){return Bi(t,wE)}function LPe(t){return Di(t,wE)}function FPe(t){return Di([t4(t.header),t4(t.payload)].join(e4),_ee)}function jPe(t){return[t4(t.header),t4(t.payload),BPe(t.signature)].join(e4)}function lI(t){const e=t.split(e4),r=zj(e[0]),n=zj(e[1]),i=LPe(e[2]),s=Di(e.slice(0,2).join(e4),_ee);return{header:r,payload:n,signature:i,data:s}}function Hj(t=Oh.randomBytes(OPe)){return DM.generateKeyPairFromSeed(t)}async function UPe(t,e,r,n,i=at.fromMiliseconds(Date.now())){const s={alg:_Pe,typ:IPe},o=Iee(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=FPe({header:s,payload:c}),f=DM.sign(n.secretKey,l);return jPe({header:s,payload:c,signature:f})}const $Pe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var qPe={};const VPe=":";function zv(t){const[e,r]=t.split(VPe);return{namespace:e,reference:r}}function Gj(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Tee(t,e){return t.includes(":")?[t]:e.chains||[]}var zPe=Object.defineProperty,Wj=Object.getOwnPropertySymbols,HPe=Object.prototype.hasOwnProperty,GPe=Object.prototype.propertyIsEnumerable,Kj=(t,e,r)=>e in t?zPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Yj=(t,e)=>{for(var r in e||(e={}))HPe.call(e,r)&&Kj(t,r,e[r]);if(Wj)for(var r of Wj(e))GPe.call(e,r)&&Kj(t,r,e[r]);return t};const WPe="ReactNative",sa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},KPe="js";function r4(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Uy(){return!Px()&&!!vM()&&navigator.product===WPe}function Bx(){return!r4()&&!!vM()&&!!Px()}function Lx(){return Uy()?sa.reactNative:r4()?sa.node:Bx()?sa.browser:sa.unknown}function YPe(){var t;try{return Uy()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function QPe(t,e){let r=Tw.parse(t);return r=Yj(Yj({},r),e),t=Tw.stringify(r),t}function Pee(){return AX()||{name:"",description:"",url:"",icons:[""]}}function JPe(){if(Lx()===sa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=W9e();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function ZPe(){var t;const e=Lx();return e===sa.browser?[e,((t=CX())==null?void 0:t.host)||"unknown"].join(":"):e}function kee(t,e,r){const n=JPe(),i=ZPe();return[[t,e].join("-"),[KPe,r].join("-"),n,i].join("/")}function XPe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=kee(t,e,n),f={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},u=QPe(c[1]||"",f);return c[0]+"?"+u}function N0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Mee(t){return Object.fromEntries(t.entries())}function Ree(t){return new Map(Object.entries(t))}function y0(t=at.FIVE_MINUTES,e){const r=at.toMiliseconds(t||at.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function Hv(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function Oee(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function eke(t){return Oee("topic",t)}function tke(t){return Oee("id",t)}function Dee(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function bi(t,e){return at.fromMiliseconds(Date.now()+at.toMiliseconds(t))}function ld(t){return Date.now()>=at.toMiliseconds(t)}function Ar(t,e){return`${t}${e?`:${e}`:""}`}function I3(t=[],e=[]){return[...new Set([...t,...e])]}async function rke({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=nke(s,t,e),a=Lx();if(a===sa.browser){if(!((n=Px())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,ske()?"_blank":"_self","noreferrer noopener")}else a===sa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function nke(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${oke(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function ike(t,e){let r="";try{if(Bx()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function Qj(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Jj(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function NM(){return typeof process<"u"&&qPe.IS_VITEST==="true"}function ske(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function oke(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Nee(t){return Buffer.from(t,"base64").toString("utf-8")}const ake="https://rpc.walletconnect.org/v1";async function cke(t,e,r,n,i,s){switch(r.t){case"eip191":return lke(t,e,r.s);case"eip1271":return await fke(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function lke(t,e,r){return Z_e(PX(e),r).toLowerCase()===t.toLowerCase()}async function fke(t,e,r,n,i,s){const o=zv(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",f=r.substring(2),u=PX(e).substring(2),p=a+u+c+l+f,g=await fetch(`${s||ake}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:uke(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:p},"latest"]})}),{result:y}=await g.json();return y?y.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function uke(){return Date.now()+Math.floor(Math.random()*1e3)}var dke=Object.defineProperty,hke=Object.defineProperties,pke=Object.getOwnPropertyDescriptors,Zj=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,gke=Object.prototype.propertyIsEnumerable,Xj=(t,e,r)=>e in t?dke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yke=(t,e)=>{for(var r in e||(e={}))vke.call(e,r)&&Xj(t,r,e[r]);if(Zj)for(var r of Zj(e))gke.call(e,r)&&Xj(t,r,e[r]);return t},mke=(t,e)=>hke(t,pke(e));const bke="did:pkh:",BM=t=>t==null?void 0:t.split(":"),wke=t=>{const e=t&&BM(t);if(e)return t.includes(bke)?e[3]:e[1]},fI=t=>{const e=t&&BM(t);if(e)return e[2]+":"+e[3]},n4=t=>{const e=t&&BM(t);if(e)return e.pop()};async function eU(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=Bee(i,i.iss),o=n4(i.iss);return await cke(o,s,n,fI(i.iss),r)}const Bee=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=n4(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${wke(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,u=t.nbf?`Not Before: ${t.nbf}`:void 0,p=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(b=>` +- ${b}`).join("")}`:void 0,y=T3(t.resources);if(y){const b=Pw(y);i=Pke(i,b)}return[r,n,"",i,"",s,o,a,c,l,f,u,p,g].filter(b=>b!=null).join(` +`)};function xke(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Eke(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Fp(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function Cke(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:Ake(e,r,n)}}}function Ake(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Lee(t){return Fp(t),`urn:recap:${xke(t).replace(/=/g,"")}`}function Pw(t){const e=Eke(t.replace("urn:recap:",""));return Fp(e),e}function Ske(t,e,r){const n=Cke(t,e,r);return Lee(n)}function _ke(t){return t&&t.includes("urn:recap:")}function Ike(t,e){const r=Pw(t),n=Pw(e),i=Tke(r,n);return Lee(i)}function Tke(t,e){Fp(t),Fp(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[i]=mke(yke({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function Pke(t="",e){Fp(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(u=>({ability:u.split("/")[0],action:u.split("/")[1]}));c.sort((u,p)=>u.action.localeCompare(p.action));const l={};c.forEach(u=>{l[u.ability]||(l[u.ability]=[]),l[u.ability].push(u.action)});const f=Object.keys(l).map(u=>(i++,`(${i}) '${u}': '${l[u].join("', '")}' for '${a}'.`));n.push(f.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function tU(t){var e;const r=Pw(t);Fp(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function rU(t){const e=Pw(t);Fp(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function T3(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return _ke(e)?e:void 0}const Fee="base10",no="base16",Ld="base64pad",Dm="base64url",Fx="utf8",jee=0,cu=1,jx=2,kke=0,nU=1,Nb=12,LM=32;function Mke(){const t=_M.generateKeyPair();return{privateKey:Bi(t.secretKey,no),publicKey:Bi(t.publicKey,no)}}function uI(){const t=Oh.randomBytes(LM);return Bi(t,no)}function Rke(t,e){const r=_M.sharedKey(Di(t,no),Di(e,no),!0),n=new RIe(Rx.SHA256,r).expand(LM);return Bi(n,no)}function P3(t){const e=Rx.hash(Di(t,no));return Bi(e,no)}function Nf(t){const e=Rx.hash(Di(t,Fx));return Bi(e,no)}function Uee(t){return Di(`${t}`,Fee)}function jp(t){return Number(Bi(t,Fee))}function Oke(t){const e=Uee(typeof t.type<"u"?t.type:jee);if(jp(e)===cu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Di(t.senderPublicKey,no):void 0,n=typeof t.iv<"u"?Di(t.iv,no):Oh.randomBytes(Nb),i=new AM.ChaCha20Poly1305(Di(t.symKey,no)).seal(n,Di(t.message,Fx));return $ee({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function Dke(t,e){const r=Uee(jx),n=Oh.randomBytes(Nb),i=Di(t,Fx);return $ee({type:r,sealed:i,iv:n,encoding:e})}function Nke(t){const e=new AM.ChaCha20Poly1305(Di(t.symKey,no)),{sealed:r,iv:n}=kw({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Bi(i,Fx)}function Bke(t,e){const{sealed:r}=kw({encoded:t,encoding:e});return Bi(r,Fx)}function $ee(t){const{encoding:e=Ld}=t;if(jp(t.type)===jx)return Bi(_3([t.type,t.sealed]),e);if(jp(t.type)===cu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Bi(_3([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Bi(_3([t.type,t.iv,t.sealed]),e)}function kw(t){const{encoded:e,encoding:r=Ld}=t,n=Di(e,r),i=n.slice(kke,nU),s=nU;if(jp(i)===cu){const l=s+LM,f=l+Nb,u=n.slice(s,l),p=n.slice(l,f),g=n.slice(f);return{type:i,sealed:g,iv:p,senderPublicKey:u}}if(jp(i)===jx){const l=n.slice(s),f=Oh.randomBytes(Nb);return{type:i,sealed:l,iv:f}}const o=s+Nb,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function Lke(t,e){const r=kw({encoded:t,encoding:e==null?void 0:e.encoding});return qee({type:jp(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Bi(r.senderPublicKey,no):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function qee(t){const e=(t==null?void 0:t.type)||jee;if(e===cu){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function iU(t){return t.type===cu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function sU(t){return t.type===jx}function Fke(t){return new pee.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function jke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function Uke(t){return Buffer.from(jke(t),"base64")}function $ke(t,e){const[r,n,i]=t.split("."),s=Uke(i);if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),c=`${r}.${n}`,l=new Rx.SHA256().update(Buffer.from(c)).digest(),f=Fke(e),u=Buffer.from(l).toString("hex");if(!f.verify(u,{r:o,s:a}))throw new Error("Invalid signature");return lI(t).payload}const qke="irn";function dI(t){return(t==null?void 0:t.relay)||{protocol:qke}}function ab(t){const e=$Pe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Vke=Object.defineProperty,zke=Object.defineProperties,Hke=Object.getOwnPropertyDescriptors,oU=Object.getOwnPropertySymbols,Gke=Object.prototype.hasOwnProperty,Wke=Object.prototype.propertyIsEnumerable,aU=(t,e,r)=>e in t?Vke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cU=(t,e)=>{for(var r in e||(e={}))Gke.call(e,r)&&aU(t,r,e[r]);if(oU)for(var r of oU(e))Wke.call(e,r)&&aU(t,r,e[r]);return t},Kke=(t,e)=>zke(t,Hke(e));function Yke(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function lU(t){if(!t.includes("wc:")){const c=Nee(t);c!=null&&c.includes("wc:")&&(t=c)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Tw.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:Qke(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Yke(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Qke(t){return t.startsWith("//")?t.substring(2):t}function Jke(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function fU(t){return`${t.protocol}:${t.topic}@${t.version}?`+Tw.stringify(cU(Kke(cU({symKey:t.symKey},Jke(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function S6(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function $y(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Zke(t){const e=[];return Object.values(t).forEach(r=>{e.push(...$y(r.accounts))}),e}function Xke(t,e){const r=[];return Object.values(t).forEach(n=>{$y(n.accounts).includes(e)&&r.push(...n.methods)}),r}function eMe(t,e){const r=[];return Object.values(t).forEach(n=>{$y(n.accounts).includes(e)&&r.push(...n.events)}),r}function FM(t){return t.includes(":")}function cb(t){return FM(t)?t.split(":")[0]:t}function tMe(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function uU(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=tMe(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=I3(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const rMe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},nMe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function nt(t,e){const{message:r,code:n}=nMe[t];return{message:e?`${r} ${e}`:r,code:n}}function sn(t,e){const{message:r,code:n}=rMe[t];return{message:e?`${r} ${e}`:r,code:n}}function Ql(t,e){return!!Array.isArray(t)}function Mw(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Po(t){return typeof t>"u"}function ri(t,e){return e&&Po(t)?!0:typeof t=="string"&&!!t.trim().length}function jM(t,e){return typeof t=="number"&&!isNaN(t)}function iMe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return N0(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],f=$y(a),u=r[o];(!N0(Tee(o,u),f)||!N0(u.methods,c)||!N0(u.events,l))&&(s=!1)}),s):!1}function i4(t){return ri(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function sMe(t){if(ri(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&i4(r)}}return!1}function oMe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ri(t,!1)){if(e(t))return!0;const r=Nee(t);return e(r)}}catch{}return!1}function aMe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function cMe(t){return t==null?void 0:t.topic}function lMe(t,e){let r=null;return ri(t==null?void 0:t.publicKey,!1)||(r=nt("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function dU(t){let e=!0;return Ql(t)?t.length&&(e=t.every(r=>ri(r,!1))):e=!1,e}function fMe(t,e,r){let n=null;return Ql(e)&&e.length?e.forEach(i=>{n||i4(i)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):i4(t)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function uMe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=fMe(i,Tee(i,s),`${e} ${r}`);o&&(n=o)}),n}function dMe(t,e){let r=null;return Ql(t)?t.forEach(n=>{r||sMe(n)||(r=sn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function hMe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=dMe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function pMe(t,e){let r=null;return dU(t==null?void 0:t.methods)?dU(t==null?void 0:t.events)||(r=sn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Vee(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=pMe(n,`${e}, namespace`);i&&(r=i)}),r}function vMe(t,e,r){let n=null;if(t&&Mw(t)){const i=Vee(t,e);i&&(n=i);const s=uMe(t,e,r);s&&(n=s)}else n=nt("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function H9(t,e){let r=null;if(t&&Mw(t)){const n=Vee(t,e);n&&(r=n);const i=hMe(t,e);i&&(r=i)}else r=nt("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function zee(t){return ri(t.protocol,!0)}function gMe(t,e){let r=!1;return t?t&&Ql(t)&&t.length&&t.forEach(n=>{r=zee(n)}):r=!0,r}function yMe(t){return typeof t=="number"}function Eo(t){return typeof t<"u"&&typeof t!==null}function mMe(t){return!(!t||typeof t!="object"||!t.code||!jM(t.code)||!t.message||!ri(t.message,!1))}function bMe(t){return!(Po(t)||!ri(t.method,!1))}function wMe(t){return!(Po(t)||Po(t.result)&&Po(t.error)||!jM(t.id)||!ri(t.jsonrpc,!1))}function xMe(t){return!(Po(t)||!ri(t.name,!1))}function hU(t,e){return!(!i4(e)||!Zke(t).includes(e))}function EMe(t,e,r){return ri(r,!1)?Xke(t,e).includes(r):!1}function CMe(t,e,r){return ri(r,!1)?eMe(t,e).includes(r):!1}function pU(t,e,r){let n=null;const i=AMe(t),s=SMe(e),o=Object.keys(i),a=Object.keys(s),c=vU(Object.keys(t)),l=vU(Object.keys(e)),f=c.filter(u=>!l.includes(u));return f.length&&(n=nt("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${f.toString()} - Received: ${Object.keys(e).toString()}`)),N0(o,a)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(e).toString()}`)),N0(o,a)||(n=nt("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(u=>{if(!u.includes(":")||n)return;const p=Uy(e[u].accounts);p.includes(u)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${u} + Approved: ${a.toString()}`)),Object.keys(e).forEach(u=>{if(!u.includes(":")||n)return;const p=$y(e[u].accounts);p.includes(u)||(n=nt("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${u} Required: ${u} - Approved: ${p.toString()}`))}),o.forEach(u=>{n||(N0(i[u].methods,s[u].methods)?N0(i[u].events,s[u].events)||(n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${u}`)):n=it("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${u}`))}),n}function AMe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function mU(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function SMe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Uy(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function _Me(t,e){return qM(t)&&t<=e.max&&t>=e.min}function bU(){const t=Fx();return new Promise(e=>{switch(t){case la.browser:e(IMe());break;case la.reactNative:e(TMe());break;case la.node:e(PMe());break;default:e(!0)}})}function IMe(){return Lx()&&(navigator==null?void 0:navigator.onLine)}async function TMe(){if(jy()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function PMe(){return!0}function kMe(t){switch(Fx()){case la.browser:MMe(t);break;case la.reactNative:RMe(t);break}}function MMe(t){!jy()&&Lx()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function RMe(t){jy()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const Y9={};let Bm=class{static get(e){return Y9[e]}static set(e,r){Y9[e]=r}static delete(e){delete Y9[e]}};class Zp{}let OMe=class extends Zp{constructor(e){super()}};const wU=at.FIVE_SECONDS,$y={pulse:"heartbeat_pulse"};let DMe=class Kee extends OMe{constructor(e){super(e),this.events=new ba.EventEmitter,this.interval=wU,this.interval=(e==null?void 0:e.interval)||wU}static async init(e){const r=new Kee(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),at.toMiliseconds(this.interval))}pulse(){this.events.emit($y.pulse)}};const NMe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,BMe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,LMe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function FMe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){jMe(t);return}return e}function jMe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function M6(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!LMe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(NMe.test(t)||BMe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,FMe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function UMe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Mi(t,...e){try{return UMe(t(...e))}catch(r){return Promise.reject(r)}}function $Me(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function qMe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function N3(t){if($Me(t))return String(t);if(qMe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return N3(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Yee(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const gI="base64:";function VMe(t){if(typeof t=="string")return t;Yee();const e=Buffer.from(t).toString("base64");return gI+e}function zMe(t){return typeof t!="string"||!t.startsWith(gI)?t:(Yee(),Buffer.from(t.slice(gI.length),"base64"))}function bo(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function HMe(...t){return bo(t.join(":"))}function R6(t){return t=bo(t),t?t+":":""}const GMe="memory",WMe=()=>{const t=new Map;return{name:GMe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function KMe(t={}){const e={mounts:{"":t.driver||WMe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const f of e.mountpoints)if(l.startsWith(f))return{base:f,relativeKey:l.slice(f.length),driver:e.mounts[f]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,f)=>e.mountpoints.filter(u=>u.startsWith(l)||f&&l.startsWith(u)).map(u=>({relativeBase:l.length>u.length?l.slice(u.length):void 0,mountpoint:u,driver:e.mounts[u]})),i=(l,f)=>{if(e.watching){f=bo(f);for(const u of e.watchListeners)u(l,f)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await xU(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,f,u)=>{const p=new Map,g=y=>{let b=p.get(y.base);return b||(b={driver:y.driver,base:y.base,items:[]},p.set(y.base,b)),b};for(const y of l){const b=typeof y=="string",I=bo(b?y:y.key),C=b?void 0:y.value,S=b||!y.options?f:{...f,...y.options},O=r(I);g(O).items.push({key:I,value:C,relativeKey:O.relativeKey,options:S})}return Promise.all([...p.values()].map(y=>u(y))).then(y=>y.flat())},c={hasItem(l,f={}){l=bo(l);const{relativeKey:u,driver:p}=r(l);return Mi(p.hasItem,u,f)},getItem(l,f={}){l=bo(l);const{relativeKey:u,driver:p}=r(l);return Mi(p.getItem,u,f).then(g=>M6(g))},getItems(l,f){return a(l,f,u=>u.driver.getItems?Mi(u.driver.getItems,u.items.map(p=>({key:p.relativeKey,options:p.options})),f).then(p=>p.map(g=>({key:HMe(u.base,g.key),value:M6(g.value)}))):Promise.all(u.items.map(p=>Mi(u.driver.getItem,p.relativeKey,p.options).then(g=>({key:p.key,value:M6(g)})))))},getItemRaw(l,f={}){l=bo(l);const{relativeKey:u,driver:p}=r(l);return p.getItemRaw?Mi(p.getItemRaw,u,f):Mi(p.getItem,u,f).then(g=>zMe(g))},async setItem(l,f,u={}){if(f===void 0)return c.removeItem(l);l=bo(l);const{relativeKey:p,driver:g}=r(l);g.setItem&&(await Mi(g.setItem,p,N3(f),u),g.watch||i("update",l))},async setItems(l,f){await a(l,f,async u=>{if(u.driver.setItems)return Mi(u.driver.setItems,u.items.map(p=>({key:p.relativeKey,value:N3(p.value),options:p.options})),f);u.driver.setItem&&await Promise.all(u.items.map(p=>Mi(u.driver.setItem,p.relativeKey,N3(p.value),p.options)))})},async setItemRaw(l,f,u={}){if(f===void 0)return c.removeItem(l,u);l=bo(l);const{relativeKey:p,driver:g}=r(l);if(g.setItemRaw)await Mi(g.setItemRaw,p,f,u);else if(g.setItem)await Mi(g.setItem,p,VMe(f),u);else return;g.watch||i("update",l)},async removeItem(l,f={}){typeof f=="boolean"&&(f={removeMeta:f}),l=bo(l);const{relativeKey:u,driver:p}=r(l);p.removeItem&&(await Mi(p.removeItem,u,f),(f.removeMeta||f.removeMata)&&await Mi(p.removeItem,u+"$",f),p.watch||i("remove",l))},async getMeta(l,f={}){typeof f=="boolean"&&(f={nativeOnly:f}),l=bo(l);const{relativeKey:u,driver:p}=r(l),g=Object.create(null);if(p.getMeta&&Object.assign(g,await Mi(p.getMeta,u,f)),!f.nativeOnly){const y=await Mi(p.getItem,u+"$",f).then(b=>M6(b));y&&typeof y=="object"&&(typeof y.atime=="string"&&(y.atime=new Date(y.atime)),typeof y.mtime=="string"&&(y.mtime=new Date(y.mtime)),Object.assign(g,y))}return g},setMeta(l,f,u={}){return this.setItem(l+"$",f,u)},removeMeta(l,f={}){return this.removeItem(l+"$",f)},async getKeys(l,f={}){l=R6(l);const u=n(l,!0);let p=[];const g=[];for(const y of u){const b=await Mi(y.driver.getKeys,y.relativeBase,f);for(const I of b){const C=y.mountpoint+bo(I);p.some(S=>C.startsWith(S))||g.push(C)}p=[y.mountpoint,...p.filter(I=>!I.startsWith(y.mountpoint))]}return l?g.filter(y=>y.startsWith(l)&&y[y.length-1]!=="$"):g.filter(y=>y[y.length-1]!=="$")},async clear(l,f={}){l=R6(l),await Promise.all(n(l,!1).map(async u=>{if(u.driver.clear)return Mi(u.driver.clear,u.relativeBase,f);if(u.driver.removeItem){const p=await u.driver.getKeys(u.relativeBase||"",f);return Promise.all(p.map(g=>u.driver.removeItem(g,f)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>EU(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(f=>f!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,f){if(l=R6(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((u,p)=>p.length-u.length)),e.mounts[l]=f,e.watching&&Promise.resolve(xU(f,i,l)).then(u=>{e.unwatch[l]=u}).catch(console.error),c},async unmount(l,f=!0){l=R6(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),f&&await EU(e.mounts[l]),e.mountpoints=e.mountpoints.filter(u=>u!==l),delete e.mounts[l])},getMount(l=""){l=bo(l)+":";const f=r(l);return{driver:f.driver,base:f.base}},getMounts(l="",f={}){return l=bo(l),n(l,f.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(l,f={})=>c.getKeys(l,f),get:(l,f={})=>c.getItem(l,f),set:(l,f,u={})=>c.setItem(l,f,u),has:(l,f={})=>c.hasItem(l,f),del:(l,f={})=>c.removeItem(l,f),remove:(l,f={})=>c.removeItem(l,f)};return c}function xU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function EU(t){typeof t.dispose=="function"&&await Mi(t.dispose)}function Xp(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Qee(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Xp(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let Q9;function $x(){return Q9||(Q9=Qee("keyval-store","keyval")),Q9}function CU(t,e=$x()){return e("readonly",r=>Xp(r.get(t)))}function YMe(t,e,r=$x()){return r("readwrite",n=>(n.put(e,t),Xp(n.transaction)))}function QMe(t,e=$x()){return e("readwrite",r=>(r.delete(t),Xp(r.transaction)))}function JMe(t=$x()){return t("readwrite",e=>(e.clear(),Xp(e.transaction)))}function ZMe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Xp(t.transaction)}function XMe(t=$x()){return t("readonly",e=>{if(e.getAllKeys)return Xp(e.getAllKeys());const r=[];return ZMe(e,n=>r.push(n.key)).then(()=>r)})}const eRe="idb-keyval";var tRe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Qee(t.dbName,t.storeName)),{name:eRe,options:t,async hasItem(i){return!(typeof await CU(r(i),n)>"u")},async getItem(i){return await CU(r(i),n)??null},setItem(i,s){return YMe(r(i),s,n)},removeItem(i){return QMe(r(i),n)},getKeys(){return XMe(n)},clear(){return JMe(n)}}};const rRe="WALLET_CONNECT_V2_INDEXED_DB",nRe="keyvaluestorage";let iRe=class{constructor(){this.indexedDb=KMe({driver:tRe({dbName:rRe,storeName:nRe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Su(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var J9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B3={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof J9<"u"&&J9.localStorage?B3.exports=J9.localStorage:typeof window<"u"&&window.localStorage?B3.exports=window.localStorage:B3.exports=new e})();function sRe(t){var e;return[t[0],Lp((e=t[1])!=null?e:"")]}let oRe=class{constructor(){this.localStorage=B3.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(sRe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Lp(r)}async setItem(e,r){this.localStorage.setItem(e,Su(r))}async removeItem(e){this.localStorage.removeItem(e)}};const aRe="wc_storage_version",AU=1,cRe=async(t,e,r)=>{const n=aRe,i=await e.getItem(n);if(i&&i>=AU){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,AU),r(e),lRe(t,o)},lRe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let fRe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new oRe;this.storage=e;try{const r=new iRe;cRe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function uRe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var dRe=hRe;function hRe(t,e,r){var n=r&&r.stringify||uRe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?u:0,t.charCodeAt(g+1)){case 100:case 102:if(f>=c||e[f]==null)break;u=c||e[f]==null)break;u=c||e[f]===void 0)break;u",u=g+2,g++;break}l+=n(e[f]),u=g+2,g++;break;case 115:if(f>=c)break;u-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=Dw),Object.defineProperty(c,"levelVal",{get:f}),Object.defineProperty(c,"level",{get:u,set:p});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:wRe(t)};c.levels=Wl.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Dw,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=g,e&&(c._logEvent=yI());function f(){return this.level==="silent"?1/0:this.levels.values[this.level]}function u(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,j1(l,c,"error","log"),j1(l,c,"fatal","error"),j1(l,c,"warn","error"),j1(l,c,"info","log"),j1(l,c,"debug","log"),j1(l,c,"trace","log")}function g(y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},i&&y.serializers&&(b.serializers=y.serializers);const I=b.serializers;if(i&&I){var C=Object.assign({},n,I),S=t.browser.serialize===!0?Object.keys(C):i;delete y.serializers,_E([y],S,C,this._stdErrSerialize)}function O(L){this._childLevel=(L._childLevel|0)+1,this.error=U1(L,y,"error"),this.fatal=U1(L,y,"fatal"),this.warn=U1(L,y,"warn"),this.info=U1(L,y,"info"),this.debug=U1(L,y,"debug"),this.trace=U1(L,y,"trace"),C&&(this.serializers=C,this._serialize=S),e&&(this._logEvent=yI([].concat(L._logEvent.bindings,y)))}return O.prototype=this,new O(this)}return c}Wl.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Wl.stdSerializers=pRe;Wl.stdTimeFunctions=Object.assign({},{nullTime:Jee,epochTime:Zee,unixTime:xRe,isoTime:ERe});function j1(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Dw:i[r]?i[r]:Ow[r]||Ow[n]||Dw,gRe(t,e,r)}function gRe(t,e,r){!t.transmit&&e[r]===Dw||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ow?Ow:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function U1(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},Xee=class{constructor(e,r=VM){this.level=e??"error",this.levelValue=G1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new _U(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===G1.levels.values.error?console.error(e):r===G1.levels.values.warn?console.warn(e):r===G1.levels.values.debug?console.debug(e):r===G1.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Su({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new _U(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Su({extraMetadata:e})),new Blob(r,{type:"application/json"})}},_Re=class{constructor(e,r=VM){this.baseChunkLogger=new Xee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},IRe=class{constructor(e,r=VM){this.baseChunkLogger=new Xee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var TRe=Object.defineProperty,PRe=Object.defineProperties,kRe=Object.getOwnPropertyDescriptors,IU=Object.getOwnPropertySymbols,MRe=Object.prototype.hasOwnProperty,RRe=Object.prototype.propertyIsEnumerable,TU=(t,e,r)=>e in t?TRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f4=(t,e)=>{for(var r in e||(e={}))MRe.call(e,r)&&TU(t,r,e[r]);if(IU)for(var r of IU(e))RRe.call(e,r)&&TU(t,r,e[r]);return t},u4=(t,e)=>PRe(t,kRe(e));function IE(t){return u4(f4({},t),{level:(t==null?void 0:t.level)||ARe.level})}function ORe(t,e=Vx){return t[e]||""}function DRe(t,e,r=Vx){return t[r]=e,t}function Lo(t,e=Vx){let r="";return typeof t.bindings>"u"?r=ORe(t,e):r=t.bindings().context||"",r}function NRe(t,e,r=Vx){const n=Lo(t,r);return n.trim()?`${n}/${e}`:e}function so(t,e,r=Vx){const n=NRe(t,e,r),i=t.child({context:n});return DRe(i,n,r)}function BRe(t){var e,r;const n=new _Re((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:qx(u4(f4({},t.opts),{level:"trace",browser:u4(f4({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function LRe(t){var e;const r=new IRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:qx(u4(f4({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function FRe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?BRe(t):LRe(t)}let jRe=class extends Zp{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},URe=class extends Zp{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},$Re=class{constructor(e,r){this.logger=e,this.core=r}},qRe=class extends Zp{constructor(e,r){super(),this.relayer=e,this.logger=r}},VRe=class extends Zp{constructor(e){super()}},zRe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},HRe=class extends Zp{constructor(e,r){super(),this.relayer=e,this.logger=r}},GRe=class extends Zp{constructor(e,r){super(),this.core=e,this.logger=r}},WRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},KRe=class{constructor(e,r){this.projectId=e,this.logger=r}},YRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},QRe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},JRe=class{constructor(e){this.client=e}};const ZRe="PARSE_ERROR",XRe="INVALID_REQUEST",eOe="METHOD_NOT_FOUND",tOe="INVALID_PARAMS",ete="INTERNAL_ERROR",zM="SERVER_ERROR",rOe=[-32700,-32600,-32601,-32602,-32603],Lb={[ZRe]:{code:-32700,message:"Parse error"},[XRe]:{code:-32600,message:"Invalid Request"},[eOe]:{code:-32601,message:"Method not found"},[tOe]:{code:-32602,message:"Invalid params"},[ete]:{code:-32603,message:"Internal error"},[zM]:{code:-32e3,message:"Server error"}},tte=zM;function nOe(t){return rOe.includes(t)}function PU(t){return Object.keys(Lb).includes(t)?Lb[t]:Lb[tte]}function iOe(t){const e=Object.values(Lb).find(r=>r.code===t);return e||Lb[tte]}function rte(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var nte={},Cf={},kU;function sOe(){if(kU)return Cf;kU=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.isBrowserCryptoAvailable=Cf.getSubtleCrypto=Cf.getBrowerCrypto=void 0;function t(){return(Si==null?void 0:Si.crypto)||(Si==null?void 0:Si.msCrypto)||{}}Cf.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Cf.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Cf.isBrowserCryptoAvailable=r,Cf}var Af={},MU;function oOe(){if(MU)return Af;MU=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.isBrowser=Af.isNode=Af.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Af.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Af.isNode=e;function r(){return!t()&&!e()}return Af.isBrowser=r,Af}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Px;e.__exportStar(sOe(),t),e.__exportStar(oOe(),t)})(nte);function dd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function B0(t=6){return BigInt(dd(t))}function Ud(t,e,r){return{id:r||dd(),jsonrpc:"2.0",method:t,params:e}}function TE(t,e){return{id:t,jsonrpc:"2.0",result:e}}function PE(t,e,r){return{id:t,jsonrpc:"2.0",error:aOe(e)}}function aOe(t,e){return typeof t>"u"?PU(ete):(typeof t=="string"&&(t=Object.assign(Object.assign({},PU(zM)),{message:t})),nOe(t.code)&&(t=iOe(t.code)),t)}class cOe{}class lOe extends cOe{constructor(){super()}}class fOe extends lOe{constructor(e){super()}}const uOe="^https?:",dOe="^wss?:";function hOe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function ite(t,e){const r=hOe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function RU(t){return ite(t,uOe)}function OU(t){return ite(t,dOe)}function pOe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function ste(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function HM(t){return ste(t)&&"method"in t}function kE(t){return ste(t)&&(xl(t)||Wa(t))}function xl(t){return"result"in t}function Wa(t){return"error"in t}let dc=class extends fOe{constructor(e){super(e),this.events=new ba.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Ud(e.method,e.params||[],e.id||B0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{Wa(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),kE(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const vOe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),gOe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",DU=t=>t.split("?")[0],NU=10,yOe=vOe();let mOe=class{constructor(e){if(this.url=e,this.events=new ba.EventEmitter,this.registering=!1,!OU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Su(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!OU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),s=nte.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!pOe(e)},o=new yOe(e,[],s);gOe()?o.onerror=a=>{const c=a;n(this.emitError(c.error))}:o.on("error",a=>{n(this.emitError(a))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Lp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=PE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return rte(e,DU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>NU&&this.events.setMaxListeners(NU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${DU(this.url)}`));return this.events.emit("register_error",r),r}};var d4={exports:{}};d4.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",u="[object Date]",p="[object Error]",g="[object Function]",y="[object GeneratorFunction]",b="[object Map]",I="[object Number]",C="[object Null]",S="[object Object]",O="[object Promise]",L="[object Proxy]",F="[object RegExp]",z="[object Set]",_="[object String]",$="[object Symbol]",ie="[object Undefined]",ce="[object WeakMap]",K="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",E="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[M]=j[v]=j[m]=j[R]=j[B]=j[E]=j[x]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[P]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[z]=j[_]=j[ce]=!1;var X=typeof Si=="object"&&Si&&Si.Object===Object&&Si,G=typeof self=="object"&&self&&self.Object===Object&&self,Z=X||G||Function("return this")(),ee=e&&!e.nodeType&&e,N=ee&&!0&&t&&!t.nodeType&&t,te=N&&N.exports===ee,fe=te&&X.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Re(le,we){for(var $e=-1,yt=le==null?0:le.length,zr=0,tr=[];++$e-1}function Ti(le,we){var $e=this.__data__,yt=pc($e,le);return yt<0?(++this.size,$e.push([le,we])):$e[yt][1]=we,this}er.prototype.clear=kr,er.prototype.delete=bi,er.prototype.get=wi,er.prototype.has=xi,er.prototype.set=Ti;function Sn(le){var we=-1,$e=le==null?0:le.length;for(this.clear();++we<$e;){var yt=le[we];this.set(yt[0],yt[1])}}function di(){this.size=0,this.__data__={hash:new Ct,map:new(Nt||er),string:new Ct}}function Fs(le){var we=Vo(this,le).delete(le);return this.size-=we?1:0,we}function hi(le){return Vo(this,le).get(le)}function jo(le){return Vo(this,le).has(le)}function Uo(le,we){var $e=Vo(this,le),yt=$e.size;return $e.set(le,we),this.size+=$e.size==yt?0:1,this}Sn.prototype.clear=di,Sn.prototype.delete=Fs,Sn.prototype.get=hi,Sn.prototype.has=jo,Sn.prototype.set=Uo;function pi(le){var we=-1,$e=le==null?0:le.length;for(this.__data__=new Sn;++we<$e;)this.add(le[we])}function oo(le){return this.__data__.set(le,n),this}function ao(le){return this.__data__.has(le)}pi.prototype.add=pi.prototype.push=oo,pi.prototype.has=ao;function _n(le){var we=this.__data__=new er(le);this.size=we.size}function $o(){this.__data__=new er,this.size=0}function Gi(le){var we=this.__data__,$e=we.delete(le);return this.size=we.size,$e}function qo(le){return this.__data__.get(le)}function Ca(le){return this.__data__.has(le)}function co(le,we){var $e=this.__data__;if($e instanceof er){var yt=$e.__data__;if(!Nt||yt.lengthjn))return!1;var en=tr.get(le);if(en&&tr.get(we))return en==we;var Pn=-1,ps=!0,Un=$e&s?new pi:void 0;for(tr.set(le,we),tr.set(we,le);++Pn-1&&le%1==0&&le-1&&le%1==0&&le<=o}function $u(le){var we=typeof le;return le!=null&&(we=="object"||we=="function")}function ff(le){return le!=null&&typeof le=="object"}var a1=_e?et(_e):r1;function zo(le){return Vy(le)?Lh(le):n1(le)}function Wr(){return[]}function Kr(){return!1}t.exports=zy})(d4,d4.exports);var bOe=d4.exports;const wOe=_u(bOe),ote="wc",ate=2,GM="core",nf=`${ote}@2:${GM}:`,xOe={name:GM,logger:"error"},EOe={database:":memory:"},COe="crypto",BU="client_ed25519_seed",AOe=at.ONE_DAY,SOe="keychain",_Oe="0.3",IOe="messages",TOe="0.3",POe=at.SIX_HOURS,kOe="publisher",cte="irn",MOe="error",lte="wss://relay.walletconnect.org",ROe="relayer",Ys={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},OOe="_subscription",Na={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},DOe=.1,mI="2.17.2",vn={link_mode:"link_mode",relay:"relay"},NOe="0.3",BOe="WALLETCONNECT_CLIENT_ID",LU="WALLETCONNECT_LINK_MODE_APPS",El={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},LOe="subscription",FOe="0.3",jOe=at.FIVE_SECONDS*1e3,UOe="pairing",$Oe="0.3",Lm={wc_pairingDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:at.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:at.ONE_DAY,prompt:!1,tag:0},res:{ttl:at.ONE_DAY,prompt:!1,tag:0}}},x0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Sc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},qOe="history",VOe="0.3",zOe="expirer",ja={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},HOe="0.3",GOe="verify-api",WOe="https://verify.walletconnect.com",fte="https://verify.walletconnect.org",Fb=fte,KOe=`${Fb}/v3`,YOe=[WOe,fte],QOe="echo",JOe="https://echo.walletconnect.com",bl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Tf={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},_c={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},c0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},l0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Fm={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},ZOe=.1,XOe="event-client",eDe=86400,tDe="https://pulse.walletconnect.org/batch";function rDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(O);C!==S;){for(var F=y[C],z=0,_=O-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var $=O-I;$!==O&&L[$]===0;)$++;for(var ie=c.repeat(b);$>>0,O=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,O[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&O[_]===0;)_++;for(var $=new Uint8Array(I+(S-_)),ie=I;_!==S;)$[ie++]=O[_++];return $}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var nDe=rDe,iDe=nDe;const ute=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},sDe=t=>new TextEncoder().encode(t),oDe=t=>new TextDecoder().decode(t);class aDe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class cDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),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 dte(this,e)}}class lDe{constructor(e){this.decoders=e}or(e){return dte(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const dte=(t,e)=>new lDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class fDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new aDe(e,r,n),this.decoder=new cDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ME=({name:t,prefix:e,encode:r,decode:n})=>new fDe(t,e,r,n),zx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=iDe(r,e);return ME({prefix:t,name:e,encode:n,decode:s=>ute(i(s))})},uDe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},dDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<ME({prefix:e,name:t,encode(i){return dDe(i,n,r)},decode(i){return uDe(i,n,r,t)}}),hDe=ME({prefix:"\0",name:"identity",encode:t=>oDe(t),decode:t=>sDe(t)});var pDe=Object.freeze({__proto__:null,identity:hDe});const vDe=us({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var gDe=Object.freeze({__proto__:null,base2:vDe});const yDe=us({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var mDe=Object.freeze({__proto__:null,base8:yDe});const bDe=zx({prefix:"9",name:"base10",alphabet:"0123456789"});var wDe=Object.freeze({__proto__:null,base10:bDe});const xDe=us({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),EDe=us({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var CDe=Object.freeze({__proto__:null,base16:xDe,base16upper:EDe});const ADe=us({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),SDe=us({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_De=us({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),IDe=us({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),TDe=us({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),PDe=us({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kDe=us({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),MDe=us({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),RDe=us({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ODe=Object.freeze({__proto__:null,base32:ADe,base32upper:SDe,base32pad:_De,base32padupper:IDe,base32hex:TDe,base32hexupper:PDe,base32hexpad:kDe,base32hexpadupper:MDe,base32z:RDe});const DDe=zx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),NDe=zx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var BDe=Object.freeze({__proto__:null,base36:DDe,base36upper:NDe});const LDe=zx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),FDe=zx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var jDe=Object.freeze({__proto__:null,base58btc:LDe,base58flickr:FDe});const UDe=us({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),$De=us({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qDe=us({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VDe=us({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var zDe=Object.freeze({__proto__:null,base64:UDe,base64pad:$De,base64url:qDe,base64urlpad:VDe});const hte=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),HDe=hte.reduce((t,e,r)=>(t[r]=e,t),[]),GDe=hte.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function WDe(t){return t.reduce((e,r)=>(e+=HDe[r],e),"")}function KDe(t){const e=[];for(const r of t){const n=GDe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const YDe=ME({prefix:"🚀",name:"base256emoji",encode:WDe,decode:KDe});var QDe=Object.freeze({__proto__:null,base256emoji:YDe}),JDe=pte,FU=128,ZDe=127,XDe=~ZDe,eNe=Math.pow(2,31);function pte(t,e,r){e=e||[],r=r||0;for(var n=r;t>=eNe;)e[r++]=t&255|FU,t/=128;for(;t&XDe;)e[r++]=t&255|FU,t>>>=7;return e[r]=t|0,pte.bytes=r-n+1,e}var tNe=bI,rNe=128,jU=127;function bI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw bI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&jU)<=rNe);return bI.bytes=s-n,r}var nNe=Math.pow(2,7),iNe=Math.pow(2,14),sNe=Math.pow(2,21),oNe=Math.pow(2,28),aNe=Math.pow(2,35),cNe=Math.pow(2,42),lNe=Math.pow(2,49),fNe=Math.pow(2,56),uNe=Math.pow(2,63),dNe=function(t){return t(vte.encode(t,e,r),e),$U=t=>vte.encodingLength(t),wI=(t,e)=>{const r=e.byteLength,n=$U(t),i=n+$U(r),s=new Uint8Array(i+r);return UU(t,s,0),UU(r,s,n),s.set(e,i),new pNe(t,r,e,s)};class pNe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const gte=({name:t,code:e,encode:r})=>new vNe(t,e,r);let vNe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?wI(this.code,r):r.then(n=>wI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const yte=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),gNe=gte({name:"sha2-256",code:18,encode:yte("SHA-256")}),yNe=gte({name:"sha2-512",code:19,encode:yte("SHA-512")});var mNe=Object.freeze({__proto__:null,sha256:gNe,sha512:yNe});const mte=0,bNe="identity",bte=ute,wNe=t=>wI(mte,bte(t)),xNe={code:mte,name:bNe,encode:bte,digest:wNe};var ENe=Object.freeze({__proto__:null,identity:xNe});new TextEncoder,new TextDecoder;const qU={...pDe,...gDe,...mDe,...wDe,...CDe,...ODe,...BDe,...jDe,...zDe,...QDe};({...mNe,...ENe});function CNe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function wte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const VU=wte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),X9=wte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=CNe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=it("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=so(r,this.name)}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Dee(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nee(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}let INe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=COe,this.randomSessionIdentifier=pI(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Kj(i);return kee(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Mke();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Kj(s),a=this.randomSessionIdentifier;return await UPe(a,i,AOe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Rke(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||D3(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=Hee(o),c=Su(s);if(cU(a))return Dke(c,o==null?void 0:o.encoding);if(aU(a)){const p=a.senderPublicKey,g=a.receiverPublicKey;i=await this.generateSharedKey(p,g)}const l=this.getSymKey(i),{type:f,senderPublicKey:u}=a;return Oke({type:f,symKey:l,message:c,senderPublicKey:u,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Lke(s,o);if(cU(a)){const c=Bke(s,o==null?void 0:o.encoding);return Lp(c)}if(aU(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=Nke({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return Lp(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=jd)=>{const o=Mw({encoded:i,encoding:s});return jp(o.type)},this.getPayloadSenderPublicKey=(i,s=jd)=>{const o=Mw({encoded:i,encoding:s});return o.senderPublicKey?ji(o.senderPublicKey,eo):void 0},this.core=e,this.logger=so(r,this.name),this.keychain=n||new _Ne(this.core,this.logger)}get context(){return Lo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(BU)}catch{e=pI(),await this.keychain.set(BU,e)}return SNe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}};class TNe extends $Re{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=IOe,this.version=TOe,this.initialized=!1,this.storagePrefix=nf,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Bf(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Bf(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=so(e,this.name),this.core=r}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Dee(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Nee(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class PNe extends qRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ba.EventEmitter,this.name=kOe,this.queue=new Map,this.publishTimeout=at.toMiliseconds(at.ONE_MINUTE),this.failedPublishTimeout=at.toMiliseconds(at.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||POe,c=vI(s),l=(s==null?void 0:s.prompt)||!1,f=(s==null?void 0:s.tag)||0,u=(s==null?void 0:s.id)||B0().toString(),p={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:f,id:u,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${u} tag:${f}`,y=Date.now();let b,I=1;try{for(;b===void 0;){if(Date.now()-y>this.publishTimeout)throw new Error(g);this.logger.trace({id:u,attempts:I},`publisher.publish - attempt ${I}`),b=await await zv(this.rpcPublish(n,i,a,c,l,f,u,s==null?void 0:s.attestation).catch(C=>this.logger.warn(C)),this.publishTimeout,g),I++,b||await new Promise(C=>setTimeout(C,this.failedPublishTimeout))}this.relayer.events.emit(Ys.publish,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:n,message:i,opts:s}})}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw C;this.queue.set(u,p)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=so(r,this.name),this.registerEventListeners()}get context(){return Lo(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,f,u,p;const g={method:cb(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return To((l=g.params)==null?void 0:l.prompt)&&((f=g.params)==null||delete f.prompt),To((u=g.params)==null?void 0:u.tag)&&((p=g.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g}),this.relayer.request(g)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on($y.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ys.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ys.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class kNe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var MNe=Object.defineProperty,RNe=Object.defineProperties,ONe=Object.getOwnPropertyDescriptors,zU=Object.getOwnPropertySymbols,DNe=Object.prototype.hasOwnProperty,NNe=Object.prototype.propertyIsEnumerable,HU=(t,e,r)=>e in t?MNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jm=(t,e)=>{for(var r in e||(e={}))DNe.call(e,r)&&HU(t,r,e[r]);if(zU)for(var r of zU(e))NNe.call(e,r)&&HU(t,r,e[r]);return t},eS=(t,e)=>RNe(t,ONe(e));class BNe extends HRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new kNe,this.events=new ba.EventEmitter,this.name=LOe,this.version=FOe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=nf,this.subscribeTimeout=at.toMiliseconds(at.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=vI(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((s,o)=>{const a=new at.Watch;a.start(i);const c=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(c),a.stop(i),s(!0)),a.elapsed(i)>=jOe&&(clearInterval(c),a.stop(i),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=so(r,this.name),this.clientId=""}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=vI(n);await this.rpcUnsubscribe(e,r,i);const s=rn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===vn.relay&&await this.restartToComplete();const s={method:cb(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=Bf(e+this.clientId);if((n==null?void 0:n.transportType)===vn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},at.toMiliseconds(at.ONE_SECOND)),a;const c=await zv(this.relayer.request(s).catch(l=>this.logger.warn(l)),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return c?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ys.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:cb(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await zv(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ys.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:cb(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await zv(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ys.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:cb(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,eS(jm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,jm({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,jm({},r)),this.topicMap.set(r.topic,e),this.events.emit(El.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(El.deleted,eS(jm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(El.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);rf(r)&&this.onBatchSubscribe(r.map((n,i)=>eS(jm({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on($y.pulse,async()=>{await this.checkPending()}),this.events.on(El.created,async e=>{const r=El.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(El.deleted,async e=>{const r=El.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var LNe=Object.defineProperty,GU=Object.getOwnPropertySymbols,FNe=Object.prototype.hasOwnProperty,jNe=Object.prototype.propertyIsEnumerable,WU=(t,e,r)=>e in t?LNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KU=(t,e)=>{for(var r in e||(e={}))FNe.call(e,r)&&WU(t,r,e[r]);if(GU)for(var r of GU(e))jNe.call(e,r)&&WU(t,r,e[r]);return t};class UNe extends VRe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ba.EventEmitter,this.name=ROe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=at.toMiliseconds(at.THIRTY_SECONDS+at.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||B0().toString();await this.toEstablishConnection();try{const o=this.provider.request(r);this.requestsInFlight.set(s,{promise:o,request:r}),this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const a=await new Promise(async(c,l)=>{const f=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(Na.disconnect,f);const u=await o;this.provider.off(Na.disconnect,f),c(u)});return this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(a4())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Ys.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ys.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Na.payload,this.onPayloadHandler),this.provider.on(Na.connect,this.onConnectHandler),this.provider.on(Na.disconnect,this.onDisconnectHandler),this.provider.on(Na.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?so(e.logger,this.name):qx(IE({level:e.logger||MOe})),this.messages=new TNe(this.logger,e.core),this.subscriber=new BNe(this,this.logger),this.publisher=new PNe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||lte,this.projectId=e.projectId,this.bundleId=YPe(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return Lo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:vn.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=f=>{f.topic===e&&(this.subscriber.off(El.created,l),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(El.created,l)}),new Promise(async(f,u)=>{a=await this.subscriber.subscribe(e,KU({internal:{throwOnFailedPublish:o}},r)).catch(p=>{o&&u(p)})||a,f()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await zv(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Na.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Na.disconnect,i),await zv(this.provider.connect(),at.toMiliseconds(at.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{n(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await bU())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=Ei(at.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Ys.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(a4())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new dc(new mOe(XPe({sdkVersion:mI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),HM(e)){if(!e.method.endsWith(OOe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:vn.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(KU({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else kE(e)&&this.events.emit(Ys.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ys.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=TE(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Na.payload,this.onPayloadHandler),this.provider.off(Na.connect,this.onConnectHandler),this.provider.off(Na.disconnect,this.onDisconnectHandler),this.provider.off(Na.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await bU();kMe(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Ys.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},at.toMiliseconds(DOe))))}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var $Ne=Object.defineProperty,YU=Object.getOwnPropertySymbols,qNe=Object.prototype.hasOwnProperty,VNe=Object.prototype.propertyIsEnumerable,QU=(t,e,r)=>e in t?$Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JU=(t,e)=>{for(var r in e||(e={}))qNe.call(e,r)&&QU(t,r,e[r]);if(YU)for(var r of YU(e))VNe.call(e,r)&&QU(t,r,e[r]);return t};class e1 extends zRe{constructor(e,r,n,i=nf,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=NOe,this.cached=[],this.initialized=!1,this.storagePrefix=nf,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!To(o)?this.map.set(this.getKey(o),o):aMe(o)?this.map.set(o.id,o):cMe(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>wOe(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=JU(JU({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=so(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=it("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class zNe{constructor(e,r){this.core=e,this.logger=r,this.name=UOe,this.version=$Oe,this.events=new yM,this.initialized=!1,this.storagePrefix=nf,this.ignoredPayloadTypes=[lu],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=pI(),s=await this.core.crypto.setSymKey(i),o=Ei(at.FIVE_MINUTES),a={protocol:cte},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},l=hU({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(x0.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:l}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[bl.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=dU(n.uri);i.props.properties.topic=s,i.addTrace(bl.pairing_uri_validation_success),i.addTrace(bl.pairing_uri_not_expired);let f;if(this.pairings.keys.includes(s)){if(f=this.pairings.get(s),i.addTrace(bl.existing_pairing),f.active)throw i.setError(Tf.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(bl.pairing_not_expired)}const u=c||Ei(at.FIVE_MINUTES),p={topic:s,relay:a,expiry:u,active:!1,methods:l};this.core.expirer.set(s,u),await this.pairings.set(s,p),i.addTrace(bl.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(x0.create,p),i.addTrace(bl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(bl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Tf.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(g){throw i.setError(Tf.subscribe_pairing_topic_failure),g}return i.addTrace(bl.subscribe_pairing_topic_success),p},this.activate=async({topic:n})=>{this.isInitialized();const i=Ei(at.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=y0();this.events.once(Er("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",rn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return hU({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})},this.sendRequest=async(n,i,s)=>{const o=Ud(i,s),a=await this.core.crypto.encode(n,o),c=Lm[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=TE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=PE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Lm[c.request.method]?Lm[c.request.method].res:Lm.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,rn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>ud(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(x0.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{xl(i)?this.events.emit(Er("pairing_ping",s),{}):Wa(i)&&this.events.emit(Er("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(x0.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=rn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(rn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!xo(n)){const{message:a}=it("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!oMe(n.uri)){const{message:a}=it("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Tf.malformed_pairing_uri),new Error(a)}const o=dU(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=it("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=it("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Tf.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&at.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!xo(n)){const{message:s}=it("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!xo(n)){const{message:s}=it("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ii(n,!1)){const{message:i}=it("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=it("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ud(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=it("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=so(r,this.name),this.pairings=new e1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Lo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ys.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===vn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{HM(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):kE(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(ja.expired,async e=>{const{topic:r}=Lee(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(x0.expire,{topic:r}))})}}class HNe extends URe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ba.EventEmitter,this.name=qOe,this.version=VOe,this.cached=[],this.initialized=!1,this.storagePrefix=nf,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:Ei(at.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Sc.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Wa(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Sc.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(Sc.deleted,s)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=so(r,this.name)}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Ud(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Sc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Sc.created,e=>{const r=Sc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Sc.updated,e=>{const r=Sc.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Sc.deleted,e=>{const r=Sc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on($y.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{at.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Sc.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class GNe extends GRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ba.EventEmitter,this.name=zOe,this.version=HOe,this.cached=[],this.initialized=!1,this.storagePrefix=nf,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(ja.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(ja.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=so(r,this.name)}get context(){return Lo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return eke(e);if(typeof e=="number")return tke(e);const{message:r}=it("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(ja.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=it("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=it("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;at.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(ja.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on($y.pulse,()=>this.checkExpirations()),this.events.on(ja.created,e=>{const r=ja.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ja.expired,e=>{const r=ja.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ja.deleted,e=>{const r=ja.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}}class WNe extends WRe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=GOe,this.verifyUrlV3=KOe,this.storagePrefix=nf,this.version=ate,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&at.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!Lx()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=kx(),f=this.startAbortTimer(at.ONE_SECOND*5),u=await new Promise((p,g)=>{const y=()=>{window.removeEventListener("message",I),l.body.removeChild(b),g("attestation aborted")};this.abortController.signal.addEventListener("abort",y);const b=l.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",y,{signal:this.abortController.signal});const I=C=>{if(C.data&&typeof C.data=="string")try{const S=JSON.parse(C.data);if(S.type==="verify_attestation"){if(dI(S.attestation).payload.id!==o)return;clearInterval(f),l.body.removeChild(b),this.abortController.signal.removeEventListener("abort",y),window.removeEventListener("message",I),p(S.attestation===null?"":S.attestation)}}catch(S){this.logger.warn(S)}};l.body.appendChild(b),window.addEventListener("message",I,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",u),u}catch(l){this.logger.warn(l)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(dI(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(at.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0},this.getVerifyUrl=i=>{let s=i||Fb;return YOe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Fb}`),s=Fb),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(at.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const o=$ke(i,s.publicKey),a={hasExpired:at.toMiliseconds(o.exp)this.abortController.abort(),at.toMiliseconds(e))}}class KNe extends KRe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=QOe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${JOe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=so(r,this.context)}}var YNe=Object.defineProperty,ZU=Object.getOwnPropertySymbols,QNe=Object.prototype.hasOwnProperty,JNe=Object.prototype.propertyIsEnumerable,XU=(t,e,r)=>e in t?YNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e)=>{for(var r in e||(e={}))QNe.call(e,r)&&XU(t,r,e[r]);if(ZU)for(var r of ZU(e))JNe.call(e,r)&&XU(t,r,e[r]);return t};class ZNe extends YRe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=XOe,this.storagePrefix=nf,this.storageVersion=ZOe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!FM())try{const i={eventId:eU(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Oee(this.core.relayer.protocol,this.core.relayer.version,mI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=eU(),f=this.core.projectId||"",u=Date.now(),p=Um({eventId:l,timestamp:u,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:f,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p},this.getEvent=i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return Um(Um({},a),this.setMethods(a.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on($y.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{at.fromMiliseconds(Date.now())-at.fromMiliseconds(i.timestamp)>eDe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,Um(Um({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${tDe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${mI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Ree().url,this.logger=so(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var XNe=Object.defineProperty,e$=Object.getOwnPropertySymbols,eBe=Object.prototype.hasOwnProperty,tBe=Object.prototype.propertyIsEnumerable,t$=(t,e,r)=>e in t?XNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,r$=(t,e)=>{for(var r in e||(e={}))eBe.call(e,r)&&t$(t,r,e[r]);if(e$)for(var r of e$(e))tBe.call(e,r)&&t$(t,r,e[r]);return t};let rBe=class xte extends jRe{constructor(e){var r;super(e),this.protocol=ote,this.version=ate,this.name=GM,this.events=new ba.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.dispatchEnvelope=({topic:o,message:a,sessionExists:c})=>{if(!o||!a)return;const l={topic:o,message:a,publishedAt:Date.now(),transportType:vn.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||lte,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=IE({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:xOe.logger}),{logger:i,chunkLoggerController:s}=FRe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=so(i,this.name),this.heartbeat=new DMe,this.crypto=new INe(this,this.logger,e==null?void 0:e.keychain),this.history=new HNe(this,this.logger),this.expirer=new GNe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new fRe(r$(r$({},EOe),e==null?void 0:e.storageOptions)),this.relayer=new UNe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new zNe(this,this.logger),this.verify=new WNe(this,this.logger,this.storage),this.echoClient=new KNe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new ZNe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new xte(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(BOe,n),r}get context(){return Lo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(LU,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(LU)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const nBe=rBe,Ete="wc",Cte=2,Ate="client",WM=`${Ete}@${Cte}:${Ate}:`,tS={name:Ate,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},n$="WALLETCONNECT_DEEPLINK_CHOICE",iBe="proposal",Ste="Proposal expired",sBe="session",$1=at.SEVEN_DAYS,oBe="engine",ki={wc_sessionPropose:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1104},res:{ttl:at.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1106},res:{ttl:at.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1112},res:{ttl:at.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1114},res:{ttl:at.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:at.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:at.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1119}}},rS={min:at.FIVE_MINUTES,max:at.SEVEN_DAYS},vl={idle:"IDLE",active:"ACTIVE"},aBe="request",cBe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],lBe="wc",fBe="auth",uBe="authKeys",dBe="pairingTopics",hBe="requests",RE=`${lBe}@${1.5}:${fBe}:`,L3=`${RE}:PUB_KEY`;var pBe=Object.defineProperty,vBe=Object.defineProperties,gBe=Object.getOwnPropertyDescriptors,i$=Object.getOwnPropertySymbols,yBe=Object.prototype.hasOwnProperty,mBe=Object.prototype.propertyIsEnumerable,s$=(t,e,r)=>e in t?pBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e)=>{for(var r in e||(e={}))yBe.call(e,r)&&s$(t,r,e[r]);if(i$)for(var r of i$(e))mBe.call(e,r)&&s$(t,r,e[r]);return t},Ic=(t,e)=>vBe(t,gBe(e));class bBe extends JRe{constructor(e){super(e),this.name=oBe,this.events=new yM,this.initialized=!1,this.requestQueue={state:vl.idle,queue:[]},this.sessionRequestQueue={state:vl.idle,queue:[]},this.requestQueueDelay=at.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(ki)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Ic(Vn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,f,u=!1;try{l&&(u=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!u){const{topic:L,uri:F}=await this.client.core.pairing.create();l=L,f=F}if(!l){const{message:L}=it("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const p=await this.client.core.crypto.generateKeyPair(),g=ki.wc_sessionPropose.req.ttl||at.FIVE_MINUTES,y=Ei(g),b=Vn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:cte}],proposer:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:l},a&&{sessionProperties:a}),{reject:I,resolve:C,done:S}=y0(g,Ste);this.events.once(Er("session_connect"),async({error:L,session:F})=>{if(L)I(L);else if(F){F.self.publicKey=p;const z=Ic(Vn({},F),{pairingTopic:b.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,transportType:vn.relay});await this.client.session.set(F.topic,z),await this.setExpiry(F.topic,F.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:F.peer.metadata}),this.cleanupDuplicatePairings(z),C(z)}});const O=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:b,throwOnFailedPublish:!0});return await this.setProposal(O,Vn({id:O},b)),{uri:f,approval:S}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[_c.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch($){throw o.setError(c0.no_internet_connection),$}try{await this.isValidProposalId(r==null?void 0:r.id)}catch($){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(c0.proposal_not_found),$}try{await this.isValidApprove(r)}catch($){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(c0.session_approve_namespace_validation_failure),$}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:f,sessionConfig:u}=r,p=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:y,requiredNamespaces:b,optionalNamespaces:I}=p;let C=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});C||(C=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:_c.session_approve_started,properties:{topic:g,trace:[_c.session_approve_started,_c.session_namespaces_validation_success]}}));const S=await this.client.core.crypto.generateKeyPair(),O=y.publicKey,L=await this.client.core.crypto.generateSharedKey(S,O),F=Vn(Vn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:S,metadata:this.client.metadata},expiry:Ei($1)},f&&{sessionProperties:f}),u&&{sessionConfig:u}),z=vn.relay;C.addTrace(_c.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:z})}catch($){throw C.setError(c0.subscribe_session_topic_failure),$}C.addTrace(_c.subscribe_session_topic_success);const _=Ic(Vn({},F),{topic:L,requiredNamespaces:b,optionalNamespaces:I,pairingTopic:g,acknowledged:!1,self:F.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:S,transportType:vn.relay});await this.client.session.set(L,_),C.addTrace(_c.store_session);try{C.addTrace(_c.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:F,throwOnFailedPublish:!0}).catch($=>{throw C==null||C.setError(c0.session_settle_publish_failure),$}),C.addTrace(_c.session_settle_publish_success),C.addTrace(_c.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:S},throwOnFailedPublish:!0}).catch($=>{throw C==null||C.setError(c0.session_approve_publish_failure),$}),C.addTrace(_c.session_approve_publish_success)}catch($){throw this.client.logger.error($),this.client.session.delete(L,rn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),$}return this.client.core.eventClient.deleteEvent({eventId:C.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:y.metadata}),await this.client.proposal.delete(a,rn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(L,Ei($1)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:ki.wc_sessionPropose.reject}),await this.client.proposal.delete(n,rn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(u){throw this.client.logger.error("update() -> isValidUpdate() failed"),u}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=y0(),c=dd(),l=B0().toString(),f=this.client.session.get(n).namespaces;return this.events.once(Er("session_update",c),({error:u})=>{u?a(u):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(u=>{this.client.logger.error(u),this.client.session.update(n,{namespaces:f}),a(u)}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=dd(),{done:s,resolve:o,reject:a}=y0();return this.events.once(Er("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,Ei($1)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:s,expiry:o=ki.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===vn.relay&&await this.confirmOnlineStateOrThrow();const c=dd(),l=B0().toString(),{done:f,resolve:u,reject:p}=y0(o,"Request expired. Please try again.");this.events.once(Er("session_request",c),({error:y,result:b})=>{y?p(y):u(b)});const g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return g?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ic(Vn({},i),{expiryTimestamp:Ei(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await f()):await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ic(Vn({},i),{expiryTimestamp:Ei(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){const I=await ike(this.client.core.storage,n$);await rke({id:c,topic:s,wcDeepLink:I})}y()}),f()]).then(y=>y[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===vn.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);xl(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):Wa(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=dd(),s=B0().toString(),{done:o,resolve:a,reject:c}=y0();this.events.once(Er("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=B0().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:rn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=it("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>iMe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?vn.link_mode:vn.relay;o===vn.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:f,nonce:u,type:p,exp:g,nbf:y,methods:b=[],expiry:I}=r,C=[...r.resources||[]],{topic:S,uri:O}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:S,uri:O}});const L=await this.client.core.crypto.generateKeyPair(),F=D3(L);if(await Promise.all([this.client.auth.authKeys.set(L3,{responseTopic:F,publicKey:L}),this.client.auth.pairingTopics.set(F,{topic:F,pairingTopic:S})]),await this.client.core.relayer.subscribe(F,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${S}`),b.length>0){const{namespace:E}=Vv(a[0]);let x=Ske(E,"request",b);O3(C)&&(x=Ike(x,C.pop())),C.push(x)}const z=I&&I>ki.wc_sessionAuthenticate.req.ttl?I:ki.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:p??"caip122",chains:a,statement:c,aud:l,domain:f,version:"1",nonce:u,iat:new Date().toISOString(),exp:g,nbf:y,resources:C},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:Ei(z)},$={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},ie={requiredNamespaces:{},optionalNamespaces:$,relays:[{protocol:"irn"}],pairingTopic:S,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:Ei(ki.wc_sessionPropose.req.ttl)},{done:ce,resolve:K,reject:P}=y0(z,"Request expired"),M=async({error:E,session:x})=>{if(this.events.off(Er("session_request",m),v),E)P(E);else if(x){x.self.publicKey=L,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:x.peer.metadata});const w=this.client.session.get(x.topic);await this.deleteProposal(R),K({session:w})}},v=async E=>{var x,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),E.error){const Z=rn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return E.error.code===Z.code?void 0:(this.events.off(Er("session_connect"),M),P(E.error.message))}await this.deleteProposal(R),this.events.off(Er("session_connect"),M);const{cacaos:k,responder:H}=E.result,oe=[],j=[];for(const Z of k){await nU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),P(rn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ee}=Z,N=O3(ee.resources),te=[hI(ee.iss)],fe=c4(ee.iss);if(N){const Ee=iU(N),_e=sU(N);oe.push(...Ee),te.push(..._e)}for(const Ee of te)j.push(`${Ee}:${fe}`)}const X=await this.client.core.crypto.generateSharedKey(L,H.publicKey);let G;oe.length>0&&(G={topic:X,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:H,controller:H.publicKey,expiry:Ei($1),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:pU([...new Set(oe)],[...new Set(j)]),transportType:o},await this.client.core.relayer.subscribe(X,{transportType:o}),await this.client.session.set(X,G),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:H.metadata}),G=this.client.session.get(X)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(w=H.metadata.redirect)!=null&&w.linkMode&&(T=H.metadata.redirect)!=null&&T.universal&&n&&(this.client.core.addLinkModeSupportedApp(H.metadata.redirect.universal),this.client.session.update(X,{transportType:vn.link_mode})),K({auths:k,session:G})},m=dd(),R=dd();this.events.once(Er("session_connect"),M),this.events.once(Er("session_request",m),v);let B;try{if(s){const E=Ud("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,E);const x=await this.client.core.crypto.encode("",E,{type:Ux,encoding:Nm});B=k6(n,S,x)}else await Promise.all([this.sendRequest({topic:S,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:m}),this.sendRequest({topic:S,method:"wc_sessionPropose",params:ie,expiry:ki.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:R})])}catch(E){throw this.events.off(Er("session_connect"),M),this.events.off(Er("session_request",m),v),E}return await this.setProposal(R,Vn({id:R},ie)),await this.setAuthRequest(m,{request:Ic(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:B??O,response:ce}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[l0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(I){throw s.setError(Fm.no_internet_connection),I}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(Fm.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||vn.relay;a===vn.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=D3(c),u={type:lu,receiverPublicKey:c,senderPublicKey:l},p=[],g=[];for(const I of i){if(!await nU({cacao:I,projectId:this.client.core.projectId})){s.setError(Fm.invalid_cacao);const F=rn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:F,encodeOpts:u}),new Error(F.message)}s.addTrace(l0.cacaos_verified);const{p:C}=I,S=O3(C.resources),O=[hI(C.iss)],L=c4(C.iss);if(S){const F=iU(S),z=sU(S);p.push(...F),O.push(...z)}for(const F of O)g.push(`${F}:${L}`)}const y=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(l0.create_authenticated_session_topic);let b;if((p==null?void 0:p.length)>0){b={topic:y,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Ei($1),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:pU([...new Set(p)],[...new Set(g)]),transportType:a},s.addTrace(l0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:a})}catch(I){throw s.setError(Fm.subscribe_authenticated_session_topic_failure),I}s.addTrace(l0.subscribe_authenticated_session_topic_success),await this.client.session.set(y,b),s.addTrace(l0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(l0.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(I){throw s.setError(Fm.authenticated_session_approve_publish_failure),I}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===vn.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=D3(o),l={type:lu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:ki.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,rn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return jee(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,rn("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(n$).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,rn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=vl.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(c0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,rn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=vl.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Ei(ki.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=vn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||Ei(ki.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:f}=r,u=Ud(i,s,c);let p;const g=!!f;try{const I=g?Nm:jd;p=await this.client.core.crypto.encode(n,u,{encoding:I})}catch(I){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),I}let y;if(cBe.includes(i)){const I=Bf(JSON.stringify(u)),C=Bf(p);y=await this.client.core.verify.register({id:C,decryptedId:I})}const b=ki[i].req;if(b.attestation=y,o&&(b.ttl=o),a&&(b.id=a),this.client.core.history.set(n,u),g){const I=k6(f,n,p);await global.Linking.openURL(I,this.client.name)}else{const I=ki[i].req;o&&(I.ttl=o),a&&(I.id=a),l?(I.internal=Ic(Vn({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,p,I)):this.client.core.relayer.publish(n,p,I).catch(C=>this.client.logger.error(C))}return u.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=TE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Nm:jd;f=await this.client.core.crypto.encode(i,l,Ic(Vn({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(u){const g=k6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=ki[p.request.method].res;o?(g.internal=Ic(Vn({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,g)):this.client.core.relayer.publish(i,f,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,l=PE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Nm:jd;f=await this.client.core.crypto.encode(i,l,Ic(Vn({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(u){const g=k6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=a||ki[p.request.method].res;this.client.core.relayer.publish(i,f,g)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;ud(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ud(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===vl.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=vl.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=vl.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=it("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:n});this.isValidConnect(Vn({},i.params));const f=a.expiryTimestamp||Ei(ki.wc_sessionPropose.req.ttl),u=Vn({id:c,pairingTopic:n,expiryTimestamp:f},a);await this.setProposal(c,u);const p=await this.getVerifyContext({attestationId:s,hash:Bf(JSON.stringify(i)),encryptedId:o,metadata:u.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(Tf.proposal_listener_not_found)),l==null||l.addTrace(bl.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:u,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:ki.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(xl(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const f=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const u=await this.client.core.relayer.subscribe(f,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:r})}else if(Wa(n)){await this.client.proposal.delete(s,rn("USER_DISCONNECTED"));const o=Er("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Er("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:f,sessionConfig:u}=n.params,p=Ic(Vn(Vn({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},f&&{sessionProperties:f}),u&&{sessionConfig:u}),{transportType:vn.relay}),g=Er("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Er("session_connect"),{session:p}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;xl(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Er("session_approve",i),{})):Wa(n)&&(await this.client.session.delete(r,rn("USER_DISCONNECTED")),this.events.emit(Er("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:rn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Vn({topic:r},i));try{Bm.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(c){throw Bm.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,s=Er("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);xl(n)?this.events.emit(Er("session_update",i),{}):Wa(n)&&this.events.emit(Er("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Ei($1)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Er("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);xl(n)?this.events.emit(Er("session_extend",i),{}):Wa(n)&&this.events.emit(Er("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Er("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{xl(n)?this.events.emit(Er("session_ping",i),{}):Wa(n)&&this.events.emit(Er("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(Ys.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:rn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:f}=r,{id:u,params:p}=a;try{await this.isValidRequest(Vn({topic:o},p));const g=this.client.session.get(o),y=await this.getVerifyContext({attestationId:c,hash:Bf(JSON.stringify(Ud("wc_sessionRequest",p,u))),encryptedId:l,metadata:g.peer.metadata,transportType:f}),b={id:u,topic:o,params:p,verifyContext:y};await this.setPendingSessionRequest(b),f===vn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(g){await this.sendError({id:u,topic:o,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Er("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);xl(n)?this.events.emit(Er("session_request",i),{result:n.result}):Wa(n)&&this.events.emit(Er("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=Bm.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Vn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),Bm.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),xl(n)?this.events.emit(Er("session_request",i),{result:n.result}):Wa(n)&&this.events.emit(Er("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:l,authPayload:f,expiryTimestamp:u}=s.params,p=await this.getVerifyContext({attestationId:o,hash:Bf(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),g={requester:l,pairingTopic:i,id:s.id,authPayload:f,verifyContext:p,expiryTimestamp:u};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:c}),c===vn.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:p})}catch(l){this.client.logger.error(l);const f=s.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),p=this.getAppLinkIfEnabled(s.params.requester.metadata,c),g={type:lu,receiverPublicKey:f,senderPublicKey:u};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:g,rpcOpts:ki.wc_sessionAuthenticate.autoReject,appLink:p})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=vl.idle,this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Er("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Er("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===vl.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=vl.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Ud("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!xo(r)){const{message:c}=it("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(To(n)||await this.isValidPairingTopic(n),!gMe(a)){const{message:c}=it("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!To(i)&&Rw(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!To(s)&&Rw(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),To(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=vMe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!xo(r))throw new Error(it("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=K9(i,"approve()");if(c)throw new Error(c.message);const l=yU(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!ii(s,!0)){const{message:f}=it("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}To(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!xo(r)){const{message:s}=it("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!mMe(i)){const{message:s}=it("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!xo(r)){const{message:l}=it("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!Wee(n)){const{message:l}=it("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=lMe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=K9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(ud(o)){const{message:l}=it("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!xo(r)){const{message:c}=it("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=K9(i,"update()");if(o)throw new Error(o.message);const a=yU(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!xo(r)){const{message:i}=it("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!xo(r)){const{message:c}=it("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!gU(a,s)){const{message:c}=it("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!bMe(i)){const{message:c}=it("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!EMe(a,s,i.method)){const{message:c}=it("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!_Me(o,rS)){const{message:c}=it("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${rS.min} and ${rS.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!xo(r)){const{message:o}=it("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!wMe(s)){const{message:o}=it("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!xo(r)){const{message:i}=it("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!xo(r)){const{message:a}=it("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!gU(o,s)){const{message:a}=it("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!xMe(i)){const{message:a}=it("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!CMe(o,s,i.name)){const{message:a}=it("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!xo(r)){const{message:i}=it("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ii(i,!1))throw new Error("uri is required parameter");if(!ii(s,!1))throw new Error("domain is required parameter");if(!ii(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Vv(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Vv(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||Fb,validation:"UNKNOWN",origin:o.url||""}};try{if(a===vn.link_mode){const f=this.getAppLinkIfEnabled(o,a);return c.verified.validation=f&&new URL(f).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ii(i,!1)){const{message:s}=it("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=it("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,f,u,p;return!r||n!==vn.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==void 0&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==""&&((p=r==null?void 0:r.redirect)==null?void 0:p.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=Xj(r,"topic")||"",i=decodeURIComponent(Xj(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:vn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(FM()||jy()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=it("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ys.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(L3)?this.client.auth.authKeys.get(L3):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===vn.link_mode?Nm:jd});try{HM(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:Bf(n)})):kE(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on(ja.expired,async e=>{const{topic:r,id:n}=Lee(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,it("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,it("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(x0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(x0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ii(e,!1)){const{message:r}=it("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(ud(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=it("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ii(e,!1)){const{message:r}=it("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(ud(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=it("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=it("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ii(e,!1)){const{message:r}=it("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=it("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!yMe(e)){const{message:r}=it("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=it("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(ud(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=it("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class wBe extends e1{constructor(e,r){super(e,r,iBe,WM),this.core=e,this.logger=r}}let xBe=class extends e1{constructor(e,r){super(e,r,sBe,WM),this.core=e,this.logger=r}};class EBe extends e1{constructor(e,r){super(e,r,aBe,WM,n=>n.id),this.core=e,this.logger=r}}class CBe extends e1{constructor(e,r){super(e,r,uBe,RE,()=>L3),this.core=e,this.logger=r}}class ABe extends e1{constructor(e,r){super(e,r,dBe,RE),this.core=e,this.logger=r}}class SBe extends e1{constructor(e,r){super(e,r,hBe,RE,n=>n.id),this.core=e,this.logger=r}}class _Be{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new CBe(this.core,this.logger),this.pairingTopics=new ABe(this.core,this.logger),this.requests=new SBe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class OE extends QRe{constructor(e){super(e),this.protocol=Ete,this.version=Cte,this.name=tS.name,this.events=new ba.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||tS.name,this.metadata=(e==null?void 0:e.metadata)||Ree(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:qx(IE({level:(e==null?void 0:e.logger)||tS.logger}));this.core=(e==null?void 0:e.core)||new nBe(e),this.logger=so(r,this.name),this.session=new xBe(this.core,this.logger),this.proposal=new wBe(this.core,this.logger),this.pendingRequest=new EBe(this.core,this.logger),this.engine=new bBe(this),this.auth=new _Be(this.core,this.logger)}static async init(e){const r=new OE(e);return await r.initialize(),r}get context(){return Lo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var h4={exports:{}};/** + Approved: ${p.toString()}`))}),o.forEach(u=>{n||(N0(i[u].methods,s[u].methods)?N0(i[u].events,s[u].events)||(n=nt("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${u}`)):n=nt("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${u}`))}),n}function AMe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function vU(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function SMe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=$y(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function _Me(t,e){return jM(t)&&t<=e.max&&t>=e.min}function gU(){const t=Lx();return new Promise(e=>{switch(t){case sa.browser:e(IMe());break;case sa.reactNative:e(TMe());break;case sa.node:e(PMe());break;default:e(!0)}})}function IMe(){return Bx()&&(navigator==null?void 0:navigator.onLine)}async function TMe(){if(Uy()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function PMe(){return!0}function kMe(t){switch(Lx()){case sa.browser:MMe(t);break;case sa.reactNative:RMe(t);break}}function MMe(t){!Uy()&&Bx()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function RMe(t){Uy()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const G9={};let Nm=class{static get(e){return G9[e]}static set(e,r){G9[e]=r}static delete(e){delete G9[e]}};class Zp{}let OMe=class extends Zp{constructor(e){super()}};const yU=at.FIVE_SECONDS,qy={pulse:"heartbeat_pulse"};let DMe=class Hee extends OMe{constructor(e){super(e),this.events=new va.EventEmitter,this.interval=yU,this.interval=(e==null?void 0:e.interval)||yU}static async init(e){const r=new Hee(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),at.toMiliseconds(this.interval))}pulse(){this.events.emit(qy.pulse)}};const NMe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,BMe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,LMe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function FMe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){jMe(t);return}return e}function jMe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function _6(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!LMe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(NMe.test(t)||BMe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,FMe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function UMe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Ti(t,...e){try{return UMe(t(...e))}catch(r){return Promise.reject(r)}}function $Me(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function qMe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function k3(t){if($Me(t))return String(t);if(qMe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return k3(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Gee(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const hI="base64:";function VMe(t){if(typeof t=="string")return t;Gee();const e=Buffer.from(t).toString("base64");return hI+e}function zMe(t){return typeof t!="string"||!t.startsWith(hI)?t:(Gee(),Buffer.from(t.slice(hI.length),"base64"))}function wo(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function HMe(...t){return wo(t.join(":"))}function I6(t){return t=wo(t),t?t+":":""}const GMe="memory",WMe=()=>{const t=new Map;return{name:GMe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function KMe(t={}){const e={mounts:{"":t.driver||WMe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const f of e.mountpoints)if(l.startsWith(f))return{base:f,relativeKey:l.slice(f.length),driver:e.mounts[f]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,f)=>e.mountpoints.filter(u=>u.startsWith(l)||f&&l.startsWith(u)).map(u=>({relativeBase:l.length>u.length?l.slice(u.length):void 0,mountpoint:u,driver:e.mounts[u]})),i=(l,f)=>{if(e.watching){f=wo(f);for(const u of e.watchListeners)u(l,f)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await mU(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,f,u)=>{const p=new Map,g=y=>{let b=p.get(y.base);return b||(b={driver:y.driver,base:y.base,items:[]},p.set(y.base,b)),b};for(const y of l){const b=typeof y=="string",I=wo(b?y:y.key),C=b?void 0:y.value,S=b||!y.options?f:{...f,...y.options},O=r(I);g(O).items.push({key:I,value:C,relativeKey:O.relativeKey,options:S})}return Promise.all([...p.values()].map(y=>u(y))).then(y=>y.flat())},c={hasItem(l,f={}){l=wo(l);const{relativeKey:u,driver:p}=r(l);return Ti(p.hasItem,u,f)},getItem(l,f={}){l=wo(l);const{relativeKey:u,driver:p}=r(l);return Ti(p.getItem,u,f).then(g=>_6(g))},getItems(l,f){return a(l,f,u=>u.driver.getItems?Ti(u.driver.getItems,u.items.map(p=>({key:p.relativeKey,options:p.options})),f).then(p=>p.map(g=>({key:HMe(u.base,g.key),value:_6(g.value)}))):Promise.all(u.items.map(p=>Ti(u.driver.getItem,p.relativeKey,p.options).then(g=>({key:p.key,value:_6(g)})))))},getItemRaw(l,f={}){l=wo(l);const{relativeKey:u,driver:p}=r(l);return p.getItemRaw?Ti(p.getItemRaw,u,f):Ti(p.getItem,u,f).then(g=>zMe(g))},async setItem(l,f,u={}){if(f===void 0)return c.removeItem(l);l=wo(l);const{relativeKey:p,driver:g}=r(l);g.setItem&&(await Ti(g.setItem,p,k3(f),u),g.watch||i("update",l))},async setItems(l,f){await a(l,f,async u=>{if(u.driver.setItems)return Ti(u.driver.setItems,u.items.map(p=>({key:p.relativeKey,value:k3(p.value),options:p.options})),f);u.driver.setItem&&await Promise.all(u.items.map(p=>Ti(u.driver.setItem,p.relativeKey,k3(p.value),p.options)))})},async setItemRaw(l,f,u={}){if(f===void 0)return c.removeItem(l,u);l=wo(l);const{relativeKey:p,driver:g}=r(l);if(g.setItemRaw)await Ti(g.setItemRaw,p,f,u);else if(g.setItem)await Ti(g.setItem,p,VMe(f),u);else return;g.watch||i("update",l)},async removeItem(l,f={}){typeof f=="boolean"&&(f={removeMeta:f}),l=wo(l);const{relativeKey:u,driver:p}=r(l);p.removeItem&&(await Ti(p.removeItem,u,f),(f.removeMeta||f.removeMata)&&await Ti(p.removeItem,u+"$",f),p.watch||i("remove",l))},async getMeta(l,f={}){typeof f=="boolean"&&(f={nativeOnly:f}),l=wo(l);const{relativeKey:u,driver:p}=r(l),g=Object.create(null);if(p.getMeta&&Object.assign(g,await Ti(p.getMeta,u,f)),!f.nativeOnly){const y=await Ti(p.getItem,u+"$",f).then(b=>_6(b));y&&typeof y=="object"&&(typeof y.atime=="string"&&(y.atime=new Date(y.atime)),typeof y.mtime=="string"&&(y.mtime=new Date(y.mtime)),Object.assign(g,y))}return g},setMeta(l,f,u={}){return this.setItem(l+"$",f,u)},removeMeta(l,f={}){return this.removeItem(l+"$",f)},async getKeys(l,f={}){l=I6(l);const u=n(l,!0);let p=[];const g=[];for(const y of u){const b=await Ti(y.driver.getKeys,y.relativeBase,f);for(const I of b){const C=y.mountpoint+wo(I);p.some(S=>C.startsWith(S))||g.push(C)}p=[y.mountpoint,...p.filter(I=>!I.startsWith(y.mountpoint))]}return l?g.filter(y=>y.startsWith(l)&&y[y.length-1]!=="$"):g.filter(y=>y[y.length-1]!=="$")},async clear(l,f={}){l=I6(l),await Promise.all(n(l,!1).map(async u=>{if(u.driver.clear)return Ti(u.driver.clear,u.relativeBase,f);if(u.driver.removeItem){const p=await u.driver.getKeys(u.relativeBase||"",f);return Promise.all(p.map(g=>u.driver.removeItem(g,f)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>bU(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(f=>f!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,f){if(l=I6(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((u,p)=>p.length-u.length)),e.mounts[l]=f,e.watching&&Promise.resolve(mU(f,i,l)).then(u=>{e.unwatch[l]=u}).catch(console.error),c},async unmount(l,f=!0){l=I6(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),f&&await bU(e.mounts[l]),e.mountpoints=e.mountpoints.filter(u=>u!==l),delete e.mounts[l])},getMount(l=""){l=wo(l)+":";const f=r(l);return{driver:f.driver,base:f.base}},getMounts(l="",f={}){return l=wo(l),n(l,f.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(l,f={})=>c.getKeys(l,f),get:(l,f={})=>c.getItem(l,f),set:(l,f,u={})=>c.setItem(l,f,u),has:(l,f={})=>c.hasItem(l,f),del:(l,f={})=>c.removeItem(l,f),remove:(l,f={})=>c.removeItem(l,f)};return c}function mU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function bU(t){typeof t.dispose=="function"&&await Ti(t.dispose)}function Xp(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Wee(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Xp(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let W9;function Ux(){return W9||(W9=Wee("keyval-store","keyval")),W9}function wU(t,e=Ux()){return e("readonly",r=>Xp(r.get(t)))}function YMe(t,e,r=Ux()){return r("readwrite",n=>(n.put(e,t),Xp(n.transaction)))}function QMe(t,e=Ux()){return e("readwrite",r=>(r.delete(t),Xp(r.transaction)))}function JMe(t=Ux()){return t("readwrite",e=>(e.clear(),Xp(e.transaction)))}function ZMe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Xp(t.transaction)}function XMe(t=Ux()){return t("readonly",e=>{if(e.getAllKeys)return Xp(e.getAllKeys());const r=[];return ZMe(e,n=>r.push(n.key)).then(()=>r)})}const eRe="idb-keyval";var tRe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Wee(t.dbName,t.storeName)),{name:eRe,options:t,async hasItem(i){return!(typeof await wU(r(i),n)>"u")},async getItem(i){return await wU(r(i),n)??null},setItem(i,s){return YMe(r(i),s,n)},removeItem(i){return QMe(r(i),n)},getKeys(){return XMe(n)},clear(){return JMe(n)}}};const rRe="WALLET_CONNECT_V2_INDEXED_DB",nRe="keyvaluestorage";let iRe=class{constructor(){this.indexedDb=KMe({driver:tRe({dbName:rRe,storeName:nRe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Au(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var K9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},M3={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof K9<"u"&&K9.localStorage?M3.exports=K9.localStorage:typeof window<"u"&&window.localStorage?M3.exports=window.localStorage:M3.exports=new e})();function sRe(t){var e;return[t[0],Lp((e=t[1])!=null?e:"")]}let oRe=class{constructor(){this.localStorage=M3.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(sRe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Lp(r)}async setItem(e,r){this.localStorage.setItem(e,Au(r))}async removeItem(e){this.localStorage.removeItem(e)}};const aRe="wc_storage_version",xU=1,cRe=async(t,e,r)=>{const n=aRe,i=await e.getItem(n);if(i&&i>=xU){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,xU),r(e),lRe(t,o)},lRe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let fRe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new oRe;this.storage=e;try{const r=new iRe;cRe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function uRe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var dRe=hRe;function hRe(t,e,r){var n=r&&r.stringify||uRe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?u:0,t.charCodeAt(g+1)){case 100:case 102:if(f>=c||e[f]==null)break;u=c||e[f]==null)break;u=c||e[f]===void 0)break;u",u=g+2,g++;break}l+=n(e[f]),u=g+2,g++;break;case 115:if(f>=c)break;u-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const a=t.level||"info",c=Object.create(r);c.log||(c.log=Ow),Object.defineProperty(c,"levelVal",{get:f}),Object.defineProperty(c,"level",{get:u,set:p});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:wRe(t)};c.levels=$l.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Ow,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=g,e&&(c._logEvent=pI());function f(){return this.level==="silent"?1/0:this.levels.values[this.level]}function u(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,U1(l,c,"error","log"),U1(l,c,"fatal","error"),U1(l,c,"warn","error"),U1(l,c,"info","log"),U1(l,c,"debug","log"),U1(l,c,"trace","log")}function g(y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},i&&y.serializers&&(b.serializers=y.serializers);const I=b.serializers;if(i&&I){var C=Object.assign({},n,I),S=t.browser.serialize===!0?Object.keys(C):i;delete y.serializers,xE([y],S,C,this._stdErrSerialize)}function O(L){this._childLevel=(L._childLevel|0)+1,this.error=$1(L,y,"error"),this.fatal=$1(L,y,"fatal"),this.warn=$1(L,y,"warn"),this.info=$1(L,y,"info"),this.debug=$1(L,y,"debug"),this.trace=$1(L,y,"trace"),C&&(this.serializers=C,this._serialize=S),e&&(this._logEvent=pI([].concat(L._logEvent.bindings,y)))}return O.prototype=this,new O(this)}return c}$l.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};$l.stdSerializers=pRe;$l.stdTimeFunctions=Object.assign({},{nullTime:Kee,epochTime:Yee,unixTime:xRe,isoTime:ERe});function U1(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Ow:i[r]?i[r]:Rw[r]||Rw[n]||Ow,gRe(t,e,r)}function gRe(t,e,r){!t.transmit&&e[r]===Ow||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Rw?Rw:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function $1(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},Qee=class{constructor(e,r=UM){this.level=e??"error",this.levelValue=W1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new CU(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===W1.levels.values.error?console.error(e):r===W1.levels.values.warn?console.warn(e):r===W1.levels.values.debug?console.debug(e):r===W1.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Au({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new CU(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Au({extraMetadata:e})),new Blob(r,{type:"application/json"})}},_Re=class{constructor(e,r=UM){this.baseChunkLogger=new Qee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},IRe=class{constructor(e,r=UM){this.baseChunkLogger=new Qee(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var TRe=Object.defineProperty,PRe=Object.defineProperties,kRe=Object.getOwnPropertyDescriptors,AU=Object.getOwnPropertySymbols,MRe=Object.prototype.hasOwnProperty,RRe=Object.prototype.propertyIsEnumerable,SU=(t,e,r)=>e in t?TRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s4=(t,e)=>{for(var r in e||(e={}))MRe.call(e,r)&&SU(t,r,e[r]);if(AU)for(var r of AU(e))RRe.call(e,r)&&SU(t,r,e[r]);return t},o4=(t,e)=>PRe(t,kRe(e));function EE(t){return o4(s4({},t),{level:(t==null?void 0:t.level)||ARe.level})}function ORe(t,e=qx){return t[e]||""}function DRe(t,e,r=qx){return t[r]=e,t}function Fo(t,e=qx){let r="";return typeof t.bindings>"u"?r=ORe(t,e):r=t.bindings().context||"",r}function NRe(t,e,r=qx){const n=Fo(t,r);return n.trim()?`${n}/${e}`:e}function co(t,e,r=qx){const n=NRe(t,e,r),i=t.child({context:n});return DRe(i,n,r)}function BRe(t){var e,r;const n=new _Re((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:$x(o4(s4({},t.opts),{level:"trace",browser:o4(s4({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function LRe(t){var e;const r=new IRe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:$x(o4(s4({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function FRe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?BRe(t):LRe(t)}let jRe=class extends Zp{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},URe=class extends Zp{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},$Re=class{constructor(e,r){this.logger=e,this.core=r}},qRe=class extends Zp{constructor(e,r){super(),this.relayer=e,this.logger=r}},VRe=class extends Zp{constructor(e){super()}},zRe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},HRe=class extends Zp{constructor(e,r){super(),this.relayer=e,this.logger=r}},GRe=class extends Zp{constructor(e,r){super(),this.core=e,this.logger=r}},WRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},KRe=class{constructor(e,r){this.projectId=e,this.logger=r}},YRe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},QRe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},JRe=class{constructor(e){this.client=e}};const ZRe="PARSE_ERROR",XRe="INVALID_REQUEST",eOe="METHOD_NOT_FOUND",tOe="INVALID_PARAMS",Jee="INTERNAL_ERROR",$M="SERVER_ERROR",rOe=[-32700,-32600,-32601,-32602,-32603],Bb={[ZRe]:{code:-32700,message:"Parse error"},[XRe]:{code:-32600,message:"Invalid Request"},[eOe]:{code:-32601,message:"Method not found"},[tOe]:{code:-32602,message:"Invalid params"},[Jee]:{code:-32603,message:"Internal error"},[$M]:{code:-32e3,message:"Server error"}},Zee=$M;function nOe(t){return rOe.includes(t)}function _U(t){return Object.keys(Bb).includes(t)?Bb[t]:Bb[Zee]}function iOe(t){const e=Object.values(Bb).find(r=>r.code===t);return e||Bb[Zee]}function Xee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var ete={},Ef={},IU;function sOe(){if(IU)return Ef;IU=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.isBrowserCryptoAvailable=Ef.getSubtleCrypto=Ef.getBrowerCrypto=void 0;function t(){return(Ei==null?void 0:Ei.crypto)||(Ei==null?void 0:Ei.msCrypto)||{}}Ef.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Ef.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Ef.isBrowserCryptoAvailable=r,Ef}var Cf={},TU;function oOe(){if(TU)return Cf;TU=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.isBrowser=Cf.isNode=Cf.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Cf.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Cf.isNode=e;function r(){return!t()&&!e()}return Cf.isBrowser=r,Cf}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(sOe(),t),e.__exportStar(oOe(),t)})(ete);function fd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function B0(t=6){return BigInt(fd(t))}function Fd(t,e,r){return{id:r||fd(),jsonrpc:"2.0",method:t,params:e}}function CE(t,e){return{id:t,jsonrpc:"2.0",result:e}}function AE(t,e,r){return{id:t,jsonrpc:"2.0",error:aOe(e)}}function aOe(t,e){return typeof t>"u"?_U(Jee):(typeof t=="string"&&(t=Object.assign(Object.assign({},_U($M)),{message:t})),nOe(t.code)&&(t=iOe(t.code)),t)}class cOe{}class lOe extends cOe{constructor(){super()}}class fOe extends lOe{constructor(e){super()}}const uOe="^https?:",dOe="^wss?:";function hOe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function tte(t,e){const r=hOe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function PU(t){return tte(t,uOe)}function kU(t){return tte(t,dOe)}function pOe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function rte(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function qM(t){return rte(t)&&"method"in t}function SE(t){return rte(t)&&(vl(t)||$a(t))}function vl(t){return"result"in t}function $a(t){return"error"in t}let oc=class extends fOe{constructor(e){super(e),this.events=new va.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Fd(e.method,e.params||[],e.id||B0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{$a(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),SE(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const vOe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),gOe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",MU=t=>t.split("?")[0],RU=10,yOe=vOe();let mOe=class{constructor(e){if(this.url=e,this.events=new va.EventEmitter,this.registering=!1,!kU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Au(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!kU(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),s=ete.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!pOe(e)},o=new yOe(e,[],s);gOe()?o.onerror=a=>{const c=a;n(this.emitError(c.error))}:o.on("error",a=>{n(this.emitError(a))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Lp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=AE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Xee(e,MU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>RU&&this.events.setMaxListeners(RU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${MU(this.url)}`));return this.events.emit("register_error",r),r}};var a4={exports:{}};a4.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",u="[object Date]",p="[object Error]",g="[object Function]",y="[object GeneratorFunction]",b="[object Map]",I="[object Number]",C="[object Null]",S="[object Object]",O="[object Promise]",L="[object Proxy]",F="[object RegExp]",z="[object Set]",_="[object String]",$="[object Symbol]",ie="[object Undefined]",ce="[object WeakMap]",K="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",E="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[M]=j[v]=j[m]=j[R]=j[B]=j[E]=j[x]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[P]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[z]=j[_]=j[ce]=!1;var X=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei,G=typeof self=="object"&&self&&self.Object===Object&&self,Z=X||G||Function("return this")(),ee=e&&!e.nodeType&&e,N=ee&&!0&&t&&!t.nodeType&&t,te=N&&N.exports===ee,fe=te&&X.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Re(le,we){for(var qe=-1,gt=le==null?0:le.length,tn=0,rr=[];++qe-1}function Si(le,we){var qe=this.__data__,gt=rf(qe,le);return gt<0?(++this.size,qe.push([le,we])):qe[gt][1]=we,this}tr.prototype.clear=Rr,tr.prototype.delete=vi,tr.prototype.get=gi,tr.prototype.has=yi,tr.prototype.set=Si;function _n(le){var we=-1,qe=le==null?0:le.length;for(this.clear();++weUn))return!1;var rn=rr.get(le);if(rn&&rr.get(we))return rn==we;var pn=-1,gs=!0,Pn=qe&s?new vs:void 0;for(rr.set(le,we),rr.set(we,le);++pn-1&&le%1==0&&le-1&&le%1==0&&le<=o}function Uh(le){var we=typeof le;return le!=null&&(we=="object"||we=="function")}function lf(le){return le!=null&&typeof le=="object"}var f1=_e?Xe(_e):Bh;function zy(le){return $o(le)?r1(le):i1(le)}function Hr(){return[]}function Kr(){return!1}t.exports=Vy})(a4,a4.exports);var bOe=a4.exports;const wOe=Su(bOe),nte="wc",ite=2,VM="core",Jl=`${nte}@2:${VM}:`,xOe={name:VM,logger:"error"},EOe={database:":memory:"},COe="crypto",OU="client_ed25519_seed",AOe=at.ONE_DAY,SOe="keychain",_Oe="0.3",IOe="messages",TOe="0.3",POe=at.SIX_HOURS,kOe="publisher",ste="irn",MOe="error",ote="wss://relay.walletconnect.org",ROe="relayer",Zs={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},OOe="_subscription",Pa={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},DOe=.1,vI="2.17.2",vn={link_mode:"link_mode",relay:"relay"},NOe="0.3",BOe="WALLETCONNECT_CLIENT_ID",DU="WALLETCONNECT_LINK_MODE_APPS",gl={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},LOe="subscription",FOe="0.3",jOe=at.FIVE_SECONDS*1e3,UOe="pairing",$Oe="0.3",Bm={wc_pairingDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:at.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:at.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:at.ONE_DAY,prompt:!1,tag:0},res:{ttl:at.ONE_DAY,prompt:!1,tag:0}}},x0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},bc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},qOe="history",VOe="0.3",zOe="expirer",Oa={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},HOe="0.3",GOe="verify-api",WOe="https://verify.walletconnect.com",ate="https://verify.walletconnect.org",Lb=ate,KOe=`${Lb}/v3`,YOe=[WOe,ate],QOe="echo",JOe="https://echo.walletconnect.com",hl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},If={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},wc={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},c0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},l0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Lm={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},ZOe=.1,XOe="event-client",eDe=86400,tDe="https://pulse.walletconnect.org/batch";function rDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,L=new Uint8Array(O);C!==S;){for(var F=y[C],z=0,_=O-1;(F!==0||z>>0,L[_]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");I=z,C++}for(var $=O-I;$!==O&&L[$]===0;)$++;for(var ie=c.repeat(b);$>>0,O=new Uint8Array(S);y[b];){var L=r[y.charCodeAt(b)];if(L===255)return;for(var F=0,z=S-1;(L!==0||F>>0,O[z]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=F,b++}if(y[b]!==" "){for(var _=S-C;_!==S&&O[_]===0;)_++;for(var $=new Uint8Array(I+(S-_)),ie=I;_!==S;)$[ie++]=O[_++];return $}}}function g(y){var b=p(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:p,decode:g}}var nDe=rDe,iDe=nDe;const cte=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},sDe=t=>new TextEncoder().encode(t),oDe=t=>new TextDecoder().decode(t);class aDe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class cDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),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 lte(this,e)}}class lDe{constructor(e){this.decoders=e}or(e){return lte(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const lte=(t,e)=>new lDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class fDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new aDe(e,r,n),this.decoder=new cDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const _E=({name:t,prefix:e,encode:r,decode:n})=>new fDe(t,e,r,n),Vx=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=iDe(r,e);return _E({prefix:t,name:e,encode:n,decode:s=>cte(i(s))})},uDe=(t,e,r,n)=>{const i={};for(let f=0;f=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},dDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<_E({prefix:e,name:t,encode(i){return dDe(i,n,r)},decode(i){return uDe(i,n,r,t)}}),hDe=_E({prefix:"\0",name:"identity",encode:t=>oDe(t),decode:t=>sDe(t)});var pDe=Object.freeze({__proto__:null,identity:hDe});const vDe=fs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var gDe=Object.freeze({__proto__:null,base2:vDe});const yDe=fs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var mDe=Object.freeze({__proto__:null,base8:yDe});const bDe=Vx({prefix:"9",name:"base10",alphabet:"0123456789"});var wDe=Object.freeze({__proto__:null,base10:bDe});const xDe=fs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),EDe=fs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var CDe=Object.freeze({__proto__:null,base16:xDe,base16upper:EDe});const ADe=fs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),SDe=fs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_De=fs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),IDe=fs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),TDe=fs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),PDe=fs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kDe=fs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),MDe=fs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),RDe=fs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ODe=Object.freeze({__proto__:null,base32:ADe,base32upper:SDe,base32pad:_De,base32padupper:IDe,base32hex:TDe,base32hexupper:PDe,base32hexpad:kDe,base32hexpadupper:MDe,base32z:RDe});const DDe=Vx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),NDe=Vx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var BDe=Object.freeze({__proto__:null,base36:DDe,base36upper:NDe});const LDe=Vx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),FDe=Vx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var jDe=Object.freeze({__proto__:null,base58btc:LDe,base58flickr:FDe});const UDe=fs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),$De=fs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qDe=fs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VDe=fs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var zDe=Object.freeze({__proto__:null,base64:UDe,base64pad:$De,base64url:qDe,base64urlpad:VDe});const fte=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),HDe=fte.reduce((t,e,r)=>(t[r]=e,t),[]),GDe=fte.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function WDe(t){return t.reduce((e,r)=>(e+=HDe[r],e),"")}function KDe(t){const e=[];for(const r of t){const n=GDe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const YDe=_E({prefix:"🚀",name:"base256emoji",encode:WDe,decode:KDe});var QDe=Object.freeze({__proto__:null,base256emoji:YDe}),JDe=ute,NU=128,ZDe=127,XDe=~ZDe,eNe=Math.pow(2,31);function ute(t,e,r){e=e||[],r=r||0;for(var n=r;t>=eNe;)e[r++]=t&255|NU,t/=128;for(;t&XDe;)e[r++]=t&255|NU,t>>>=7;return e[r]=t|0,ute.bytes=r-n+1,e}var tNe=gI,rNe=128,BU=127;function gI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw gI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&BU)<=rNe);return gI.bytes=s-n,r}var nNe=Math.pow(2,7),iNe=Math.pow(2,14),sNe=Math.pow(2,21),oNe=Math.pow(2,28),aNe=Math.pow(2,35),cNe=Math.pow(2,42),lNe=Math.pow(2,49),fNe=Math.pow(2,56),uNe=Math.pow(2,63),dNe=function(t){return t(dte.encode(t,e,r),e),FU=t=>dte.encodingLength(t),yI=(t,e)=>{const r=e.byteLength,n=FU(t),i=n+FU(r),s=new Uint8Array(i+r);return LU(t,s,0),LU(r,s,n),s.set(e,i),new pNe(t,r,e,s)};class pNe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const hte=({name:t,code:e,encode:r})=>new vNe(t,e,r);let vNe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?yI(this.code,r):r.then(n=>yI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const pte=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),gNe=hte({name:"sha2-256",code:18,encode:pte("SHA-256")}),yNe=hte({name:"sha2-512",code:19,encode:pte("SHA-512")});var mNe=Object.freeze({__proto__:null,sha256:gNe,sha512:yNe});const vte=0,bNe="identity",gte=cte,wNe=t=>yI(vte,gte(t)),xNe={code:vte,name:bNe,encode:gte,digest:wNe};var ENe=Object.freeze({__proto__:null,identity:xNe});new TextEncoder,new TextDecoder;const jU={...pDe,...gDe,...mDe,...wDe,...CDe,...ODe,...BDe,...jDe,...zDe,...QDe};({...mNe,...ENe});function CNe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function yte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const UU=yte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Q9=yte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=CNe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=nt("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=co(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Mee(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ree(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}}let INe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=COe,this.randomSessionIdentifier=uI(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Hj(i);return Iee(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Mke();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Hj(s),a=this.randomSessionIdentifier;return await UPe(a,i,AOe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Rke(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||P3(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=qee(o),c=Au(s);if(sU(a))return Dke(c,o==null?void 0:o.encoding);if(iU(a)){const p=a.senderPublicKey,g=a.receiverPublicKey;i=await this.generateSharedKey(p,g)}const l=this.getSymKey(i),{type:f,senderPublicKey:u}=a;return Oke({type:f,symKey:l,message:c,senderPublicKey:u,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=Lke(s,o);if(sU(a)){const c=Bke(s,o==null?void 0:o.encoding);return Lp(c)}if(iU(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=Nke({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return Lp(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=Ld)=>{const o=kw({encoded:i,encoding:s});return jp(o.type)},this.getPayloadSenderPublicKey=(i,s=Ld)=>{const o=kw({encoded:i,encoding:s});return o.senderPublicKey?Bi(o.senderPublicKey,no):void 0},this.core=e,this.logger=co(r,this.name),this.keychain=n||new _Ne(this.core,this.logger)}get context(){return Fo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(OU)}catch{e=uI(),await this.keychain.set(OU,e)}return SNe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}};class TNe extends $Re{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=IOe,this.version=TOe,this.initialized=!1,this.storagePrefix=Jl,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Nf(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Nf(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=co(e,this.name),this.core=r}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Mee(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Ree(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}}let PNe=class extends qRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new va.EventEmitter,this.name=kOe,this.queue=new Map,this.publishTimeout=at.toMiliseconds(at.ONE_MINUTE),this.failedPublishTimeout=at.toMiliseconds(at.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||POe,c=dI(s),l=(s==null?void 0:s.prompt)||!1,f=(s==null?void 0:s.tag)||0,u=(s==null?void 0:s.id)||B0().toString(),p={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:f,id:u,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${u} tag:${f}`,y=Date.now();let b,I=1;try{for(;b===void 0;){if(Date.now()-y>this.publishTimeout)throw new Error(g);this.logger.trace({id:u,attempts:I},`publisher.publish - attempt ${I}`),b=await await Hv(this.rpcPublish(n,i,a,c,l,f,u,s==null?void 0:s.attestation).catch(C=>this.logger.warn(C)),this.publishTimeout,g),I++,b||await new Promise(C=>setTimeout(C,this.failedPublishTimeout))}this.relayer.events.emit(Zs.publish,p),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:n,message:i,opts:s}})}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw C;this.queue.set(u,p)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=co(r,this.name),this.registerEventListeners()}get context(){return Fo(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,f,u,p;const g={method:ab(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return Po((l=g.params)==null?void 0:l.prompt)&&((f=g.params)==null||delete f.prompt),Po((u=g.params)==null?void 0:u.tag)&&((p=g.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g}),this.relayer.request(g)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(qy.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Zs.connection_stalled);return}this.checkQueue()}),this.relayer.on(Zs.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};class kNe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var MNe=Object.defineProperty,RNe=Object.defineProperties,ONe=Object.getOwnPropertyDescriptors,$U=Object.getOwnPropertySymbols,DNe=Object.prototype.hasOwnProperty,NNe=Object.prototype.propertyIsEnumerable,qU=(t,e,r)=>e in t?MNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fm=(t,e)=>{for(var r in e||(e={}))DNe.call(e,r)&&qU(t,r,e[r]);if($U)for(var r of $U(e))NNe.call(e,r)&&qU(t,r,e[r]);return t},J9=(t,e)=>RNe(t,ONe(e));class BNe extends HRe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new kNe,this.events=new va.EventEmitter,this.name=LOe,this.version=FOe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Jl,this.subscribeTimeout=at.toMiliseconds(at.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=dI(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((s,o)=>{const a=new at.Watch;a.start(i);const c=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(c),a.stop(i),s(!0)),a.elapsed(i)>=jOe&&(clearInterval(c),a.stop(i),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=co(r,this.name),this.clientId=""}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=dI(n);await this.rpcUnsubscribe(e,r,i);const s=sn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===vn.relay&&await this.restartToComplete();const s={method:ab(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=Nf(e+this.clientId);if((n==null?void 0:n.transportType)===vn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},at.toMiliseconds(at.ONE_SECOND)),a;const c=await Hv(this.relayer.request(s).catch(l=>this.logger.warn(l)),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return c?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Zs.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ab(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Hv(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Zs.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:ab(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Hv(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Zs.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:ab(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,J9(Fm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Fm({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,Fm({},r)),this.topicMap.set(r.topic,e),this.events.emit(gl.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=nt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(gl.deleted,J9(Fm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(gl.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=nt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Ql(r)&&this.onBatchSubscribe(r.map((n,i)=>J9(Fm({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(qy.pulse,async()=>{await this.checkPending()}),this.events.on(gl.created,async e=>{const r=gl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(gl.deleted,async e=>{const r=gl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var LNe=Object.defineProperty,VU=Object.getOwnPropertySymbols,FNe=Object.prototype.hasOwnProperty,jNe=Object.prototype.propertyIsEnumerable,zU=(t,e,r)=>e in t?LNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,HU=(t,e)=>{for(var r in e||(e={}))FNe.call(e,r)&&zU(t,r,e[r]);if(VU)for(var r of VU(e))jNe.call(e,r)&&zU(t,r,e[r]);return t};class UNe extends VRe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new va.EventEmitter,this.name=ROe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=at.toMiliseconds(at.THIRTY_SECONDS+at.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||B0().toString();await this.toEstablishConnection();try{const o=this.provider.request(r);this.requestsInFlight.set(s,{promise:o,request:r}),this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const a=await new Promise(async(c,l)=>{const f=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(Pa.disconnect,f);const u=await o;this.provider.off(Pa.disconnect,f),c(u)});return this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(r4())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Zs.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Zs.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Pa.payload,this.onPayloadHandler),this.provider.on(Pa.connect,this.onConnectHandler),this.provider.on(Pa.disconnect,this.onDisconnectHandler),this.provider.on(Pa.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?co(e.logger,this.name):$x(EE({level:e.logger||MOe})),this.messages=new TNe(this.logger,e.core),this.subscriber=new BNe(this,this.logger),this.publisher=new PNe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||ote,this.projectId=e.projectId,this.bundleId=YPe(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return Fo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:vn.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=f=>{f.topic===e&&(this.subscriber.off(gl.created,l),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(gl.created,l)}),new Promise(async(f,u)=>{a=await this.subscriber.subscribe(e,HU({internal:{throwOnFailedPublish:o}},r)).catch(p=>{o&&u(p)})||a,f()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Hv(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Pa.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Pa.disconnect,i),await Hv(this.provider.connect(),at.toMiliseconds(at.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{n(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await gU())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=bi(at.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Zs.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(r4())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new oc(new mOe(XPe({sdkVersion:vI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),qM(e)){if(!e.method.endsWith(OOe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:vn.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(HU({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else SE(e)&&this.events.emit(Zs.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Zs.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=CE(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Pa.payload,this.onPayloadHandler),this.provider.off(Pa.connect,this.onConnectHandler),this.provider.off(Pa.disconnect,this.onDisconnectHandler),this.provider.off(Pa.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await gU();kMe(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Zs.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},at.toMiliseconds(DOe))))}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var $Ne=Object.defineProperty,GU=Object.getOwnPropertySymbols,qNe=Object.prototype.hasOwnProperty,VNe=Object.prototype.propertyIsEnumerable,WU=(t,e,r)=>e in t?$Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KU=(t,e)=>{for(var r in e||(e={}))qNe.call(e,r)&&WU(t,r,e[r]);if(GU)for(var r of GU(e))VNe.call(e,r)&&WU(t,r,e[r]);return t};class e1 extends zRe{constructor(e,r,n,i=Jl,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=NOe,this.cached=[],this.initialized=!1,this.storagePrefix=Jl,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Po(o)?this.map.set(this.getKey(o),o):aMe(o)?this.map.set(o.id,o):cMe(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>wOe(a[c],o[c]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=KU(KU({},this.getData(o)),a);this.map.set(o,c),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=co(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=nt("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=nt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=nt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}}class zNe{constructor(e,r){this.core=e,this.logger=r,this.name=UOe,this.version=$Oe,this.events=new pM,this.initialized=!1,this.storagePrefix=Jl,this.ignoredPayloadTypes=[cu],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=uI(),s=await this.core.crypto.setSymKey(i),o=bi(at.FIVE_MINUTES),a={protocol:ste},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},l=fU({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(x0.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:l}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[hl.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=lU(n.uri);i.props.properties.topic=s,i.addTrace(hl.pairing_uri_validation_success),i.addTrace(hl.pairing_uri_not_expired);let f;if(this.pairings.keys.includes(s)){if(f=this.pairings.get(s),i.addTrace(hl.existing_pairing),f.active)throw i.setError(If.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(hl.pairing_not_expired)}const u=c||bi(at.FIVE_MINUTES),p={topic:s,relay:a,expiry:u,active:!1,methods:l};this.core.expirer.set(s,u),await this.pairings.set(s,p),i.addTrace(hl.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(x0.create,p),i.addTrace(hl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(hl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(If.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(g){throw i.setError(If.subscribe_pairing_topic_failure),g}return i.addTrace(hl.subscribe_pairing_topic_success),p},this.activate=async({topic:n})=>{this.isInitialized();const i=bi(at.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=y0();this.events.once(Ar("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",sn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return fU({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})},this.sendRequest=async(n,i,s)=>{const o=Fd(i,s),a=await this.core.crypto.encode(n,o),c=Bm[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=CE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Bm[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=AE(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=Bm[c.request.method]?Bm[c.request.method].res:Bm.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>ld(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(x0.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{vl(i)?this.events.emit(Ar("pairing_ping",s),{}):$a(i)&&this.events.emit(Ar("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(x0.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=sn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(sn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!Eo(n)){const{message:a}=nt("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(If.malformed_pairing_uri),new Error(a)}if(!oMe(n.uri)){const{message:a}=nt("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(If.malformed_pairing_uri),new Error(a)}const o=lU(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=nt("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(If.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=nt("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(If.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&at.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Eo(n)){const{message:s}=nt("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Eo(n)){const{message:s}=nt("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ri(n,!1)){const{message:i}=nt("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=nt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ld(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=nt("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=co(r,this.name),this.pairings=new e1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Fo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Zs.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===vn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{qM(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):SE(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(Oa.expired,async e=>{const{topic:r}=Dee(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(x0.expire,{topic:r}))})}}class HNe extends URe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new va.EventEmitter,this.name=qOe,this.version=VOe,this.cached=[],this.initialized=!1,this.storagePrefix=Jl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:bi(at.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(bc.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=$a(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(bc.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(bc.deleted,s)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=co(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Fd(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=nt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(bc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=nt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(bc.created,e=>{const r=bc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(bc.updated,e=>{const r=bc.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(bc.deleted,e=>{const r=bc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(qy.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{at.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(bc.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}}class GNe extends GRe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new va.EventEmitter,this.name=zOe,this.version=HOe,this.cached=[],this.initialized=!1,this.storagePrefix=Jl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Oa.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Oa.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=co(r,this.name)}get context(){return Fo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return eke(e);if(typeof e=="number")return tke(e);const{message:r}=nt("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Oa.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=nt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=nt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;at.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Oa.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(qy.pulse,()=>this.checkExpirations()),this.events.on(Oa.created,e=>{const r=Oa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Oa.expired,e=>{const r=Oa.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Oa.deleted,e=>{const r=Oa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}}class WNe extends WRe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=GOe,this.verifyUrlV3=KOe,this.storagePrefix=Jl,this.version=ite,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&at.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!Bx()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=Px(),f=this.startAbortTimer(at.ONE_SECOND*5),u=await new Promise((p,g)=>{const y=()=>{window.removeEventListener("message",I),l.body.removeChild(b),g("attestation aborted")};this.abortController.signal.addEventListener("abort",y);const b=l.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",y,{signal:this.abortController.signal});const I=C=>{if(C.data&&typeof C.data=="string")try{const S=JSON.parse(C.data);if(S.type==="verify_attestation"){if(lI(S.attestation).payload.id!==o)return;clearInterval(f),l.body.removeChild(b),this.abortController.signal.removeEventListener("abort",y),window.removeEventListener("message",I),p(S.attestation===null?"":S.attestation)}}catch(S){this.logger.warn(S)}};l.body.appendChild(b),window.addEventListener("message",I,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",u),u}catch(l){this.logger.warn(l)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(lI(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(at.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0},this.getVerifyUrl=i=>{let s=i||Lb;return YOe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Lb}`),s=Lb),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(at.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const o=$ke(i,s.publicKey),a={hasExpired:at.toMiliseconds(o.exp)this.abortController.abort(),at.toMiliseconds(e))}}class KNe extends KRe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=QOe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${JOe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=co(r,this.context)}}var YNe=Object.defineProperty,YU=Object.getOwnPropertySymbols,QNe=Object.prototype.hasOwnProperty,JNe=Object.prototype.propertyIsEnumerable,QU=(t,e,r)=>e in t?YNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jm=(t,e)=>{for(var r in e||(e={}))QNe.call(e,r)&&QU(t,r,e[r]);if(YU)for(var r of YU(e))JNe.call(e,r)&&QU(t,r,e[r]);return t};class ZNe extends YRe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=XOe,this.storagePrefix=Jl,this.storageVersion=ZOe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!NM())try{const i={eventId:Jj(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:kee(this.core.relayer.protocol,this.core.relayer.version,vI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=Jj(),f=this.core.projectId||"",u=Date.now(),p=jm({eventId:l,timestamp:u,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:f,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p},this.getEvent=i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return jm(jm({},a),this.setMethods(a.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(qy.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{at.fromMiliseconds(Date.now())-at.fromMiliseconds(i.timestamp)>eDe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,jm(jm({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${tDe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${vI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Pee().url,this.logger=co(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var XNe=Object.defineProperty,JU=Object.getOwnPropertySymbols,eBe=Object.prototype.hasOwnProperty,tBe=Object.prototype.propertyIsEnumerable,ZU=(t,e,r)=>e in t?XNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,XU=(t,e)=>{for(var r in e||(e={}))eBe.call(e,r)&&ZU(t,r,e[r]);if(JU)for(var r of JU(e))tBe.call(e,r)&&ZU(t,r,e[r]);return t};let rBe=class mte extends jRe{constructor(e){var r;super(e),this.protocol=nte,this.version=ite,this.name=VM,this.events=new va.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.dispatchEnvelope=({topic:o,message:a,sessionExists:c})=>{if(!o||!a)return;const l={topic:o,message:a,publishedAt:Date.now(),transportType:vn.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||ote,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=EE({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:xOe.logger}),{logger:i,chunkLoggerController:s}=FRe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=co(i,this.name),this.heartbeat=new DMe,this.crypto=new INe(this,this.logger,e==null?void 0:e.keychain),this.history=new HNe(this,this.logger),this.expirer=new GNe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new fRe(XU(XU({},EOe),e==null?void 0:e.storageOptions)),this.relayer=new UNe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new zNe(this,this.logger),this.verify=new WNe(this,this.logger,this.storage),this.echoClient=new KNe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new ZNe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new mte(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(BOe,n),r}get context(){return Fo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(DU,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(DU)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const nBe=rBe,bte="wc",wte=2,xte="client",zM=`${bte}@${wte}:${xte}:`,Z9={name:xte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},e$="WALLETCONNECT_DEEPLINK_CHOICE",iBe="proposal",Ete="Proposal expired",sBe="session",q1=at.SEVEN_DAYS,oBe="engine",Ii={wc_sessionPropose:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1104},res:{ttl:at.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1106},res:{ttl:at.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:at.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1112},res:{ttl:at.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:at.ONE_DAY,prompt:!1,tag:1114},res:{ttl:at.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:at.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:at.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:at.FIVE_MINUTES,prompt:!1,tag:1119}}},X9={min:at.FIVE_MINUTES,max:at.SEVEN_DAYS},ll={idle:"IDLE",active:"ACTIVE"},aBe="request",cBe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],lBe="wc",fBe="auth",uBe="authKeys",dBe="pairingTopics",hBe="requests",IE=`${lBe}@${1.5}:${fBe}:`,R3=`${IE}:PUB_KEY`;var pBe=Object.defineProperty,vBe=Object.defineProperties,gBe=Object.getOwnPropertyDescriptors,t$=Object.getOwnPropertySymbols,yBe=Object.prototype.hasOwnProperty,mBe=Object.prototype.propertyIsEnumerable,r$=(t,e,r)=>e in t?pBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e)=>{for(var r in e||(e={}))yBe.call(e,r)&&r$(t,r,e[r]);if(t$)for(var r of t$(e))mBe.call(e,r)&&r$(t,r,e[r]);return t},xc=(t,e)=>vBe(t,gBe(e));class bBe extends JRe{constructor(e){super(e),this.name=oBe,this.events=new pM,this.initialized=!1,this.requestQueue={state:ll.idle,queue:[]},this.sessionRequestQueue={state:ll.idle,queue:[]},this.requestQueueDelay=at.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Ii)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=xc(Vn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,f,u=!1;try{l&&(u=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!u){const{topic:L,uri:F}=await this.client.core.pairing.create();l=L,f=F}if(!l){const{message:L}=nt("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const p=await this.client.core.crypto.generateKeyPair(),g=Ii.wc_sessionPropose.req.ttl||at.FIVE_MINUTES,y=bi(g),b=Vn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:ste}],proposer:{publicKey:p,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:l},a&&{sessionProperties:a}),{reject:I,resolve:C,done:S}=y0(g,Ete);this.events.once(Ar("session_connect"),async({error:L,session:F})=>{if(L)I(L);else if(F){F.self.publicKey=p;const z=xc(Vn({},F),{pairingTopic:b.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,transportType:vn.relay});await this.client.session.set(F.topic,z),await this.setExpiry(F.topic,F.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:F.peer.metadata}),this.cleanupDuplicatePairings(z),C(z)}});const O=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:b,throwOnFailedPublish:!0});return await this.setProposal(O,Vn({id:O},b)),{uri:f,approval:S}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[wc.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch($){throw o.setError(c0.no_internet_connection),$}try{await this.isValidProposalId(r==null?void 0:r.id)}catch($){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(c0.proposal_not_found),$}try{await this.isValidApprove(r)}catch($){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(c0.session_approve_namespace_validation_failure),$}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:f,sessionConfig:u}=r,p=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:y,requiredNamespaces:b,optionalNamespaces:I}=p;let C=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});C||(C=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:wc.session_approve_started,properties:{topic:g,trace:[wc.session_approve_started,wc.session_namespaces_validation_success]}}));const S=await this.client.core.crypto.generateKeyPair(),O=y.publicKey,L=await this.client.core.crypto.generateSharedKey(S,O),F=Vn(Vn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:S,metadata:this.client.metadata},expiry:bi(q1)},f&&{sessionProperties:f}),u&&{sessionConfig:u}),z=vn.relay;C.addTrace(wc.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:z})}catch($){throw C.setError(c0.subscribe_session_topic_failure),$}C.addTrace(wc.subscribe_session_topic_success);const _=xc(Vn({},F),{topic:L,requiredNamespaces:b,optionalNamespaces:I,pairingTopic:g,acknowledged:!1,self:F.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:S,transportType:vn.relay});await this.client.session.set(L,_),C.addTrace(wc.store_session);try{C.addTrace(wc.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:F,throwOnFailedPublish:!0}).catch($=>{throw C==null||C.setError(c0.session_settle_publish_failure),$}),C.addTrace(wc.session_settle_publish_success),C.addTrace(wc.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:S},throwOnFailedPublish:!0}).catch($=>{throw C==null||C.setError(c0.session_approve_publish_failure),$}),C.addTrace(wc.session_approve_publish_success)}catch($){throw this.client.logger.error($),this.client.session.delete(L,sn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),$}return this.client.core.eventClient.deleteEvent({eventId:C.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:y.metadata}),await this.client.proposal.delete(a,sn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(L,bi(q1)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:Ii.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(u){throw this.client.logger.error("update() -> isValidUpdate() failed"),u}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=y0(),c=fd(),l=B0().toString(),f=this.client.session.get(n).namespaces;return this.events.once(Ar("session_update",c),({error:u})=>{u?a(u):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(u=>{this.client.logger.error(u),this.client.session.update(n,{namespaces:f}),a(u)}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=fd(),{done:s,resolve:o,reject:a}=y0();return this.events.once(Ar("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,bi(q1)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:s,expiry:o=Ii.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===vn.relay&&await this.confirmOnlineStateOrThrow();const c=fd(),l=B0().toString(),{done:f,resolve:u,reject:p}=y0(o,"Request expired. Please try again.");this.events.once(Ar("session_request",c),({error:y,result:b})=>{y?p(y):u(b)});const g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return g?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:xc(Vn({},i),{expiryTimestamp:bi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await f()):await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:xc(Vn({},i),{expiryTimestamp:bi(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){const I=await ike(this.client.core.storage,e$);await rke({id:c,topic:s,wcDeepLink:I})}y()}),f()]).then(y=>y[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===vn.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);vl(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):$a(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=fd(),s=B0().toString(),{done:o,resolve:a,reject:c}=y0();this.events.once(Ar("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=B0().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:sn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=nt("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>iMe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?vn.link_mode:vn.relay;o===vn.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:f,nonce:u,type:p,exp:g,nbf:y,methods:b=[],expiry:I}=r,C=[...r.resources||[]],{topic:S,uri:O}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:S,uri:O}});const L=await this.client.core.crypto.generateKeyPair(),F=P3(L);if(await Promise.all([this.client.auth.authKeys.set(R3,{responseTopic:F,publicKey:L}),this.client.auth.pairingTopics.set(F,{topic:F,pairingTopic:S})]),await this.client.core.relayer.subscribe(F,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${S}`),b.length>0){const{namespace:E}=zv(a[0]);let x=Ske(E,"request",b);T3(C)&&(x=Ike(x,C.pop())),C.push(x)}const z=I&&I>Ii.wc_sessionAuthenticate.req.ttl?I:Ii.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:p??"caip122",chains:a,statement:c,aud:l,domain:f,version:"1",nonce:u,iat:new Date().toISOString(),exp:g,nbf:y,resources:C},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:bi(z)},$={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},ie={requiredNamespaces:{},optionalNamespaces:$,relays:[{protocol:"irn"}],pairingTopic:S,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:bi(Ii.wc_sessionPropose.req.ttl)},{done:ce,resolve:K,reject:P}=y0(z,"Request expired"),M=async({error:E,session:x})=>{if(this.events.off(Ar("session_request",m),v),E)P(E);else if(x){x.self.publicKey=L,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:x.peer.metadata});const w=this.client.session.get(x.topic);await this.deleteProposal(R),K({session:w})}},v=async E=>{var x,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),E.error){const Z=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return E.error.code===Z.code?void 0:(this.events.off(Ar("session_connect"),M),P(E.error.message))}await this.deleteProposal(R),this.events.off(Ar("session_connect"),M);const{cacaos:k,responder:H}=E.result,oe=[],j=[];for(const Z of k){await eU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),P(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ee}=Z,N=T3(ee.resources),te=[fI(ee.iss)],fe=n4(ee.iss);if(N){const Ee=tU(N),_e=rU(N);oe.push(...Ee),te.push(..._e)}for(const Ee of te)j.push(`${Ee}:${fe}`)}const X=await this.client.core.crypto.generateSharedKey(L,H.publicKey);let G;oe.length>0&&(G={topic:X,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:H,controller:H.publicKey,expiry:bi(q1),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:uU([...new Set(oe)],[...new Set(j)]),transportType:o},await this.client.core.relayer.subscribe(X,{transportType:o}),await this.client.session.set(X,G),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:H.metadata}),G=this.client.session.get(X)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(w=H.metadata.redirect)!=null&&w.linkMode&&(T=H.metadata.redirect)!=null&&T.universal&&n&&(this.client.core.addLinkModeSupportedApp(H.metadata.redirect.universal),this.client.session.update(X,{transportType:vn.link_mode})),K({auths:k,session:G})},m=fd(),R=fd();this.events.once(Ar("session_connect"),M),this.events.once(Ar("session_request",m),v);let B;try{if(s){const E=Fd("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,E);const x=await this.client.core.crypto.encode("",E,{type:jx,encoding:Dm});B=S6(n,S,x)}else await Promise.all([this.sendRequest({topic:S,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:m}),this.sendRequest({topic:S,method:"wc_sessionPropose",params:ie,expiry:Ii.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:R})])}catch(E){throw this.events.off(Ar("session_connect"),M),this.events.off(Ar("session_request",m),v),E}return await this.setProposal(R,Vn({id:R},ie)),await this.setAuthRequest(m,{request:xc(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:B??O,response:ce}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[l0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(I){throw s.setError(Lm.no_internet_connection),I}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(Lm.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||vn.relay;a===vn.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=P3(c),u={type:cu,receiverPublicKey:c,senderPublicKey:l},p=[],g=[];for(const I of i){if(!await eU({cacao:I,projectId:this.client.core.projectId})){s.setError(Lm.invalid_cacao);const F=sn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:F,encodeOpts:u}),new Error(F.message)}s.addTrace(l0.cacaos_verified);const{p:C}=I,S=T3(C.resources),O=[fI(C.iss)],L=n4(C.iss);if(S){const F=tU(S),z=rU(S);p.push(...F),O.push(...z)}for(const F of O)g.push(`${F}:${L}`)}const y=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(l0.create_authenticated_session_topic);let b;if((p==null?void 0:p.length)>0){b={topic:y,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:bi(q1),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:uU([...new Set(p)],[...new Set(g)]),transportType:a},s.addTrace(l0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:a})}catch(I){throw s.setError(Lm.subscribe_authenticated_session_topic_failure),I}s.addTrace(l0.subscribe_authenticated_session_topic_success),await this.client.session.set(y,b),s.addTrace(l0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(l0.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(I){throw s.setError(Lm.authenticated_session_approve_publish_failure),I}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===vn.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=P3(o),l={type:cu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:Ii.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Bee(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,sn("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(e$).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,sn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=ll.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(c0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=ll.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,bi(Ii.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=vn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||bi(Ii.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:f}=r,u=Fd(i,s,c);let p;const g=!!f;try{const I=g?Dm:Ld;p=await this.client.core.crypto.encode(n,u,{encoding:I})}catch(I){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),I}let y;if(cBe.includes(i)){const I=Nf(JSON.stringify(u)),C=Nf(p);y=await this.client.core.verify.register({id:C,decryptedId:I})}const b=Ii[i].req;if(b.attestation=y,o&&(b.ttl=o),a&&(b.id=a),this.client.core.history.set(n,u),g){const I=S6(f,n,p);await global.Linking.openURL(I,this.client.name)}else{const I=Ii[i].req;o&&(I.ttl=o),a&&(I.id=a),l?(I.internal=xc(Vn({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,p,I)):this.client.core.relayer.publish(n,p,I).catch(C=>this.client.logger.error(C))}return u.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=CE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ld;f=await this.client.core.crypto.encode(i,l,xc(Vn({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(u){const g=S6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=Ii[p.request.method].res;o?(g.internal=xc(Vn({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,g)):this.client.core.relayer.publish(i,f,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,l=AE(n,s);let f;const u=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=u?Dm:Ld;f=await this.client.core.crypto.encode(i,l,xc(Vn({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let p;try{p=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(u){const g=S6(c,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=a||Ii[p.request.method].res;this.client.core.relayer.publish(i,f,g)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;ld(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ld(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ll.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ll.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=ll.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=nt("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:n});this.isValidConnect(Vn({},i.params));const f=a.expiryTimestamp||bi(Ii.wc_sessionPropose.req.ttl),u=Vn({id:c,pairingTopic:n,expiryTimestamp:f},a);await this.setProposal(c,u);const p=await this.getVerifyContext({attestationId:s,hash:Nf(JSON.stringify(i)),encryptedId:o,metadata:u.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(If.proposal_listener_not_found)),l==null||l.addTrace(hl.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:u,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:Ii.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(vl(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const f=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const u=await this.client.core.relayer.subscribe(f,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:r})}else if($a(n)){await this.client.proposal.delete(s,sn("USER_DISCONNECTED"));const o=Ar("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Ar("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:f,sessionConfig:u}=n.params,p=xc(Vn(Vn({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},f&&{sessionProperties:f}),u&&{sessionConfig:u}),{transportType:vn.relay}),g=Ar("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Ar("session_connect"),{session:p}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;vl(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ar("session_approve",i),{})):$a(n)&&(await this.client.session.delete(r,sn("USER_DISCONNECTED")),this.events.emit(Ar("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=Nm.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Vn({topic:r},i));try{Nm.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(c){throw Nm.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,s=Ar("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_update",i),{}):$a(n)&&this.events.emit(Ar("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,bi(q1)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Ar("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_extend",i),{}):$a(n)&&this.events.emit(Ar("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Ar("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{vl(n)?this.events.emit(Ar("session_ping",i),{}):$a(n)&&this.events.emit(Ar("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(Zs.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:f}=r,{id:u,params:p}=a;try{await this.isValidRequest(Vn({topic:o},p));const g=this.client.session.get(o),y=await this.getVerifyContext({attestationId:c,hash:Nf(JSON.stringify(Fd("wc_sessionRequest",p,u))),encryptedId:l,metadata:g.peer.metadata,transportType:f}),b={id:u,topic:o,params:p,verifyContext:y};await this.setPendingSessionRequest(b),f===vn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(g){await this.sendError({id:u,topic:o,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Ar("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):$a(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=Nm.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Vn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),Nm.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),vl(n)?this.events.emit(Ar("session_request",i),{result:n.result}):$a(n)&&this.events.emit(Ar("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:l,authPayload:f,expiryTimestamp:u}=s.params,p=await this.getVerifyContext({attestationId:o,hash:Nf(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),g={requester:l,pairingTopic:i,id:s.id,authPayload:f,verifyContext:p,expiryTimestamp:u};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:c}),c===vn.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:p})}catch(l){this.client.logger.error(l);const f=s.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),p=this.getAppLinkIfEnabled(s.params.requester.metadata,c),g={type:cu,receiverPublicKey:f,senderPublicKey:u};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:g,rpcOpts:Ii.wc_sessionAuthenticate.autoReject,appLink:p})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ll.idle,this.processSessionRequestQueue()},at.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Ar("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Ar("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ll.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ll.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Fd("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Eo(r)){const{message:c}=nt("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Po(n)||await this.isValidPairingTopic(n),!gMe(a)){const{message:c}=nt("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Po(i)&&Mw(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Po(s)&&Mw(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Po(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=vMe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Eo(r))throw new Error(nt("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=H9(i,"approve()");if(c)throw new Error(c.message);const l=pU(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!ri(s,!0)){const{message:f}=nt("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}Po(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Eo(r)){const{message:s}=nt("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!mMe(i)){const{message:s}=nt("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Eo(r)){const{message:l}=nt("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!zee(n)){const{message:l}=nt("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=lMe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=H9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(ld(o)){const{message:l}=nt("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Eo(r)){const{message:c}=nt("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=H9(i,"update()");if(o)throw new Error(o.message);const a=pU(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Eo(r)){const{message:i}=nt("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Eo(r)){const{message:c}=nt("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!hU(a,s)){const{message:c}=nt("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!bMe(i)){const{message:c}=nt("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!EMe(a,s,i.method)){const{message:c}=nt("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!_Me(o,X9)){const{message:c}=nt("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${X9.min} and ${X9.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!Eo(r)){const{message:o}=nt("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!wMe(s)){const{message:o}=nt("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Eo(r)){const{message:i}=nt("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Eo(r)){const{message:a}=nt("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!hU(o,s)){const{message:a}=nt("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!xMe(i)){const{message:a}=nt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!CMe(o,s,i.name)){const{message:a}=nt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Eo(r)){const{message:i}=nt("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ri(i,!1))throw new Error("uri is required parameter");if(!ri(s,!1))throw new Error("domain is required parameter");if(!ri(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>zv(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=zv(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||Lb,validation:"UNKNOWN",origin:o.url||""}};try{if(a===vn.link_mode){const f=this.getAppLinkIfEnabled(o,a);return c.verified.validation=f&&new URL(f).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ri(i,!1)){const{message:s}=nt("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=nt("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,f,u,p;return!r||n!==vn.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==void 0&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==""&&((p=r==null?void 0:r.redirect)==null?void 0:p.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=Qj(r,"topic")||"",i=decodeURIComponent(Qj(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:vn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(NM()||Uy()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=nt("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Zs.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(R3)?this.client.auth.authKeys.get(R3):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===vn.link_mode?Dm:Ld});try{qM(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:Nf(n)})):SE(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on(Oa.expired,async e=>{const{topic:r,id:n}=Dee(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,nt("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,nt("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(x0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(x0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ri(e,!1)){const{message:r}=nt("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=nt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(ld(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=nt("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ri(e,!1)){const{message:r}=nt("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=nt("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(ld(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=nt("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=nt("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ri(e,!1)){const{message:r}=nt("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=nt("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!yMe(e)){const{message:r}=nt("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=nt("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(ld(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=nt("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class wBe extends e1{constructor(e,r){super(e,r,iBe,zM),this.core=e,this.logger=r}}let xBe=class extends e1{constructor(e,r){super(e,r,sBe,zM),this.core=e,this.logger=r}};class EBe extends e1{constructor(e,r){super(e,r,aBe,zM,n=>n.id),this.core=e,this.logger=r}}class CBe extends e1{constructor(e,r){super(e,r,uBe,IE,()=>R3),this.core=e,this.logger=r}}class ABe extends e1{constructor(e,r){super(e,r,dBe,IE),this.core=e,this.logger=r}}class SBe extends e1{constructor(e,r){super(e,r,hBe,IE,n=>n.id),this.core=e,this.logger=r}}class _Be{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new CBe(this.core,this.logger),this.pairingTopics=new ABe(this.core,this.logger),this.requests=new SBe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class TE extends QRe{constructor(e){super(e),this.protocol=bte,this.version=wte,this.name=Z9.name,this.events=new va.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||Z9.name,this.metadata=(e==null?void 0:e.metadata)||Pee(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:$x(EE({level:(e==null?void 0:e.logger)||Z9.logger}));this.core=(e==null?void 0:e.core)||new nBe(e),this.logger=co(r,this.name),this.session=new xBe(this.core,this.logger),this.proposal=new wBe(this.core,this.logger),this.pendingRequest=new EBe(this.core,this.logger),this.engine=new bBe(this),this.auth=new _Be(this.core,this.logger)}static async init(e){const r=new TE(e);return await r.initialize(),r}get context(){return Fo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var c4={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */h4.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",u=1,p=2,g=4,y=1,b=2,I=1,C=2,S=4,O=8,L=16,F=32,z=64,_=128,$=256,ie=512,ce=30,K="...",P=800,M=16,v=1,m=2,R=3,B=1/0,E=9007199254740991,x=17976931348623157e292,w=NaN,T=4294967295,k=T-1,H=T>>>1,oe=[["ary",_],["bind",I],["bindKey",C],["curry",O],["curryRight",L],["flip",ie],["partial",F],["partialRight",z],["rearg",$]],j="[object Arguments]",X="[object Array]",G="[object AsyncFunction]",Z="[object Boolean]",ee="[object Date]",N="[object DOMException]",te="[object Error]",fe="[object Function]",Ee="[object GeneratorFunction]",_e="[object Map]",Re="[object Number]",Te="[object Null]",De="[object Object]",ze="[object Promise]",et="[object Proxy]",Je="[object RegExp]",ke="[object Set]",Ne="[object String]",tt="[object Symbol]",Ze="[object Undefined]",st="[object WeakMap]",nt="[object WeakSet]",We="[object ArrayBuffer]",lt="[object DataView]",vt="[object Float32Array]",Ke="[object Float64Array]",gt="[object Int8Array]",wt="[object Int16Array]",rt="[object Int32Array]",It="[object Uint8Array]",At="[object Uint8ClampedArray]",Tt="[object Uint16Array]",Xt="[object Uint32Array]",lr=/\b__p \+= '';/g,xt=/\b(__p \+=) '' \+/g,ar=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rr=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,Dt=RegExp(rr.source),Nt=RegExp(kt.source),dt=/<%-([\s\S]+?)%>/g,Lt=/<%([\s\S]+?)%>/g,Mt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/[\\^$.*+?()[\]{}|]/g,Et=RegExp(ht.source),Bt=/^\s+/,He=/\s/,$t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ct=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,Ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rr=/[()=,{}\[\]\/\s]/,Ut=/\\(\\)?/g,Sr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,er=/\w*$/,kr=/^[-+]0x[0-9a-f]+$/i,bi=/^0b[01]+$/i,wi=/^\[object .+?Constructor\]$/,xi=/^0o[0-7]+$/i,Ti=/^(?:0|[1-9]\d*)$/,Sn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,di=/($^)/,Fs=/['\n\r\u2028\u2029\\]/g,hi="\\ud800-\\udfff",jo="\\u0300-\\u036f",Uo="\\ufe20-\\ufe2f",pi="\\u20d0-\\u20ff",oo=jo+Uo+pi,ao="\\u2700-\\u27bf",_n="a-z\\xdf-\\xf6\\xf8-\\xff",$o="\\xac\\xb1\\xd7\\xf7",Gi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qo="\\u2000-\\u206f",Ca=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",co="A-Z\\xc0-\\xd6\\xd8-\\xde",Lh="\\ufe0e\\ufe0f",pc=$o+Gi+qo+Ca,Fh="['’]",cf="["+hi+"]",jh="["+pc+"]",lf="["+oo+"]",Du="\\d+",qy="["+ao+"]",r1="["+_n+"]",n1="[^"+hi+pc+Du+ao+_n+co+"]",Nu="\\ud83c[\\udffb-\\udfff]",Bu="(?:"+lf+"|"+Nu+")",Uh="[^"+hi+"]",Lu="(?:\\ud83c[\\udde6-\\uddff]){2}",Vo="[\\ud800-\\udbff][\\udc00-\\udfff]",ds="["+co+"]",hr="\\u200d",i1="(?:"+r1+"|"+n1+")",Aa="(?:"+ds+"|"+n1+")",hs="(?:"+Fh+"(?:d|ll|m|re|s|t|ve))?",s1="(?:"+Fh+"(?:D|LL|M|RE|S|T|VE))?",$h=Bu+"?",qh="["+Lh+"]?",Fu="(?:"+hr+"(?:"+[Uh,Lu,Vo].join("|")+")"+qh+$h+")*",vc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ju="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",o1=qh+$h+Fu,nl="(?:"+[qy,Lu,Vo].join("|")+")"+o1,Vy="(?:"+[Uh+lf+"?",lf,Lu,Vo,cf].join("|")+")",Uu=RegExp(Fh,"g"),zy=RegExp(lf,"g"),il=RegExp(Nu+"(?="+Nu+")|"+Vy+o1,"g"),lo=RegExp([ds+"?"+r1+"+"+hs+"(?="+[jh,ds,"$"].join("|")+")",Aa+"+"+s1+"(?="+[jh,ds+i1,"$"].join("|")+")",ds+"?"+i1+"+"+hs,ds+"+"+s1,ju,vc,Du,nl].join("|"),"g"),$u=RegExp("["+hr+hi+oo+Lh+"]"),ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,a1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],zo=-1,Wr={};Wr[vt]=Wr[Ke]=Wr[gt]=Wr[wt]=Wr[rt]=Wr[It]=Wr[At]=Wr[Tt]=Wr[Xt]=!0,Wr[j]=Wr[X]=Wr[We]=Wr[Z]=Wr[lt]=Wr[ee]=Wr[te]=Wr[fe]=Wr[_e]=Wr[Re]=Wr[De]=Wr[Je]=Wr[ke]=Wr[Ne]=Wr[st]=!1;var Kr={};Kr[j]=Kr[X]=Kr[We]=Kr[lt]=Kr[Z]=Kr[ee]=Kr[vt]=Kr[Ke]=Kr[gt]=Kr[wt]=Kr[rt]=Kr[_e]=Kr[Re]=Kr[De]=Kr[Je]=Kr[ke]=Kr[Ne]=Kr[tt]=Kr[It]=Kr[At]=Kr[Tt]=Kr[Xt]=!0,Kr[te]=Kr[fe]=Kr[st]=!1;var le={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},we={"&":"&","<":"<",">":">",'"':""","'":"'"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'"},yt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zr=parseFloat,tr=parseInt,ln=typeof Si=="object"&&Si&&Si.Object===Object&&Si,jn=typeof self=="object"&&self&&self.Object===Object&&self,wr=ln||jn||Function("return this")(),en=e&&!e.nodeType&&e,Pn=en&&!0&&t&&!t.nodeType&&t,ps=Pn&&Pn.exports===en,Un=ps&&ln.process,fn=function(){try{var be=Pn&&Pn.require&&Pn.require("util").types;return be||Un&&Un.binding&&Un.binding("util")}catch{}}(),Yn=fn&&fn.isArrayBuffer,Ho=fn&&fn.isDate,js=fn&&fn.isMap,Go=fn&&fn.isRegExp,Vh=fn&&fn.isSet,uf=fn&&fn.isTypedArray;function Qn(be,Oe,Pe){switch(Pe.length){case 0:return be.call(Oe);case 1:return be.call(Oe,Pe[0]);case 2:return be.call(Oe,Pe[0],Pe[1]);case 3:return be.call(Oe,Pe[0],Pe[1],Pe[2])}return be.apply(Oe,Pe)}function LE(be,Oe,Pe,bt){for(var Jt=-1,Nr=be==null?0:be.length;++Jt-1}function Hy(be,Oe,Pe){for(var bt=-1,Jt=be==null?0:be.length;++bt-1;);return Pe}function Qx(be,Oe){for(var Pe=be.length;Pe--&&qu(Oe,be[Pe],0)>-1;);return Pe}function GE(be,Oe){for(var Pe=be.length,bt=0;Pe--;)be[Pe]===Oe&&++bt;return bt}var WE=Yy(le),KE=Yy(we);function YE(be){return"\\"+yt[be]}function QE(be,Oe){return be==null?r:be[Oe]}function zu(be){return $u.test(be)}function JE(be){return ff.test(be)}function ZE(be){for(var Oe,Pe=[];!(Oe=be.next()).done;)Pe.push(Oe.value);return Pe}function Zy(be){var Oe=-1,Pe=Array(be.size);return be.forEach(function(bt,Jt){Pe[++Oe]=[Jt,bt]}),Pe}function hn(be,Oe){return function(Pe){return be(Oe(Pe))}}function gc(be,Oe){for(var Pe=-1,bt=be.length,Jt=0,Nr=[];++Pe-1}function _re(d,h){var A=this.__data__,U=h2(A,d);return U<0?(++this.size,A.push([d,h])):A[U][1]=h,this}pf.prototype.clear=Ere,pf.prototype.delete=Cre,pf.prototype.get=Are,pf.prototype.has=Sre,pf.prototype.set=_re;function vf(d){var h=-1,A=d==null?0:d.length;for(this.clear();++h=h?d:h)),d}function Ia(d,h,A,U,J,se){var he,ye=h&u,Ce=h&p,Fe=h&g;if(A&&(he=J?A(d,U,J,se):A(d)),he!==r)return he;if(!kn(d))return d;var je=nr(d);if(je){if(he=kne(d),!ye)return vo(d,he)}else{var Ve=vs(d),ft=Ve==fe||Ve==Ee;if(Ju(d))return kR(d,ye);if(Ve==De||Ve==j||ft&&!J){if(he=Ce||ft?{}:YR(d),!ye)return Ce?bne(d,qre(he,d)):mne(d,oR(he,d))}else{if(!Kr[Ve])return J?d:{};he=Mne(d,Ve,ye)}}se||(se=new mc);var Rt=se.get(d);if(Rt)return Rt;se.set(d,he),AO(d)?d.forEach(function(Kt){he.add(Ia(Kt,h,A,Kt,d,se))}):EO(d)&&d.forEach(function(Kt,xr){he.set(xr,Ia(Kt,h,A,xr,d,se))});var Wt=Fe?Ce?_C:SC:Ce?yo:Pi,ur=je?r:Wt(d);return fo(ur||d,function(Kt,xr){ur&&(xr=Kt,Kt=d[xr]),nm(he,xr,Ia(Kt,h,A,xr,d,se))}),he}function Vre(d){var h=Pi(d);return function(A){return aR(A,d,h)}}function aR(d,h,A){var U=A.length;if(d==null)return!U;for(d=tn(d);U--;){var J=A[U],se=h[J],he=d[J];if(he===r&&!(J in d)||!se(he))return!1}return!0}function cR(d,h,A){if(typeof d!="function")throw new po(o);return fm(function(){d.apply(r,A)},h)}function im(d,h,A,U){var J=-1,se=c1,he=!0,ye=d.length,Ce=[],Fe=h.length;if(!ye)return Ce;A&&(h=dn(h,Us(A))),U?(se=Hy,he=!1):h.length>=i&&(se=Gh,he=!1,h=new Qh(h));e:for(;++JJ?0:J+A),U=U===r||U>J?J:fr(U),U<0&&(U+=J),U=A>U?0:_O(U);A0&&A(ye)?h>1?Wi(ye,h-1,A,U,J):ol(J,ye):U||(J[J.length]=ye)}return J}var aC=BR(),uR=BR(!0);function ll(d,h){return d&&aC(d,h,Pi)}function cC(d,h){return d&&uR(d,h,Pi)}function v2(d,h){return sl(h,function(A){return wf(d[A])})}function Zh(d,h){h=Yu(h,d);for(var A=0,U=h.length;d!=null&&Ah}function Gre(d,h){return d!=null&&Hr.call(d,h)}function Wre(d,h){return d!=null&&h in tn(d)}function Kre(d,h,A){return d>=pt(h,A)&&d=120&&je.length>=120)?new Qh(he&&je):r}je=d[0];var Ve=-1,ft=ye[0];e:for(;++Ve-1;)ye!==d&&y1.call(ye,Ce,1),y1.call(d,Ce,1);return d}function ER(d,h){for(var A=d?h.length:0,U=A-1;A--;){var J=h[A];if(A==U||J!==se){var se=J;bf(J)?y1.call(d,J,1):mC(d,J)}}return d}function vC(d,h){return d+pe(un()*(h-d+1))}function ane(d,h,A,U){for(var J=-1,se=Qe(ae((h-d)/(A||1)),0),he=Pe(se);se--;)he[U?se:++J]=d,d+=A;return he}function gC(d,h){var A="";if(!d||h<1||h>E)return A;do h%2&&(A+=d),h=pe(h/2),h&&(d+=d);while(h);return A}function pr(d,h){return OC(ZR(d,h,mo),d+"")}function cne(d){return sR(_1(d))}function lne(d,h){var A=_1(d);return _2(A,Jh(h,0,A.length))}function am(d,h,A,U){if(!kn(d))return d;h=Yu(h,d);for(var J=-1,se=h.length,he=se-1,ye=d;ye!=null&&++JJ?0:J+h),A=A>J?J:A,A<0&&(A+=J),J=h>A?0:A-h>>>0,h>>>=0;for(var se=Pe(J);++U>>1,he=d[se];he!==null&&!Ko(he)&&(A?he<=h:he=i){var Fe=h?null:Cne(d);if(Fe)return uo(Fe);he=!1,J=Gh,Ce=new Qh}else Ce=h?[]:ye;e:for(;++U=U?d:Ta(d,h,A)}var PR=q||function(d){return wr.clearTimeout(d)};function kR(d,h){if(h)return d.slice();var A=d.length,U=i2?i2(A):new d.constructor(A);return d.copy(U),U}function EC(d){var h=new d.constructor(d.byteLength);return new v1(h).set(new v1(d)),h}function pne(d,h){var A=h?EC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.byteLength)}function vne(d){var h=new d.constructor(d.source,er.exec(d));return h.lastIndex=d.lastIndex,h}function gne(d){return rm?tn(rm.call(d)):{}}function MR(d,h){var A=h?EC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function RR(d,h){if(d!==h){var A=d!==r,U=d===null,J=d===d,se=Ko(d),he=h!==r,ye=h===null,Ce=h===h,Fe=Ko(h);if(!ye&&!Fe&&!se&&d>h||se&&he&&Ce&&!ye&&!Fe||U&&he&&Ce||!A&&Ce||!J)return 1;if(!U&&!se&&!Fe&&d=ye)return Ce;var Fe=A[U];return Ce*(Fe=="desc"?-1:1)}}return d.index-h.index}function OR(d,h,A,U){for(var J=-1,se=d.length,he=A.length,ye=-1,Ce=h.length,Fe=Qe(se-he,0),je=Pe(Ce+Fe),Ve=!U;++ye1?A[J-1]:r,he=J>2?A[2]:r;for(se=d.length>3&&typeof se=="function"?(J--,se):r,he&&Vs(A[0],A[1],he)&&(se=J<3?r:se,J=1),h=tn(h);++U-1?J[se?h[he]:he]:r}}function jR(d){return mf(function(h){var A=h.length,U=A,J=_a.prototype.thru;for(d&&h.reverse();U--;){var se=h[U];if(typeof se!="function")throw new po(o);if(J&&!he&&A2(se)=="wrapper")var he=new _a([],!0)}for(U=he?U:A;++U1&&Mr.reverse(),je&&Ceye))return!1;var Fe=se.get(d),je=se.get(h);if(Fe&&je)return Fe==h&&je==d;var Ve=-1,ft=!0,Rt=A&b?new Qh:r;for(se.set(d,h),se.set(h,d);++Ve1?"& ":"")+h[U],h=h.join(A>2?", ":" "),d.replace($t,`{ + */c4.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",u=1,p=2,g=4,y=1,b=2,I=1,C=2,S=4,O=8,L=16,F=32,z=64,_=128,$=256,ie=512,ce=30,K="...",P=800,M=16,v=1,m=2,R=3,B=1/0,E=9007199254740991,x=17976931348623157e292,w=NaN,T=4294967295,k=T-1,H=T>>>1,oe=[["ary",_],["bind",I],["bindKey",C],["curry",O],["curryRight",L],["flip",ie],["partial",F],["partialRight",z],["rearg",$]],j="[object Arguments]",X="[object Array]",G="[object AsyncFunction]",Z="[object Boolean]",ee="[object Date]",N="[object DOMException]",te="[object Error]",fe="[object Function]",Ee="[object GeneratorFunction]",_e="[object Map]",Re="[object Number]",Te="[object Null]",De="[object Object]",ze="[object Promise]",Xe="[object Proxy]",Qe="[object RegExp]",ke="[object Set]",Ne="[object String]",et="[object Symbol]",Je="[object Undefined]",it="[object WeakMap]",rt="[object WeakSet]",We="[object ArrayBuffer]",lt="[object DataView]",pt="[object Float32Array]",Ke="[object Float64Array]",vt="[object Int8Array]",bt="[object Int16Array]",tt="[object Int32Array]",_t="[object Uint8Array]",Ct="[object Uint8ClampedArray]",It="[object Uint16Array]",er="[object Uint32Array]",ur=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,lr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ir=/&(?:amp|lt|gt|quot|#39);/g,Pt=/[&<>"']/g,Ot=RegExp(ir.source),Dt=RegExp(Pt.source),dt=/<%-([\s\S]+?)%>/g,Bt=/<%([\s\S]+?)%>/g,kt=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/[\\^$.*+?()[\]{}|]/g,xt=RegExp(ht.source),Nt=/^\s+/,He=/\s/,$t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,Ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dr=/[()=,{}\[\]\/\s]/,Ut=/\\(\\)?/g,Ir=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tr=/\w*$/,Rr=/^[-+]0x[0-9a-f]+$/i,vi=/^0b[01]+$/i,gi=/^\[object .+?Constructor\]$/,yi=/^0o[0-7]+$/i,Si=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,us=/($^)/,ds=/['\n\r\u2028\u2029\\]/g,hs="\\ud800-\\udfff",Vi="\\u0300-\\u036f",ps="\\ufe20-\\ufe2f",vs="\\u20d0-\\u20ff",Us=Vi+ps+vs,lo="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",zi="\\xac\\xb1\\xd7\\xf7",fo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$s="\\u2000-\\u206f",tf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jc="A-Z\\xc0-\\xd6\\xd8-\\xde",r1="\\ufe0e\\ufe0f",rf=zi+fo+$s+tf,nf="['’]",sf="["+hs+"]",Nh="["+rf+"]",of="["+Us+"]",n1="\\d+",Ou="["+lo+"]",Bh="["+In+"]",i1="[^"+hs+rf+n1+lo+In+Jc+"]",cc="\\ud83c[\\udffb-\\udfff]",s1="(?:"+of+"|"+cc+")",gr="[^"+hs+"]",Du="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+Jc+"]",o1="\\u200d",Lh="(?:"+Bh+"|"+i1+")",Uo="(?:"+xn+"|"+i1+")",af="(?:"+nf+"(?:d|ll|m|re|s|t|ve))?",a1="(?:"+nf+"(?:D|LL|M|RE|S|T|VE))?",Nu=s1+"?",c1="["+r1+"]?",Fh="(?:"+o1+"(?:"+[gr,Du,Zc].join("|")+")"+c1+Nu+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l1=c1+Nu+Fh,Xc="(?:"+[Ou,Du,Zc].join("|")+")"+l1,$o="(?:"+[gr+of+"?",of,Du,Zc,sf].join("|")+")",cf=RegExp(nf,"g"),Vy=RegExp(of,"g"),Bu=RegExp(cc+"(?="+cc+")|"+$o+l1,"g"),uo=RegExp([xn+"?"+Bh+"+"+af+"(?="+[Nh,xn,"$"].join("|")+")",Uo+"+"+a1+"(?="+[Nh,xn+Lh,"$"].join("|")+")",xn+"?"+Lh+"+"+af,xn+"+"+a1,jh,lc,n1,Xc].join("|"),"g"),Uh=RegExp("["+o1+hs+Us+r1+"]"),lf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,f1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],zy=-1,Hr={};Hr[pt]=Hr[Ke]=Hr[vt]=Hr[bt]=Hr[tt]=Hr[_t]=Hr[Ct]=Hr[It]=Hr[er]=!0,Hr[j]=Hr[X]=Hr[We]=Hr[Z]=Hr[lt]=Hr[ee]=Hr[te]=Hr[fe]=Hr[_e]=Hr[Re]=Hr[De]=Hr[Qe]=Hr[ke]=Hr[Ne]=Hr[it]=!1;var Kr={};Kr[j]=Kr[X]=Kr[We]=Kr[lt]=Kr[Z]=Kr[ee]=Kr[pt]=Kr[Ke]=Kr[vt]=Kr[bt]=Kr[tt]=Kr[_e]=Kr[Re]=Kr[De]=Kr[Qe]=Kr[ke]=Kr[Ne]=Kr[et]=Kr[_t]=Kr[Ct]=Kr[It]=Kr[er]=!0,Kr[te]=Kr[fe]=Kr[it]=!1;var le={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},we={"&":"&","<":"<",">":">",'"':""","'":"'"},qe={"&":"&","<":"<",">":">",""":'"',"'":"'"},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tn=parseFloat,rr=parseInt,hn=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei,Un=typeof self=="object"&&self&&self.Object===Object&&self,Er=hn||Un||Function("return this")(),rn=e&&!e.nodeType&&e,pn=rn&&!0&&t&&!t.nodeType&&t,gs=pn&&pn.exports===rn,Pn=gs&&hn.process,ln=function(){try{var be=pn&&pn.require&&pn.require("util").types;return be||Pn&&Pn.binding&&Pn.binding("util")}catch{}}(),Hi=ln&&ln.isArrayBuffer,qo=ln&&ln.isDate,qs=ln&&ln.isMap,ba=ln&&ln.isRegExp,$h=ln&&ln.isSet,ff=ln&&ln.isTypedArray;function fi(be,Oe,Pe){switch(Pe.length){case 0:return be.call(Oe);case 1:return be.call(Oe,Pe[0]);case 2:return be.call(Oe,Pe[0],Pe[1]);case 3:return be.call(Oe,Pe[0],Pe[1],Pe[2])}return be.apply(Oe,Pe)}function RE(be,Oe,Pe,mt){for(var Zt=-1,Lr=be==null?0:be.length;++Zt-1}function Hy(be,Oe,Pe){for(var mt=-1,Zt=be==null?0:be.length;++mt-1;);return Pe}function Qx(be,Oe){for(var Pe=be.length;Pe--&&Lu(Oe,be[Pe],0)>-1;);return Pe}function $E(be,Oe){for(var Pe=be.length,mt=0;Pe--;)be[Pe]===Oe&&++mt;return mt}var qE=Ky(le),VE=Ky(we);function zE(be){return"\\"+gt[be]}function HE(be,Oe){return be==null?r:be[Oe]}function Yr(be){return Uh.test(be)}function Jx(be){return lf.test(be)}function fc(be){for(var Oe,Pe=[];!(Oe=be.next()).done;)Pe.push(Oe.value);return Pe}function zh(be){var Oe=-1,Pe=Array(be.size);return be.forEach(function(mt,Zt){Pe[++Oe]=[Zt,mt]}),Pe}function Jy(be,Oe){return function(Pe){return be(Oe(Pe))}}function nr(be,Oe){for(var Pe=-1,mt=be.length,Zt=0,Lr=[];++Pe-1}function _re(d,h){var A=this.__data__,U=c2(A,d);return U<0?(++this.size,A.push([d,h])):A[U][1]=h,this}hf.prototype.clear=Ere,hf.prototype.delete=Cre,hf.prototype.get=Are,hf.prototype.has=Sre,hf.prototype.set=_re;function pf(d){var h=-1,A=d==null?0:d.length;for(this.clear();++h=h?d:h)),d}function xa(d,h,A,U,J,se){var he,ye=h&u,Ce=h&p,Fe=h&g;if(A&&(he=J?A(d,U,J,se):A(d)),he!==r)return he;if(!Mn(d))return d;var je=sr(d);if(je){if(he=kne(d),!ye)return go(d,he)}else{var Ve=ys(d),ft=Ve==fe||Ve==Ee;if(Yu(d))return IR(d,ye);if(Ve==De||Ve==j||ft&&!J){if(he=Ce||ft?{}:GR(d),!ye)return Ce?bne(d,qre(he,d)):mne(d,nR(he,d))}else{if(!Kr[Ve])return J?d:{};he=Mne(d,Ve,ye)}}se||(se=new dc);var Mt=se.get(d);if(Mt)return Mt;se.set(d,he),xO(d)?d.forEach(function(Yt){he.add(xa(Yt,h,A,Yt,d,se))}):bO(d)&&d.forEach(function(Yt,Cr){he.set(Cr,xa(Yt,h,A,Cr,d,se))});var Kt=Fe?Ce?CC:EC:Ce?mo:_i,pr=je?r:Kt(d);return ho(pr||d,function(Yt,Cr){pr&&(Cr=Yt,Yt=d[Cr]),rm(he,Cr,xa(Yt,h,A,Cr,d,se))}),he}function Vre(d){var h=_i(d);return function(A){return iR(A,d,h)}}function iR(d,h,A){var U=A.length;if(d==null)return!U;for(d=nn(d);U--;){var J=A[U],se=h[J],he=d[J];if(he===r&&!(J in d)||!se(he))return!1}return!0}function sR(d,h,A){if(typeof d!="function")throw new vo(o);return lm(function(){d.apply(r,A)},h)}function nm(d,h,A,U){var J=-1,se=u1,he=!0,ye=d.length,Ce=[],Fe=h.length;if(!ye)return Ce;A&&(h=fn(h,Vs(A))),U?(se=Hy,he=!1):h.length>=i&&(se=Vh,he=!1,h=new Qh(h));e:for(;++JJ?0:J+A),U=U===r||U>J?J:hr(U),U<0&&(U+=J),U=A>U?0:CO(U);A0&&A(ye)?h>1?Gi(ye,h-1,A,U,J):tl(J,ye):U||(J[J.length]=ye)}return J}var iC=OR(),cR=OR(!0);function nl(d,h){return d&&iC(d,h,_i)}function sC(d,h){return d&&cR(d,h,_i)}function f2(d,h){return el(h,function(A){return bf(d[A])})}function Zh(d,h){h=Wu(h,d);for(var A=0,U=h.length;d!=null&&Ah}function Gre(d,h){return d!=null&&Gr.call(d,h)}function Wre(d,h){return d!=null&&h in nn(d)}function Kre(d,h,A){return d>=dr(h,A)&&d=120&&je.length>=120)?new Qh(he&&je):r}je=d[0];var Ve=-1,ft=ye[0];e:for(;++Ve-1;)ye!==d&&Wh.call(ye,Ce,1),Wh.call(d,Ce,1);return d}function bR(d,h){for(var A=d?h.length:0,U=A-1;A--;){var J=h[A];if(A==U||J!==se){var se=J;mf(J)?Wh.call(d,J,1):vC(d,J)}}return d}function dC(d,h){return d+Ae(kn()*(h-d+1))}function ane(d,h,A,U){for(var J=-1,se=Gt(Se((h-d)/(A||1)),0),he=Pe(se);se--;)he[U?se:++J]=d,d+=A;return he}function hC(d,h){var A="";if(!d||h<1||h>E)return A;do h%2&&(A+=d),h=Ae(h/2),h&&(d+=d);while(h);return A}function yr(d,h){return kC(YR(d,h,bo),d+"")}function cne(d){return rR(I1(d))}function lne(d,h){var A=I1(d);return x2(A,Jh(h,0,A.length))}function om(d,h,A,U){if(!Mn(d))return d;h=Wu(h,d);for(var J=-1,se=h.length,he=se-1,ye=d;ye!=null&&++JJ?0:J+h),A=A>J?J:A,A<0&&(A+=J),J=h>A?0:A-h>>>0,h>>>=0;for(var se=Pe(J);++U>>1,he=d[se];he!==null&&!zo(he)&&(A?he<=h:he=i){var Fe=h?null:Cne(d);if(Fe)return Hh(Fe);he=!1,J=Vh,Ce=new Qh}else Ce=h?[]:ye;e:for(;++U=U?d:Ea(d,h,A)}var _R=ae||function(d){return Er.clearTimeout(d)};function IR(d,h){if(h)return d.slice();var A=d.length,U=n2?n2(A):new d.constructor(A);return d.copy(U),U}function bC(d){var h=new d.constructor(d.byteLength);return new b1(h).set(new b1(d)),h}function pne(d,h){var A=h?bC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.byteLength)}function vne(d){var h=new d.constructor(d.source,tr.exec(d));return h.lastIndex=d.lastIndex,h}function gne(d){return tm?nn(tm.call(d)):{}}function TR(d,h){var A=h?bC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function PR(d,h){if(d!==h){var A=d!==r,U=d===null,J=d===d,se=zo(d),he=h!==r,ye=h===null,Ce=h===h,Fe=zo(h);if(!ye&&!Fe&&!se&&d>h||se&&he&&Ce&&!ye&&!Fe||U&&he&&Ce||!A&&Ce||!J)return 1;if(!U&&!se&&!Fe&&d=ye)return Ce;var Fe=A[U];return Ce*(Fe=="desc"?-1:1)}}return d.index-h.index}function kR(d,h,A,U){for(var J=-1,se=d.length,he=A.length,ye=-1,Ce=h.length,Fe=Gt(se-he,0),je=Pe(Ce+Fe),Ve=!U;++ye1?A[J-1]:r,he=J>2?A[2]:r;for(se=d.length>3&&typeof se=="function"?(J--,se):r,he&&Gs(A[0],A[1],he)&&(se=J<3?r:se,J=1),h=nn(h);++U-1?J[se?h[he]:he]:r}}function BR(d){return yf(function(h){var A=h.length,U=A,J=wa.prototype.thru;for(d&&h.reverse();U--;){var se=h[U];if(typeof se!="function")throw new vo(o);if(J&&!he&&b2(se)=="wrapper")var he=new wa([],!0)}for(U=he?U:A;++U1&&Or.reverse(),je&&Ceye))return!1;var Fe=se.get(d),je=se.get(h);if(Fe&&je)return Fe==h&&je==d;var Ve=-1,ft=!0,Mt=A&b?new Qh:r;for(se.set(d,h),se.set(h,d);++Ve1?"& ":"")+h[U],h=h.join(A>2?", ":" "),d.replace($t,`{ /* [wrapped with `+h+`] */ -`)}function One(d){return nr(d)||t0(d)||!!(a2&&d&&d[a2])}function bf(d,h){var A=typeof d;return h=h??E,!!h&&(A=="number"||A!="symbol"&&Ti.test(d))&&d>-1&&d%1==0&&d0){if(++h>=P)return arguments[0]}else h=0;return d.apply(r,arguments)}}function _2(d,h){var A=-1,U=d.length,J=U-1;for(h=h===r?U:h;++A1?d[h-1]:r;return A=typeof A=="function"?(d.pop(),A):r,fO(d,A)});function uO(d){var h=ne(d);return h.__chain__=!0,h}function zie(d,h){return h(d),d}function I2(d,h){return h(d)}var Hie=mf(function(d){var h=d.length,A=h?d[0]:0,U=this.__wrapped__,J=function(se){return oC(se,d)};return h>1||this.__actions__.length||!(U instanceof _r)||!bf(A)?this.thru(J):(U=U.slice(A,+A+(h?1:0)),U.__actions__.push({func:I2,args:[J],thisArg:r}),new _a(U,this.__chain__).thru(function(se){return h&&!se.length&&se.push(r),se}))});function Gie(){return uO(this)}function Wie(){return new _a(this.value(),this.__chain__)}function Kie(){this.__values__===r&&(this.__values__=SO(this.value()));var d=this.__index__>=this.__values__.length,h=d?r:this.__values__[this.__index__++];return{done:d,value:h}}function Yie(){return this}function Qie(d){for(var h,A=this;A instanceof d2;){var U=iO(A);U.__index__=0,U.__values__=r,h?J.__wrapped__=U:h=U;var J=U;A=A.__wrapped__}return J.__wrapped__=d,h}function Jie(){var d=this.__wrapped__;if(d instanceof _r){var h=d;return this.__actions__.length&&(h=new _r(this)),h=h.reverse(),h.__actions__.push({func:I2,args:[DC],thisArg:r}),new _a(h,this.__chain__)}return this.thru(DC)}function Zie(){return IR(this.__wrapped__,this.__actions__)}var Xie=b2(function(d,h,A){Hr.call(d,A)?++d[A]:gf(d,A,1)});function ese(d,h,A){var U=nr(d)?Hx:zre;return A&&Vs(d,h,A)&&(h=r),U(d,Gt(h,3))}function tse(d,h){var A=nr(d)?sl:fR;return A(d,Gt(h,3))}var rse=FR(sO),nse=FR(oO);function ise(d,h){return Wi(T2(d,h),1)}function sse(d,h){return Wi(T2(d,h),B)}function ose(d,h,A){return A=A===r?1:fr(A),Wi(T2(d,h),A)}function dO(d,h){var A=nr(d)?fo:Wu;return A(d,Gt(h,3))}function hO(d,h){var A=nr(d)?FE:lR;return A(d,Gt(h,3))}var ase=b2(function(d,h,A){Hr.call(d,A)?d[A].push(h):gf(d,A,[h])});function cse(d,h,A,U){d=go(d)?d:_1(d),A=A&&!U?fr(A):0;var J=d.length;return A<0&&(A=Qe(J+A,0)),O2(d)?A<=J&&d.indexOf(h,A)>-1:!!J&&qu(d,h,A)>-1}var lse=pr(function(d,h,A){var U=-1,J=typeof h=="function",se=go(d)?Pe(d.length):[];return Wu(d,function(he){se[++U]=J?Qn(h,he,A):sm(he,h,A)}),se}),fse=b2(function(d,h,A){gf(d,A,h)});function T2(d,h){var A=nr(d)?dn:gR;return A(d,Gt(h,3))}function use(d,h,A,U){return d==null?[]:(nr(h)||(h=h==null?[]:[h]),A=U?r:A,nr(A)||(A=A==null?[]:[A]),wR(d,h,A))}var dse=b2(function(d,h,A){d[A?0:1].push(h)},function(){return[[],[]]});function hse(d,h,A){var U=nr(d)?Gy:Kx,J=arguments.length<3;return U(d,Gt(h,4),A,J,Wu)}function pse(d,h,A){var U=nr(d)?jE:Kx,J=arguments.length<3;return U(d,Gt(h,4),A,J,lR)}function vse(d,h){var A=nr(d)?sl:fR;return A(d,M2(Gt(h,3)))}function gse(d){var h=nr(d)?sR:cne;return h(d)}function yse(d,h,A){(A?Vs(d,h,A):h===r)?h=1:h=fr(h);var U=nr(d)?jre:lne;return U(d,h)}function mse(d){var h=nr(d)?Ure:une;return h(d)}function bse(d){if(d==null)return 0;if(go(d))return O2(d)?df(d):d.length;var h=vs(d);return h==_e||h==ke?d.size:dC(d).length}function wse(d,h,A){var U=nr(d)?zh:dne;return A&&Vs(d,h,A)&&(h=r),U(d,Gt(h,3))}var xse=pr(function(d,h){if(d==null)return[];var A=h.length;return A>1&&Vs(d,h[0],h[1])?h=[]:A>2&&Vs(h[0],h[1],h[2])&&(h=[h[0]]),wR(d,Wi(h,1),[])}),P2=V||function(){return wr.Date.now()};function Ese(d,h){if(typeof h!="function")throw new po(o);return d=fr(d),function(){if(--d<1)return h.apply(this,arguments)}}function pO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,yf(d,_,r,r,r,r,h)}function vO(d,h){var A;if(typeof h!="function")throw new po(o);return d=fr(d),function(){return--d>0&&(A=h.apply(this,arguments)),d<=1&&(h=r),A}}var BC=pr(function(d,h,A){var U=I;if(A.length){var J=gc(A,A1(BC));U|=F}return yf(d,U,h,A,J)}),gO=pr(function(d,h,A){var U=I|C;if(A.length){var J=gc(A,A1(gO));U|=F}return yf(h,U,d,A,J)});function yO(d,h,A){h=A?r:h;var U=yf(d,O,r,r,r,r,r,h);return U.placeholder=yO.placeholder,U}function mO(d,h,A){h=A?r:h;var U=yf(d,L,r,r,r,r,r,h);return U.placeholder=mO.placeholder,U}function bO(d,h,A){var U,J,se,he,ye,Ce,Fe=0,je=!1,Ve=!1,ft=!0;if(typeof d!="function")throw new po(o);h=ka(h)||0,kn(A)&&(je=!!A.leading,Ve="maxWait"in A,se=Ve?Qe(ka(A.maxWait)||0,h):se,ft="trailing"in A?!!A.trailing:ft);function Rt(ei){var wc=U,Ef=J;return U=J=r,Fe=ei,he=d.apply(Ef,wc),he}function Wt(ei){return Fe=ei,ye=fm(xr,h),je?Rt(ei):he}function ur(ei){var wc=ei-Ce,Ef=ei-Fe,FO=h-wc;return Ve?pt(FO,se-Ef):FO}function Kt(ei){var wc=ei-Ce,Ef=ei-Fe;return Ce===r||wc>=h||wc<0||Ve&&Ef>=se}function xr(){var ei=P2();if(Kt(ei))return Mr(ei);ye=fm(xr,ur(ei))}function Mr(ei){return ye=r,ft&&U?Rt(ei):(U=J=r,he)}function Yo(){ye!==r&&PR(ye),Fe=0,U=Ce=J=ye=r}function zs(){return ye===r?he:Mr(P2())}function Qo(){var ei=P2(),wc=Kt(ei);if(U=arguments,J=this,Ce=ei,wc){if(ye===r)return Wt(Ce);if(Ve)return PR(ye),ye=fm(xr,h),Rt(Ce)}return ye===r&&(ye=fm(xr,h)),he}return Qo.cancel=Yo,Qo.flush=zs,Qo}var Cse=pr(function(d,h){return cR(d,1,h)}),Ase=pr(function(d,h,A){return cR(d,ka(h)||0,A)});function Sse(d){return yf(d,ie)}function k2(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new po(o);var A=function(){var U=arguments,J=h?h.apply(this,U):U[0],se=A.cache;if(se.has(J))return se.get(J);var he=d.apply(this,U);return A.cache=se.set(J,he)||se,he};return A.cache=new(k2.Cache||vf),A}k2.Cache=vf;function M2(d){if(typeof d!="function")throw new po(o);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function _se(d){return vO(2,d)}var Ise=hne(function(d,h){h=h.length==1&&nr(h[0])?dn(h[0],Us(Gt())):dn(Wi(h,1),Us(Gt()));var A=h.length;return pr(function(U){for(var J=-1,se=pt(U.length,A);++J=h}),t0=hR(function(){return arguments}())?hR:function(d){return qn(d)&&Hr.call(d,"callee")&&!o2.call(d,"callee")},nr=Pe.isArray,qse=Yn?Us(Yn):Qre;function go(d){return d!=null&&R2(d.length)&&!wf(d)}function Xn(d){return qn(d)&&go(d)}function Vse(d){return d===!0||d===!1||qn(d)&&qs(d)==Z}var Ju=Se||KC,zse=Ho?Us(Ho):Jre;function Hse(d){return qn(d)&&d.nodeType===1&&!um(d)}function Gse(d){if(d==null)return!0;if(go(d)&&(nr(d)||typeof d=="string"||typeof d.splice=="function"||Ju(d)||S1(d)||t0(d)))return!d.length;var h=vs(d);if(h==_e||h==ke)return!d.size;if(lm(d))return!dC(d).length;for(var A in d)if(Hr.call(d,A))return!1;return!0}function Wse(d,h){return om(d,h)}function Kse(d,h,A){A=typeof A=="function"?A:r;var U=A?A(d,h):r;return U===r?om(d,h,r,A):!!U}function FC(d){if(!qn(d))return!1;var h=qs(d);return h==te||h==N||typeof d.message=="string"&&typeof d.name=="string"&&!um(d)}function Yse(d){return typeof d=="number"&&Ae(d)}function wf(d){if(!kn(d))return!1;var h=qs(d);return h==fe||h==Ee||h==G||h==et}function xO(d){return typeof d=="number"&&d==fr(d)}function R2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=E}function kn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var EO=js?Us(js):Xre;function Qse(d,h){return d===h||uC(d,h,TC(h))}function Jse(d,h,A){return A=typeof A=="function"?A:r,uC(d,h,TC(h),A)}function Zse(d){return CO(d)&&d!=+d}function Xse(d){if(Bne(d))throw new Jt(s);return pR(d)}function eoe(d){return d===null}function toe(d){return d==null}function CO(d){return typeof d=="number"||qn(d)&&qs(d)==Re}function um(d){if(!qn(d)||qs(d)!=De)return!1;var h=g1(d);if(h===null)return!0;var A=Hr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&d1.call(A)==rC}var jC=Go?Us(Go):ene;function roe(d){return xO(d)&&d>=-E&&d<=E}var AO=Vh?Us(Vh):tne;function O2(d){return typeof d=="string"||!nr(d)&&qn(d)&&qs(d)==Ne}function Ko(d){return typeof d=="symbol"||qn(d)&&qs(d)==tt}var S1=uf?Us(uf):rne;function noe(d){return d===r}function ioe(d){return qn(d)&&vs(d)==st}function soe(d){return qn(d)&&qs(d)==nt}var ooe=C2(hC),aoe=C2(function(d,h){return d<=h});function SO(d){if(!d)return[];if(go(d))return O2(d)?ho(d):vo(d);if(Wh&&d[Wh])return ZE(d[Wh]());var h=vs(d),A=h==_e?Zy:h==ke?uo:_1;return A(d)}function xf(d){if(!d)return d===0?d:0;if(d=ka(d),d===B||d===-B){var h=d<0?-1:1;return h*x}return d===d?d:0}function fr(d){var h=xf(d),A=h%1;return h===h?A?h-A:h:0}function _O(d){return d?Jh(fr(d),0,T):0}function ka(d){if(typeof d=="number")return d;if(Ko(d))return w;if(kn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=kn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=Yx(d);var A=bi.test(d);return A||xi.test(d)?tr(d.slice(2),A?2:8):kr.test(d)?w:+d}function IO(d){return fl(d,yo(d))}function coe(d){return d?Jh(fr(d),-E,E):d===0?d:0}function Yr(d){return d==null?"":Wo(d)}var loe=E1(function(d,h){if(lm(h)||go(h)){fl(h,Pi(h),d);return}for(var A in h)Hr.call(h,A)&&nm(d,A,h[A])}),TO=E1(function(d,h){fl(h,yo(h),d)}),D2=E1(function(d,h,A,U){fl(h,yo(h),d,U)}),foe=E1(function(d,h,A,U){fl(h,Pi(h),d,U)}),uoe=mf(oC);function doe(d,h){var A=x1(d);return h==null?A:oR(A,h)}var hoe=pr(function(d,h){d=tn(d);var A=-1,U=h.length,J=U>2?h[2]:r;for(J&&Vs(h[0],h[1],J)&&(U=1);++A1),se}),fl(d,_C(d),A),U&&(A=Ia(A,u|p|g,Ane));for(var J=h.length;J--;)mC(A,h[J]);return A});function Moe(d,h){return kO(d,M2(Gt(h)))}var Roe=mf(function(d,h){return d==null?{}:sne(d,h)});function kO(d,h){if(d==null)return{};var A=dn(_C(d),function(U){return[U]});return h=Gt(h),xR(d,A,function(U,J){return h(U,J[0])})}function Ooe(d,h,A){h=Yu(h,d);var U=-1,J=h.length;for(J||(J=1,d=r);++Uh){var U=d;d=h,h=U}if(A||d%1||h%1){var J=un();return pt(d+J*(h-d+zr("1e-"+((J+"").length-1))),h)}return vC(d,h)}var zoe=C1(function(d,h,A){return h=h.toLowerCase(),d+(A?OO(h):h)});function OO(d){return qC(Yr(d).toLowerCase())}function DO(d){return d=Yr(d),d&&d.replace(Sn,WE).replace(zy,"")}function Hoe(d,h,A){d=Yr(d),h=Wo(h);var U=d.length;A=A===r?U:Jh(fr(A),0,U);var J=A;return A-=h.length,A>=0&&d.slice(A,J)==h}function Goe(d){return d=Yr(d),d&&Nt.test(d)?d.replace(kt,KE):d}function Woe(d){return d=Yr(d),d&&Et.test(d)?d.replace(ht,"\\$&"):d}var Koe=C1(function(d,h,A){return d+(A?"-":"")+h.toLowerCase()}),Yoe=C1(function(d,h,A){return d+(A?" ":"")+h.toLowerCase()}),Qoe=LR("toLowerCase");function Joe(d,h,A){d=Yr(d),h=fr(h);var U=h?df(d):0;if(!h||U>=h)return d;var J=(h-U)/2;return E2(pe(J),A)+d+E2(ae(J),A)}function Zoe(d,h,A){d=Yr(d),h=fr(h);var U=h?df(d):0;return h&&U>>0,A?(d=Yr(d),d&&(typeof h=="string"||h!=null&&!jC(h))&&(h=Wo(h),!h&&zu(d))?Qu(ho(d),0,A):d.split(h,A)):[]}var sae=C1(function(d,h,A){return d+(A?" ":"")+qC(h)});function oae(d,h,A){return d=Yr(d),A=A==null?0:Jh(fr(A),0,d.length),h=Wo(h),d.slice(A,A+h.length)==h}function aae(d,h,A){var U=ne.templateSettings;A&&Vs(d,h,A)&&(h=r),d=Yr(d),h=D2({},h,U,zR);var J=D2({},h.imports,U.imports,zR),se=Pi(J),he=Hh(J,se),ye,Ce,Fe=0,je=h.interpolate||di,Ve="__p += '",ft=tm((h.escape||di).source+"|"+je.source+"|"+(je===Mt?Sr:di).source+"|"+(h.evaluate||di).source+"|$","g"),Rt="//# sourceURL="+(Hr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zo+"]")+` -`;d.replace(ft,function(Kt,xr,Mr,Yo,zs,Qo){return Mr||(Mr=Yo),Ve+=d.slice(Fe,Qo).replace(Fs,YE),xr&&(ye=!0,Ve+=`' + -__e(`+xr+`) + -'`),zs&&(Ce=!0,Ve+=`'; -`+zs+`; -__p += '`),Mr&&(Ve+=`' + -((__t = (`+Mr+`)) == null ? '' : __t) + -'`),Fe=Qo+Kt.length,Kt}),Ve+=`'; -`;var Wt=Hr.call(h,"variable")&&h.variable;if(!Wt)Ve=`with (obj) { +`)}function One(d){return sr(d)||t0(d)||!!(em&&d&&d[em])}function mf(d,h){var A=typeof d;return h=h??E,!!h&&(A=="number"||A!="symbol"&&Si.test(d))&&d>-1&&d%1==0&&d0){if(++h>=P)return arguments[0]}else h=0;return d.apply(r,arguments)}}function x2(d,h){var A=-1,U=d.length,J=U-1;for(h=h===r?U:h;++A1?d[h-1]:r;return A=typeof A=="function"?(d.pop(),A):r,aO(d,A)});function cO(d){var h=ne(d);return h.__chain__=!0,h}function zie(d,h){return h(d),d}function E2(d,h){return h(d)}var Hie=yf(function(d){var h=d.length,A=h?d[0]:0,U=this.__wrapped__,J=function(se){return nC(se,d)};return h>1||this.__actions__.length||!(U instanceof Tr)||!mf(A)?this.thru(J):(U=U.slice(A,+A+(h?1:0)),U.__actions__.push({func:E2,args:[J],thisArg:r}),new wa(U,this.__chain__).thru(function(se){return h&&!se.length&&se.push(r),se}))});function Gie(){return cO(this)}function Wie(){return new wa(this.value(),this.__chain__)}function Kie(){this.__values__===r&&(this.__values__=EO(this.value()));var d=this.__index__>=this.__values__.length,h=d?r:this.__values__[this.__index__++];return{done:d,value:h}}function Yie(){return this}function Qie(d){for(var h,A=this;A instanceof a2;){var U=tO(A);U.__index__=0,U.__values__=r,h?J.__wrapped__=U:h=U;var J=U;A=A.__wrapped__}return J.__wrapped__=d,h}function Jie(){var d=this.__wrapped__;if(d instanceof Tr){var h=d;return this.__actions__.length&&(h=new Tr(this)),h=h.reverse(),h.__actions__.push({func:E2,args:[MC],thisArg:r}),new wa(h,this.__chain__)}return this.thru(MC)}function Zie(){return AR(this.__wrapped__,this.__actions__)}var Xie=p2(function(d,h,A){Gr.call(d,A)?++d[A]:vf(d,A,1)});function ese(d,h,A){var U=sr(d)?zx:zre;return A&&Gs(d,h,A)&&(h=r),U(d,Wt(h,3))}function tse(d,h){var A=sr(d)?el:aR;return A(d,Wt(h,3))}var rse=NR(rO),nse=NR(nO);function ise(d,h){return Gi(C2(d,h),1)}function sse(d,h){return Gi(C2(d,h),B)}function ose(d,h,A){return A=A===r?1:hr(A),Gi(C2(d,h),A)}function lO(d,h){var A=sr(d)?ho:Hu;return A(d,Wt(h,3))}function fO(d,h){var A=sr(d)?OE:oR;return A(d,Wt(h,3))}var ase=p2(function(d,h,A){Gr.call(d,A)?d[A].push(h):vf(d,A,[h])});function cse(d,h,A,U){d=yo(d)?d:I1(d),A=A&&!U?hr(A):0;var J=d.length;return A<0&&(A=Gt(J+A,0)),T2(d)?A<=J&&d.indexOf(h,A)>-1:!!J&&Lu(d,h,A)>-1}var lse=yr(function(d,h,A){var U=-1,J=typeof h=="function",se=yo(d)?Pe(d.length):[];return Hu(d,function(he){se[++U]=J?fi(h,he,A):im(he,h,A)}),se}),fse=p2(function(d,h,A){vf(d,A,h)});function C2(d,h){var A=sr(d)?fn:hR;return A(d,Wt(h,3))}function use(d,h,A,U){return d==null?[]:(sr(h)||(h=h==null?[]:[h]),A=U?r:A,sr(A)||(A=A==null?[]:[A]),yR(d,h,A))}var dse=p2(function(d,h,A){d[A?0:1].push(h)},function(){return[[],[]]});function hse(d,h,A){var U=sr(d)?Gy:Kx,J=arguments.length<3;return U(d,Wt(h,4),A,J,Hu)}function pse(d,h,A){var U=sr(d)?DE:Kx,J=arguments.length<3;return U(d,Wt(h,4),A,J,oR)}function vse(d,h){var A=sr(d)?el:aR;return A(d,_2(Wt(h,3)))}function gse(d){var h=sr(d)?rR:cne;return h(d)}function yse(d,h,A){(A?Gs(d,h,A):h===r)?h=1:h=hr(h);var U=sr(d)?jre:lne;return U(d,h)}function mse(d){var h=sr(d)?Ure:une;return h(d)}function bse(d){if(d==null)return 0;if(yo(d))return T2(d)?uf(d):d.length;var h=ys(d);return h==_e||h==ke?d.size:lC(d).length}function wse(d,h,A){var U=sr(d)?d1:dne;return A&&Gs(d,h,A)&&(h=r),U(d,Wt(h,3))}var xse=yr(function(d,h){if(d==null)return[];var A=h.length;return A>1&&Gs(d,h[0],h[1])?h=[]:A>2&&Gs(h[0],h[1],h[2])&&(h=[h[0]]),yR(d,Gi(h,1),[])}),A2=ve||function(){return Er.Date.now()};function Ese(d,h){if(typeof h!="function")throw new vo(o);return d=hr(d),function(){if(--d<1)return h.apply(this,arguments)}}function uO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,gf(d,_,r,r,r,r,h)}function dO(d,h){var A;if(typeof h!="function")throw new vo(o);return d=hr(d),function(){return--d>0&&(A=h.apply(this,arguments)),d<=1&&(h=r),A}}var OC=yr(function(d,h,A){var U=I;if(A.length){var J=nr(A,S1(OC));U|=F}return gf(d,U,h,A,J)}),hO=yr(function(d,h,A){var U=I|C;if(A.length){var J=nr(A,S1(hO));U|=F}return gf(h,U,d,A,J)});function pO(d,h,A){h=A?r:h;var U=gf(d,O,r,r,r,r,r,h);return U.placeholder=pO.placeholder,U}function vO(d,h,A){h=A?r:h;var U=gf(d,L,r,r,r,r,r,h);return U.placeholder=vO.placeholder,U}function gO(d,h,A){var U,J,se,he,ye,Ce,Fe=0,je=!1,Ve=!1,ft=!0;if(typeof d!="function")throw new vo(o);h=Aa(h)||0,Mn(A)&&(je=!!A.leading,Ve="maxWait"in A,se=Ve?Gt(Aa(A.maxWait)||0,h):se,ft="trailing"in A?!!A.trailing:ft);function Mt(Zn){var pc=U,xf=J;return U=J=r,Fe=Zn,he=d.apply(xf,pc),he}function Kt(Zn){return Fe=Zn,ye=lm(Cr,h),je?Mt(Zn):he}function pr(Zn){var pc=Zn-Ce,xf=Zn-Fe,NO=h-pc;return Ve?dr(NO,se-xf):NO}function Yt(Zn){var pc=Zn-Ce,xf=Zn-Fe;return Ce===r||pc>=h||pc<0||Ve&&xf>=se}function Cr(){var Zn=A2();if(Yt(Zn))return Or(Zn);ye=lm(Cr,pr(Zn))}function Or(Zn){return ye=r,ft&&U?Mt(Zn):(U=J=r,he)}function Ho(){ye!==r&&_R(ye),Fe=0,U=Ce=J=ye=r}function Ws(){return ye===r?he:Or(A2())}function Go(){var Zn=A2(),pc=Yt(Zn);if(U=arguments,J=this,Ce=Zn,pc){if(ye===r)return Kt(Ce);if(Ve)return _R(ye),ye=lm(Cr,h),Mt(Ce)}return ye===r&&(ye=lm(Cr,h)),he}return Go.cancel=Ho,Go.flush=Ws,Go}var Cse=yr(function(d,h){return sR(d,1,h)}),Ase=yr(function(d,h,A){return sR(d,Aa(h)||0,A)});function Sse(d){return gf(d,ie)}function S2(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new vo(o);var A=function(){var U=arguments,J=h?h.apply(this,U):U[0],se=A.cache;if(se.has(J))return se.get(J);var he=d.apply(this,U);return A.cache=se.set(J,he)||se,he};return A.cache=new(S2.Cache||pf),A}S2.Cache=pf;function _2(d){if(typeof d!="function")throw new vo(o);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function _se(d){return dO(2,d)}var Ise=hne(function(d,h){h=h.length==1&&sr(h[0])?fn(h[0],Vs(Wt())):fn(Gi(h,1),Vs(Wt()));var A=h.length;return yr(function(U){for(var J=-1,se=dr(U.length,A);++J=h}),t0=fR(function(){return arguments}())?fR:function(d){return qn(d)&&Gr.call(d,"callee")&&!Gh.call(d,"callee")},sr=Pe.isArray,qse=Hi?Vs(Hi):Qre;function yo(d){return d!=null&&I2(d.length)&&!bf(d)}function Jn(d){return qn(d)&&yo(d)}function Vse(d){return d===!0||d===!1||qn(d)&&Hs(d)==Z}var Yu=Ye||HC,zse=qo?Vs(qo):Jre;function Hse(d){return qn(d)&&d.nodeType===1&&!fm(d)}function Gse(d){if(d==null)return!0;if(yo(d)&&(sr(d)||typeof d=="string"||typeof d.splice=="function"||Yu(d)||_1(d)||t0(d)))return!d.length;var h=ys(d);if(h==_e||h==ke)return!d.size;if(cm(d))return!lC(d).length;for(var A in d)if(Gr.call(d,A))return!1;return!0}function Wse(d,h){return sm(d,h)}function Kse(d,h,A){A=typeof A=="function"?A:r;var U=A?A(d,h):r;return U===r?sm(d,h,r,A):!!U}function NC(d){if(!qn(d))return!1;var h=Hs(d);return h==te||h==N||typeof d.message=="string"&&typeof d.name=="string"&&!fm(d)}function Yse(d){return typeof d=="number"&&st(d)}function bf(d){if(!Mn(d))return!1;var h=Hs(d);return h==fe||h==Ee||h==G||h==Xe}function mO(d){return typeof d=="number"&&d==hr(d)}function I2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=E}function Mn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var bO=qs?Vs(qs):Xre;function Qse(d,h){return d===h||cC(d,h,SC(h))}function Jse(d,h,A){return A=typeof A=="function"?A:r,cC(d,h,SC(h),A)}function Zse(d){return wO(d)&&d!=+d}function Xse(d){if(Bne(d))throw new Zt(s);return uR(d)}function eoe(d){return d===null}function toe(d){return d==null}function wO(d){return typeof d=="number"||qn(d)&&Hs(d)==Re}function fm(d){if(!qn(d)||Hs(d)!=De)return!1;var h=w1(d);if(h===null)return!0;var A=Gr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&g1.call(A)==XE}var BC=ba?Vs(ba):ene;function roe(d){return mO(d)&&d>=-E&&d<=E}var xO=$h?Vs($h):tne;function T2(d){return typeof d=="string"||!sr(d)&&qn(d)&&Hs(d)==Ne}function zo(d){return typeof d=="symbol"||qn(d)&&Hs(d)==et}var _1=ff?Vs(ff):rne;function noe(d){return d===r}function ioe(d){return qn(d)&&ys(d)==it}function soe(d){return qn(d)&&Hs(d)==rt}var ooe=m2(fC),aoe=m2(function(d,h){return d<=h});function EO(d){if(!d)return[];if(yo(d))return T2(d)?po(d):go(d);if(q&&d[q])return fc(d[q]());var h=ys(d),A=h==_e?zh:h==ke?Hh:I1;return A(d)}function wf(d){if(!d)return d===0?d:0;if(d=Aa(d),d===B||d===-B){var h=d<0?-1:1;return h*x}return d===d?d:0}function hr(d){var h=wf(d),A=h%1;return h===h?A?h-A:h:0}function CO(d){return d?Jh(hr(d),0,T):0}function Aa(d){if(typeof d=="number")return d;if(zo(d))return w;if(Mn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=Mn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=Fu(d);var A=vi.test(d);return A||yi.test(d)?rr(d.slice(2),A?2:8):Rr.test(d)?w:+d}function AO(d){return il(d,mo(d))}function coe(d){return d?Jh(hr(d),-E,E):d===0?d:0}function Qr(d){return d==null?"":Vo(d)}var loe=C1(function(d,h){if(cm(h)||yo(h)){il(h,_i(h),d);return}for(var A in h)Gr.call(h,A)&&rm(d,A,h[A])}),SO=C1(function(d,h){il(h,mo(h),d)}),P2=C1(function(d,h,A,U){il(h,mo(h),d,U)}),foe=C1(function(d,h,A,U){il(h,_i(h),d,U)}),uoe=yf(nC);function doe(d,h){var A=E1(d);return h==null?A:nR(A,h)}var hoe=yr(function(d,h){d=nn(d);var A=-1,U=h.length,J=U>2?h[2]:r;for(J&&Gs(h[0],h[1],J)&&(U=1);++A1),se}),il(d,CC(d),A),U&&(A=xa(A,u|p|g,Ane));for(var J=h.length;J--;)vC(A,h[J]);return A});function Moe(d,h){return IO(d,_2(Wt(h)))}var Roe=yf(function(d,h){return d==null?{}:sne(d,h)});function IO(d,h){if(d==null)return{};var A=fn(CC(d),function(U){return[U]});return h=Wt(h),mR(d,A,function(U,J){return h(U,J[0])})}function Ooe(d,h,A){h=Wu(h,d);var U=-1,J=h.length;for(J||(J=1,d=r);++Uh){var U=d;d=h,h=U}if(A||d%1||h%1){var J=kn();return dr(d+J*(h-d+tn("1e-"+((J+"").length-1))),h)}return dC(d,h)}var zoe=A1(function(d,h,A){return h=h.toLowerCase(),d+(A?kO(h):h)});function kO(d){return jC(Qr(d).toLowerCase())}function MO(d){return d=Qr(d),d&&d.replace(_n,qE).replace(Vy,"")}function Hoe(d,h,A){d=Qr(d),h=Vo(h);var U=d.length;A=A===r?U:Jh(hr(A),0,U);var J=A;return A-=h.length,A>=0&&d.slice(A,J)==h}function Goe(d){return d=Qr(d),d&&Dt.test(d)?d.replace(Pt,VE):d}function Woe(d){return d=Qr(d),d&&xt.test(d)?d.replace(ht,"\\$&"):d}var Koe=A1(function(d,h,A){return d+(A?"-":"")+h.toLowerCase()}),Yoe=A1(function(d,h,A){return d+(A?" ":"")+h.toLowerCase()}),Qoe=DR("toLowerCase");function Joe(d,h,A){d=Qr(d),h=hr(h);var U=h?uf(d):0;if(!h||U>=h)return d;var J=(h-U)/2;return y2(Ae(J),A)+d+y2(Se(J),A)}function Zoe(d,h,A){d=Qr(d),h=hr(h);var U=h?uf(d):0;return h&&U>>0,A?(d=Qr(d),d&&(typeof h=="string"||h!=null&&!BC(h))&&(h=Vo(h),!h&&Yr(d))?Ku(po(d),0,A):d.split(h,A)):[]}var sae=A1(function(d,h,A){return d+(A?" ":"")+jC(h)});function oae(d,h,A){return d=Qr(d),A=A==null?0:Jh(hr(A),0,d.length),h=Vo(h),d.slice(A,A+h.length)==h}function aae(d,h,A){var U=ne.templateSettings;A&&Gs(d,h,A)&&(h=r),d=Qr(d),h=P2({},h,U,$R);var J=P2({},h.imports,U.imports,$R),se=_i(J),he=Qy(J,se),ye,Ce,Fe=0,je=h.interpolate||us,Ve="__p += '",ft=Xy((h.escape||us).source+"|"+je.source+"|"+(je===kt?Ir:us).source+"|"+(h.evaluate||us).source+"|$","g"),Mt="//# sourceURL="+(Gr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zy+"]")+` +`;d.replace(ft,function(Yt,Cr,Or,Ho,Ws,Go){return Or||(Or=Ho),Ve+=d.slice(Fe,Go).replace(ds,zE),Cr&&(ye=!0,Ve+=`' + +__e(`+Cr+`) + +'`),Ws&&(Ce=!0,Ve+=`'; +`+Ws+`; +__p += '`),Or&&(Ve+=`' + +((__t = (`+Or+`)) == null ? '' : __t) + +'`),Fe=Go+Yt.length,Yt}),Ve+=`'; +`;var Kt=Gr.call(h,"variable")&&h.variable;if(!Kt)Ve=`with (obj) { `+Ve+` } -`;else if(Rr.test(Wt))throw new Jt(a);Ve=(Ce?Ve.replace(lr,""):Ve).replace(xt,"$1").replace(ar,"$1;"),Ve="function("+(Wt||"obj")+`) { -`+(Wt?"":`obj || (obj = {}); +`;else if(Dr.test(Kt))throw new Zt(a);Ve=(Ce?Ve.replace(ur,""):Ve).replace(wt,"$1").replace(lr,"$1;"),Ve="function("+(Kt||"obj")+`) { +`+(Kt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(Ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Ve+`return __p -}`;var ur=BO(function(){return Nr(se,Rt+"return "+Ve).apply(r,he)});if(ur.source=Ve,FC(ur))throw ur;return ur}function cae(d){return Yr(d).toLowerCase()}function lae(d){return Yr(d).toUpperCase()}function fae(d,h,A){if(d=Yr(d),d&&(A||h===r))return Yx(d);if(!d||!(h=Wo(h)))return d;var U=ho(d),J=ho(h),se=Vu(U,J),he=Qx(U,J)+1;return Qu(U,se,he).join("")}function uae(d,h,A){if(d=Yr(d),d&&(A||h===r))return d.slice(0,em(d)+1);if(!d||!(h=Wo(h)))return d;var U=ho(d),J=Qx(U,ho(h))+1;return Qu(U,0,J).join("")}function dae(d,h,A){if(d=Yr(d),d&&(A||h===r))return d.replace(Bt,"");if(!d||!(h=Wo(h)))return d;var U=ho(d),J=Vu(U,ho(h));return Qu(U,J).join("")}function hae(d,h){var A=ce,U=K;if(kn(h)){var J="separator"in h?h.separator:J;A="length"in h?fr(h.length):A,U="omission"in h?Wo(h.omission):U}d=Yr(d);var se=d.length;if(zu(d)){var he=ho(d);se=he.length}if(A>=se)return d;var ye=A-df(U);if(ye<1)return U;var Ce=he?Qu(he,0,ye).join(""):d.slice(0,ye);if(J===r)return Ce+U;if(he&&(ye+=Ce.length-ye),jC(J)){if(d.slice(ye).search(J)){var Fe,je=Ce;for(J.global||(J=tm(J.source,Yr(er.exec(J))+"g")),J.lastIndex=0;Fe=J.exec(je);)var Ve=Fe.index;Ce=Ce.slice(0,Ve===r?ye:Ve)}}else if(d.indexOf(Wo(J),ye)!=ye){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+U}function pae(d){return d=Yr(d),d&&Dt.test(d)?d.replace(rr,Zx):d}var vae=C1(function(d,h,A){return d+(A?" ":"")+h.toUpperCase()}),qC=LR("toUpperCase");function NO(d,h,A){return d=Yr(d),h=A?r:h,h===r?JE(d)?t2(d):qE(d):d.match(h)||[]}var BO=pr(function(d,h){try{return Qn(d,r,h)}catch(A){return FC(A)?A:new Jt(A)}}),gae=mf(function(d,h){return fo(h,function(A){A=ul(A),gf(d,A,BC(d[A],d))}),d});function yae(d){var h=d==null?0:d.length,A=Gt();return d=h?dn(d,function(U){if(typeof U[1]!="function")throw new po(o);return[A(U[0]),U[1]]}):[],pr(function(U){for(var J=-1;++JE)return[];var A=T,U=pt(d,T);h=Gt(h),d-=T;for(var J=Jy(U,h);++A0||h<0)?new _r(A):(d<0?A=A.takeRight(-d):d&&(A=A.drop(d)),h!==r&&(h=fr(h),A=h<0?A.dropRight(-h):A.take(h-d)),A)},_r.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},_r.prototype.toArray=function(){return this.take(T)},ll(_r.prototype,function(d,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),U=/^(?:head|last)$/.test(h),J=ne[U?"take"+(h=="last"?"Right":""):h],se=U||/^find/.test(h);J&&(ne.prototype[h]=function(){var he=this.__wrapped__,ye=U?[1]:arguments,Ce=he instanceof _r,Fe=ye[0],je=Ce||nr(he),Ve=function(xr){var Mr=J.apply(ne,ol([xr],ye));return U&&ft?Mr[0]:Mr};je&&A&&typeof Fe=="function"&&Fe.length!=1&&(Ce=je=!1);var ft=this.__chain__,Rt=!!this.__actions__.length,Wt=se&&!ft,ur=Ce&&!Rt;if(!se&&je){he=ur?he:new _r(this);var Kt=d.apply(he,ye);return Kt.__actions__.push({func:I2,args:[Ve],thisArg:r}),new _a(Kt,ft)}return Wt&&ur?d.apply(this,ye):(Kt=this.thru(Ve),Wt?U?Kt.value()[0]:Kt.value():Kt)})}),fo(["pop","push","shift","sort","splice","unshift"],function(d){var h=f1[d],A=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",U=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if(U&&!this.__chain__){var se=this.value();return h.apply(nr(se)?se:[],J)}return this[A](function(he){return h.apply(nr(he)?he:[],J)})}}),ll(_r.prototype,function(d,h){var A=ne[h];if(A){var U=A.name+"";Hr.call(hf,U)||(hf[U]=[]),hf[U].push({name:h,func:A})}}),hf[w2(r,C).name]=[{name:"wrapper",func:r}],_r.prototype.clone=pre,_r.prototype.reverse=vre,_r.prototype.value=gre,ne.prototype.at=Hie,ne.prototype.chain=Gie,ne.prototype.commit=Wie,ne.prototype.next=Kie,ne.prototype.plant=Qie,ne.prototype.reverse=Jie,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=Zie,ne.prototype.first=ne.prototype.head,Wh&&(ne.prototype[Wh]=Yie),ne},Hu=r2();Pn?((Pn.exports=Hu)._=Hu,en._=Hu):wr._=Hu}).call(Si)})(h4,h4.exports);var IBe=h4.exports,xI={exports:{}};(function(t,e){var r=typeof self<"u"?self:Si,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(v){return v&&DataView.prototype.isPrototypeOf(v)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(v){return v&&l.indexOf(Object.prototype.toString.call(v))>-1};function u(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function p(v){return typeof v!="string"&&(v=String(v)),v}function g(v){var m={next:function(){var R=v.shift();return{done:R===void 0,value:R}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,R){this.append(R,m)},this):Array.isArray(v)?v.forEach(function(m){this.append(m[0],m[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(m){this.append(m,v[m])},this)}y.prototype.append=function(v,m){v=u(v),m=p(m);var R=this.map[v];this.map[v]=R?R+", "+m:m},y.prototype.delete=function(v){delete this.map[u(v)]},y.prototype.get=function(v){return v=u(v),this.has(v)?this.map[v]:null},y.prototype.has=function(v){return this.map.hasOwnProperty(u(v))},y.prototype.set=function(v,m){this.map[u(v)]=p(m)},y.prototype.forEach=function(v,m){for(var R in this.map)this.map.hasOwnProperty(R)&&v.call(m,this.map[R],R,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,R){v.push(R)}),g(v)},y.prototype.values=function(){var v=[];return this.forEach(function(m){v.push(m)}),g(v)},y.prototype.entries=function(){var v=[];return this.forEach(function(m,R){v.push([R,m])}),g(v)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function b(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function I(v){return new Promise(function(m,R){v.onload=function(){m(v.result)},v.onerror=function(){R(v.error)}})}function C(v){var m=new FileReader,R=I(m);return m.readAsArrayBuffer(v),R}function S(v){var m=new FileReader,R=I(m);return m.readAsText(v),R}function O(v){for(var m=new Uint8Array(v),R=new Array(m.length),B=0;B-1?m:v}function $(v,m){m=m||{};var R=m.body;if(v instanceof $){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,m.headers||(this.headers=new y(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!R&&v._bodyInit!=null&&(R=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new y(m.headers)),this.method=_(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&R)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(R)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(R){if(R){var B=R.split("="),E=B.shift().replace(/\+/g," "),x=B.join("=").replace(/\+/g," ");m.append(decodeURIComponent(E),decodeURIComponent(x))}}),m}function ce(v){var m=new y,R=v.replace(/\r?\n[\t ]+/g," ");return R.split(/\r?\n/).forEach(function(B){var E=B.split(":"),x=E.shift().trim();if(x){var w=E.join(":").trim();m.append(x,w)}}),m}F.call($.prototype);function K(v,m){m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in m?m.statusText:"OK",this.headers=new y(m.headers),this.url=m.url||"",this._initBody(v)}F.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var v=new K(null,{status:0,statusText:""});return v.type="error",v};var P=[301,302,303,307,308];K.redirect=function(v,m){if(P.indexOf(m)===-1)throw new RangeError("Invalid status code");return new K(null,{status:m,headers:{location:v}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,R){this.message=m,this.name=R;var B=Error(m);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(v,m){return new Promise(function(R,B){var E=new $(v,m);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function w(){x.abort()}x.onload=function(){var T={status:x.status,statusText:x.statusText,headers:ce(x.getAllResponseHeaders()||"")};T.url="responseURL"in x?x.responseURL:T.headers.get("X-Request-URL");var k="response"in x?x.response:x.responseText;R(new K(k,T))},x.onerror=function(){B(new TypeError("Network request failed"))},x.ontimeout=function(){B(new TypeError("Network request failed"))},x.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},x.open(E.method,E.url,!0),E.credentials==="include"?x.withCredentials=!0:E.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&a.blob&&(x.responseType="blob"),E.headers.forEach(function(T,k){x.setRequestHeader(k,T)}),E.signal&&(E.signal.addEventListener("abort",w),x.onreadystatechange=function(){x.readyState===4&&E.signal.removeEventListener("abort",w)}),x.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return M.polyfill=!0,s.fetch||(s.fetch=M,s.Headers=y,s.Request=$,s.Response=K),o.Headers=y,o.Request=$,o.Response=K,o.fetch=M,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(xI,xI.exports);var TBe=xI.exports;const o$=_u(TBe);var PBe=Object.defineProperty,kBe=Object.defineProperties,MBe=Object.getOwnPropertyDescriptors,a$=Object.getOwnPropertySymbols,RBe=Object.prototype.hasOwnProperty,OBe=Object.prototype.propertyIsEnumerable,c$=(t,e,r)=>e in t?PBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l$=(t,e)=>{for(var r in e||(e={}))RBe.call(e,r)&&c$(t,r,e[r]);if(a$)for(var r of a$(e))OBe.call(e,r)&&c$(t,r,e[r]);return t},f$=(t,e)=>kBe(t,MBe(e));const DBe={Accept:"application/json","Content-Type":"application/json"},NBe="POST",u$={headers:DBe,method:NBe},d$=10;let rl=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ba.EventEmitter,this.isAvailable=!1,this.registering=!1,!RU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Su(e),n=await(await o$(this.url,f$(l$({},u$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!RU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Su({id:1,jsonrpc:"2.0",method:"test",params:[]});await o$(e,f$(l$({},u$),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Lp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=PE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return rte(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>d$&&this.events.setMaxListeners(d$)}};const h$="error",BBe="wss://relay.walletconnect.org",LBe="wc",FBe="universal_provider",p$=`${LBe}@2:${FBe}:`,_te="https://rpc.walletconnect.org/v1/",W1="generic",jBe=`${_te}bundler`,hc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var UBe=Object.defineProperty,$Be=Object.defineProperties,qBe=Object.getOwnPropertyDescriptors,v$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,g$=(t,e,r)=>e in t?UBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,D6=(t,e)=>{for(var r in e||(e={}))VBe.call(e,r)&&g$(t,r,e[r]);if(v$)for(var r of v$(e))zBe.call(e,r)&&g$(t,r,e[r]);return t},HBe=(t,e)=>$Be(t,qBe(e));function va(t,e,r){var n;const i=Vv(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${_te}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function t1(t){return t.includes(":")?t.split(":")[1]:t}function Ite(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function GBe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function nS(t={},e={}){const r=y$(t),n=y$(e);return IBe.merge(r,n)}function y$(t){var e,r,n,i;const s={};if(!Rw(t))return s;for(const[o,a]of Object.entries(t)){const c=$M(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},p=lb(o);s[p]=HBe(D6(D6({},s[p]),a),{chains:R3(c,(e=s[p])==null?void 0:e.chains),methods:R3(l,(r=s[p])==null?void 0:r.methods),events:R3(f,(n=s[p])==null?void 0:n.events),rpcMap:D6(D6({},u),(i=s[p])==null?void 0:i.rpcMap)})}return s}function WBe(t){return t.includes(":")?t.split(":")[2]:t}function m$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=$M(r)?[r]:n.chains?n.chains:Ite(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function iS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Tte={},Vr=t=>Tte[t],sS=(t,e)=>{Tte[t]=e};class KBe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}var YBe=Object.defineProperty,QBe=Object.defineProperties,JBe=Object.getOwnPropertyDescriptors,b$=Object.getOwnPropertySymbols,ZBe=Object.prototype.hasOwnProperty,XBe=Object.prototype.propertyIsEnumerable,w$=(t,e,r)=>e in t?YBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x$=(t,e)=>{for(var r in e||(e={}))ZBe.call(e,r)&&w$(t,r,e[r]);if(b$)for(var r of b$(e))XBe.call(e,r)&&w$(t,r,e[r]);return t},E$=(t,e)=>QBe(t,JBe(e));class eLe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||va(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(t1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:E$(x$({},o.sessionProperties||{}),{capabilities:E$(x$({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ud("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${jBe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class tLe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}class rLe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}let nLe=class{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||va(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new dc(new rl(n,Vr("disableProviderPing")))}};class iLe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=t1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}class sLe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}class oLe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}class aLe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||va(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace);return typeof n>"u"?void 0:new dc(new rl(n,Vr("disableProviderPing")))}}class cLe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||va(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace);return typeof n>"u"?void 0:new dc(new rl(n))}}class lLe{constructor(e){this.name=W1,this.namespace=e.namespace,this.events=Vr("events"),this.client=Vr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=Vv(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new dc(new rl(n,Vr("disableProviderPing")))}}var fLe=Object.defineProperty,uLe=Object.defineProperties,dLe=Object.getOwnPropertyDescriptors,C$=Object.getOwnPropertySymbols,hLe=Object.prototype.hasOwnProperty,pLe=Object.prototype.propertyIsEnumerable,A$=(t,e,r)=>e in t?fLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,N6=(t,e)=>{for(var r in e||(e={}))hLe.call(e,r)&&A$(t,r,e[r]);if(C$)for(var r of C$(e))pLe.call(e,r)&&A$(t,r,e[r]);return t},oS=(t,e)=>uLe(t,dLe(e));let vLe=class Pte{constructor(e){this.events=new yM,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:qx(IE({level:(e==null?void 0:e.logger)||h$})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Pte(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:N6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,TE(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:rn("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=m$(this.session.namespaces);this.namespaces=nS(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=m$(s.namespaces);this.namespaces=nS(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Ste)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===W1?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(rf(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await OE.init({core:this.providerOpts.core,logger:this.providerOpts.logger||h$,relayUrl:this.providerOpts.relayUrl||BBe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>lb(r)))];sS("client",this.client),sS("events",this.events),sS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=GBe(r,this.session),i=Ite(n),s=nS(this.namespaces,this.optionalNamespaces),o=oS(N6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new eLe({namespace:o});break;case"algorand":this.rpcProviders[r]=new nLe({namespace:o});break;case"solana":this.rpcProviders[r]=new tLe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new rLe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new KBe({namespace:o});break;case"cip34":this.rpcProviders[r]=new iLe({namespace:o});break;case"elrond":this.rpcProviders[r]=new sLe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new oLe({namespace:o});break;case"near":this.rpcProviders[r]=new aLe({namespace:o});break;case"tezos":this.rpcProviders[r]=new cLe({namespace:o});break;default:this.rpcProviders[W1]?this.rpcProviders[W1].updateNamespace(o):this.rpcProviders[W1]=new lLe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&rf(i)&&this.events.emit("accountsChanged",i.map(WBe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=lb(i),a=iS(i)!==iS(s)?`${o}:${iS(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=oS(N6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",oS(N6({},rn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(hc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[W1]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>lb(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=lb(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${p$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${p$}/${e}`)}};const gLe=vLe,yLe="wc",mLe="ethereum_provider",bLe=`${yLe}@2:${mLe}:`,wLe="https://rpc.walletconnect.org/v1/",EI=["eth_sendTransaction","personal_sign"],xLe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],CI=["chainChanged","accountsChanged"],ELe=["chainChanged","accountsChanged","message","disconnect","connect"];var CLe=Object.defineProperty,ALe=Object.defineProperties,SLe=Object.getOwnPropertyDescriptors,S$=Object.getOwnPropertySymbols,_Le=Object.prototype.hasOwnProperty,ILe=Object.prototype.propertyIsEnumerable,_$=(t,e,r)=>e in t?CLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,K1=(t,e)=>{for(var r in e||(e={}))_Le.call(e,r)&&_$(t,r,e[r]);if(S$)for(var r of S$(e))ILe.call(e,r)&&_$(t,r,e[r]);return t},aS=(t,e)=>ALe(t,SLe(e));function p4(t){return Number(t[0].split(":")[1])}function B6(t){return`0x${t.toString(16)}`}function TLe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!rf(e))throw new Error("Invalid chains");const c={chains:e,methods:n||EI,events:s||CI,rpcMap:K1({},e.length?{[p4(e)]:a[p4(e)]}:{})},l=s==null?void 0:s.filter(g=>!CI.includes(g)),f=n==null?void 0:n.filter(g=>!EI.includes(g));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,p={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:xLe))],events:[...new Set(c.events.concat(o!=null&&o.length?o:ELe))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?p:void 0}}let PLe=class kte{constructor(){this.events=new ba.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=bLe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new kte;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=TLe(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(aS(K1({namespaces:K1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=Yj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:B6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(aS(K1({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=Yj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:B6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",B6(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",aS(K1({},rn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",B6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||EI:[],c=i.length?(e==null?void 0:e.events)||CI:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),p=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:p,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?p4(this.rpc.chains):p4(this.rpc.optionalChains),this.signer=await gLe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await R9e(()=>import("./index-BSEof6bf.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(K1({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&rf(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&rf(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${wLe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};var Mte={exports:{}};/*! +}`;var pr=OO(function(){return Lr(se,Mt+"return "+Ve).apply(r,he)});if(pr.source=Ve,NC(pr))throw pr;return pr}function cae(d){return Qr(d).toLowerCase()}function lae(d){return Qr(d).toUpperCase()}function fae(d,h,A){if(d=Qr(d),d&&(A||h===r))return Fu(d);if(!d||!(h=Vo(h)))return d;var U=po(d),J=po(h),se=Yx(U,J),he=Qx(U,J)+1;return Ku(U,se,he).join("")}function uae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.slice(0,Zy(d)+1);if(!d||!(h=Vo(h)))return d;var U=po(d),J=Qx(U,po(h))+1;return Ku(U,0,J).join("")}function dae(d,h,A){if(d=Qr(d),d&&(A||h===r))return d.replace(Nt,"");if(!d||!(h=Vo(h)))return d;var U=po(d),J=Yx(U,po(h));return Ku(U,J).join("")}function hae(d,h){var A=ce,U=K;if(Mn(h)){var J="separator"in h?h.separator:J;A="length"in h?hr(h.length):A,U="omission"in h?Vo(h.omission):U}d=Qr(d);var se=d.length;if(Yr(d)){var he=po(d);se=he.length}if(A>=se)return d;var ye=A-uf(U);if(ye<1)return U;var Ce=he?Ku(he,0,ye).join(""):d.slice(0,ye);if(J===r)return Ce+U;if(he&&(ye+=Ce.length-ye),BC(J)){if(d.slice(ye).search(J)){var Fe,je=Ce;for(J.global||(J=Xy(J.source,Qr(tr.exec(J))+"g")),J.lastIndex=0;Fe=J.exec(je);)var Ve=Fe.index;Ce=Ce.slice(0,Ve===r?ye:Ve)}}else if(d.indexOf(Vo(J),ye)!=ye){var ft=Ce.lastIndexOf(J);ft>-1&&(Ce=Ce.slice(0,ft))}return Ce+U}function pae(d){return d=Qr(d),d&&Ot.test(d)?d.replace(ir,t2):d}var vae=A1(function(d,h,A){return d+(A?" ":"")+h.toUpperCase()}),jC=DR("toUpperCase");function RO(d,h,A){return d=Qr(d),h=A?r:h,h===r?Jx(d)?KE(d):LE(d):d.match(h)||[]}var OO=yr(function(d,h){try{return fi(d,r,h)}catch(A){return NC(A)?A:new Zt(A)}}),gae=yf(function(d,h){return ho(h,function(A){A=sl(A),vf(d,A,OC(d[A],d))}),d});function yae(d){var h=d==null?0:d.length,A=Wt();return d=h?fn(d,function(U){if(typeof U[1]!="function")throw new vo(o);return[A(U[0]),U[1]]}):[],yr(function(U){for(var J=-1;++JE)return[];var A=T,U=dr(d,T);h=Wt(h),d-=T;for(var J=qh(U,h);++A0||h<0)?new Tr(A):(d<0?A=A.takeRight(-d):d&&(A=A.drop(d)),h!==r&&(h=hr(h),A=h<0?A.dropRight(-h):A.take(h-d)),A)},Tr.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Tr.prototype.toArray=function(){return this.take(T)},nl(Tr.prototype,function(d,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),U=/^(?:head|last)$/.test(h),J=ne[U?"take"+(h=="last"?"Right":""):h],se=U||/^find/.test(h);J&&(ne.prototype[h]=function(){var he=this.__wrapped__,ye=U?[1]:arguments,Ce=he instanceof Tr,Fe=ye[0],je=Ce||sr(he),Ve=function(Cr){var Or=J.apply(ne,tl([Cr],ye));return U&&ft?Or[0]:Or};je&&A&&typeof Fe=="function"&&Fe.length!=1&&(Ce=je=!1);var ft=this.__chain__,Mt=!!this.__actions__.length,Kt=se&&!ft,pr=Ce&&!Mt;if(!se&&je){he=pr?he:new Tr(this);var Yt=d.apply(he,ye);return Yt.__actions__.push({func:E2,args:[Ve],thisArg:r}),new wa(Yt,ft)}return Kt&&pr?d.apply(this,ye):(Yt=this.thru(Ve),Kt?U?Yt.value()[0]:Yt.value():Yt)})}),ho(["pop","push","shift","sort","splice","unshift"],function(d){var h=p1[d],A=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",U=/^(?:pop|shift)$/.test(d);ne.prototype[d]=function(){var J=arguments;if(U&&!this.__chain__){var se=this.value();return h.apply(sr(se)?se:[],J)}return this[A](function(he){return h.apply(sr(he)?he:[],J)})}}),nl(Tr.prototype,function(d,h){var A=ne[h];if(A){var U=A.name+"";Gr.call(uc,U)||(uc[U]=[]),uc[U].push({name:h,func:A})}}),uc[v2(r,C).name]=[{name:"wrapper",func:r}],Tr.prototype.clone=pre,Tr.prototype.reverse=vre,Tr.prototype.value=gre,ne.prototype.at=Hie,ne.prototype.chain=Gie,ne.prototype.commit=Wie,ne.prototype.next=Kie,ne.prototype.plant=Qie,ne.prototype.reverse=Jie,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=Zie,ne.prototype.first=ne.prototype.head,q&&(ne.prototype[q]=Yie),ne},ju=YE();pn?((pn.exports=ju)._=ju,rn._=ju):Er._=ju}).call(Ei)})(c4,c4.exports);var IBe=c4.exports,mI={exports:{}};(function(t,e){var r=typeof self<"u"?self:Ei,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(v){return v&&DataView.prototype.isPrototypeOf(v)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(v){return v&&l.indexOf(Object.prototype.toString.call(v))>-1};function u(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function p(v){return typeof v!="string"&&(v=String(v)),v}function g(v){var m={next:function(){var R=v.shift();return{done:R===void 0,value:R}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,R){this.append(R,m)},this):Array.isArray(v)?v.forEach(function(m){this.append(m[0],m[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(m){this.append(m,v[m])},this)}y.prototype.append=function(v,m){v=u(v),m=p(m);var R=this.map[v];this.map[v]=R?R+", "+m:m},y.prototype.delete=function(v){delete this.map[u(v)]},y.prototype.get=function(v){return v=u(v),this.has(v)?this.map[v]:null},y.prototype.has=function(v){return this.map.hasOwnProperty(u(v))},y.prototype.set=function(v,m){this.map[u(v)]=p(m)},y.prototype.forEach=function(v,m){for(var R in this.map)this.map.hasOwnProperty(R)&&v.call(m,this.map[R],R,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,R){v.push(R)}),g(v)},y.prototype.values=function(){var v=[];return this.forEach(function(m){v.push(m)}),g(v)},y.prototype.entries=function(){var v=[];return this.forEach(function(m,R){v.push([R,m])}),g(v)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function b(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function I(v){return new Promise(function(m,R){v.onload=function(){m(v.result)},v.onerror=function(){R(v.error)}})}function C(v){var m=new FileReader,R=I(m);return m.readAsArrayBuffer(v),R}function S(v){var m=new FileReader,R=I(m);return m.readAsText(v),R}function O(v){for(var m=new Uint8Array(v),R=new Array(m.length),B=0;B-1?m:v}function $(v,m){m=m||{};var R=m.body;if(v instanceof $){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,m.headers||(this.headers=new y(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!R&&v._bodyInit!=null&&(R=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new y(m.headers)),this.method=_(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&R)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(R)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(R){if(R){var B=R.split("="),E=B.shift().replace(/\+/g," "),x=B.join("=").replace(/\+/g," ");m.append(decodeURIComponent(E),decodeURIComponent(x))}}),m}function ce(v){var m=new y,R=v.replace(/\r?\n[\t ]+/g," ");return R.split(/\r?\n/).forEach(function(B){var E=B.split(":"),x=E.shift().trim();if(x){var w=E.join(":").trim();m.append(x,w)}}),m}F.call($.prototype);function K(v,m){m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in m?m.statusText:"OK",this.headers=new y(m.headers),this.url=m.url||"",this._initBody(v)}F.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},K.error=function(){var v=new K(null,{status:0,statusText:""});return v.type="error",v};var P=[301,302,303,307,308];K.redirect=function(v,m){if(P.indexOf(m)===-1)throw new RangeError("Invalid status code");return new K(null,{status:m,headers:{location:v}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(m,R){this.message=m,this.name=R;var B=Error(m);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(v,m){return new Promise(function(R,B){var E=new $(v,m);if(E.signal&&E.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function w(){x.abort()}x.onload=function(){var T={status:x.status,statusText:x.statusText,headers:ce(x.getAllResponseHeaders()||"")};T.url="responseURL"in x?x.responseURL:T.headers.get("X-Request-URL");var k="response"in x?x.response:x.responseText;R(new K(k,T))},x.onerror=function(){B(new TypeError("Network request failed"))},x.ontimeout=function(){B(new TypeError("Network request failed"))},x.onabort=function(){B(new o.DOMException("Aborted","AbortError"))},x.open(E.method,E.url,!0),E.credentials==="include"?x.withCredentials=!0:E.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&a.blob&&(x.responseType="blob"),E.headers.forEach(function(T,k){x.setRequestHeader(k,T)}),E.signal&&(E.signal.addEventListener("abort",w),x.onreadystatechange=function(){x.readyState===4&&E.signal.removeEventListener("abort",w)}),x.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return M.polyfill=!0,s.fetch||(s.fetch=M,s.Headers=y,s.Request=$,s.Response=K),o.Headers=y,o.Request=$,o.Response=K,o.fetch=M,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(mI,mI.exports);var TBe=mI.exports;const n$=Su(TBe);var PBe=Object.defineProperty,kBe=Object.defineProperties,MBe=Object.getOwnPropertyDescriptors,i$=Object.getOwnPropertySymbols,RBe=Object.prototype.hasOwnProperty,OBe=Object.prototype.propertyIsEnumerable,s$=(t,e,r)=>e in t?PBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o$=(t,e)=>{for(var r in e||(e={}))RBe.call(e,r)&&s$(t,r,e[r]);if(i$)for(var r of i$(e))OBe.call(e,r)&&s$(t,r,e[r]);return t},a$=(t,e)=>kBe(t,MBe(e));const DBe={Accept:"application/json","Content-Type":"application/json"},NBe="POST",c$={headers:DBe,method:NBe},l$=10;let Qc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new va.EventEmitter,this.isAvailable=!1,this.registering=!1,!PU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Au(e),n=await(await n$(this.url,a$(o$({},c$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!PU(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Au({id:1,jsonrpc:"2.0",method:"test",params:[]});await n$(e,a$(o$({},c$),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Lp(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=AE(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Xee(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>l$&&this.events.setMaxListeners(l$)}};const f$="error",BBe="wss://relay.walletconnect.org",LBe="wc",FBe="universal_provider",u$=`${LBe}@2:${FBe}:`,Cte="https://rpc.walletconnect.org/v1/",K1="generic",jBe=`${Cte}bundler`,ac={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var UBe=Object.defineProperty,$Be=Object.defineProperties,qBe=Object.getOwnPropertyDescriptors,d$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,h$=(t,e,r)=>e in t?UBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P6=(t,e)=>{for(var r in e||(e={}))VBe.call(e,r)&&h$(t,r,e[r]);if(d$)for(var r of d$(e))zBe.call(e,r)&&h$(t,r,e[r]);return t},HBe=(t,e)=>$Be(t,qBe(e));function ua(t,e,r){var n;const i=zv(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Cte}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function t1(t){return t.includes(":")?t.split(":")[1]:t}function Ate(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function GBe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function eS(t={},e={}){const r=p$(t),n=p$(e);return IBe.merge(r,n)}function p$(t){var e,r,n,i;const s={};if(!Mw(t))return s;for(const[o,a]of Object.entries(t)){const c=FM(o)?[o]:a.chains,l=a.methods||[],f=a.events||[],u=a.rpcMap||{},p=cb(o);s[p]=HBe(P6(P6({},s[p]),a),{chains:I3(c,(e=s[p])==null?void 0:e.chains),methods:I3(l,(r=s[p])==null?void 0:r.methods),events:I3(f,(n=s[p])==null?void 0:n.events),rpcMap:P6(P6({},u),(i=s[p])==null?void 0:i.rpcMap)})}return s}function WBe(t){return t.includes(":")?t.split(":")[2]:t}function v$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=FM(r)?[r]:n.chains?n.chains:Ate(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function tS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Ste={},zr=t=>Ste[t],rS=(t,e)=>{Ste[t]=e};class KBe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}var YBe=Object.defineProperty,QBe=Object.defineProperties,JBe=Object.getOwnPropertyDescriptors,g$=Object.getOwnPropertySymbols,ZBe=Object.prototype.hasOwnProperty,XBe=Object.prototype.propertyIsEnumerable,y$=(t,e,r)=>e in t?YBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m$=(t,e)=>{for(var r in e||(e={}))ZBe.call(e,r)&&y$(t,r,e[r]);if(g$)for(var r of g$(e))XBe.call(e,r)&&y$(t,r,e[r]);return t},b$=(t,e)=>QBe(t,JBe(e));class eLe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||ua(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(t1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:b$(m$({},o.sessionProperties||{}),{capabilities:b$(m$({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Fd("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${jBe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class tLe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}class rLe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}class nLe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||ua(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new oc(new Qc(n,zr("disableProviderPing")))}}class iLe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=t1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}class sLe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}class oLe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=t1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}class aLe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ua(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace);return typeof n>"u"?void 0:new oc(new Qc(n,zr("disableProviderPing")))}}class cLe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ua(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace);return typeof n>"u"?void 0:new oc(new Qc(n))}}class lLe{constructor(e){this.name=K1,this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(ac.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=zv(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ua(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new oc(new Qc(n,zr("disableProviderPing")))}}var fLe=Object.defineProperty,uLe=Object.defineProperties,dLe=Object.getOwnPropertyDescriptors,w$=Object.getOwnPropertySymbols,hLe=Object.prototype.hasOwnProperty,pLe=Object.prototype.propertyIsEnumerable,x$=(t,e,r)=>e in t?fLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k6=(t,e)=>{for(var r in e||(e={}))hLe.call(e,r)&&x$(t,r,e[r]);if(w$)for(var r of w$(e))pLe.call(e,r)&&x$(t,r,e[r]);return t},nS=(t,e)=>uLe(t,dLe(e));let vLe=class _te{constructor(e){this.events=new pM,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:$x(EE({level:(e==null?void 0:e.logger)||f$})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new _te(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:k6({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,CE(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:sn("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=v$(this.session.namespaces);this.namespaces=eS(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=v$(s.namespaces);this.namespaces=eS(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Ete)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===K1?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Ql(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await TE.init({core:this.providerOpts.core,logger:this.providerOpts.logger||f$,relayUrl:this.providerOpts.relayUrl||BBe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>cb(r)))];rS("client",this.client),rS("events",this.events),rS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=GBe(r,this.session),i=Ate(n),s=eS(this.namespaces,this.optionalNamespaces),o=nS(k6({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new eLe({namespace:o});break;case"algorand":this.rpcProviders[r]=new nLe({namespace:o});break;case"solana":this.rpcProviders[r]=new tLe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new rLe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new KBe({namespace:o});break;case"cip34":this.rpcProviders[r]=new iLe({namespace:o});break;case"elrond":this.rpcProviders[r]=new sLe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new oLe({namespace:o});break;case"near":this.rpcProviders[r]=new aLe({namespace:o});break;case"tezos":this.rpcProviders[r]=new cLe({namespace:o});break;default:this.rpcProviders[K1]?this.rpcProviders[K1].updateNamespace(o):this.rpcProviders[K1]=new lLe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Ql(i)&&this.events.emit("accountsChanged",i.map(WBe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=cb(i),a=tS(i)!==tS(s)?`${o}:${tS(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=nS(k6({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",nS(k6({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(ac.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[K1]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>cb(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=cb(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${u$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${u$}/${e}`)}};const gLe=vLe,yLe="wc",mLe="ethereum_provider",bLe=`${yLe}@2:${mLe}:`,wLe="https://rpc.walletconnect.org/v1/",bI=["eth_sendTransaction","personal_sign"],xLe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],wI=["chainChanged","accountsChanged"],ELe=["chainChanged","accountsChanged","message","disconnect","connect"];var CLe=Object.defineProperty,ALe=Object.defineProperties,SLe=Object.getOwnPropertyDescriptors,E$=Object.getOwnPropertySymbols,_Le=Object.prototype.hasOwnProperty,ILe=Object.prototype.propertyIsEnumerable,C$=(t,e,r)=>e in t?CLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y1=(t,e)=>{for(var r in e||(e={}))_Le.call(e,r)&&C$(t,r,e[r]);if(E$)for(var r of E$(e))ILe.call(e,r)&&C$(t,r,e[r]);return t},iS=(t,e)=>ALe(t,SLe(e));function l4(t){return Number(t[0].split(":")[1])}function M6(t){return`0x${t.toString(16)}`}function TLe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!Ql(e))throw new Error("Invalid chains");const c={chains:e,methods:n||bI,events:s||wI,rpcMap:Y1({},e.length?{[l4(e)]:a[l4(e)]}:{})},l=s==null?void 0:s.filter(g=>!wI.includes(g)),f=n==null?void 0:n.filter(g=>!bI.includes(g));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const u=(l==null?void 0:l.length)&&(f==null?void 0:f.length)||!r,p={chains:[...new Set(u?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:xLe))],events:[...new Set(c.events.concat(o!=null&&o.length?o:ELe))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?p:void 0}}let PLe=class Ite{constructor(){this.events=new va.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=bLe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Ite;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=TLe(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(iS(Y1({namespaces:Y1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=Gj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:M6(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(iS(Y1({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=Gj(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:M6(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",M6(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",iS(Y1({},sn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",M6(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||bI:[],c=i.length?(e==null?void 0:e.events)||wI:[],l=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],u=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),p=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:a,events:c,optionalMethods:l,optionalEvents:f,rpcMap:u,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:p,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?l4(this.rpc.chains):l4(this.rpc.optionalChains),this.signer=await gLe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await R9e(()=>import("./index-SPESv6LF.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Y1({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Ql(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Ql(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${wLe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};var Tte={exports:{}};/*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * * Copyright (c) 2013 hij1nx * Licensed under the MIT license. - */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(x){return Object.prototype.toString.call(x)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",f=l?setImmediate:setTimeout,u=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(E){var x=Object.getOwnPropertyNames(E);return x.push.apply(x,Object.getOwnPropertySymbols(E)),x}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(E){E&&(this._conf=E,E.delimiter&&(this.delimiter=E.delimiter),E.maxListeners!==r&&(this._maxListeners=E.maxListeners),E.wildcard&&(this.wildcard=E.wildcard),E.newListener&&(this._newListener=E.newListener),E.removeListener&&(this._removeListener=E.removeListener),E.verboseMemoryLeak&&(this.verboseMemoryLeak=E.verboseMemoryLeak),E.ignoreErrors&&(this.ignoreErrors=E.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(E,x){var w="(node) warning: possible EventEmitter memory leak detected. "+E+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+x+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=E,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(E,x,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[E];case 2:return[E,x];case 3:return[E,x,w];default:for(var k=new Array(T);T--;)k[T]=arguments[T];return k}};function I(E,x){for(var w={},T,k=E.length,H=0,oe=0;oe0;)E=H[X],oe.call(j,E,w[E]);this._listeners={},this._listenersCount=0,G()}}});function S(E,x,w,T){var k=Object.assign({},x);if(!E)return k;if(typeof E!="object")throw TypeError("options must be an object");var H=Object.keys(E),oe=H.length,j,X,G;function Z(N){throw Error('Invalid "'+j+'" option value'+(N?". Reason: "+N:""))}for(var ee=0;ee0;)if(j===E[X])return H;oe(x)}}var F=L(["function"]),z=L(["object","function"]);function _(E,x,w){var T,k,H=0,oe,j=new E(function(X,G,Z){w=S(w,{timeout:0,overload:!1},{timeout:function(fe,Ee){return fe*=1,(typeof fe!="number"||fe<0||!Number.isFinite(fe))&&Ee("timeout must be a positive number"),fe}}),T=!w.overload&&typeof E.prototype.cancel=="function"&&typeof Z=="function";function ee(){k&&(k=null),H&&(clearTimeout(H),H=0)}var N=function(fe){ee(),X(fe)},te=function(fe){ee(),G(fe)};T?x(N,te,Z):(k=[function(fe){te(fe||Error("canceled"))}],x(N,te,function(fe){if(oe)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof fe!="function")throw TypeError("onCancel callback must be a function");k.push(fe)}),oe=!0),w.timeout>0&&(H=setTimeout(function(){var fe=Error("timeout");fe.code="ETIMEDOUT",H=0,j.cancel(fe),G(fe)},w.timeout))});return T||(j.cancel=function(X){if(k){for(var G=k.length,Z=1;Z0;)te=ze[j],te!=="_listeners"&&(et=ie(E,x,w[te],T+1,k),et&&(N?N.push.apply(N,et):N=et));return N}else if(Te==="**"){for(Re=T+1===k||T+2===k&&De==="*",Re&&w._listeners&&(N=ie(E,x,w,k,k)),ze=u(w),j=ze.length;j-- >0;)te=ze[j],te!=="_listeners"&&(te==="*"||te==="**"?(w[te]._listeners&&!Re&&(et=ie(E,x,w[te],k,k),et&&(N?N.push.apply(N,et):N=et)),et=ie(E,x,w[te],T,k)):te===De?et=ie(E,x,w[te],T+2,k):et=ie(E,x,w[te],T,k),et&&(N?N.push.apply(N,et):N=et));return N}else w[Te]&&(N=ie(E,x,w[Te],T+1,k));if(fe=w["*"],fe&&ie(E,x,fe,T+1,k),Ee=w["**"],Ee)if(T0;)te=ze[j],te!=="_listeners"&&(te===De?ie(E,x,Ee[te],T+2,k):te===Te?ie(E,x,Ee[te],T+1,k):(_e={},_e[te]=Ee[te],ie(E,x,{"**":_e},T+1,k)));else Ee._listeners?ie(E,x,Ee,k,k):Ee["*"]&&Ee["*"]._listeners&&ie(E,x,Ee["*"],k,k);return N}function ce(E,x,w){var T=0,k=0,H,oe=this.delimiter,j=oe.length,X;if(typeof E=="string")if((H=E.indexOf(oe))!==-1){X=new Array(5);do X[T++]=E.slice(k,H),k=H+j;while((H=E.indexOf(oe,k))!==-1);X[T++]=E.slice(k)}else X=[E],T=1;else X=E,T=E.length;if(T>1){for(H=0;H+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,y.call(this,G._listeners.length,Z))):G._listeners=x,!0;return!0}function K(E,x,w,T){for(var k=u(E),H=k.length,oe,j,X,G=E._listeners,Z;H-- >0;)j=k[H],oe=E[j],j==="_listeners"?X=w:X=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&x.push(Z?X:X.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,x,X,Z);return x}function P(E){for(var x=u(E),w=x.length,T,k,H;w-- >0;)k=x[w],T=E[k],T&&(H=!0,k!=="_listeners"&&!P(T)&&delete E[k]);return H}function M(E,x,w){this.emitter=E,this.event=x,this.listener=w}M.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(E,x,w){if(w===!0)k=!0;else if(w===!1)T=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var T=w.async,k=w.promisify,H=w.nextTick,oe=w.objectify}if(T||H||k){var j=x,X=x._origin||x;if(H&&!o)throw Error("process.nextTick is not supported");k===r&&(k=x.constructor.name==="AsyncFunction"),x=function(){var G=arguments,Z=this,ee=this.event;return k?H?Promise.resolve():new Promise(function(N){f(N)}).then(function(){return Z.event=ee,j.apply(Z,G)}):(H?process.nextTick:f)(function(){Z.event=ee,j.apply(Z,G)})},x._async=!0,x._origin=X}return[x,oe?new M(this,E,x):this]}function m(E){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,E)}m.EventEmitter2=m,m.prototype.listenTo=function(E,x,w){if(typeof E!="object")throw TypeError("target musts be an object");var T=this;w=S(w,{on:r,off:r,reducers:r},{on:F,off:F,reducers:z});function k(H){if(typeof H!="object")throw TypeError("events must be an object");var oe=w.reducers,j=$.call(T,E),X;j===-1?X=new C(T,E,w):X=T._observers[j];for(var G=u(H),Z=G.length,ee,N=typeof oe=="function",te=0;te0;)k=w[T],(!E||k._target===E)&&(k.unsubscribe(x),H=!0);return H},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(E){E!==r&&(this._maxListeners=E,this._conf||(this._conf={}),this._conf.maxListeners=E)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(E,x,w){return this._once(E,x,!1,w)},m.prototype.prependOnceListener=function(E,x,w){return this._once(E,x,!0,w)},m.prototype._once=function(E,x,w,T){return this._many(E,1,x,w,T)},m.prototype.many=function(E,x,w,T){return this._many(E,x,w,!1,T)},m.prototype.prependMany=function(E,x,w,T){return this._many(E,x,w,!0,T)},m.prototype._many=function(E,x,w,T,k){var H=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--x===0&&H.off(E,oe),w.apply(this,arguments)}return oe._origin=w,this._on(E,oe,T,k)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var E=arguments[0],x,w=this.wildcard,T,k,H,oe,j;if(E==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(x=E,E!=="newListener"&&E!=="removeListener"&&typeof E=="object")){if(k=E.length,a){for(H=0;H3)for(T=new Array(X-1),oe=1;oe3)for(k=new Array(G-1),j=1;j0&&this._events[E].length>this._maxListeners&&(this._events[E].warned=!0,y.call(this,this._events[E].length,E))):this._events[E]=x,k)},m.prototype.off=function(E,x){if(typeof x!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var k=typeof E=="string"?E.split(this.delimiter):E.slice();if(T=ie.call(this,null,k,this.listenerTree,0),!T)return this}else{if(!this._events[E])return this;w=this._events[E],T.push({_listeners:w})}for(var H=0;H0){for(T=this._all,x=0,w=T.length;x0;)T=x[w[H]],typeof T=="function"?k.push(T):k.push.apply(k,T);return k}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],X=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,j,X,oe,0),j}return x?(T=x[E],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(E){var x=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,E):x?u(x):[]},m.prototype.listenerCount=function(E){return this.listeners(E).length},m.prototype.hasListeners=function(E){if(this.wildcard){var x=[],w=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,x,w,this.listenerTree,0),x.length>0}var T=this._events,k=this._all;return!!(k&&k.length||T&&(E===r?u(T).length:T[E]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(E,x){var w=this,T=typeof x;return T==="number"?x={timeout:x}:T==="function"&&(x={filter:x}),x=S(x,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:O}),_(x.Promise,function(k,H,oe){function j(){var X=x.filter;if(!(X&&!X.apply(w,arguments)))if(w.off(E,j),x.handleError){var G=arguments[0];G?H(G):k(b.apply(null,arguments).slice(1))}else k(b.apply(null,arguments))}oe(function(){w.off(E,j)}),w._on(E,j,!1)},{timeout:x.timeout,overload:x.overload})};function R(E,x,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:O});var T=w.Promise;return _(T,function(k,H,oe){var j;if(typeof E.addEventListener=="function"){j=function(){k(b.apply(null,arguments))},oe(function(){E.removeEventListener(x,j)}),E.addEventListener(x,j,{once:!0});return}var X=function(){G&&E.removeListener("error",G),k(b.apply(null,arguments))},G;x!=="error"&&(G=function(Z){E.removeListener(x,X),H(Z)},E.once("error",G)),oe(function(){G&&E.removeListener("error",G),E.removeListener(x,X)}),E.once(x,X)},{timeout:w.timeout,overload:w.overload})}var B=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return B._maxListeners},set:function(E){if(typeof E!="number"||E<0||Number.isNaN(E))throw TypeError("n must be a non-negative number");B._maxListeners=E},enumerable:!0},once:{value:R,writable:!0,configurable:!0}}),Object.defineProperties(B,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Mte);var kLe=Mte.exports,AI=function(){return AI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),OLe=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},DLe=function(t,e,r){return E0(void 0,void 0,void 0,function(){var n,i;return C0(this,function(s){return n=r.messageDigest(),i=A4e(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},NLe=function(t,e,r){return E0(void 0,void 0,void 0,function(){var n,i,s,o,a;return C0(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Dn(r.address,s,t),[4,o.isValidSignature(n,Ue(r.signature))];case 2:return a=c.sent(),a===BLe?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},BLe="0x1626ba7e",LLe=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),E0(n,void 0,void 0,function(){var o,a,c,l,f,u,p,g,y,b;return C0(this,function(I){switch(I.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],f=o[3],u=o[4],a!==SI)throw new Error("ethauth: not an ethauth proof");return p=MF.decode(l),g=JSON.parse(p),y=new Ote({address:c,claims:g,signature:f,extra:u}),[4,this.validateProof(y,s)];case 1:if(b=I.sent(),!b)throw new Error("ethauth: proof is invalid");return[2,y]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),E0(n,void 0,void 0,function(){var o,a;return C0(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return E0(n,void 0,void 0,function(){var s,c,o,a,c;return C0(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(c{const n=Qt(await t.getAddress());if(!n||n===""||n==="0x")throw ULe;const i=new Ote;if(i.address=n,!r||!r.app||r.app==="")throw new Dte("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):FLe);const s=i.messageTypedData(),o=c9e(e);i.signature=await(t instanceof Ix?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new LLe().encodeProof(i,!0);return{typedData:s,proofString:c}};class Dte extends Error{constructor(e){super(e),this.name="AuthError"}}const ULe=new Dte("auth error: account address is empty");mt.context.defaultContexts,new aX.remote.RemoteConfigTracker("https://sessions.sequence.app");const $Le=new Map(["addHook(bytes4,address)","clearExtraImageHashes(bytes32[])","removeHook(bytes4)","setExtraImageHash(bytes32,uint256)","updateIPFSRoot(bytes32)","updateImageHash(bytes32)","updateImageHashAndIPFS(bytes32,bytes32)","updateImplementation(address)"].map(t=>[Oo(t).slice(0,10),t]));function _I(t,e){const r=mt.transaction.fromTransactionish(t,e);mt.transaction.unwind(t,r).forEach(i=>qLe(t,i))}function qLe(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=Ue(e.data);if(r.length>=4&&!VLe(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden");if(e.data){const n=Me(e.data).slice(0,10),i=$Le.get(n);if(i){const s=i.slice(0,i.indexOf("("));throw new Error(`${s} calls are forbidden`)}}}function VLe(t){const e=new $i(Ps.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}function $c(){return $c=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.predicate(t))}const WLe=[{name:"Decentraland Exception",predicate:YLe},{name:"0x v3 Exception",predicate:QLe}],KLe=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function YLe(t){try{const e=Ip(t);return KLe.test(e)}catch{return!1}}function QLe(t){const e=new $i(JLe);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const JLe=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],F3=Ii(`Ethereum Signed Message: -`),ZLe=t=>mu(t)?Ue(t):Ii(t),Nte=t=>{const e=ZLe(t);return GLe(e)?e:Ue(qr([F3,Ii(String(e.length)),e]))},XLe=t=>{if(JSON.stringify(t.slice(0,F3.length))!==JSON.stringify(F3))return t;const e=t.slice(F3.length),r=String(e.length).length;let n,i;try{i=Number(Ip(e.slice(0,r)))}catch{i=Number(Me(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},I$=async(t,e,r,n)=>new mt.reader.OnChainReader(n).isValidSignature(t,e,r);async function eFe(t){return Array.isArray(t)?Promise.all(t.map(e=>vi(e))):vi(t)}function tFe(t){return[t,...t.auxiliary||[]]}const rFe=1e4;class nFe{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new kLe.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=rFe){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ge.MAINNET,s=a9e(i).chainId,o={connected:!0,chainId:zc(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await jLe(this.account,s,a)}catch(c){return Ci.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}async sendMessageRequest(e){var r;const i=Number(((r=e.clientVersion)==null?void 0:r.split(".")[0])||"0")<2,s={id:e.data.id,jsonrpc:"2.0",result:null,error:void 0};try{const o=await this.request({method:e.data.method,params:e.data.params,chainId:e.chainId});return $c({},e,{data:i?$c({},s,{result:o}):o})}catch(o){return $c({},e,{data:i?$c({},s,{error:o}):{error:o}})}}async request(e){await this.getAccount();try{var r,n;if((!this.account||this.account===null)&&!iFe.includes(e.method))throw HLe;const l=this.account;if(!l)throw new Error("WalletRequestHandler: wallet account is not configured");const f=(r=this.account)==null?void 0:r.providerFor((n=e.chainId)!=null?n:this.defaultChainId());if(!f)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${e.chainId}`);const u=sFe(f)?f:void 0;switch(e.method){case"net_version":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("net_version",[])}case"eth_chainId":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("eth_chainId",[])}case"eth_accounts":return[l.address];case"eth_getBalance":{const[p,g]=e.params,y=await f.getBalance(p,g);return Nv(y)}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(e.method){case"sequence_sign":case"personal_sign":{const[I,C]=e.params;p=I;break}case"eth_sign":{const[I,C]=e.params;p=C;break}}let g="";const y=Nte(p),b=e.method==="sequence_sign";if(this.prompter===null){var i;g=await l.signMessage(y,(i=e.chainId)!=null?i:this.defaultChainId(),b?"eip6492":"ignore")}else g=await this.prompter.promptSignMessage({chainId:e.chainId,message:Ue(y),eip6492:b},this.connectOptions);if(g&&g.length>0)return g;throw new Error("declined by user")}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,g]=e.params;let y;if(typeof g=="string")try{y=JSON.parse(g)}catch(C){console.warn("walletRequestHandler: error parsing typedData",C)}else y=g;if(!y||!y.domain||!y.types||!y.message)throw new Error("invalid typedData object");let b="";const I=e.method==="sequence_signTypedData_v4";if(this.prompter===null){var s;b=await l.signTypedData(y.domain,y.types,y.message,(s=e.chainId)!=null?s:this.defaultChainId(),I?"eip6492":"ignore")}else b=await this.prompter.promptSignMessage({chainId:e.chainId,typedData:y,eip6492:I},this.connectOptions);if(b&&b.length>0)return b;throw new Error("declined by user")}case"eth_sendTransaction":{const p=tFe(e.params[0]).map(y=>("gas"in y&&y.gasLimit===void 0&&(y.gasLimit=y.gas,delete y.gas),y));_I(l.address,p);let g="";if(this.prompter===null){var o,a;const y=await l.sendTransaction(p,(o=e.chainId)!=null?o:this.defaultChainId());g=(a=y==null?void 0:y.hash)!=null?a:""}else g=await this.prompter.promptSendTransaction(p,e.chainId,this.connectOptions);if(g)return g;throw new Error("declined by user")}case"eth_signTransaction":{const[p]=e.params;if(Qt(p.from)!==l.address)throw new Error("sender address does not match wallet");if(_I(l.address,p),this.prompter===null){var c;return await l.signTransactions(p,(c=e.chainId)!=null?c:this.defaultChainId())}else return await this.prompter.promptSignTransaction(p,e.chainId,this.connectOptions)}case"eth_sendRawTransaction":if(mt.transaction.isSignedTransactionBundle(e.params[0])){const p=Number(e.params[0].chainId);return(await l.relayer(p).relay(e.params[0])).hash}else return(await f.broadcastTransaction(e.params[0])).hash;case"eth_getTransactionCount":{const p=Qt(e.params[0]),g=e.params[1],y=await f.getTransactionCount(p,g);return Nv(BigInt(y))}case"eth_blockNumber":return await f.getBlockNumber();case"eth_getBlockByNumber":return await f.getBlock(e.params[0]);case"eth_getBlockByHash":return await f.getBlock(e.params[0]);case"eth_getTransactionByHash":return await f.getTransaction(e.params[0]);case"eth_call":{const[p,g]=e.params;return await f.call($c({},p,{blockTag:g}))}case"eth_getCode":{const[p,g]=e.params;return await f.getCode(p,g)}case"eth_estimateGas":{const[p]=e.params;return await f.estimateGas(p)}case"eth_gasPrice":{const p=await f.getFeeData();return p.gasPrice===null?null:Nv(p.gasPrice)}case"wallet_switchEthereumChain":{const[p]=e.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const g=BigInt(p.chainId);return this.setDefaultChainId(Number(g)),null}case"sequence_getWalletContext":return l.contexts;case"sequence_getWalletConfig":{const[p]=e.params;return p?[(await l.status(p)).onChain.config]:await Promise.all(l.networks.map(async function(g){return(await l.status(g.chainId)).onChain.config}))}case"sequence_getWalletState":{const[p]=e.params;return p?[T$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return T$(g.chainId,y)}))}case"sequence_getNetworks":return await this.getNetworks(!0);case"sequence_isSequence":return!0;case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=e.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");return this.setDefaultChainId(p),await this.getNetworks(!0)}default:{if(!u)throw new Error("Account provider doesn't support send method");return await u.send(e.method,e.params)}}}catch(l){throw Ci.error(l),{message:typeof l=="string"?l:(l==null?void 0:l.message)||"unkown error",code:4001}}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=$c({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(Ci.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>$c({},i,{provider:void 0,relayer:void 0}))};if(e){const i=Iw(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",zc(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",zc(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){Ci.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(Ci.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function T$(t,e){return{context:e.original.context,config:e.onChain.config,address:mt.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const iFe=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];function sFe(t){return t&&typeof t=="object"&&typeof t.send=="function"&&typeof t.getNetwork=="function"}function oFe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}class DE{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!KM.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new DE(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new Bte(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await eFe(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await new Promise(c=>{(async function f(){const u=await o.getTransaction(s);if(u!==null)return c(u);await o.once("block",f)})()})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r){return this.getProvider(r==null?void 0:r.chainId).call(e)}getChainId(){return Promise.resolve(this.client.getChainId())}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}getNonce(e){throw new Error("SequenceSigner does not support getNonce")}populateCall(e){throw new Error("SequenceSigner does not support populateCall")}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class Bte extends DE{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class aFe{constructor(e){if(this.signer=e,Bte.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return I$(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Nte(r),a=OEe(o);return I$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Dk(r),n,i)}}const cFe=["method"],P$=["connect","disconnect","chainChanged","accountsChanged"];class KM extends gJ{constructor(e,r,n=dM,i){super(e.getChainId(),i),this.client=e,this.providerFor=r,this.networks=n,this.options=i,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,this.eip1193EventListeners=new Map,e.onConnect(s=>{var o;(o=this.eip1193EventListeners.get("connect"))==null||o.forEach(a=>a(s))}),e.onDisconnect(s=>{var o;(o=this.eip1193EventListeners.get("disconnect"))==null||o.forEach(a=>a(s))}),e.onDefaultChainIdChanged(s=>{var o;(o=this.eip1193EventListeners.get("chainChanged"))==null||o.forEach(a=>a(s))}),e.onAccountsChanged(s=>{var o;(o=this.eip1193EventListeners.get("accountsChanged"))==null||o.forEach(a=>a(s))}),this.signer=new DE(this.client,this),this.utils=new aFe(this.signer)}async on(e,r){if(P$.includes(e)){const n=this.eip1193EventListeners.get(e)||new Set;return n.add(r),this.eip1193EventListeners.set(e,n),this}return super.on(e,r)}async off(e,r){if(P$.includes(e)){const n=this.eip1193EventListeners.get(e);return n&&(r?n.delete(r):n.clear()),this}return super.off(e,r)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect($c({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=Iw(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new lFe(this.client,this.providerFor,r,this.options)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async _perform(e){var r;const{method:n}=e,i=oFe(e,cFe),s=await this._getSubprovider(),o=(r=s.getRpcRequest(e))!=null?r:{method:n,args:Object.values(i)};if(!o)throw new Error(`Unsupported method ${e.method}`);return s.send(o.method,o.args)}async perform(e,r){if(e==="eth_chainId")return zc(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const n=r[0],i=Lte(n);return this.setDefaultChainId(i)}return e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4"?this.client.request({method:e,params:r,chainId:this.getChainId()}):this._perform($c({method:e},r))}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async _detectNetwork(){const e=this.client.getChainId(),r=Iw(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return new ca(r.name,r.chainId)}async detectNetwork(){return this._detectNetwork()}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getFeeData(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getFeeData()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorage(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorage(e,r,n)}async call(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).call(e)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBlock(e,r)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return vw(e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}KM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function Lte(t){return typeof t=="object"?Lte(t.chainId):Number(t)}class lFe extends KM{constructor(e,r,n,i){super(e,r,void 0,i),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=Iw(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return new ca(r.name,r.chainId)}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class Zr{constructor(e){de(this,"networkStore",Ir(Nn));de(this,"authStore",Ir(li));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"availableExternalProviders",Or([]));de(this,"selectedExternalProvider",Or(void 0));de(this,"selectedExternalWalletAddress",Or(void 0));de(this,"isSendingTokenTransaction",Or(void 0));de(this,"isSendingCollectibleTransaction",Or(void 0));de(this,"isSendingSignedTokenTransaction",Or(void 0));de(this,"connectDetails",Or(void 0));de(this,"connectOptions",Or(void 0));de(this,"isSigningTxn",Or(!1));de(this,"isSigningMsg",Or(!1));de(this,"toSignPermission",Or(void 0));de(this,"toSignResult",Or(void 0));de(this,"toSignTxnDetails",Or(void 0));de(this,"toSignMsgDetails",Or(void 0));de(this,"isCheckingWalletDeployment",Or(!1));de(this,"signClientWarningType",Or(!1));de(this,"walletRequestHandler");de(this,"local",{lastConnectedExternalProviderInfo:new Np(dh.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});de(this,"defaultNetwork",new Np(dh.DEFAULT_NETWORK));de(this,"getLastConnectedExternalProviderInfo",()=>this.local.lastConnectedExternalProviderInfo.get());de(this,"sendToken",async(e,r,n)=>{var i,s;try{const o=this.store.get(li).account,a=e.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Nn).providerForChainId(a);this.isSendingTokenTransaction.set({tokenBalance:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(!n)return{hash:""};if(e.contractType===hh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:E6e(n)}):e.contractType===hh.ERC20&&(console.info("Sending ERC20 token with address, on chainId: ",e.contractAddress,a),p=await new Dn(e.contractAddress,jv,c).transfer.populateTransaction(r,W7(n,((s=e.contractInfo)==null?void 0:s.decimals)??18))),!p)throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingTokenTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"sendCollectible",async(e,r,n)=>{var i,s;try{const o=this.store.get(li).account,a=e.collectibleInfoParams.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Nn).providerForChainId(a);this.isSendingCollectibleTransaction.set({collectibleInfo:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(e.collectibleInfoParams.contractType==="ERC721")console.info("Sending ERC721 non-fungible token with address, on chainId: ",e.collectibleInfoParams.address,a),p=await new Dn(e.collectibleInfoParams.address,hM,c).safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId);else if(e.collectibleInfoParams.contractType==="ERC1155"){console.info("Sending ERC1155 token with address, on chainId: ",e.collectibleInfoParams.address,a);const y=new Dn(e.collectibleInfoParams.address,pM,c);if(!n)return{hash:""};p=await y.safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId,W7(n,((s=e==null?void 0:e.collectibleInfoResponse)==null?void 0:s.decimals)??18),"0x")}if(!p)throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingCollectibleTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"setExternalProvider",async e=>{if(!e){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0),this.local.lastConnectedExternalProviderInfo.set(void 0);return}const n=(await this.getExternalProviderAccounts(e.provider))[0];this.local.lastConnectedExternalProviderInfo.set(e.info),this.selectedExternalProvider.set(e),this.selectedExternalWalletAddress.set(n),e.provider.on("accountsChanged",async i=>{if(i.length===0){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0);return}if(i[0]!==n){const o=(await this.getExternalProviderAccounts(e.provider))[0];this.selectedExternalWalletAddress.set(o)}})});de(this,"resetSignObservables",()=>{this.isSigningTxn.set(!1),this.toSignTxnDetails.set(void 0),this.toSignMsgDetails.set(void 0),this.toSignPermission.set(void 0),this.toSignResult.set(void 0)});de(this,"checkWalletDeployment",async e=>{const r=this.store.get(li).account;if(!r)throw new Error("No account found");return(await r.status(e)).onChain.deployed});this.store=e,this.walletRequestHandler=new nFe(void 0,new fFe(e),this.networkStore.networks.get()),this.walletRequestHandler.onConnectOptionsChange=n=>{this.connectOptions.set(n)},this.availableExternalProviders.subscribe(n=>{const i=this.local.lastConnectedExternalProviderInfo.get(),s=n.find(o=>(i==null?void 0:i.name)===o.info.name);s&&this.setExternalProvider(s)});const r=this.store.get(li).account;this.walletRequestHandler.signIn(r??null)}async sendTransaction(e,r,n,i,s){const o=await e.status(s),a=await e.predecorateTransactions(i,o,s),c=await e.signTransactions(a,s,void 0,{serial:!0}),l=await e.decorateTransactions(c,o);await this.switchToChain(r,s);const f=await r.request({method:"eth_estimateGas",params:[{from:n,to:l.entrypoint,data:mt.transaction.encodeBundleExecData(l)}]});return{hash:await r.request({method:"eth_sendTransaction",params:[{from:n,to:l.entrypoint,data:mt.transaction.encodeBundleExecData(l),gas:f}]})}}async getExternalProviderAccounts(e){return new Promise((r,n)=>{var i;(i=e.sendAsync)==null||i.call(e,{method:"eth_requestAccounts",params:[]},(s,o)=>{s&&n(s),o.result.length===0&&n(new Error("No accounts found")),r(o.result)})})}async getExternalProviderAddress(e){return(await this.getExternalProviderAccounts(e))[0]}async switchToChain(e,r){return new Promise((n,i)=>{var s;(s=e.sendAsync)==null||s.call(e,{method:"wallet_switchEthereumChain",params:[{chainId:zc(r)}]},(o,a)=>{o&&i(o),n(a)})})}}class fFe{constructor(e){this.store=e}getDefaultChainId(){return this.store.get(Zr).defaultNetwork.get()??1}async promptChangeNetwork(e){return this.store.get(Nn).networks.get().some(n=>n.chainId===e)?(this.store.get(Zr).defaultNetwork.set(e),!0):!1}async promptConfirmWalletDeploy(e,r){if(console.log("prompt confirm wallet deploy:",e,r),!e)return Promise.resolve(!1);const n=await this.store.get(Zr).checkWalletDeployment(e);return new Promise((i,s)=>{i(!!n)})}async promptConnect(e){console.log("promptconnect",e);const r=this.store.get(li).account;return await this.store.get(Zr).walletRequestHandler.signIn(r??null),e&&this.store.get(Zr).walletRequestHandler.setConnectOptions(e),new Promise((n,i)=>{const s=this.store.get(Zr).connectDetails.subscribe(o=>{s(),!o||!o.connected?i("connect cancelled by user"):n(o)})})}async promptSignInConnect(e){return console.log("prompt sign in connect:",e),{connected:!1}}async promptSignMessage(e,r){return console.log("prompt sign message:",e,r),e.chainId?e.eip6492!==!0&&!(await this.store.get(li).account.status(e.chainId)).canOnchainValidate&&!await this.promptConfirmWalletDeploy(e.chainId,r)?(this.store.get(Zr).signClientWarningType.set("notDeployed"),Promise.reject("User rejected wallet deploy request")):(this.store.get(Zr).isSigningMsg.set(!0),this.store.get(Zr).toSignMsgDetails.set({message:e,chainId:e.chainId,options:r}),new Promise((n,i)=>{const s=this.store.get(Zr).toSignPermission.subscribe(()=>{s();const o=this.store.get(Zr).toSignPermission.get();if(this.store.get(Zr).toSignPermission.set(void 0),!o||o==="cancelled")i("request failed");else{const a=this.store.get(Zr).toSignResult.get();a&&n(a.hash)}})})):Promise.reject("No chainId found in message")}promptSignTransaction(e,r,n){console.log("prompt sign transaction:",e,r,n);let i;Array.isArray(e)?i=e:i=[e];const s=this.store.get(li).accountAddress.get();if(!s)throw new Error("Unknown account address");const o=mt.transaction.fromTransactionish(s,i);return console.log("prompt sign txn:",o,r,n),_I(s,i),new Promise((a,c)=>{this.store.get(Zr).toSignTxnDetails.set({txn:i,chainId:r,options:n}),this.store.get(Zr).isSigningTxn.set(!0);const l=this.store.get(Zr).toSignPermission.subscribe(()=>{l();const f=this.store.get(Zr).toSignPermission.get();if(this.store.get(Zr).toSignPermission.set(void 0),!f||f==="cancelled")c("request failed");else{const u=this.store.get(Zr).toSignResult.get();u&&a(u.hash)}})})}promptSendTransaction(e,r,n){return this.promptSignTransaction(e,r,n)}}async function Fte(t){return await PLe.init({projectId:lX,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"TODO_CHANGE_LATER",icons:[]}})}function uFe(){const[t,e]=D.useState(null),n=Ir(Zr).getLastConnectedExternalProviderInfo();return D.useEffect(()=>{async function i(){const s=await Fte(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const k$=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let L6=[];const cS={value:()=>L6,subscribe:t=>{function e(r){L6.some(n=>n.info.uuid===r.detail.info.uuid)||(L6=[...L6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},jte=()=>D.useSyncExternalStore(cS.subscribe,cS.value,cS.value);class NE{constructor(e){de(this,"authStore",Ir(li));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"isReady",Or(!1));de(this,"signClient");de(this,"currentRequestInfo");de(this,"allSessions",Or([]));de(this,"sessions",this.allSessions.readOnly());de(this,"createSignClient",async()=>{this.signClient=await OE.init({projectId:lX,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"http://localhost:5173",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});de(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));de(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});de(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});de(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});de(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});de(this,"onSessionProposal",async e=>{var l,f,u,p,g;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Zr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const b=this.store.get(Nn).networks.get(),I=i.map(_=>Number(_.split(":").pop())),C=s.map(_=>Number(_.split(":").pop())),L={eip155:{accounts:b.map(_=>_.chainId).filter(_=>[...I,...C].includes(_)).map(_=>"eip155:"+_+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},F=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:L})),z=await(F==null?void 0:F.acknowledged());console.log("session",z),this.allSessions.set(this.getSignClientSessions()??[]),(p=this.signClient)==null||p.core.pairing.getPairings().filter(_=>e.params.pairingTopic!==_.topic).forEach(async _=>{var $,ie;e.params.proposer.metadata.url===(($=_.peerMetadata)==null?void 0:$.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:_.topic}))})}else(g=this.signClient)==null||g.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});de(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Zr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Zr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});de(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});de(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});de(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});de(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}const M$=["https://dweb.link/ipfs/","https://gateway.pinata.cloud/ipfs/","https://nftstorage.link/ipfs/","https://flk-ipfs.io/ipfs/","https://storry.tv/ipfs/","https://ipfs.io/ipfs/","https://hardbin.com/ipfs/","https://ipfs.runfission.com/ipfs/","https://ipfs.eth.aragon.network/ipfs/","https://4everland.io/ipfs/","https://w3s.link/ipfs/","https://trustless-gateway.link/ipfs/"],dFe="QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1";class hFe{constructor(){de(this,"gatewayURL");de(this,"localStore");this.localStore=new Np(dh.GATEWAY_ADDRESS),this.gatewayURL=this.localStore.get(),this.findAccessibleGateway()}async findAccessibleGateway(){const e=this.localStore.get();if(e&&await this.isGatewayAccessible(e)){this.gatewayURL=e;return}for(const r of M$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=M$[0],console.warn("No accessible IPFS gateways found, falling back to default")}async isGatewayAccessible(e){try{return await fetch(`${e}${dFe}`,{signal:AbortSignal.timeout(3e3)}),!0}catch{return!1}}async fetch(e){this.gatewayURL||await this.findAccessibleGateway();const r=await this.getGatewayURL(e);return fetch(r,{signal:AbortSignal.timeout(3e3)})}async getGatewayURL(e){if(this.gatewayURL||await this.findAccessibleGateway(),!e.startsWith("ipfs://"))throw new Error("Invalid IPFS URI");return e.replace("ipfs://",this.gatewayURL)}}class YM{constructor(e){de(this,"isFetchingBalances",Or(!1));de(this,"isFetchingCollectibleInfo",Or(!1));de(this,"ipfsGatewayHelper",new hFe);de(this,"userCollectibles",Or([]));de(this,"local",{userCollectibles:new Np(dh.COLLECTIBLES)});this.store=e;const r=this.store.get(Nn);pX(r.networks,n=>{const i=this.store.get(li).accountAddress.get();i&&n.length>0&&this.loadBalances(i)})}async loadBalances(e){const r=this.local.userCollectibles.get()??[];if(r.length===0)return;this.isFetchingBalances.set(!0);const n=[],i=r.map(async s=>{const o=await this.getCollectibleInfo(s);if(!o.isOwner){this.removeCollectible({collectibleInfoParams:s,collectibleInfoResponse:o});return}n.push({collectibleInfoParams:s,collectibleInfoResponse:o})});await Promise.allSettled(i),this.userCollectibles.set(n),this.isFetchingBalances.set(!1)}async getCollectibleInfo(e){const r=this.store.get(li).accountAddress.get();if(!r)throw new Error("No account found");const n=this.store.get(Nn).providerForChainId(e.chainId);this.isFetchingCollectibleInfo.set(!0);let i,s,o,a,c;if(e.contractType===hh.ERC721){const f=new Dn(e.address,hM,n),p=(await f.ownerOf(e.tokenId)).toLowerCase()===r.toLowerCase();if(!p)return this.isFetchingCollectibleInfo.set(!1),{isOwner:p,uri:""};i=await f.tokenURI(e.tokenId)}else if(e.contractType===hh.ERC1155){const f=new Dn(e.address,pM,n);if(a=await f.balanceOf(r,e.tokenId),!a)return this.isFetchingCollectibleInfo.set(!1),{isOwner:!1,uri:""};i=await f.uri(e.tokenId)}if(!i)throw new Error("Could not get collectible URI");i.includes("{id}")&&(i=i.replace("{id}",e.tokenId.toString()));let l;return i.startsWith("ipfs://")?l=await this.ipfsGatewayHelper.fetch(i).then(f=>f.json()):l=await fetch(i).then(f=>f.json()),l&&(c=l.decimals,s=l.image,o=l.name),s!=null&&s.startsWith("ipfs://")&&(s=await this.ipfsGatewayHelper.getGatewayURL(s)),a=a??BigInt(1),c=c??0,this.isFetchingCollectibleInfo.set(!1),{isOwner:!0,uri:i,image:s,name:o,balance:a,decimals:c}}async addCollectible(e){if(e.collectibleInfoResponse.isOwner){const r=this.local.userCollectibles.get()??[];if(r.some(n=>n.address===e.collectibleInfoParams.address&&n.tokenId===e.collectibleInfoParams.tokenId))throw new Error("Collectible already added");this.local.userCollectibles.set([...r,e.collectibleInfoParams]),this.isFetchingCollectibleInfo.set(!0),this.loadBalances(),this.isFetchingCollectibleInfo.set(!1)}}async removeCollectible(e){const n=(this.local.userCollectibles.get()??[]).filter(o=>o.address!==e.collectibleInfoParams.address||o.tokenId!==e.collectibleInfoParams.tokenId);this.local.userCollectibles.set(n);const s=this.userCollectibles.get().filter(o=>o.collectibleInfoParams.address!==e.collectibleInfoParams.address||o.collectibleInfoParams.tokenId!==e.collectibleInfoParams.tokenId);this.userCollectibles.set(s)}}function BE({chainId:t,paddingTop:e="1",paddingBottom:r="2"}){return W.jsx(xe,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(Ge,{variant:"xsmall",color:"text100",children:ky(t)})})}function pFe({collectibleInfo:t,onSendClick:e,onRemoveClick:r}){return W.jsxs($r,{width:"full",flexDirection:"column",gap:"2",padding:"4",children:[W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(Ge,{variant:"medium",color:"text80",children:t.collectibleInfoResponse.name??"Collectible"})}),W.jsx(xe,{style:{height:"200px"},children:W.jsx(a8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image??"",width:"full"})}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Ge,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(fh(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(BE,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(xe,{children:[W.jsx(Zt,{size:"xs",label:"Send",variant:"primary",shape:"square",onClick:e}),r&&W.jsx(Zt,{marginLeft:"2",size:"xs",label:"Remove",shape:"square",onClick:r})]})]})]})}function vFe({onClose:t}){const r=Ir(Nn).networks.get(),n=r.filter(z=>z.type===Ft.MAINNET),i=Ir(YM),s=yn(i.isFetchingCollectibleInfo),o=h8(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(),[b,I]=D.useState(),[C,S]=D.useState(!1);D.useEffect(()=>{a&&l&&u&&g?i.getCollectibleInfo({chainId:a.chainId,address:l,tokenId:u,contractType:g}).then(z=>{I(z)}):I(void 0)},[a,l,u,g]);const O=n.map(z=>({label:z.title,value:z.chainId.toString()})),L=async()=>{a&&l&&b&&u&&g&&(await i.addCollectible({collectibleInfoParams:{chainId:a.chainId,address:l,tokenId:u,contractType:g},collectibleInfoResponse:b}),S(!1),o({variant:"success",title:"Collectible added"}),F(),t())},F=()=>{f(void 0),c(void 0),p(void 0),y(void 0)};return W.jsxs($r,{flexDirection:"column",paddingY:"4",paddingX:"8",marginBottom:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:C,children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(M7,{label:"Collectible Network",labelLocation:"left",name:"collectibleNetwork",options:O,onValueChange:z=>c(r.find(_=>_.chainId===Number(z)))}),W.jsx(Wn,{width:"full",label:"Collectible Address",labelLocation:"left",name:"collectibleAddress",value:l??"",onChange:z=>{f(z.target.value)}}),W.jsx(M7,{label:"Collectible Type",labelLocation:"left",name:"collectibleType",options:[{value:"ERC721",label:"ERC721"},{value:"ERC1155",label:"ERC1155"}],onValueChange:z=>y(z)}),W.jsx(Wn,{width:"full",label:"Collectible Token ID",labelLocation:"left",name:"collectibleId",value:u??"",onKeyPress:z=>{/[0-9]/.test(z.key)||z.preventDefault()},onChange:z=>{if(z.target.value===""){p(void 0);return}p(z.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx(Ge,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx($r,{flexDirection:"column",gap:"2",children:W.jsxs(xe,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(Ge,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(Ge,{variant:"medium",color:"text100",children:Number(fh(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:C,onClick:()=>{F(),t()}}),W.jsx(Zt,{label:"Add",disabled:b===void 0||!b.isOwner||C,variant:"primary",size:"md",shape:"square",onClick:L})]})]})]})}function gFe({onSendClick:t}){const e=Ir(YM),r=yn(e.isFetchingBalances),n=yn(e.userCollectibles),i=D.useMemo(()=>n,[n]),[s,o]=D.useState(!1);return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(xe,{width:"1/3",children:W.jsx(pFe,{collectibleInfo:a,onSendClick:()=>{t(a)},onRemoveClick:()=>{e.removeCollectible(a)}})},a.collectibleInfoParams.chainId+a.collectibleInfoParams.address+a.collectibleInfoParams.tokenId)),r&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})})]}),W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",marginBottom:"4",children:[s&&W.jsx(vFe,{onClose:()=>o(!1)}),W.jsx(Zt,{label:"Import collectible",leftIcon:UH,variant:"primary",size:"md",shape:"square",onClick:()=>{o(!0)}})]})]})}function yFe({onClose:t}){const e=Ir(Nn),r=h8(),[n,i]=D.useState(),[s,o]=D.useState(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(),b=async()=>{n&&s&&a&&l&&await e.addNetwork({chainId:Number(n),name:s,title:s,type:Ft.MAINNET,rpcUrl:a,blockExplorer:{rootUrl:l},nativeToken:{name:u||"Ether",symbol:g||"ETH",decimals:18}})},I=()=>{i(void 0),o(void 0),c(void 0),f(void 0),p(void 0),y(void 0)};return W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(Wn,{width:"full",label:"Chain ID",labelLocation:"left",name:"chainId",value:n??"",onChange:C=>{i(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Network Name",labelLocation:"left",name:"networkName",value:s??"",onChange:C=>{o(C.target.value)}}),W.jsx(Wn,{width:"full",label:"RPC URL",labelLocation:"left",name:"rpcUrl",value:a??"",onChange:C=>{c(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Block explorer URL",labelLocation:"left",name:"rpcUrl",value:l??"",onChange:C=>{f(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Native Token Name",labelLocation:"left",name:"tokenName",value:u??"",onChange:C=>{p(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Native Token Symbol",labelLocation:"left",name:"tokenSymbol",value:g??"",onChange:C=>{y(C.target.value)}}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{I(),t()}}),W.jsx(Zt,{label:"Add",variant:"primary",size:"md",shape:"square",onClick:async()=>{try{await b(),r({variant:"success",title:"Network added",description:`You can now use ${s} network`}),I(),t()}catch(C){r({variant:"error",title:"Could not add network",description:C.message}),console.error(C)}}})]})]})}function R$({network:t}){var f,u;const e=Ir(Nn),n=yn(e.userAdditionNetworkChainIds).includes(t.chainId);D.useEffect(()=>{var p,g;(s!==t.rpcUrl||a!==((p=t.blockExplorer)==null?void 0:p.rootUrl))&&(o(t.rpcUrl),c(((g=t.blockExplorer)==null?void 0:g.rootUrl)??""))},[t]);const i=e.editedNetworkChainIds.get().includes(t.chainId),[s,o]=D.useState(t.rpcUrl),[a,c]=D.useState(((f=t.blockExplorer)==null?void 0:f.rootUrl)??""),l=s!==t.rpcUrl||a!==((u=t.blockExplorer)==null?void 0:u.rootUrl);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{fontWeight:"bold",color:"text100",children:t.title}),W.jsx(Wn,{label:"RPC URL",labelLocation:"left",name:"rpcUrl",spellCheck:!1,disabled:n,value:s??"",onChange:p=>{o(p.target.value)}}),W.jsx(Wn,{label:"Block Explorer URL",labelLocation:"left",name:"blockExplorerUrl",spellCheck:!1,disabled:n,value:a??"",onChange:p=>{c(p.target.value)}}),n&&W.jsxs(xe,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(Ge,{variant:"small",color:"text50",children:"Added by you"}),W.jsx(Zt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>e.removeNetwork(t.chainId)})]}),(l||i)&&!n&&W.jsxs(xe,{marginTop:"4",justifyContent:"flex-end",gap:"3",children:[W.jsx(W.Fragment,{children:i&&W.jsx(Zt,{label:"Reset to default",variant:"danger",size:"md",shape:"square",onClick:()=>e.resetNetworkEdit(t.chainId)})}),W.jsx(W.Fragment,{children:l&&W.jsx(Zt,{label:"Save",variant:"primary",size:"md",shape:"square",onClick:()=>{const p=t;p.rpcUrl=s,p.blockExplorer={rootUrl:a},p.relayer=_3(s),e.editNetwork(p)}})})]}),W.jsx(Sh,{})]})}function mFe(){const t=Ir(Nn),e=yn(t.networks),r=e.filter(f=>f.type===Ft.MAINNET),n=yn(t.userAdditionNetworkChainIds),i=r.sort((f,u)=>n.includes(f.chainId)?-1:1),s=e.filter(f=>f.type===Ft.TESTNET),[o,a]=D.useState(Ft.MAINNET),[c,l]=D.useState(!1);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(xe,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(vwe,{value:o,onValueChange:f=>a(f),children:[W.jsx(xe,{marginBottom:"10",children:W.jsx(pwe,{value:o,tabs:[{label:"Networks",value:Ft.MAINNET},{label:"Test Networks",value:Ft.TESTNET}]})}),W.jsx(HB,{value:Ft.MAINNET,children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"flex-end",marginY:"4",children:[W.jsx(Zt,{label:"Add network",variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}}),c&&W.jsx(yFe,{onClose:()=>l(!1)})]}),W.jsx(W.Fragment,{children:i.map((f,u)=>W.jsx(R$,{network:f},u))})]})}),W.jsx(HB,{value:Ft.TESTNET,children:W.jsx(xe,{flexDirection:"column",gap:"2",children:s.map((f,u)=>W.jsx(R$,{network:f},u))})})]})})]})}function lS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(xe,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(xe,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(lh,{size:"md"}),W.jsxs(xe,{flexDirection:"column",gap:"1",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(Ge,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(BE,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(Ge,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(Ge,{variant:"small",color:"text50",children:"Your external wallet will prompt you to confirm the transaction"})]})]})]})}function bFe({onSelectProvider:t}){const e=Ir(NE),r=jte(),[n,i]=D.useState(!1),s=()=>window.confirm("All WalletConnect Dapp sessions will be disconnected. If you would like to continue, click OK and connect to WalletConnect again."),o=async()=>{try{if(!n){if(e.allSessions.get().length!==0){if(!s())throw new Error("User rejected wallet connect modal");await e.disconnectAllSessions(),t();return}i(!0);const a=await Fte(!0);await a.connect();let c=hre(a);t(c)}}catch(a){console.error(a)}};return W.jsx(W.Fragment,{children:!n&&W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{flexDirection:"column",gap:"4",padding:"8",children:[W.jsx($r,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>{o()},children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:"https://avatars.githubusercontent.com/u/37784886",alt:"Wallet Connect",style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:"Wallet Connect"})]})}),r.map(a=>W.jsx($r,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>t(a),children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:a.info.icon,alt:a.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function wFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=KP("isMobile"),n=Ir(Zr),[i,s]=D.useState(void 0),[o,a]=D.useState(void 0),[c,l]=D.useState(!1),[f,u]=D.useState(!1);if(D.useEffect(()=>{const C=n.selectedExternalWalletAddress.get();c&&C&&a(n.selectedExternalWalletAddress.get())},[c]),D.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=t.collectibleInfoParams.contractType==="ERC721",g=ky(t.collectibleInfoParams.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(y=t==null?void 0:t.collectibleInfoResponse)==null?void 0:y.name," on ",g]}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Wn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:p?"1":i??"",onChange:C=>{s(C.target.value)},disabled:p,controls:W.jsx(W.Fragment,{children:t.collectibleInfoParams.contractType==="ERC1155"&&W.jsx(Zt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var C,S;s(fh((C=t==null?void 0:t.collectibleInfoResponse)==null?void 0:C.balance,((S=t==null?void 0:t.collectibleInfoResponse)==null?void 0:S.decimals)??18))}})})}),W.jsxs(Ge,{variant:"small",color:"text50",children:["Current balance:"," ",fh((b=t==null?void 0:t.collectibleInfoResponse)==null?void 0:b.balance,((I=t==null?void 0:t.collectibleInfoResponse)==null?void 0:I.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Wn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:C=>{a(C.target.value)},disabled:c}),W.jsx(eP,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:C=>l(C===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Zt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!(p&&o||!p&&o&&i),onClick:()=>{e(o,i)}})]})]})]})}function xFe({tokenBalance:t,onClose:e}){var g,y;const r=KP("isMobile"),n=Ir(Zr),[i,s]=D.useState(void 0),[o,a]=D.useState(void 0),[c,l]=D.useState(!1),[f,u]=D.useState(!1);if(D.useEffect(()=>{const b=n.selectedExternalWalletAddress.get();c&&b&&a(n.selectedExternalWalletAddress.get())},[c]),D.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=ky(t.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(g=t==null?void 0:t.contractInfo)==null?void 0:g.symbol," on ",p]}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Wn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:i??"",onChange:b=>{s(b.target.value)},controls:W.jsx(Zt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var b;s(fh(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(Ge,{variant:"small",color:"text50",children:["Current balance:"," ",fh(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Wn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:b=>{a(b.target.value)},disabled:c}),W.jsx(eP,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:b=>l(b===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Zt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})]})}function EFe({onTokenListClick:t}){const e=Ir(li),r=rk();return W.jsxs(Kye,{children:[W.jsx(Zt,{as:Yye,label:"Settings",variant:"text"}),W.jsx(Qye,{side:"bottom",align:"end",sideOffset:20,children:W.jsxs(xe,{marginTop:"2",children:[W.jsx(HA,{onClick:t,children:W.jsx(xe,{padding:"1",children:W.jsx(Ge,{variant:"normal",fontWeight:"bold",children:"Token List"})})}),W.jsx(HA,{disabled:!0,children:W.jsx(xe,{width:"16",children:W.jsx(Sh,{color:"white"})})}),W.jsx(HA,{onClick:()=>{e.logout(),r("/")},children:W.jsx(xe,{padding:"1",children:W.jsx(Ge,{variant:"normal",fontWeight:"bold",children:"Log out"})})})]})})]})}function CFe(){const t=Ir(Tx),e=yn(t.userAddedTokens);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"4",marginBottom:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Token List"}),W.jsx(Ge,{variant:"normal",color:"text50",children:"Tokens added by you can be removed here"})]}),W.jsxs(xe,{width:"full",height:"full",flexDirection:"column",marginTop:"4",paddingBottom:"12",gap:"4",children:[e.length===0&&W.jsx(xe,{height:"full",alignItems:"center",justifyContent:"center",children:W.jsx(Ge,{variant:"medium",color:"text50",marginBottom:"16",children:"You haven't added any tokens yet"})}),e.map((r,n)=>W.jsxs($r,{width:"full",flexDirection:"row",gap:"2",alignItems:"center",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{variant:"medium",color:"text80",children:r.symbol}),W.jsx(Ge,{variant:"normal",color:"text50",children:r.address}),W.jsx(BE,{chainId:r.chainId})]}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Zt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>{t.removeToken(r)}})})]},n))]})]})}function AFe({onClose:t}){const r=Ir(Nn).networks.get(),n=r.filter(S=>S.type===Ft.MAINNET),i=Ir(Tx),s=yn(i.isFetchingTokenInfo),o=h8(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(!1);D.useEffect(()=>{a&&l?i.getTokenInfo(a.chainId,l).then(S=>{p(S)}):p(void 0)},[a,l]);const b=n.map(S=>({label:S.title,value:S.chainId.toString()})),I=async()=>{a&&l&&u&&(y(!0),await i.addToken({chainId:a.chainId,address:l,contractType:hh.ERC20,symbol:u.symbol,decimals:u.decimals}),y(!1),o({variant:"success",title:"Token added"}),C(),t())},C=()=>{f(void 0),c(void 0)};return W.jsxs($r,{flexDirection:"column",paddingY:"4",paddingX:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:g,children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(M7,{label:"Token Network",labelLocation:"left",name:"tokenNetwork",options:b,onValueChange:S=>c(r.find(O=>O.chainId===Number(S)))}),W.jsx(Wn,{width:"full",label:"Token Address",labelLocation:"left",name:"tokenAddress",value:l??"",onChange:S=>{f(S.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})}),u&&W.jsxs(W.Fragment,{children:[W.jsx(Wn,{width:"full",label:"Token Symbol",labelLocation:"left",name:"tokenSymbol",value:(u==null?void 0:u.symbol)??"",disabled:!0}),W.jsx(Wn,{width:"full",label:"Token Decimals",labelLocation:"left",name:"tokenDecimals",value:(u==null?void 0:u.decimals)??"",disabled:!0})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Zt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:g,onClick:()=>{C(),t()}}),W.jsx(Zt,{label:"Add",disabled:u===void 0||g,variant:"primary",size:"md",shape:"square",onClick:I})]})]})]})}const SFe=(t,e)=>Math.floor(t*10**e)/10**e;function _Fe({disabled:t,tokenBalance:e,onSendClick:r,onRemoveClick:n}){var o,a;const i=fh(e.balance,((o=e.contractInfo)==null?void 0:o.decimals)??18),s=SFe(Number(i),5);return W.jsxs($r,{width:"full",flexDirection:"column",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",children:[W.jsx(Ge,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Ge,{color:"text80",children:s})})]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(BE,{chainId:e.chainId}),W.jsxs(xe,{marginLeft:"auto",gap:"2",children:[W.jsx(Zt,{size:"xs",label:"Send",variant:"primary",shape:"square",disabled:t,onClick:r}),n&&W.jsx(Zt,{size:"xs",label:"Remove",shape:"square",onClick:n})]})]})]})}function IFe({filterZeroBalances:t,onSendClick:e}){const r=Ir(Zr),n=Ir(Tx),i=yn(n.balances),s=yn(n.isFetchingBalances),o=yn(r.selectedExternalProvider)!==void 0,a=D.useMemo(()=>t?i.filter(u=>u.balance!=="0"):i,[i,t,s]),[c,l]=D.useState(!1),f=u=>u.contractType===hh.NATIVE?void 0:()=>{var p,g;n.removeToken({chainId:u.chainId,address:u.contractAddress,contractType:u.contractType,decimals:(p=u.contractInfo)==null?void 0:p.decimals,symbol:(g=u.contractInfo)==null?void 0:g.symbol})};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"column",gap:"4",marginBottom:"8",children:[a.map(u=>W.jsx(_Fe,{tokenBalance:u,disabled:!o,onSendClick:()=>e(u),onRemoveClick:f(u)},u.contractAddress+u.chainId)),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(lh,{size:"lg"})})]}),c&&W.jsx(AFe,{onClose:()=>l(!1)}),!c&&W.jsx(xe,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Zt,{label:"Import token",leftIcon:UH,variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}})})]})}function TFe({onClose:t}){var a;const e=Ir(Zr),r=yn(e.connectOptions),[n,i]=D.useState(!1),s=async()=>{if(n)return;i(!0);const c=await e.walletRequestHandler.connect(r);e.connectDetails.set(c),i(!1),t()},o=()=>{e.connectDetails.set({connected:!1}),t()};return W.jsx(xe,{children:r&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Would you like to allow this dapp to connect to your wallet?"}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:r.app}),W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(a=r.origin)==null?void 0:a.split("//")[1]}),W.jsx(yu,{size:"xs",icon:J4,onClick:()=>window.open(r.origin,"_blank")})]})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Network"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${ky(Number(r.networkId))}`})]}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"6",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:o,"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:n?"Authorizing…":"Connect",disabled:n,onClick:s,"data-id":"signingContinue"})]})]})})}function PFe({sessionList:t}){const e=Ir(NE);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(Ge,{variant:"large",color:"text80",marginTop:"6",marginBottom:"2",children:"Connected Dapps via WalletConnect"}),t.map((r,n)=>W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",padding:"2",children:[W.jsx(a8,{width:"8",height:"8",src:r.peer.metadata.icons[0]}),W.jsx(Ge,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(xe,{gap:"2",children:[r.peer.metadata.url&&W.jsx(yu,{size:"xs",icon:J4,onClick:()=>window.open(r.peer.metadata.url,"_blank")}),W.jsx(yu,{size:"xs",icon:Vg,onClick:()=>{e.disconnectSession(r.topic)}})]})]},n))]})}function kFe({onClose:t}){var l,f;const e=Ir(Zr),r=Ir(li),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=D.useState(""),[a,c]=D.useState("");return D.useEffect(()=>{if(console.log("details",n),c(new Date().toLocaleString()),n!=null&&n.message.message){const u=XLe(n.message.message);try{o(Ip(u))}catch{o(Me(u))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),W.jsx(xe,{children:n&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Ge,{variant:"md",color:"text100",children:a})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(f=(l=n==null?void 0:n.options)==null?void 0:l.origin)==null?void 0:f.split("//")[1]}),W.jsx(yu,{size:"xs",icon:J4,onClick:()=>{var u;return window.open((u=n.options)==null?void 0:u.origin,"_blank")}})]})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Network"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${ky(n.chainId)}`})]}),W.jsxs($r,{flexDirection:"column",gap:"4",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Signee"}),W.jsx($r,{children:W.jsx(Ge,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(GH,{label:"Message Content",children:W.jsx($r,{children:W.jsx(Ge,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(n)},"data-id":"signingContinue"})]})]})})}function MFe({onClose:t}){var I,C;const e=Ir(Zr),r=Ir(Nn),n=Ir(YM),[i,s]=D.useState("Unknown"),[o,a]=D.useState(null),[c,l]=D.useState({name:null}),[f,u]=D.useState(null),[p,g]=D.useState(""),y=e.toSignTxnDetails.get();D.useEffect(()=>{if(!y)return;g(new Date().toLocaleString());const S=r.providerForChainId(y.chainId??0),O=y.txn[0].data,L=y.txn[0].to;b(O,L,S)},[y]),D.useEffect(()=>{if(!y||!(y!=null&&y.txn[0].to)||!o)return;const S=y.txn[0].to,O={chainId:y.chainId,address:S,tokenId:o,contractType:i};n.getCollectibleInfo(O)},[i,o]);async function b(S,O,L){try{const F=new Dn(O,jv,L);try{const ie=await F.symbol();s("ERC20"),l({name:ie});const K=new $i(jv).parseTransaction({data:S}),P=await F.decimals();u(Number(fh(K==null?void 0:K.args[1],P??18)));return}catch{}const z=new Dn(O,C9e,L);if(await z.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Dn(O,hM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const P=await ie.name();l({name:P});return}if(await z.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Dn(O,pM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const P=await ie.uri(K);l({name:P});return}}catch(F){console.error("Error parsing contract type. The transaction is either using a smart contract that doesnt support ERC165 or the token is native:",F)}if(y!=null&&y.txn[0].value){s("Native Token"),l({name:`${ky((y==null?void 0:y.chainId)??1)} Native Token`});return}console.info("Token info could not be decoded for this transaction")}return W.jsx(xe,{children:y&&W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(Ge,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Sh,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Ge,{variant:"md",color:"text100",children:p})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(C=(I=y==null?void 0:y.options)==null?void 0:I.origin)==null?void 0:C.split("//")[1]}),W.jsx(yu,{size:"xs",icon:J4,onClick:()=>{var S;return window.open((S=y.options)==null?void 0:S.origin,"_blank")}})]})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs($r,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Amount"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(GH,{label:"Transaction Data",children:W.jsx(xe,{flexDirection:"column",gap:"2",children:y.txn.map((S,O)=>W.jsx($r,{children:W.jsx(Ge,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},O))})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Zt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Zt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(y)},"data-id":"signingContinue"})]})]})})})}function RFe({warningType:t}){return W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(xe,{flexDirection:"column",children:W.jsx($r,{children:W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"2",children:[t==="noProvider"&&'Please ensure that an external wallet is connected via the "Connect" button',t==="isWalletConnect"&&"Please switch your external wallet to an option other than WalletConnect",t==="notDeployed"&&"Please deploy our wallet on the required network before trying to sign messages"]})})})]})})}var Ute={},Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.compactObject=Vte;Fo.deprecated=$Fe;var OFe=Fo.detectBrowser=qFe;Fo.disableLog=FFe;Fo.disableWarnings=jFe;Fo.extractVersion=j3;Fo.filterStats=VFe;Fo.log=UFe;Fo.walkStats=v4;Fo.wrapPeerConnectionEvent=LFe;function DFe(t,e,r){return e=NFe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NFe(t){var e=BFe(t,"string");return gh(e)=="symbol"?e:e+""}function BFe(t,e){if(gh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gh(t){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gh(t)}var $te=!0,qte=!0;function j3(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function LFe(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function FFe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):($te=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function jFe(t){return typeof t!="boolean"?new Error("Argument type: "+gh(t)+". Please use a boolean."):(qte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function UFe(){if((typeof window>"u"?"undefined":gh(window))==="object"){if($te)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $Fe(t,e){qte&&console.warn(t+" is deprecated, please use "+e+" instead.")}function qFe(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=j3(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=j3(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=j3(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function O$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Vte(t){return O$(t)?Object.keys(t).reduce(function(e,r){var n=O$(t[r]),i=n?Vte(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,DFe({},r,i))},{}):t}function v4(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?v4(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){v4(t,t.get(i),r)})}))}function VFe(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&v4(t,a,i)})}),i}Object.defineProperty(Ute,"__esModule",{value:!0});var zFe=Ute.shimGetUserMedia=WFe,HFe=GFe(Fo);function zte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(zte=function(i){return i?r:e})(t)}function GFe(t,e){if(t&&t.__esModule)return t;if(t===null||gd(t)!="object"&&typeof t!="function")return{default:t};var r=zte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function gd(t){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gd(t)}var D$=HFe.log;function WFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(gd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var p=gd(l[u])==="object"?l[u]:{ideal:l[u]};p.exact!==void 0&&typeof p.exact=="number"&&(p.min=p.max=p.exact);var g=function(I,C){return I?I+C.charAt(0).toUpperCase()+C.slice(1):C==="deviceId"?"sourceId":C};if(p.ideal!==void 0){f.optional=f.optional||[];var y={};typeof p.ideal=="number"?(y[g("min",u)]=p.ideal,f.optional.push(y),y={},y[g("max",u)]=p.ideal,f.optional.push(y)):(y[g("",u)]=p.ideal,f.optional.push(y))}p.exact!==void 0&&typeof p.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[g("",u)]=p.exact):["min","max"].forEach(function(b){p[b]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[g(b,u)]=p[b])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&gd(l.audio)==="object"){var u=function(I,C,S){C in I&&!(S in I)&&(I[S]=I[C],delete I[C])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&gd(l.video)==="object"){var p=l.video.facingMode;p=p&&(gd(p)==="object"?p:{ideal:p});var g=e.version<66;if(p&&(p.exact==="user"||p.exact==="environment"||p.ideal==="user"||p.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!g)){delete l.video.facingMode;var y;if(p.exact==="environment"||p.ideal==="environment"?y=["back","rear"]:(p.exact==="user"||p.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(b){b=b.filter(function(C){return C.kind==="videoinput"});var I=b.find(function(C){return y.some(function(S){return C.label.toLowerCase().includes(S)})});return!I&&b.length&&y.includes("back")&&(I=b[b.length-1]),I&&(l.video.deviceId=p.exact?{exact:I.deviceId}:{ideal:I.deviceId}),l.video=n(l.video),D$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return D$("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(p){r.webkitGetUserMedia(p,f,function(g){u&&u(s(g))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var Hte={};Object.defineProperty(Hte,"__esModule",{value:!0});var KFe=Hte.shimGetUserMedia=JFe,YFe=QFe(Fo);function Gte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gte=function(i){return i?r:e})(t)}function QFe(t,e){if(t&&t.__esModule)return t;if(t===null||Hv(t)!="object"&&typeof t!="function")return{default:t};var r=Gte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Hv(t){"@babel/helpers - typeof";return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hv(t)}function JFe(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){YFe.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Hv(c)==="object"&&Hv(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Hv(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var af={};Object.defineProperty(af,"__esModule",{value:!0});af.shimAudioContext=aje;af.shimCallbacksAPI=rje;af.shimConstraints=Yte;af.shimCreateOfferLegacy=oje;var ZFe=af.shimGetUserMedia=nje;af.shimLocalStreamsAPI=eje;af.shimRTCIceServerUrls=ije;af.shimRemoteStreamsAPI=tje;af.shimTrackEventTransceiver=sje;var Wte=XFe(Fo);function Kte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Kte=function(i){return i?r:e})(t)}function XFe(t,e){if(t&&t.__esModule)return t;if(t===null||yh(t)!="object"&&typeof t!="function")return{default:t};var r=Kte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yh(t){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(t)}function eje(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function rje(t){if(!(yh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p};var a=function(l,f,u){var p=i.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p};e.setLocalDescription=a,a=function(l,f,u){var p=s.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.setRemoteDescription=a,a=function(l,f,u){var p=o.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.addIceCandidate=a}}function nje(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(Yte(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function Yte(t){return t&&t.video!==void 0?Object.assign({},t,{video:Wte.compactObject(t.video)}):t}function ije(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},Jte=(t,e,r)=>e.has(t)||Qte("Cannot "+r),cje=(t,e,r)=>(Jte(t,e,"read from private field"),r?r.call(t):e.get(t)),lje=(t,e,r)=>e.has(t)?Qte("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),fje=(t,e,r,n)=>(Jte(t,e,"write to private field"),e.set(t,r),r);const N$=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function uje(t){return t.join("|")}function dje(t){const e=B$(t);let r=0,n=N$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=N$[i],o=B$(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.2.15/dist/${r[1]}/${t}`:e+t}};let L$=new WeakMap;function QM(t,e){var r;const n=L$.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:bje,s=t({...i});return L$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function wje(t,e,r=ly){const n={...ly,...r},i=await QM(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Zte(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((q,V)=>{s=q,o=V}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),p="./this.program",g="";function y(q){return i.locateFile?i.locateFile(q,g):g+q}var b,I;if(c||f||l){var C;f?g=self.location.href:typeof document<"u"&&((C=document.currentScript)===null||C===void 0?void 0:C.tagName.toUpperCase())==="SCRIPT"&&(g=document.currentScript.src),e&&(g=e),g.startsWith("blob:")?g="":g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(I=q=>{var V=new XMLHttpRequest;return V.open("GET",q,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),b=q=>fetch(q,{credentials:"same-origin"}).then(V=>V.ok?V.arrayBuffer():Promise.reject(new Error(V.status+" : "+V.url)))}var S=i.print||console.log.bind(console),O=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(p=i.thisProgram);var L=i.wasmBinary,F,z=!1,_,$,ie,ce,K,P,M,v;function m(){var q=F.buffer;i.HEAP8=_=new Int8Array(q),i.HEAP16=ie=new Int16Array(q),i.HEAPU8=$=new Uint8Array(q),i.HEAPU16=ce=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=P=new Uint32Array(q),i.HEAPF32=M=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var R=[],B=[],E=[];function x(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)k(i.preRun.shift());Je(R)}function w(){Je(B)}function T(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)oe(i.postRun.shift());Je(E)}function k(q){R.unshift(q)}function H(q){B.unshift(q)}function oe(q){E.unshift(q)}var j=0,X=null;function G(q){var V;j++,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j)}function Z(q){var V;if(j--,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j),j==0&&X){var re=X;X=null,re()}}function ee(q){var V;(V=i.onAbort)===null||V===void 0||V.call(i,q),q="Aborted("+q+")",O(q),z=!0,q+=". Build with -sASSERTIONS for more info.";var re=new WebAssembly.RuntimeError(q);throw o(re),re}var N="data:application/octet-stream;base64,",te=q=>q.startsWith(N);function fe(){var q="zxing_reader.wasm";return te(q)?q:y(q)}var Ee;function _e(q){if(q==Ee&&L)return new Uint8Array(L);if(I)return I(q);throw"both async and sync fetching of the wasm failed"}function Re(q){return L?Promise.resolve().then(()=>_e(q)):b(q).then(V=>new Uint8Array(V),()=>_e(q))}function Te(q,V,re){return Re(q).then(ae=>WebAssembly.instantiate(ae,V)).then(re,ae=>{O(`failed to asynchronously prepare wasm: ${ae}`),ee(ae)})}function De(q,V,re,ae){return!q&&typeof WebAssembly.instantiateStreaming=="function"&&!te(V)&&typeof fetch=="function"?fetch(V,{credentials:"same-origin"}).then(pe=>{var me=WebAssembly.instantiateStreaming(pe,re);return me.then(ae,function(Se){return O(`wasm streaming compile failed: ${Se}`),O("falling back to ArrayBuffer instantiation"),Te(V,re,ae)})}):Te(V,re,ae)}function ze(){return{a:Zy}}function et(){var q,V=ze();function re(pe,me){return hn=pe.exports,F=hn.za,m(),ds=hn.Da,H(hn.Aa),Z(),hn}G();function ae(pe){re(pe.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(V,re)}catch(pe){O(`Module.instantiateWasm callback failed with error: ${pe}`),o(pe)}return(q=Ee)!==null&&q!==void 0||(Ee=fe()),De(L,Ee,V,ae).catch(o),{}}var Je=q=>{for(;q.length>0;)q.shift()(i)};i.noExitRuntime;var ke=q=>ho(q),Ne=()=>em(),tt=[],Ze=0,st=q=>{var V=new lt(q);return V.get_caught()||(V.set_caught(!0),Ze--),V.set_rethrown(!1),tt.push(V),Xx(q),Jx(q)},nt=0,We=()=>{yr(0,0);var q=tt.pop();Zx(q.excPtr),nt=0};class lt{constructor(V){this.excPtr=V,this.ptr=V-24}set_type(V){P[this.ptr+4>>2]=V}get_type(){return P[this.ptr+4>>2]}set_destructor(V){P[this.ptr+8>>2]=V}get_destructor(){return P[this.ptr+8>>2]}set_caught(V){V=V?1:0,_[this.ptr+12]=V}get_caught(){return _[this.ptr+12]!=0}set_rethrown(V){V=V?1:0,_[this.ptr+13]=V}get_rethrown(){return _[this.ptr+13]!=0}init(V,re){this.set_adjusted_ptr(0),this.set_type(V),this.set_destructor(re)}set_adjusted_ptr(V){P[this.ptr+16>>2]=V}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var vt=q=>{throw nt||(nt=q),nt},Ke=q=>df(q),gt=q=>{var V=nt;if(!V)return Ke(0),0;var re=new lt(V);re.set_adjusted_ptr(V);var ae=re.get_type();if(!ae)return Ke(0),V;for(var pe of q){if(pe===0||pe===ae)break;var me=re.ptr+16;if(e2(pe,ae,me))return Ke(pe),V}return Ke(ae),V},wt=()=>gt([]),rt=q=>gt([q]),It=(q,V)=>gt([q,V]),At=()=>{var q=tt.pop();q||ee("no exception to throw");var V=q.excPtr;throw q.get_rethrown()||(tt.push(q),q.set_rethrown(!0),q.set_caught(!1),Ze++),nt=V,nt},Tt=(q,V,re)=>{var ae=new lt(q);throw ae.init(V,re),nt=q,Ze++,nt},Xt=()=>Ze,lr=()=>{ee("")},xt={},ar=q=>{for(;q.length;){var V=q.pop(),re=q.pop();re(V)}};function rr(q){return this.fromWireType(P[q>>2])}var kt={},Dt={},Nt={},dt,Lt=q=>{throw new dt(q)},Mt=(q,V,re)=>{q.forEach(Ae=>Nt[Ae]=V);function ae(Ae){var Be=re(Ae);Be.length!==q.length&&Lt("Mismatched type converter count");for(var Ye=0;Ye{Dt.hasOwnProperty(Ae)?pe[Be]=Dt[Ae]:(me.push(Ae),kt.hasOwnProperty(Ae)||(kt[Ae]=[]),kt[Ae].push(()=>{pe[Be]=Dt[Ae],++Se,Se===me.length&&ae(pe)}))}),me.length===0&&ae(pe)},ut=q=>{var V=xt[q];delete xt[q];var re=V.rawConstructor,ae=V.rawDestructor,pe=V.fields,me=pe.map(Se=>Se.getterReturnType).concat(pe.map(Se=>Se.setterArgumentType));Mt([q],me,Se=>{var Ae={};return pe.forEach((Be,Ye)=>{var Qe=Be.fieldName,pt=Se[Ye],mr=Be.getter,Br=Be.getterContext,un=Se[Ye+pe.length],Zn=Be.setter,In=Be.setterContext;Ae[Qe]={read:pn=>pt.fromWireType(mr(Br,pn)),write:(pn,yc)=>{var $n=[];Zn(In,pn,un.toWireType($n,yc)),ar($n)}}}),[{name:V.name,fromWireType:Be=>{var Ye={};for(var Qe in Ae)Ye[Qe]=Ae[Qe].read(Be);return ae(Be),Ye},toWireType:(Be,Ye)=>{for(var Qe in Ae)if(!(Qe in Ye))throw new TypeError(`Missing field: "${Qe}"`);var pt=re();for(Qe in Ae)Ae[Qe].write(pt,Ye[Qe]);return Be!==null&&Be.push(ae,pt),pt},argPackAdvance:ct,readValueFromPointer:rr,destructorFunction:ae}]})},Vt=(q,V,re,ae,pe)=>{},zt=()=>{for(var q=new Array(256),V=0;V<256;++V)q[V]=String.fromCharCode(V);ht=q},ht,Et=q=>{for(var V="",re=q;$[re];)V+=ht[$[re++]];return V},Bt,He=q=>{throw new Bt(q)};function $t(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ae=V.name;if(q||He(`type "${ae}" must have a positive integer typeid pointer`),Dt.hasOwnProperty(q)){if(re.ignoreDuplicateRegistrations)return;He(`Cannot register type '${ae}' twice`)}if(Dt[q]=V,delete Nt[q],kt.hasOwnProperty(q)){var pe=kt[q];delete kt[q],pe.forEach(me=>me())}}function Ct(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(q,V,re)}var ct=8,Ht=(q,V,re,ae)=>{V=Et(V),Ct(q,{name:V,fromWireType:function(pe){return!!pe},toWireType:function(pe,me){return me?re:ae},argPackAdvance:ct,readValueFromPointer:function(pe){return this.fromWireType($[pe])},destructorFunction:null})},Rr=q=>({count:q.count,deleteScheduled:q.deleteScheduled,preservePointerOnDelete:q.preservePointerOnDelete,ptr:q.ptr,ptrType:q.ptrType,smartPtr:q.smartPtr,smartPtrType:q.smartPtrType}),Ut=q=>{function V(re){return re.$$.ptrType.registeredClass.name}He(V(q)+" instance already deleted")},Sr=!1,er=q=>{},kr=q=>{q.smartPtr?q.smartPtrType.rawDestructor(q.smartPtr):q.ptrType.registeredClass.rawDestructor(q.ptr)},bi=q=>{q.count.value-=1;var V=q.count.value===0;V&&kr(q)},wi=(q,V,re)=>{if(V===re)return q;if(re.baseClass===void 0)return null;var ae=wi(q,V,re.baseClass);return ae===null?null:re.downcast(ae)},xi={},Ti=()=>Object.keys(pi).length,Sn=()=>{var q=[];for(var V in pi)pi.hasOwnProperty(V)&&q.push(pi[V]);return q},di=[],Fs=()=>{for(;di.length;){var q=di.pop();q.$$.deleteScheduled=!1,q.delete()}},hi,jo=q=>{hi=q,di.length&&hi&&hi(Fs)},Uo=()=>{i.getInheritedInstanceCount=Ti,i.getLiveInheritedInstances=Sn,i.flushPendingDeletes=Fs,i.setDelayFunction=jo},pi={},oo=(q,V)=>{for(V===void 0&&He("ptr should not be undefined");q.baseClass;)V=q.upcast(V),q=q.baseClass;return V},ao=(q,V)=>(V=oo(q,V),pi[V]),_n=(q,V)=>{(!V.ptrType||!V.ptr)&&Lt("makeClassHandle requires ptr and ptrType");var re=!!V.smartPtrType,ae=!!V.smartPtr;return re!==ae&&Lt("Both smartPtrType and smartPtr must be specified"),V.count={value:1},Gi(Object.create(q,{$$:{value:V,writable:!0}}))};function $o(q){var V=this.getPointee(q);if(!V)return this.destructor(q),null;var re=ao(this.registeredClass,V);if(re!==void 0){if(re.$$.count.value===0)return re.$$.ptr=V,re.$$.smartPtr=q,re.clone();var ae=re.clone();return this.destructor(q),ae}function pe(){return this.isSmartPointer?_n(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:V,smartPtrType:this,smartPtr:q}):_n(this.registeredClass.instancePrototype,{ptrType:this,ptr:q})}var me=this.registeredClass.getActualType(V),Se=xi[me];if(!Se)return pe.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var Be=wi(V,this.registeredClass,Ae.registeredClass);return Be===null?pe.call(this):this.isSmartPointer?_n(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Be,smartPtrType:this,smartPtr:q}):_n(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Be})}var Gi=q=>typeof FinalizationRegistry>"u"?(Gi=V=>V,q):(Sr=new FinalizationRegistry(V=>{bi(V.$$)}),Gi=V=>{var re=V.$$,ae=!!re.smartPtr;if(ae){var pe={$$:re};Sr.register(V,pe,V)}return V},er=V=>Sr.unregister(V),Gi(q)),qo=()=>{Object.assign(Ca.prototype,{isAliasOf(q){if(!(this instanceof Ca)||!(q instanceof Ca))return!1;var V=this.$$.ptrType.registeredClass,re=this.$$.ptr;q.$$=q.$$;for(var ae=q.$$.ptrType.registeredClass,pe=q.$$.ptr;V.baseClass;)re=V.upcast(re),V=V.baseClass;for(;ae.baseClass;)pe=ae.upcast(pe),ae=ae.baseClass;return V===ae&&re===pe},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var q=Gi(Object.create(Object.getPrototypeOf(this),{$$:{value:Rr(this.$$)}}));return q.$$.count.value+=1,q.$$.deleteScheduled=!1,q},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),er(this),bi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),di.push(this),di.length===1&&hi&&hi(Fs),this.$$.deleteScheduled=!0,this}})};function Ca(){}var co=(q,V)=>Object.defineProperty(V,"name",{value:q}),Lh=(q,V,re)=>{if(q[V].overloadTable===void 0){var ae=q[V];q[V]=function(){for(var pe=arguments.length,me=new Array(pe),Se=0;Se{i.hasOwnProperty(q)?((re===void 0||i[q].overloadTable!==void 0&&i[q].overloadTable[re]!==void 0)&&He(`Cannot register public name '${q}' twice`),Lh(i,q,q),i.hasOwnProperty(re)&&He(`Cannot register multiple overloads of a function with the same number of arguments (${re})!`),i[q].overloadTable[re]=V):(i[q]=V,re!==void 0&&(i[q].numArguments=re))},Fh=48,cf=57,jh=q=>{if(q===void 0)return"_unknown";q=q.replace(/[^a-zA-Z0-9_]/g,"$");var V=q.charCodeAt(0);return V>=Fh&&V<=cf?`_${q}`:q};function lf(q,V,re,ae,pe,me,Se,Ae){this.name=q,this.constructor=V,this.instancePrototype=re,this.rawDestructor=ae,this.baseClass=pe,this.getActualType=me,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var Du=(q,V,re)=>{for(;V!==re;)V.upcast||He(`Expected null or instance of ${re.name}, got an instance of ${V.name}`),q=V.upcast(q),V=V.baseClass;return q};function qy(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${zr(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=Du(V.$$.ptr,re,this.registeredClass);return ae}function r1(q,V){var re;if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,re),re):0;(!V||!V.$$)&&He(`Cannot pass "${zr(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);var ae=V.$$.ptrType.registeredClass;if(re=Du(V.$$.ptr,ae,this.registeredClass),this.isSmartPointer)switch(V.$$.smartPtr===void 0&&He("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?re=V.$$.smartPtr:He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:re=V.$$.smartPtr;break;case 2:if(V.$$.smartPtrType===this)re=V.$$.smartPtr;else{var pe=V.clone();re=this.rawShare(re,zo.toHandle(()=>pe.delete())),q!==null&&q.push(this.rawDestructor,re)}break;default:He("Unsupporting sharing policy")}return re}function n1(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${zr(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.ptrType.name} to parameter type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=Du(V.$$.ptr,re,this.registeredClass);return ae}var Nu=()=>{Object.assign(Bu.prototype,{getPointee(q){return this.rawGetPointee&&(q=this.rawGetPointee(q)),q},destructor(q){var V;(V=this.rawDestructor)===null||V===void 0||V.call(this,q)},argPackAdvance:ct,readValueFromPointer:rr,fromWireType:$o})};function Bu(q,V,re,ae,pe,me,Se,Ae,Be,Ye,Qe){this.name=q,this.registeredClass=V,this.isReference=re,this.isConst=ae,this.isSmartPointer=pe,this.pointeeType=me,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=Be,this.rawShare=Ye,this.rawDestructor=Qe,!pe&&V.baseClass===void 0?ae?(this.toWireType=qy,this.destructorFunction=null):(this.toWireType=n1,this.destructorFunction=null):this.toWireType=r1}var Uh=(q,V,re)=>{i.hasOwnProperty(q)||Lt("Replacing nonexistent public symbol"),i[q].overloadTable!==void 0&&re!==void 0?i[q].overloadTable[re]=V:(i[q]=V,i[q].argCount=re)},Lu=(q,V,re)=>{q=q.replace(/p/g,"i");var ae=i["dynCall_"+q];return ae(V,...re)},Vo=[],ds,hr=q=>{var V=Vo[q];return V||(q>=Vo.length&&(Vo.length=q+1),Vo[q]=V=ds.get(q)),V},i1=function(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(q.includes("j"))return Lu(q,V,re);var ae=hr(V)(...re);return ae},Aa=(q,V)=>function(){for(var re=arguments.length,ae=new Array(re),pe=0;pe{q=Et(q);function re(){return q.includes("j")?Aa(q,V):hr(V)}var ae=re();return typeof ae!="function"&&He(`unknown function pointer with signature ${q}: ${V}`),ae},s1=(q,V)=>{var re=co(V,function(ae){this.name=V,this.message=ae;var pe=new Error(ae).stack;pe!==void 0&&(this.stack=this.toString()+` -`+pe.replace(/^Error(:[^\n]*)?\n/,""))});return re.prototype=Object.create(q.prototype),re.prototype.constructor=re,re.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},re},$h,qh=q=>{var V=gc(q),re=Et(V);return uo(V),re},Fu=(q,V)=>{var re=[],ae={};function pe(me){if(!ae[me]&&!Dt[me]){if(Nt[me]){Nt[me].forEach(pe);return}re.push(me),ae[me]=!0}}throw V.forEach(pe),new $h(`${q}: `+re.map(qh).join([", "]))},vc=(q,V,re,ae,pe,me,Se,Ae,Be,Ye,Qe,pt,mr)=>{Qe=Et(Qe),me=hs(pe,me),Ae&&(Ae=hs(Se,Ae)),Ye&&(Ye=hs(Be,Ye)),mr=hs(pt,mr);var Br=jh(Qe);pc(Br,function(){Fu(`Cannot construct ${Qe} due to unbound types`,[ae])}),Mt([q,V,re],ae?[ae]:[],un=>{un=un[0];var Zn,In;ae?(Zn=un.registeredClass,In=Zn.instancePrototype):In=Ca.prototype;var pn=co(Qe,function(){if(Object.getPrototypeOf(this)!==yc)throw new Bt("Use 'new' to construct "+Qe);if($n.constructor_body===void 0)throw new Bt(Qe+" has no accessible constructor");for(var l2=arguments.length,b1=new Array(l2),w1=0;w1{for(var re=[],ae=0;ae>2]);return re};function o1(q){for(var V=1;V{var Se=ju(V,re);pe=hs(ae,pe),Mt([],[q],Ae=>{Ae=Ae[0];var Be=`constructor ${Ae.name}`;if(Ae.registeredClass.constructor_body===void 0&&(Ae.registeredClass.constructor_body=[]),Ae.registeredClass.constructor_body[V-1]!==void 0)throw new Bt(`Cannot register multiple constructors with identical number of parameters (${V-1}) for class '${Ae.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ae.registeredClass.constructor_body[V-1]=()=>{Fu(`Cannot construct ${Ae.name} due to unbound types`,Se)},Mt([],Se,Ye=>(Ye.splice(1,0,null),Ae.registeredClass.constructor_body[V-1]=nl(Be,Ye,null,pe,me),[])),[]})},Uu=q=>{q=q.trim();const V=q.indexOf("(");return V!==-1?q.substr(0,V):q},zy=(q,V,re,ae,pe,me,Se,Ae,Be,Ye)=>{var Qe=ju(re,ae);V=Et(V),V=Uu(V),me=hs(pe,me),Mt([],[q],pt=>{pt=pt[0];var mr=`${pt.name}.${V}`;V.startsWith("@@")&&(V=Symbol[V.substring(2)]),Ae&&pt.registeredClass.pureVirtualFunctions.push(V);function Br(){Fu(`Cannot call ${mr} due to unbound types`,Qe)}var un=pt.registeredClass.instancePrototype,Zn=un[V];return Zn===void 0||Zn.overloadTable===void 0&&Zn.className!==pt.name&&Zn.argCount===re-2?(Br.argCount=re-2,Br.className=pt.name,un[V]=Br):(Lh(un,V,mr),un[V].overloadTable[re-2]=Br),Mt([],Qe,In=>{var pn=nl(mr,In,pt,me,Se);return un[V].overloadTable===void 0?(pn.argCount=re-2,un[V]=pn):un[V].overloadTable[re-2]=pn,[]}),[]})},il=[],lo=[],$u=q=>{q>9&&--lo[q+1]===0&&(lo[q]=void 0,il.push(q))},ff=()=>lo.length/2-5-il.length,a1=()=>{lo.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=ff},zo={toValue:q=>(q||He("Cannot use deleted val. handle = "+q),lo[q]),toHandle:q=>{switch(q){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const V=il.pop()||lo.length;return lo[V]=q,lo[V+1]=1,V}}}},Wr={name:"emscripten::val",fromWireType:q=>{var V=zo.toValue(q);return $u(q),V},toWireType:(q,V)=>zo.toHandle(V),argPackAdvance:ct,readValueFromPointer:rr,destructorFunction:null},Kr=q=>Ct(q,Wr),le=(q,V,re)=>{switch(V){case 1:return re?function(ae){return this.fromWireType(_[ae])}:function(ae){return this.fromWireType($[ae])};case 2:return re?function(ae){return this.fromWireType(ie[ae>>1])}:function(ae){return this.fromWireType(ce[ae>>1])};case 4:return re?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(P[ae>>2])};default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},we=(q,V,re,ae)=>{V=Et(V);function pe(){}pe.values={},Ct(q,{name:V,constructor:pe,fromWireType:function(me){return this.constructor.values[me]},toWireType:(me,Se)=>Se.value,argPackAdvance:ct,readValueFromPointer:le(V,re,ae),destructorFunction:null}),pc(V,pe)},$e=(q,V)=>{var re=Dt[q];return re===void 0&&He(`${V} has unknown type ${qh(q)}`),re},yt=(q,V,re)=>{var ae=$e(q,"enum");V=Et(V);var pe=ae.constructor,me=Object.create(ae.constructor.prototype,{value:{value:re},constructor:{value:co(`${ae.name}_${V}`,function(){})}});pe.values[re]=me,pe[V]=me},zr=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},tr=(q,V)=>{switch(V){case 4:return function(re){return this.fromWireType(M[re>>2])};case 8:return function(re){return this.fromWireType(v[re>>3])};default:throw new TypeError(`invalid float width (${V}): ${q}`)}},ln=(q,V,re)=>{V=Et(V),Ct(q,{name:V,fromWireType:ae=>ae,toWireType:(ae,pe)=>pe,argPackAdvance:ct,readValueFromPointer:tr(V,re),destructorFunction:null})},jn=(q,V,re,ae,pe,me,Se,Ae)=>{var Be=ju(V,re);q=Et(q),q=Uu(q),pe=hs(ae,pe),pc(q,function(){Fu(`Cannot call ${q} due to unbound types`,Be)},V-1),Mt([],Be,Ye=>{var Qe=[Ye[0],null].concat(Ye.slice(1));return Uh(q,nl(q,Qe,null,pe,me),V-1),[]})},wr=(q,V,re)=>{switch(V){case 1:return re?ae=>_[ae]:ae=>$[ae];case 2:return re?ae=>ie[ae>>1]:ae=>ce[ae>>1];case 4:return re?ae=>K[ae>>2]:ae=>P[ae>>2];default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},en=(q,V,re,ae,pe)=>{V=Et(V);var me=Qe=>Qe;if(ae===0){var Se=32-8*re;me=Qe=>Qe<>>Se}var Ae=V.includes("unsigned"),Be=(Qe,pt)=>{},Ye;Ae?Ye=function(Qe,pt){return Be(pt,this.name),pt>>>0}:Ye=function(Qe,pt){return Be(pt,this.name),pt},Ct(q,{name:V,fromWireType:me,toWireType:Ye,argPackAdvance:ct,readValueFromPointer:wr(V,re,ae!==0),destructorFunction:null})},Pn=(q,V,re)=>{var ae=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],pe=ae[V];function me(Se){var Ae=P[Se>>2],Be=P[Se+4>>2];return new pe(_.buffer,Be,Ae)}re=Et(re),Ct(q,{name:re,fromWireType:me,argPackAdvance:ct,readValueFromPointer:me},{ignoreDuplicateRegistrations:!0})},ps=Object.assign({optional:!0},Wr),Un=(q,V)=>{Ct(q,ps)},fn=(q,V,re,ae)=>{if(!(ae>0))return 0;for(var pe=re,me=re+ae-1,Se=0;Se=55296&&Ae<=57343){var Be=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Be&1023}if(Ae<=127){if(re>=me)break;V[re++]=Ae}else if(Ae<=2047){if(re+1>=me)break;V[re++]=192|Ae>>6,V[re++]=128|Ae&63}else if(Ae<=65535){if(re+2>=me)break;V[re++]=224|Ae>>12,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}else{if(re+3>=me)break;V[re++]=240|Ae>>18,V[re++]=128|Ae>>12&63,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}}return V[re]=0,re-pe},Yn=(q,V,re)=>fn(q,$,V,re),Ho=q=>{for(var V=0,re=0;re=55296&&ae<=57343?(V+=4,++re):V+=3}return V},js=typeof TextDecoder<"u"?new TextDecoder:void 0,Go=(q,V,re)=>{for(var ae=V+re,pe=V;q[pe]&&!(pe>=ae);)++pe;if(pe-V>16&&q.buffer&&js)return js.decode(q.subarray(V,pe));for(var me="";V>10,56320|Ye&1023)}}return me},Vh=(q,V)=>q?Go($,q,V):"",uf=(q,V)=>{V=Et(V);var re=V==="std::string";Ct(q,{name:V,fromWireType(ae){var pe=P[ae>>2],me=ae+4,Se;if(re)for(var Ae=me,Be=0;Be<=pe;++Be){var Ye=me+Be;if(Be==pe||$[Ye]==0){var Qe=Ye-Ae,pt=Vh(Ae,Qe);Se===void 0?Se=pt:(Se+="\0",Se+=pt),Ae=Ye+1}}else{for(var mr=new Array(pe),Be=0;Be>2]=me,re&&Se)Yn(pe,Be,me+1);else if(Se)for(var Ye=0;Ye255&&(uo(Be),He("String has UTF-16 code units that do not fit in 8 bits")),$[Be+Ye]=Qe}else for(var Ye=0;Ye{for(var re=q,ae=re>>1,pe=ae+V/2;!(ae>=pe)&&ce[ae];)++ae;if(re=ae<<1,re-q>32&&Qn)return Qn.decode($.subarray(q,re));for(var me="",Se=0;!(Se>=V/2);++Se){var Ae=ie[q+Se*2>>1];if(Ae==0)break;me+=String.fromCharCode(Ae)}return me},fo=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<2)return 0;re-=2;for(var pe=V,me=re>1]=Ae,V+=2}return ie[V>>1]=0,V-pe},FE=q=>q.length*2,Hx=(q,V)=>{for(var re=0,ae="";!(re>=V/4);){var pe=K[q+re*4>>2];if(pe==0)break;if(++re,pe>=65536){var me=pe-65536;ae+=String.fromCharCode(55296|me>>10,56320|me&1023)}else ae+=String.fromCharCode(pe)}return ae},sl=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<4)return 0;for(var pe=V,me=pe+re-4,Se=0;Se=55296&&Ae<=57343){var Be=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Be&1023}if(K[V>>2]=Ae,V+=4,V+4>me)break}return K[V>>2]=0,V-pe},c1=q=>{for(var V=0,re=0;re=55296&&ae<=57343&&++re,V+=4}return V},Hy=(q,V,re)=>{re=Et(re);var ae,pe,me,Se;V===2?(ae=LE,pe=fo,Se=FE,me=Ae=>ce[Ae>>1]):V===4&&(ae=Hx,pe=sl,Se=c1,me=Ae=>P[Ae>>2]),Ct(q,{name:re,fromWireType:Ae=>{for(var Be=P[Ae>>2],Ye,Qe=Ae+4,pt=0;pt<=Be;++pt){var mr=Ae+4+pt*V;if(pt==Be||me(mr)==0){var Br=mr-Qe,un=ae(Qe,Br);Ye===void 0?Ye=un:(Ye+="\0",Ye+=un),Qe=mr+V}}return uo(Ae),Ye},toWireType:(Ae,Be)=>{typeof Be!="string"&&He(`Cannot pass non-string to C++ string type ${re}`);var Ye=Se(Be),Qe=Xy(4+Ye+V);return P[Qe>>2]=Ye/V,pe(Be,Qe+4,Ye+V),Ae!==null&&Ae.push(uo,Qe),Qe},argPackAdvance:ct,readValueFromPointer:rr,destructorFunction(Ae){uo(Ae)}})},dn=(q,V,re,ae,pe,me)=>{xt[q]={name:Et(V),rawConstructor:hs(re,ae),rawDestructor:hs(pe,me),fields:[]}},ol=(q,V,re,ae,pe,me,Se,Ae,Be,Ye)=>{xt[q].fields.push({fieldName:Et(V),getterReturnType:re,getter:hs(ae,pe),getterContext:me,setterArgumentType:Se,setter:hs(Ae,Be),setterContext:Ye})},Gy=(q,V)=>{V=Et(V),Ct(q,{isVoid:!0,name:V,argPackAdvance:0,fromWireType:()=>{},toWireType:(re,ae)=>{}})},jE=(q,V,re)=>$.copyWithin(q,V,V+re),zh=[],UE=(q,V,re,ae)=>(q=zh[q],V=zo.toValue(V),q(null,V,re,ae)),$E={},qE=q=>{var V=$E[q];return V===void 0?Et(q):V},Wy=()=>{if(typeof globalThis=="object")return globalThis;function q(V){V.$$$embind_global$$$=V;var re=typeof $$$embind_global$$$=="object"&&V.$$$embind_global$$$==V;return re||delete V.$$$embind_global$$$,re}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&q(global)?$$$embind_global$$$=global:typeof self=="object"&&q(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},l1=q=>q===0?zo.toHandle(Wy()):(q=qE(q),zo.toHandle(Wy()[q])),qu=q=>{var V=zh.length;return zh.push(q),V},VE=(q,V)=>{for(var re=new Array(q),ae=0;ae>2],"parameter "+ae);return re},Gx=Reflect.construct,Wx=(q,V,re)=>{var ae=[],pe=q.toWireType(ae,re);return ae.length&&(P[V>>2]=zo.toHandle(ae)),pe},Ky=(q,V,re)=>{var ae=VE(q,V),pe=ae.shift();q--;var me=new Array(q),Se=(Be,Ye,Qe,pt)=>{for(var mr=0,Br=0;BrBe.name).join(", ")}) => ${pe.name}>`;return qu(co(Ae,Se))},Yy=q=>{q>9&&(lo[q+1]+=1)},Kx=q=>{var V=zo.toValue(q);ar(V),$u(q)},zE=(q,V)=>{q=$e(q,"_emval_take_value");var re=q.readValueFromPointer(V);return zo.toHandle(re)},Qy=(q,V,re,ae)=>{var pe=new Date().getFullYear(),me=new Date(pe,0,1),Se=new Date(pe,6,1),Ae=me.getTimezoneOffset(),Be=Se.getTimezoneOffset(),Ye=Math.max(Ae,Be);P[q>>2]=Ye*60,K[V>>2]=+(Ae!=Be);var Qe=Br=>{var un=Br>=0?"-":"+",Zn=Math.abs(Br),In=String(Math.floor(Zn/60)).padStart(2,"0"),pn=String(Zn%60).padStart(2,"0");return`UTC${un}${In}${pn}`},pt=Qe(Ae),mr=Qe(Be);Be2147483648,HE=(q,V)=>Math.ceil(q/V)*V,Yx=q=>{var V=F.buffer,re=(q-V.byteLength+65535)/65536;try{return F.grow(re),m(),1}catch{}},Us=q=>{var V=$.length;q>>>=0;var re=Jy();if(q>re)return!1;for(var ae=1;ae<=4;ae*=2){var pe=V*(1+.2/ae);pe=Math.min(pe,q+100663296);var me=Math.min(re,HE(Math.max(q,pe),65536)),Se=Yx(me);if(Se)return!0}return!1},Hh={},Gh=()=>p||"./this.program",Vu=()=>{if(!Vu.strings){var q=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",V={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:q,_:Gh()};for(var re in Hh)Hh[re]===void 0?delete V[re]:V[re]=Hh[re];var ae=[];for(var re in V)ae.push(`${re}=${V[re]}`);Vu.strings=ae}return Vu.strings},Qx=(q,V)=>{for(var re=0;re{var re=0;return Vu().forEach((ae,pe)=>{var me=V+re;P[q+pe*4>>2]=me,Qx(ae,me),re+=ae.length+1}),0},WE=(q,V)=>{var re=Vu();P[q>>2]=re.length;var ae=0;return re.forEach(pe=>ae+=pe.length+1),P[V>>2]=ae,0},KE=q=>52;function YE(q,V,re,ae,pe){return 70}var QE=[null,[],[]],zu=(q,V)=>{var re=QE[q];V===0||V===10?((q===1?S:O)(Go(re,0)),re.length=0):re.push(V)},JE=(q,V,re,ae)=>{for(var pe=0,me=0;me>2],Ae=P[V+4>>2];V+=8;for(var Be=0;Be>2]=pe,0},ZE=q=>q;dt=i.InternalError=class extends Error{constructor(q){super(q),this.name="InternalError"}},zt(),Bt=i.BindingError=class extends Error{constructor(q){super(q),this.name="BindingError"}},qo(),Uo(),Nu(),$h=i.UnboundTypeError=s1(Error,"UnboundTypeError"),a1();var Zy={t:st,x:We,a:wt,j:rt,k:It,O:At,q:Tt,ga:Xt,d:vt,ca:lr,va:ut,ba:Vt,pa:Ht,ta:vc,sa:Vy,E:zy,oa:Kr,F:we,n:yt,W:ln,X:jn,y:en,u:Pn,ua:Un,V:uf,P:Hy,L:dn,wa:ol,qa:Gy,ja:jE,T:UE,xa:$u,ya:l1,U:Ky,Y:Yy,Z:Kx,ra:zE,da:Qy,ha:Us,ea:GE,fa:WE,ia:KE,$:YE,S:JE,J:h1,C:nC,Q:bt,R:s2,r:d1,b:Hu,D:n2,la:p1,c:Nr,ka:al,h:Pe,i:XE,s:po,N:tC,w:eC,I:i2,K:Hr,B:iC,H:o2,aa:a2,_:Wh,l:Jn,f:Jt,e:Oe,g:be,M:g1,m:tm,ma:rC,p:f1,v:Gu,na:u1,A:v1,o:tn,G:y1,z:ZE},hn=et(),gc=q=>(gc=hn.Ba)(q),uo=i._free=q=>(uo=i._free=hn.Ca)(q),Xy=i._malloc=q=>(Xy=i._malloc=hn.Ea)(q),Jx=q=>(Jx=hn.Fa)(q),yr=(q,V)=>(yr=hn.Ga)(q,V),df=q=>(df=hn.Ha)(q),ho=q=>(ho=hn.Ia)(q),em=()=>(em=hn.Ja)(),Zx=q=>(Zx=hn.Ka)(q),Xx=q=>(Xx=hn.La)(q),e2=(q,V,re)=>(e2=hn.Ma)(q,V,re);i.dynCall_viijii=(q,V,re,ae,pe,me,Se)=>(i.dynCall_viijii=hn.Na)(q,V,re,ae,pe,me,Se);var t2=i.dynCall_jiii=(q,V,re,ae)=>(t2=i.dynCall_jiii=hn.Oa)(q,V,re,ae);i.dynCall_jiji=(q,V,re,ae,pe)=>(i.dynCall_jiji=hn.Pa)(q,V,re,ae,pe);var r2=i.dynCall_jiiii=(q,V,re,ae,pe)=>(r2=i.dynCall_jiiii=hn.Qa)(q,V,re,ae,pe);i.dynCall_iiiiij=(q,V,re,ae,pe,me,Se)=>(i.dynCall_iiiiij=hn.Ra)(q,V,re,ae,pe,me,Se),i.dynCall_iiiiijj=(q,V,re,ae,pe,me,Se,Ae,Be)=>(i.dynCall_iiiiijj=hn.Sa)(q,V,re,ae,pe,me,Se,Ae,Be),i.dynCall_iiiiiijj=(q,V,re,ae,pe,me,Se,Ae,Be,Ye)=>(i.dynCall_iiiiiijj=hn.Ta)(q,V,re,ae,pe,me,Se,Ae,Be,Ye);function Hu(q,V){var re=Ne();try{return hr(q)(V)}catch(ae){if(ke(re),ae!==ae+0)throw ae;yr(1,0)}}function be(q,V,re,ae){var pe=Ne();try{hr(q)(V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function Oe(q,V,re){var ae=Ne();try{hr(q)(V,re)}catch(pe){if(ke(ae),pe!==pe+0)throw pe;yr(1,0)}}function Pe(q,V,re,ae){var pe=Ne();try{return hr(q)(V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function bt(q,V,re,ae,pe){var me=Ne();try{return hr(q)(V,re,ae,pe)}catch(Se){if(ke(me),Se!==Se+0)throw Se;yr(1,0)}}function Jt(q,V){var re=Ne();try{hr(q)(V)}catch(ae){if(ke(re),ae!==ae+0)throw ae;yr(1,0)}}function Nr(q,V,re){var ae=Ne();try{return hr(q)(V,re)}catch(pe){if(ke(ae),pe!==pe+0)throw pe;yr(1,0)}}function Jn(q){var V=Ne();try{hr(q)()}catch(re){if(ke(V),re!==re+0)throw re;yr(1,0)}}function tn(q,V,re,ae,pe,me,Se,Ae,Be,Ye,Qe){var pt=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae,Be,Ye,Qe)}catch(mr){if(ke(pt),mr!==mr+0)throw mr;yr(1,0)}}function tm(q,V,re,ae,pe){var me=Ne();try{hr(q)(V,re,ae,pe)}catch(Se){if(ke(me),Se!==Se+0)throw Se;yr(1,0)}}function XE(q,V,re,ae,pe){var me=Ne();try{return hr(q)(V,re,ae,pe)}catch(Se){if(ke(me),Se!==Se+0)throw Se;yr(1,0)}}function po(q,V,re,ae,pe,me){var Se=Ne();try{return hr(q)(V,re,ae,pe,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;yr(1,0)}}function f1(q,V,re,ae,pe,me){var Se=Ne();try{hr(q)(V,re,ae,pe,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;yr(1,0)}}function eC(q,V,re,ae,pe,me,Se){var Ae=Ne();try{return hr(q)(V,re,ae,pe,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;yr(1,0)}}function Gu(q,V,re,ae,pe,me,Se,Ae){var Be=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;yr(1,0)}}function u1(q,V,re,ae,pe,me,Se,Ae,Be){var Ye=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae,Be)}catch(Qe){if(ke(Ye),Qe!==Qe+0)throw Qe;yr(1,0)}}function d1(q){var V=Ne();try{return hr(q)()}catch(re){if(ke(V),re!==re+0)throw re;yr(1,0)}}function Hr(q,V,re,ae,pe,me,Se,Ae,Be){var Ye=Ne();try{return hr(q)(V,re,ae,pe,me,Se,Ae,Be)}catch(Qe){if(ke(Ye),Qe!==Qe+0)throw Qe;yr(1,0)}}function tC(q,V,re,ae,pe,me,Se){var Ae=Ne();try{return hr(q)(V,re,ae,pe,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;yr(1,0)}}function n2(q,V,re,ae){var pe=Ne();try{return hr(q)(V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function h1(q,V,re,ae){var pe=Ne();try{return hr(q)(V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function rC(q,V,re,ae,pe,me,Se,Ae){var Be=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;yr(1,0)}}function nC(q,V,re,ae,pe,me){var Se=Ne();try{return hr(q)(V,re,ae,pe,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;yr(1,0)}}function iC(q,V,re,ae,pe,me,Se,Ae,Be,Ye){var Qe=Ne();try{return hr(q)(V,re,ae,pe,me,Se,Ae,Be,Ye)}catch(pt){if(ke(Qe),pt!==pt+0)throw pt;yr(1,0)}}function p1(q,V,re){var ae=Ne();try{return hr(q)(V,re)}catch(pe){if(ke(ae),pe!==pe+0)throw pe;yr(1,0)}}function al(q,V,re,ae,pe){var me=Ne();try{return hr(q)(V,re,ae,pe)}catch(Se){if(ke(me),Se!==Se+0)throw Se;yr(1,0)}}function v1(q,V,re,ae,pe,me,Se,Ae,Be,Ye){var Qe=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae,Be,Ye)}catch(pt){if(ke(Qe),pt!==pt+0)throw pt;yr(1,0)}}function i2(q,V,re,ae,pe,me,Se,Ae){var Be=Ne();try{return hr(q)(V,re,ae,pe,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;yr(1,0)}}function g1(q,V,re,ae,pe,me,Se){var Ae=Ne();try{hr(q)(V,re,ae,pe,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;yr(1,0)}}function s2(q,V,re,ae){var pe=Ne();try{return hr(q)(V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function o2(q,V,re,ae,pe,me,Se,Ae,Be,Ye,Qe,pt){var mr=Ne();try{return hr(q)(V,re,ae,pe,me,Se,Ae,Be,Ye,Qe,pt)}catch(Br){if(ke(mr),Br!==Br+0)throw Br;yr(1,0)}}function y1(q,V,re,ae,pe,me,Se,Ae,Be,Ye,Qe,pt,mr,Br,un,Zn){var In=Ne();try{hr(q)(V,re,ae,pe,me,Se,Ae,Be,Ye,Qe,pt,mr,Br,un,Zn)}catch(pn){if(ke(In),pn!==pn+0)throw pn;yr(1,0)}}function a2(q,V,re,ae){var pe=Ne();try{return t2(q,V,re,ae)}catch(me){if(ke(pe),me!==me+0)throw me;yr(1,0)}}function Wh(q,V,re,ae,pe){var me=Ne();try{return r2(q,V,re,ae,pe)}catch(Se){if(ke(me),Se!==Se+0)throw Se;yr(1,0)}}var Sa;X=function q(){Sa||Kh(),Sa||(X=q)};function Kh(){if(j>0||(x(),j>0))return;function q(){var V;Sa||(Sa=!0,i.calledRun=!0,!z&&(w(),s(i),(V=i.onRuntimeInitialized)===null||V===void 0||V.call(i),T()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),q()},1)):q()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Kh(),n=a,n}})();function Eje(t){return QM(JM,t)}async function Cje(t,e){return wje(JM,t,e)}async function Aje(t,e){return xje(JM,t,e)}const ere=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],Sje=[...ere,["unknown"]].map(t=>t[0]),II=new Map(ere);function _je(t){for(const[e,r]of II)if(t===r)return e;return"unknown"}function Ije(t){if(tre(t))return{width:t.naturalWidth,height:t.naturalHeight};if(rre(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(nre(t))return{width:t.videoWidth,height:t.videoHeight};if(sre(t))return{width:t.width,height:t.height};if(are(t))return{width:t.displayWidth,height:t.displayHeight};if(ire(t))return{width:t.width,height:t.height};if(ore(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function tre(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLImageElement)}catch{return!1}}function rre(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.SVGImageElement)}catch{return!1}}function nre(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLVideoElement)}catch{return!1}}function ire(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLCanvasElement)}catch{return!1}}function sre(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function ore(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function are(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function cre(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function Tje(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function Pje(t,e){try{const r=new OffscreenCanvas(t,e);if(r.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return r;throw void 0}catch{const r=document.createElement("canvas");return r.width=t,r.height=e,r}}async function lre(t){if(tre(t)&&!await Oje(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(rre(t)&&!await Dje(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(are(t)&&Nje(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(nre(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(sre(t)&&Lje(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:r}=Ije(t);if(e===0||r===0)return null;const n=Pje(e,r).getContext("2d");n.drawImage(t,0,0);try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function kje(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let r="";try{r=URL.createObjectURL(t),e.src=r,await e.decode()}finally{URL.revokeObjectURL(r)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await lre(e)}function Mje(t){const{width:e,height:r}=t;if(e===0||r===0)return null;const n=t.getContext("2d");try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Rje(t){if(cre(t))return await kje(t);if(Tje(t)){if(Bje(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return ire(t)||ore(t)?Mje(t):await lre(t)}async function Oje(t){try{return await t.decode(),!0}catch{return!1}}async function Dje(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function Nje(t){return t.format===null}function Bje(t){return t.data.buffer.byteLength===0}function Lje(t){return t.width===0&&t.height===0}function F$(t,e){return Fje(t)?new DOMException(`${e}: ${t.message}`,t.name):jje(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Fje(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function jje(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var U3;class TI extends EventTarget{constructor(e={}){var r;super(),lje(this,U3);try{const n=(r=e==null?void 0:e.formats)==null?void 0:r.filter(i=>i!=="unknown");if((n==null?void 0:n.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const i of n??[])if(!II.has(i))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${i}' is not a valid enum value of type BarcodeFormat.`);fje(this,U3,n??[]),Eje().then(i=>{this.dispatchEvent(new CustomEvent("load",{detail:i}))}).catch(i=>{this.dispatchEvent(new CustomEvent("error",{detail:i}))})}catch(n){throw F$(n,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Sje.filter(e=>e!=="unknown")}async detect(e){try{const r=await Rje(e);if(r===null)return[];let n;const i={tryHarder:!0,returnCodabarStartEnd:!0,formats:cje(this,U3).map(s=>II.get(s))};try{cre(r)?n=await Cje(r,i):n=await Aje(r,i)}catch(s){throw console.error(s),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return n.map(s=>{const{topLeft:{x:o,y:a},topRight:{x:c,y:l},bottomLeft:{x:f,y:u},bottomRight:{x:p,y:g}}=s.position,y=Math.min(o,c,f,p),b=Math.min(a,l,u,g),I=Math.max(o,c,f,p),C=Math.max(a,l,u,g);return{boundingBox:new DOMRectReadOnly(y,b,I-y,C-b),rawValue:s.text,format:_je(s.format),cornerPoints:[{x:o,y:a},{x:c,y:l},{x:p,y:g},{x:f,y:u}]}})}catch(r){throw F$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}U3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=TI);function Uje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function $je(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),qt.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function qje(t){const{scanning:e,startScanning:r,stopScanning:n}=t,[i,s]=D.useState(!1);function o(){s(!0),e?n():r(),setTimeout(()=>s(!1),1e3)}return qt.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:i?"default":"pointer"}},e?qt.createElement(Uje,{disabled:i,onClick:o}):qt.createElement($je,{disabled:i,onClick:o}))}function Vje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function zje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function Hje(t){const{status:e,scanning:r,torchToggle:n}=t;function i(s){n(s)}return r&&n?qt.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?qt.createElement(zje,{onClick:()=>i(!1)}):qt.createElement(Vje,{onClick:()=>i(!0)})):null}function Gje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function Wje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function Kje(t){const{scanning:e,capabilities:r,onZoom:n,value:i}=t;if(!e||!n)return null;const s=(r.max-r.min)/3;return qt.createElement(D.Fragment,null,qt.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Wje,{disabled:i<=r.min,onClick:function(){n(Math.max(i-s,r.min))}})),qt.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Gje,{disabled:i>=r.max,onClick:function(){n(Math.min(i+s,r.max))}})))}function Yje(t){const{scanning:e,loading:r,capabilities:n,border:i=35,onOff:s,torch:o,zoom:a,startScanning:c,stopScanning:l}=t,f="rgba(255, 0, 0, 0.5)";return qt.createElement("div",{style:{position:"relative"}},qt.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${i>=35?i:35}px solid rgba(0, 0, 0, 0.2)`}},r&&qt.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",qt.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),qt.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:f,strokeWidth:3})),s&&qt.createElement(qje,{scanning:e,startScanning:c,stopScanning:l}),o&&n.torch&&qt.createElement(Hje,{scanning:e,status:o.status,torchToggle:o.toggle}),a&&n.zoom&&qt.createElement(Kje,{scanning:e,capabilities:n.zoom,value:a.value,onZoom:a.onChange}))}const Qje={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},Jje={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},Zje={width:"100%",height:"100%",position:"relative"},Xje={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var eUe=function(t){let e,r=!1;return(...n)=>(r||(e=t(n),r=!0),e)}(()=>{const t=OFe(window);switch(t.browser){case"chrome":zFe(window,t);break;case"firefox":KFe(window,t);break;case"safari":ZFe(window,t);break;default:throw new Error("Unsupported browser")}});const tUe="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var fb=t=>t instanceof Date,fre=t=>t==null;const ure=t=>typeof t=="object";var j$=t=>!fre(t)&&!Array.isArray(t)&&ure(t)&&!fb(t),U$=t=>fre(t)||!ure(t);function dre(t,e){if(U$(t)||U$(e))return t===e;if(fb(t)&&fb(e))return t.getTime()===e.getTime();const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r){const s=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=e[i];if(fb(s)&&fb(o)||j$(s)&&j$(o)||Array.isArray(s)&&Array.isArray(o)?!dre(s,o):s!==o)return!1}}return!0}function F6(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function rUe(t){var e;const{onScan:r,constraints:n,formats:i=["qr_code"],paused:s=!1,components:o,children:a,styles:c,classNames:l,allowMultiple:f,scanDelay:u,onError:p}=t,g=D.useRef(null),y=D.useRef(null),b=D.useRef(null),I=D.useMemo(()=>({...Qje,...n}),[n]),C=D.useMemo(()=>({...Jje,...o}),[o]),[S,O]=D.useState(!1),[L,F]=D.useState(!0),[z,_]=D.useState(I),$=function(){const v=D.useRef(Promise.resolve({type:"stop",data:{}})),m=D.useRef(null),R=D.useRef(null),[B,E]=D.useState({}),[x,w]=D.useState({}),T=D.useCallback(async(X,G)=>{var Z,ee,N;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Z=navigator==null?void 0:navigator.mediaDevices)===null||Z===void 0?void 0:Z.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");eUe();const te=await navigator.mediaDevices.getUserMedia({audio:!1,video:G});X.srcObject!==void 0?X.srcObject=te:X.mozSrcObject!==void 0?X.mozSrcObject=te:window.URL.createObjectURL?X.src=window.URL.createObjectURL(te):window.webkitURL?X.src=window.webkitURL.createObjectURL(te):X.src=te.id,await Promise.race([X.play(),new Promise(Ee=>setTimeout(Ee,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Ee=>setTimeout(Ee,500));const[fe]=te.getVideoTracks();return w(fe.getSettings()),E((N=(ee=fe==null?void 0:fe.getCapabilities)===null||ee===void 0?void 0:ee.call(fe))!==null&&N!==void 0?N:{}),m.current=te,R.current=fe,{type:"start",data:{videoEl:X,stream:te,constraints:G}}},[]),k=D.useCallback(async(X,G)=>{X.src="",X.srcObject=null,X.load();for(const Z of G.getTracks())G.removeTrack(Z),Z.stop();return m.current=null,R.current=null,w({}),{type:"stop",data:{}}},[]),H=D.useCallback(async(X,{constraints:G,restart:Z=!1})=>{if(v.current=v.current.then(ee=>{if(ee.type==="start"){const{data:{videoEl:N,stream:te,constraints:fe}}=ee;return Z||X!==N||G!==fe?k(N,te).then(()=>T(X,G)):ee}return T(X,G)}),(await v.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[T,k]),oe=D.useCallback(async()=>{if(v.current=v.current.then(X=>{if(X.type==="stop")return X;const{data:{videoEl:G,stream:Z}}=X;return k(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[k]),j=D.useCallback(async X=>{const G=R.current;if(!G)throw new Error("No active video track found.");{X.advanced&&X.advanced[0].zoom&&G.getCapabilities().torch&&await G.applyConstraints({advanced:[{torch:!1}]}),await G.applyConstraints(X);const Z=G.getCapabilities(),ee=G.getSettings();E(Z),w(ee)}},[]);return D.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:B,settings:x,startCamera:H,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:ce}=function(v){const{videoElementRef:m,onScan:R,onFound:B,retryDelay:E=100,scanDelay:x=0,formats:w=[],audio:T=!0,allowMultiple:k=!1}=v,H=D.useRef(new TI({formats:w})),oe=D.useRef(null),j=D.useRef(null);D.useEffect(()=>{H.current=new TI({formats:w})},[w]),D.useEffect(()=>{typeof window<"u"&&T&&(oe.current=new Audio(tUe))},[T]);const X=D.useCallback(G=>async Z=>{if(m.current!==null&&m.current.readyState>1){const{lastScan:ee,contentBefore:N,lastScanHadContent:te}=G;if(Z-ee!N.includes(De.rawValue)),_e=fe.length>0;let Re=G.lastOnScan;(Ee||k&&_e&&Z-Re>=x)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(De=>console.error("Error playing the sound",De)),Re=Z,R(fe)),_e&&B(fe),!_e&&te&&B(fe);const Te={lastScan:Z,lastOnScan:Re,lastScanHadContent:_e,contentBefore:Ee?fe.map(De=>De.rawValue):N};j.current=window.requestAnimationFrame(X(Te))}}},[m.current,R,B,E]);return{startScanning:D.useCallback(()=>{const G=performance.now(),Z={lastScan:G,lastOnScan:G,contentBefore:[],lastScanHadContent:!1};j.current=window.requestAnimationFrame(X(Z))},[X]),stopScanning:D.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null)},[])}}({videoElementRef:g,onScan:r,onFound:v=>function(m,R,B,E){const x=B;if(x==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=R;if(w==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(m.length===0||E===void 0)F6(x);else{const T=w.offsetWidth,k=w.offsetHeight,H=w.videoWidth,oe=w.videoHeight,j=Math.max(T/H,k/oe),X=H*j,G=oe*j,Z=X/H,ee=G/oe,N=(T-X)/2,te=(k-G)/2,fe=({x:Te,y:De})=>({x:Math.floor(Te*Z),y:Math.floor(De*ee)}),Ee=({x:Te,y:De})=>({x:Math.floor(Te+N),y:Math.floor(De+te)}),_e=m.map(Te=>{const{boundingBox:De,cornerPoints:ze}=Te,{x:et,y:Je}=Ee(fe({x:De.x,y:De.y})),{x:ke,y:Ne}=fe({x:De.width,y:De.height});return{...Te,cornerPoints:ze.map(tt=>Ee(fe(tt))),boundingBox:DOMRectReadOnly.fromRect({x:et,y:Je,width:ke,height:Ne})}});x.width=w.offsetWidth,x.height=w.offsetHeight;const Re=x.getContext("2d");if(Re===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");E(_e,Re)}}(v,g.current,b.current,C.tracker),formats:i,audio:C.audio,allowMultiple:f,retryDelay:C.tracker===void 0?500:10,scanDelay:u});D.useEffect(()=>(O(!0),()=>{O(!1)}),[]),D.useEffect(()=>{S&&(ce(),ie())},[o==null?void 0:o.tracker]),D.useEffect(()=>{if(!dre(I,z)){const v=I;n!=null&&n.deviceId&&delete v.facingMode,_(v)}},[n]);const K=D.useMemo(()=>({constraints:z,shouldStream:S&&!s}),[z,S,s]),P=async()=>{const v=g.current;if(v==null)throw new Error("Video should be defined when component is mounted.");const m=y.current;if(m==null)throw new Error("Canvas should be defined when component is mounted.");const R=m.getContext("2d");if(R==null)throw new Error("Canvas should be defined when component is mounted.");if(K.shouldStream){await $.stopCamera(),F(!1);try{await $.startCamera(v,K),v?F(!0):await $.stopCamera()}catch(B){p==null||p(B),console.error("error",B)}}else m.width=v.videoWidth,m.height=v.videoHeight,R.drawImage(v,0,0,v.videoWidth,v.videoHeight),await $.stopCamera(),F(!1)};D.useEffect(()=>{(async()=>await P())()},[K]);const M=D.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return D.useEffect(()=>{if(M){if(y.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(F6(y.current),b.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(F6(b.current),g.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");ie()}},[M]),qt.createElement("div",{style:{...Zje,...c==null?void 0:c.container},className:l==null?void 0:l.container},qt.createElement("video",{ref:g,style:{...Xje,...c==null?void 0:c.video,visibility:s?"hidden":"visible"},className:l==null?void 0:l.video,autoPlay:!0,muted:!0,playsInline:!0}),qt.createElement("canvas",{ref:y,style:{display:s?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),qt.createElement("canvas",{ref:b,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),qt.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},C.finder&&qt.createElement(Yje,{scanning:L,capabilities:$.capabilities,loading:!1,onOff:C.onOff,zoom:C.zoom&&$.settings.zoom?{value:$.settings.zoom,onChange:async v=>{const m={...z,advanced:[{zoom:v}]};await $.updateConstraints(m)}}:void 0,torch:C.torch?{status:(e=$.settings.torch)!==null&&e!==void 0&&e,toggle:async v=>{const m={...z,advanced:[{torch:v}]};await $.updateConstraints(m)}}:void 0,startScanning:async()=>await P(),stopScanning:async()=>{await $.stopCamera(),F6(b.current),F(!1)},border:c==null?void 0:c.finderBorder}),a))}function nUe({onQrUri:t}){const e=Ir(NE),[r,n]=D.useState(""),i=async()=>{if(r){console.log(r);try{await e.pair(r)}catch(s){console.error(s),t(!1)}}t(!0)};return W.jsxs(xe,{flexDirection:"column",justifyContent:"space-between",padding:"12",gap:"3",children:[W.jsx(rUe,{onScan:s=>{s[0].rawValue&&n(s[0].rawValue)},styles:{video:{transform:"scaleX(-1)",borderRadius:"10px"}}}),W.jsxs(xe,{children:[W.jsx(Wn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Zt,{marginTop:"4",variant:"primary",size:"md",shape:"square",label:"Connect Dapp",disabled:!r,onClick:()=>{r&&i()}})})]})]})}const hre=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});function iUe(){var _e,Re;const t=jte(),e=Ir(li),r=Ir(Tx),n=Ir(Zr),i=Ir(NE),s=yn(e.accountAddress),o=yn(n.isSigningTxn),a=yn(n.isSigningMsg),c=yn(i.allSessions),l=h8(),f=KP("isMobile"),u=uFe();D.useEffect(()=>{if(u&&u.connected&&!n.selectedExternalProvider.get()){let Te=hre(u),De=n.availableExternalProviders.get();De?n.availableExternalProviders.set([Te,...De]):n.availableExternalProviders.set([Te])}},[u]),D.useEffect(()=>{t.length>0&&n.availableExternalProviders.set(t)},[t]);const p=yn(n.selectedExternalProvider),g=yn(n.selectedExternalWalletAddress),y=yn(n.isSendingTokenTransaction),b=yn(n.isSendingCollectibleTransaction),I=yn(n.isSendingSignedTokenTransaction),C=Ir(Nn),[S,O]=D.useState(!0),[L,F]=D.useState(void 0),[z,_]=D.useState(void 0),[$,ie]=D.useState(!1),[ce,K]=D.useState(!1),[P,M]=D.useState(!1),[v,m]=D.useState(!1),[R,B]=D.useState(!1),[E,x]=D.useState(!1),[w,T]=D.useState(!1),k=yn(n.signClientWarningType),H=Te=>{_(void 0),n.isSendingCollectibleTransaction.set(void 0),F(Te),B(!0)},oe=Te=>{F(void 0),n.isSendingTokenTransaction.set(void 0),_(Te),x(!0)},j=async(Te=!1)=>{(p===void 0||Te)&&M(!0)},X=async()=>{n.setExternalProvider(void 0);const Te=p;(Te==null?void 0:Te.info.name)==="WalletConnect"&&Te.provider.disconnect()},G=async(Te,De)=>{if(!n.selectedExternalProvider.get()){console.warn("No external provider selected");return}var ze;let et;try{if(L)ze=L.chainId,et=await n.sendToken(L,Te,De);else if(z)ze=z.collectibleInfoParams.chainId,et=await n.sendCollectible(z,Te,De);else{console.warn("No pending send found");return}}catch(Ne){Ne.code===4001&&l({variant:"error",title:"User denied transaction signature."}),console.error(Ne);return}const Je=C.providerForChainId(ze),ke=await k$(Je,et.hash);ke&&l({variant:"success",title:"Transaction confirmed",description:"You can view the transaction details on your connected external wallet"}),L&&r.updateTokenBalance(L),F(void 0),_(void 0),n.isSendingTokenTransaction.set(void 0),n.isSendingCollectibleTransaction.set(void 0),console.log("receipt",ke)},Z=async(Te,De)=>{const ze=C.providerForChainId(De);await k$(ze,Te)&&(n.isSendingSignedTokenTransaction.set(void 0),l({variant:"success",title:"Sign transaction confirmed",description:"You can view the transaction details on your connected external wallet"}))},ee=()=>{i.rejectRequest(),n.toSignPermission.set("cancelled")};async function N(Te){var ke;const De=async(Ne,tt,Ze)=>{try{const st=await n.getExternalProviderAddress(ze);if(!st)throw new Error("No provider address found");return console.log("sendTransaction chainId",tt),await n.sendTransaction(et,ze,st,Ne,tt)}catch(st){throw n.isSendingSignedTokenTransaction.set(void 0),st}},ze=(ke=n.selectedExternalProvider.get())==null?void 0:ke.provider,et=e.account;let Je;if(Te)try{n.isSendingSignedTokenTransaction.set(Te),Je=await De(Te.txn,Te.chainId,Te.options),Z(Je.hash,Te.chainId),n.toSignResult.set(Je),n.toSignPermission.set("approved")}catch(Ne){throw n.isSendingSignedTokenTransaction.set(void 0),ee(),Ne}}async function te(Te){const De=async(Je,ke)=>{try{let Ne;if(Je.message)console.log("signMessage chainId",Je.chainId),Ne=await ze.signMessage(Je.message,Je.chainId,Je.eip6492?"eip6492":"throw");else if(Je.typedData){const tt=Je.typedData;Ne=await ze.signTypedData(tt.domain,tt.types,tt.message,Je.chainId,Je.eip6492?"eip6492":"throw")}if(!Ne)throw new Error("Account sign method failed");return{hash:Ne}}catch(Ne){throw Ne}},ze=e.account;let et;if(Te)try{et=await De(Te.message),n.toSignResult.set(et),n.toSignPermission.set("approved")}catch(Je){throw n.isSendingSignedTokenTransaction.set(void 0),ee(),Je}}const fe=async()=>{var Te;((Te=n.selectedExternalProvider.get())==null?void 0:Te.info.name)==="WalletConnect"?n.signClientWarningType.set("isWalletConnect"):T(!0)},Ee=async()=>{m(!0)};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:vM,alt:"Sequence Logo",width:"40"}),W.jsxs(xe,{marginLeft:"auto",children:[W.jsx(Zt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>ie(!0)}),W.jsx(EFe,{onTokenListClick:()=>K(!0)})]})]}),W.jsxs(xe,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs($r,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(Ge,{variant:"normal",fontWeight:"bold",color:"text100",children:s}),W.jsx(PFe,{sessionList:c}),W.jsx(Zt,{marginTop:"4",variant:"primary",size:"sm",shape:"square",label:"Connect to a Dapp with WalletConnect",leftIcon:Kpe,onClick:()=>{fe()}})]}),W.jsxs($r,{alignItems:"center",flexDirection:"column",padding:"6",marginTop:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:p?"Your external wallet that will be used to relay transactions":"Connect an external wallet to relay transactions"}),p&&W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:p.info.icon,alt:p.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:p.info.name})]}),g&&W.jsxs(Ge,{variant:"normal",color:"text100",children:["(",g,")"]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(Zt,{size:"xs",label:"Change external wallet",variant:"text",shape:"square",marginRight:"10",onClick:()=>j(!0)}),W.jsx(Zt,{size:"xs",label:"Disconnect",variant:"text",shape:"square",onClick:()=>X()})]})]})}),!p&&W.jsx(Zt,{label:"Connect",variant:"primary",size:"md",shape:"square",onClick:j})]}),y&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(lS,{symbol:((Re=(_e=y.tokenBalance)==null?void 0:_e.contractInfo)==null?void 0:Re.symbol)??"",chainId:y.tokenBalance.chainId,to:y.to,amount:y.amount})}),b&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(lS,{symbol:b.collectibleInfo.collectibleInfoResponse.name??"",chainId:b.collectibleInfo.collectibleInfoParams.chainId,to:b.to,amount:b.amount})}),I&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(lS,{symbol:"tokens",chainId:I.chainId,to:I.txn[0].to,amount:String(Number(I.txn[0].value))})}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(xe,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Coins"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(swe,{label:"Filter zero balances",checked:S,onCheckedChange:O})})]}),W.jsx(IFe,{filterZeroBalances:S,onSendClick:H})]}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(gFe,{onSendClick:oe})]})]})]}),$&&W.jsx(Tc,{onClose:()=>ie(!1),children:W.jsx(mFe,{})}),ce&&W.jsx(Tc,{onClose:()=>K(!1),children:W.jsx(CFe,{})}),P&&W.jsx(Tc,{size:"md",onClose:()=>M(!1),children:W.jsx(bFe,{onSelectProvider:async Te=>{var De,ze;Te&&(((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"&&await((ze=n.selectedExternalProvider.get())==null?void 0:ze.provider).disconnect(),n.setExternalProvider(Te)),M(!1)}})}),v&&W.jsx(Tc,{size:"md",onClose:()=>m(!1),children:W.jsx(TFe,{onClose:()=>m(!1)})}),w&&W.jsx(Tc,{size:"md",contentProps:{style:{width:f?"100%":"600px",height:f?"":"750px"}},onClose:()=>T(!1),children:W.jsx(nUe,{onQrUri:Te=>{Te&&Ee(),T(!1)}})}),o&&W.jsx(Tc,{isDismissible:!1,size:"md",contentProps:{style:{width:f?"100%":"800px",maxHeight:"100%",overflowY:"auto"}},children:W.jsx(MFe,{onClose:Te=>{var De;n.isSigningTxn.set(!1),Te?n.selectedExternalProvider.get()===void 0?(ee(),n.signClientWarningType.set("noProvider")):((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"?(ee(),n.signClientWarningType.set("isWalletConnect")):N(Te):ee()}})}),a&&W.jsx(Tc,{isDismissible:!1,size:"md",contentProps:{style:{width:f?"100%":"800px",maxHeight:"90%",overflowY:"auto"}},children:W.jsx(kFe,{onClose:Te=>{var De;n.isSigningMsg.set(!1),Te?n.selectedExternalProvider.get()===void 0?(ee(),n.signClientWarningType.set("noProvider")):((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"?(ee(),n.signClientWarningType.set("isWalletConnect")):te(Te):ee()}})}),k&&W.jsx(Tc,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(RFe,{warningType:k})}),R&&W.jsx(Tc,{size:"md",onClose:()=>B(!1),children:W.jsx(xFe,{tokenBalance:L,onClose:(Te,De)=>{B(!1),Te&&De&&G(Te,De)}})}),E&&W.jsx(Tc,{size:"md",onClose:()=>x(!1),children:W.jsx(wFe,{collectibleInfo:z,onClose:(Te,De)=>{x(!1),(Te&&(z==null?void 0:z.collectibleInfoParams.contractType)==="ERC721"||Te&&De)&&G(Te,De)}})})]})}const sUe=()=>{const t=Ir(li),e=yn(t.accountAddress);return W.jsx(M2e,{basename:"/wallet-recovery-app",children:W.jsxs(A2e,{children:[W.jsx(i3,{path:"/",element:e?W.jsx(JA,{replace:!0,to:"/wallet"}):W.jsx(_9e,{})}),W.jsx(i3,{path:"recovery",element:e?W.jsx(JA,{replace:!0,to:"/wallet"}):W.jsx(P9e,{})}),W.jsx(i3,{path:"wallet",element:e?W.jsx(iUe,{}):W.jsx(JA,{replace:!0,to:"/"})})]})})},oUe=Nxe();L7.createRoot(document.getElementById("root")).render(W.jsx(qt.StrictMode,{children:W.jsx(Bxe,{store:oUe,children:W.jsx(Rme,{theme:"dark",children:W.jsx(Vwe,{children:W.jsx(sUe,{})})})})}));export{R9e as _}; + */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(x){return Object.prototype.toString.call(x)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",f=l?setImmediate:setTimeout,u=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(E){var x=Object.getOwnPropertyNames(E);return x.push.apply(x,Object.getOwnPropertySymbols(E)),x}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(E){E&&(this._conf=E,E.delimiter&&(this.delimiter=E.delimiter),E.maxListeners!==r&&(this._maxListeners=E.maxListeners),E.wildcard&&(this.wildcard=E.wildcard),E.newListener&&(this._newListener=E.newListener),E.removeListener&&(this._removeListener=E.removeListener),E.verboseMemoryLeak&&(this.verboseMemoryLeak=E.verboseMemoryLeak),E.ignoreErrors&&(this.ignoreErrors=E.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(E,x){var w="(node) warning: possible EventEmitter memory leak detected. "+E+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+x+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=E,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(E,x,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[E];case 2:return[E,x];case 3:return[E,x,w];default:for(var k=new Array(T);T--;)k[T]=arguments[T];return k}};function I(E,x){for(var w={},T,k=E.length,H=0,oe=0;oe0;)E=H[X],oe.call(j,E,w[E]);this._listeners={},this._listenersCount=0,G()}}});function S(E,x,w,T){var k=Object.assign({},x);if(!E)return k;if(typeof E!="object")throw TypeError("options must be an object");var H=Object.keys(E),oe=H.length,j,X,G;function Z(N){throw Error('Invalid "'+j+'" option value'+(N?". Reason: "+N:""))}for(var ee=0;ee0;)if(j===E[X])return H;oe(x)}}var F=L(["function"]),z=L(["object","function"]);function _(E,x,w){var T,k,H=0,oe,j=new E(function(X,G,Z){w=S(w,{timeout:0,overload:!1},{timeout:function(fe,Ee){return fe*=1,(typeof fe!="number"||fe<0||!Number.isFinite(fe))&&Ee("timeout must be a positive number"),fe}}),T=!w.overload&&typeof E.prototype.cancel=="function"&&typeof Z=="function";function ee(){k&&(k=null),H&&(clearTimeout(H),H=0)}var N=function(fe){ee(),X(fe)},te=function(fe){ee(),G(fe)};T?x(N,te,Z):(k=[function(fe){te(fe||Error("canceled"))}],x(N,te,function(fe){if(oe)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof fe!="function")throw TypeError("onCancel callback must be a function");k.push(fe)}),oe=!0),w.timeout>0&&(H=setTimeout(function(){var fe=Error("timeout");fe.code="ETIMEDOUT",H=0,j.cancel(fe),G(fe)},w.timeout))});return T||(j.cancel=function(X){if(k){for(var G=k.length,Z=1;Z0;)te=ze[j],te!=="_listeners"&&(Xe=ie(E,x,w[te],T+1,k),Xe&&(N?N.push.apply(N,Xe):N=Xe));return N}else if(Te==="**"){for(Re=T+1===k||T+2===k&&De==="*",Re&&w._listeners&&(N=ie(E,x,w,k,k)),ze=u(w),j=ze.length;j-- >0;)te=ze[j],te!=="_listeners"&&(te==="*"||te==="**"?(w[te]._listeners&&!Re&&(Xe=ie(E,x,w[te],k,k),Xe&&(N?N.push.apply(N,Xe):N=Xe)),Xe=ie(E,x,w[te],T,k)):te===De?Xe=ie(E,x,w[te],T+2,k):Xe=ie(E,x,w[te],T,k),Xe&&(N?N.push.apply(N,Xe):N=Xe));return N}else w[Te]&&(N=ie(E,x,w[Te],T+1,k));if(fe=w["*"],fe&&ie(E,x,fe,T+1,k),Ee=w["**"],Ee)if(T0;)te=ze[j],te!=="_listeners"&&(te===De?ie(E,x,Ee[te],T+2,k):te===Te?ie(E,x,Ee[te],T+1,k):(_e={},_e[te]=Ee[te],ie(E,x,{"**":_e},T+1,k)));else Ee._listeners?ie(E,x,Ee,k,k):Ee["*"]&&Ee["*"]._listeners&&ie(E,x,Ee["*"],k,k);return N}function ce(E,x,w){var T=0,k=0,H,oe=this.delimiter,j=oe.length,X;if(typeof E=="string")if((H=E.indexOf(oe))!==-1){X=new Array(5);do X[T++]=E.slice(k,H),k=H+j;while((H=E.indexOf(oe,k))!==-1);X[T++]=E.slice(k)}else X=[E],T=1;else X=E,T=E.length;if(T>1){for(H=0;H+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,y.call(this,G._listeners.length,Z))):G._listeners=x,!0;return!0}function K(E,x,w,T){for(var k=u(E),H=k.length,oe,j,X,G=E._listeners,Z;H-- >0;)j=k[H],oe=E[j],j==="_listeners"?X=w:X=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&x.push(Z?X:X.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,x,X,Z);return x}function P(E){for(var x=u(E),w=x.length,T,k,H;w-- >0;)k=x[w],T=E[k],T&&(H=!0,k!=="_listeners"&&!P(T)&&delete E[k]);return H}function M(E,x,w){this.emitter=E,this.event=x,this.listener=w}M.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(E,x,w){if(w===!0)k=!0;else if(w===!1)T=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var T=w.async,k=w.promisify,H=w.nextTick,oe=w.objectify}if(T||H||k){var j=x,X=x._origin||x;if(H&&!o)throw Error("process.nextTick is not supported");k===r&&(k=x.constructor.name==="AsyncFunction"),x=function(){var G=arguments,Z=this,ee=this.event;return k?H?Promise.resolve():new Promise(function(N){f(N)}).then(function(){return Z.event=ee,j.apply(Z,G)}):(H?process.nextTick:f)(function(){Z.event=ee,j.apply(Z,G)})},x._async=!0,x._origin=X}return[x,oe?new M(this,E,x):this]}function m(E){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,E)}m.EventEmitter2=m,m.prototype.listenTo=function(E,x,w){if(typeof E!="object")throw TypeError("target musts be an object");var T=this;w=S(w,{on:r,off:r,reducers:r},{on:F,off:F,reducers:z});function k(H){if(typeof H!="object")throw TypeError("events must be an object");var oe=w.reducers,j=$.call(T,E),X;j===-1?X=new C(T,E,w):X=T._observers[j];for(var G=u(H),Z=G.length,ee,N=typeof oe=="function",te=0;te0;)k=w[T],(!E||k._target===E)&&(k.unsubscribe(x),H=!0);return H},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(E){E!==r&&(this._maxListeners=E,this._conf||(this._conf={}),this._conf.maxListeners=E)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(E,x,w){return this._once(E,x,!1,w)},m.prototype.prependOnceListener=function(E,x,w){return this._once(E,x,!0,w)},m.prototype._once=function(E,x,w,T){return this._many(E,1,x,w,T)},m.prototype.many=function(E,x,w,T){return this._many(E,x,w,!1,T)},m.prototype.prependMany=function(E,x,w,T){return this._many(E,x,w,!0,T)},m.prototype._many=function(E,x,w,T,k){var H=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--x===0&&H.off(E,oe),w.apply(this,arguments)}return oe._origin=w,this._on(E,oe,T,k)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var E=arguments[0],x,w=this.wildcard,T,k,H,oe,j;if(E==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(x=E,E!=="newListener"&&E!=="removeListener"&&typeof E=="object")){if(k=E.length,a){for(H=0;H3)for(T=new Array(X-1),oe=1;oe3)for(k=new Array(G-1),j=1;j0&&this._events[E].length>this._maxListeners&&(this._events[E].warned=!0,y.call(this,this._events[E].length,E))):this._events[E]=x,k)},m.prototype.off=function(E,x){if(typeof x!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var k=typeof E=="string"?E.split(this.delimiter):E.slice();if(T=ie.call(this,null,k,this.listenerTree,0),!T)return this}else{if(!this._events[E])return this;w=this._events[E],T.push({_listeners:w})}for(var H=0;H0){for(T=this._all,x=0,w=T.length;x0;)T=x[w[H]],typeof T=="function"?k.push(T):k.push.apply(k,T);return k}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],X=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,j,X,oe,0),j}return x?(T=x[E],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(E){var x=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,E):x?u(x):[]},m.prototype.listenerCount=function(E){return this.listeners(E).length},m.prototype.hasListeners=function(E){if(this.wildcard){var x=[],w=typeof E=="string"?E.split(this.delimiter):E.slice();return ie.call(this,x,w,this.listenerTree,0),x.length>0}var T=this._events,k=this._all;return!!(k&&k.length||T&&(E===r?u(T).length:T[E]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(E,x){var w=this,T=typeof x;return T==="number"?x={timeout:x}:T==="function"&&(x={filter:x}),x=S(x,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:O}),_(x.Promise,function(k,H,oe){function j(){var X=x.filter;if(!(X&&!X.apply(w,arguments)))if(w.off(E,j),x.handleError){var G=arguments[0];G?H(G):k(b.apply(null,arguments).slice(1))}else k(b.apply(null,arguments))}oe(function(){w.off(E,j)}),w._on(E,j,!1)},{timeout:x.timeout,overload:x.overload})};function R(E,x,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:O});var T=w.Promise;return _(T,function(k,H,oe){var j;if(typeof E.addEventListener=="function"){j=function(){k(b.apply(null,arguments))},oe(function(){E.removeEventListener(x,j)}),E.addEventListener(x,j,{once:!0});return}var X=function(){G&&E.removeListener("error",G),k(b.apply(null,arguments))},G;x!=="error"&&(G=function(Z){E.removeListener(x,X),H(Z)},E.once("error",G)),oe(function(){G&&E.removeListener("error",G),E.removeListener(x,X)}),E.once(x,X)},{timeout:w.timeout,overload:w.overload})}var B=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return B._maxListeners},set:function(E){if(typeof E!="number"||E<0||Number.isNaN(E))throw TypeError("n must be a non-negative number");B._maxListeners=E},enumerable:!0},once:{value:R,writable:!0,configurable:!0}}),Object.defineProperties(B,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Tte);var kLe=Tte.exports,xI=function(){return xI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),OLe=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},DLe=function(t,e,r){return E0(void 0,void 0,void 0,function(){var n,i;return C0(this,function(s){return n=r.messageDigest(),i=A4e(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},NLe=function(t,e,r){return E0(void 0,void 0,void 0,function(){var n,i,s,o,a;return C0(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Nn(r.address,s,t),[4,o.isValidSignature(n,Ue(r.signature))];case 2:return a=c.sent(),a===BLe?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},BLe="0x1626ba7e",LLe=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),E0(n,void 0,void 0,function(){var o,a,c,l,f,u,p,g,y,b;return C0(this,function(I){switch(I.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],f=o[3],u=o[4],a!==EI)throw new Error("ethauth: not an ethauth proof");return p=TF.decode(l),g=JSON.parse(p),y=new kte({address:c,claims:g,signature:f,extra:u}),[4,this.validateProof(y,s)];case 1:if(b=I.sent(),!b)throw new Error("ethauth: proof is invalid");return[2,y]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),E0(n,void 0,void 0,function(){var o,a;return C0(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return E0(n,void 0,void 0,function(){var s,c,o,a,c;return C0(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(c{const n=Jt(await t.getAddress());if(!n||n===""||n==="0x")throw ULe;const i=new kte;if(i.address=n,!r||!r.app||r.app==="")throw new Mte("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):FLe);const s=i.messageTypedData(),o=c9e(e);i.signature=await(t instanceof _x?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new LLe().encodeProof(i,!0);return{typedData:s,proofString:c}};class Mte extends Error{constructor(e){super(e),this.name="AuthError"}}const ULe=new Mte("auth error: account address is empty");yt.context.defaultContexts,new iX.remote.RemoteConfigTracker("https://sessions.sequence.app");const $Le=new Map(["addHook(bytes4,address)","clearExtraImageHashes(bytes32[])","removeHook(bytes4)","setExtraImageHash(bytes32,uint256)","updateIPFSRoot(bytes32)","updateImageHash(bytes32)","updateImageHashAndIPFS(bytes32,bytes32)","updateImplementation(address)"].map(t=>[Do(t).slice(0,10),t]));function CI(t,e){const r=yt.transaction.fromTransactionish(t,e);yt.transaction.unwind(t,r).forEach(i=>qLe(t,i))}function qLe(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=Ue(e.data);if(r.length>=4&&!VLe(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden");if(e.data){const n=Me(e.data).slice(0,10),i=$Le.get(n);if(i){const s=i.slice(0,i.indexOf("("));throw new Error(`${s} calls are forbidden`)}}}function VLe(t){const e=new Fi(Ms.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}function Nc(){return Nc=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.predicate(t))}const WLe=[{name:"Decentraland Exception",predicate:YLe},{name:"0x v3 Exception",predicate:QLe}],KLe=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function YLe(t){try{const e=Ip(t);return KLe.test(e)}catch{return!1}}function QLe(t){const e=new Fi(JLe);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const JLe=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],O3=Ai(`Ethereum Signed Message: +`),ZLe=t=>yu(t)?Ue(t):Ai(t),Rte=t=>{const e=ZLe(t);return GLe(e)?e:Ue(Vr([O3,Ai(String(e.length)),e]))},XLe=t=>{if(JSON.stringify(t.slice(0,O3.length))!==JSON.stringify(O3))return t;const e=t.slice(O3.length),r=String(e.length).length;let n,i;try{i=Number(Ip(e.slice(0,r)))}catch{i=Number(Me(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},A$=async(t,e,r,n)=>new yt.reader.OnChainReader(n).isValidSignature(t,e,r);async function eFe(t){return Array.isArray(t)?Promise.all(t.map(e=>ui(e))):ui(t)}function tFe(t){return[t,...t.auxiliary||[]]}const rFe=1e4;class nFe{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new kLe.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=rFe){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ge.MAINNET,s=a9e(i).chainId,o={connected:!0,chainId:Fc(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await jLe(this.account,s,a)}catch(c){return wi.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}async sendMessageRequest(e){var r;const i=Number(((r=e.clientVersion)==null?void 0:r.split(".")[0])||"0")<2,s={id:e.data.id,jsonrpc:"2.0",result:null,error:void 0};try{const o=await this.request({method:e.data.method,params:e.data.params,chainId:e.chainId});return Nc({},e,{data:i?Nc({},s,{result:o}):o})}catch(o){return Nc({},e,{data:i?Nc({},s,{error:o}):{error:o}})}}async request(e){await this.getAccount();try{var r,n;if((!this.account||this.account===null)&&!iFe.includes(e.method))throw HLe;const l=this.account;if(!l)throw new Error("WalletRequestHandler: wallet account is not configured");const f=(r=this.account)==null?void 0:r.providerFor((n=e.chainId)!=null?n:this.defaultChainId());if(!f)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${e.chainId}`);const u=sFe(f)?f:void 0;switch(e.method){case"net_version":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("net_version",[])}case"eth_chainId":{if(!u)throw new Error("Account provider doesn't support send method");return await u.send("eth_chainId",[])}case"eth_accounts":return[l.address];case"eth_getBalance":{const[p,g]=e.params,y=await f.getBalance(p,g);return Bv(y)}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(e.method){case"sequence_sign":case"personal_sign":{const[I,C]=e.params;p=I;break}case"eth_sign":{const[I,C]=e.params;p=C;break}}let g="";const y=Rte(p),b=e.method==="sequence_sign";if(this.prompter===null){var i;g=await l.signMessage(y,(i=e.chainId)!=null?i:this.defaultChainId(),b?"eip6492":"ignore")}else g=await this.prompter.promptSignMessage({chainId:e.chainId,message:Ue(y),eip6492:b},this.connectOptions);if(g&&g.length>0)return g;throw new Error("declined by user")}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,g]=e.params;let y;if(typeof g=="string")try{y=JSON.parse(g)}catch(C){console.warn("walletRequestHandler: error parsing typedData",C)}else y=g;if(!y||!y.domain||!y.types||!y.message)throw new Error("invalid typedData object");let b="";const I=e.method==="sequence_signTypedData_v4";if(this.prompter===null){var s;b=await l.signTypedData(y.domain,y.types,y.message,(s=e.chainId)!=null?s:this.defaultChainId(),I?"eip6492":"ignore")}else b=await this.prompter.promptSignMessage({chainId:e.chainId,typedData:y,eip6492:I},this.connectOptions);if(b&&b.length>0)return b;throw new Error("declined by user")}case"eth_sendTransaction":{const p=tFe(e.params[0]).map(y=>("gas"in y&&y.gasLimit===void 0&&(y.gasLimit=y.gas,delete y.gas),y));CI(l.address,p);let g="";if(this.prompter===null){var o,a;const y=await l.sendTransaction(p,(o=e.chainId)!=null?o:this.defaultChainId());g=(a=y==null?void 0:y.hash)!=null?a:""}else g=await this.prompter.promptSendTransaction(p,e.chainId,this.connectOptions);if(g)return g;throw new Error("declined by user")}case"eth_signTransaction":{const[p]=e.params;if(Jt(p.from)!==l.address)throw new Error("sender address does not match wallet");if(CI(l.address,p),this.prompter===null){var c;return await l.signTransactions(p,(c=e.chainId)!=null?c:this.defaultChainId())}else return await this.prompter.promptSignTransaction(p,e.chainId,this.connectOptions)}case"eth_sendRawTransaction":if(yt.transaction.isSignedTransactionBundle(e.params[0])){const p=Number(e.params[0].chainId);return(await l.relayer(p).relay(e.params[0])).hash}else return(await f.broadcastTransaction(e.params[0])).hash;case"eth_getTransactionCount":{const p=Jt(e.params[0]),g=e.params[1],y=await f.getTransactionCount(p,g);return Bv(BigInt(y))}case"eth_blockNumber":return await f.getBlockNumber();case"eth_getBlockByNumber":return await f.getBlock(e.params[0]);case"eth_getBlockByHash":return await f.getBlock(e.params[0]);case"eth_getTransactionByHash":return await f.getTransaction(e.params[0]);case"eth_call":{const[p,g]=e.params;return await f.call(Nc({},p,{blockTag:g}))}case"eth_getCode":{const[p,g]=e.params;return await f.getCode(p,g)}case"eth_estimateGas":{const[p]=e.params;return await f.estimateGas(p)}case"eth_gasPrice":{const p=await f.getFeeData();return p.gasPrice===null?null:Bv(p.gasPrice)}case"wallet_switchEthereumChain":{const[p]=e.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const g=BigInt(p.chainId);return this.setDefaultChainId(Number(g)),null}case"sequence_getWalletContext":return l.contexts;case"sequence_getWalletConfig":{const[p]=e.params;return p?[(await l.status(p)).onChain.config]:await Promise.all(l.networks.map(async function(g){return(await l.status(g.chainId)).onChain.config}))}case"sequence_getWalletState":{const[p]=e.params;return p?[S$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return S$(g.chainId,y)}))}case"sequence_getNetworks":return await this.getNetworks(!0);case"sequence_isSequence":return!0;case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=e.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");return this.setDefaultChainId(p),await this.getNetworks(!0)}default:{if(!u)throw new Error("Account provider doesn't support send method");return await u.send(e.method,e.params)}}}catch(l){throw wi.error(l),{message:typeof l=="string"?l:(l==null?void 0:l.message)||"unkown error",code:4001}}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Nc({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(wi.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Nc({},i,{provider:void 0,relayer:void 0}))};if(e){const i=_w(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Fc(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Fc(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){wi.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(wi.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function S$(t,e){return{context:e.original.context,config:e.onChain.config,address:yt.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const iFe=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];function sFe(t){return t&&typeof t=="object"&&typeof t.send=="function"&&typeof t.getNetwork=="function"}function oFe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}class PE{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!HM.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new PE(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new Ote(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await eFe(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await new Promise(c=>{(async function f(){const u=await o.getTransaction(s);if(u!==null)return c(u);await o.once("block",f)})()})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r){return this.getProvider(r==null?void 0:r.chainId).call(e)}getChainId(){return Promise.resolve(this.client.getChainId())}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}getNonce(e){throw new Error("SequenceSigner does not support getNonce")}populateCall(e){throw new Error("SequenceSigner does not support populateCall")}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class Ote extends PE{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class aFe{constructor(e){if(this.signer=e,Ote.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return A$(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Rte(r),a=OEe(o);return A$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Mk(r),n,i)}}const cFe=["method"],_$=["connect","disconnect","chainChanged","accountsChanged"];class HM extends hJ{constructor(e,r,n=lM,i){super(e.getChainId(),i),this.client=e,this.providerFor=r,this.networks=n,this.options=i,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,this.eip1193EventListeners=new Map,e.onConnect(s=>{var o;(o=this.eip1193EventListeners.get("connect"))==null||o.forEach(a=>a(s))}),e.onDisconnect(s=>{var o;(o=this.eip1193EventListeners.get("disconnect"))==null||o.forEach(a=>a(s))}),e.onDefaultChainIdChanged(s=>{var o;(o=this.eip1193EventListeners.get("chainChanged"))==null||o.forEach(a=>a(s))}),e.onAccountsChanged(s=>{var o;(o=this.eip1193EventListeners.get("accountsChanged"))==null||o.forEach(a=>a(s))}),this.signer=new PE(this.client,this),this.utils=new aFe(this.signer)}async on(e,r){if(_$.includes(e)){const n=this.eip1193EventListeners.get(e)||new Set;return n.add(r),this.eip1193EventListeners.set(e,n),this}return super.on(e,r)}async off(e,r){if(_$.includes(e)){const n=this.eip1193EventListeners.get(e);return n&&(r?n.delete(r):n.clear()),this}return super.off(e,r)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Nc({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=_w(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new lFe(this.client,this.providerFor,r,this.options)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async _perform(e){var r;const{method:n}=e,i=oFe(e,cFe),s=await this._getSubprovider(),o=(r=s.getRpcRequest(e))!=null?r:{method:n,args:Object.values(i)};if(!o)throw new Error(`Unsupported method ${e.method}`);return s.send(o.method,o.args)}async perform(e,r){if(e==="eth_chainId")return Fc(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const n=r[0],i=Dte(n);return this.setDefaultChainId(i)}return e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4"?this.client.request({method:e,params:r,chainId:this.getChainId()}):this._perform(Nc({method:e},r))}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async _detectNetwork(){const e=this.client.getChainId(),r=_w(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return new ia(r.name,r.chainId)}async detectNetwork(){return this._detectNetwork()}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getFeeData(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getFeeData()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorage(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorage(e,r,n)}async call(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).call(e)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBlock(e,r)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return pw(e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}HM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function Dte(t){return typeof t=="object"?Dte(t.chainId):Number(t)}class lFe extends HM{constructor(e,r,n,i){super(e,r,void 0,i),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=_w(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return new ia(r.name,r.chainId)}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class Xr{constructor(e){de(this,"networkStore",Pr(Bn));de(this,"authStore",Pr(ai));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"availableExternalProviders",Nr([]));de(this,"selectedExternalProvider",Nr(void 0));de(this,"selectedExternalWalletAddress",Nr(void 0));de(this,"isSendingTokenTransaction",Nr(void 0));de(this,"isSendingCollectibleTransaction",Nr(void 0));de(this,"isSendingSignedTokenTransaction",Nr(void 0));de(this,"connectDetails",Nr(void 0));de(this,"connectOptions",Nr(void 0));de(this,"isSigningTxn",Nr(!1));de(this,"isSigningMsg",Nr(!1));de(this,"toSignPermission",Nr(void 0));de(this,"toSignResult",Nr(void 0));de(this,"toSignTxnDetails",Nr(void 0));de(this,"toSignMsgDetails",Nr(void 0));de(this,"isCheckingWalletDeployment",Nr(!1));de(this,"signClientWarningType",Nr(!1));de(this,"walletRequestHandler");de(this,"local",{lastConnectedExternalProviderInfo:new Np(fh.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});de(this,"defaultNetwork",new Np(fh.DEFAULT_NETWORK));de(this,"getLastConnectedExternalProviderInfo",()=>this.local.lastConnectedExternalProviderInfo.get());de(this,"sendToken",async(e,r,n)=>{var i,s;try{const o=this.store.get(ai).account,a=e.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Bn).providerForChainId(a);this.isSendingTokenTransaction.set({tokenBalance:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(!n)return{hash:""};if(e.contractType===uh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:E6e(n)}):e.contractType===uh.ERC20&&(console.info("Sending ERC20 token with address, on chainId: ",e.contractAddress,a),p=await new Nn(e.contractAddress,Uv,c).transfer.populateTransaction(r,z7(n,((s=e.contractInfo)==null?void 0:s.decimals)??18))),!p)throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingTokenTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingTokenTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"sendCollectible",async(e,r,n)=>{var i,s;try{const o=this.store.get(ai).account,a=e.collectibleInfoParams.chainId;if(!o)throw new Error("No account found");const c=this.store.get(Bn).providerForChainId(a);this.isSendingCollectibleTransaction.set({collectibleInfo:e,to:r,amount:n});const l=(i=this.selectedExternalProvider.get())==null?void 0:i.provider;if(!l)throw new Error("No external provider selected");const u=(await this.getExternalProviderAccounts(l))[0];await this.switchToChain(l,a);let p;if(e.collectibleInfoParams.contractType==="ERC721")console.info("Sending ERC721 non-fungible token with address, on chainId: ",e.collectibleInfoParams.address,a),p=await new Nn(e.collectibleInfoParams.address,fM,c).safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId);else if(e.collectibleInfoParams.contractType==="ERC1155"){console.info("Sending ERC1155 token with address, on chainId: ",e.collectibleInfoParams.address,a);const y=new Nn(e.collectibleInfoParams.address,uM,c);if(!n)return{hash:""};p=await y.safeTransferFrom.populateTransaction(o,r,e.collectibleInfoParams.tokenId,z7(n,((s=e==null?void 0:e.collectibleInfoResponse)==null?void 0:s.decimals)??18),"0x")}if(!p)throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction");let g;try{g=(await this.sendTransaction(o,l,u,p,a)).hash}catch(y){throw this.isSendingCollectibleTransaction.set(void 0),y}return{hash:g}}catch{throw this.isSendingCollectibleTransaction.set(void 0),new Error("Could not create transaction")}});de(this,"setExternalProvider",async e=>{if(!e){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0),this.local.lastConnectedExternalProviderInfo.set(void 0);return}const n=(await this.getExternalProviderAccounts(e.provider))[0];this.local.lastConnectedExternalProviderInfo.set(e.info),this.selectedExternalProvider.set(e),this.selectedExternalWalletAddress.set(n),e.provider.on("accountsChanged",async i=>{if(i.length===0){this.selectedExternalProvider.set(void 0),this.selectedExternalWalletAddress.set(void 0);return}if(i[0]!==n){const o=(await this.getExternalProviderAccounts(e.provider))[0];this.selectedExternalWalletAddress.set(o)}})});de(this,"resetSignObservables",()=>{this.isSigningTxn.set(!1),this.toSignTxnDetails.set(void 0),this.toSignMsgDetails.set(void 0),this.toSignPermission.set(void 0),this.toSignResult.set(void 0)});de(this,"checkWalletDeployment",async e=>{const r=this.store.get(ai).account;if(!r)throw new Error("No account found");return(await r.status(e)).onChain.deployed});this.store=e,this.walletRequestHandler=new nFe(void 0,new fFe(e),this.networkStore.networks.get()),this.walletRequestHandler.onConnectOptionsChange=n=>{this.connectOptions.set(n)},this.availableExternalProviders.subscribe(n=>{const i=this.local.lastConnectedExternalProviderInfo.get(),s=n.find(o=>(i==null?void 0:i.name)===o.info.name);s&&this.setExternalProvider(s)});const r=this.store.get(ai).account;this.walletRequestHandler.signIn(r??null)}async sendTransaction(e,r,n,i,s){const o=await e.status(s),a=await e.predecorateTransactions(i,o,s),c=await e.signTransactions(a,s,void 0,{serial:!0}),l=await e.decorateTransactions(c,o);await this.switchToChain(r,s);const f=await r.request({method:"eth_estimateGas",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l)}]});return{hash:await r.request({method:"eth_sendTransaction",params:[{from:n,to:l.entrypoint,data:yt.transaction.encodeBundleExecData(l),gas:f}]})}}async getExternalProviderAccounts(e){return new Promise((r,n)=>{var i;(i=e.sendAsync)==null||i.call(e,{method:"eth_requestAccounts",params:[]},(s,o)=>{s&&n(s),o.result.length===0&&n(new Error("No accounts found")),r(o.result)})})}async getExternalProviderAddress(e){return(await this.getExternalProviderAccounts(e))[0]}async switchToChain(e,r){return new Promise((n,i)=>{var s;(s=e.sendAsync)==null||s.call(e,{method:"wallet_switchEthereumChain",params:[{chainId:Fc(r)}]},(o,a)=>{o&&i(o),n(a)})})}}class fFe{constructor(e){this.store=e}getDefaultChainId(){return this.store.get(Xr).defaultNetwork.get()??1}async promptChangeNetwork(e){return this.store.get(Bn).networks.get().some(n=>n.chainId===e)?(this.store.get(Xr).defaultNetwork.set(e),!0):!1}async promptConfirmWalletDeploy(e,r){if(console.log("prompt confirm wallet deploy:",e,r),!e)return Promise.resolve(!1);const n=await this.store.get(Xr).checkWalletDeployment(e);return new Promise((i,s)=>{i(!!n)})}async promptConnect(e){console.log("promptconnect",e);const r=this.store.get(ai).account;return await this.store.get(Xr).walletRequestHandler.signIn(r??null),e&&this.store.get(Xr).walletRequestHandler.setConnectOptions(e),new Promise((n,i)=>{const s=this.store.get(Xr).connectDetails.subscribe(o=>{s(),!o||!o.connected?i("connect cancelled by user"):n(o)})})}async promptSignInConnect(e){return console.log("prompt sign in connect:",e),{connected:!1}}async promptSignMessage(e,r){return console.log("prompt sign message:",e,r),e.chainId?e.eip6492!==!0&&!(await this.store.get(ai).account.status(e.chainId)).canOnchainValidate&&!await this.promptConfirmWalletDeploy(e.chainId,r)?(this.store.get(Xr).signClientWarningType.set("notDeployed"),Promise.reject("User rejected wallet deploy request")):(this.store.get(Xr).isSigningMsg.set(!0),this.store.get(Xr).toSignMsgDetails.set({message:e,chainId:e.chainId,options:r}),new Promise((n,i)=>{const s=this.store.get(Xr).toSignPermission.subscribe(()=>{s();const o=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!o||o==="cancelled")i("request failed");else{const a=this.store.get(Xr).toSignResult.get();a&&n(a.hash)}})})):Promise.reject("No chainId found in message")}promptSignTransaction(e,r,n){console.log("prompt sign transaction:",e,r,n);let i;Array.isArray(e)?i=e:i=[e];const s=this.store.get(ai).accountAddress.get();if(!s)throw new Error("Unknown account address");const o=yt.transaction.fromTransactionish(s,i);return console.log("prompt sign txn:",o,r,n),CI(s,i),new Promise((a,c)=>{this.store.get(Xr).toSignTxnDetails.set({txn:i,chainId:r,options:n}),this.store.get(Xr).isSigningTxn.set(!0);const l=this.store.get(Xr).toSignPermission.subscribe(()=>{l();const f=this.store.get(Xr).toSignPermission.get();if(this.store.get(Xr).toSignPermission.set(void 0),!f||f==="cancelled")c("request failed");else{const u=this.store.get(Xr).toSignResult.get();u&&a(u.hash)}})})}promptSendTransaction(e,r,n){return this.promptSignTransaction(e,r,n)}}async function Nte(t){return await PLe.init({projectId:oX,showQrModal:t,optionalChains:[1],metadata:{name:"Sequence Recovery Wallet External Wallet",description:"",url:"TODO_CHANGE_LATER",icons:[]}})}function uFe(){const[t,e]=D.useState(null),n=Pr(Xr).getLastConnectedExternalProviderInfo();return D.useEffect(()=>{async function i(){const s=await Nte(!1);await s.enable(),e(s)}return(n==null?void 0:n.name)==="WalletConnect"&&i(),()=>{t&&t.disconnect()}},[]),t}const I$=async(t,e,r=15)=>{let n,i=0;do{if(i>5&&await new Promise(s=>setTimeout(s,100*i)),n=await t.getTransactionReceipt(e),i===r){console.warn(`Could not get receipt for transaction ${e} after ${i} tries`);return}if(n)return n;i++}while(!n&&i<=r)};let R6=[];const sS={value:()=>R6,subscribe:t=>{function e(r){R6.some(n=>n.info.uuid===r.detail.info.uuid)||(R6=[...R6,r.detail],t())}return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new Event("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}},Bte=()=>D.useSyncExternalStore(sS.subscribe,sS.value,sS.value);class kE{constructor(e){de(this,"authStore",Pr(ai));de(this,"accountAddress",this.authStore.accountAddress.get());de(this,"isReady",Nr(!1));de(this,"signClient");de(this,"currentRequestInfo");de(this,"allSessions",Nr([]));de(this,"sessions",this.allSessions.readOnly());de(this,"createSignClient",async()=>{this.signClient=await TE.init({projectId:oX,metadata:{name:"Sequence Recovery Wallet",description:"Sequence Recovery Wallet - Recover Your Wallet",url:"http://localhost:5173",icons:["https://sequence.app/apple-touch-icon.png"]}}),this.signClient.on("session_proposal",this.onSessionProposal),this.signClient.on("session_request",this.onSessionRequest),this.signClient.on("session_ping",this.onSessionPing),this.signClient.on("session_event",this.onSessionEvent),this.signClient.on("session_update",this.onSessionUpdate),this.signClient.on("session_delete",this.onSessionDelete);const e=this.getSignClientSessions();e?this.allSessions.set(e):this.allSessions.set([]),this.isReady.set(!0)});de(this,"getSignClientSessions",()=>this.signClient.session.getAll().filter(r=>r.self.metadata.name!=="Sequence Recovery Wallet External Wallet"));de(this,"pair",async e=>{if(!this.signClient)throw new Error("WalletConnect signClient not initialized.");await this.signClient.core.pairing.pair({uri:e}),this.allSessions.set(this.getSignClientSessions())});de(this,"rejectRequest",()=>{var e;this.currentRequestInfo&&((e=this.signClient)==null||e.respond({topic:this.currentRequestInfo.topic,response:{id:this.currentRequestInfo.id,jsonrpc:"2.0",error:{message:"User rejected.",code:4001}}}))});de(this,"disconnectSession",async e=>{var n,i;const r=(n=this.signClient)==null?void 0:n.session.get(e);r&&(await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:r.topic,reason:{message:"User disconnected.",code:6e3}})),this.allSessions.set(this.getSignClientSessions()??[]))});de(this,"disconnectAllSessions",async()=>{var r;(((r=this.signClient)==null?void 0:r.session.getAll())??[]).forEach(async n=>{var i;await((i=this.signClient)==null?void 0:i.engine.client.disconnect({topic:n.topic,reason:{message:"User disconnected.",code:6e3}}))}),this.allSessions.set([])});de(this,"onSessionProposal",async e=>{var l,f,u,p,g;console.log("onSessionProposal",e);const r=e.params.requiredNamespaces,n=e.params.optionalNamespaces,i=Object.keys(r).length===0?[]:r.eip155.chains??[],s=Object.keys(n).length===0?[]:n.eip155.chains??[],o=((l=i[0])==null?void 0:l.split(":").pop())??((f=s[0])==null?void 0:f.split(":").pop());if(!o)throw new Error("No chainId found in WalletConnect session proposal namespaces.");const a={app:e.params.proposer.metadata.name,origin:e.params.proposer.metadata.url,networkId:o,keepWalletOpened:!0},c=await this.store.get(Xr).walletRequestHandler.promptConnect(a);if(c&&c.connected){const b=this.store.get(Bn).networks.get(),I=i.map(_=>Number(_.split(":").pop())),C=s.map(_=>Number(_.split(":").pop())),L={eip155:{accounts:b.map(_=>_.chainId).filter(_=>[...I,...C].includes(_)).map(_=>"eip155:"+_+":"+this.accountAddress),methods:["eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v4","wallet_switchEthereumChain"],events:["chainChanged","accountsChanged","connect","disconnect"]}},F=await((u=this.signClient)==null?void 0:u.approve({id:e.id,namespaces:L})),z=await(F==null?void 0:F.acknowledged());console.log("session",z),this.allSessions.set(this.getSignClientSessions()??[]),(p=this.signClient)==null||p.core.pairing.getPairings().filter(_=>e.params.pairingTopic!==_.topic).forEach(async _=>{var $,ie;e.params.proposer.metadata.url===(($=_.peerMetadata)==null?void 0:$.url)&&await((ie=this.signClient)==null?void 0:ie.core.pairing.disconnect({topic:_.topic}))})}else(g=this.signClient)==null||g.reject({id:e.id,reason:{message:"User rejected.",code:5e3}})});de(this,"onSessionRequest",async e=>{var o,a,c;console.log("onSessionRequest",e);const r=e.params.chainId.split(":").pop(),n={jsonrpc:"2.0",id:e.id,method:e.params.request.method,params:e.params.request.params,chainId:Number(r)};n.method==="eth_sendTransaction"&&Array.isArray(n.params)&&n.params.forEach(l=>{delete l.nonce});const i=(o=this.signClient)==null?void 0:o.session.get(e.topic),s={app:(i==null?void 0:i.peer.metadata.name)??"",origin:i==null?void 0:i.peer.metadata.url,networkId:r};this.store.get(Xr).walletRequestHandler.setConnectOptions(s),this.currentRequestInfo={topic:e.topic,id:e.id};try{const l=await this.store.get(Xr).walletRequestHandler.request(n);(a=this.signClient)==null||a.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",result:l}})}catch(l){(c=this.signClient)==null||c.respond({topic:e.topic,response:{id:e.id,jsonrpc:"2.0",error:{message:l.message,code:l.code??4001}}})}this.currentRequestInfo=void 0});de(this,"onSessionPing",async e=>{console.log("onSessionPing",e)});de(this,"onSessionEvent",async e=>{console.log("onSessionEvent",e)});de(this,"onSessionUpdate",async e=>{console.log("onSessionUpdate",e)});de(this,"onSessionDelete",async e=>{console.log("onSessionDelete",e),this.allSessions.set(this.getSignClientSessions()??[])});this.store=e,this.createSignClient()}}const T$=["https://dweb.link/ipfs/","https://gateway.pinata.cloud/ipfs/","https://nftstorage.link/ipfs/","https://flk-ipfs.io/ipfs/","https://storry.tv/ipfs/","https://ipfs.io/ipfs/","https://hardbin.com/ipfs/","https://ipfs.runfission.com/ipfs/","https://ipfs.eth.aragon.network/ipfs/","https://4everland.io/ipfs/","https://w3s.link/ipfs/","https://trustless-gateway.link/ipfs/"],dFe="QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1";class hFe{constructor(){de(this,"gatewayURL");de(this,"localStore");this.localStore=new Np(fh.GATEWAY_ADDRESS),this.gatewayURL=this.localStore.get(),this.findAccessibleGateway()}async findAccessibleGateway(){const e=this.localStore.get();if(e&&await this.isGatewayAccessible(e)){this.gatewayURL=e;return}for(const r of T$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=T$[0],console.warn("No accessible IPFS gateways found, falling back to default")}async isGatewayAccessible(e){try{return await fetch(`${e}${dFe}`,{signal:AbortSignal.timeout(3e3)}),!0}catch{return!1}}async fetch(e){this.gatewayURL||await this.findAccessibleGateway();const r=await this.getGatewayURL(e);return fetch(r,{signal:AbortSignal.timeout(3e3)})}async getGatewayURL(e){if(this.gatewayURL||await this.findAccessibleGateway(),!e.startsWith("ipfs://"))throw new Error("Invalid IPFS URI");return e.replace("ipfs://",this.gatewayURL)}}class GM{constructor(e){de(this,"isFetchingBalances",Nr(!1));de(this,"isFetchingCollectibleInfo",Nr(!1));de(this,"ipfsGatewayHelper",new hFe);de(this,"userCollectibles",Nr([]));de(this,"local",{userCollectibles:new Np(fh.COLLECTIBLES)});this.store=e;const r=this.store.get(Bn);uX(r.networks,n=>{const i=this.store.get(ai).accountAddress.get();i&&n.length>0&&this.loadBalances(i)})}async loadBalances(e){const r=this.local.userCollectibles.get()??[];if(r.length===0)return;this.isFetchingBalances.set(!0);const n=[],i=r.map(async s=>{const o=await this.getCollectibleInfo(s);if(!o.isOwner){this.removeCollectible({collectibleInfoParams:s,collectibleInfoResponse:o});return}n.push({collectibleInfoParams:s,collectibleInfoResponse:o})});await Promise.allSettled(i),this.userCollectibles.set(n),this.isFetchingBalances.set(!1)}async getCollectibleInfo(e){const r=this.store.get(ai).accountAddress.get();if(!r)throw new Error("No account found");const n=this.store.get(Bn).providerForChainId(e.chainId);this.isFetchingCollectibleInfo.set(!0);let i,s,o,a,c;if(e.contractType===uh.ERC721){const f=new Nn(e.address,fM,n),p=(await f.ownerOf(e.tokenId)).toLowerCase()===r.toLowerCase();if(!p)return this.isFetchingCollectibleInfo.set(!1),{isOwner:p,uri:""};i=await f.tokenURI(e.tokenId)}else if(e.contractType===uh.ERC1155){const f=new Nn(e.address,uM,n);if(a=await f.balanceOf(r,e.tokenId),!a)return this.isFetchingCollectibleInfo.set(!1),{isOwner:!1,uri:""};i=await f.uri(e.tokenId)}if(!i)throw new Error("Could not get collectible URI");i.includes("{id}")&&(i=i.replace("{id}",e.tokenId.toString()));let l;return i.startsWith("ipfs://")?l=await this.ipfsGatewayHelper.fetch(i).then(f=>f.json()):l=await fetch(i).then(f=>f.json()),l&&(c=l.decimals,s=l.image,o=l.name),s!=null&&s.startsWith("ipfs://")&&(s=await this.ipfsGatewayHelper.getGatewayURL(s)),a=a??BigInt(1),c=c??0,this.isFetchingCollectibleInfo.set(!1),{isOwner:!0,uri:i,image:s,name:o,balance:a,decimals:c}}async addCollectible(e){if(e.collectibleInfoResponse.isOwner){const r=this.local.userCollectibles.get()??[];if(r.some(n=>n.address===e.collectibleInfoParams.address&&n.tokenId===e.collectibleInfoParams.tokenId))throw new Error("Collectible already added");this.local.userCollectibles.set([...r,e.collectibleInfoParams]),this.isFetchingCollectibleInfo.set(!0),this.loadBalances(),this.isFetchingCollectibleInfo.set(!1)}}async removeCollectible(e){const n=(this.local.userCollectibles.get()??[]).filter(o=>o.address!==e.collectibleInfoParams.address||o.tokenId!==e.collectibleInfoParams.tokenId);this.local.userCollectibles.set(n);const s=this.userCollectibles.get().filter(o=>o.collectibleInfoParams.address!==e.collectibleInfoParams.address||o.collectibleInfoParams.tokenId!==e.collectibleInfoParams.tokenId);this.userCollectibles.set(s)}}function ME({chainId:t,paddingTop:e="1",paddingBottom:r="2"}){return W.jsx(xe,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(Ge,{variant:"xsmall",color:"text100",children:My(t)})})}function pFe({collectibleInfo:t,onSendClick:e,onRemoveClick:r}){return W.jsxs(qr,{width:"full",flexDirection:"column",gap:"2",padding:"4",children:[W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(Ge,{variant:"medium",color:"text80",children:t.collectibleInfoResponse.name??"Collectible"})}),W.jsx(xe,{style:{height:"200px"},children:W.jsx(r8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image??"",width:"full"})}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Ge,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(ch(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(xe,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(ME,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(xe,{children:[W.jsx(Xt,{size:"xs",label:"Send",variant:"primary",shape:"square",onClick:e}),r&&W.jsx(Xt,{marginLeft:"2",size:"xs",label:"Remove",shape:"square",onClick:r})]})]})]})}function vFe({onClose:t}){const r=Pr(Bn).networks.get(),n=r.filter(z=>z.type===Ft.MAINNET),i=Pr(GM),s=yn(i.isFetchingCollectibleInfo),o=c8(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(),[b,I]=D.useState(),[C,S]=D.useState(!1);D.useEffect(()=>{a&&l&&u&&g?i.getCollectibleInfo({chainId:a.chainId,address:l,tokenId:u,contractType:g}).then(z=>{I(z)}):I(void 0)},[a,l,u,g]);const O=n.map(z=>({label:z.title,value:z.chainId.toString()})),L=async()=>{a&&l&&b&&u&&g&&(await i.addCollectible({collectibleInfoParams:{chainId:a.chainId,address:l,tokenId:u,contractType:g},collectibleInfoResponse:b}),S(!1),o({variant:"success",title:"Collectible added"}),F(),t())},F=()=>{f(void 0),c(void 0),p(void 0),y(void 0)};return W.jsxs(qr,{flexDirection:"column",paddingY:"4",paddingX:"8",marginBottom:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:C,children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(T7,{label:"Collectible Network",labelLocation:"left",name:"collectibleNetwork",options:O,onValueChange:z=>c(r.find(_=>_.chainId===Number(z)))}),W.jsx(Wn,{width:"full",label:"Collectible Address",labelLocation:"left",name:"collectibleAddress",value:l??"",onChange:z=>{f(z.target.value)}}),W.jsx(T7,{label:"Collectible Type",labelLocation:"left",name:"collectibleType",options:[{value:"ERC721",label:"ERC721"},{value:"ERC1155",label:"ERC1155"}],onValueChange:z=>y(z)}),W.jsx(Wn,{width:"full",label:"Collectible Token ID",labelLocation:"left",name:"collectibleId",value:u??"",onKeyPress:z=>{/[0-9]/.test(z.key)||z.preventDefault()},onChange:z=>{if(z.target.value===""){p(void 0);return}p(z.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(xe,{alignItems:"center",justifyContent:"center",children:W.jsx(Ge,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{flexDirection:"column",gap:"2",children:W.jsxs(xe,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(Ge,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(Ge,{variant:"medium",color:"text100",children:Number(ch(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Xt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:C,onClick:()=>{F(),t()}}),W.jsx(Xt,{label:"Add",disabled:b===void 0||!b.isOwner||C,variant:"primary",size:"md",shape:"square",onClick:L})]})]})]})}function gFe({onSendClick:t}){const e=Pr(GM),r=yn(e.isFetchingBalances),n=yn(e.userCollectibles),i=D.useMemo(()=>n,[n]),[s,o]=D.useState(!1);return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(xe,{width:"1/3",children:W.jsx(pFe,{collectibleInfo:a,onSendClick:()=>{t(a)},onRemoveClick:()=>{e.removeCollectible(a)}})},a.collectibleInfoParams.chainId+a.collectibleInfoParams.address+a.collectibleInfoParams.tokenId)),r&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})})]}),W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",marginBottom:"4",children:[s&&W.jsx(vFe,{onClose:()=>o(!1)}),W.jsx(Xt,{label:"Import collectible",leftIcon:LH,variant:"primary",size:"md",shape:"square",onClick:()=>{o(!0)}})]})]})}function yFe({onClose:t}){const e=Pr(Bn),r=c8(),[n,i]=D.useState(),[s,o]=D.useState(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(),b=async()=>{n&&s&&a&&l&&await e.addNetwork({chainId:Number(n),name:s,title:s,type:Ft.MAINNET,rpcUrl:a,blockExplorer:{rootUrl:l},nativeToken:{name:u||"Ether",symbol:g||"ETH",decimals:18}})},I=()=>{i(void 0),o(void 0),c(void 0),f(void 0),p(void 0),y(void 0)};return W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(Wn,{width:"full",label:"Chain ID",labelLocation:"left",name:"chainId",value:n??"",onChange:C=>{i(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Network Name",labelLocation:"left",name:"networkName",value:s??"",onChange:C=>{o(C.target.value)}}),W.jsx(Wn,{width:"full",label:"RPC URL",labelLocation:"left",name:"rpcUrl",value:a??"",onChange:C=>{c(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Block explorer URL",labelLocation:"left",name:"rpcUrl",value:l??"",onChange:C=>{f(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Native Token Name",labelLocation:"left",name:"tokenName",value:u??"",onChange:C=>{p(C.target.value)}}),W.jsx(Wn,{width:"full",label:"Native Token Symbol",labelLocation:"left",name:"tokenSymbol",value:g??"",onChange:C=>{y(C.target.value)}}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Xt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{I(),t()}}),W.jsx(Xt,{label:"Add",variant:"primary",size:"md",shape:"square",onClick:async()=>{try{await b(),r({variant:"success",title:"Network added",description:`You can now use ${s} network`}),I(),t()}catch(C){r({variant:"error",title:"Could not add network",description:C.message}),console.error(C)}}})]})]})}function P$({network:t}){var f,u;const e=Pr(Bn),n=yn(e.userAdditionNetworkChainIds).includes(t.chainId);D.useEffect(()=>{var p,g;(s!==t.rpcUrl||a!==((p=t.blockExplorer)==null?void 0:p.rootUrl))&&(o(t.rpcUrl),c(((g=t.blockExplorer)==null?void 0:g.rootUrl)??""))},[t]);const i=e.editedNetworkChainIds.get().includes(t.chainId),[s,o]=D.useState(t.rpcUrl),[a,c]=D.useState(((f=t.blockExplorer)==null?void 0:f.rootUrl)??""),l=s!==t.rpcUrl||a!==((u=t.blockExplorer)==null?void 0:u.rootUrl);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{fontWeight:"bold",color:"text100",children:t.title}),W.jsx(Wn,{label:"RPC URL",labelLocation:"left",name:"rpcUrl",spellCheck:!1,disabled:n,value:s??"",onChange:p=>{o(p.target.value)}}),W.jsx(Wn,{label:"Block Explorer URL",labelLocation:"left",name:"blockExplorerUrl",spellCheck:!1,disabled:n,value:a??"",onChange:p=>{c(p.target.value)}}),n&&W.jsxs(xe,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(Ge,{variant:"small",color:"text50",children:"Added by you"}),W.jsx(Xt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>e.removeNetwork(t.chainId)})]}),(l||i)&&!n&&W.jsxs(xe,{marginTop:"4",justifyContent:"flex-end",gap:"3",children:[W.jsx(W.Fragment,{children:i&&W.jsx(Xt,{label:"Reset to default",variant:"danger",size:"md",shape:"square",onClick:()=>e.resetNetworkEdit(t.chainId)})}),W.jsx(W.Fragment,{children:l&&W.jsx(Xt,{label:"Save",variant:"primary",size:"md",shape:"square",onClick:()=>{const p=t;p.rpcUrl=s,p.blockExplorer={rootUrl:a},p.relayer=x3(s),e.editNetwork(p)}})})]}),W.jsx(Ch,{})]})}function mFe(){const t=Pr(Bn),e=yn(t.networks),r=e.filter(f=>f.type===Ft.MAINNET),n=yn(t.userAdditionNetworkChainIds),i=r.sort((f,u)=>n.includes(f.chainId)?-1:1),s=e.filter(f=>f.type===Ft.TESTNET),[o,a]=D.useState(Ft.MAINNET),[c,l]=D.useState(!1);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(xe,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(vwe,{value:o,onValueChange:f=>a(f),children:[W.jsx(xe,{marginBottom:"10",children:W.jsx(pwe,{value:o,tabs:[{label:"Networks",value:Ft.MAINNET},{label:"Test Networks",value:Ft.TESTNET}]})}),W.jsx(qB,{value:Ft.MAINNET,children:W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsxs(xe,{width:"full",flexDirection:"column",alignItems:"flex-end",marginY:"4",children:[W.jsx(Xt,{label:"Add network",variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}}),c&&W.jsx(yFe,{onClose:()=>l(!1)})]}),W.jsx(W.Fragment,{children:i.map((f,u)=>W.jsx(P$,{network:f},u))})]})}),W.jsx(qB,{value:Ft.TESTNET,children:W.jsx(xe,{flexDirection:"column",gap:"2",children:s.map((f,u)=>W.jsx(P$,{network:f},u))})})]})})]})}function oS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(xe,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(xe,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(ah,{size:"md"}),W.jsxs(xe,{flexDirection:"column",gap:"1",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(Ge,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(ME,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(Ge,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(Ge,{variant:"small",color:"text50",children:"Your external wallet will prompt you to confirm the transaction"})]})]})]})}function bFe({onSelectProvider:t}){const e=Pr(kE),r=Bte(),[n,i]=D.useState(!1),s=()=>window.confirm("All WalletConnect Dapp sessions will be disconnected. If you would like to continue, click OK and connect to WalletConnect again."),o=async()=>{try{if(!n){if(e.allSessions.get().length!==0){if(!s())throw new Error("User rejected wallet connect modal");await e.disconnectAllSessions(),t();return}i(!0);const a=await Nte(!0);await a.connect();let c=fre(a);t(c)}}catch(a){console.error(a)}};return W.jsx(W.Fragment,{children:!n&&W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{flexDirection:"column",gap:"4",padding:"8",children:[W.jsx(qr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>{o()},children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:"https://avatars.githubusercontent.com/u/37784886",alt:"Wallet Connect",style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:"Wallet Connect"})]})}),r.map(a=>W.jsx(qr,{flexDirection:"row",alignItems:"center",gap:"2",cursor:"pointer",background:{base:"buttonGlass",hover:"backgroundSecondary"},onClick:()=>t(a),children:W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:[W.jsx("img",{src:a.info.icon,alt:a.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function wFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=HP("isMobile"),n=Pr(Xr),[i,s]=D.useState(void 0),[o,a]=D.useState(void 0),[c,l]=D.useState(!1),[f,u]=D.useState(!1);if(D.useEffect(()=>{const C=n.selectedExternalWalletAddress.get();c&&C&&a(n.selectedExternalWalletAddress.get())},[c]),D.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=t.collectibleInfoParams.contractType==="ERC721",g=My(t.collectibleInfoParams.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(y=t==null?void 0:t.collectibleInfoResponse)==null?void 0:y.name," on ",g]}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Wn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:p?"1":i??"",onChange:C=>{s(C.target.value)},disabled:p,controls:W.jsx(W.Fragment,{children:t.collectibleInfoParams.contractType==="ERC1155"&&W.jsx(Xt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var C,S;s(ch((C=t==null?void 0:t.collectibleInfoResponse)==null?void 0:C.balance,((S=t==null?void 0:t.collectibleInfoResponse)==null?void 0:S.decimals)??18))}})})}),W.jsxs(Ge,{variant:"small",color:"text50",children:["Current balance:"," ",ch((b=t==null?void 0:t.collectibleInfoResponse)==null?void 0:b.balance,((I=t==null?void 0:t.collectibleInfoResponse)==null?void 0:I.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Wn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:C=>{a(C.target.value)},disabled:c}),W.jsx(JT,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:C=>l(C===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Xt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Xt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!(p&&o||!p&&o&&i),onClick:()=>{e(o,i)}})]})]})]})}function xFe({tokenBalance:t,onClose:e}){var g,y;const r=HP("isMobile"),n=Pr(Xr),[i,s]=D.useState(void 0),[o,a]=D.useState(void 0),[c,l]=D.useState(!1),[f,u]=D.useState(!1);if(D.useEffect(()=>{const b=n.selectedExternalWalletAddress.get();c&&b&&a(n.selectedExternalWalletAddress.get())},[c]),D.useEffect(()=>{u(n.selectedExternalWalletAddress.get()!==void 0)},[n.selectedExternalWalletAddress]),!t)return null;const p=My(t.chainId);return W.jsxs(xe,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:["Sending ",(g=t==null?void 0:t.contractInfo)==null?void 0:g.symbol," on ",p]}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(xe,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Wn,{label:"Amount",labelLocation:"top",name:"amount",placeholder:"Enter amount",value:i??"",onChange:b=>{s(b.target.value)},controls:W.jsx(Xt,{label:"Max",variant:"text",size:"md",shape:"square",paddingRight:"2",onClick:()=>{var b;s(ch(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(Ge,{variant:"small",color:"text50",children:["Current balance:"," ",ch(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(xe,{flexDirection:"column",gap:"3",children:[W.jsx(Wn,{label:"To",labelLocation:"top",name:"to",placeholder:"0x...",value:o??"",onChange:b=>{a(b.target.value)},disabled:c}),W.jsx(JT,{label:f?"Send to connected external wallet address":"Connect external wallet to autofill address",checked:c,onCheckedChange:b=>l(b===!0),labelLocation:"right",disabled:!f})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Xt,{label:"Cancel",variant:"text",size:"md",shape:"square",onClick:()=>{e()}}),W.jsx(Xt,{label:"Send",variant:"primary",size:"md",shape:"square",disabled:!o||!i,onClick:()=>{o&&i&&e(o,i)}})]})]})]})}function EFe({onTokenListClick:t}){const e=Pr(ai),r=XP();return W.jsxs(Kye,{children:[W.jsx(Xt,{as:Yye,label:"Settings",variant:"text"}),W.jsx(Qye,{side:"bottom",align:"end",sideOffset:20,children:W.jsxs(xe,{marginTop:"2",children:[W.jsx(qA,{onClick:t,children:W.jsx(xe,{padding:"1",children:W.jsx(Ge,{variant:"normal",fontWeight:"bold",children:"Token List"})})}),W.jsx(qA,{disabled:!0,children:W.jsx(xe,{width:"16",children:W.jsx(Ch,{color:"white"})})}),W.jsx(qA,{onClick:()=>{e.logout(),r("/")},children:W.jsx(xe,{padding:"1",children:W.jsx(Ge,{variant:"normal",fontWeight:"bold",children:"Log out"})})})]})})]})}function CFe(){const t=Pr(Ix),e=yn(t.userAddedTokens);return W.jsxs(xe,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"4",marginBottom:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Token List"}),W.jsx(Ge,{variant:"normal",color:"text50",children:"Tokens added by you can be removed here"})]}),W.jsxs(xe,{width:"full",height:"full",flexDirection:"column",marginTop:"4",paddingBottom:"12",gap:"4",children:[e.length===0&&W.jsx(xe,{height:"full",alignItems:"center",justifyContent:"center",children:W.jsx(Ge,{variant:"medium",color:"text50",marginBottom:"16",children:"You haven't added any tokens yet"})}),e.map((r,n)=>W.jsxs(qr,{width:"full",flexDirection:"row",gap:"2",alignItems:"center",children:[W.jsxs(xe,{flexDirection:"column",gap:"2",children:[W.jsx(Ge,{variant:"medium",color:"text80",children:r.symbol}),W.jsx(Ge,{variant:"normal",color:"text50",children:r.address}),W.jsx(ME,{chainId:r.chainId})]}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Xt,{label:"Remove",variant:"danger",size:"md",shape:"square",onClick:()=>{t.removeToken(r)}})})]},n))]})]})}function AFe({onClose:t}){const r=Pr(Bn).networks.get(),n=r.filter(S=>S.type===Ft.MAINNET),i=Pr(Ix),s=yn(i.isFetchingTokenInfo),o=c8(),[a,c]=D.useState(),[l,f]=D.useState(),[u,p]=D.useState(),[g,y]=D.useState(!1);D.useEffect(()=>{a&&l?i.getTokenInfo(a.chainId,l).then(S=>{p(S)}):p(void 0)},[a,l]);const b=n.map(S=>({label:S.title,value:S.chainId.toString()})),I=async()=>{a&&l&&u&&(y(!0),await i.addToken({chainId:a.chainId,address:l,contractType:uh.ERC20,symbol:u.symbol,decimals:u.decimals}),y(!1),o({variant:"success",title:"Token added"}),C(),t())},C=()=>{f(void 0),c(void 0)};return W.jsxs(qr,{flexDirection:"column",paddingY:"4",paddingX:"8",borderRadius:"md",width:"full",height:"full",alignItems:"center",disabled:g,children:[W.jsx(xe,{children:W.jsx(Ge,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(xe,{flexDirection:"column",width:"full",marginTop:"4",gap:"4",children:[W.jsx(T7,{label:"Token Network",labelLocation:"left",name:"tokenNetwork",options:b,onValueChange:S=>c(r.find(O=>O.chainId===Number(S)))}),W.jsx(Wn,{width:"full",label:"Token Address",labelLocation:"left",name:"tokenAddress",value:l??"",onChange:S=>{f(S.target.value)}}),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})}),u&&W.jsxs(W.Fragment,{children:[W.jsx(Wn,{width:"full",label:"Token Symbol",labelLocation:"left",name:"tokenSymbol",value:(u==null?void 0:u.symbol)??"",disabled:!0}),W.jsx(Wn,{width:"full",label:"Token Decimals",labelLocation:"left",name:"tokenDecimals",value:(u==null?void 0:u.decimals)??"",disabled:!0})]}),W.jsxs(xe,{alignItems:"center",justifyContent:"flex-end",gap:"8",marginTop:"4",children:[W.jsx(Xt,{label:"Cancel",variant:"text",size:"md",shape:"square",disabled:g,onClick:()=>{C(),t()}}),W.jsx(Xt,{label:"Add",disabled:u===void 0||g,variant:"primary",size:"md",shape:"square",onClick:I})]})]})]})}const SFe=(t,e)=>Math.floor(t*10**e)/10**e;function _Fe({disabled:t,tokenBalance:e,onSendClick:r,onRemoveClick:n}){var o,a;const i=ch(e.balance,((o=e.contractInfo)==null?void 0:o.decimals)??18),s=SFe(Number(i),5);return W.jsxs(qr,{width:"full",flexDirection:"column",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",alignItems:"center",children:[W.jsx(Ge,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(Ge,{color:"text80",children:s})})]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(ME,{chainId:e.chainId}),W.jsxs(xe,{marginLeft:"auto",gap:"2",children:[W.jsx(Xt,{size:"xs",label:"Send",variant:"primary",shape:"square",disabled:t,onClick:r}),n&&W.jsx(Xt,{size:"xs",label:"Remove",shape:"square",onClick:n})]})]})]})}function IFe({filterZeroBalances:t,onSendClick:e}){const r=Pr(Xr),n=Pr(Ix),i=yn(n.balances),s=yn(n.isFetchingBalances),o=yn(r.selectedExternalProvider)!==void 0,a=D.useMemo(()=>t?i.filter(u=>u.balance!=="0"):i,[i,t,s]),[c,l]=D.useState(!1),f=u=>u.contractType===uh.NATIVE?void 0:()=>{var p,g;n.removeToken({chainId:u.chainId,address:u.contractAddress,contractType:u.contractType,decimals:(p=u.contractInfo)==null?void 0:p.decimals,symbol:(g=u.contractInfo)==null?void 0:g.symbol})};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{width:"full",flexDirection:"column",gap:"4",marginBottom:"8",children:[a.map(u=>W.jsx(_Fe,{tokenBalance:u,disabled:!o,onSendClick:()=>e(u),onRemoveClick:f(u)},u.contractAddress+u.chainId)),s&&W.jsx(xe,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ah,{size:"lg"})})]}),c&&W.jsx(AFe,{onClose:()=>l(!1)}),!c&&W.jsx(xe,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Xt,{label:"Import token",leftIcon:LH,variant:"primary",size:"md",shape:"square",onClick:()=>{l(!0)}})})]})}function TFe({onClose:t}){var a;const e=Pr(Xr),r=yn(e.connectOptions),[n,i]=D.useState(!1),s=async()=>{if(n)return;i(!0);const c=await e.walletRequestHandler.connect(r);e.connectDetails.set(c),i(!1),t()},o=()=>{e.connectDetails.set({connected:!1}),t()};return W.jsx(xe,{children:r&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Would you like to allow this dapp to connect to your wallet?"}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:r.app}),W.jsxs(xe,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(a=r.origin)==null?void 0:a.split("//")[1]}),W.jsx(gu,{size:"xs",icon:G4,onClick:()=>window.open(r.origin,"_blank")})]})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Network"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${My(Number(r.networkId))}`})]}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"6",children:[W.jsx(Xt,{width:"full",label:"Cancel",onClick:o,"data-id":"signingCancel"}),W.jsx(Xt,{width:"full",variant:"primary",label:n?"Authorizing…":"Connect",disabled:n,onClick:s,"data-id":"signingContinue"})]})]})})}function PFe({sessionList:t}){const e=Pr(kE);return W.jsxs(xe,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(Ge,{variant:"large",color:"text80",marginTop:"6",marginBottom:"2",children:"Connected Dapps via WalletConnect"}),t.map((r,n)=>W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"2",padding:"2",children:[W.jsx(r8,{width:"8",height:"8",src:r.peer.metadata.icons[0]}),W.jsx(Ge,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(xe,{gap:"2",children:[r.peer.metadata.url&&W.jsx(gu,{size:"xs",icon:G4,onClick:()=>window.open(r.peer.metadata.url,"_blank")}),W.jsx(gu,{size:"xs",icon:zg,onClick:()=>{e.disconnectSession(r.topic)}})]})]},n))]})}function kFe({onClose:t}){var l,f;const e=Pr(Xr),r=Pr(ai),n=e.toSignMsgDetails.get(),i=r.accountAddress.get(),[s,o]=D.useState(""),[a,c]=D.useState("");return D.useEffect(()=>{if(console.log("details",n),c(new Date().toLocaleString()),n!=null&&n.message.message){const u=XLe(n.message.message);try{o(Ip(u))}catch{o(Me(u))}}else n!=null&&n.message.typedData&&o(JSON.stringify(n.message.typedData,void 0,4))},[n]),W.jsx(xe,{children:n&&W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Ge,{variant:"md",color:"text100",children:a})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(f=(l=n==null?void 0:n.options)==null?void 0:l.origin)==null?void 0:f.split("//")[1]}),W.jsx(gu,{size:"xs",icon:G4,onClick:()=>{var u;return window.open((u=n.options)==null?void 0:u.origin,"_blank")}})]})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Network"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${My(n.chainId)}`})]}),W.jsxs(qr,{flexDirection:"column",gap:"4",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Signee"}),W.jsx(qr,{children:W.jsx(Ge,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(VH,{label:"Message Content",children:W.jsx(qr,{children:W.jsx(Ge,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Xt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Xt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(n)},"data-id":"signingContinue"})]})]})})}function MFe({onClose:t}){var I,C;const e=Pr(Xr),r=Pr(Bn),n=Pr(GM),[i,s]=D.useState("Unknown"),[o,a]=D.useState(null),[c,l]=D.useState({name:null}),[f,u]=D.useState(null),[p,g]=D.useState(""),y=e.toSignTxnDetails.get();D.useEffect(()=>{if(!y)return;g(new Date().toLocaleString());const S=r.providerForChainId(y.chainId??0),O=y.txn[0].data,L=y.txn[0].to;b(O,L,S)},[y]),D.useEffect(()=>{if(!y||!(y!=null&&y.txn[0].to)||!o)return;const S=y.txn[0].to,O={chainId:y.chainId,address:S,tokenId:o,contractType:i};n.getCollectibleInfo(O)},[i,o]);async function b(S,O,L){try{const F=new Nn(O,Uv,L);try{const ie=await F.symbol();s("ERC20"),l({name:ie});const K=new Fi(Uv).parseTransaction({data:S}),P=await F.decimals();u(Number(ch(K==null?void 0:K.args[1],P??18)));return}catch{}const z=new Nn(O,C9e,L);if(await z.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Nn(O,fM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const P=await ie.name();l({name:P});return}if(await z.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Nn(O,uM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const P=await ie.uri(K);l({name:P});return}}catch(F){console.error("Error parsing contract type. The transaction is either using a smart contract that doesnt support ERC165 or the token is native:",F)}if(y!=null&&y.txn[0].value){s("Native Token"),l({name:`${My((y==null?void 0:y.chainId)??1)} Native Token`});return}console.info("Token info could not be decoded for this transaction")}return W.jsx(xe,{children:y&&W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(Ge,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Ch,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(Ge,{variant:"md",color:"text100",children:p})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(xe,{alignItems:"center",gap:"3",children:[W.jsx(Ge,{variant:"md",color:"text100",children:(C=(I=y==null?void 0:y.options)==null?void 0:I.origin)==null?void 0:C.split("//")[1]}),W.jsx(gu,{size:"xs",icon:G4,onClick:()=>{var S;return window.open((S=y.options)==null?void 0:S.origin,"_blank")}})]})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(Ge,{variant:"md",color:"text100",children:"Amount"}),W.jsx(Ge,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(VH,{label:"Transaction Data",children:W.jsx(xe,{flexDirection:"column",gap:"2",children:y.txn.map((S,O)=>W.jsx(qr,{children:W.jsx(Ge,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},O))})}),W.jsxs(xe,{flexDirection:{sm:"column",md:"row"},gap:"2",width:"full",marginTop:"10",children:[W.jsx(Xt,{width:"full",label:"Cancel",onClick:()=>{t()},"data-id":"signingCancel"}),W.jsx(Xt,{width:"full",variant:"primary",label:"Send",onClick:()=>{t(y)},"data-id":"signingContinue"})]})]})})})}function RFe({warningType:t}){return W.jsx(xe,{children:W.jsxs(xe,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(Ge,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(xe,{flexDirection:"column",children:W.jsx(qr,{children:W.jsxs(Ge,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"2",children:[t==="noProvider"&&'Please ensure that an external wallet is connected via the "Connect" button',t==="isWalletConnect"&&"Please switch your external wallet to an option other than WalletConnect",t==="notDeployed"&&"Please deploy our wallet on the required network before trying to sign messages"]})})})]})})}var Lte={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.compactObject=Ute;jo.deprecated=$Fe;var OFe=jo.detectBrowser=qFe;jo.disableLog=FFe;jo.disableWarnings=jFe;jo.extractVersion=D3;jo.filterStats=VFe;jo.log=UFe;jo.walkStats=f4;jo.wrapPeerConnectionEvent=LFe;function DFe(t,e,r){return e=NFe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NFe(t){var e=BFe(t,"string");return ph(e)=="symbol"?e:e+""}function BFe(t,e){if(ph(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ph(t){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ph(t)}var Fte=!0,jte=!0;function D3(t,e,r){var n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function LFe(t,e,r){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(o,a){if(o!==e)return i.apply(this,arguments);var c=function(f){var u=r(f);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,c),i.apply(this,[o,c])};var s=n.removeEventListener;n.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);var c=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function FFe(t){return typeof t!="boolean"?new Error("Argument type: "+ph(t)+". Please use a boolean."):(Fte=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function jFe(t){return typeof t!="boolean"?new Error("Argument type: "+ph(t)+". Please use a boolean."):(jte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function UFe(){if((typeof window>"u"?"undefined":ph(window))==="object"){if(Fte)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $Fe(t,e){jte&&console.warn(t+" is deprecated, please use "+e+" instead.")}function qFe(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var r=t.navigator;if(r.userAgentData&&r.userAgentData.brands){var n=r.userAgentData.brands.find(function(i){return i.brand==="Chromium"});if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(r.mozGetUserMedia)e.browser="firefox",e.version=D3(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=D3(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=D3(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function k$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ute(t){return k$(t)?Object.keys(t).reduce(function(e,r){var n=k$(t[r]),i=n?Ute(t[r]):t[r],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,DFe({},r,i))},{}):t}function f4(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?f4(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(function(i){f4(t,t.get(i),r)})}))}function VFe(t,e,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;var s=[];return t.forEach(function(o){o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(function(o){t.forEach(function(a){a.type===n&&a.trackId===o.id&&f4(t,a,i)})}),i}Object.defineProperty(Lte,"__esModule",{value:!0});var zFe=Lte.shimGetUserMedia=WFe,HFe=GFe(jo);function $te(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return($te=function(i){return i?r:e})(t)}function GFe(t,e){if(t&&t.__esModule)return t;if(t===null||pd(t)!="object"&&typeof t!="function")return{default:t};var r=$te(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function pd(t){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pd(t)}var M$=HFe.log;function WFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(pd(l)!=="object"||l.mandatory||l.optional)return l;var f={};return Object.keys(l).forEach(function(u){if(!(u==="require"||u==="advanced"||u==="mediaSource")){var p=pd(l[u])==="object"?l[u]:{ideal:l[u]};p.exact!==void 0&&typeof p.exact=="number"&&(p.min=p.max=p.exact);var g=function(I,C){return I?I+C.charAt(0).toUpperCase()+C.slice(1):C==="deviceId"?"sourceId":C};if(p.ideal!==void 0){f.optional=f.optional||[];var y={};typeof p.ideal=="number"?(y[g("min",u)]=p.ideal,f.optional.push(y),y={},y[g("max",u)]=p.ideal,f.optional.push(y)):(y[g("",u)]=p.ideal,f.optional.push(y))}p.exact!==void 0&&typeof p.exact!="number"?(f.mandatory=f.mandatory||{},f.mandatory[g("",u)]=p.exact):["min","max"].forEach(function(b){p[b]!==void 0&&(f.mandatory=f.mandatory||{},f.mandatory[g(b,u)]=p[b])})}}),l.advanced&&(f.optional=(f.optional||[]).concat(l.advanced)),f},i=function(l,f){if(e.version>=61)return f(l);if(l=JSON.parse(JSON.stringify(l)),l&&pd(l.audio)==="object"){var u=function(I,C,S){C in I&&!(S in I)&&(I[S]=I[C],delete I[C])};l=JSON.parse(JSON.stringify(l)),u(l.audio,"autoGainControl","googAutoGainControl"),u(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=n(l.audio)}if(l&&pd(l.video)==="object"){var p=l.video.facingMode;p=p&&(pd(p)==="object"?p:{ideal:p});var g=e.version<66;if(p&&(p.exact==="user"||p.exact==="environment"||p.ideal==="user"||p.ideal==="environment")&&!(r.mediaDevices.getSupportedConstraints&&r.mediaDevices.getSupportedConstraints().facingMode&&!g)){delete l.video.facingMode;var y;if(p.exact==="environment"||p.ideal==="environment"?y=["back","rear"]:(p.exact==="user"||p.ideal==="user")&&(y=["front"]),y)return r.mediaDevices.enumerateDevices().then(function(b){b=b.filter(function(C){return C.kind==="videoinput"});var I=b.find(function(C){return y.some(function(S){return C.label.toLowerCase().includes(S)})});return!I&&b.length&&y.includes("back")&&(I=b[b.length-1]),I&&(l.video.deviceId=p.exact?{exact:I.deviceId}:{ideal:I.deviceId}),l.video=n(l.video),M$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return M$("chrome: "+JSON.stringify(l)),f(l)},s=function(l){return e.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},o=function(l,f,u){i(l,function(p){r.webkitGetUserMedia(p,f,function(g){u&&u(s(g))})})};if(r.getUserMedia=o.bind(r),r.mediaDevices.getUserMedia){var a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(c){return i(c,function(l){return a(l).then(function(f){if(l.audio&&!f.getAudioTracks().length||l.video&&!f.getVideoTracks().length)throw f.getTracks().forEach(function(u){u.stop()}),new DOMException("","NotFoundError");return f},function(f){return Promise.reject(s(f))})})}}}}var qte={};Object.defineProperty(qte,"__esModule",{value:!0});var KFe=qte.shimGetUserMedia=JFe,YFe=QFe(jo);function Vte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Vte=function(i){return i?r:e})(t)}function QFe(t,e){if(t&&t.__esModule)return t;if(t===null||Gv(t)!="object"&&typeof t!="function")return{default:t};var r=Vte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function Gv(t){"@babel/helpers - typeof";return Gv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gv(t)}function JFe(t,e){var r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(c,l,f){YFe.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(c).then(l,f)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(l,f,u){f in l&&!(u in l)&&(l[u]=l[f],delete l[f])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(c){return Gv(c)==="object"&&Gv(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var o=n.prototype.getSettings;n.prototype.getSettings=function(){var c=o.apply(this,arguments);return i(c,"mozAutoGainControl","autoGainControl"),i(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var a=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&Gv(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),i(c,"autoGainControl","mozAutoGainControl"),i(c,"noiseSuppression","mozNoiseSuppression")),a.apply(this,[c])}}}}var ef={};Object.defineProperty(ef,"__esModule",{value:!0});ef.shimAudioContext=aje;ef.shimCallbacksAPI=rje;ef.shimConstraints=Gte;ef.shimCreateOfferLegacy=oje;var ZFe=ef.shimGetUserMedia=nje;ef.shimLocalStreamsAPI=eje;ef.shimRTCIceServerUrls=ije;ef.shimRemoteStreamsAPI=tje;ef.shimTrackEventTransceiver=sje;var zte=XFe(jo);function Hte(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Hte=function(i){return i?r:e})(t)}function XFe(t,e){if(t&&t.__esModule)return t;if(t===null||vh(t)!="object"&&typeof t!="function")return{default:t};var r=Hte(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function vh(t){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vh(t)}function eje(t){if(!(vh(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){var i=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(function(s){return e.call(i,s,n)}),n.getVideoTracks().forEach(function(s){return e.call(i,s,n)})},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=this,s=arguments.length,o=new Array(s>1?s-1:0),a=1;a=0)){n._remoteStreams.push(s);var o=new Event("addstream");o.stream=s,n.dispatchEvent(o)}})}),e.apply(n,arguments)}}}function rje(t){if(!(vh(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p},e.createAnswer=function(l,f){var u=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[u]);return f?(p.then(l,f),Promise.resolve()):p};var a=function(l,f,u){var p=i.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p};e.setLocalDescription=a,a=function(l,f,u){var p=s.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.setRemoteDescription=a,a=function(l,f,u){var p=o.apply(this,[l]);return u?(p.then(f,u),Promise.resolve()):p},e.addIceCandidate=a}}function nje(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=function(i){return n(Gte(i))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(s,o,a){e.mediaDevices.getUserMedia(s).then(o,a)}).bind(e))}function Gte(t){return t&&t.video!==void 0?Object.assign({},t,{video:zte.compactObject(t.video)}):t}function ije(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){for(var s=[],o=0;o{throw TypeError(t)},Kte=(t,e,r)=>e.has(t)||Wte("Cannot "+r),cje=(t,e,r)=>(Kte(t,e,"read from private field"),r?r.call(t):e.get(t)),lje=(t,e,r)=>e.has(t)?Wte("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),fje=(t,e,r,n)=>(Kte(t,e,"write to private field"),e.set(t,r),r);const R$=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function uje(t){return t.join("|")}function dje(t){const e=O$(t);let r=0,n=R$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=R$[i],o=O$(s);if(o===e)return s;o{const r=t.match(/_(.+?)\.wasm$/);return r?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.3/dist/${r[1]}/${t}`:e+t}};let D$=new WeakMap;function WM(t,e){var r;const n=D$.get(t);if(n!=null&&n.modulePromise&&e===void 0)return n.modulePromise;const i=(r=n==null?void 0:n.moduleOverrides)!=null?r:bje,s=t({...i});return D$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function wje(t,e,r=fy){const n={...fy,...r},i=await WM(t),{size:s}=e,o=new Uint8Array(await e.arrayBuffer()),a=i._malloc(s);i.HEAPU8.set(o,a);const c=i.readBarcodesFromImage(a,s,Yte(i,n));i._free(a);const l=[];for(let f=0;f{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(r={}){var n,i=r,s,o,a=new Promise((q,V)=>{s=q,o=V}),c=typeof window=="object",l=typeof Bun<"u",f=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var u=Object.assign({},i),p="./this.program",g="";function y(q){return i.locateFile?i.locateFile(q,g):g+q}var b,I;if(c||f||l){var C;f?g=self.location.href:typeof document<"u"&&((C=document.currentScript)===null||C===void 0?void 0:C.tagName.toUpperCase())==="SCRIPT"&&(g=document.currentScript.src),e&&(g=e),g.startsWith("blob:")?g="":g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),f&&(I=q=>{var V=new XMLHttpRequest;return V.open("GET",q,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),b=q=>fetch(q,{credentials:"same-origin"}).then(V=>V.ok?V.arrayBuffer():Promise.reject(new Error(V.status+" : "+V.url)))}var S=i.print||console.log.bind(console),O=i.printErr||console.error.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&(p=i.thisProgram);var L=i.wasmBinary,F,z=!1,_,$,ie,ce,K,P,M,v;function m(){var q=F.buffer;i.HEAP8=_=new Int8Array(q),i.HEAP16=ie=new Int16Array(q),i.HEAPU8=$=new Uint8Array(q),i.HEAPU16=ce=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=P=new Uint32Array(q),i.HEAPF32=M=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var R=[],B=[],E=[];function x(){var q=i.preRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(k)),Qe(R)}function w(){Qe(B)}function T(){var q=i.postRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(oe)),Qe(E)}function k(q){R.unshift(q)}function H(q){B.unshift(q)}function oe(q){E.unshift(q)}var j=0,X=null;function G(q){var V;j++,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j)}function Z(q){var V;if(j--,(V=i.monitorRunDependencies)===null||V===void 0||V.call(i,j),j==0&&X){var re=X;X=null,re()}}function ee(q){var V;(V=i.onAbort)===null||V===void 0||V.call(i,q),q="Aborted("+q+")",O(q),z=!0,q+=". Build with -sASSERTIONS for more info.";var re=new WebAssembly.RuntimeError(q);throw o(re),re}var N="data:application/octet-stream;base64,",te=q=>q.startsWith(N);function fe(){var q="zxing_reader.wasm";return te(q)?q:y(q)}var Ee;function _e(q){if(q==Ee&&L)return new Uint8Array(L);if(I)return I(q);throw"both async and sync fetching of the wasm failed"}function Re(q){return L?Promise.resolve().then(()=>_e(q)):b(q).then(V=>new Uint8Array(V),()=>_e(q))}function Te(q,V,re){return Re(q).then(ae=>WebAssembly.instantiate(ae,V)).then(re,ae=>{O(`failed to asynchronously prepare wasm: ${ae}`),ee(ae)})}function De(q,V,re,ae){return!q&&typeof WebAssembly.instantiateStreaming=="function"&&!te(V)&&typeof fetch=="function"?fetch(V,{credentials:"same-origin"}).then(ve=>{var me=WebAssembly.instantiateStreaming(ve,re);return me.then(ae,function(Se){return O(`wasm streaming compile failed: ${Se}`),O("falling back to ArrayBuffer instantiation"),Te(V,re,ae)})}):Te(V,re,ae)}function ze(){return{a:HE}}function Xe(){var q,V=ze();function re(ve,me){return Yr=ve.exports,F=Yr.za,m(),s1=Yr.Da,H(Yr.Aa),Z(),Yr}G();function ae(ve){re(ve.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(V,re)}catch(ve){O(`Module.instantiateWasm callback failed with error: ${ve}`),o(ve)}return(q=Ee)!==null&&q!==void 0||(Ee=fe()),De(L,Ee,V,ae).catch(o),{}}var Qe=q=>{q.forEach(V=>V(i))};i.noExitRuntime;var ke=q=>Zx(q),Ne=()=>Xx(),et=[],Je=0,it=q=>{var V=new lt(q);return V.get_caught()||(V.set_caught(!0),Je--),V.set_rethrown(!1),et.push(V),uf(q),Jy(q)},rt=0,We=()=>{nr(0,0);var q=et.pop();e2(q.excPtr),rt=0};class lt{constructor(V){this.excPtr=V,this.ptr=V-24}set_type(V){P[this.ptr+4>>2]=V}get_type(){return P[this.ptr+4>>2]}set_destructor(V){P[this.ptr+8>>2]=V}get_destructor(){return P[this.ptr+8>>2]}set_caught(V){V=V?1:0,_[this.ptr+12]=V}get_caught(){return _[this.ptr+12]!=0}set_rethrown(V){V=V?1:0,_[this.ptr+13]=V}get_rethrown(){return _[this.ptr+13]!=0}init(V,re){this.set_adjusted_ptr(0),this.set_type(V),this.set_destructor(re)}set_adjusted_ptr(V){P[this.ptr+16>>2]=V}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var pt=q=>{throw rt||(rt=q),rt},Ke=q=>Hh(q),vt=q=>{var V=rt;if(!V)return Ke(0),0;var re=new lt(V);re.set_adjusted_ptr(V);var ae=re.get_type();if(!ae)return Ke(0),V;for(var ve of q){if(ve===0||ve===ae)break;var me=re.ptr+16;if(po(ve,ae,me))return Ke(ve),V}return Ke(ae),V},bt=()=>vt([]),tt=q=>vt([q]),_t=(q,V)=>vt([q,V]),Ct=()=>{var q=et.pop();q||ee("no exception to throw");var V=q.excPtr;throw q.get_rethrown()||(et.push(q),q.set_rethrown(!0),q.set_caught(!1),Je++),rt=V,rt},It=(q,V,re)=>{var ae=new lt(q);throw ae.init(V,re),rt=q,Je++,rt},er=()=>Je,ur=()=>{ee("")},wt={},lr=q=>{for(;q.length;){var V=q.pop(),re=q.pop();re(V)}};function ir(q){return this.fromWireType(P[q>>2])}var Pt={},Ot={},Dt={},dt,Bt=q=>{throw new dt(q)},kt=(q,V,re)=>{q.forEach(Ae=>Dt[Ae]=V);function ae(Ae){var Be=re(Ae);Be.length!==q.length&&Bt("Mismatched type converter count");for(var Ye=0;Ye{Ot.hasOwnProperty(Ae)?ve[Be]=Ot[Ae]:(me.push(Ae),Pt.hasOwnProperty(Ae)||(Pt[Ae]=[]),Pt[Ae].push(()=>{ve[Be]=Ot[Ae],++Se,Se===me.length&&ae(ve)}))}),me.length===0&&ae(ve)},ut=q=>{var V=wt[q];delete wt[q];var re=V.rawConstructor,ae=V.rawDestructor,ve=V.fields,me=ve.map(Se=>Se.getterReturnType).concat(ve.map(Se=>Se.setterArgumentType));kt([q],me,Se=>{var Ae={};return ve.forEach((Be,Ye)=>{var st=Be.fieldName,Lt=Se[Ye],wr=Be.getter,Gt=Be.getterContext,dr=Se[Ye+ve.length],Qn=Be.setter,$n=Be.setterContext;Ae[st]={read:kn=>Lt.fromWireType(wr(Gt,kn)),write:(kn,df)=>{var mi=[];Qn($n,kn,dr.toWireType(mi,df)),lr(mi)}}}),[{name:V.name,fromWireType:Be=>{var Ye={};for(var st in Ae)Ye[st]=Ae[st].read(Be);return ae(Be),Ye},toWireType:(Be,Ye)=>{for(var st in Ae)if(!(st in Ye))throw new TypeError(`Missing field: "${st}"`);var Lt=re();for(st in Ae)Ae[st].write(Lt,Ye[st]);return Be!==null&&Be.push(ae,Lt),Lt},argPackAdvance:ct,readValueFromPointer:ir,destructorFunction:ae}]})},Vt=(q,V,re,ae,ve)=>{},zt=()=>{for(var q=new Array(256),V=0;V<256;++V)q[V]=String.fromCharCode(V);ht=q},ht,xt=q=>{for(var V="",re=q;$[re];)V+=ht[$[re++]];return V},Nt,He=q=>{throw new Nt(q)};function $t(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var ae=V.name;if(q||He(`type "${ae}" must have a positive integer typeid pointer`),Ot.hasOwnProperty(q)){if(re.ignoreDuplicateRegistrations)return;He(`Cannot register type '${ae}' twice`)}if(Ot[q]=V,delete Dt[q],Pt.hasOwnProperty(q)){var ve=Pt[q];delete Pt[q],ve.forEach(me=>me())}}function Et(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(q,V,re)}var ct=8,Ht=(q,V,re,ae)=>{V=xt(V),Et(q,{name:V,fromWireType:function(ve){return!!ve},toWireType:function(ve,me){return me?re:ae},argPackAdvance:ct,readValueFromPointer:function(ve){return this.fromWireType($[ve])},destructorFunction:null})},Dr=q=>({count:q.count,deleteScheduled:q.deleteScheduled,preservePointerOnDelete:q.preservePointerOnDelete,ptr:q.ptr,ptrType:q.ptrType,smartPtr:q.smartPtr,smartPtrType:q.smartPtrType}),Ut=q=>{function V(re){return re.$$.ptrType.registeredClass.name}He(V(q)+" instance already deleted")},Ir=!1,tr=q=>{},Rr=q=>{q.smartPtr?q.smartPtrType.rawDestructor(q.smartPtr):q.ptrType.registeredClass.rawDestructor(q.ptr)},vi=q=>{q.count.value-=1;var V=q.count.value===0;V&&Rr(q)},gi=(q,V,re)=>{if(V===re)return q;if(re.baseClass===void 0)return null;var ae=gi(q,V,re.baseClass);return ae===null?null:re.downcast(ae)},yi={},Si={},_n=(q,V)=>{for(V===void 0&&He("ptr should not be undefined");q.baseClass;)V=q.upcast(V),q=q.baseClass;return V},us=(q,V)=>(V=_n(q,V),Si[V]),ds=(q,V)=>{(!V.ptrType||!V.ptr)&&Bt("makeClassHandle requires ptr and ptrType");var re=!!V.smartPtrType,ae=!!V.smartPtr;return re!==ae&&Bt("Both smartPtrType and smartPtr must be specified"),V.count={value:1},Vi(Object.create(q,{$$:{value:V,writable:!0}}))};function hs(q){var V=this.getPointee(q);if(!V)return this.destructor(q),null;var re=us(this.registeredClass,V);if(re!==void 0){if(re.$$.count.value===0)return re.$$.ptr=V,re.$$.smartPtr=q,re.clone();var ae=re.clone();return this.destructor(q),ae}function ve(){return this.isSmartPointer?ds(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:V,smartPtrType:this,smartPtr:q}):ds(this.registeredClass.instancePrototype,{ptrType:this,ptr:q})}var me=this.registeredClass.getActualType(V),Se=yi[me];if(!Se)return ve.call(this);var Ae;this.isConst?Ae=Se.constPointerType:Ae=Se.pointerType;var Be=gi(V,this.registeredClass,Ae.registeredClass);return Be===null?ve.call(this):this.isSmartPointer?ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Be,smartPtrType:this,smartPtr:q}):ds(Ae.registeredClass.instancePrototype,{ptrType:Ae,ptr:Be})}var Vi=q=>typeof FinalizationRegistry>"u"?(Vi=V=>V,q):(Ir=new FinalizationRegistry(V=>{vi(V.$$)}),Vi=V=>{var re=V.$$,ae=!!re.smartPtr;if(ae){var ve={$$:re};Ir.register(V,ve,V)}return V},tr=V=>Ir.unregister(V),Vi(q)),ps=[],vs=()=>{for(;ps.length;){var q=ps.pop();q.$$.deleteScheduled=!1,q.delete()}},Us,lo=()=>{Object.assign(In.prototype,{isAliasOf(q){if(!(this instanceof In)||!(q instanceof In))return!1;var V=this.$$.ptrType.registeredClass,re=this.$$.ptr;q.$$=q.$$;for(var ae=q.$$.ptrType.registeredClass,ve=q.$$.ptr;V.baseClass;)re=V.upcast(re),V=V.baseClass;for(;ae.baseClass;)ve=ae.upcast(ve),ae=ae.baseClass;return V===ae&&re===ve},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var q=Vi(Object.create(Object.getPrototypeOf(this),{$$:{value:Dr(this.$$)}}));return q.$$.count.value+=1,q.$$.deleteScheduled=!1,q},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),tr(this),vi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),ps.push(this),ps.length===1&&Us&&Us(vs),this.$$.deleteScheduled=!0,this}})};function In(){}var zi=(q,V)=>Object.defineProperty(V,"name",{value:q}),fo=(q,V,re)=>{if(q[V].overloadTable===void 0){var ae=q[V];q[V]=function(){for(var ve=arguments.length,me=new Array(ve),Se=0;Se{i.hasOwnProperty(q)?((re===void 0||i[q].overloadTable!==void 0&&i[q].overloadTable[re]!==void 0)&&He(`Cannot register public name '${q}' twice`),fo(i,q,q),i.hasOwnProperty(re)&&He(`Cannot register multiple overloads of a function with the same number of arguments (${re})!`),i[q].overloadTable[re]=V):(i[q]=V,re!==void 0&&(i[q].numArguments=re))},tf=48,Jc=57,r1=q=>{q=q.replace(/[^a-zA-Z0-9_]/g,"$");var V=q.charCodeAt(0);return V>=tf&&V<=Jc?`_${q}`:q};function rf(q,V,re,ae,ve,me,Se,Ae){this.name=q,this.constructor=V,this.instancePrototype=re,this.rawDestructor=ae,this.baseClass=ve,this.getActualType=me,this.upcast=Se,this.downcast=Ae,this.pureVirtualFunctions=[]}var nf=(q,V,re)=>{for(;V!==re;)V.upcast||He(`Expected null or instance of ${re.name}, got an instance of ${V.name}`),q=V.upcast(q),V=V.baseClass;return q};function sf(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=nf(V.$$.ptr,re,this.registeredClass);return ae}function Nh(q,V){var re;if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,re),re):0;(!V||!V.$$)&&He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);var ae=V.$$.ptrType.registeredClass;if(re=nf(V.$$.ptr,ae,this.registeredClass),this.isSmartPointer)switch(V.$$.smartPtr===void 0&&He("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?re=V.$$.smartPtr:He(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:re=V.$$.smartPtr;break;case 2:if(V.$$.smartPtrType===this)re=V.$$.smartPtr;else{var ve=V.clone();re=this.rawShare(re,uo.toHandle(()=>ve.delete())),q!==null&&q.push(this.rawDestructor,re)}break;default:He("Unsupporting sharing policy")}return re}function of(q,V){if(V===null)return this.isReference&&He(`null is not a valid ${this.name}`),0;V.$$||He(`Cannot pass "${le(V)}" as a ${this.name}`),V.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&He(`Cannot convert argument of type ${V.$$.ptrType.name} to parameter type ${this.name}`);var re=V.$$.ptrType.registeredClass,ae=nf(V.$$.ptr,re,this.registeredClass);return ae}var n1=()=>{Object.assign(Ou.prototype,{getPointee(q){return this.rawGetPointee&&(q=this.rawGetPointee(q)),q},destructor(q){var V;(V=this.rawDestructor)===null||V===void 0||V.call(this,q)},argPackAdvance:ct,readValueFromPointer:ir,fromWireType:hs})};function Ou(q,V,re,ae,ve,me,Se,Ae,Be,Ye,st){this.name=q,this.registeredClass=V,this.isReference=re,this.isConst=ae,this.isSmartPointer=ve,this.pointeeType=me,this.sharingPolicy=Se,this.rawGetPointee=Ae,this.rawConstructor=Be,this.rawShare=Ye,this.rawDestructor=st,!ve&&V.baseClass===void 0?ae?(this.toWireType=sf,this.destructorFunction=null):(this.toWireType=of,this.destructorFunction=null):this.toWireType=Nh}var Bh=(q,V,re)=>{i.hasOwnProperty(q)||Bt("Replacing nonexistent public symbol"),i[q].overloadTable!==void 0&&re!==void 0?i[q].overloadTable[re]=V:(i[q]=V,i[q].argCount=re)},i1=(q,V,re)=>{q=q.replace(/p/g,"i");var ae=i["dynCall_"+q];return ae(V,...re)},cc=[],s1,gr=q=>{var V=cc[q];return V||(q>=cc.length&&(cc.length=q+1),cc[q]=V=s1.get(q)),V},Du=function(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(q.includes("j"))return i1(q,V,re);var ae=gr(V)(...re);return ae},Zc=(q,V)=>function(){for(var re=arguments.length,ae=new Array(re),ve=0;ve{q=xt(q);function re(){return q.includes("j")?Zc(q,V):gr(V)}var ae=re();return typeof ae!="function"&&He(`unknown function pointer with signature ${q}: ${V}`),ae},o1=(q,V)=>{var re=zi(V,function(ae){this.name=V,this.message=ae;var ve=new Error(ae).stack;ve!==void 0&&(this.stack=this.toString()+` +`+ve.replace(/^Error(:[^\n]*)?\n/,""))});return re.prototype=Object.create(q.prototype),re.prototype.constructor=re,re.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},re},Lh,Uo=q=>{var V=Jx(q),re=xt(V);return fc(V),re},af=(q,V)=>{var re=[],ae={};function ve(me){if(!ae[me]&&!Ot[me]){if(Dt[me]){Dt[me].forEach(ve);return}re.push(me),ae[me]=!0}}throw V.forEach(ve),new Lh(`${q}: `+re.map(Uo).join([", "]))},a1=(q,V,re,ae,ve,me,Se,Ae,Be,Ye,st,Lt,wr)=>{st=xt(st),me=xn(ve,me),Ae&&(Ae=xn(Se,Ae)),Ye&&(Ye=xn(Be,Ye)),wr=xn(Lt,wr);var Gt=r1(st);$s(Gt,function(){af(`Cannot construct ${st} due to unbound types`,[ae])}),kt([q,V,re],ae?[ae]:[],dr=>{dr=dr[0];var Qn,$n;ae?(Qn=dr.registeredClass,$n=Qn.instancePrototype):$n=In.prototype;var kn=zi(st,function(){if(Object.getPrototypeOf(this)!==df)throw new Nt("Use 'new' to construct "+st);if(mi.constructor_body===void 0)throw new Nt(st+" has no accessible constructor");for(var Kh=arguments.length,uc=new Array(Kh),x1=0;x1{for(var re=[],ae=0;ae>2]);return re};function c1(q){for(var V=1;V{var Se=Nu(V,re);ve=xn(ae,ve),kt([],[q],Ae=>{Ae=Ae[0];var Be=`constructor ${Ae.name}`;if(Ae.registeredClass.constructor_body===void 0&&(Ae.registeredClass.constructor_body=[]),Ae.registeredClass.constructor_body[V-1]!==void 0)throw new Nt(`Cannot register multiple constructors with identical number of parameters (${V-1}) for class '${Ae.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ae.registeredClass.constructor_body[V-1]=()=>{af(`Cannot construct ${Ae.name} due to unbound types`,Se)},kt([],Se,Ye=>(Ye.splice(1,0,null),Ae.registeredClass.constructor_body[V-1]=Fh(Be,Ye,null,ve,me),[])),[]})},jh=q=>{q=q.trim();const V=q.indexOf("(");return V!==-1?q.substr(0,V):q},l1=(q,V,re,ae,ve,me,Se,Ae,Be,Ye)=>{var st=Nu(re,ae);V=xt(V),V=jh(V),me=xn(ve,me),kt([],[q],Lt=>{Lt=Lt[0];var wr=`${Lt.name}.${V}`;V.startsWith("@@")&&(V=Symbol[V.substring(2)]),Ae&&Lt.registeredClass.pureVirtualFunctions.push(V);function Gt(){af(`Cannot call ${wr} due to unbound types`,st)}var dr=Lt.registeredClass.instancePrototype,Qn=dr[V];return Qn===void 0||Qn.overloadTable===void 0&&Qn.className!==Lt.name&&Qn.argCount===re-2?(Gt.argCount=re-2,Gt.className=Lt.name,dr[V]=Gt):(fo(dr,V,wr),dr[V].overloadTable[re-2]=Gt),kt([],st,$n=>{var kn=Fh(wr,$n,Lt,me,Se);return dr[V].overloadTable===void 0?(kn.argCount=re-2,dr[V]=kn):dr[V].overloadTable[re-2]=kn,[]}),[]})},Xc=[],$o=[],cf=q=>{q>9&&--$o[q+1]===0&&($o[q]=void 0,Xc.push(q))},Vy=()=>$o.length/2-5-Xc.length,Bu=()=>{$o.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=Vy},uo={toValue:q=>(q||He("Cannot use deleted val. handle = "+q),$o[q]),toHandle:q=>{switch(q){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const V=Xc.pop()||$o.length;return $o[V]=q,$o[V+1]=1,V}}}},Uh={name:"emscripten::val",fromWireType:q=>{var V=uo.toValue(q);return cf(q),V},toWireType:(q,V)=>uo.toHandle(V),argPackAdvance:ct,readValueFromPointer:ir,destructorFunction:null},lf=q=>Et(q,Uh),f1=(q,V,re)=>{switch(V){case 1:return re?function(ae){return this.fromWireType(_[ae])}:function(ae){return this.fromWireType($[ae])};case 2:return re?function(ae){return this.fromWireType(ie[ae>>1])}:function(ae){return this.fromWireType(ce[ae>>1])};case 4:return re?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(P[ae>>2])};default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},zy=(q,V,re,ae)=>{V=xt(V);function ve(){}ve.values={},Et(q,{name:V,constructor:ve,fromWireType:function(me){return this.constructor.values[me]},toWireType:(me,Se)=>Se.value,argPackAdvance:ct,readValueFromPointer:f1(V,re,ae),destructorFunction:null}),$s(V,ve)},Hr=(q,V)=>{var re=Ot[q];return re===void 0&&He(`${V} has unknown type ${Uo(q)}`),re},Kr=(q,V,re)=>{var ae=Hr(q,"enum");V=xt(V);var ve=ae.constructor,me=Object.create(ae.constructor.prototype,{value:{value:re},constructor:{value:zi(`${ae.name}_${V}`,function(){})}});ve.values[re]=me,ve[V]=me},le=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},we=(q,V)=>{switch(V){case 4:return function(re){return this.fromWireType(M[re>>2])};case 8:return function(re){return this.fromWireType(v[re>>3])};default:throw new TypeError(`invalid float width (${V}): ${q}`)}},qe=(q,V,re)=>{V=xt(V),Et(q,{name:V,fromWireType:ae=>ae,toWireType:(ae,ve)=>ve,argPackAdvance:ct,readValueFromPointer:we(V,re),destructorFunction:null})},gt=(q,V,re,ae,ve,me,Se,Ae)=>{var Be=Nu(V,re);q=xt(q),q=jh(q),ve=xn(ae,ve),$s(q,function(){af(`Cannot call ${q} due to unbound types`,Be)},V-1),kt([],Be,Ye=>{var st=[Ye[0],null].concat(Ye.slice(1));return Bh(q,Fh(q,st,null,ve,me),V-1),[]})},tn=(q,V,re)=>{switch(V){case 1:return re?ae=>_[ae]:ae=>$[ae];case 2:return re?ae=>ie[ae>>1]:ae=>ce[ae>>1];case 4:return re?ae=>K[ae>>2]:ae=>P[ae>>2];default:throw new TypeError(`invalid integer width (${V}): ${q}`)}},rr=(q,V,re,ae,ve)=>{V=xt(V);var me=st=>st;if(ae===0){var Se=32-8*re;me=st=>st<>>Se}var Ae=V.includes("unsigned"),Be=(st,Lt)=>{},Ye;Ae?Ye=function(st,Lt){return Be(Lt,this.name),Lt>>>0}:Ye=function(st,Lt){return Be(Lt,this.name),Lt},Et(q,{name:V,fromWireType:me,toWireType:Ye,argPackAdvance:ct,readValueFromPointer:tn(V,re,ae!==0),destructorFunction:null})},hn=(q,V,re)=>{var ae=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ve=ae[V];function me(Se){var Ae=P[Se>>2],Be=P[Se+4>>2];return new ve(_.buffer,Be,Ae)}re=xt(re),Et(q,{name:re,fromWireType:me,argPackAdvance:ct,readValueFromPointer:me},{ignoreDuplicateRegistrations:!0})},Un=Object.assign({optional:!0},Uh),Er=(q,V)=>{Et(q,Un)},rn=(q,V,re,ae)=>{if(!(ae>0))return 0;for(var ve=re,me=re+ae-1,Se=0;Se=55296&&Ae<=57343){var Be=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Be&1023}if(Ae<=127){if(re>=me)break;V[re++]=Ae}else if(Ae<=2047){if(re+1>=me)break;V[re++]=192|Ae>>6,V[re++]=128|Ae&63}else if(Ae<=65535){if(re+2>=me)break;V[re++]=224|Ae>>12,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}else{if(re+3>=me)break;V[re++]=240|Ae>>18,V[re++]=128|Ae>>12&63,V[re++]=128|Ae>>6&63,V[re++]=128|Ae&63}}return V[re]=0,re-ve},pn=(q,V,re)=>rn(q,$,V,re),gs=q=>{for(var V=0,re=0;re=55296&&ae<=57343?(V+=4,++re):V+=3}return V},Pn=typeof TextDecoder<"u"?new TextDecoder:void 0,ln=function(q){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var ae=V+re,ve=V;q[ve]&&!(ve>=ae);)++ve;if(ve-V>16&&q.buffer&&Pn)return Pn.decode(q.subarray(V,ve));for(var me="";V>10,56320|Ye&1023)}}return me},Hi=(q,V)=>q?ln($,q,V):"",qo=(q,V)=>{V=xt(V);var re=V==="std::string";Et(q,{name:V,fromWireType(ae){var ve=P[ae>>2],me=ae+4,Se;if(re)for(var Ae=me,Be=0;Be<=ve;++Be){var Ye=me+Be;if(Be==ve||$[Ye]==0){var st=Ye-Ae,Lt=Hi(Ae,st);Se===void 0?Se=Lt:(Se+="\0",Se+=Lt),Ae=Ye+1}}else{for(var wr=new Array(ve),Be=0;Be>2]=me,re&&Se)pn(ve,Be,me+1);else if(Se)for(var Ye=0;Ye255&&(fc(Be),He("String has UTF-16 code units that do not fit in 8 bits")),$[Be+Ye]=st}else for(var Ye=0;Ye{for(var re=q,ae=re>>1,ve=ae+V/2;!(ae>=ve)&&ce[ae];)++ae;if(re=ae<<1,re-q>32&&qs)return qs.decode($.subarray(q,re));for(var me="",Se=0;!(Se>=V/2);++Se){var Ae=ie[q+Se*2>>1];if(Ae==0)break;me+=String.fromCharCode(Ae)}return me},$h=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<2)return 0;re-=2;for(var ve=V,me=re>1]=Ae,V+=2}return ie[V>>1]=0,V-ve},ff=q=>q.length*2,fi=(q,V)=>{for(var re=0,ae="";!(re>=V/4);){var ve=K[q+re*4>>2];if(ve==0)break;if(++re,ve>=65536){var me=ve-65536;ae+=String.fromCharCode(55296|me>>10,56320|me&1023)}else ae+=String.fromCharCode(ve)}return ae},RE=(q,V,re)=>{var ae;if((ae=re)!==null&&ae!==void 0||(re=2147483647),re<4)return 0;for(var ve=V,me=ve+re-4,Se=0;Se=55296&&Ae<=57343){var Be=q.charCodeAt(++Se);Ae=65536+((Ae&1023)<<10)|Be&1023}if(K[V>>2]=Ae,V+=4,V+4>me)break}return K[V>>2]=0,V-ve},ho=q=>{for(var V=0,re=0;re=55296&&ae<=57343&&++re,V+=4}return V},OE=(q,V,re)=>{re=xt(re);var ae,ve,me,Se;V===2?(ae=ba,ve=$h,Se=ff,me=Ae=>ce[Ae>>1]):V===4&&(ae=fi,ve=RE,Se=ho,me=Ae=>P[Ae>>2]),Et(q,{name:re,fromWireType:Ae=>{for(var Be=P[Ae>>2],Ye,st=Ae+4,Lt=0;Lt<=Be;++Lt){var wr=Ae+4+Lt*V;if(Lt==Be||me(wr)==0){var Gt=wr-st,dr=ae(st,Gt);Ye===void 0?Ye=dr:(Ye+="\0",Ye+=dr),st=wr+V}}return fc(Ae),Ye},toWireType:(Ae,Be)=>{typeof Be!="string"&&He(`Cannot pass non-string to C++ string type ${re}`);var Ye=Se(Be),st=zh(4+Ye+V);return P[st>>2]=Ye/V,ve(Be,st+4,Ye+V),Ae!==null&&Ae.push(fc,st),st},argPackAdvance:ct,readValueFromPointer:ir,destructorFunction(Ae){fc(Ae)}})},zx=(q,V,re,ae,ve,me)=>{wt[q]={name:xt(V),rawConstructor:xn(re,ae),rawDestructor:xn(ve,me),fields:[]}},el=(q,V,re,ae,ve,me,Se,Ae,Be,Ye)=>{wt[q].fields.push({fieldName:xt(V),getterReturnType:re,getter:xn(ae,ve),getterContext:me,setterArgumentType:Se,setter:xn(Ae,Be),setterContext:Ye})},u1=(q,V)=>{V=xt(V),Et(q,{isVoid:!0,name:V,argPackAdvance:0,fromWireType:()=>{},toWireType:(re,ae)=>{}})},Hy=(q,V,re)=>$.copyWithin(q,V,V+re),fn=[],tl=(q,V,re,ae)=>(q=fn[q],V=uo.toValue(V),q(null,V,re,ae)),Gy={},DE=q=>{var V=Gy[q];return V===void 0?xt(q):V},d1=()=>{if(typeof globalThis=="object")return globalThis;function q(V){V.$$$embind_global$$$=V;var re=typeof $$$embind_global$$$=="object"&&V.$$$embind_global$$$==V;return re||delete V.$$$embind_global$$$,re}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&q(global)?$$$embind_global$$$=global:typeof self=="object"&&q(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},NE=q=>q===0?uo.toHandle(d1()):(q=DE(q),uo.toHandle(d1()[q])),BE=q=>{var V=fn.length;return fn.push(q),V},LE=(q,V)=>{for(var re=new Array(q),ae=0;ae>2],"parameter "+ae);return re},Hx=Reflect.construct,h1=(q,V,re)=>{var ae=[],ve=q.toWireType(ae,re);return ae.length&&(P[V>>2]=uo.toHandle(ae)),ve},Lu=(q,V,re)=>{var ae=LE(q,V),ve=ae.shift();q--;var me=new Array(q),Se=(Be,Ye,st,Lt)=>{for(var wr=0,Gt=0;GtBe.name).join(", ")}) => ${ve.name}>`;return BE(zi(Ae,Se))},FE=q=>{q>9&&($o[q+1]+=1)},Gx=q=>{var V=uo.toValue(q);lr(V),cf(q)},Wx=(q,V)=>{q=Hr(q,"_emval_take_value");var re=q.readValueFromPointer(V);return uo.toHandle(re)},Wy=(q,V,re,ae)=>{var ve=new Date().getFullYear(),me=new Date(ve,0,1),Se=new Date(ve,6,1),Ae=me.getTimezoneOffset(),Be=Se.getTimezoneOffset(),Ye=Math.max(Ae,Be);P[q>>2]=Ye*60,K[V>>2]=+(Ae!=Be);var st=Gt=>{var dr=Gt>=0?"-":"+",Qn=Math.abs(Gt),$n=String(Math.floor(Qn/60)).padStart(2,"0"),kn=String(Qn%60).padStart(2,"0");return`UTC${dr}${$n}${kn}`},Lt=st(Ae),wr=st(Be);Be2147483648,Kx=(q,V)=>Math.ceil(q/V)*V,jE=q=>{var V=F.buffer,re=(q-V.byteLength+65535)/65536|0;try{return F.grow(re),m(),1}catch{}},Yy=q=>{var V=$.length;q>>>=0;var re=Ky();if(q>re)return!1;for(var ae=1;ae<=4;ae*=2){var ve=V*(1+.2/ae);ve=Math.min(ve,q+100663296);var me=Math.min(re,Kx(Math.max(q,ve),65536)),Se=jE(me);if(Se)return!0}return!1},qh={},UE=()=>p||"./this.program",Fu=()=>{if(!Fu.strings){var q=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",V={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:q,_:UE()};for(var re in qh)qh[re]===void 0?delete V[re]:V[re]=qh[re];var ae=[];for(var re in V)ae.push(`${re}=${V[re]}`);Fu.strings=ae}return Fu.strings},Vs=(q,V)=>{for(var re=0;re{var re=0;return Fu().forEach((ae,ve)=>{var me=V+re;P[q+ve*4>>2]=me,Vs(ae,me),re+=ae.length+1}),0},Vh=(q,V)=>{var re=Fu();P[q>>2]=re.length;var ae=0;return re.forEach(ve=>ae+=ve.length+1),P[V>>2]=ae,0},Yx=q=>52;function Qx(q,V,re,ae,ve){return 70}var $E=[null,[],[]],qE=(q,V)=>{var re=$E[q];V===0||V===10?((q===1?S:O)(ln(re)),re.length=0):re.push(V)},VE=(q,V,re,ae)=>{for(var ve=0,me=0;me>2],Ae=P[V+4>>2];V+=8;for(var Be=0;Be>2]=ve,0},zE=q=>q;dt=i.InternalError=class extends Error{constructor(q){super(q),this.name="InternalError"}},zt(),Nt=i.BindingError=class extends Error{constructor(q){super(q),this.name="BindingError"}},lo(),n1(),Lh=i.UnboundTypeError=o1(Error,"UnboundTypeError"),Bu();var HE={t:it,x:We,a:bt,j:tt,k:_t,O:Ct,q:It,ga:er,d:pt,ca:ur,va:ut,ba:Vt,pa:Ht,ta:a1,sa:lc,E:l1,oa:lf,F:zy,n:Kr,W:qe,X:gt,y:rr,u:hn,ua:Er,V:qo,P:OE,L:zx,wa:el,qa:u1,ja:Hy,T:tl,xa:cf,ya:NE,U:Lu,Y:FE,Z:Gx,ra:Wx,da:Wy,ha:Yy,ea:Qy,fa:Vh,ia:Yx,$:Qx,S:VE,J:g1,C:ZE,Q:ju,R:rl,r:p1,b:GE,D:v1,la:y1,c:Oe,ka:XE,h:YE,i:Lr,s:Yn,N:Uu,w:Xy,I:tC,K:JE,z:r2,H:b1,aa:w1,_:i2,l:Pe,f:be,e:KE,g:WE,M:m1,m:Zt,ma:Gr,p:nn,v:QE,na:vo,B:eC,o:mt,G:n2,A:zE},Yr=Xe(),Jx=q=>(Jx=Yr.Ba)(q),fc=i._free=q=>(fc=i._free=Yr.Ca)(q),zh=i._malloc=q=>(zh=i._malloc=Yr.Ea)(q),Jy=q=>(Jy=Yr.Fa)(q),nr=(q,V)=>(nr=Yr.Ga)(q,V),Hh=q=>(Hh=Yr.Ha)(q),Zx=q=>(Zx=Yr.Ia)(q),Xx=()=>(Xx=Yr.Ja)(),e2=q=>(e2=Yr.Ka)(q),uf=q=>(uf=Yr.La)(q),po=(q,V,re)=>(po=Yr.Ma)(q,V,re);i.dynCall_viijii=(q,V,re,ae,ve,me,Se)=>(i.dynCall_viijii=Yr.Na)(q,V,re,ae,ve,me,Se);var Zy=i.dynCall_jiii=(q,V,re,ae)=>(Zy=i.dynCall_jiii=Yr.Oa)(q,V,re,ae);i.dynCall_jiji=(q,V,re,ae,ve)=>(i.dynCall_jiji=Yr.Pa)(q,V,re,ae,ve);var t2=i.dynCall_jiiii=(q,V,re,ae,ve)=>(t2=i.dynCall_jiiii=Yr.Qa)(q,V,re,ae,ve);i.dynCall_iiiiij=(q,V,re,ae,ve,me,Se)=>(i.dynCall_iiiiij=Yr.Ra)(q,V,re,ae,ve,me,Se),i.dynCall_iiiiijj=(q,V,re,ae,ve,me,Se,Ae,Be)=>(i.dynCall_iiiiijj=Yr.Sa)(q,V,re,ae,ve,me,Se,Ae,Be),i.dynCall_iiiiiijj=(q,V,re,ae,ve,me,Se,Ae,Be,Ye)=>(i.dynCall_iiiiiijj=Yr.Ta)(q,V,re,ae,ve,me,Se,Ae,Be,Ye);function GE(q,V){var re=Ne();try{return gr(q)(V)}catch(ae){if(ke(re),ae!==ae+0)throw ae;nr(1,0)}}function WE(q,V,re,ae){var ve=Ne();try{gr(q)(V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function KE(q,V,re){var ae=Ne();try{gr(q)(V,re)}catch(ve){if(ke(ae),ve!==ve+0)throw ve;nr(1,0)}}function YE(q,V,re,ae){var ve=Ne();try{return gr(q)(V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function ju(q,V,re,ae,ve){var me=Ne();try{return gr(q)(V,re,ae,ve)}catch(Se){if(ke(me),Se!==Se+0)throw Se;nr(1,0)}}function be(q,V){var re=Ne();try{gr(q)(V)}catch(ae){if(ke(re),ae!==ae+0)throw ae;nr(1,0)}}function Oe(q,V,re){var ae=Ne();try{return gr(q)(V,re)}catch(ve){if(ke(ae),ve!==ve+0)throw ve;nr(1,0)}}function Pe(q){var V=Ne();try{gr(q)()}catch(re){if(ke(V),re!==re+0)throw re;nr(1,0)}}function mt(q,V,re,ae,ve,me,Se,Ae,Be,Ye,st){var Lt=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae,Be,Ye,st)}catch(wr){if(ke(Lt),wr!==wr+0)throw wr;nr(1,0)}}function Zt(q,V,re,ae,ve){var me=Ne();try{gr(q)(V,re,ae,ve)}catch(Se){if(ke(me),Se!==Se+0)throw Se;nr(1,0)}}function Lr(q,V,re,ae,ve){var me=Ne();try{return gr(q)(V,re,ae,ve)}catch(Se){if(ke(me),Se!==Se+0)throw Se;nr(1,0)}}function Yn(q,V,re,ae,ve,me){var Se=Ne();try{return gr(q)(V,re,ae,ve,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function nn(q,V,re,ae,ve,me){var Se=Ne();try{gr(q)(V,re,ae,ve,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function Xy(q,V,re,ae,ve,me,Se){var Ae=Ne();try{return gr(q)(V,re,ae,ve,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;nr(1,0)}}function QE(q,V,re,ae,ve,me,Se,Ae){var Be=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;nr(1,0)}}function vo(q,V,re,ae,ve,me,Se,Ae,Be){var Ye=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae,Be)}catch(st){if(ke(Ye),st!==st+0)throw st;nr(1,0)}}function p1(q){var V=Ne();try{return gr(q)()}catch(re){if(ke(V),re!==re+0)throw re;nr(1,0)}}function JE(q,V,re,ae,ve,me,Se,Ae,Be){var Ye=Ne();try{return gr(q)(V,re,ae,ve,me,Se,Ae,Be)}catch(st){if(ke(Ye),st!==st+0)throw st;nr(1,0)}}function Uu(q,V,re,ae,ve,me,Se){var Ae=Ne();try{return gr(q)(V,re,ae,ve,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;nr(1,0)}}function v1(q,V,re,ae){var ve=Ne();try{return gr(q)(V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function g1(q,V,re,ae){var ve=Ne();try{return gr(q)(V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function Gr(q,V,re,ae,ve,me,Se,Ae){var Be=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;nr(1,0)}}function ZE(q,V,re,ae,ve,me){var Se=Ne();try{return gr(q)(V,re,ae,ve,me)}catch(Ae){if(ke(Se),Ae!==Ae+0)throw Ae;nr(1,0)}}function r2(q,V,re,ae,ve,me,Se,Ae,Be,Ye){var st=Ne();try{return gr(q)(V,re,ae,ve,me,Se,Ae,Be,Ye)}catch(Lt){if(ke(st),Lt!==Lt+0)throw Lt;nr(1,0)}}function y1(q,V,re){var ae=Ne();try{return gr(q)(V,re)}catch(ve){if(ke(ae),ve!==ve+0)throw ve;nr(1,0)}}function XE(q,V,re,ae,ve){var me=Ne();try{return gr(q)(V,re,ae,ve)}catch(Se){if(ke(me),Se!==Se+0)throw Se;nr(1,0)}}function eC(q,V,re,ae,ve,me,Se,Ae,Be,Ye){var st=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae,Be,Ye)}catch(Lt){if(ke(st),Lt!==Lt+0)throw Lt;nr(1,0)}}function tC(q,V,re,ae,ve,me,Se,Ae){var Be=Ne();try{return gr(q)(V,re,ae,ve,me,Se,Ae)}catch(Ye){if(ke(Be),Ye!==Ye+0)throw Ye;nr(1,0)}}function m1(q,V,re,ae,ve,me,Se){var Ae=Ne();try{gr(q)(V,re,ae,ve,me,Se)}catch(Be){if(ke(Ae),Be!==Be+0)throw Be;nr(1,0)}}function rl(q,V,re,ae){var ve=Ne();try{return gr(q)(V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function b1(q,V,re,ae,ve,me,Se,Ae,Be,Ye,st,Lt){var wr=Ne();try{return gr(q)(V,re,ae,ve,me,Se,Ae,Be,Ye,st,Lt)}catch(Gt){if(ke(wr),Gt!==Gt+0)throw Gt;nr(1,0)}}function n2(q,V,re,ae,ve,me,Se,Ae,Be,Ye,st,Lt,wr,Gt,dr,Qn){var $n=Ne();try{gr(q)(V,re,ae,ve,me,Se,Ae,Be,Ye,st,Lt,wr,Gt,dr,Qn)}catch(kn){if(ke($n),kn!==kn+0)throw kn;nr(1,0)}}function w1(q,V,re,ae){var ve=Ne();try{return Zy(q,V,re,ae)}catch(me){if(ke(ve),me!==me+0)throw me;nr(1,0)}}function i2(q,V,re,ae,ve){var me=Ne();try{return t2(q,V,re,ae,ve)}catch(Se){if(ke(me),Se!==Se+0)throw Se;nr(1,0)}}var Gh,Wh;X=function q(){Gh||em(),Gh||(X=q)};function em(){if(j>0||!Wh&&(Wh=1,x(),j>0))return;function q(){var V;Gh||(Gh=1,i.calledRun=1,!z&&(w(),s(i),(V=i.onRuntimeInitialized)===null||V===void 0||V.call(i),T()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),q()},1)):q()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return em(),n=a,n}})();function Eje(t){return WM(KM,t)}async function Cje(t,e){return wje(KM,t,e)}async function Aje(t,e){return xje(KM,t,e)}const Jte=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],Sje=[...Jte,["unknown"]].map(t=>t[0]),AI=new Map(Jte);function _je(t){for(const[e,r]of AI)if(t===r)return e;return"unknown"}function Ije(t){if(Zte(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Xte(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(ere(t))return{width:t.videoWidth,height:t.videoHeight};if(rre(t))return{width:t.width,height:t.height};if(ire(t))return{width:t.displayWidth,height:t.displayHeight};if(tre(t))return{width:t.width,height:t.height};if(nre(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Zte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLImageElement)}catch{return!1}}function Xte(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.SVGImageElement)}catch{return!1}}function ere(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLVideoElement)}catch{return!1}}function tre(t){var e,r;try{return t instanceof((r=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:r.HTMLCanvasElement)}catch{return!1}}function rre(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function nre(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function ire(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function sre(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function Tje(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function Pje(t,e){try{const r=new OffscreenCanvas(t,e);if(r.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return r;throw void 0}catch{const r=document.createElement("canvas");return r.width=t,r.height=e,r}}async function ore(t){if(Zte(t)&&!await Oje(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Xte(t)&&!await Dje(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ire(t)&&Nje(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ere(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(rre(t)&&Lje(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:r}=Ije(t);if(e===0||r===0)return null;const n=Pje(e,r).getContext("2d");n.drawImage(t,0,0);try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function kje(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let r="";try{r=URL.createObjectURL(t),e.src=r,await e.decode()}finally{URL.revokeObjectURL(r)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ore(e)}function Mje(t){const{width:e,height:r}=t;if(e===0||r===0)return null;const n=t.getContext("2d");try{return n.getImageData(0,0,e,r)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Rje(t){if(sre(t))return await kje(t);if(Tje(t)){if(Bje(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return tre(t)||nre(t)?Mje(t):await ore(t)}async function Oje(t){try{return await t.decode(),!0}catch{return!1}}async function Dje(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function Nje(t){return t.format===null}function Bje(t){return t.data.buffer.byteLength===0}function Lje(t){return t.width===0&&t.height===0}function N$(t,e){return Fje(t)?new DOMException(`${e}: ${t.message}`,t.name):jje(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Fje(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function jje(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var N3;class SI extends EventTarget{constructor(e={}){var r;super(),lje(this,N3);try{const n=(r=e==null?void 0:e.formats)==null?void 0:r.filter(i=>i!=="unknown");if((n==null?void 0:n.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const i of n??[])if(!AI.has(i))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${i}' is not a valid enum value of type BarcodeFormat.`);fje(this,N3,n??[]),Eje().then(i=>{this.dispatchEvent(new CustomEvent("load",{detail:i}))}).catch(i=>{this.dispatchEvent(new CustomEvent("error",{detail:i}))})}catch(n){throw N$(n,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Sje.filter(e=>e!=="unknown")}async detect(e){try{const r=await Rje(e);if(r===null)return[];let n;const i={tryHarder:!0,returnCodabarStartEnd:!0,formats:cje(this,N3).map(s=>AI.get(s))};try{sre(r)?n=await Cje(r,i):n=await Aje(r,i)}catch(s){throw console.error(s),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return n.map(s=>{const{topLeft:{x:o,y:a},topRight:{x:c,y:l},bottomLeft:{x:f,y:u},bottomRight:{x:p,y:g}}=s.position,y=Math.min(o,c,f,p),b=Math.min(a,l,u,g),I=Math.max(o,c,f,p),C=Math.max(a,l,u,g);return{boundingBox:new DOMRectReadOnly(y,b,I-y,C-b),rawValue:s.text,format:_je(s.format),cornerPoints:[{x:o,y:a},{x:c,y:l},{x:p,y:g},{x:f,y:u}]}})}catch(r){throw N$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}N3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=SI);function Uje(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function $je(t){const{onClick:e,disabled:r,className:n}=t,i={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return qt.createElement("svg",{onClick:r?void 0:e,className:n,style:i,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),qt.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function qje(t){const{scanning:e,startScanning:r,stopScanning:n}=t,[i,s]=D.useState(!1);function o(){s(!0),e?n():r(),setTimeout(()=>s(!1),1e3)}return qt.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:i?"default":"pointer"}},e?qt.createElement(Uje,{disabled:i,onClick:o}):qt.createElement($je,{disabled:i,onClick:o}))}function Vje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function zje(t){const{onClick:e,className:r,style:n}=t;return qt.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:n,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function Hje(t){const{status:e,scanning:r,torchToggle:n}=t;function i(s){n(s)}return r&&n?qt.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?qt.createElement(zje,{onClick:()=>i(!1)}):qt.createElement(Vje,{onClick:()=>i(!0)})):null}function Gje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function Wje(t){const{onClick:e,className:r,disabled:n=!1}=t,i={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",fill:n?"grey":"yellow",...t.style};return qt.createElement("svg",{onClick:n?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:r,style:i,xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function Kje(t){const{scanning:e,capabilities:r,onZoom:n,value:i}=t;if(!e||!n)return null;const s=(r.max-r.min)/3;return qt.createElement(D.Fragment,null,qt.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Wje,{disabled:i<=r.min,onClick:function(){n(Math.max(i-s,r.min))}})),qt.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},qt.createElement(Gje,{disabled:i>=r.max,onClick:function(){n(Math.min(i+s,r.max))}})))}function Yje(t){const{scanning:e,loading:r,capabilities:n,border:i=35,onOff:s,torch:o,zoom:a,startScanning:c,stopScanning:l}=t,f="rgba(255, 0, 0, 0.5)";return qt.createElement("div",{style:{position:"relative"}},qt.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${i>=35?i:35}px solid rgba(0, 0, 0, 0.2)`}},r&&qt.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",qt.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),qt.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:f,strokeWidth:3}),qt.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:f,strokeWidth:3})),s&&qt.createElement(qje,{scanning:e,startScanning:c,stopScanning:l}),o&&n.torch&&qt.createElement(Hje,{scanning:e,status:o.status,torchToggle:o.toggle}),a&&n.zoom&&qt.createElement(Kje,{scanning:e,capabilities:n.zoom,value:a.value,onZoom:a.onChange}))}const Qje={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},Jje={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},Zje={width:"100%",height:"100%",position:"relative"},Xje={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var eUe=function(t){let e,r=!1;return(...n)=>(r||(e=t(n),r=!0),e)}(()=>{const t=OFe(window);switch(t.browser){case"chrome":zFe(window,t);break;case"firefox":KFe(window,t);break;case"safari":ZFe(window,t);break;default:throw new Error("Unsupported browser")}});const tUe="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var lb=t=>t instanceof Date,are=t=>t==null;const cre=t=>typeof t=="object";var B$=t=>!are(t)&&!Array.isArray(t)&&cre(t)&&!lb(t),L$=t=>are(t)||!cre(t);function lre(t,e){if(L$(t)||L$(e))return t===e;if(lb(t)&&lb(e))return t.getTime()===e.getTime();const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r){const s=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=e[i];if(lb(s)&&lb(o)||B$(s)&&B$(o)||Array.isArray(s)&&Array.isArray(o)?!lre(s,o):s!==o)return!1}}return!0}function O6(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function rUe(t){var e;const{onScan:r,constraints:n,formats:i=["qr_code"],paused:s=!1,components:o,children:a,styles:c,classNames:l,allowMultiple:f,scanDelay:u,onError:p}=t,g=D.useRef(null),y=D.useRef(null),b=D.useRef(null),I=D.useMemo(()=>({...Qje,...n}),[n]),C=D.useMemo(()=>({...Jje,...o}),[o]),[S,O]=D.useState(!1),[L,F]=D.useState(!0),[z,_]=D.useState(I),$=function(){const v=D.useRef(Promise.resolve({type:"stop",data:{}})),m=D.useRef(null),R=D.useRef(null),[B,E]=D.useState({}),[x,w]=D.useState({}),T=D.useCallback(async(X,G)=>{var Z,ee,N;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Z=navigator==null?void 0:navigator.mediaDevices)===null||Z===void 0?void 0:Z.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");eUe();const te=await navigator.mediaDevices.getUserMedia({audio:!1,video:G});X.srcObject!==void 0?X.srcObject=te:X.mozSrcObject!==void 0?X.mozSrcObject=te:window.URL.createObjectURL?X.src=window.URL.createObjectURL(te):window.webkitURL?X.src=window.webkitURL.createObjectURL(te):X.src=te.id,await Promise.race([X.play(),new Promise(Ee=>setTimeout(Ee,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Ee=>setTimeout(Ee,500));const[fe]=te.getVideoTracks();return w(fe.getSettings()),E((N=(ee=fe==null?void 0:fe.getCapabilities)===null||ee===void 0?void 0:ee.call(fe))!==null&&N!==void 0?N:{}),m.current=te,R.current=fe,{type:"start",data:{videoEl:X,stream:te,constraints:G}}},[]),k=D.useCallback(async(X,G)=>{X.src="",X.srcObject=null,X.load();for(const Z of G.getTracks())G.removeTrack(Z),Z.stop();return m.current=null,R.current=null,w({}),{type:"stop",data:{}}},[]),H=D.useCallback(async(X,{constraints:G,restart:Z=!1})=>{if(v.current=v.current.then(ee=>{if(ee.type==="start"){const{data:{videoEl:N,stream:te,constraints:fe}}=ee;return Z||X!==N||G!==fe?k(N,te).then(()=>T(X,G)):ee}return T(X,G)}),(await v.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[T,k]),oe=D.useCallback(async()=>{if(v.current=v.current.then(X=>{if(X.type==="stop")return X;const{data:{videoEl:G,stream:Z}}=X;return k(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[k]),j=D.useCallback(async X=>{const G=R.current;if(!G)throw new Error("No active video track found.");{X.advanced&&X.advanced[0].zoom&&G.getCapabilities().torch&&await G.applyConstraints({advanced:[{torch:!1}]}),await G.applyConstraints(X);const Z=G.getCapabilities(),ee=G.getSettings();E(Z),w(ee)}},[]);return D.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:B,settings:x,startCamera:H,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:ce}=function(v){const{videoElementRef:m,onScan:R,onFound:B,retryDelay:E=100,scanDelay:x=0,formats:w=[],audio:T=!0,allowMultiple:k=!1}=v,H=D.useRef(new SI({formats:w})),oe=D.useRef(null),j=D.useRef(null);D.useEffect(()=>{H.current=new SI({formats:w})},[w]),D.useEffect(()=>{typeof window<"u"&&T&&(oe.current=new Audio(tUe))},[T]);const X=D.useCallback(G=>async Z=>{if(m.current!==null&&m.current.readyState>1){const{lastScan:ee,contentBefore:N,lastScanHadContent:te}=G;if(Z-ee!N.includes(De.rawValue)),_e=fe.length>0;let Re=G.lastOnScan;(Ee||k&&_e&&Z-Re>=x)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(De=>console.error("Error playing the sound",De)),Re=Z,R(fe)),_e&&B(fe),!_e&&te&&B(fe);const Te={lastScan:Z,lastOnScan:Re,lastScanHadContent:_e,contentBefore:Ee?fe.map(De=>De.rawValue):N};j.current=window.requestAnimationFrame(X(Te))}}},[m.current,R,B,E]);return{startScanning:D.useCallback(()=>{const G=performance.now(),Z={lastScan:G,lastOnScan:G,contentBefore:[],lastScanHadContent:!1};j.current=window.requestAnimationFrame(X(Z))},[X]),stopScanning:D.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null)},[])}}({videoElementRef:g,onScan:r,onFound:v=>function(m,R,B,E){const x=B;if(x==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=R;if(w==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(m.length===0||E===void 0)O6(x);else{const T=w.offsetWidth,k=w.offsetHeight,H=w.videoWidth,oe=w.videoHeight,j=Math.max(T/H,k/oe),X=H*j,G=oe*j,Z=X/H,ee=G/oe,N=(T-X)/2,te=(k-G)/2,fe=({x:Te,y:De})=>({x:Math.floor(Te*Z),y:Math.floor(De*ee)}),Ee=({x:Te,y:De})=>({x:Math.floor(Te+N),y:Math.floor(De+te)}),_e=m.map(Te=>{const{boundingBox:De,cornerPoints:ze}=Te,{x:Xe,y:Qe}=Ee(fe({x:De.x,y:De.y})),{x:ke,y:Ne}=fe({x:De.width,y:De.height});return{...Te,cornerPoints:ze.map(et=>Ee(fe(et))),boundingBox:DOMRectReadOnly.fromRect({x:Xe,y:Qe,width:ke,height:Ne})}});x.width=w.offsetWidth,x.height=w.offsetHeight;const Re=x.getContext("2d");if(Re===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");E(_e,Re)}}(v,g.current,b.current,C.tracker),formats:i,audio:C.audio,allowMultiple:f,retryDelay:C.tracker===void 0?500:10,scanDelay:u});D.useEffect(()=>(O(!0),()=>{O(!1)}),[]),D.useEffect(()=>{S&&(ce(),ie())},[o==null?void 0:o.tracker]),D.useEffect(()=>{if(!lre(I,z)){const v=I;n!=null&&n.deviceId&&delete v.facingMode,_(v)}},[n]);const K=D.useMemo(()=>({constraints:z,shouldStream:S&&!s}),[z,S,s]),P=async()=>{const v=g.current;if(v==null)throw new Error("Video should be defined when component is mounted.");const m=y.current;if(m==null)throw new Error("Canvas should be defined when component is mounted.");const R=m.getContext("2d");if(R==null)throw new Error("Canvas should be defined when component is mounted.");if(K.shouldStream){await $.stopCamera(),F(!1);try{await $.startCamera(v,K),v?F(!0):await $.stopCamera()}catch(B){p==null||p(B),console.error("error",B)}}else m.width=v.videoWidth,m.height=v.videoHeight,R.drawImage(v,0,0,v.videoWidth,v.videoHeight),await $.stopCamera(),F(!1)};D.useEffect(()=>{(async()=>await P())()},[K]);const M=D.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return D.useEffect(()=>{if(M){if(y.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(O6(y.current),b.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(O6(b.current),g.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");ie()}},[M]),qt.createElement("div",{style:{...Zje,...c==null?void 0:c.container},className:l==null?void 0:l.container},qt.createElement("video",{ref:g,style:{...Xje,...c==null?void 0:c.video,visibility:s?"hidden":"visible"},className:l==null?void 0:l.video,autoPlay:!0,muted:!0,playsInline:!0}),qt.createElement("canvas",{ref:y,style:{display:s?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),qt.createElement("canvas",{ref:b,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),qt.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},C.finder&&qt.createElement(Yje,{scanning:L,capabilities:$.capabilities,loading:!1,onOff:C.onOff,zoom:C.zoom&&$.settings.zoom?{value:$.settings.zoom,onChange:async v=>{const m={...z,advanced:[{zoom:v}]};await $.updateConstraints(m)}}:void 0,torch:C.torch?{status:(e=$.settings.torch)!==null&&e!==void 0&&e,toggle:async v=>{const m={...z,advanced:[{torch:v}]};await $.updateConstraints(m)}}:void 0,startScanning:async()=>await P(),stopScanning:async()=>{await $.stopCamera(),O6(b.current),F(!1)},border:c==null?void 0:c.finderBorder}),a))}function nUe({onQrUri:t}){const e=Pr(kE),[r,n]=D.useState(""),i=async()=>{if(r){console.log(r);try{await e.pair(r)}catch(s){console.error(s),t(!1)}}t(!0)};return W.jsxs(xe,{flexDirection:"column",justifyContent:"space-between",padding:"12",gap:"3",children:[W.jsx(rUe,{onScan:s=>{s[0].rawValue&&n(s[0].rawValue)},styles:{video:{transform:"scaleX(-1)",borderRadius:"10px"}}}),W.jsxs(xe,{children:[W.jsx(Wn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(xe,{justifyContent:"flex-end",children:W.jsx(Xt,{marginTop:"4",variant:"primary",size:"md",shape:"square",label:"Connect Dapp",disabled:!r,onClick:()=>{r&&i()}})})]})]})}const fre=t=>({info:{walletId:"",uuid:"",name:"WalletConnect",icon:"https://avatars.githubusercontent.com/u/37784886"},provider:t});function iUe(){var _e,Re;const t=Bte(),e=Pr(ai),r=Pr(Ix),n=Pr(Xr),i=Pr(kE),s=yn(e.accountAddress),o=yn(n.isSigningTxn),a=yn(n.isSigningMsg),c=yn(i.allSessions),l=c8(),f=HP("isMobile"),u=uFe();D.useEffect(()=>{if(u&&u.connected&&!n.selectedExternalProvider.get()){let Te=fre(u),De=n.availableExternalProviders.get();De?n.availableExternalProviders.set([Te,...De]):n.availableExternalProviders.set([Te])}},[u]),D.useEffect(()=>{t.length>0&&n.availableExternalProviders.set(t)},[t]);const p=yn(n.selectedExternalProvider),g=yn(n.selectedExternalWalletAddress),y=yn(n.isSendingTokenTransaction),b=yn(n.isSendingCollectibleTransaction),I=yn(n.isSendingSignedTokenTransaction),C=Pr(Bn),[S,O]=D.useState(!0),[L,F]=D.useState(void 0),[z,_]=D.useState(void 0),[$,ie]=D.useState(!1),[ce,K]=D.useState(!1),[P,M]=D.useState(!1),[v,m]=D.useState(!1),[R,B]=D.useState(!1),[E,x]=D.useState(!1),[w,T]=D.useState(!1),k=yn(n.signClientWarningType),H=Te=>{_(void 0),n.isSendingCollectibleTransaction.set(void 0),F(Te),B(!0)},oe=Te=>{F(void 0),n.isSendingTokenTransaction.set(void 0),_(Te),x(!0)},j=async(Te=!1)=>{(p===void 0||Te)&&M(!0)},X=async()=>{n.setExternalProvider(void 0);const Te=p;(Te==null?void 0:Te.info.name)==="WalletConnect"&&Te.provider.disconnect()},G=async(Te,De)=>{if(!n.selectedExternalProvider.get()){console.warn("No external provider selected");return}var ze;let Xe;try{if(L)ze=L.chainId,Xe=await n.sendToken(L,Te,De);else if(z)ze=z.collectibleInfoParams.chainId,Xe=await n.sendCollectible(z,Te,De);else{console.warn("No pending send found");return}}catch(Ne){Ne.code===4001&&l({variant:"error",title:"User denied transaction signature."}),console.error(Ne);return}const Qe=C.providerForChainId(ze),ke=await I$(Qe,Xe.hash);ke&&l({variant:"success",title:"Transaction confirmed",description:"You can view the transaction details on your connected external wallet"}),L&&r.updateTokenBalance(L),F(void 0),_(void 0),n.isSendingTokenTransaction.set(void 0),n.isSendingCollectibleTransaction.set(void 0),console.log("receipt",ke)},Z=async(Te,De)=>{const ze=C.providerForChainId(De);await I$(ze,Te)&&(n.isSendingSignedTokenTransaction.set(void 0),l({variant:"success",title:"Sign transaction confirmed",description:"You can view the transaction details on your connected external wallet"}))},ee=()=>{i.rejectRequest(),n.toSignPermission.set("cancelled")};async function N(Te){var ke;const De=async(Ne,et,Je)=>{try{const it=await n.getExternalProviderAddress(ze);if(!it)throw new Error("No provider address found");return console.log("sendTransaction chainId",et),await n.sendTransaction(Xe,ze,it,Ne,et)}catch(it){throw n.isSendingSignedTokenTransaction.set(void 0),it}},ze=(ke=n.selectedExternalProvider.get())==null?void 0:ke.provider,Xe=e.account;let Qe;if(Te)try{n.isSendingSignedTokenTransaction.set(Te),Qe=await De(Te.txn,Te.chainId,Te.options),Z(Qe.hash,Te.chainId),n.toSignResult.set(Qe),n.toSignPermission.set("approved")}catch(Ne){throw n.isSendingSignedTokenTransaction.set(void 0),ee(),Ne}}async function te(Te){const De=async(Qe,ke)=>{try{let Ne;if(Qe.message)console.log("signMessage chainId",Qe.chainId),Ne=await ze.signMessage(Qe.message,Qe.chainId,Qe.eip6492?"eip6492":"throw");else if(Qe.typedData){const et=Qe.typedData;Ne=await ze.signTypedData(et.domain,et.types,et.message,Qe.chainId,Qe.eip6492?"eip6492":"throw")}if(!Ne)throw new Error("Account sign method failed");return{hash:Ne}}catch(Ne){throw Ne}},ze=e.account;let Xe;if(Te)try{Xe=await De(Te.message),n.toSignResult.set(Xe),n.toSignPermission.set("approved")}catch(Qe){throw n.isSendingSignedTokenTransaction.set(void 0),ee(),Qe}}const fe=async()=>{var Te;((Te=n.selectedExternalProvider.get())==null?void 0:Te.info.name)==="WalletConnect"?n.signClientWarningType.set("isWalletConnect"):T(!0)},Ee=async()=>{m(!0)};return W.jsxs(W.Fragment,{children:[W.jsxs(xe,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(xe,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:dM,alt:"Sequence Logo",width:"40"}),W.jsxs(xe,{marginLeft:"auto",children:[W.jsx(Xt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>ie(!0)}),W.jsx(EFe,{onTokenListClick:()=>K(!0)})]})]}),W.jsxs(xe,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(Ge,{variant:"normal",fontWeight:"bold",color:"text100",children:s}),W.jsx(PFe,{sessionList:c}),W.jsx(Xt,{marginTop:"4",variant:"primary",size:"sm",shape:"square",label:"Connect to a Dapp with WalletConnect",leftIcon:Kpe,onClick:()=>{fe()}})]}),W.jsxs(qr,{alignItems:"center",flexDirection:"column",padding:"6",marginTop:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:p?"Your external wallet that will be used to relay transactions":"Connect an external wallet to relay transactions"}),p&&W.jsx(xe,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(xe,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(xe,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:p.info.icon,alt:p.info.name,style:{width:"20px",height:"20px"}}),W.jsx(Ge,{variant:"normal",color:"text100",children:p.info.name})]}),g&&W.jsxs(Ge,{variant:"normal",color:"text100",children:["(",g,")"]}),W.jsxs(xe,{flexDirection:"row",children:[W.jsx(Xt,{size:"xs",label:"Change external wallet",variant:"text",shape:"square",marginRight:"10",onClick:()=>j(!0)}),W.jsx(Xt,{size:"xs",label:"Disconnect",variant:"text",shape:"square",onClick:()=>X()})]})]})}),!p&&W.jsx(Xt,{label:"Connect",variant:"primary",size:"md",shape:"square",onClick:j})]}),y&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(oS,{symbol:((Re=(_e=y.tokenBalance)==null?void 0:_e.contractInfo)==null?void 0:Re.symbol)??"",chainId:y.tokenBalance.chainId,to:y.to,amount:y.amount})}),b&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(oS,{symbol:b.collectibleInfo.collectibleInfoResponse.name??"",chainId:b.collectibleInfo.collectibleInfoParams.chainId,to:b.to,amount:b.amount})}),I&&W.jsx(xe,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(oS,{symbol:"tokens",chainId:I.chainId,to:I.txn[0].to,amount:String(Number(I.txn[0].value))})}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(xe,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(Ge,{variant:"large",color:"text80",children:"Coins"}),W.jsx(xe,{marginLeft:"auto",children:W.jsx(swe,{label:"Filter zero balances",checked:S,onCheckedChange:O})})]}),W.jsx(IFe,{filterZeroBalances:S,onSendClick:H})]}),W.jsxs(xe,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(Ge,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(gFe,{onSendClick:oe})]})]})]}),$&&W.jsx(Ec,{onClose:()=>ie(!1),children:W.jsx(mFe,{})}),ce&&W.jsx(Ec,{onClose:()=>K(!1),children:W.jsx(CFe,{})}),P&&W.jsx(Ec,{size:"md",onClose:()=>M(!1),children:W.jsx(bFe,{onSelectProvider:async Te=>{var De,ze;Te&&(((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"&&await((ze=n.selectedExternalProvider.get())==null?void 0:ze.provider).disconnect(),n.setExternalProvider(Te)),M(!1)}})}),v&&W.jsx(Ec,{size:"md",onClose:()=>m(!1),children:W.jsx(TFe,{onClose:()=>m(!1)})}),w&&W.jsx(Ec,{size:"md",contentProps:{style:{width:f?"100%":"600px",height:f?"":"750px"}},onClose:()=>T(!1),children:W.jsx(nUe,{onQrUri:Te=>{Te&&Ee(),T(!1)}})}),o&&W.jsx(Ec,{isDismissible:!1,size:"md",contentProps:{style:{width:f?"100%":"800px",maxHeight:"100%",overflowY:"auto"}},children:W.jsx(MFe,{onClose:Te=>{var De;n.isSigningTxn.set(!1),Te?n.selectedExternalProvider.get()===void 0?(ee(),n.signClientWarningType.set("noProvider")):((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"?(ee(),n.signClientWarningType.set("isWalletConnect")):N(Te):ee()}})}),a&&W.jsx(Ec,{isDismissible:!1,size:"md",contentProps:{style:{width:f?"100%":"800px",maxHeight:"90%",overflowY:"auto"}},children:W.jsx(kFe,{onClose:Te=>{var De;n.isSigningMsg.set(!1),Te?n.selectedExternalProvider.get()===void 0?(ee(),n.signClientWarningType.set("noProvider")):((De=n.selectedExternalProvider.get())==null?void 0:De.info.name)==="WalletConnect"?(ee(),n.signClientWarningType.set("isWalletConnect")):te(Te):ee()}})}),k&&W.jsx(Ec,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(RFe,{warningType:k})}),R&&W.jsx(Ec,{size:"md",onClose:()=>B(!1),children:W.jsx(xFe,{tokenBalance:L,onClose:(Te,De)=>{B(!1),Te&&De&&G(Te,De)}})}),E&&W.jsx(Ec,{size:"md",onClose:()=>x(!1),children:W.jsx(wFe,{collectibleInfo:z,onClose:(Te,De)=>{x(!1),(Te&&(z==null?void 0:z.collectibleInfoParams.contractType)==="ERC721"||Te&&De)&&G(Te,De)}})})]})}const sUe=()=>{const t=Pr(ai),e=yn(t.accountAddress);return W.jsx(M2e,{basename:"/wallet-recovery-app",children:W.jsxs(A2e,{children:[W.jsx(X6,{path:"/",element:e?W.jsx(KA,{replace:!0,to:"/wallet"}):W.jsx(_9e,{})}),W.jsx(X6,{path:"recovery",element:e?W.jsx(KA,{replace:!0,to:"/wallet"}):W.jsx(P9e,{})}),W.jsx(X6,{path:"wallet",element:e?W.jsx(iUe,{}):W.jsx(KA,{replace:!0,to:"/"})})]})})},oUe=Nxe();D7.createRoot(document.getElementById("root")).render(W.jsx(qt.StrictMode,{children:W.jsx(Bxe,{store:oUe,children:W.jsx(Rme,{theme:"dark",children:W.jsx(Vwe,{children:W.jsx(sUe,{})})})})}));export{R9e as _}; diff --git a/index.html b/index.html index 6420be9..3ac3552 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Sequence Wallet Recovery - +