From 7966c31fcf52d9dfd2bd8a51860e26d005a11aa4 Mon Sep 17 00:00:00 2001 From: tolgahan-arikan Date: Wed, 6 Nov 2024 11:29:35 +0000 Subject: [PATCH] Build: (8dfe929) Use HashRouter instead of BrowserRouter (#14) --- .../{index-D1QftycB.js => index-BRLMF329.js} | 2 +- .../{index-CaDRg2eB.js => index-CMBogj9u.js} | 4 +- .../{index-Bm7klC1g.js => index-CskbwyY2.js} | 86 +++++++++---------- index.html | 2 +- 4 files changed, 47 insertions(+), 47 deletions(-) rename assets/{index-D1QftycB.js => index-BRLMF329.js} (99%) rename assets/{index-CaDRg2eB.js => index-CMBogj9u.js} (98%) rename assets/{index-Bm7klC1g.js => index-CskbwyY2.js} (89%) diff --git a/assets/index-D1QftycB.js b/assets/index-BRLMF329.js similarity index 99% rename from assets/index-D1QftycB.js rename to assets/index-BRLMF329.js index 728e5f7..28e94c3 100644 --- a/assets/index-D1QftycB.js +++ b/assets/index-BRLMF329.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-CaDRg2eB.js";import"./index-Bm7klC1g.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-CMBogj9u.js";import"./index-CskbwyY2.js";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/assets/index-CaDRg2eB.js b/assets/index-CMBogj9u.js similarity index 98% rename from assets/index-CaDRg2eB.js rename to assets/index-CMBogj9u.js index cfb65aa..11121a1 100644 --- a/assets/index-CaDRg2eB.js +++ b/assets/index-CMBogj9u.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D1QftycB.js","assets/index-Bm7klC1g.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); -import{_ as pe}from"./index-Bm7klC1g.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-D1QftycB.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-BRLMF329.js","assets/index-CskbwyY2.js","assets/index-AnxZPkAf.css"])))=>i.map(i=>d[i]); +import{_ as pe}from"./index-CskbwyY2.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-BRLMF329.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-Bm7klC1g.js b/assets/index-CskbwyY2.js similarity index 89% rename from assets/index-Bm7klC1g.js rename to assets/index-CskbwyY2.js index 8ef03ea..46dfa7e 100644 --- a/assets/index-Bm7klC1g.js +++ b/assets/index-CskbwyY2.js @@ -1,4 +1,4 @@ -var tce=Object.defineProperty;var LO=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)||LO("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)?LO("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 $$(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 q$={exports:{}},m4={},V$={exports:{}},_r={};/** +var tce=Object.defineProperty;var FO=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)||FO("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)?FO("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 q$(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 V$={exports:{}},m4={},z$={exports:{}},_r={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var tce=Object.defineProperty;var LO=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 Qw=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"),FO=Symbol.iterator;function pce(t){return t===null||typeof t!="object"?null:(t=FO&&t[FO]||t["@@iterator"],typeof t=="function"?t:null)}var z$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H$=Object.assign,G$={};function uy(t,e,r){this.props=t,this.context=e,this.refs=G$,this.updater=r||z$}uy.prototype.isReactComponent={};uy.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")};uy.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function W$(){}W$.prototype=uy.prototype;function II(t,e,r){this.props=t,this.context=e,this.refs=G$,this.updater=r||z$}var TI=II.prototype=new W$;TI.constructor=II;H$(TI,uy.prototype);TI.isPureReactComponent=!0;var jO=Array.isArray,K$=Object.prototype.hasOwnProperty,PI={current:null},Y$={key:!0,ref:!0,__self:!0,__source:!0};function Q$(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)K$.call(e,n)&&!Y$.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 X$(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=X$;m4.jsxs=X$;q$.exports=m4;var W=q$.exports,eq={exports:{}},da={},tq={exports:{}},rq={};/** + */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 eq(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=eq;m4.jsxs=eq;V$.exports=m4;var W=V$.exports,tq={exports:{}},da={},rq={exports:{}},nq={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var tce=Object.defineProperty;var LO=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(x,E){var w=x.length;x.push(E);e:for(;0>>1,P=x[T];if(0>>1;Ti(j,w))Xi(G,j)?(x[T]=G,x[X]=w,T=X):(x[T]=j,x[oe]=w,T=oe);else if(Xi(G,w))x[T]=G,x[X]=w,T=X;else break e}}return E}function i(x,E){var w=x.sortIndex-E.sortIndex;return w!==0?w:x.id-E.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(x){for(var E=r(l);E!==null;){if(E.callback===null)n(l);else if(E.startTime<=x)n(l),E.sortIndex=E.expirationTime,e(c,E);else break;E=r(l)}}function L(x){if(b=!1,O(x),!y)if(r(c)!==null)y=!0,M(F);else{var E=r(l);E!==null&&N(L,E.startTime-x)}}function F(x,E){y=!1,b&&(b=!1,C($),$=-1),g=!0;var w=p;try{for(O(E),u=r(c);u!==null&&(!(u.expirationTime>E)||x&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var P=T(u.expirationTime<=E);E=t.unstable_now(),typeof P=="function"?u.callback=P:u===r(c)&&n(c),O(E)}else n(c);u=r(c)}if(u!==null)var H=!0;else{var oe=r(l);oe!==null&&N(L,oe.startTime-E),H=!1}return H}finally{u=null,p=w,g=!1}}var z=!1,_=null,$=-1,ie=5,le=-1;function K(){return!(t.unstable_now()-lex||125T?(x.sortIndex=w,e(l,x),r(c)===null&&x===r(l)&&(b?(C($),$=-1):b=!0,N(L,w-T))):(x.sortIndex=P,e(c,x),y||g||(y=!0,M(F))),x},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(x){var E=p;return function(){var w=p;p=E;try{return x.apply(this,arguments)}finally{p=w}}}})(rq);tq.exports=rq;var Sce=tq.exports;/** + */(function(t){function e(x,E){var w=x.length;x.push(E);e:for(;0>>1,P=x[T];if(0>>1;Ti(j,w))Xi(G,j)?(x[T]=G,x[X]=w,T=X):(x[T]=j,x[oe]=w,T=oe);else if(Xi(G,w))x[T]=G,x[X]=w,T=X;else break e}}return E}function i(x,E){var w=x.sortIndex-E.sortIndex;return w!==0?w:x.id-E.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(x){for(var E=r(l);E!==null;){if(E.callback===null)n(l);else if(E.startTime<=x)n(l),E.sortIndex=E.expirationTime,e(c,E);else break;E=r(l)}}function L(x){if(b=!1,O(x),!y)if(r(c)!==null)y=!0,M(F);else{var E=r(l);E!==null&&N(L,E.startTime-x)}}function F(x,E){y=!1,b&&(b=!1,C($),$=-1),g=!0;var w=p;try{for(O(E),u=r(c);u!==null&&(!(u.expirationTime>E)||x&&!K());){var T=u.callback;if(typeof T=="function"){u.callback=null,p=u.priorityLevel;var P=T(u.expirationTime<=E);E=t.unstable_now(),typeof P=="function"?u.callback=P:u===r(c)&&n(c),O(E)}else n(c);u=r(c)}if(u!==null)var H=!0;else{var oe=r(l);oe!==null&&N(L,oe.startTime-E),H=!1}return H}finally{u=null,p=w,g=!1}}var z=!1,_=null,$=-1,ie=5,le=-1;function K(){return!(t.unstable_now()-lex||125T?(x.sortIndex=w,e(l,x),r(c)===null&&x===r(l)&&(b?(C($),$=-1):b=!0,N(L,w-T))):(x.sortIndex=P,e(c,x),y||g||(y=!0,M(F))),x},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(x){var E=p;return function(){var w=p;p=E;try{return x.apply(this,arguments)}finally{p=w}}}})(nq);rq.exports=nq;var Sce=rq.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var tce=Object.defineProperty;var LO=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,la=Sce;function Ze(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"),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]*$/,$O={},qO={};function Tce(t){return aS.call(qO,t)?!0:aS.call($O,t)?!1:Ice.test(t)?qO[t]=!0:($O[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 MI=/[\-:]([a-z])/g;function RI(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(MI,RI);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(MI,RI);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(MI,RI);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 OI(t,e,r,n){var i=ss.hasOwnProperty(e)?ss[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]*$/,qO={},VO={};function Tce(t){return aS.call(VO,t)?!0:aS.call(qO,t)?!1:Ice.test(t)?VO[t]=!0:(qO[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 MI=/[\-:]([a-z])/g;function RI(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(MI,RI);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(MI,RI);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(MI,RI);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 OI(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{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 DI:return"StrictMode";case lS:return"Suspense";case fS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case sq:return(t.displayName||"Context")+".Consumer";case iq:return(t._context.displayName||"Context")+".Provider";case NI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case BI:return e=t.displayName||null,e!==null?e:uS(t.type)||"Memo";case od: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===DI?"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 th(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function aq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Oce(t){var e=aq(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 cq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=aq(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 zO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=th(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 lq(t,e){e=e.checked,e!=null&&OI(t,"checked",e,!1)}function hS(t,e){lq(t,e);var r=th(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,th(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function HO(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 hq(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 pq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=hq(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 LI(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 KO(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 vq(t){Ev?Cv?Cv.push(t):Cv=[t]:Ev=t}function gq(){if(Ev){var t=Ev,e=Cv;if(Cv=Ev=null,KO(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),nD=" ",iD=!1;function Bq(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 Lq(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 Lq(e);case"keypress":return e.which!==32?null:(iD=!0,nD);case"textInput":return t=e.data,t===nD&&iD?null:t;default:return null}}function Tle(t,e){if(Z1)return t==="compositionend"||!HI&&Bq(t,e)?(t=Dq(),L6=qI=Od=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=cD(r)}}function $q(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?$q(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function qq(){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 GI(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=qq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&$q(r.ownerDocument.documentElement,r)){if(n!==null&&GI(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=lD(r,s);var o=lD(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 fD(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&&GI(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 rh={},Ns=bh(rh),Mo=bh(!1),mp=rh;function Bg(t,e){var r=t.type.contextTypes;if(!r)return rh;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 yD(t,e,r){if(Ns.current!==rh)throw Error(Ze(168));bn(Ns,e),bn(Mo,r)}function Jq(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||rh,mp=Ns.current,bn(Ns,t),bn(Mo,Mo.current),!0}function mD(t,e,r){var n=t.stateNode;if(!n)throw Error(Ze(169));r?(t=Jq(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 Zq(t){Of===null?Of=[t]:Of.push(t)}function Yle(t){A4=!0,Zq(t)}function wh(){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 le=p(C,_,O[$],L);if(le===null){_===null&&(_=ie);break}t&&_&&le.alternate===null&&e(C,_),S=s(le,S,$),z===null?F=le:z.sibling=le,z=le,_=ie}if($===O.length)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;$$?(ie=_,_=null):ie=_.sibling;var K=p(C,_,le.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(le.done)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;!le.done;$++,le=O.next())le=u(C,le.value,L),le!==null&&(S=s(le,S,$),z===null?F=le:z.sibling=le,z=le);return Tn&&f0(C,$),F}for(_=n(C,_);!le.done;$++,le=O.next())le=g(_,C,$,le.value,L),le!==null&&(t&&le.alternate!==null&&_.delete(le.key===null?$:le.key),S=s(le,S,$),z===null?F=le:z.sibling=le,z=le);return t&&_.forEach(function(k){return e(C,k)}),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===od&&xD(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 od: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=rV(!0),nV=rV(!1),Y3=bh(null),Q3=null,sv=null,QI=null;function JI(){QI=sv=Q3=null}function ZI(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,QI=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(QI!==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 XI(t){_0===null?_0=[t]:_0.push(t)}function iV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,XI(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 ad=!1;function eT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sV(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 zd(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,XI(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,jI(t,r)}}function ED(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;ad=!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:ad=!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 CD(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 EV(){return Ja().memoizedState}function Xle(t,e,r){var n=Gd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},CV(t))AV(e,r);else if(r=iV(t,e,r,n),r!==null){var i=to();$c(r,t,n,i),SV(r,e,n)}}function efe(t,e,r){var n=Gd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(CV(t))AV(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,XI(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=iV(t,e,i,n),r!==null&&(i=to(),$c(r,t,n,i),SV(r,e,n))}}function CV(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function AV(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 SV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,jI(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:SD,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,$6(4194308,4,yV.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:AD,useDebugValue:cT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=AD(!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||lV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,SD(uV.bind(null,n,s,t),[t]),n.flags|=2048,ew(9,fV.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")&&(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 Z1:return"Fragment";case J1:return"Portal";case cS:return"Profiler";case DI:return"StrictMode";case lS:return"Suspense";case fS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case oq:return(t.displayName||"Context")+".Consumer";case sq:return(t._context.displayName||"Context")+".Provider";case NI:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case BI:return e=t.displayName||null,e!==null?e:uS(t.type)||"Memo";case od: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===DI?"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 th(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function cq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Oce(t){var e=cq(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 lq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=cq(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 HO(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=th(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 fq(t,e){e=e.checked,e!=null&&OI(t,"checked",e,!1)}function hS(t,e){fq(t,e);var r=th(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,th(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function GO(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 Ev(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 pq(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 vq(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=pq(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 LI(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wS=null,Cv=null,Av=null;function YO(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 gq(t){Cv?Av?Av.push(t):Av=[t]:Cv=t}function yq(){if(Cv){var t=Cv,e=Av;if(Av=Cv=null,YO(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),iD=" ",sD=!1;function Lq(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 Fq(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var X1=!1;function Ile(t,e){switch(t){case"compositionend":return Fq(e);case"keypress":return e.which!==32?null:(sD=!0,iD);case"textInput":return t=e.data,t===iD&&sD?null:t;default:return null}}function Tle(t,e){if(X1)return t==="compositionend"||!HI&&Lq(t,e)?(t=Nq(),L6=qI=Od=null,X1=!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=lD(r)}}function qq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?qq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Vq(){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 GI(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=Vq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&qq(r.ownerDocument.documentElement,r)){if(n!==null&&GI(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=fD(r,s);var o=fD(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,ev=null,_S=null,pb=null,IS=!1;function uD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;IS||ev==null||ev!==B3(n)||(n=ev,"selectionStart"in n&&GI(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"),0nv||(t.current=OS[nv],OS[nv]=null,nv--)}function bn(t,e){nv++,OS[nv]=t.current,t.current=e}var rh={},Ns=bh(rh),Mo=bh(!1),mp=rh;function Lg(t,e){var r=t.type.contextTypes;if(!r)return rh;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 mD(t,e,r){if(Ns.current!==rh)throw Error(Ze(168));bn(Ns,e),bn(Mo,r)}function Zq(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||rh,mp=Ns.current,bn(Ns,t),bn(Mo,Mo.current),!0}function bD(t,e,r){var n=t.stateNode;if(!n)throw Error(Ze(169));r?(t=Zq(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 Xq(t){Of===null?Of=[t]:Of.push(t)}function Yle(t){A4=!0,Xq(t)}function wh(){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 le=p(C,_,O[$],L);if(le===null){_===null&&(_=ie);break}t&&_&&le.alternate===null&&e(C,_),S=s(le,S,$),z===null?F=le:z.sibling=le,z=le,_=ie}if($===O.length)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;$$?(ie=_,_=null):ie=_.sibling;var K=p(C,_,le.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(le.done)return r(C,_),Tn&&f0(C,$),F;if(_===null){for(;!le.done;$++,le=O.next())le=u(C,le.value,L),le!==null&&(S=s(le,S,$),z===null?F=le:z.sibling=le,z=le);return Tn&&f0(C,$),F}for(_=n(C,_);!le.done;$++,le=O.next())le=g(_,C,$,le.value,L),le!==null&&(t&&le.alternate!==null&&_.delete(le.key===null?$:le.key),S=s(le,S,$),z===null?F=le:z.sibling=le,z=le);return t&&_.forEach(function(k){return e(C,k)}),Tn&&f0(C,$),F}function I(C,S,O,L){if(typeof O=="object"&&O!==null&&O.type===Z1&&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===Z1){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===od&&ED(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===Z1?(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 J1: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 od: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 jg=nV(!0),iV=nV(!1),Y3=bh(null),Q3=null,ov=null,QI=null;function JI(){QI=ov=Q3=null}function ZI(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 _v(t,e){Q3=t,QI=ov=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(QI!==t)if(t={context:t,memoizedValue:e,next:null},ov===null){if(Q3===null)throw Error(Ze(308));ov=t,Q3.dependencies={lanes:0,firstContext:t}}else ov=ov.next=t;return e}var _0=null;function XI(t){_0===null?_0=[t]:_0.push(t)}function sV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,XI(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 ad=!1;function eT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oV(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 zd(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,XI(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,jI(t,r)}}function CD(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;ad=!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:ad=!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 AD(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 CV(){return Ja().memoizedState}function Xle(t,e,r){var n=Gd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},AV(t))SV(e,r);else if(r=sV(t,e,r,n),r!==null){var i=to();$c(r,t,n,i),_V(r,e,n)}}function efe(t,e,r){var n=Gd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(AV(t))SV(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,XI(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=sV(t,e,i,n),r!==null&&(i=to(),$c(r,t,n,i),_V(r,e,n))}}function AV(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function SV(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 _V(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,jI(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:_D,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,$6(4194308,4,mV.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:SD,useDebugValue:cT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=SD(!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||fV(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,_D(dV.bind(null,n,s,t),[t]),n.flags|=2048,ew(9,uV.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[Il]=e,t[Yb]=n,NV(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 pT(),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(KI(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),nT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rT(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 ZI(e.type._context),null;case 22:case 23:return pT(),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 BD=!1;function ufe(t,e){if(TS=$3,t=qq(),GI(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=BD,BD=!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 FV(t){var e=t.alternate;e!==null&&(t.alternate=null,FV(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 jV(t){return t.tag===5||t.tag===3||t.tag===4}function LD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jV(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 Ju(t,e,r){for(r=r.child;r!==null;)UV(t,e,r),r=r.sibling}function UV(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,Ju(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,Ju(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)}Ju(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)}Ju(t,e,r);break;case 21:Ju(t,e,r);break;case 22:r.mode&1?(Is=(n=Is)||r.memoizedState!==null,Ju(t,e,r),Is=n):Ju(t,e,r);break;default:Ju(t,e,r)}}function FD(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,Dd===null)var n=!1;else{if(t=Dd,Dd=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()-dT?sp(t,0):uT|=r),Oo(t,e)}function KV(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),KV(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),KV(t,r)}var YV;YV=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&&Xq(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=sT(null,e,n,t,i,r);var s=oT();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,eT(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&&WI(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=OD(null,e,n,t,r);break e;case 11:e=MD(null,e,n,t,r);break e;case 14:e=RD(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),OD(t,e,n,i,r);case 3:e:{if(RV(e),t===null)throw Error(Ze(387));n=e.pendingProps,s=e.memoizedState,i=s.element,sV(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=DD(t,e,n,r,i);break e}else if(n!==i){i=Ug(Error(Ze(424)),e),e=DD(t,e,n,r,i);break e}else for(na=Vd(e.stateNode.containerInfo.firstChild),oa=e,Tn=!0,Bc=null,r=nV(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 oV(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),MV(t,e),Js(t,e,o,r),e.child;case 6:return t===null&&NS(e),null;case 13:return OV(t,e,r);case 4:return tT(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),MD(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),RD(t,e,n,i,r);case 15:return PV(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),_V(e,n,i),FS(e,n,i,r),$S(null,e,n,!0,t,r);case 19:return DV(t,e,r);case 22:return kV(t,e,r)}throw Error(Ze(156,e.tag))};function QV(t,e){return Cq(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 gT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Efe(t){if(typeof t=="function")return gT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===NI)return 11;if(t===BI)return 14}return 2}function Wd(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")gT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case J1:return op(r.children,i,s,e);case DI: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 oq:return P4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case iq:o=10;break e;case sq:o=9;break e;case NI:o=11;break e;case BI:o=14;break e;case od: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=oq,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 yT(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},eT(s),t}function Afe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ez)}catch(t){console.error(t)}}ez(),eq.exports=da;var xh=eq.exports;const Pfe=Su(xh),xT=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),D4=D.createContext({}),N4=D.createContext(null),ET=typeof window<"u",tz=ET?D.useLayoutEffect:D.useEffect,rz=D.createContext({strict:!1}),B4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kfe="framerAppearId",nz="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 iz(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[nz],y=D.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return tz(()=>{u&&(u.updateFeatures(),CT.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),D.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,GD||(GD=!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:oz(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 oz(t){if(t)return t.options.allowProjection!==!1?t.projection:oz(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 AT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ST=["initial",...AT];function L4(t){return nw(t.animate)||ST.some(e=>rw(t[e]))}function az(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}),[WD(e),WD(r)])}function WD(t){return Array.isArray(t)?t.join(" "):t}const KD={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 KD)qg[t]={isEnabled:e=>KD[t].some(r=>!!e[r])};function Ufe(t){for(const e in t)qg[e]={...qg[e],...t[e]}}const _T=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(xT),...a,layoutId:Vfe(a)},{isStatic:u}=f,p=jfe(a),g=n(a,u);if(!u&&ET){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(_T).id;return e&&t!==void 0?e+"-"+t:t}function zfe(t,e){D.useContext(rz).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 IT(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"],Eh=new Set(tx);function cz(t,{layout:e,layoutId:r}){return Eh.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!o5[t]||t==="opacity")}const Ts=t=>!!(t&&t.getVelocity),lz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,nh=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},bb={...py,transform:t=>nh(0,1,t)},K2={...py,default:1},wb=t=>Math.round(t*1e5)/1e5,TT=/-?(?:\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}`}),nd=nx("deg"),Bl=nx("%"),Qt=nx("px"),Zfe=nx("vh"),Xfe=nx("vw"),YD={...Bl,parse:t=>Bl.parse(t)/100,transform:t=>Bl.transform(t*100)},QD={...py,transform:Math.round},PT={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:nd,rotateX:nd,rotateY:nd,rotateZ:nd,scale:K2,scaleX:K2,scaleY:K2,scaleZ:K2,skew:nd,skewX:nd,skewY:nd,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:bb,originX:YD,originY:YD,originZ:Qt,zIndex:QD,backgroundPositionX:Qt,backgroundPositionY:Qt,fillOpacity:bb,strokeOpacity:bb,numOctaves:QD},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),uz=fz("--"),nue=fz("var(--"),kT=t=>nue(t)?iue.test(t.split("/*")[0].trim()):!1,iue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function MT(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(Eh.has(c)){o=!0;continue}else if(uz(c)){i[c]=l;continue}else{const f=lz(l,PT[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 RT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dz(t,e,r){for(const n in e)!Ts(e[n])&&!cz(n,r)&&(t[n]=e[n])}function sue({transformTemplate:t},e){return D.useMemo(()=>{const r=RT();return MT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function oue(t,e){const r=t.style||{},n={};return dz(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 hz=t=>!a5(t);function lue(t){t&&(hz=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"||(hz(i)||r===!0&&a5(i)||!e&&!a5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function JD(t,e,r){return typeof t=="string"?t:Qt.transform(e+r*t)}function uue(t,e,r){const n=JD(e,t.x,t.width),i=JD(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 OT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(MT(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 pz=()=>({...RT(),attrs:{}}),DT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vue(t,e,r,n){const i=D.useMemo(()=>{const s=pz();return OT(s,e,DT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};dz(s,t.style,t),i.style={...s,...i.style}}return i}function gue(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(IT(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 vz(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 gz=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 yz(t,e,r,n){vz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(gz.has(i)?i:B4(i),e.attrs[i])}function NT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(Ts(i[o])||e.style&&Ts(e.style[o])||cz(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 mz(t,e,r){const n=NT(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 ZD(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function BT(t,e,r,n){if(typeof e=="function"){const[i,s]=ZD(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]=ZD(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function LT(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 bz=new Set(["opacity","clipPath","filter","transform"]);function wz(t){if(Eh.has(t))return"transform";if(bz.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 xz=t=>(e,r)=>{const n=D.useContext(D4),i=D.useContext(N4),s=()=>bue(t,e,n,i,r);return r?s():LT(s)};function wue(t,e){const r=wz(e);r&&F4(t,r)}function XD(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)&&XD(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}=iz(typeof requestAnimationFrame<"u"?requestAnimationFrame:ks,!0),Eue={useVisualState:xz({scrapeMotionValuesFromProps:mz,createRenderState:pz,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(()=>{OT(r,n,DT(e.tagName),t.transformTemplate),yz(e,r)})}})},Cue={useVisualState:xz({applyWillChange:!0,scrapeMotionValuesFromProps:NT,createRenderState:RT})};function Aue(t,{forwardMotionProps:e=!1},r,n){return{...IT(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 Ez=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=>Ez(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 Cz(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const eN=Cz("dragHorizontal"),tN=Cz("dragVertical");function Az(t){let e=!1;if(t==="y")e=tN();else if(t==="x")e=eN();else{const r=eN(),n=tN();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Sz(){const t=Az(!0);return t?(t(),!1):!0}class Ch{constructor(e){this.isMounted=!1,this.node=e}update(){}}function rN(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||Sz())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 Ch{mount(){this.unmount=nu(rN(this.node,!0),rN(this.node,!1))}unmount(){}}class Tue extends Ch{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 _z=(t,e)=>e?t===e?!0:_z(t,e.parentElement):!1;function wA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,U4(r))}class Pue extends Ch{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&&!_z(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),!Sz()}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 Ch{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 Iz(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:Eh.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 FT(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 Tz=t=>/^0[^.\s]+$/u.test(t);function Hue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Tz(t):!0}const Pz=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 kz(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 Pz(o)?parseFloat(o):o}return kT(i)?kz(i,e,r+1):i}const Kue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),nN=t=>t===py||t===Qt,iN=(t,e)=>parseFloat(t.split(", ")[e]),sN=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return iN(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?iN(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:sN(4,13),y:sN(5,14)};Vg.translateX=Vg.x;Vg.translateY=Vg.y;const Mz=t=>e=>e.test(t),Zue={test:t=>t==="auto",parse:t=>t},Rz=[py,Qt,Bl,nd,Xfe,Zfe,Zue],oN=t=>Rz.find(Mz(t)),ap=new Set;let r7=!1,n7=!1;function Oz(){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 Dz(){ap.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(n7=!0)})}function Xue(){Dz(),Oz()}class jT{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(Dz),on.resolveKeyframes(Oz))):(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)),Nz=(t,e,r)=>n=>{if(!rx(n))return n;const[i,s,o,a]=n.match(TT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ede=t=>nh(0,255,t),EA={...py,transform:t=>Math.round(ede(t))},T0={test:UT("rgb","red"),parse:Nz("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:UT("#"),parse:tde,transform:T0.transform},lv={test:UT("hsl","hue"),parse:Nz("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(TT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Yfe))===null||r===void 0?void 0:r.length)||0)>0}const Bz="number",Lz="color",nde="var",ide="var(",aN="${}",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(Lz),r.push(Ss.parse(c))):c.startsWith(ide)?(n.var.push(s),i.push(nde),r.push(c)):(n.number.push(s),i.push(Bz),r.push(parseFloat(c))),++s,aN)).split(aN);return{values:r,split:a,indexes:n,types:i}}function Fz(t){return iw(t).values}function jz(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=Fz(t);return jz(t)(e.map(ode))}const ih={test:rde,parse:Fz,createTransformer:jz,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(TT)||[];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={...ih,getAnimatableNone:t=>{const e=t.match(fde);return e?e.map(lde).join(" "):t}},ude={...PT,color:Ss,backgroundColor:Ss,outlineColor:Ss,fill:Ss,stroke:Ss,borderColor:Ss,borderTopColor:Ss,borderRightColor:Ss,borderBottomColor:Ss,borderLeftColor:Ss,filter:s7,WebkitFilter:s7},$T=t=>ude[t];function Uz(t,e){let r=$T(t);return r!==s7&&(r=ih),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 qz(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)}},cN=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ih.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 zz(t,e){return e?t*(1e3/e):0}const mde=5;function Hz(t,e,r){const n=Math.max(e-mde,0);return zz(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=nh(xde,Ede,o),t=nh(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(!lN(t,Ide)&&lN(t,_de)){const r=Cde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Gz({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):Hz(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 fN({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($),le=O($);p.done=Math.abs(ie)<=l,p.value=p.done?C:le};let F,z;const _=$=>{g(p.value)&&(F=$,z=Gz({keyframes:[p.value,y(p.value)],velocity:Hz(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 Wz=(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=Wz(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:Wz(i(s),e,n)}const Rde=ix(.42,0,1,1),Ode=ix(0,0,.58,1),Kz=ix(.42,0,.58,1),Dde=t=>Array.isArray(t)&&typeof t[0]!="number",Yz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qz=t=>e=>1-t(1-e),qT=t=>1-Math.sin(Math.acos(t)),Jz=Qz(qT),Nde=Yz(qT),Zz=ix(.33,1.53,.69,.99),VT=Qz(Zz),Bde=Yz(VT),Lde=t=>(t*=2)<1?.5*VT(t):.5*(2-Math.pow(2,-10*(t-1))),uN={linear:ks,easeIn:Rde,easeInOut:Kz,easeOut:Ode,circIn:qT,circInOut:Nde,circOut:Jz,backIn:VT,backInOut:Bde,backOut:Zz,anticipate:Lde},dN=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(uN[t]!==void 0),uN[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 hN(t){const e=Ude(t);if(!e)return!1;let r=e.parse(t);return e===lv&&(r=Fde(r)),r}const pN=(t,e)=>{const r=hN(t),n=hN(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 zT(t){return typeof t=="number"?qde:typeof t=="string"?kT(t)?c5:Ss.test(t)?pN:Hde:Array.isArray(t)?Xz:typeof t=="object"?Ss.test(t)?pN:Vde:c5}function Xz(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>zT(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=ih.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(Xz(zde(n,i),i.values),r):c5(t,e)};function eH(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Dn(t,e,r):zT(t)(t,e)}function Gde(t,e,r){const n=[],i=r||eH,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(nh(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||Kz).splice(0,t.length-1)}function l5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Dde(n)?n.map(dN):dN(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 vN=2e4;function Zde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=vN?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:fN,inertia:fN,tween:l5,keyframes:l5,spring:Gz},the=t=>t/100;class HT extends Vz{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)||jT,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,eH(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($),le=$%1;!le&&$>=1&&(le=1),le===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(le=1-le,b&&(le-=b/u)):y==="mirror"&&(L=o)),O=nh(0,1,le)*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 tH=t=>Array.isArray(t)&&typeof t[0]=="number";function rH(t){return!!(!t||typeof t=="string"&&t in GT||tH(t)||Array.isArray(t)&&t.every(rH))}const zm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,GT={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 nH(t)||GT.easeOut}function nH(t){if(t)return tH(t)?zm(t):Array.isArray(t)?t.map(rhe):GT[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=nH(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=qz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),f5=10,she=2e4;function ohe(t){return t.type==="spring"||!rH(t.ease)}function ahe(t,e){const r=new HT({...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 HT({...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&&bz.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=qz(()=>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 WT=(t,e,r,n={},i,s,o)=>a=>{const c=FT(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&&gN.supports(u)?new gN(u):new HT(u)};class KT{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 iH{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 KT);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>yN)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,yN);return zz(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 iH(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 sH(t){return t.props[nz]}class phe extends iH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=wz(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 oH(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,...FT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=sH(t);if(C){const S=window.MotionHandoffAnimation(C,u,on);S!==null&&(y.startTime=S,b=!0)}}p.start(WT(u,p,g,t.shouldReduceMotion&&Eh.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(oH(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(oH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const whe=[...AT].reverse(),xhe=AT.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=mN(),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 le=Array.isArray(O)?O:[O];let K=le.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:k={}}=S,R={...k,...K},v=m=>{$=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const M=t.getValue(m);M&&(M.liveStyle=!1)};for(const m in R){const M=K[m],N=k[m];if(g.hasOwnProperty(m))continue;let x=!1;e7(M)&&e7(N)?x=!Iz(M,N):x=M!==N,x?M!=null?v(m):p.add(m):M!==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(...le.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=mN(),n=!0}}}function Ahe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Iz(e,t):!1}function r0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mN(){return{animate:r0(!0),whileInView:r0(),whileHover:r0(),whileTap:r0(),whileDrag:r0(),whileFocus:r0(),exit:r0()}}class She extends Ch{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 Ch{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}},bN=(t,e)=>Math.abs(t-e);function Phe(t,e){const r=bN(t.x,e.x),n=bN(t.y,e.y);return Math.sqrt(r**2+n**2)}class aH{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)},!Ez(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 wN(t,e){return{x:t.x-e.x,y:t.y-e.y}}function IA({point:t},e){return{point:t,delta:wN(t,cH(e)),offset:wN(t,khe(e)),velocity:Mhe(e,.1)}}function khe(t){return t[0]}function cH(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=cH(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 lH=1e-4,Rhe=1-lH,Ohe=1+lH,fH=.01,Dhe=0-fH,Nhe=0+fH;function fa(t){return t.max-t.min}function Bhe(t,e,r){return Math.abs(t-e)<=r}function xN(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){xN(t.x,e.x,r.x,n?n.originX:void 0),xN(t.y,e.y,r.y,n?n.originY:void 0)}function EN(t,e,r){t.min=r.min+e.min,t.max=t.min+fa(e)}function Lhe(t,e,r){EN(t.x,e.x,r.x),EN(t.y,e.y,r.y)}function CN(t,e,r){t.min=e.min-r.min,t.max=t.min+fa(e)}function Eb(t,e,r){CN(t.x,e.x,r.x),CN(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 AN(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:AN(t.x,r,i),y:AN(t.y,e,n)}}function SN(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)),nh(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:_N(t,"left","right"),y:_N(t,"top","bottom")}}function _N(t,e,r){return{min:IN(t,e),max:IN(t,r)}}function IN(t,e){return typeof t=="number"?t:t[e]||0}const TN=()=>({translate:0,scale:1,origin:0,originPoint:0}),fv=()=>({x:TN(),y:TN()}),PN=()=>({min:0,max:0}),Xn=()=>({x:PN(),y:PN()});function Ra(t){return[t("x"),t("y")]}function uH({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)||dH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function dH(t){return kN(t.x)||kN(t.y)}function kN(t){return t&&t!=="0%"}function u5(t,e,r){const n=t-r,i=e*n;return r+i}function MN(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=MN(t.min,e,r,n,i),t.max=MN(t.max,e,r,n,i)}function hH(t,{x:e,y:r}){d7(t.x,e.translate,e.scale,e.originPoint),d7(t.y,r.translate,r.scale,r.originPoint)}const RN=.999999999999,ON=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;aRN&&(e.x=1),e.yRN&&(e.y=1)}function uv(t,e){t.min=t.min+e,t.max=t.max+e}function DN(t,e,r,n,i=.5){const s=Dn(t.min,t.max,i);d7(t,e,r,s,n)}function dv(t,e){DN(t.x,e.x,e.scaleX,e.scale,e.originX),DN(t.y,e.y,e.scaleY,e.scale,e.originY)}function pH(t,e){return uH(Hhe(t.getBoundingClientRect(),e))}function Whe(t,e,r){const n=pH(t,r),{scroll:i}=e;return i&&(uv(n.x,i.offset.x),uv(n.y,i.offset.y)),n}const vH=({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=Az(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 aH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:vH(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=uH(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(WT(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 Ch{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 NN=t=>(e,r)=>{t&&on.postRender(()=>t(e,r))};class Zhe extends Ch{constructor(){super(...arguments),this.removePointerDownListener=ks}onPointerDown(e){this.session=new aH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:NN(e),onStart:NN(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 BN(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=BN(t,e.target.x),n=BN(t,e.target.y);return`${r}% ${n}%`}},e0e={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=ih.parse(t);if(i.length>5)return n;const s=ih.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(),CT.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 gH(t){const[e,r]=Xhe(),n=D.useContext(_T);return W.jsx(t0e,{...t,layoutGroup:n,switchLayoutGroup:D.useContext(sz),isPresent:e,safeToRemove:r})}const r0e={borderRadius:{...wm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wm,borderTopRightRadius:wm,borderBottomLeftRadius:wm,borderBottomRightRadius:wm,boxShadow:e0e},yH=["TopLeft","TopRight","BottomLeft","BottomRight"],n0e=yH.length,LN=t=>typeof t=="string"?parseFloat(t):t,FN=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 UN(t,e){t.min=e.min,t.max=e.max}function Sa(t,e){UN(t.x,e.x),UN(t.y,e.y)}function $N(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function qN(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=qN(t.min,e,r,a,i),t.max=qN(t.max,e,r,a,i)}function VN(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 zN(t,e,r,n){VN(t.x,e,c0e,r?r.x:void 0,n?n.x:void 0),VN(t.y,e,l0e,r?r.y:void 0,n?n.y:void 0)}function HN(t){return t.translate===0&&t.scale===1}function bH(t){return HN(t.x)&&HN(t.y)}function GN(t,e){return t.min===e.min&&t.max===e.max}function f0e(t,e){return GN(t.x,e.x)&&GN(t.y,e.y)}function WN(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function wH(t,e){return WN(t.x,e.x)&&WN(t.y,e.y)}function KN(t){return fa(t.x)/fa(t.y)}function YN(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(WT("",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"},QN=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 xH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=sH(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&&xH(n)}function EH({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(ZN))})}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||!wH(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={...FT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||ZN(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&&xH(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;XN(u.x,o.x,F),XN(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,QN,{...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(QN),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&&CH(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(JN),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}):CH(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=!bH(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),wH(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 JN(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 ZN(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 XN(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 eB(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){eB(t.x,e.x,r.x,n),eB(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]},tB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),rB=tB("applewebkit/")&&!tB("chrome/")?Math.round:ks;function nB(t){t.min=rB(t.min),t.max=rB(t.max)}function D0e(t){nB(t.x),nB(t.y)}function CH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Bhe(KN(e),KN(r),.2)}function N0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const B0e=EH({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},AH=EH({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:AH,MeasureLayout:gH}},h7={current:null},SH={current:!1};function F0e(){if(SH.current=!0,!!ET)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 iB=new WeakMap,U0e=[...Rz,Ss,ih],$0e=t=>U0e.find(Mz(t)),sB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],q0e=ST.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=jT,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=az(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,iB.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)),SH.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(){iB.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=Eh.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"&&(Pz(i)||Tz(i))?i=parseFloat(i):!$0e(i)&&ih.test(r)&&(i=Uz(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=BT(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 KT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class _H extends V0e{constructor(){super(...arguments),this.KeyframeResolver=$z}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 _H{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=vz}readValueFromInstance(e,r){if(Eh.has(r)){const n=$T(r);return n&&n.default||0}else{const n=z0e(e),i=(uz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return pH(e,r)}build(e,r,n){MT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return NT(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 _H{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Eh.has(r)){const n=$T(r);return n&&n.default||0}return r=gz.has(r)?r:B4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return mz(e,r,n)}build(e,r,n){OT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){yz(e,r,n,i)}mount(e){this.isSVGTag=DT(e.tagName),super.mount(e)}}const W0e=(t,e)=>IT(t)?new G0e(e):new H0e(e,{allowProjection:t!==D.Fragment}),K0e={layout:{ProjectionNode:AH,MeasureLayout:gH}},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(xT);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 TV(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 PV(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"&&(Hd===null?Hd=new Set([this]):Hd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function PD(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 kD(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 MD(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,zd(r,e,1))),r.lanes|=1),t)}var sfe=_u.ReactCurrentOwner,ko=!1;function Js(t,e,r,n){e.child=t===null?iV(e,null,r,n):jg(e,t.child,r,n)}function RD(t,e,r,n,i){r=r.render;var s=e.ref;return _v(e,i),n=sT(t,e,r,n,s,i),r=oT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,du(t,e,i)):(Tn&&r&&WI(e),e.flags|=1,Js(t,e,n,i),e.child)}function OD(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!gT(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,kV(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=Wd(s,n),t.ref=e.ref,t.return=e,e.child=t}function kV(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 MV(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(cv,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(cv,Xo),Xo|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,bn(cv,Xo),Xo|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,bn(cv,Xo),Xo|=n;return Js(t,e,i,r),e.child}function RV(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=Lg(e,s),_v(e,i),r=sT(t,e,r,n,s,i),n=oT(),t!==null&&!ko?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,du(t,e,i)):(Tn&&n&&WI(e),e.flags|=1,Js(t,e,r,i),e.child)}function DD(t,e,r,n,i){if(Ro(r)){var s=!0;G3(e)}else s=!1;if(_v(e,i),e.stateNode===null)q6(t,e),IV(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=Lg(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)&&TD(e,o,n,l),ad=!1;var p=e.memoizedState;o.state=p,J3(e,n,o,i),c=e.memoizedState,a!==n||p!==c||Mo.current||ad?(typeof f=="function"&&(LS(e,r,f,n),c=e.memoizedState),(a=ad||ID(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,oV(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=Lg(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)&&TD(e,o,n,c),ad=!1,p=e.memoizedState,o.state=p,J3(e,n,o,i);var y=e.memoizedState;a!==u||p!==y||Mo.current||ad?(typeof g=="function"&&(LS(e,r,g,n),y=e.memoizedState),(l=ad||ID(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){RV(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&bD(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=jg(e,t.child,null,s),e.child=jg(e,null,a,s)):Js(t,e,a,s),e.memoizedState=n.state,i&&bD(e,r,!0),e.child}function OV(t){var e=t.stateNode;e.pendingContext?mD(t,e.pendingContext,e.pendingContext!==e.context):e.context&&mD(t,e.context,!1),tT(t,e.containerInfo)}function ND(t,e,r,n,i){return Fg(),YI(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 DV(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):lT(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=Wd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Wd(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=Wd(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 lT(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&&YI(n),jg(e,t.child,null,r),t=lT(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&&jg(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 vT(),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=Vd(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=lT(e,n.children),e.flags|=4096,e)}function BD(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 NV(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&&BD(t,r,e);else if(t.tag===19)BD(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=Wd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Wd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function afe(t,e,r){switch(e.tag){case 3:OV(e),Fg();break;case 5:aV(e);break;case 1:Ro(e.type)&&G3(e);break;case 4:tT(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?DV(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 NV(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,MV(t,e,r)}return du(t,e,r)}var BV,zS,LV,FV;BV=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(){};LV=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)}};FV=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(KI(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,Ug(),Sn(Mo),Sn(Ns),nT(),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:rT(e);var i=I0(Jb.current);if(r=e.type,t!==null&&e.stateNode!=null)LV(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,BV(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;iqg&&(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>qg&&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 pT(),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(KI(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 Ug(),Sn(Mo),Sn(Ns),nT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rT(e),null;case 13:if(Sn(Rn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ze(340));Fg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Rn),null;case 4:return Ug(),null;case 10:return ZI(e.type._context),null;case 22:case 23:return pT(),null;case 24:return null;default:return null}}var z2=!1,Is=!1,ffe=typeof WeakSet=="function"?WeakSet:Set,St=null;function av(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 LD=!1;function ufe(t,e){if(TS=$3,t=Vq(),GI(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=LD,LD=!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 jV(t){var e=t.alternate;e!==null&&(t.alternate=null,jV(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 UV(t){return t.tag===5||t.tag===3||t.tag===4}function FD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||UV(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 Ju(t,e,r){for(r=r.child;r!==null;)$V(t,e,r),r=r.sibling}function $V(t,e,r){if(Dl&&typeof Dl.onCommitFiberUnmount=="function")try{Dl.onCommitFiberUnmount(b4,r)}catch{}switch(r.tag){case 5:Is||av(r,e);case 6:var n=Yi,i=Dc;Yi=null,Ju(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,Ju(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)}Ju(t,e,r);break;case 1:if(!Is&&(av(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)}Ju(t,e,r);break;case 21:Ju(t,e,r);break;case 22:r.mode&1?(Is=(n=Is)||r.memoizedState!==null,Ju(t,e,r),Is=n):Ju(t,e,r);break;default:Ju(t,e,r)}}function jD(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,Dd===null)var n=!1;else{if(t=Dd,Dd=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()-dT?sp(t,0):uT|=r),Oo(t,e)}function YV(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),YV(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),YV(t,r)}var QV;QV=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&&eV(e,K3,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;q6(t,e),t=e.pendingProps;var i=Lg(e,Ns.current);_v(e,r),i=sT(null,e,n,t,i,r);var s=oT();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,eT(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&&WI(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=DD(null,e,n,t,r);break e;case 11:e=RD(null,e,n,t,r);break e;case 14:e=OD(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),DD(t,e,n,i,r);case 3:e:{if(OV(e),t===null)throw Error(Ze(387));n=e.pendingProps,s=e.memoizedState,i=s.element,oV(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=$g(Error(Ze(423)),e),e=ND(t,e,n,r,i);break e}else if(n!==i){i=$g(Error(Ze(424)),e),e=ND(t,e,n,r,i);break e}else for(na=Vd(e.stateNode.containerInfo.firstChild),oa=e,Tn=!0,Bc=null,r=iV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Fg(),n===i){e=du(t,e,r);break e}Js(t,e,n,r)}e=e.child}return e;case 5:return aV(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),RV(t,e),Js(t,e,o,r),e.child;case 6:return t===null&&NS(e),null;case 13:return DV(t,e,r);case 4:return tT(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=jg(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),RD(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,_v(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),OD(t,e,n,i,r);case 15:return kV(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,_v(e,r),IV(e,n,i),FS(e,n,i,r),$S(null,e,n,!0,t,r);case 19:return NV(t,e,r);case 22:return MV(t,e,r)}throw Error(Ze(156,e.tag))};function JV(t,e){return Aq(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 gT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Efe(t){if(typeof t=="function")return gT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===NI)return 11;if(t===BI)return 14}return 2}function Wd(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")gT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Z1:return op(r.children,i,s,e);case DI: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 aq:return P4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case sq:o=10;break e;case oq:o=9;break e;case NI:o=11;break e;case BI:o=14;break e;case od: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=aq,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 yT(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},eT(s),t}function Afe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tz)}catch(t){console.error(t)}}tz(),tq.exports=da;var xh=tq.exports;const Pfe=Su(xh),xT=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),D4=D.createContext({}),N4=D.createContext(null),ET=typeof window<"u",rz=ET?D.useLayoutEffect:D.useEffect,nz=D.createContext({strict:!1}),B4=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kfe="framerAppearId",iz="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 sz(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[iz],y=D.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return rz(()=>{u&&(u.updateFeatures(),CT.render(u.render),y.current&&u.animationState&&u.animationState.animateChanges())}),D.useEffect(()=>{u&&(!y.current&&u.animationState&&u.animationState.animateChanges(),y.current=!1,WD||(WD=!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:az(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&lv(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:l})}function az(t){if(t)return t.options.allowProjection!==!1?t.projection:az(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):lv(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 AT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ST=["initial",...AT];function L4(t){return nw(t.animate)||ST.some(e=>rw(t[e]))}function cz(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}),[KD(e),KD(r)])}function KD(t){return Array.isArray(t)?t.join(" "):t}const YD={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"]},Vg={};for(const t in YD)Vg[t]={isEnabled:e=>YD[t].some(r=>!!e[r])};function Ufe(t){for(const e in t)Vg[e]={...Vg[e],...t[e]}}const _T=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(xT),...a,layoutId:Vfe(a)},{isStatic:u}=f,p=jfe(a),g=n(a,u);if(!u&&ET){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(_T).id;return e&&t!==void 0?e+"-"+t:t}function zfe(t,e){D.useContext(nz).strict}function Hfe(t){const{drag:e,layout:r}=Vg;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 IT(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"],Eh=new Set(tx);function lz(t,{layout:e,layoutId:r}){return Eh.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!o5[t]||t==="opacity")}const Ts=t=>!!(t&&t.getVelocity),fz=(t,e)=>e&&typeof t=="number"?e.transform(t):t,nh=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},bb={...vy,transform:t=>nh(0,1,t)},K2={...vy,default:1},wb=t=>Math.round(t*1e5)/1e5,TT=/-?(?:\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}`}),nd=nx("deg"),Bl=nx("%"),Qt=nx("px"),Zfe=nx("vh"),Xfe=nx("vw"),QD={...Bl,parse:t=>Bl.parse(t)/100,transform:t=>Bl.transform(t*100)},JD={...vy,transform:Math.round},PT={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:nd,rotateX:nd,rotateY:nd,rotateZ:nd,scale:K2,scaleX:K2,scaleY:K2,scaleZ:K2,skew:nd,skewX:nd,skewY:nd,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:bb,originX:QD,originY:QD,originZ:Qt,zIndex:JD,backgroundPositionX:Qt,backgroundPositionY:Qt,fillOpacity:bb,strokeOpacity:bb,numOctaves:JD},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),dz=uz("--"),nue=uz("var(--"),kT=t=>nue(t)?iue.test(t.split("/*")[0].trim()):!1,iue=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function MT(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(Eh.has(c)){o=!0;continue}else if(dz(c)){i[c]=l;continue}else{const f=fz(l,PT[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 RT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hz(t,e,r){for(const n in e)!Ts(e[n])&&!lz(n,r)&&(t[n]=e[n])}function sue({transformTemplate:t},e){return D.useMemo(()=>{const r=RT();return MT(r,e,t),Object.assign({},r.vars,r.style)},[e])}function oue(t,e){const r=t.style||{},n={};return hz(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 pz=t=>!a5(t);function lue(t){t&&(pz=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"||(pz(i)||r===!0&&a5(i)||!e&&!a5(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function ZD(t,e,r){return typeof t=="string"?t:Qt.transform(e+r*t)}function uue(t,e,r){const n=ZD(e,t.x,t.width),i=ZD(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 OT(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},f,u){if(MT(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 vz=()=>({...RT(),attrs:{}}),DT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vue(t,e,r,n){const i=D.useMemo(()=>{const s=vz();return OT(s,e,DT(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};hz(s,t.style,t),i.style={...s,...i.style}}return i}function gue(t=!1){return(r,n,i,{latestValues:s},o)=>{const c=(IT(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 gz(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 yz=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 mz(t,e,r,n){gz(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(yz.has(i)?i:B4(i),e.attrs[i])}function NT(t,e,r){var n;const{style:i}=t,s={};for(const o in i)(Ts(i[o])||e.style&&Ts(e.style[o])||lz(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 bz(t,e,r){const n=NT(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 XD(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function BT(t,e,r,n){if(typeof e=="function"){const[i,s]=XD(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]=XD(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function LT(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 wz=new Set(["opacity","clipPath","filter","transform"]);function xz(t){if(Eh.has(t))return"transform";if(wz.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 Ez=t=>(e,r)=>{const n=D.useContext(D4),i=D.useContext(N4),s=()=>bue(t,e,n,i,r);return r?s():LT(s)};function wue(t,e){const r=xz(e);r&&F4(t,r)}function eN(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)&&eN(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}=sz(typeof requestAnimationFrame<"u"?requestAnimationFrame:ks,!0),Eue={useVisualState:Ez({scrapeMotionValuesFromProps:bz,createRenderState:vz,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(()=>{OT(r,n,DT(e.tagName),t.transformTemplate),mz(e,r)})}})},Cue={useVisualState:Ez({applyWillChange:!0,scrapeMotionValuesFromProps:NT,createRenderState:RT})};function Aue(t,{forwardMotionProps:e=!1},r,n){return{...IT(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 Cz=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=>Cz(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 Az(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const tN=Az("dragHorizontal"),rN=Az("dragVertical");function Sz(t){let e=!1;if(t==="y")e=rN();else if(t==="x")e=tN();else{const r=tN(),n=rN();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function _z(){const t=Sz(!0);return t?(t(),!1):!0}class Ch{constructor(e){this.isMounted=!1,this.node=e}update(){}}function nN(t,e){const r=e?"pointerenter":"pointerleave",n=e?"onHoverStart":"onHoverEnd",i=(s,o)=>{if(s.pointerType==="touch"||_z())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 Ch{mount(){this.unmount=nu(nN(this.node,!0),nN(this.node,!1))}unmount(){}}class Tue extends Ch{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 Iz=(t,e)=>e?t===e?!0:Iz(t,e.parentElement):!1;function wA(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,U4(r))}class Pue extends Ch{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&&!Iz(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),!_z()}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 Ch{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 Tz(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:Eh.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 FT(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 Pz=t=>/^0[^.\s]+$/u.test(t);function Hue(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Pz(t):!0}const kz=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 Mz(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 kz(o)?parseFloat(o):o}return kT(i)?Mz(i,e,r+1):i}const Kue=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),iN=t=>t===vy||t===Qt,sN=(t,e)=>parseFloat(t.split(", ")[e]),oN=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return sN(i[1],e);{const s=n.match(/^matrix\((.+)\)$/u);return s?sN(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 zg={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:oN(4,13),y:oN(5,14)};zg.translateX=zg.x;zg.translateY=zg.y;const Rz=t=>e=>e.test(t),Zue={test:t=>t==="auto",parse:t=>t},Oz=[vy,Qt,Bl,nd,Xfe,Zfe,Zue],aN=t=>Oz.find(Rz(t)),ap=new Set;let r7=!1,n7=!1;function Dz(){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 Nz(){ap.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(n7=!0)})}function Xue(){Nz(),Dz()}class jT{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(Nz),on.resolveKeyframes(Dz))):(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)),Bz=(t,e,r)=>n=>{if(!rx(n))return n;const[i,s,o,a]=n.match(TT);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ede=t=>nh(0,255,t),EA={...vy,transform:t=>Math.round(ede(t))},T0={test:UT("rgb","red"),parse:Bz("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:UT("#"),parse:tde,transform:T0.transform},fv={test:UT("hsl","hue"),parse:Bz("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)||fv.test(t),parse:t=>T0.test(t)?T0.parse(t):fv.test(t)?fv.parse(t):i7.parse(t),transform:t=>rx(t)?t:t.hasOwnProperty("red")?T0.transform(t):fv.transform(t)};function rde(t){var e,r;return isNaN(t)&&rx(t)&&(((e=t.match(TT))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Yfe))===null||r===void 0?void 0:r.length)||0)>0}const Lz="number",Fz="color",nde="var",ide="var(",cN="${}",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(Fz),r.push(Ss.parse(c))):c.startsWith(ide)?(n.var.push(s),i.push(nde),r.push(c)):(n.number.push(s),i.push(Lz),r.push(parseFloat(c))),++s,cN)).split(cN);return{values:r,split:a,indexes:n,types:i}}function jz(t){return iw(t).values}function Uz(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=jz(t);return Uz(t)(e.map(ode))}const ih={test:rde,parse:jz,createTransformer:Uz,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(TT)||[];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={...ih,getAnimatableNone:t=>{const e=t.match(fde);return e?e.map(lde).join(" "):t}},ude={...PT,color:Ss,backgroundColor:Ss,outlineColor:Ss,fill:Ss,stroke:Ss,borderColor:Ss,borderTopColor:Ss,borderRightColor:Ss,borderBottomColor:Ss,borderLeftColor:Ss,filter:s7,WebkitFilter:s7},$T=t=>ude[t];function $z(t,e){let r=$T(t);return r!==s7&&(r=ih),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 Vz(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)}},lN=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ih.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 Hz(t,e){return e?t*(1e3/e):0}const mde=5;function Gz(t,e,r){const n=Math.max(e-mde,0);return Hz(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=nh(xde,Ede,o),t=nh(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(!fN(t,Ide)&&fN(t,_de)){const r=Cde(t);e={...e,...r,mass:1},e.isResolvedFromDuration=!0}return e}function Wz({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):Gz(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 uN({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($),le=O($);p.done=Math.abs(ie)<=l,p.value=p.done?C:le};let F,z;const _=$=>{g(p.value)&&(F=$,z=Wz({keyframes:[p.value,y(p.value)],velocity:Gz(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 Kz=(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=Kz(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:Kz(i(s),e,n)}const Rde=ix(.42,0,1,1),Ode=ix(0,0,.58,1),Yz=ix(.42,0,.58,1),Dde=t=>Array.isArray(t)&&typeof t[0]!="number",Qz=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Jz=t=>e=>1-t(1-e),qT=t=>1-Math.sin(Math.acos(t)),Zz=Jz(qT),Nde=Qz(qT),Xz=ix(.33,1.53,.69,.99),VT=Jz(Xz),Bde=Qz(VT),Lde=t=>(t*=2)<1?.5*VT(t):.5*(2-Math.pow(2,-10*(t-1))),dN={linear:ks,easeIn:Rde,easeInOut:Yz,easeOut:Ode,circIn:qT,circInOut:Nde,circOut:Zz,backIn:VT,backInOut:Bde,backOut:Xz,anticipate:Lde},hN=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(dN[t]!==void 0),dN[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,fv],Ude=t=>jde.find(e=>e.test(t));function pN(t){const e=Ude(t);if(!e)return!1;let r=e.parse(t);return e===fv&&(r=Fde(r)),r}const vN=(t,e)=>{const r=pN(t),n=pN(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 zT(t){return typeof t=="number"?qde:typeof t=="string"?kT(t)?c5:Ss.test(t)?vN:Hde:Array.isArray(t)?eH:typeof t=="object"?Ss.test(t)?vN:Vde:c5}function eH(t,e){const r=[...t],n=r.length,i=t.map((s,o)=>zT(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=ih.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(eH(zde(n,i),i.values),r):c5(t,e)};function tH(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Dn(t,e,r):zT(t)(t,e)}function Gde(t,e,r){const n=[],i=r||tH,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(nh(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||Yz).splice(0,t.length-1)}function l5({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Dde(n)?n.map(hN):hN(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 gN=2e4;function Zde(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=gN?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:uN,inertia:uN,tween:l5,keyframes:l5,spring:Wz},the=t=>t/100;class HT extends zz{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)||jT,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,tH(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($),le=$%1;!le&&$>=1&&(le=1),le===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(y==="reverse"?(le=1-le,b&&(le-=b/u)):y==="mirror"&&(L=o)),O=nh(0,1,le)*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 rH=t=>Array.isArray(t)&&typeof t[0]=="number";function nH(t){return!!(!t||typeof t=="string"&&t in GT||rH(t)||Array.isArray(t)&&t.every(nH))}const zm=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,GT={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 iH(t)||GT.easeOut}function iH(t){if(t)return rH(t)?zm(t):Array.isArray(t)?t.map(rhe):GT[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=iH(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=Vz(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),f5=10,she=2e4;function ohe(t){return t.type==="spring"||!nH(t.ease)}function ahe(t,e){const r=new HT({...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 HT({...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&&wz.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=Vz(()=>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 WT=(t,e,r,n={},i,s,o)=>a=>{const c=FT(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&&yN.supports(u)?new yN(u):new HT(u)};class KT{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 sH{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 KT);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>mN)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,mN);return Hz(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 sH(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 oH(t){return t.props[iz]}class phe extends sH{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const r=xz(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 aH(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,...FT(o||{},u)};let b=!1;if(window.MotionHandoffAnimation){const C=oH(t);if(C){const S=window.MotionHandoffAnimation(C,u,on);S!==null&&(y.startTime=S,b=!0)}}p.start(WT(u,p,g,t.shouldReduceMotion&&Eh.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(aH(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(aH(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const whe=[...AT].reverse(),xhe=AT.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=bN(),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 le=Array.isArray(O)?O:[O];let K=le.reduce(i(C),{});F===!1&&(K={});const{prevResolvedValues:k={}}=S,R={...k,...K},v=m=>{$=!0,p.has(m)&&(ie=!0,p.delete(m)),S.needsAnimating[m]=!0;const M=t.getValue(m);M&&(M.liveStyle=!1)};for(const m in R){const M=K[m],N=k[m];if(g.hasOwnProperty(m))continue;let x=!1;e7(M)&&e7(N)?x=!Tz(M,N):x=M!==N,x?M!=null?v(m):p.add(m):M!==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(...le.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=bN(),n=!0}}}function Ahe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Tz(e,t):!1}function r0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bN(){return{animate:r0(!0),whileInView:r0(),whileHover:r0(),whileTap:r0(),whileDrag:r0(),whileFocus:r0(),exit:r0()}}class She extends Ch{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 Ch{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}},wN=(t,e)=>Math.abs(t-e);function Phe(t,e){const r=wN(t.x,e.x),n=wN(t.y,e.y);return Math.sqrt(r**2+n**2)}class cH{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)},!Cz(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 xN(t,e){return{x:t.x-e.x,y:t.y-e.y}}function IA({point:t},e){return{point:t,delta:xN(t,lH(e)),offset:xN(t,khe(e)),velocity:Mhe(e,.1)}}function khe(t){return t[0]}function lH(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=lH(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 fH=1e-4,Rhe=1-fH,Ohe=1+fH,uH=.01,Dhe=0-uH,Nhe=0+uH;function fa(t){return t.max-t.min}function Bhe(t,e,r){return Math.abs(t-e)<=r}function EN(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){EN(t.x,e.x,r.x,n?n.originX:void 0),EN(t.y,e.y,r.y,n?n.originY:void 0)}function CN(t,e,r){t.min=r.min+e.min,t.max=t.min+fa(e)}function Lhe(t,e,r){CN(t.x,e.x,r.x),CN(t.y,e.y,r.y)}function AN(t,e,r){t.min=e.min-r.min,t.max=t.min+fa(e)}function Eb(t,e,r){AN(t.x,e.x,r.x),AN(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 SN(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:SN(t.x,r,i),y:SN(t.y,e,n)}}function _N(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)),nh(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:IN(t,"left","right"),y:IN(t,"top","bottom")}}function IN(t,e,r){return{min:TN(t,e),max:TN(t,r)}}function TN(t,e){return typeof t=="number"?t:t[e]||0}const PN=()=>({translate:0,scale:1,origin:0,originPoint:0}),uv=()=>({x:PN(),y:PN()}),kN=()=>({min:0,max:0}),Xn=()=>({x:kN(),y:kN()});function Ra(t){return[t("x"),t("y")]}function dH({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)||hH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function hH(t){return MN(t.x)||MN(t.y)}function MN(t){return t&&t!=="0%"}function u5(t,e,r){const n=t-r,i=e*n;return r+i}function RN(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=RN(t.min,e,r,n,i),t.max=RN(t.max,e,r,n,i)}function pH(t,{x:e,y:r}){d7(t.x,e.translate,e.scale,e.originPoint),d7(t.y,r.translate,r.scale,r.originPoint)}const ON=.999999999999,DN=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;aON&&(e.x=1),e.yON&&(e.y=1)}function dv(t,e){t.min=t.min+e,t.max=t.max+e}function NN(t,e,r,n,i=.5){const s=Dn(t.min,t.max,i);d7(t,e,r,s,n)}function hv(t,e){NN(t.x,e.x,e.scaleX,e.scale,e.originX),NN(t.y,e.y,e.scaleY,e.scale,e.originY)}function vH(t,e){return dH(Hhe(t.getBoundingClientRect(),e))}function Whe(t,e,r){const n=vH(t,r),{scroll:i}=e;return i&&(dv(n.x,i.offset.x),dv(n.y,i.offset.y)),n}const gH=({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=Sz(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 cH(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:gH(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&&lv(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||!lv(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=dH(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(WT(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(!lv(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();lv(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 Ch{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 BN=t=>(e,r)=>{t&&on.postRender(()=>t(e,r))};class Zhe extends Ch{constructor(){super(...arguments),this.removePointerDownListener=ks}onPointerDown(e){this.session=new cH(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gH(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:BN(e),onStart:BN(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 LN(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=LN(t,e.target.x),n=LN(t,e.target.y);return`${r}% ${n}%`}},e0e={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=ih.parse(t);if(i.length>5)return n;const s=ih.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(),CT.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 yH(t){const[e,r]=Xhe(),n=D.useContext(_T);return W.jsx(t0e,{...t,layoutGroup:n,switchLayoutGroup:D.useContext(oz),isPresent:e,safeToRemove:r})}const r0e={borderRadius:{...wm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wm,borderTopRightRadius:wm,borderBottomLeftRadius:wm,borderBottomRightRadius:wm,boxShadow:e0e},mH=["TopLeft","TopRight","BottomLeft","BottomRight"],n0e=mH.length,FN=t=>typeof t=="string"?parseFloat(t):t,jN=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 $N(t,e){t.min=e.min,t.max=e.max}function Sa(t,e){$N(t.x,e.x),$N(t.y,e.y)}function qN(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function VN(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=VN(t.min,e,r,a,i),t.max=VN(t.max,e,r,a,i)}function zN(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 HN(t,e,r,n){zN(t.x,e,c0e,r?r.x:void 0,n?n.x:void 0),zN(t.y,e,l0e,r?r.y:void 0,n?n.y:void 0)}function GN(t){return t.translate===0&&t.scale===1}function wH(t){return GN(t.x)&&GN(t.y)}function WN(t,e){return t.min===e.min&&t.max===e.max}function f0e(t,e){return WN(t.x,e.x)&&WN(t.y,e.y)}function KN(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function xH(t,e){return KN(t.x,e.x)&&KN(t.y,e.y)}function YN(t){return fa(t.x)/fa(t.y)}function QN(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(WT("",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"},JN=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 EH(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=oH(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&&EH(n)}function CH({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(XN))})}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||!xH(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={...FT(b,"layout"),onPlay:I,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else p||XN(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&&EH(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;eB(u.x,o.x,F),eB(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,JN,{...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(JN),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&&AH(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),hv(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(ZN),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}):AH(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=uv();xb(a,n,r.layoutBox);const c=uv();o?xb(c,t.applyTransform(i,!0),r.measuredBox):xb(c,n,r.layoutBox);const l=!wH(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),xH(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 ZN(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 XN(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 eB(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 tB(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){tB(t.x,e.x,r.x,n),tB(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]},rB=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),nB=rB("applewebkit/")&&!rB("chrome/")?Math.round:ks;function iB(t){t.min=nB(t.min),t.max=nB(t.max)}function D0e(t){iB(t.x),iB(t.y)}function AH(t,e,r){return t==="position"||t==="preserve-aspect"&&!Bhe(YN(e),YN(r),.2)}function N0e(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const B0e=CH({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},SH=CH({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:SH,MeasureLayout:yH}},h7={current:null},_H={current:!1};function F0e(){if(_H.current=!0,!!ET)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 sB=new WeakMap,U0e=[...Oz,Ss,ih],$0e=t=>U0e.find(Rz(t)),oB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],q0e=ST.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=jT,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=cz(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,sB.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)),_H.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(){sB.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=Eh.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 Vg){const r=Vg[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"&&(kz(i)||Pz(i))?i=parseFloat(i):!$0e(i)&&ih.test(r)&&(i=$z(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=BT(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 KT),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class IH extends V0e{constructor(){super(...arguments),this.KeyframeResolver=qz}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 IH{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=gz}readValueFromInstance(e,r){if(Eh.has(r)){const n=$T(r);return n&&n.default||0}else{const n=z0e(e),i=(dz(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return vH(e,r)}build(e,r,n){MT(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return NT(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 IH{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Eh.has(r)){const n=$T(r);return n&&n.default||0}return r=yz.has(r)?r:B4(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return bz(e,r,n)}build(e,r,n){OT(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){mz(e,r,n,i)}mount(e){this.isSVGTag=DT(e.tagName),super.mount(e)}}const W0e=(t,e)=>IT(t)?new G0e(e):new H0e(e,{allowProjection:t!==D.Fragment}),K0e={layout:{ProjectionNode:SH,MeasureLayout:yH}},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(xT);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=LT(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 oB(t){const e=[];return D.Children.forEach(t,r=>{D.isValidElement(r)&&e.push(r)}),e}const IH=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=D.useMemo(()=>oB(t),[t]),c=a.map(Q2),l=D.useRef(!0),f=D.useRef(a),u=LT(()=>new Map),[p,g]=D.useState(a),[y,b]=D.useState(a);tz(()=>{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)})})},TH={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=LT(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 aB(t){const e=[];return D.Children.forEach(t,r=>{D.isValidElement(r)&&e.push(r)}),e}const TH=({children:t,exitBeforeEnter:e,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=D.useMemo(()=>aB(t),[t]),c=a.map(Q2),l=D.useRef(!0),f=D.useRef(a),u=LT(()=>new Map),[p,g]=D.useState(a),[y,b]=D.useState(a);rz(()=>{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)})})},PH={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={...TH,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={...TH,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"}},aB={sm:0,md:480,lg:769,xl:1281};var cB={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 lB(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)},PH=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),PH(t));p7.properties=PH.properties;const upe="https://assets.sequence.info/",dpe=5,hpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},kH=t=>t?hpe[t]||t:"medium",ppe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${kH(e)}/`),vpe=(t,e)=>upe+`images/networks/${kH(e)}/${t}.webp?v${dpe}`;function MH(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 RH={exports:{}},xm={};/** + )`,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={...PH,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={...PH,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"}},cB={sm:0,md:480,lg:769,xl:1281};var lB={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 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 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)},kH=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),kH(t));p7.properties=kH.properties;const upe="https://assets.sequence.info/",dpe=5,hpe={xs:"small",sm:"small",md:"medium",lg:"large",xl:"large"},MH=t=>t?hpe[t]||t:"medium",ppe=(t,e)=>t.replace(/\/(small|medium|large)\//,`/${MH(e)}/`),vpe=(t,e)=>upe+`images/networks/${MH(e)}/${t}.webp?v${dpe}`;function RH(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 OH={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 fB;function gpe(){if(fB)return xm;fB=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}RH.exports=gpe();var Y=RH.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 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 dB(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=dB(dB({},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 hB(t.variantClassNames,r=>hB(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 Iu=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(be,{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 He=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(be,{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(be,{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(be,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(be,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(He,{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(be,{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&&xh.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 OH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Mpe(t){return D.isValidElement(t)&&t.type===OH}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 YT(t,e){t&&xh.flushSync(()=>t.dispatchEvent(e))}var QT="Checkbox",[Npe,fUe]=Fs(QT),[Bpe,Lpe]=Npe(QT),DH=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":LH(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%)"}})]})});DH.displayName=QT;var NH="CheckboxIndicator",BH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Lpe(NH,r);return Y.jsx(oo,{present:n||lp(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":LH(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});BH.displayName=NH;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 LH(t){return lp(t)?"indeterminate":t?"checked":"unchecked"}var jpe=DH,Upe=BH,$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(be,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(He,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(He,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(be,{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"})}),FH=({size:t="sm",...e})=>Y.jsx(be,{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"})}),JT=({size:t="sm",...e})=>Y.jsx(be,{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"})}),jH=({size:t="sm",...e})=>Y.jsx(be,{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(be,{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(be,{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(be,{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(be,{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(JT,{size:t==="lg"?"sm":"xs"})}),ZT=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=Z$.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 XT="Collapsible",[r1e,uUe]=Fs(XT),[n1e,eP]=r1e(XT),UH=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":rP(c),"data-disabled":s?"":void 0,...a,ref:e})})});UH.displayName=XT;var $H="CollapsibleTrigger",qH=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=eP($H,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":rP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:ot(t.onClick,i.onOpenToggle)})});qH.displayName=$H;var tP="CollapsibleContent",VH=D.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=eP(tP,t.__scopeCollapsible);return Y.jsx(oo,{present:r||i.open,children:({present:s})=>Y.jsx(i1e,{...n,ref:e,present:s})})});VH.displayName=tP;var i1e=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=eP(tP,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":rP(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 rP(t){return t?"open":"closed"}var s1e=UH,o1e=qH,a1e=VH,pB="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 zH=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(be,{as:cp.div,className:pi(e,c1e),initial:{height:f?"auto":pB},animate:{height:f?"auto":pB},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(He,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(be,{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(jH,{className:u1e,color:"text50"})})]}),Y.jsx(IH,{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",vB,HH=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(HH),[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(le=>le.contains($));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),z=b1e(_=>{const $=_.target;[...l.branches].some(le=>le.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&&(vB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),gB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=vB)}},[f,p,r,l]),D.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),gB())},[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",GH=D.forwardRef((t,e)=>{const r=D.useContext(HH),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})});GH.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(){WH(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&&WH(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 gB(){const t=new CustomEvent(g7);document.dispatchEvent(t)}function WH(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?YT(i,s):i.dispatchEvent(s)}var w1e=vy,x1e=GH,OA=0;function nP(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yB()),document.body.insertAdjacentElement("beforeend",t[1]??yB()),OA++,()=>{OA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),OA--}},[])}function yB(){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",mB={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:id(u.current,{select:!0})},I=function(O){if(g.paused||!a)return;const L=O.relatedTarget;L!==null&&(a.contains(L)||id(u.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const F of O)F.removedNodes.length>0&&id(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){wB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(DA,mB);a.addEventListener(DA,l),a.dispatchEvent(C),C.defaultPrevented||(C1e(T1e(KH(a)),{select:!0}),document.activeElement===b&&id(a))}return()=>{a.removeEventListener(DA,l),setTimeout(()=>{const C=new CustomEvent(NA,mB);a.addEventListener(NA,f),a.dispatchEvent(C),C.defaultPrevented||id(b??document.body,{select:!0}),a.removeEventListener(NA,f),wB.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&&id(O,{select:!0})):b.shiftKey&&C===O&&(b.preventDefault(),r&&id(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(id(n,{select:e}),document.activeElement!==r)return}function A1e(t){const e=KH(t),r=bB(e,t),n=bB(e.reverse(),t);return[r,n]}function KH(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 bB(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 id(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&_1e(t)&&e&&t.select()}}var wB=I1e();function I1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=xB(t,e),t.unshift(e)},remove(e){var r;t=xB(t,e),(r=t[0])==null||r.resume()}}}function xB(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,sh=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 iP(t){return t==="x"?"y":"x"}function sP(t){return t==="y"?"height":"width"}function oh(t){return["top","bottom"].includes(vu(t))?"y":"x"}function oP(t){return iP(oh(t))}function R1e(t,e,r){r===void 0&&(r=!1);const n=gy(t),i=oP(t),s=sP(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 YH(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 EB(t,e,r){let{reference:n,floating:i}=t;const s=oh(e),o=oP(e),a=sP(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}=EB(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=YH(f),p={x:r,y:n},g=oP(i),y=sP(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,le=Rl(u[C],ie),K=Rl(u[S],ie),k=le,R=_-b[y]-K,v=_/2-b[y]/2+$,m=y7(k,v,R),M=!c.arrow&&gy(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,k;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:le},reset:{placement:m}};let M=(k=le.filter(N=>N.overflows[0]<=0).sort((N,x)=>N.overflows[1]-x.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(g){case"bestFit":{var R;const N=(R=le.filter(x=>{if(z){const E=oh(x.placement);return E===S||E==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(E=>E>0).reduce((E,w)=>E+w,0)]).sort((x,E)=>x[1]-E[1])[0])==null?void 0:R[0];N&&(M=N);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function CB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function AB(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=CB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:AB(o)}}}case"escaped":{const s=await aw(e,{...i,altBoundary:!0}),o=CB(s,r.floating);return{data:{escapedOffsets:o,escaped:AB(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=oh(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=oh(vu(i)),p=iP(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=oh(i),p=iP(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=oh(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),le=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*(le!==0||K!==0?le+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 QH(t)?(t.nodeName||"").toLowerCase():"#document"}function aa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tu(t){var e;return(e=(QH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function QH(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 SB(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 aP(t){const e=cP(),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=ah(t);for(;zl(e)&&!Hg(e);){if(Y4(e))return null;if(aP(e))return e;e=ah(e)}return null}function cP(){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 ah(t){if(yy(t)==="html")return t;const e=t.assignedSlot||t.parentNode||SB(t)&&t.host||Tu(t);return SB(e)?e.host:e}function JH(t){const e=ah(t);return Hg(e)?t.ownerDocument?t.ownerDocument.body:t.body:zl(e)&&ox(e)?e:JH(e)}function cw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=JH(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 ZH(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 lP(t){return Vl(t)?t:t.contextElement}function Iv(t){const e=lP(t);if(!zl(e))return sh(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=ZH(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=sh(0);function XH(t){const e=aa(t);return!cP()||!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=lP(t);let o=sh(1);e&&(n?Vl(n)&&(o=Iv(n)):o=Iv(t));const a=Y1e(s,r,n)?XH(s):sh(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=Tu(n),a=e?Y4(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=sh(1);const f=sh(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 eG(t){return Ap(Tu(t)).left+Q4(t).scrollLeft}function Z1e(t){const e=Tu(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+eG(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=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=cP();(!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):sh(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 _B(t,e,r){let n;if(e==="viewport")n=X1e(t,r);else if(e==="document")n=Z1e(Tu(t));else if(Vl(e))n=eve(e,r);else{const i=XH(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return p5(n)}function tG(t,e){const r=ah(t);return r===e||!Vl(r)||Hg(r)?!1:zc(r).position==="fixed"||tG(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?ah(t):t;for(;Vl(o)&&!Hg(o);){const a=zc(o),c=aP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ox(o)&&!c&&tG(t,o))?n=n.filter(f=>f!==o):i=a,o=ah(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=_B(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},_B(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}=ZH(t);return{width:e,height:r}}function ive(t,e,r){const n=zl(e),i=Tu(e),s=r==="fixed",o=Ap(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=sh(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=eG(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 IB(t,e){return!zl(t)||zc(t).position==="fixed"?null:e?e(t):t.offsetParent}function rG(t,e){const r=aa(t);if(Y4(t))return r;if(!zl(t)){let i=ah(t);for(;i&&!Hg(i);){if(Vl(i)&&!BA(i))return i;i=ah(i)}return r}let n=IB(t,e);for(;n&&G1e(n)&&BA(n);)n=IB(n,e);return n&&Hg(n)&&BA(n)&&!aP(n)?r:n||W1e(t)||r}const sve=async function(t){const e=this.getOffsetParent||rG,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:Tu,getClippingRect:rve,getOffsetParent:rG,getElementRects:sve,getClientRects:J1e,getDimensions:nve,getScale:Iv,isElement:Vl,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=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=lP(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,TB=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 nG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function PB(t,e){const r=nG(t);return Math.round(e*r)/r}function kB(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(N=>{N!==z.current&&(z.current=N,b(N))},[]),O=D.useCallback(N=>{N!==_.current&&(_.current=N,C(N))},[]),L=s||y,F=o||I,z=D.useRef(null),_=D.useRef(null),$=D.useRef(f),ie=c!=null,le=kB(c),K=kB(i),k=D.useCallback(()=>{if(!z.current||!_.current)return;const N={placement:e,strategy:r,middleware:p};K.current&&(N.platform=K.current),gve(z.current,_.current,N).then(x=>{const E={...x,isPositioned:!0};R.current&&!v5($.current,E)&&($.current=E,xh.flushSync(()=>{u(E)}))})},[p,e,r,K]);Y6(()=>{l===!1&&$.current.isPositioned&&($.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[l]);const R=D.useRef(!1);Y6(()=>(R.current=!0,()=>{R.current=!1}),[]),Y6(()=>{if(L&&(z.current=L),F&&(_.current=F),L&&F){if(le.current)return le.current(L,F,k);k()}},[L,F,k,le,ie]);const v=D.useMemo(()=>({reference:z,floating:_,setReference:S,setFloating:O}),[S,O]),m=D.useMemo(()=>({reference:L,floating:F}),[L,F]),M=D.useMemo(()=>{const N={position:r,left:0,top:0};if(!m.floating)return N;const x=PB(m.floating,f.x),E=PB(m.floating,f.y);return a?{...N,transform:"translate("+x+"px, "+E+"px)",...nG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:x,top:E}},[r,a,m.floating,f.x,f.y]);return D.useMemo(()=>({...f,update:k,refs:v,elements:m,floatingStyles:M}),[f,k,v,m,M])}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?TB({element:n.current,padding:i}).fn(r):{}:n?TB({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",iG=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"})})});iG.displayName=_ve;var Ive=iG,fP="Popper",[sG,my]=Fs(fP),[Tve,oG]=sG(fP),aG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=D.useState(null);return Y.jsx(Tve,{scope:e,anchor:n,onAnchorChange:i,children:r})};aG.displayName=fP;var cG="PopperAnchor",lG=D.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=oG(cG,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})});lG.displayName=cG;var uP="PopperContent",[Pve,kve]=sG(uP),fG=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=oG(uP,c),[_,$]=D.useState(null),ie=kr(e,Ee=>$(Ee)),[le,K]=D.useState(null),k=H4(le),R=(k==null?void 0:k.width)??0,v=(k==null?void 0:k.height)??0,m=l+(u!=="center"?"-"+u:""),M=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},N=Array.isArray(b)?b:[b],x=N.length>0,E={padding:M,boundary:N.filter(Rve),altBoundary:x},{refs:w,floatingStyles:T,placement:P,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,...E}),y&&Eve({...E}),Cve({...E,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`)}}),le&&Sve({element:le,padding:g}),Ove({arrowWidth:R,arrowHeight:v}),S&&Ave({strategy:"referenceHidden",...E})]}),[j,X]=hG(P),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,B=((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:B,children:Y.jsx(jt.div,{"data-side":j,"data-align":X,...F,ref:ie,style:{...F.style,animation:H?void 0:"none"}})})})});fG.displayName=uP;var uG="PopperArrow",Mve={top:"bottom",right:"left",bottom:"top",left:"right"},dG=D.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=kve(uG,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"}})})});dG.displayName=uG;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]=hG(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 hG(t){const[e,r="center"]=t.split("-");return[e,r]}var dP=aG,hP=lG,pP=fG,vP=dG,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,pG,Bve]=W4(J4),[Lve,by]=Fs(J4,[Bve]),[Fve,jve]=Lve(J4),vG=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})})}));vG.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=pG(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 le=new CustomEvent(LA,Nve);if($.currentTarget.dispatchEvent(le),!le.defaultPrevented){const K=L().filter(M=>M.focusable),k=K.find(M=>M.active),R=K.find(M=>M.id===b),m=[k,R,...K].filter(Boolean).map(M=>M.ref.current);mG(m,f)}}F.current=!1}),onBlur:ot(t.onBlur,()=>S(!1))})})}),gG="RovingFocusGroupItem",yG=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Wa(),c=s||a,l=jve(gG,r),f=l.currentTabStopId===c,u=pG(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(()=>mG(C))}})})})});yG.displayName=gG;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 mG(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 gP=vG,yP=yG,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,bG=function(t){return t&&(t.host||bG(t.parentNode))},Gve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=bG(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={})}},mP=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=CG(),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"),` + */var uB;function gpe(){if(uB)return xm;uB=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}OH.exports=gpe();var Y=OH.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 dB(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 hB(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=hB(hB({},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 pB(t.variantClassNames,r=>pB(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 Iu=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return Y.jsx(be,{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 He=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(be,{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(be,{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(be,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:p==="xs"?"1":"2",children:[Y.jsxs(be,{justifyContent:"flex-start",alignItems:"center",gap:p==="xs"?"1":"2",children:[f&&Y.jsx(f,{size:F}),Y.jsx(He,{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(be,{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&&xh.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 DH=({children:t})=>Y.jsx(Y.Fragment,{children:t});function Mpe(t){return D.isValidElement(t)&&t.type===DH}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 YT(t,e){t&&xh.flushSync(()=>t.dispatchEvent(e))}var QT="Checkbox",[Npe,fUe]=Fs(QT),[Bpe,Lpe]=Npe(QT),NH=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":FH(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%)"}})]})});NH.displayName=QT;var BH="CheckboxIndicator",LH=D.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Lpe(BH,r);return Y.jsx(oo,{present:n||lp(s.state)||s.state===!0,children:Y.jsx(jt.span,{"data-state":FH(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});LH.displayName=BH;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 FH(t){return lp(t)?"indeterminate":t?"checked":"unchecked"}var jpe=NH,Upe=LH,$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(be,{flexDirection:"column",gap:"0.5",children:[r&&Y.jsx(He,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Y.jsx(He,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Y.jsxs(be,{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"})}),jH=({size:t="sm",...e})=>Y.jsx(be,{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"})}),JT=({size:t="sm",...e})=>Y.jsx(be,{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"})}),UH=({size:t="sm",...e})=>Y.jsx(be,{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"})}),Hg=({size:t="sm",...e})=>Y.jsx(be,{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(be,{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(be,{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(be,{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(JT,{size:t==="lg"?"sm":"xs"})}),ZT=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=X$.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 XT="Collapsible",[r1e,uUe]=Fs(XT),[n1e,eP]=r1e(XT),$H=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":rP(c),"data-disabled":s?"":void 0,...a,ref:e})})});$H.displayName=XT;var qH="CollapsibleTrigger",VH=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=eP(qH,r);return Y.jsx(jt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":rP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:e,onClick:ot(t.onClick,i.onOpenToggle)})});VH.displayName=qH;var tP="CollapsibleContent",zH=D.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=eP(tP,t.__scopeCollapsible);return Y.jsx(oo,{present:r||i.open,children:({present:s})=>Y.jsx(i1e,{...n,ref:e,present:s})})});zH.displayName=tP;var i1e=D.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=eP(tP,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":rP(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 rP(t){return t?"open":"closed"}var s1e=$H,o1e=VH,a1e=zH,vB="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 HH=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(be,{as:cp.div,className:pi(e,c1e),initial:{height:f?"auto":vB},animate:{height:f?"auto":vB},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(He,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),Y.jsx(be,{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(UH,{className:u1e,color:"text50"})})]}),Y.jsx(TH,{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",gB,GH=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gy=D.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=D.useContext(GH),[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(le=>le.contains($));!L||ie||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},p),z=b1e(_=>{const $=_.target;[...l.branches].some(le=>le.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&&(gB=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),yB(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=gB)}},[f,p,r,l]),D.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),yB())},[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)})});gy.displayName=p1e;var y1e="DismissableLayerBranch",WH=D.forwardRef((t,e)=>{const r=D.useContext(GH),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})});WH.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(){KH(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&&KH(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 yB(){const t=new CustomEvent(g7);document.dispatchEvent(t)}function KH(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?YT(i,s):i.dispatchEvent(s)}var w1e=gy,x1e=WH,OA=0;function nP(){D.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??mB()),document.body.insertAdjacentElement("beforeend",t[1]??mB()),OA++,()=>{OA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),OA--}},[])}function mB(){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",bB={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:id(u.current,{select:!0})},I=function(O){if(g.paused||!a)return;const L=O.relatedTarget;L!==null&&(a.contains(L)||id(u.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const F of O)F.removedNodes.length>0&&id(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){xB.add(g);const b=document.activeElement;if(!a.contains(b)){const C=new CustomEvent(DA,bB);a.addEventListener(DA,l),a.dispatchEvent(C),C.defaultPrevented||(C1e(T1e(YH(a)),{select:!0}),document.activeElement===b&&id(a))}return()=>{a.removeEventListener(DA,l),setTimeout(()=>{const C=new CustomEvent(NA,bB);a.addEventListener(NA,f),a.dispatchEvent(C),C.defaultPrevented||id(b??document.body,{select:!0}),a.removeEventListener(NA,f),xB.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&&id(O,{select:!0})):b.shiftKey&&C===O&&(b.preventDefault(),r&&id(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(id(n,{select:e}),document.activeElement!==r)return}function A1e(t){const e=YH(t),r=wB(e,t),n=wB(e.reverse(),t);return[r,n]}function YH(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 wB(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 id(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&_1e(t)&&e&&t.select()}}var xB=I1e();function I1e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=EB(t,e),t.unshift(e)},remove(e){var r;t=EB(t,e),(r=t[0])==null||r.resume()}}}function EB(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,sh=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 yy(t){return t.split("-")[1]}function iP(t){return t==="x"?"y":"x"}function sP(t){return t==="y"?"height":"width"}function oh(t){return["top","bottom"].includes(vu(t))?"y":"x"}function oP(t){return iP(oh(t))}function R1e(t,e,r){r===void 0&&(r=!1);const n=yy(t),i=oP(t),s=sP(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=yy(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 QH(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 CB(t,e,r){let{reference:n,floating:i}=t;const s=oh(e),o=oP(e),a=sP(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(yy(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}=CB(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=QH(f),p={x:r,y:n},g=oP(i),y=sP(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,le=Rl(u[C],ie),K=Rl(u[S],ie),k=le,R=_-b[y]-K,v=_/2-b[y]/2+$,m=y7(k,v,R),M=!c.arrow&&yy(i)!=null&&v!==m&&s.reference[y]/2-(vv<=0)){var K,k;const v=(((K=s.flip)==null?void 0:K.index)||0)+1,m=_[v];if(m)return{data:{index:v,overflows:le},reset:{placement:m}};let M=(k=le.filter(N=>N.overflows[0]<=0).sort((N,x)=>N.overflows[1]-x.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(g){case"bestFit":{var R;const N=(R=le.filter(x=>{if(z){const E=oh(x.placement);return E===S||E==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(E=>E>0).reduce((E,w)=>E+w,0)]).sort((x,E)=>x[1]-E[1])[0])==null?void 0:R[0];N&&(M=N);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function AB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function SB(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=AB(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:SB(o)}}}case"escaped":{const s=await aw(e,{...i,altBoundary:!0}),o=AB(s,r.floating);return{data:{escapedOffsets:o,escaped:SB(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=yy(r),c=oh(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=oh(vu(i)),p=iP(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=oh(i),p=iP(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=yy(r),u=oh(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),le=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*(le!==0||K!==0?le+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 my(t){return JH(t)?(t.nodeName||"").toLowerCase():"#document"}function aa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tu(t){var e;return(e=(JH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function JH(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 _B(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(my(t))}function Y4(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function aP(t){const e=cP(),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=ah(t);for(;zl(e)&&!Gg(e);){if(Y4(e))return null;if(aP(e))return e;e=ah(e)}return null}function cP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gg(t){return["html","body","#document"].includes(my(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 ah(t){if(my(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_B(t)&&t.host||Tu(t);return _B(e)?e.host:e}function ZH(t){const e=ah(t);return Gg(e)?t.ownerDocument?t.ownerDocument.body:t.body:zl(e)&&ox(e)?e:ZH(e)}function cw(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=ZH(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 XH(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 lP(t){return Vl(t)?t:t.contextElement}function Tv(t){const e=lP(t);if(!zl(e))return sh(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=XH(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=sh(0);function eG(t){const e=aa(t);return!cP()||!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=lP(t);let o=sh(1);e&&(n?Vl(n)&&(o=Tv(n)):o=Tv(t));const a=Y1e(s,r,n)?eG(s):sh(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=Tv(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=Tu(n),a=e?Y4(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=sh(1);const f=sh(0),u=zl(n);if((u||!u&&!s)&&((my(n)!=="body"||ox(o))&&(c=Q4(n)),zl(n))){const p=Ap(n);l=Tv(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 tG(t){return Ap(Tu(t)).left+Q4(t).scrollLeft}function Z1e(t){const e=Tu(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+tG(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=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=cP();(!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)?Tv(t):sh(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 IB(t,e,r){let n;if(e==="viewport")n=X1e(t,r);else if(e==="document")n=Z1e(Tu(t));else if(Vl(e))n=eve(e,r);else{const i=eG(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return p5(n)}function rG(t,e){const r=ah(t);return r===e||!Vl(r)||Gg(r)?!1:zc(r).position==="fixed"||rG(r,e)}function tve(t,e){const r=e.get(t);if(r)return r;let n=cw(t,[],!1).filter(a=>Vl(a)&&my(a)!=="body"),i=null;const s=zc(t).position==="fixed";let o=s?ah(t):t;for(;Vl(o)&&!Gg(o);){const a=zc(o),c=aP(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ox(o)&&!c&&rG(t,o))?n=n.filter(f=>f!==o):i=a,o=ah(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=IB(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},IB(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}=XH(t);return{width:e,height:r}}function ive(t,e,r){const n=zl(e),i=Tu(e),s=r==="fixed",o=Ap(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=sh(0);if(n||!n&&!s)if((my(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=tG(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 TB(t,e){return!zl(t)||zc(t).position==="fixed"?null:e?e(t):t.offsetParent}function nG(t,e){const r=aa(t);if(Y4(t))return r;if(!zl(t)){let i=ah(t);for(;i&&!Gg(i);){if(Vl(i)&&!BA(i))return i;i=ah(i)}return r}let n=TB(t,e);for(;n&&G1e(n)&&BA(n);)n=TB(n,e);return n&&Gg(n)&&BA(n)&&!aP(n)?r:n||W1e(t)||r}const sve=async function(t){const e=this.getOffsetParent||nG,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:Tu,getClippingRect:rve,getOffsetParent:nG,getElementRects:sve,getClientRects:J1e,getDimensions:nve,getScale:Tv,isElement:Vl,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=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=lP(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,PB=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 iG(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function kB(t,e){const r=iG(t);return Math.round(e*r)/r}function MB(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(N=>{N!==z.current&&(z.current=N,b(N))},[]),O=D.useCallback(N=>{N!==_.current&&(_.current=N,C(N))},[]),L=s||y,F=o||I,z=D.useRef(null),_=D.useRef(null),$=D.useRef(f),ie=c!=null,le=MB(c),K=MB(i),k=D.useCallback(()=>{if(!z.current||!_.current)return;const N={placement:e,strategy:r,middleware:p};K.current&&(N.platform=K.current),gve(z.current,_.current,N).then(x=>{const E={...x,isPositioned:!0};R.current&&!v5($.current,E)&&($.current=E,xh.flushSync(()=>{u(E)}))})},[p,e,r,K]);Y6(()=>{l===!1&&$.current.isPositioned&&($.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[l]);const R=D.useRef(!1);Y6(()=>(R.current=!0,()=>{R.current=!1}),[]),Y6(()=>{if(L&&(z.current=L),F&&(_.current=F),L&&F){if(le.current)return le.current(L,F,k);k()}},[L,F,k,le,ie]);const v=D.useMemo(()=>({reference:z,floating:_,setReference:S,setFloating:O}),[S,O]),m=D.useMemo(()=>({reference:L,floating:F}),[L,F]),M=D.useMemo(()=>{const N={position:r,left:0,top:0};if(!m.floating)return N;const x=kB(m.floating,f.x),E=kB(m.floating,f.y);return a?{...N,transform:"translate("+x+"px, "+E+"px)",...iG(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:x,top:E}},[r,a,m.floating,f.x,f.y]);return D.useMemo(()=>({...f,update:k,refs:v,elements:m,floatingStyles:M}),[f,k,v,m,M])}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?PB({element:n.current,padding:i}).fn(r):{}:n?PB({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",sG=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"})})});sG.displayName=_ve;var Ive=sG,fP="Popper",[oG,by]=Fs(fP),[Tve,aG]=oG(fP),cG=t=>{const{__scopePopper:e,children:r}=t,[n,i]=D.useState(null);return Y.jsx(Tve,{scope:e,anchor:n,onAnchorChange:i,children:r})};cG.displayName=fP;var lG="PopperAnchor",fG=D.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=aG(lG,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})});fG.displayName=lG;var uP="PopperContent",[Pve,kve]=oG(uP),uG=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=aG(uP,c),[_,$]=D.useState(null),ie=kr(e,Ee=>$(Ee)),[le,K]=D.useState(null),k=H4(le),R=(k==null?void 0:k.width)??0,v=(k==null?void 0:k.height)??0,m=l+(u!=="center"?"-"+u:""),M=typeof I=="number"?I:{top:0,right:0,bottom:0,left:0,...I},N=Array.isArray(b)?b:[b],x=N.length>0,E={padding:M,boundary:N.filter(Rve),altBoundary:x},{refs:w,floatingStyles:T,placement:P,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,...E}),y&&Eve({...E}),Cve({...E,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`)}}),le&&Sve({element:le,padding:g}),Ove({arrowWidth:R,arrowHeight:v}),S&&Ave({strategy:"referenceHidden",...E})]}),[j,X]=pG(P),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,B=((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:B,children:Y.jsx(jt.div,{"data-side":j,"data-align":X,...F,ref:ie,style:{...F.style,animation:H?void 0:"none"}})})})});uG.displayName=uP;var dG="PopperArrow",Mve={top:"bottom",right:"left",bottom:"top",left:"right"},hG=D.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=kve(dG,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"}})})});hG.displayName=dG;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]=pG(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 pG(t){const[e,r="center"]=t.split("-");return[e,r]}var dP=cG,hP=fG,pP=uG,vP=hG,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,vG,Bve]=W4(J4),[Lve,wy]=Fs(J4,[Bve]),[Fve,jve]=Lve(J4),gG=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})})}));gG.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=vG(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 le=new CustomEvent(LA,Nve);if($.currentTarget.dispatchEvent(le),!le.defaultPrevented){const K=L().filter(M=>M.focusable),k=K.find(M=>M.active),R=K.find(M=>M.id===b),m=[k,R,...K].filter(Boolean).map(M=>M.ref.current);bG(m,f)}}F.current=!1}),onBlur:ot(t.onBlur,()=>S(!1))})})}),yG="RovingFocusGroupItem",mG=D.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Wa(),c=s||a,l=jve(yG,r),f=l.currentTabStopId===c,u=vG(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(()=>bG(C))}})})})});mG.displayName=yG;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 bG(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 gP=gG,yP=mG,Hve=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},k1=new WeakMap,X2=new WeakMap,e6={},FA=0,wG=function(t){return t&&(t.host||wG(t.parentNode))},Gve=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=wG(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=(k1.get(p)||0)+1,I=(s.get(p)||0)+1;k1.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=k1.get(u)-1,g=s.get(u)-1;k1.set(u,p),s.set(u,g),p||(X2.has(u)||u.removeAttribute(n),X2.delete(u)),g||u.removeAttribute(r)}),FA--,FA||(k1=new WeakMap,k1=new WeakMap,X2=new WeakMap,e6={})}},mP=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=AG(),Pv="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(Tv,`] { + body[`).concat(Pv,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` @@ -92,30 +92,30 @@ Error generating stack: `+s.message+` margin-right: 0 `).concat(n,`; } - body[`).concat(Tv,`] { + body[`).concat(Pv,`] { `).concat(Qve,": ").concat(a,`px; } -`)},RB=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,(RB()+1).toString()),function(){var t=RB()-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"},AG=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 AG(t,"overflowY")},bge=function(t){return AG(t,"overflowX")},OB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=SG(t,n);if(i){var s=_G(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]},SG=function(t,e){return t==="v"?mge(e):bge(e)},_G=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=_G(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&SG(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]},DB=function(t){return[t.deltaX,t.deltaY]},NB=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` +`)},OB=function(){var t=parseInt(document.body.getAttribute(Pv)||"0",10);return isFinite(t)?t:0},vge=function(){D.useEffect(function(){return document.body.setAttribute(Pv,(OB()+1).toString()),function(){var t=OB()-1;t<=0?document.body.removeAttribute(Pv):document.body.setAttribute(Pv,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 M1=w7?{passive:!1}:!1,yge=function(t){return t.tagName==="TEXTAREA"},SG=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 SG(t,"overflowY")},bge=function(t){return SG(t,"overflowX")},DB=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=_G(t,n);if(i){var s=IG(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]},_G=function(t,e){return t==="v"?mge(e):bge(e)},IG=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=IG(t,a),y=g[0],b=g[1],I=g[2],C=b-I-s*y;(y||C)&&_G(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]},NB=function(t){return[t.deltaX,t.deltaY]},BB=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,M1=[];function Ige(t){var e=D.useRef([]),r=D.useRef([0,0]),n=D.useRef(),i=D.useState(_ge++)[0],s=D.useState(CG)[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(NB)).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 $=OB(_,z);if(!$)return!0;if($?F=_:(F=_==="v"?"h":"v",$=OB(_,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?DB(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(NB).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,DB(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(EG,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"],IG=["ArrowUp","PageDown","End"],Mge=[...kge,...IG],Rge={ltr:[...x7,"ArrowRight"],rtl:[...x7,"ArrowLeft"]},Oge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cx="Menu",[lw,Dge,Nge]=W4(cx),[Hp,TG]=Fs(cx,[Nge,my,by]),e8=my(),PG=by(),[Bge,Gp]=Hp(cx),[Lge,lx]=Hp(cx),kG=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(dP,{...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})})})};kG.displayName=cx;var Fge="MenuAnchor",bP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(hP,{...i,...n,ref:e})});bP.displayName=Fge;var wP="MenuPortal",[jge,MG]=Hp(wP,{forceMount:void 0}),RG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Gp(wP,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})})})};RG.displayName=wP;var Ka="MenuContent",[Uge,xP]=Hp(Ka),OG=D.forwardRef((t,e)=>{const r=MG(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 mP(s)},[]),Y.jsx(EP,{...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(EP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),EP=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=PG(r),L=Dge(r),[F,z]=D.useState(null),_=D.useRef(null),$=kr(e,_,I.onContentChange),ie=D.useRef(0),le=D.useRef(""),K=D.useRef(0),k=D.useRef(null),R=D.useRef("right"),v=D.useRef(0),m=y?X4:D.Fragment,M=y?{as:Cp,allowPinchZoom:!0}:void 0,N=E=>{var w,T;const P=le.current+E,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,P,j),Z=(T=H.find(ee=>ee.textValue===G))==null?void 0:T.ref.current;(function ee(B){le.current=B,window.clearTimeout(ie.current),B!==""&&(ie.current=window.setTimeout(()=>ee(""),1e3))})(P),Z&&setTimeout(()=>Z.focus())};D.useEffect(()=>()=>window.clearTimeout(ie.current),[]),nP();const x=D.useCallback(E=>{var w,T;return R.current===((w=k.current)==null?void 0:w.side)&&rye(E,(T=k.current)==null?void 0:T.area)},[]);return Y.jsx(Uge,{scope:r,searchRef:le,onItemEnter:D.useCallback(E=>{x(E)&&E.preventDefault()},[x]),onItemLeave:D.useCallback(E=>{var w;x(E)||((w=_.current)==null||w.focus(),z(null))},[x]),onTriggerLeave:D.useCallback(E=>{x(E)&&E.preventDefault()},[x]),pointerGraceTimerRef:K,onPointerGraceIntentChange:D.useCallback(E=>{k.current=E},[]),children:Y.jsx(m,{...M,children:Y.jsx(K4,{asChild:!0,trapped:i,onMountAutoFocus:ot(s,E=>{var w;E.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(gP,{asChild:!0,...O,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:z,onEntryFocus:ot(c,E=>{C.isUsingKeyboardRef.current||E.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(pP,{role:"menu","aria-orientation":"vertical","data-state":YG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:$,style:{outline:"none",...b.style},onKeyDown:ot(b.onKeyDown,E=>{const T=E.target.closest("[data-radix-menu-content]")===E.currentTarget,P=E.ctrlKey||E.altKey||E.metaKey,H=E.key.length===1;T&&(E.key==="Tab"&&E.preventDefault(),!P&&H&&N(E.key));const oe=_.current;if(E.target!==oe||!Mge.includes(E.key))return;E.preventDefault();const X=L().filter(G=>!G.disabled).map(G=>G.ref.current);IG.includes(E.key)&&X.reverse(),Zge(X)}),onBlur:ot(t.onBlur,E=>{E.currentTarget.contains(E.target)||(window.clearTimeout(ie.current),le.current="")}),onPointerMove:ot(t.onPointerMove,fw(E=>{const w=E.target,T=v.current!==E.clientX;if(E.currentTarget.contains(w)&&T){const P=E.clientX>v.current?"right":"left";R.current=P,v.current=E.clientX}}))})})})})})})});OG.displayName=Ka;var Vge="MenuGroup",CP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});CP.displayName=Vge;var zge="MenuLabel",DG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});DG.displayName=zge;var g5="MenuItem",BB="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=xP(g5,t.__scopeMenu),c=kr(e,s),l=D.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent(BB,{bubbles:!0,cancelable:!0});u.addEventListener(BB,g=>n==null?void 0:n(g),{once:!0}),YT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(NG,{...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 NG=D.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=xP(g5,r),a=PG(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(yP,{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",BG=D.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx($G,{scope:t.__scopeMenu,checked:r,children:Y.jsx(t8,{role:"menuitemcheckbox","aria-checked":y5(r)?"mixed":r,...i,ref:e,"data-state":SP(r),onSelect:ot(i.onSelect,()=>n==null?void 0:n(y5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});BG.displayName=Hge;var LG="MenuRadioGroup",[Gge,Wge]=Hp(LG,{value:void 0,onValueChange:()=>{}}),FG=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(CP,{...i,ref:e})})});FG.displayName=LG;var jG="MenuRadioItem",UG=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=Wge(jG,t.__scopeMenu),s=r===i.value;return Y.jsx($G,{scope:t.__scopeMenu,checked:s,children:Y.jsx(t8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":SP(s),onSelect:ot(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});UG.displayName=jG;var AP="MenuItemIndicator",[$G,Kge]=Hp(AP,{checked:!1}),qG=D.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Kge(AP,r);return Y.jsx(oo,{present:n||y5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":SP(s.checked)})})});qG.displayName=AP;var Yge="MenuSeparator",VG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});VG.displayName=Yge;var Qge="MenuArrow",zG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(vP,{...i,...n,ref:e})});zG.displayName=Qge;var Jge="MenuSub",[dUe,HG]=Hp(Jge),Gm="MenuSubTrigger",GG=D.forwardRef((t,e)=>{const r=Gp(Gm,t.__scopeMenu),n=lx(Gm,t.__scopeMenu),i=HG(Gm,t.__scopeMenu),s=xP(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(bP,{asChild:!0,...l,children:Y.jsx(NG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":YG(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())})})})});GG.displayName=Gm;var WG="MenuSubContent",KG=D.forwardRef((t,e)=>{const r=MG(Ka,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(Ka,t.__scopeMenu),o=lx(Ka,t.__scopeMenu),a=HG(WG,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(EP,{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())})})})})})});KG.displayName=WG;function YG(t){return t?"open":"closed"}function y5(t){return t==="indeterminate"}function SP(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=kG,iye=bP,sye=RG,oye=OG,aye=CP,cye=DG,lye=t8,fye=BG,uye=FG,dye=UG,hye=qG,pye=VG,vye=zG,gye=GG,yye=KG,_P="DropdownMenu",[mye,hUe]=Fs(_P,[TG]),ao=TG(),[bye,QG]=mye(_P),JG=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})})};JG.displayName=_P;var ZG="DropdownMenuTrigger",XG=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=QG(ZG,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())})})})});XG.displayName=ZG;var wye="DropdownMenuPortal",xye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=ao(e);return Y.jsx(sye,{...n,...r})};xye.displayName=wye;var eW="DropdownMenuContent",tW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=QG(eW,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)"}})});tW.displayName=eW;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",rW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(lye,{...i,...n,ref:e})});rW.displayName=_ye;var Iye="DropdownMenuCheckboxItem",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(fye,{...i,...n,ref:e})});nW.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",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(dye,{...i,...n,ref:e})});iW.displayName=kye;var Mye="DropdownMenuItemIndicator",sW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(hye,{...i,...n,ref:e})});sW.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",oW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(vye,{...i,...n,ref:e})});oW.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=JG,Uye=XG,$ye=tW,qye=rW,Vye=nW,zye=iW,aW=sW,Hye=oW,Gye="_1k2mbvi1 _1k2mbvi0 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr1v4 fyvr1x8 fyvr1zc fyvr111g fyvr11r0 fyvr11xx",Wye="_1k2mbvi2",IP="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",cW="_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(IP,t),asChild:!0,...r,children:Y.jsx(be,{children:Y.jsx(He,{variant:"small",children:e})})}),Zye=({children:t})=>Y.jsx(aW,{className:cW,children:t});D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Vye,{className:pi(IP,t),...r,ref:n,children:[Y.jsx(Zye,{children:Y.jsx(JT,{size:"xs"})}),Y.jsx(He,{variant:"small",children:e})]}));D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(zye,{className:pi(IP,t),...r,ref:n,children:[Y.jsx(aW,{className:cW,children:Y.jsx(He,{children:"•"})}),Y.jsx(He,{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(be,{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(be,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(He,{ellipsis:!0,children:b.name}),Y.jsxs(He,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(He,{ellipsis:!0,children:f}),Y.jsx(be,{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(be,{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(be,{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 TP="Dialog",[lW,pUe]=Fs(TP),[ame,Kc]=lW(TP),fW=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})};fW.displayName=TP;var uW="DialogTrigger",cme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(uW,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":MP(i.open),...n,ref:s,onClick:ot(t.onClick,i.onOpenToggle)})});cme.displayName=uW;var PP="DialogPortal",[lme,dW]=lW(PP,{forceMount:void 0}),hW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Kc(PP,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})}))})};hW.displayName=PP;var m5="DialogOverlay",pW=D.forwardRef((t,e)=>{const r=dW(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});pW.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":MP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Sp="DialogContent",vW=D.forwardRef((t,e)=>{const r=dW(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})})});vW.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 mP(s)},[]),Y.jsx(gW,{...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(gW,{...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()}})}),gW=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 nP(),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":MP(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})]})]})}),kP="DialogTitle",hme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(kP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});hme.displayName=kP;var yW="DialogDescription",pme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(yW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});pme.displayName=yW;var mW="DialogClose",bW=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(mW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,()=>i.onOpenChange(!1))})});bW.displayName=mW;function MP(t){return t?"open":"closed"}var wW="DialogTitleWarning",[vUe,xW]=Spe(wW,{contentName:Sp,titleName:kP,docsSlug:"dialog"}),vme=({titleId:t})=>{const e=xW(wW),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},_ge=0,R1=[];function Ige(t){var e=D.useRef([]),r=D.useRef([0,0]),n=D.useRef(),i=D.useState(_ge++)[0],s=D.useState(AG)[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(BB)).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 $=DB(_,z);if(!$)return!0;if($?F=_:(F=_==="v"?"h":"v",$=DB(_,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(!(!R1.length||R1[R1.length-1]!==s)){var C="deltaY"in I?NB(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(BB).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,NB(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 R1.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",c,M1),document.addEventListener("touchmove",c,M1),document.addEventListener("touchstart",f,M1),function(){R1=R1.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,M1),document.removeEventListener("touchmove",c,M1),document.removeEventListener("touchstart",f,M1)}},[]);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(CG,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"],TG=["ArrowUp","PageDown","End"],Mge=[...kge,...TG],Rge={ltr:[...x7,"ArrowRight"],rtl:[...x7,"ArrowLeft"]},Oge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cx="Menu",[lw,Dge,Nge]=W4(cx),[Hp,PG]=Fs(cx,[Nge,by,wy]),e8=by(),kG=wy(),[Bge,Gp]=Hp(cx),[Lge,lx]=Hp(cx),MG=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(dP,{...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})})})};MG.displayName=cx;var Fge="MenuAnchor",bP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(hP,{...i,...n,ref:e})});bP.displayName=Fge;var wP="MenuPortal",[jge,RG]=Hp(wP,{forceMount:void 0}),OG=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=Gp(wP,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})})})};OG.displayName=wP;var Ka="MenuContent",[Uge,xP]=Hp(Ka),DG=D.forwardRef((t,e)=>{const r=RG(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 mP(s)},[]),Y.jsx(EP,{...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(EP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),EP=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=kG(r),L=Dge(r),[F,z]=D.useState(null),_=D.useRef(null),$=kr(e,_,I.onContentChange),ie=D.useRef(0),le=D.useRef(""),K=D.useRef(0),k=D.useRef(null),R=D.useRef("right"),v=D.useRef(0),m=y?X4:D.Fragment,M=y?{as:Cp,allowPinchZoom:!0}:void 0,N=E=>{var w,T;const P=le.current+E,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,P,j),Z=(T=H.find(ee=>ee.textValue===G))==null?void 0:T.ref.current;(function ee(B){le.current=B,window.clearTimeout(ie.current),B!==""&&(ie.current=window.setTimeout(()=>ee(""),1e3))})(P),Z&&setTimeout(()=>Z.focus())};D.useEffect(()=>()=>window.clearTimeout(ie.current),[]),nP();const x=D.useCallback(E=>{var w,T;return R.current===((w=k.current)==null?void 0:w.side)&&rye(E,(T=k.current)==null?void 0:T.area)},[]);return Y.jsx(Uge,{scope:r,searchRef:le,onItemEnter:D.useCallback(E=>{x(E)&&E.preventDefault()},[x]),onItemLeave:D.useCallback(E=>{var w;x(E)||((w=_.current)==null||w.focus(),z(null))},[x]),onTriggerLeave:D.useCallback(E=>{x(E)&&E.preventDefault()},[x]),pointerGraceTimerRef:K,onPointerGraceIntentChange:D.useCallback(E=>{k.current=E},[]),children:Y.jsx(m,{...M,children:Y.jsx(K4,{asChild:!0,trapped:i,onMountAutoFocus:ot(s,E=>{var w;E.preventDefault(),(w=_.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:Y.jsx(gy,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:p,onDismiss:g,children:Y.jsx(gP,{asChild:!0,...O,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:F,onCurrentTabStopIdChange:z,onEntryFocus:ot(c,E=>{C.isUsingKeyboardRef.current||E.preventDefault()}),preventScrollOnEntryFocus:!0,children:Y.jsx(pP,{role:"menu","aria-orientation":"vertical","data-state":QG(I.open),"data-radix-menu-content":"",dir:C.dir,...S,...b,ref:$,style:{outline:"none",...b.style},onKeyDown:ot(b.onKeyDown,E=>{const T=E.target.closest("[data-radix-menu-content]")===E.currentTarget,P=E.ctrlKey||E.altKey||E.metaKey,H=E.key.length===1;T&&(E.key==="Tab"&&E.preventDefault(),!P&&H&&N(E.key));const oe=_.current;if(E.target!==oe||!Mge.includes(E.key))return;E.preventDefault();const X=L().filter(G=>!G.disabled).map(G=>G.ref.current);TG.includes(E.key)&&X.reverse(),Zge(X)}),onBlur:ot(t.onBlur,E=>{E.currentTarget.contains(E.target)||(window.clearTimeout(ie.current),le.current="")}),onPointerMove:ot(t.onPointerMove,fw(E=>{const w=E.target,T=v.current!==E.clientX;if(E.currentTarget.contains(w)&&T){const P=E.clientX>v.current?"right":"left";R.current=P,v.current=E.clientX}}))})})})})})})});DG.displayName=Ka;var Vge="MenuGroup",CP=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"group",...n,ref:e})});CP.displayName=Vge;var zge="MenuLabel",NG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});NG.displayName=zge;var g5="MenuItem",LB="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=xP(g5,t.__scopeMenu),c=kr(e,s),l=D.useRef(!1),f=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent(LB,{bubbles:!0,cancelable:!0});u.addEventListener(LB,g=>n==null?void 0:n(g),{once:!0}),YT(u,p),p.defaultPrevented?l.current=!1:o.onClose()}};return Y.jsx(BG,{...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 BG=D.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=xP(g5,r),a=kG(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(yP,{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",LG=D.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return Y.jsx(qG,{scope:t.__scopeMenu,checked:r,children:Y.jsx(t8,{role:"menuitemcheckbox","aria-checked":y5(r)?"mixed":r,...i,ref:e,"data-state":SP(r),onSelect:ot(i.onSelect,()=>n==null?void 0:n(y5(r)?!0:!r),{checkForDefaultPrevented:!1})})})});LG.displayName=Hge;var FG="MenuRadioGroup",[Gge,Wge]=Hp(FG,{value:void 0,onValueChange:()=>{}}),jG=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(CP,{...i,ref:e})})});jG.displayName=FG;var UG="MenuRadioItem",$G=D.forwardRef((t,e)=>{const{value:r,...n}=t,i=Wge(UG,t.__scopeMenu),s=r===i.value;return Y.jsx(qG,{scope:t.__scopeMenu,checked:s,children:Y.jsx(t8,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":SP(s),onSelect:ot(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});$G.displayName=UG;var AP="MenuItemIndicator",[qG,Kge]=Hp(AP,{checked:!1}),VG=D.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Kge(AP,r);return Y.jsx(oo,{present:n||y5(s.checked)||s.checked===!0,children:Y.jsx(jt.span,{...i,ref:e,"data-state":SP(s.checked)})})});VG.displayName=AP;var Yge="MenuSeparator",zG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return Y.jsx(jt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});zG.displayName=Yge;var Qge="MenuArrow",HG=D.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=e8(r);return Y.jsx(vP,{...i,...n,ref:e})});HG.displayName=Qge;var Jge="MenuSub",[dUe,GG]=Hp(Jge),Gm="MenuSubTrigger",WG=D.forwardRef((t,e)=>{const r=Gp(Gm,t.__scopeMenu),n=lx(Gm,t.__scopeMenu),i=GG(Gm,t.__scopeMenu),s=xP(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(bP,{asChild:!0,...l,children:Y.jsx(BG,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":QG(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())})})})});WG.displayName=Gm;var KG="MenuSubContent",YG=D.forwardRef((t,e)=>{const r=RG(Ka,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=Gp(Ka,t.__scopeMenu),o=lx(Ka,t.__scopeMenu),a=GG(KG,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(EP,{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())})})})})})});YG.displayName=KG;function QG(t){return t?"open":"closed"}function y5(t){return t==="indeterminate"}function SP(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=MG,iye=bP,sye=OG,oye=DG,aye=CP,cye=NG,lye=t8,fye=LG,uye=jG,dye=$G,hye=VG,pye=zG,vye=HG,gye=WG,yye=YG,_P="DropdownMenu",[mye,hUe]=Fs(_P,[PG]),ao=PG(),[bye,JG]=mye(_P),ZG=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})})};ZG.displayName=_P;var XG="DropdownMenuTrigger",eW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=JG(XG,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())})})})});eW.displayName=XG;var wye="DropdownMenuPortal",xye=t=>{const{__scopeDropdownMenu:e,...r}=t,n=ao(e);return Y.jsx(sye,{...n,...r})};xye.displayName=wye;var tW="DropdownMenuContent",rW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=JG(tW,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)"}})});rW.displayName=tW;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",nW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(lye,{...i,...n,ref:e})});nW.displayName=_ye;var Iye="DropdownMenuCheckboxItem",iW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(fye,{...i,...n,ref:e})});iW.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",sW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(dye,{...i,...n,ref:e})});sW.displayName=kye;var Mye="DropdownMenuItemIndicator",oW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(hye,{...i,...n,ref:e})});oW.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",aW=D.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=ao(r);return Y.jsx(vye,{...i,...n,ref:e})});aW.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=ZG,Uye=eW,$ye=rW,qye=nW,Vye=iW,zye=sW,cW=oW,Hye=aW,Gye="_1k2mbvi1 _1k2mbvi0 fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr1v4 fyvr1x8 fyvr1zc fyvr111g fyvr11r0 fyvr11xx",Wye="_1k2mbvi2",IP="_1k2mbvi4 _1k2mbvi3 fyvr11h4 fyvr11hs fyvr11fs fyvr11gg fyvr1zs fyvr111g fyvr1v0 fyvr1x4 fyvr1310 fyvr130u fyvr11l8 fyvr11ow fyvr11o4 fyvr12zf fyvr11rc fyvr11m4 fyvr12wf",lW="_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(IP,t),asChild:!0,...r,children:Y.jsx(be,{children:Y.jsx(He,{variant:"small",children:e})})}),Zye=({children:t})=>Y.jsx(cW,{className:lW,children:t});D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(Vye,{className:pi(IP,t),...r,ref:n,children:[Y.jsx(Zye,{children:Y.jsx(JT,{size:"xs"})}),Y.jsx(He,{variant:"small",children:e})]}));D.forwardRef(({className:t,children:e,...r},n)=>Y.jsxs(zye,{className:pi(IP,t),...r,ref:n,children:[Y.jsx(cW,{className:lW,children:Y.jsx(He,{children:"•"})}),Y.jsx(He,{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(be,{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(be,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[Y.jsx(He,{ellipsis:!0,children:b.name}),Y.jsxs(He,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[b.size.toFixed(2)," kb"]})]}):Y.jsx(He,{ellipsis:!0,children:f}),Y.jsx(be,{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:Hg,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,kv=64,VA=kv/2,zA=(t,e=E7)=>t%e/(E7/kv),O1=(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=kv/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(be,{as:"svg",className:pi(e,ime({size:n})),viewBox:`0 0 ${kv} ${kv}`,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:kv/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(be,{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 TP="Dialog",[fW,pUe]=Fs(TP),[ame,Kc]=fW(TP),uW=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})};uW.displayName=TP;var dW="DialogTrigger",cme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(dW,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":MP(i.open),...n,ref:s,onClick:ot(t.onClick,i.onOpenToggle)})});cme.displayName=dW;var PP="DialogPortal",[lme,hW]=fW(PP,{forceMount:void 0}),pW=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Kc(PP,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})}))})};pW.displayName=PP;var m5="DialogOverlay",vW=D.forwardRef((t,e)=>{const r=hW(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});vW.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":MP(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Sp="DialogContent",gW=D.forwardRef((t,e)=>{const r=hW(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})})});gW.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 mP(s)},[]),Y.jsx(yW,{...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(yW,{...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()}})}),yW=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 nP(),Y.jsxs(Y.Fragment,{children:[Y.jsx(K4,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Y.jsx(gy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":MP(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})]})]})}),kP="DialogTitle",hme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(kP,r);return Y.jsx(jt.h2,{id:i.titleId,...n,ref:e})});hme.displayName=kP;var mW="DialogDescription",pme=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(mW,r);return Y.jsx(jt.p,{id:i.descriptionId,...n,ref:e})});pme.displayName=mW;var bW="DialogClose",wW=D.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Kc(bW,r);return Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,()=>i.onOpenChange(!1))})});wW.displayName=bW;function MP(t){return t?"open":"closed"}var xW="DialogTitleWarning",[vUe,EW]=Spe(xW,{contentName:Sp,titleName:kP,docsSlug:"dialog"}),vme=({titleId:t})=>{const e=EW(xW),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 {${xW(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=fW,bme=hW,wme=pW,xme=vW,Eme=bW,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(be,{className:Ame({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:Y.jsx(be,{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 EW(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]=EW(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 LB(t,e,r){t.style.setProperty(_me(e),r)}function FB(t,e,r){if(typeof r=="object"){var n=e;EW(r,(a,c)=>{a!=null&&LB(t,Ime(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&LB(t,s,i[s])}}}const RP=["dark","light"],CW="dark",Tme="data-theme",jB="@sequence.theme",Pme=t=>RP.includes(t),kme=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),AW=t=>t?`${jB}.${t}`:jB,Mme=t=>{const e=localStorage.getItem(AW(t));return e&&RP.includes(e)?e:CW},SW=D.createContext(null),Rme=t=>{const[e,r]=D.useState(t.theme||CW);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),FB(i,cB,{colors:rpe[e]})):kme(e)&&FB(i,cB,{colors:e}),t.root&&i.classList.add("seq-root"))},[e,t.root]);const n=D.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{RP.includes(i)&&(localStorage.setItem(AW(t.scope),i),r(i))}}),[e,t.root,t.scope]);return Y.jsx(SW.Provider,{value:n,children:t.children})},Ome=()=>{const t=D.useContext(SW);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(be,{...u,className:pi("seq-root",Dme,u==null?void 0:u.className),children:[Y.jsx(be,{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(be,{width:"full",children:Y.jsxs(be,{className:pi(Fme,jme({borderRadius:i})),children:[f&&Y.jsx(f,{size:"sm"}),Y.jsx(be,{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 OP="Progress",DP=100,[Vme,gUe]=Fs(OP),[zme,Hme]=Vme(OP),Gme=D.forwardRef((t,e)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=Kme,...o}=t;(i||i===0)&&!UB(i)&&console.error(Yme(`${i}`,"Progress"));const a=UB(i)?i:DP;n!==null&&!$B(n,a)&&console.error(Qme(`${n}`,"Progress"));const c=$B(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":IW(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});Gme.displayName=OP;var _W="ProgressIndicator",Wme=D.forwardRef((t,e)=>{const{__scopeProgress:r,...n}=t,i=Hme(_W,r);return Y.jsx(jt.div,{"data-state":IW(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:e})});Wme.displayName=_W;function Kme(t,e){return`${Math.round(t/e*100)}%`}function IW(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function b5(t){return typeof t=="number"}function UB(t){return b5(t)&&!isNaN(t)&&t>0}function $B(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 \`${DP}\`.`}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 {${EW(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=uW,bme=pW,wme=vW,xme=gW,Eme=wW,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(be,{className:Ame({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:Y.jsx(be,{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 CW(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]=CW(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 FB(t,e,r){t.style.setProperty(_me(e),r)}function jB(t,e,r){if(typeof r=="object"){var n=e;CW(r,(a,c)=>{a!=null&&FB(t,Ime(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&FB(t,s,i[s])}}}const RP=["dark","light"],AW="dark",Tme="data-theme",UB="@sequence.theme",Pme=t=>RP.includes(t),kme=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),SW=t=>t?`${UB}.${t}`:UB,Mme=t=>{const e=localStorage.getItem(SW(t));return e&&RP.includes(e)?e:AW},_W=D.createContext(null),Rme=t=>{const[e,r]=D.useState(t.theme||AW);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),jB(i,lB,{colors:rpe[e]})):kme(e)&&jB(i,lB,{colors:e}),t.root&&i.classList.add("seq-root"))},[e,t.root]);const n=D.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{RP.includes(i)&&(localStorage.setItem(SW(t.scope),i),r(i))}}),[e,t.root,t.scope]);return Y.jsx(_W.Provider,{value:n,children:t.children})},Ome=()=>{const t=D.useContext(_W);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(be,{...u,className:pi("seq-root",Dme,u==null?void 0:u.className),children:[Y.jsx(be,{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:Hg,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(be,{width:"full",children:Y.jsxs(be,{className:pi(Fme,jme({borderRadius:i})),children:[f&&Y.jsx(f,{size:"sm"}),Y.jsx(be,{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 OP="Progress",DP=100,[Vme,gUe]=Fs(OP),[zme,Hme]=Vme(OP),Gme=D.forwardRef((t,e)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=Kme,...o}=t;(i||i===0)&&!$B(i)&&console.error(Yme(`${i}`,"Progress"));const a=$B(i)?i:DP;n!==null&&!qB(n,a)&&console.error(Qme(`${n}`,"Progress"));const c=qB(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":TW(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});Gme.displayName=OP;var IW="ProgressIndicator",Wme=D.forwardRef((t,e)=>{const{__scopeProgress:r,...n}=t,i=Hme(IW,r);return Y.jsx(jt.div,{"data-state":TW(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:e})});Wme.displayName=IW;function Kme(t,e){return`${Math.round(t/e*100)}%`}function TW(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function b5(t){return typeof t=="number"}function $B(t){return b5(t)&&!isNaN(t)&&t>0}function qB(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 \`${DP}\`.`}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 ${DP} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var NP="Radio",[Jme,TW]=Fs(NP),[Zme,Xme]=Jme(NP),PW=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":RW(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%)"}})]})});PW.displayName=NP;var kW="RadioIndicator",MW=D.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Xme(kW,r);return Y.jsx(oo,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":RW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});MW.displayName=kW;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 RW(t){return t?"checked":"unchecked"}var tbe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BP="RadioGroup",[rbe,yUe]=Fs(BP,[by,TW]),OW=by(),DW=TW(),[nbe,ibe]=rbe(BP),NW=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=OW(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(gP,{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})})})});NW.displayName=BP;var BW="RadioGroupItem",LW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=ibe(BW,r),o=s.disabled||n,a=OW(r),c=DW(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(yP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(PW,{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())})})})});LW.displayName=BW;var sbe="RadioGroupIndicator",FW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=DW(r);return Y.jsx(MW,{...i,...n,ref:e})});FW.displayName=sbe;var obe=NW,abe=LW,cbe=FW,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(be,{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(be,{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 qB(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),jW=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}),le=D.useRef(null),K=b?!!b.closest("form"):!0,[k,R]=D.useState(new Set),v=Array.from(k).map(m=>m.props.value).join(";");return Y.jsx(dP,{...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:le,disabled:p,children:[Y.jsx(n8.Provider,{scope:e,children:Y.jsx(mbe,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(m=>{R(M=>new Set(M).add(m))},[]),onNativeOptionRemove:D.useCallback(m=>{R(M=>{const N=new Set(M);return N.delete(m),N})},[]),children:r})}),K?Y.jsxs(sK,{"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(k)]},v):null]})})};jW.displayName=ux;var UW="SelectTrigger",$W=D.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=s8(r),o=Ah(UW,r),a=o.disabled||n,c=kr(e,o.onTriggerChange),l=i8(r),[f,u,p]=oK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=aK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(hP,{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":iK(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())})})})});$W.displayName=UW;var qW="SelectValue",VW=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Ah(qW,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:iK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});VW.displayName=qW;var wbe="SelectIcon",zW=D.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});zW.displayName=wbe;var _p="SelectContent",HW=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?xh.createPortal(Y.jsx(GW,{scope:t.__scopeSelect,children:Y.jsx(n8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(WW,{...t,ref:e})});HW.displayName=_p;var Pf=10,[GW,Sh]=wy(_p),xbe="SelectContentImpl",WW=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),[le,K]=D.useState(null),k=i8(r),[R,v]=D.useState(!1),m=D.useRef(!1);D.useEffect(()=>{if(O)return mP(O)},[O]),nP();const M=D.useCallback(G=>{const[Z,...ee]=k().map(fe=>fe.ref.current),[B]=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===B&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==te))return},[k,F]),N=D.useCallback(()=>M([$,O]),[M,$,O]);D.useEffect(()=>{R&&N()},[R,N]);const{onOpenChange:x,triggerPointerDownPosRef:E}=S;D.useEffect(()=>{if(O){let G={x:0,y:0};const Z=B=>{var te,fe;G={x:Math.abs(Math.round(B.pageX)-(((te=E.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(B.pageY)-(((fe=E.current)==null?void 0:fe.y)??0))}},ee=B=>{G.x<=10&&G.y<=10?B.preventDefault():O.contains(B.target)||x(!1),document.removeEventListener("pointermove",Z),E.current=null};return E.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,x,E]),D.useEffect(()=>{const G=()=>x(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[x]);const[w,T]=oK(G=>{const Z=k().filter(te=>!te.disabled),ee=Z.find(te=>te.ref.current===document.activeElement),B=aK(Z,G,ee);B&&setTimeout(()=>B.ref.current.focus())}),P=D.useCallback((G,Z,ee)=>{const B=!m.current&&!ee;(S.value!==void 0&&S.value===Z||B)&&(ie(G),B&&(m.current=!0))},[S.value]),H=D.useCallback(()=>O==null?void 0:O.focus(),[O]),oe=D.useCallback((G,Z,ee)=>{const B=!m.current&&!ee;(S.value!==void 0&&S.value===Z||B)&&K(G)},[S.value]),j=n==="popper"?C7:KW,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(GW,{scope:r,content:O,viewport:F,onViewportChange:z,itemRefCallback:P,selectedItem:$,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:N,selectedItemText:le,position:n,isPositioned:R,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 B=k().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(G.key)&&(B=B.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const te=G.target,fe=B.indexOf(te);B=B.slice(fe+1)}setTimeout(()=>M(B)),G.preventDefault()}})})})})})})});WW.displayName=xbe;var Ebe="SelectItemAlignedPosition",KW=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(),le=C.getBoundingClientRect();if(s.dir!=="rtl"){const te=le.left-$.left,fe=ie.left-te,Ee=_.left-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-Pf,De=qB(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.left=De+"px"}else{const te=$.right-le.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=qB(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.right=De+"px"}const K=p(),k=window.innerHeight-Pf*2,R=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),M=parseInt(v.paddingTop,10),N=parseInt(v.borderBottomWidth,10),x=parseInt(v.paddingBottom,10),E=m+M+R+x+N,w=Math.min(I.offsetHeight*5,E),T=window.getComputedStyle(b),P=parseInt(T.paddingTop,10),H=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-Pf,j=k-oe,X=I.offsetHeight/2,G=I.offsetTop+X,Z=m+M+G,ee=E-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+N),_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?P: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=k+"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}})})})});KW.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(pP,{...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,LP]=wy(_p,{}),A7="SelectViewport",YW=D.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Sh(A7,r),o=LP(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})})})]})});YW.displayName=A7;var QW="SelectGroup",[Sbe,_be]=wy(QW),JW=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})})});JW.displayName=QW;var ZW="SelectLabel",Ibe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=_be(ZW,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});Ibe.displayName=ZW;var w5="SelectItem",[Tbe,XW]=wy(w5),eK=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())})})})})});eK.displayName=w5;var Wm="SelectItemText",tK=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Ah(Wm,r),a=Sh(Wm,r),c=XW(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?xh.createPortal(s.children,o.valueNode):null]})});tK.displayName=Wm;var rK="SelectItemIndicator",Pbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return XW(rK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});Pbe.displayName=rK;var S7="SelectScrollUpButton",kbe=D.forwardRef((t,e)=>{const r=Sh(S7,t.__scopeSelect),n=LP(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(nK,{...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=LP(_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(nK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Mbe.displayName=_7;var nK=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(vP,{...i,...n,ref:e}):null});Dbe.displayName=I7;function iK(t){return t===""||t===void 0}var sK=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})})});sK.displayName="BubbleSelect";function oK(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 aK(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=jW,Lbe=$W,Fbe=VW,jbe=zW,Ube=HW,$be=YW,qbe=JW,Vbe=eK,zbe=tK,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(be,{as:jbe,display:"inline-flex",children:Y.jsx(jH,{})})]}),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 ch=D.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(be,{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(be,{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 FP="Switch",[Jbe,bUe]=Fs(FP),[Zbe,Xbe]=Jbe(FP),cK=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":uK(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%)"}})]})});cK.displayName=FP;var lK="SwitchThumb",fK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Xbe(lK,r);return Y.jsx(jt.span,{"data-state":uK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});fK.displayName=lK;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 uK(t){return t?"checked":"unchecked"}var twe=cK,rwe=fK,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(be,{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 jP="Tabs",[owe,wUe]=Fs(jP,[by]),dK=by(),[awe,UP]=owe(jP),hK=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})})});hK.displayName=jP;var pK="TabsList",vK=D.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=UP(pK,r),o=dK(r);return Y.jsx(gP,{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})})});vK.displayName=pK;var gK="TabsTrigger",yK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=UP(gK,r),a=dK(r),c=wK(o.baseId,n),l=xK(o.baseId,n),f=n===o.value;return Y.jsx(yP,{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)})})})});yK.displayName=gK;var mK="TabsContent",bK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=UP(mK,r),c=wK(a.baseId,n),l=xK(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})})});bK.displayName=mK;function wK(t,e){return`${t}-trigger-${e}`}function xK(t,e){return`${t}-content-${e}`}var cwe=hK,lwe=vK,fwe=yK,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(be,{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(He,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},vwe=cwe,VB=bK;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(be,{className:gwe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(He,{children:n})]})});var $P="ToastProvider",[qP,ywe,mwe]=W4("Toast"),[EK,xUe]=Fs("Toast",[mwe]),[bwe,o8]=EK($P),CK=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 \`${$P}\`. Expected non-empty \`string\`.`),Y.jsx(qP.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})})};CK.displayName=$P;var AK="ToastViewport",wwe=["F8"],P7="toast.viewportPause",k7="toast.viewportResume",SK=D.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=wwe,label:i="Notifications ({hotkey})",...s}=t,o=o8(AK,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 k=b({tabbingDirection:ie?"backwards":"forwards"}),R=k.findIndex(v=>v===$);HA(k.slice(R+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(qP.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)}})]})});SK.displayName=AK;var _K="ToastFocusProxy",M7=D.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=o8(_K,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=_K;var a8="Toast",xwe="toast.swipeStart",Ewe="toast.swipeMove",Cwe="toast.swipeCancel",Awe="toast.swipeEnd",IK=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)})})})});IK.displayName=a8;var[Swe,_we]=EK(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:le}=b,K=Bs(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),k=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=()=>{k(_.current),l==null||l()},M=()=>{const N=new Date().getTime()-z.current;_.current=_.current-N,window.clearTimeout($.current),c==null||c()};return v.addEventListener(P7,M),v.addEventListener(k7,m),()=>{v.removeEventListener(P7,M),v.removeEventListener(k7,m)}}},[b.viewport,F,c,l,k]),D.useEffect(()=>{s&&!b.isClosePausedRef.current&&k(F)},[s,F,b.isClosePausedRef,k]),D.useEffect(()=>(ie(),()=>le()),[ie,le]);const R=D.useMemo(()=>I?OK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[R&&Y.jsx(Twe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),Y.jsx(Swe,{scope:r,onClose:K,children:xh.createPortal(Y.jsx(qP.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,M=v.clientY-O.current.y,N=!!L.current,x=["left","right"].includes(b.swipeDirection),E=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=x?E(0,m):0,T=x?0:E(0,M),P=v.pointerType==="touch"?10:2,H={x:w,y:T},oe={originalEvent:v,delta:H};N?(L.current=H,n6(Ewe,u,oe,{discrete:!1})):zB(H,b.swipeDirection,P)?(L.current=H,n6(xwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>P||Math.abs(M)>P)&&(O.current=null)}),onPointerUp:ot(t.onPointerUp,v=>{const m=L.current,M=v.target;if(M.hasPointerCapture(v.pointerId)&&M.releasePointerCapture(v.pointerId),L.current=null,O.current=null,m){const N=v.currentTarget,x={originalEvent:v,delta:m};zB(m,b.swipeDirection,b.swipeThreshold)?n6(Awe,g,x,{discrete:!0}):n6(Cwe,p,x,{discrete:!0}),N.addEventListener("click",E=>E.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",TK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});TK.displayName=Pwe;var kwe="ToastDescription",PK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});PK.displayName=kwe;var kK="ToastAction",Mwe=D.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(RK,{altText:r,asChild:!0,children:Y.jsx(VP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${kK}\`. Expected non-empty \`string\`.`),null)});Mwe.displayName=kK;var MK="ToastClose",VP=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=_we(MK,r);return Y.jsx(RK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,i.onClose)})})});VP.displayName=MK;var RK=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 OK(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(...OK(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?YT(i,s):i.dispatchEvent(s)}var zB=(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=CK,Bwe=SK,Lwe=IK,Fwe=TK,jwe=PK,Uwe=VP,$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 DK=D.createContext(null),Vwe=t=>{const{children:e,...r}=t,[n,i]=D.useState(new Set);return Y.jsxs(Nwe,{...r,children:[Y.jsxs(DK.Provider,{value:i,children:[e,Y.jsx(IH,{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(be,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(JT,{})});case"error":return Y.jsx(be,{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(be,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(be,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Fwe,{children:Y.jsx(He,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(jwe,{children:Y.jsx(He,{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(DK);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(be,{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(be,{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",HB="bnrreba";const GB="40%",WB="-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(be,{className:pi(r,Zwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(r8,{className:pi(Xwe,c&&HB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(He,{className:pi(exe,c&&HB),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:GB,height:GB,right:WB,bottom:WB}})]})});var[l8,EUe]=Fs("Tooltip",[my]),f8=my(),NK="TooltipProvider",txe=700,R7="tooltip.open",[rxe,zP]=l8(NK),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=NK;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=zP(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(dP,{...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=zP(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(hP,{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 HP="TooltipPortal",[axe,cxe]=l8(HP,{forceMount:void 0}),lxe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=dx(HP,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=HP;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(BK,{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=zP(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(BK,{...t,ref:s})}),[dxe,hxe]=l8(u8,{isInside:!1}),BK=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(pP,{"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(OH,{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 LK="TooltipArrow",pxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=f8(r);return hxe(LK,r).isInside?null:Y.jsx(vP,{...i,...n,ref:e})});pxe.displayName=LK;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 GP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${aB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${aB.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={},KB=xh;D7.createRoot=KB.createRoot,D7.hydrateRoot=KB.hydrateRoot;var FK={exports:{}},cn={};/** @license React v16.13.1 +Defaulting to \`null\`.`}var NP="Radio",[Jme,PW]=Fs(NP),[Zme,Xme]=Jme(NP),kW=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":OW(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%)"}})]})});kW.displayName=NP;var MW="RadioIndicator",RW=D.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Xme(MW,r);return Y.jsx(oo,{present:n||s.checked,children:Y.jsx(jt.span,{"data-state":OW(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});RW.displayName=MW;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 OW(t){return t?"checked":"unchecked"}var tbe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BP="RadioGroup",[rbe,yUe]=Fs(BP,[wy,PW]),DW=wy(),NW=PW(),[nbe,ibe]=rbe(BP),BW=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=DW(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(gP,{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})})})});BW.displayName=BP;var LW="RadioGroupItem",FW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=ibe(LW,r),o=s.disabled||n,a=DW(r),c=NW(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(yP,{asChild:!0,...a,focusable:!o,active:u,children:Y.jsx(kW,{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())})})})});FW.displayName=LW;var sbe="RadioGroupIndicator",jW=D.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=NW(r);return Y.jsx(RW,{...i,...n,ref:e})});jW.displayName=sbe;var obe=BW,abe=FW,cbe=jW,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(be,{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(be,{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 VB(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),[xy,mUe]=Fs(ux,[gbe,by]),s8=by(),[ybe,Ah]=xy(ux),[mbe,bbe]=xy(ux),UW=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}),le=D.useRef(null),K=b?!!b.closest("form"):!0,[k,R]=D.useState(new Set),v=Array.from(k).map(m=>m.props.value).join(";");return Y.jsx(dP,{...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:le,disabled:p,children:[Y.jsx(n8.Provider,{scope:e,children:Y.jsx(mbe,{scope:t.__scopeSelect,onNativeOptionAdd:D.useCallback(m=>{R(M=>new Set(M).add(m))},[]),onNativeOptionRemove:D.useCallback(m=>{R(M=>{const N=new Set(M);return N.delete(m),N})},[]),children:r})}),K?Y.jsxs(oK,{"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(k)]},v):null]})})};UW.displayName=ux;var $W="SelectTrigger",qW=D.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=s8(r),o=Ah($W,r),a=o.disabled||n,c=kr(e,o.onTriggerChange),l=i8(r),[f,u,p]=aK(y=>{const b=l().filter(S=>!S.disabled),I=b.find(S=>S.value===o.value),C=cK(b,y,I);C!==void 0&&o.onValueChange(C.value)}),g=()=>{a||(o.onOpenChange(!0),p())};return Y.jsx(hP,{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":sK(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())})})})});qW.displayName=$W;var VW="SelectValue",zW=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Ah(VW,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:sK(c.value)?Y.jsx(Y.Fragment,{children:o}):s})});zW.displayName=VW;var wbe="SelectIcon",HW=D.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return Y.jsx(jt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});HW.displayName=wbe;var _p="SelectContent",GW=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?xh.createPortal(Y.jsx(WW,{scope:t.__scopeSelect,children:Y.jsx(n8.Slot,{scope:t.__scopeSelect,children:Y.jsx("div",{children:t.children})})}),s):null}return Y.jsx(KW,{...t,ref:e})});GW.displayName=_p;var Pf=10,[WW,Sh]=xy(_p),xbe="SelectContentImpl",KW=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),[le,K]=D.useState(null),k=i8(r),[R,v]=D.useState(!1),m=D.useRef(!1);D.useEffect(()=>{if(O)return mP(O)},[O]),nP();const M=D.useCallback(G=>{const[Z,...ee]=k().map(fe=>fe.ref.current),[B]=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===B&&F&&(F.scrollTop=F.scrollHeight),fe==null||fe.focus(),document.activeElement!==te))return},[k,F]),N=D.useCallback(()=>M([$,O]),[M,$,O]);D.useEffect(()=>{R&&N()},[R,N]);const{onOpenChange:x,triggerPointerDownPosRef:E}=S;D.useEffect(()=>{if(O){let G={x:0,y:0};const Z=B=>{var te,fe;G={x:Math.abs(Math.round(B.pageX)-(((te=E.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(B.pageY)-(((fe=E.current)==null?void 0:fe.y)??0))}},ee=B=>{G.x<=10&&G.y<=10?B.preventDefault():O.contains(B.target)||x(!1),document.removeEventListener("pointermove",Z),E.current=null};return E.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,x,E]),D.useEffect(()=>{const G=()=>x(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[x]);const[w,T]=aK(G=>{const Z=k().filter(te=>!te.disabled),ee=Z.find(te=>te.ref.current===document.activeElement),B=cK(Z,G,ee);B&&setTimeout(()=>B.ref.current.focus())}),P=D.useCallback((G,Z,ee)=>{const B=!m.current&&!ee;(S.value!==void 0&&S.value===Z||B)&&(ie(G),B&&(m.current=!0))},[S.value]),H=D.useCallback(()=>O==null?void 0:O.focus(),[O]),oe=D.useCallback((G,Z,ee)=>{const B=!m.current&&!ee;(S.value!==void 0&&S.value===Z||B)&&K(G)},[S.value]),j=n==="popper"?C7:YW,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(WW,{scope:r,content:O,viewport:F,onViewportChange:z,itemRefCallback:P,selectedItem:$,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:N,selectedItemText:le,position:n,isPositioned:R,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(gy,{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 B=k().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(G.key)&&(B=B.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const te=G.target,fe=B.indexOf(te);B=B.slice(fe+1)}setTimeout(()=>M(B)),G.preventDefault()}})})})})})})});KW.displayName=xbe;var Ebe="SelectItemAlignedPosition",YW=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(),le=C.getBoundingClientRect();if(s.dir!=="rtl"){const te=le.left-$.left,fe=ie.left-te,Ee=_.left-fe,_e=_.width+Ee,Re=Math.max(_e,$.width),Te=window.innerWidth-Pf,De=VB(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.left=De+"px"}else{const te=$.right-le.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=VB(fe,[Pf,Te-Re]);a.style.minWidth=_e+"px",a.style.right=De+"px"}const K=p(),k=window.innerHeight-Pf*2,R=b.scrollHeight,v=window.getComputedStyle(l),m=parseInt(v.borderTopWidth,10),M=parseInt(v.paddingTop,10),N=parseInt(v.borderBottomWidth,10),x=parseInt(v.paddingBottom,10),E=m+M+R+x+N,w=Math.min(I.offsetHeight*5,E),T=window.getComputedStyle(b),P=parseInt(T.paddingTop,10),H=parseInt(T.paddingBottom,10),oe=_.top+_.height/2-Pf,j=k-oe,X=I.offsetHeight/2,G=I.offsetTop+X,Z=m+M+G,ee=E-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+N),_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?P: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=k+"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}})})})});YW.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(pP,{...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,LP]=xy(_p,{}),A7="SelectViewport",QW=D.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Sh(A7,r),o=LP(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})})})]})});QW.displayName=A7;var JW="SelectGroup",[Sbe,_be]=xy(JW),ZW=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})})});ZW.displayName=JW;var XW="SelectLabel",Ibe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=_be(XW,r);return Y.jsx(jt.div,{id:i.id,...n,ref:e})});Ibe.displayName=XW;var w5="SelectItem",[Tbe,eK]=xy(w5),tK=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())})})})})});tK.displayName=w5;var Wm="SelectItemText",rK=D.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Ah(Wm,r),a=Sh(Wm,r),c=eK(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?xh.createPortal(s.children,o.valueNode):null]})});rK.displayName=Wm;var nK="SelectItemIndicator",Pbe=D.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return eK(nK,r).isSelected?Y.jsx(jt.span,{"aria-hidden":!0,...n,ref:e}):null});Pbe.displayName=nK;var S7="SelectScrollUpButton",kbe=D.forwardRef((t,e)=>{const r=Sh(S7,t.__scopeSelect),n=LP(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(iK,{...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=LP(_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(iK,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Mbe.displayName=_7;var iK=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(vP,{...i,...n,ref:e}):null});Dbe.displayName=I7;function sK(t){return t===""||t===void 0}var oK=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})})});oK.displayName="BubbleSelect";function aK(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 cK(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=UW,Lbe=qW,Fbe=zW,jbe=HW,Ube=GW,$be=QW,qbe=ZW,Vbe=tK,zbe=rK,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(be,{as:jbe,display:"inline-flex",children:Y.jsx(UH,{})})]}),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:Hg,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 ch=D.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Y.jsx(be,{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(be,{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 FP="Switch",[Jbe,bUe]=Fs(FP),[Zbe,Xbe]=Jbe(FP),lK=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":dK(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%)"}})]})});lK.displayName=FP;var fK="SwitchThumb",uK=D.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Xbe(fK,r);return Y.jsx(jt.span,{"data-state":dK(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});uK.displayName=fK;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 dK(t){return t?"checked":"unchecked"}var twe=lK,rwe=uK,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(be,{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 jP="Tabs",[owe,wUe]=Fs(jP,[wy]),hK=wy(),[awe,UP]=owe(jP),pK=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})})});pK.displayName=jP;var vK="TabsList",gK=D.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=UP(vK,r),o=hK(r);return Y.jsx(gP,{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})})});gK.displayName=vK;var yK="TabsTrigger",mK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=UP(yK,r),a=hK(r),c=xK(o.baseId,n),l=EK(o.baseId,n),f=n===o.value;return Y.jsx(yP,{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)})})})});mK.displayName=yK;var bK="TabsContent",wK=D.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=UP(bK,r),c=xK(a.baseId,n),l=EK(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})})});wK.displayName=bK;function xK(t,e){return`${t}-trigger-${e}`}function EK(t,e){return`${t}-content-${e}`}var cwe=pK,lwe=gK,fwe=mK,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(be,{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(He,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},vwe=cwe,zB=wK;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(be,{className:gwe,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&Y.jsx(r,{size:"xs"}),Y.jsx(He,{children:n})]})});var $P="ToastProvider",[qP,ywe,mwe]=W4("Toast"),[CK,xUe]=Fs("Toast",[mwe]),[bwe,o8]=CK($P),AK=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 \`${$P}\`. Expected non-empty \`string\`.`),Y.jsx(qP.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})})};AK.displayName=$P;var SK="ToastViewport",wwe=["F8"],P7="toast.viewportPause",k7="toast.viewportResume",_K=D.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=wwe,label:i="Notifications ({hotkey})",...s}=t,o=o8(SK,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 k=b({tabbingDirection:ie?"backwards":"forwards"}),R=k.findIndex(v=>v===$);HA(k.slice(R+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(qP.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)}})]})});_K.displayName=SK;var IK="ToastFocusProxy",M7=D.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,s=o8(IK,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=IK;var a8="Toast",xwe="toast.swipeStart",Ewe="toast.swipeMove",Cwe="toast.swipeCancel",Awe="toast.swipeEnd",TK=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)})})})});TK.displayName=a8;var[Swe,_we]=CK(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:le}=b,K=Bs(()=>{var v;(I==null?void 0:I.contains(document.activeElement))&&((v=b.viewport)==null||v.focus()),o()}),k=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=()=>{k(_.current),l==null||l()},M=()=>{const N=new Date().getTime()-z.current;_.current=_.current-N,window.clearTimeout($.current),c==null||c()};return v.addEventListener(P7,M),v.addEventListener(k7,m),()=>{v.removeEventListener(P7,M),v.removeEventListener(k7,m)}}},[b.viewport,F,c,l,k]),D.useEffect(()=>{s&&!b.isClosePausedRef.current&&k(F)},[s,F,b.isClosePausedRef,k]),D.useEffect(()=>(ie(),()=>le()),[ie,le]);const R=D.useMemo(()=>I?DK(I):null,[I]);return b.viewport?Y.jsxs(Y.Fragment,{children:[R&&Y.jsx(Twe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),Y.jsx(Swe,{scope:r,onClose:K,children:xh.createPortal(Y.jsx(qP.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,M=v.clientY-O.current.y,N=!!L.current,x=["left","right"].includes(b.swipeDirection),E=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,w=x?E(0,m):0,T=x?0:E(0,M),P=v.pointerType==="touch"?10:2,H={x:w,y:T},oe={originalEvent:v,delta:H};N?(L.current=H,n6(Ewe,u,oe,{discrete:!1})):HB(H,b.swipeDirection,P)?(L.current=H,n6(xwe,f,oe,{discrete:!1}),v.target.setPointerCapture(v.pointerId)):(Math.abs(m)>P||Math.abs(M)>P)&&(O.current=null)}),onPointerUp:ot(t.onPointerUp,v=>{const m=L.current,M=v.target;if(M.hasPointerCapture(v.pointerId)&&M.releasePointerCapture(v.pointerId),L.current=null,O.current=null,m){const N=v.currentTarget,x={originalEvent:v,delta:m};HB(m,b.swipeDirection,b.swipeThreshold)?n6(Awe,g,x,{discrete:!0}):n6(Cwe,p,x,{discrete:!0}),N.addEventListener("click",E=>E.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",PK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});PK.displayName=Pwe;var kwe="ToastDescription",kK=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return Y.jsx(jt.div,{...n,ref:e})});kK.displayName=kwe;var MK="ToastAction",Mwe=D.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?Y.jsx(OK,{altText:r,asChild:!0,children:Y.jsx(VP,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${MK}\`. Expected non-empty \`string\`.`),null)});Mwe.displayName=MK;var RK="ToastClose",VP=D.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=_we(RK,r);return Y.jsx(OK,{asChild:!0,children:Y.jsx(jt.button,{type:"button",...n,ref:e,onClick:ot(t.onClick,i.onClose)})})});VP.displayName=RK;var OK=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 DK(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(...DK(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?YT(i,s):i.dispatchEvent(s)}var HB=(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=AK,Bwe=_K,Lwe=TK,Fwe=PK,jwe=kK,Uwe=VP,$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 NK=D.createContext(null),Vwe=t=>{const{children:e,...r}=t,[n,i]=D.useState(new Set);return Y.jsxs(Nwe,{...r,children:[Y.jsxs(NK.Provider,{value:i,children:[e,Y.jsx(TH,{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(be,{background:"positive",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(JT,{})});case"error":return Y.jsx(be,{background:"negative",color:"black",borderRadius:"circle",width:"8",height:"8",placeItems:"center",minWidth:"0",flexShrink:"0",children:Y.jsx(Hg,{})});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(be,{gap:"3",alignItems:"center",children:[c(),Y.jsxs(be,{flexDirection:"column",gap:"1",children:[n&&Y.jsx(Fwe,{children:Y.jsx(He,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:n})}),Y.jsx(jwe,{children:Y.jsx(He,{as:"div",variant:"normal",fontWeight:"medium",color:"text50",children:i})})]})]}),o&&Y.jsx(Uwe,{"aria-label":"Close",asChild:!0,children:Y.jsx(gu,{icon:Hg,size:"xs"})})]})})},c8=()=>{const t=D.useContext(NK);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(be,{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(be,{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",GB="bnrreba";const WB="40%",KB="-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(be,{className:pi(r,Zwe({size:a})),style:i,flexShrink:"0",...l,children:[s?Y.jsx(r8,{className:pi(Xwe,c&&GB),disableAnimation:n,borderRadius:e,overflow:"hidden",src:s}):Y.jsx(He,{className:pi(exe,c&&GB),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:WB,height:WB,right:KB,bottom:KB}})]})});var[l8,EUe]=Fs("Tooltip",[by]),f8=by(),BK="TooltipProvider",txe=700,R7="tooltip.open",[rxe,zP]=l8(BK),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=BK;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=zP(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(dP,{...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=zP(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(hP,{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 HP="TooltipPortal",[axe,cxe]=l8(HP,{forceMount:void 0}),lxe=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=dx(HP,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=HP;var Wg="TooltipContent",fxe=D.forwardRef((t,e)=>{const r=cxe(Wg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,o=dx(Wg,t.__scopeTooltip);return Y.jsx(oo,{present:n||o.open,children:o.disableHoverableContent?Y.jsx(LK,{side:i,...s,ref:e}):Y.jsx(uxe,{side:i,...s,ref:e})})}),uxe=D.forwardRef((t,e)=>{const r=dx(Wg,t.__scopeTooltip),n=zP(Wg,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(LK,{...t,ref:s})}),[dxe,hxe]=l8(u8,{isInside:!1}),LK=D.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=dx(Wg,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(gy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:Y.jsxs(pP,{"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(DH,{children:n}),Y.jsx(dxe,{scope:r,isInside:!0,children:Y.jsx(hbe,{id:c.contentId,role:"tooltip",children:i||n})})]})})});fxe.displayName=Wg;var FK="TooltipArrow",pxe=D.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=f8(r);return hxe(FK,r).isInside?null:Y.jsx(vP,{...i,...n,ref:e})});pxe.displayName=FK;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 GP=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${cB.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${cB.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={},YB=xh;D7.createRoot=YB.createRoot,D7.hydrateRoot=YB.hydrateRoot;var jK={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 Ui=typeof Symbol=="function"&&Symbol.for,WP=Ui?Symbol.for("react.element"):60103,KP=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,YP=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 WP:switch(t=t.type,t){case YP: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 KP:return e}}}function jK(t){return pa(t)===y8}cn.AsyncMode=YP;cn.ConcurrentMode=y8;cn.ContextConsumer=g8;cn.ContextProvider=v8;cn.Element=WP;cn.ForwardRef=m8;cn.Fragment=d8;cn.Lazy=x8;cn.Memo=w8;cn.Portal=KP;cn.Profiler=p8;cn.StrictMode=h8;cn.Suspense=b8;cn.isAsyncMode=function(t){return jK(t)||pa(t)===YP};cn.isConcurrentMode=jK;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===WP};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)===KP};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;FK.exports=cn;var _xe=FK.exports,UK=_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},$K={};$K[UK.ForwardRef]=Ixe;$K[UK.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 QB,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&&QB?QB(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,qK=D.createContext(null),Bxe=({store:t,children:e})=>W.jsx(qK.Provider,{value:t,children:e});function Pr(t){const e=D.useContext(qK);if(!e)throw new Error("store cannot be null! check your ");return e.get(t)}/** + */var Ui=typeof Symbol=="function"&&Symbol.for,WP=Ui?Symbol.for("react.element"):60103,KP=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,YP=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 WP:switch(t=t.type,t){case YP: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 KP:return e}}}function UK(t){return pa(t)===y8}cn.AsyncMode=YP;cn.ConcurrentMode=y8;cn.ContextConsumer=g8;cn.ContextProvider=v8;cn.Element=WP;cn.ForwardRef=m8;cn.Fragment=d8;cn.Lazy=x8;cn.Memo=w8;cn.Portal=KP;cn.Profiler=p8;cn.StrictMode=h8;cn.Suspense=b8;cn.isAsyncMode=function(t){return UK(t)||pa(t)===YP};cn.isConcurrentMode=UK;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===WP};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)===KP};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;jK.exports=cn;var _xe=jK.exports,$K=_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},qK={};qK[$K.ForwardRef]=Ixe;qK[$K.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 JB,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&&JB?JB(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,VK=D.createContext(null),Bxe=({store:t,children:e})=>W.jsx(VK.Provider,{value:t,children:e});function Pr(t){const e=D.useContext(VK);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 uw(){return uw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function VK(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 ZB(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=Nd.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=Nd.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=Nd.Push;let S=B7(b.location,I,C);l=f()+1;let O=ZB(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=Nd.Replace;let S=B7(b.location,I,C);l=f();let O=ZB(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(JB,u),c=I,()=>{i.removeEventListener(JB,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 XB;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(XB||(XB={}));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=QP(i.pathname||"/",r);if(s==null)return null;let o=zK(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=Kd([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+'".')),zK(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 HK(s.path))i(s,o,c)}),e}function HK(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=HK(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,eL=t=>t==="*";function Yxe(t,e){let r=t.split("/"),n=r.length;return r.some(eL)&&(n+=Kxe),e&&(n+=Hxe),r.filter(i=>!eL(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),VK(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 VK(!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 QP(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 JP(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 ZP(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 Kd=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 GK=["post","put","patch","delete"];new Set(GK);const a2e=["get",...GK];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 QP(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 XB(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"?Wp(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 Wp(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=Nd.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=Nd.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=Nd.Push;let S=B7(b.location,I,C);r&&r(S,I),l=f()+1;let O=XB(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=Nd.Replace;let S=B7(b.location,I,C);r&&r(S,I),l=f();let O=XB(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(ZB,u),c=I,()=>{i.removeEventListener(ZB,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 eL;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(eL||(eL={}));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"?Wp(e):e,s=JP(i.pathname||"/",r);if(s==null)return null;let o=zK(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=Kd([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+'".')),zK(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 HK(s.path))i(s,o,c)}),e}function HK(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=HK(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,tL=t=>t==="*";function Yxe(t,e){let r=t.split("/"),n=r.length;return r.some(tL)&&(n+=Kxe),e&&(n+=Hxe),r.filter(i=>!tL(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),QP(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 QP(!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 JP(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"?Wp(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 ZP(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 XP(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Wp(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 Kd=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 GK=["post","put","patch","delete"];new Set(GK);const a2e=["get",...GK];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 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=ZP(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Kd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function YK(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(JP(i,n.v7_relativeSplatPath));return D.useMemo(()=>ZP(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:Kd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Kd([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:Nd.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(WK.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(XP);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 QK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(QK||{}),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(XP);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 JK(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(WK),r=b2e(E5.UseRouteError),n=JK(E5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function E2e(){let{router:t}=m2e(QK.UseNavigateStable),e=JK(E5.UseNavigateStable),r=D.useRef(!1);return KK(()=>{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=ek(),f=ZP(e,JP(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=Nd.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=QP(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}/** + */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=XP(l,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Kd([e,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[e,n,o,s,t])}function YK(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(ZP(i,n.v7_relativeSplatPath));return D.useMemo(()=>XP(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"?Wp(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:Kd([c,i.encodeLocation?i.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?c:Kd([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:Nd.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(WK.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(ek);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 QK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(QK||{}),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(ek);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 JK(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(WK),r=b2e(E5.UseRouteError),n=JK(E5.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function E2e(){let{router:t}=m2e(QK.UseNavigateStable),e=JK(E5.UseNavigateStable),r=D.useRef(!1);return KK(()=>{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=tk(),f=XP(e,ZP(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=Nd.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=Wp(n));let{pathname:f="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,b=D.useMemo(()=>{let I=JP(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 F7(){return F7=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",rL=Z$[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&&rL?rL(()=>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,ZK=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=QP(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 nL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(nL||(nL={}));var iL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(iL||(iL={}));function D2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=ek(),l=hx(),f=YK(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},XK="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 tk(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=${XK}`),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 eY(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 tY(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 rY(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]+sL[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 nY(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 nY(t,e,!0)}function iY(t,e){return nY(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 oL="0123456789abcdef";function px(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=oL[r>>4],e+=oL[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),aY(t,e,r))}const c6e=Object.freeze({error:o6e,ignore:aY,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&&(tY(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 cY(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 aL=cY();const h6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let YA=!1;async function lY(t,e){try{const r=t.match(h6e);if(!r)throw new Error("invalid data");return new Yd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?i6e(r[3]):g6e(r[3]))}catch{return new Yd(599,"BAD REQUEST (invalid data: URI)",{},null,new Hl(t))}}function fY(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 Yd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hl(r))}}return e}const c6={data:lY,ipfs:fY("https://gateway.ipfs.io/ipfs/")},uY=new WeakMap;var L0,gd;class v6e{constructor(e){Ie(this,L0);Ie(this,gd);ue(this,L0,[]),ue(this,gd,!1),uY.set(e,()=>{if(!Q(this,gd)){ue(this,gd,!0);for(const r of Q(this,L0))setTimeout(()=>{r()},0);ue(this,L0,[])}})}addListener(e){Le(!Q(this,gd),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,L0).push(e)}get cancelled(){return Q(this,gd)}checkSignal(){Le(!this.cancelled,"cancelled","CANCELLED",{})}}L0=new WeakMap,gd=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,yd,$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,yd);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,yd,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,yd)||aL}set getUrlFunc(e){ue(this,yd,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,cL()+this.timeout,0,this,new Yd(0,"",{},null,this))}cancel(){Le(Q(this,bl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=uY.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,yd,Q(this,yd)),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");aL=e}static createGetUrlFunc(e){return cY()}static createDataGateway(){return lY}static createIpfsGatewayFunc(e){return fY(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,yd=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(cL()<=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 Yd){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 Yd(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 QM=class QM{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 Yd=QM;function cL(){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 dd(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 dd(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=lL(t,e+1,n);return r(e+1+n+i),fL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),fL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=lL(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=dY(e,0);return pe(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function uL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function hY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(hY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=uL(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=uL(e.length);return r.unshift(183+r.length),r.concat(e)}const dL="0123456789abcdef";function Tp(t){let e="0x";for(const r of hY(t))e+=dL[r>>4],e+=dL[r&15];return e}const pY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function lh(t,e){let r=18;if(typeof e=="string"){const n=pY.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=pY.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={},vY=new WeakMap;function m0(t){return vY.get(t)}function hL(t,e){vY.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(hL(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 hL(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]=pL(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,md,Up,Y7,gY;const JM=class JM{constructor(e,r,n){Ie(this,Up);de(this,"allowLoose");Ie(this,Co);Ie(this,Jo);Ie(this,z0);Ie(this,H0);Ie(this,md);Rt(this,{allowLoose:!!r}),ue(this,Co,Xi(e)),ue(this,z0,0),ue(this,H0,null),ue(this,md,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 JM(Q(this,Co).slice(Q(this,Jo)+e),this.allowLoose,Q(this,md));return ue(r,H0,this),r}readBytes(e,r){let n=$e(this,Up,gY).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,md=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,md)<1||Q(this,z0)<=Q(this,md)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,md)} ( 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}})},gY=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=JM;function ra(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function nk(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 yY(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 mY(t,e){nk(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 vL(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(!bY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class ik{clone(){return this._cloneInto()}}const P6e={}.toString;function wY(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 xY=class extends ik{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,yY(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 xY(t,e).update(r).digest();T8.create=(t,e)=>new xY(t,e);function M6e(t,e,r,n){yY(t);const i=wY({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 sk(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 ok extends ik{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]),Zu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xu=new Uint32Array(64);let L6e=class extends ok{constructor(){super(64,32,8,!1),this.A=Zu[0]|0,this.B=Zu[1]|0,this.C=Zu[2]|0,this.D=Zu[3]|0,this.E=Zu[4]|0,this.F=Zu[5]|0,this.G=Zu[6]|0,this.H=Zu[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)Xu[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=Xu[u-15],g=Xu[u-2],y=al(p,7)^al(p,18)^p>>>3,b=al(g,17)^al(g,19)^g>>>10;Xu[u]=b+Xu[u-7]+y+Xu[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]+Xu[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(){Xu.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 EY(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 CY(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,AY=(t,e,r)=>t<>>32-r,SY=(t,e,r)=>e<>>32-r,_Y=(t,e,r)=>e<>>64-r,IY=(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:EY,split:CY,toBig:F6e,shrSH:j6e,shrSL:U6e,rotrSH:$6e,rotrSL:q6e,rotrBH:V6e,rotrBL:z6e,rotr32H:H6e,rotr32L:G6e,rotlSH:AY,rotlSL:SY,rotlBH:_Y,rotlBL:IY,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))),ed=new Uint32Array(80),td=new Uint32Array(80);let r3e=class extends ok{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)ed[O]=e.getUint32(r),td[O]=e.getUint32(r+=4);for(let O=16;O<80;O++){const L=ed[O-15]|0,F=td[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),$=ed[O-2]|0,ie=td[O-2]|0,le=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),k=vr.add4L(_,K,td[O-7],td[O-16]),R=vr.add4H(k,z,le,ed[O-7],ed[O-16]);ed[O]=R|0,td[O]=k|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],td[O]),ie=vr.add5H($,C,L,z,e3e[O],ed[O]),le=$|0,K=vr.rotrSH(n,i,28)^vr.rotrBH(n,i,34)^vr.rotrBH(n,i,39),k=vr.rotrSL(n,i,28)^vr.rotrBL(n,i,34)^vr.rotrBL(n,i,39),R=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,le|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=vr.add3L(le,k,v);n=vr.add3H(m,ie,K,R),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(){ed.fill(0),td.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 ak=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 gL=n3e(),yL=gL.crypto||gL.msCrypto;function i3e(t){switch(t){case"sha256":return Cy.create();case"sha512":return ak.create()}pe(!1,"invalid hashing algorithm name","algorithm",t)}function s3e(t,e){const r={sha256:Cy,sha512:ak}[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:ak}[i];return pe(s!=null,"invalid pbkdf2 algorithm","algorithm",i),sk(s,t,e,{c:r,dkLen:n})}function a3e(t){Le(yL!=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 yL.getRandomValues(e),e}let TY=!1;const PY=function(t,e,r){return s3e(t,e).update(r).digest()};let kY=PY;function Ay(t,e,r){const n=Ue(e,"key"),i=Ue(r,"data");return Me(kY(t,n,i))}Ay._=PY;Ay.lock=function(){TY=!0};Ay.register=function(t){if(TY)throw new Error("computeHmac is locked");kY=t};Object.freeze(Ay);const[MY,RY,OY]=[[],[],[]],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],MY.push(2*(5*n+r)),RY.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?_Y(t,e,r):AY(t,e,r),bL=(t,e,r)=>r>32?IY(t,e,r):SY(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=mL(l,f,1)^r[a],p=bL(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=RY[o],c=mL(i,s,a),l=bL(i,s,a),f=MY[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 ck extends ik{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(mY(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 ck(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 ck(e,t,r)),y3e=g3e(1,136,256/8);let DY=!1;const NY=function(t){return y3e(t)};let BY=NY;function br(t){const e=Ue(t,"data");return Me(BY(e))}br._=NY;br.lock=function(){DY=!0};br.register=function(t){if(DY)throw new TypeError("keccak256 is locked");BY=t};Object.freeze(br);const m3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),LY=Uint8Array.from({length:16},(t,e)=>e),b3e=LY.map(t=>(9*t+5)%16);let lk=[LY],fk=[b3e];for(let t=0;t<4;t++)for(let e of[lk,fk])e.push(e[t].map(r=>m3e[r]));const FY=[[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=lk.map((t,e)=>t.map(r=>FY[e][r])),x3e=fk.map((t,e)=>t.map(r=>FY[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 wL(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 ok{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=lk[g],S=fk[g],O=w3e[g],L=x3e[g];for(let F=0;F<16;F++){const z=d6(n+wL(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+wL(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 jY=!1;const UY=function(t){return S3e(t)};let $Y=UY;function Sy(t){const e=Ue(t,"data");return Me($Y(e))}Sy._=UY;Sy.lock=function(){jY=!0};Sy.register=function(t){if(jY)throw new TypeError("ripemd160 is locked");$Y=t};Object.freeze(Sy);let qY=!1;const VY=function(t,e,r,n,i){return o3e(t,e,r,n,i)};let zY=VY;function Ph(t,e,r,n,i){const s=Ue(t,"password"),o=Ue(e,"salt");return Me(zY(s,o,r,n,i))}Ph._=VY;Ph.lock=function(){qY=!0};Ph.register=function(t){if(qY)throw new Error("pbkdf2 is locked");zY=t};Object.freeze(Ph);let HY=!1;const GY=function(t){return new Uint8Array(a3e(t))};let WY=GY;function ca(t){return WY(t)}ca._=GY;ca.lock=function(){HY=!0};ca.register=function(t){if(HY)throw new Error("randomBytes is locked");WY=t};Object.freeze(ca);const jr=(t,e)=>t<>>32-e;function xL(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,le=f,K=u,k=p,R=g,v=y,m=b,M=I,N=C,x=S,E=O,w=L,T=F;for(let P=0;P<8;P+=2)le^=jr(z+x|0,7),v^=jr(le+z|0,9),x^=jr(v+le|0,13),z^=jr(x+v|0,18),m^=jr(K+_|0,7),E^=jr(m+K|0,9),_^=jr(E+m|0,13),K^=jr(_+E|0,18),w^=jr(M+k|0,7),$^=jr(w+M|0,9),k^=jr($+w|0,13),M^=jr(k+$|0,18),ie^=jr(T+N|0,7),R^=jr(ie+T|0,9),N^=jr(R+ie|0,13),T^=jr(N+R|0,18),_^=jr(z+ie|0,7),$^=jr(_+z|0,9),ie^=jr($+_|0,13),z^=jr(ie+$|0,18),k^=jr(K+le|0,7),R^=jr(k+K|0,9),le^=jr(R+k|0,13),K^=jr(le+R|0,18),N^=jr(M+m|0,7),v^=jr(N+M|0,9),m^=jr(v+N|0,13),M^=jr(m+v|0,18),x^=jr(T+w|0,7),E^=jr(x+T|0,9),w^=jr(E+x|0,13),T^=jr(w+E|0,18);i[s++]=o+z|0,i[s++]=a+_|0,i[s++]=c+$|0,i[s++]=l+ie|0,i[s++]=f+le|0,i[s++]=u+K|0,i[s++]=p+k|0,i[s++]=g+R|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+M|0,i[s++]=C+N|0,i[s++]=S+x|0,i[s++]=O+E|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),xL(r,s,t,e+=16,r,o)}function KY(t,e,r){const n=wY({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=sk(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 YY(t,e,r,n,i){const s=sk(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}=KY(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 vL(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;rsQ;t>>=P8,e+=1);return e}function D3e(t,e){return t>>BigInt(e)&P8}const N3e=(t,e,r)=>t|(r?P8:sQ)<(T3e<new Uint8Array(t),EL=t=>Uint8Array.from(t);function aQ(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(EL([0]),u),n=a(),u.length!==0&&(i=a(EL([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:pk,bitSet:N3e,bytesToHex:Qg,bytesToNumberBE:up,bytesToNumberLE:dk,concatBytes:hw,createHmacDrbg:aQ,ensureBytes:Ic,equalBytes:M3e,hexToBytes:Jg,hexToNumber:uk,numberToBytesBE:Zg,numberToBytesLE:hk,numberToHexUnpadded:oQ,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),CL=BigInt(5),AL=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 cQ(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}=cQ(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:pk(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?hk(c,s):Zg(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?dk(c):up(c)}});return Object.freeze(a)}function lQ(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 fQ(t){const e=lQ(t);return e+Math.ceil(e/2)}function W3e(t,e,r=!1){const n=t.length,i=lQ(e),s=fQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?up(t):dk(t),a=_o(o,e-si)+si;return r?hk(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 uQ(t){return V3e(t.Fp),vx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q3e(t){const e=uQ(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 SL=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,SL),{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),le=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,le),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,_),le=r.mul(b,le),K=r.sub($,le),K=r.mul(b,K),K=r.add(K,_),_=r.add($,$),$=r.add(_,$),$=r.add($,le),$=r.mul($,K),z=r.add(z,$),le=r.mul(O,L),le=r.add(le,le),$=r.mul(le,K),F=r.sub(F,$),_=r.mul(le,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,le=r.mul(e.b,SL);let K=r.mul(I,O),k=r.mul(C,L),R=r.mul(S,F),v=r.add(I,C),m=r.add(O,L);v=r.mul(v,m),m=r.add(K,k),v=r.sub(v,m),m=r.add(I,S);let M=r.add(O,F);return m=r.mul(m,M),M=r.add(K,R),m=r.sub(m,M),M=r.add(C,S),z=r.add(L,F),M=r.mul(M,z),z=r.add(k,R),M=r.sub(M,z),$=r.mul(ie,m),z=r.mul(le,R),$=r.add(z,$),z=r.sub(k,$),$=r.add(k,$),_=r.mul(z,$),k=r.add(K,K),k=r.add(k,K),R=r.mul(ie,R),m=r.mul(le,m),k=r.add(k,R),R=r.sub(K,R),R=r.mul(ie,R),m=r.add(m,R),K=r.mul(k,m),_=r.add(_,K),K=r.mul(M,m),z=r.mul(v,z),z=r.sub(z,K),K=r.mul(v,k),$=r.mul(M,$),$=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:le,f:K}=this.wNAF(_);$=g.constTimeNegate(L,$),le=g.constTimeNegate(z,le),le=new u(r.mul(le.px,O.beta),le.py,le.pz),C=$.add(le),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=uQ(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 M=n>>Ua;return m>M}function b(m){return y(m)?a(-m):m}const I=(m,M,N)=>up(m.slice(M,N));class C{constructor(M,N,x){this.r=M,this.s=N,this.recovery=x,this.assertValidity()}static fromCompact(M){const N=e.nByteLength;return M=Ic("compactSignature",M,N*2),new C(I(M,0,N),I(M,N,2*N))}static fromDER(M){const{r:N,s:x}=k0.toSig(Ic("DER",M));return new C(N,x)}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(M){return new C(this.r,this.s,M)}recoverPublicKey(M){const{r:N,s:x,recovery:E}=this,w=_(Ic("msgHash",M));if(E==null||![0,1,2,3].includes(E))throw new Error("recovery id invalid");const T=E===2||E===3?N+e.n:N;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=E&1?"03":"02",H=l.fromHex(P+g(T)),oe=c(T),j=a(-w*oe),X=a(x*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=fQ(e.n);return W3e(e.randomBytes(m),e.n)},precompute(m=8,M=l.BASE){return M._setWindowSize(m),M.multiply(BigInt(3)),M}};function O(m,M=!0){return l.fromPrivateKey(m).toRawBytes(M)}function L(m){const M=m instanceof Uint8Array,N=typeof m=="string",x=(M||N)&&m.length;return M?x===i||x===s:N?x===2*i||x===2*s:m instanceof l}function F(m,M,N=!0){if(L(m))throw new Error("first arg must be private key");if(!L(M))throw new Error("second arg must be public key");return l.fromHex(M).multiply(f(m)).toRawBytes(N)}const z=e.bits2int||function(m){const M=up(m),N=m.length*8-e.nBitLength;return N>0?M>>BigInt(N):M},_=e.bits2int_modN||function(m){return a(z(m))},$=pk(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 le(m,M,N=K){if(["recovered","canonical"].some(ee=>ee in N))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:E}=e;let{lowS:w,prehash:T,extraEntropy:P}=N;w==null&&(w=!0),m=Ic("msgHash",m),T&&(m=Ic("prehashed msgHash",x(m)));const H=_(m),oe=f(M),j=[ie(oe),ie(H)];if(P!=null){const ee=P===!0?E(r.BYTES):P;j.push(Ic("extraEntropy",ee))}const X=hw(...j),G=H;function Z(ee){const B=z(ee);if(!p(B))return;const te=c(B),fe=l.BASE.multiply(B).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},k={lowS:e.lowS,prehash:!1};function R(m,M,N=K){const{seed:x,k2sig:E}=le(m,M,N),w=e;return aQ(w.hash.outputLen,w.nByteLength,w.hmac)(x,E)}l.BASE._setWindowSize(8);function v(m,M,N,x=k){var fe;const E=m;if(M=Ic("msgHash",M),N=Ic("publicKey",N),"strict"in x)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=x;let P,H;try{if(typeof E=="string"||E instanceof Uint8Array)try{P=C.fromDER(E)}catch(Ee){if(!(Ee instanceof k0.Err))throw Ee;P=C.fromCompact(E)}else if(typeof E=="object"&&typeof E.r=="bigint"&&typeof E.s=="bigint"){const{r:Ee,s:_e}=E;P=new C(Ee,_e)}else throw new Error("PARSE");H=l.fromHex(N)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&P.hasHighS())return!1;T&&(M=e.hash(M));const{r:oe,s:j}=P,X=_(M),G=c(j),Z=a(X*G),ee=a(oe*G),B=(fe=l.BASE.multiplyAndAddUnsafe(H,Z,ee))==null?void 0:fe.toAffine();return B?a(B.x)===oe:!1}return{CURVE:e,getPublicKey:O,getSharedSecret:F,sign:R,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 dQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),_L=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),i5e=BigInt(1),X7=BigInt(2),IL=(t,e)=>(t+e/X7)/e;function s5e(t){const e=dQ,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(dQ,void 0,void 0,{sqrt:s5e}),sd=n5e({a:BigInt(0),b:BigInt(7),Fp:e_,n:_L,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=_L,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=IL(s*t,e),c=IL(-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);sd.ProjectivePoint;const mu="0x0000000000000000000000000000000000000000",Xg="0x0000000000000000000000000000000000000000000000000000000000000000",o5e=`Ethereum Signed Message: -`,TL=BigInt(0),PL=BigInt(1),kL=BigInt(2),ML=BigInt(27),RL=BigInt(28),p6=BigInt(35),D1={};function OL(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==ML||r==RL?TL:(pe(r>=p6,"invalid EIP-155 v","v",e),(r-p6)/kL)}static getChainIdV(e,r){return Tt(e)*kL+BigInt(35+r-27)}static getNormalizedV(e){const r=Tt(e);return r===TL||r===ML?27:r===PL||r===RL?28:(pe(r>=p6,"invalid v","v",e),r&PL?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=OL(n),s=function(l,f){if(l!=null)return OL(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 Qd=(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=sd.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(sd.getSharedSecret(Xi(Q(this,jf)),Ue(r),!1))}static computePublicKey(e,r){let n=Ue(e,"key");if(n.length===32){const s=sd.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=sd.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=sd.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=sd.ProjectivePoint.fromHex(Ml.computePublicKey(e).substring(2)),s=sd.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 DL(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 vk={};for(let t=0;t<10;t++)vk[String(t)]=String(t);for(let t=0;t<26;t++)vk[String.fromCharCode(65+t)]=String(10+t);const NL=15;function l5e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>vk[n]).join("");for(;e.length>=NL;){let n=e.substring(0,NL);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===BL}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 Pu{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 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 pQ(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 vQ(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 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");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=rk(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 gQ{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 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");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 pQ(r,this.coders,i)}decode(r){return vQ(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 LL=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),FL=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 le=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 yQ(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 bQ(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 wQ(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 wQ(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 wQ(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 xQ(t){return`{${N5e(t)}}`}function B5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function AQ(t){return t&16777215}let t_,jL,r_,n3;function z5e(){let t=yQ(F5e);t_=new Map(mQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),jL=new Set(vw(t)),r_=new Map,n3=new Map;for(let[e,r]of bQ(t)){if(!jL.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 SQ(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 IQ(t){return _Q(t).map(AQ)}function W5e(t){return G5e(_Q(t))}const UL=45,TQ=".",PQ=65039,kQ=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_,MQ,M0,i_,RQ,Ov,t9,V1,v0,$L,s_;function gk(){if(n_)return;let t=yQ(_5e);const e=()=>vw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));n_=new Map(bQ(t)),MQ=r(),M0=e(),i_=new Set(e().map(f=>M0[f])),M0=new Set(M0),RQ=r(),r();let i=mQ(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,kQ);n(v0,IQ(v0)),$L=D5e(t).map(f=>K5e.from(f)).sort(L5e),s_=new Map;for(let f of $L){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===PQ?u.push(...g):u=g}for(let p of u)p.V=f}}function yk(t){return(OQ(t)?"":`${mk(M8([t]))} `)+xQ(t)}function mk(t){return`"${t}"‎`}function Y5e(t){if(t.length>=4&&t[2]==UL&&t[3]==UL)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=LL.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))?NQ(e[0],r):DQ(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 ${mk(M8(e,63))}: ${i}`)}return ey(n)}).join(TQ)}function DQ(t){return new Error(`disallowed character: ${yk(t)}`)}function NQ(t,e){let r=yk(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 NQ(t,r);if(t.M){let r=IQ(e);for(let n=1,i=r.length;nFL)throw new Error(`excessive non-spacing marks: ${mk(M8(r.slice(n-1,s)))} (${s-n}/${FL})`);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(!MQ.has(o))throw DQ(o)}}}return i.length&&n.push(e(i)),n}function o4e(t){return t.filter(e=>e!=PQ)}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 BQ=new Uint8Array(32);BQ.fill(0);function qL(t){return pe(t.length!==0,"invalid ENS name; empty component","comp",t),t}function LQ(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=Qd.computePublicKey(t,!1):e=t.publicKey,Jt(br("0x"+e.substring(4)).substring(26))}function M5(t,e){return gx(Qd.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 VL(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 bk(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 wk(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,bd,Uf,wd,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,bd);Ie(this,Uf);Ie(this,wd);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,bd,null),ue(this,wd,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,bd);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,wd,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,bd);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,bd=new WeakMap,Uf=new WeakMap,wd=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 Ek(t){return typeof t=="string"&&(t=Ai(t)),br(Vr([Ai(o5e),Ai(String(t.length)),t]))}function A4e(t,e){const r=Ek(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 FQ(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=rk(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(iY(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(FQ(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(FQ(n,e[i]))}),Me(Vr(r))}function dp(t,e){return br(Sr(t,e))}const jQ=new Uint8Array(32);jQ.fill(0);const T4e=BigInt(-1),UQ=BigInt(0),$Q=BigInt(1),P4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function k4e(t){const e=Ue(t),r=e.length%32;return r?Vr([e,jQ.slice(r)]):Me(e)}const M4e=Ya($Q,32),R4e=Ya(UQ,32),zL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},i9=["name","version","chainId","verifyingContract","salt"];function HL(t){return function(e){return pe(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const O4e={name:HL("name"),version:HL("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+$Q)*T4e:UQ;return function(o){const a=Tt(o,"value");return pe(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Ya(r?rk(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 GL(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,qQ;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,GL(c,s[c])+f.map(u=>GL(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,qQ).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=zL[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:zL[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,qQ=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 fh=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(" ")),VQ="constant external internal payable private public pure view override",B4e=eo(VQ.split(" ")),zQ="constructor error event fallback function receive struct",HQ=eo(zQ.split(" ")),GQ="calldata memory storage payable indexed",L4e=eo(GQ.split(" ")),F4e="tuple returns",j4e=[zQ,GQ,F4e,VQ].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$_]*)"),WQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),KQ=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(KQ)){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 WL(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(HQ)){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 YQ(t){let e=wu(t,B4e);return WL(e,eo("constant payable nonpayable".split(" "))),WL(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 QQ(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 KL(t){const e=t.match(KQ);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"),YL="_ParamTypeInternal",QL="_ErrorInternal",JL="_EventInternal",ZL="_ConstructorInternal",XL="_FallbackInternal",eF="_FunctionInternal",tF="_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:YL}),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=KL(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(WQ),"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=KL(e.type),new Na(On,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[No]===YL}};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(HQ)){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(WQ),"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:QL})}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]===QL}}class Pl extends D8{constructor(r,n,i,s){super(r,"event",n,i);de(this,"anonymous");Object.defineProperty(this,No,{value:JL}),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]===JL}}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:ZL}),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=QQ(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]===ZL}}class Df extends kp{constructor(r,n,i){super(r,"fallback",n);de(this,"payable");Object.defineProperty(this,No,{value:XL}),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=YQ(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]===XL}}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:eF}),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=YQ(r);let a=[];wu(r,eo(["returns"])).has("returns")&&(a=au(r));const c=QQ(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]===eF}}class hp extends D8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,No,{value:tF})}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]===tF}}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,rF=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 xd,z1;const p4=class p4{constructor(){Ie(this,xd)}getDefaultValue(e){const r=e.map(i=>$e(this,xd,z1).call(this,is.from(i)));return new v6(r,"_").defaultValue()}encode(e,r){eY(r.length,e.length,"types/values length mismatch");const n=e.map(o=>$e(this,xd,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,xd,z1).call(this,is.from(o)));return new v6(i,"_").decode(new K7(r,n,rF))}static _setDefaultMaxInflation(e){pe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),rF=e}static defaultAbiCoder(){return o9==null&&(o9=new p4),o9}static getBuiltinCallException(e,r,n){return K4e(e,r,n,p4.defaultAbiCoder())}};xd=new WeakSet,z1=function(e){if(e.isArray())return new v5e($e(this,xd,z1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new v6(e.components.map(n=>$e(this,xd,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 nF{constructor(e){de(this,"hash");de(this,"_isIndexed");Rt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const iF={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"},sF={"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&&iF[t.toString()]&&(e=iF[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=iY(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 nF(null);else if(o[y])b=new nF(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 JQ=BigInt(0);function Dv(t){return t??null}function ni(t){return t==null?null:t.toString()}class oF{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=JQ;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()"}),eJ(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()"}),XQ(this,e)}replaceableTransaction(e){pe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new ZM(this,this.provider);return ue(r,Ed,e),r}};Ed=new WeakMap;let Ew=ZM;function X4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function XQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function eJ(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 Ck 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 tJ extends mx{constructor(r,n){super(r,r.provider);de(this,"error");Rt(this,{error:n})}}var mg;class t8e extends ZQ{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 Ck(r,Q(this,mg),n)}catch(i){return new tJ(r,i)}return r})}}mg=new WeakMap;var Uw;class Ak 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 rJ extends oY{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 rJ{constructor(e,r,n,i,s){super(e,r,n,new Ck(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 aF=BigInt(0);function nJ(t){return t&&typeof t.call=="function"}function iJ(t){return t&&typeof t.estimateGas=="function"}function N8(t){return t&&typeof t.resolveName=="function"}function sJ(t){return t&&typeof t.sendTransaction=="function"}function oJ(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 aJ(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 aJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ts(a.from,oJ(t.runner)));const c=t.interface,l=Tt(a.value||aF,"overrides.value")===aF,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(nJ(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 tk(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Le(sJ(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 Ak(t.interface,l,c)},i=async function(o){const a=Mp(t.runner,"estimateGas");return Le(iJ(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 aJ(l.pop()),u.from&&(u.from=await ts(u.from,oJ(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(sJ(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 Ak(t.interface,p,u)},o=async function(...l){const f=Mp(t.runner,"estimateGas");return Le(iJ(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(nJ(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 tk(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"),cJ=new WeakMap;function c8e(t,e){cJ.set(t[R5],e)}function Ko(t){return cJ.get(t[R5])}function l8e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function Sk(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 Sk(t,e)).tag)||null}async function cF(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 Sk(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 rJ(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 j$;j$=R5;const Fb=class Fb{constructor(e,r,n,i){de(this,"target");de(this,"interface");de(this,"runner");de(this,"filters");de(this,j$);de(this,"fallback");pe(typeof e=="string"||hQ(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 Ak(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 Sk(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 Ck(u,this.interface,p)}catch(g){return new tJ(u,g)}return new mx(u,f)})}async on(e,r){const n=await cF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await cF(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 lJ=new RegExp("^(ipfs)://(.*)$","i"),lF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),lJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Cd,Y0,Ad,H1,v4,fJ;const bv=class bv{constructor(e,r,n){Ie(this,Ad);de(this,"provider");de(this,"address");de(this,"name");Ie(this,Cd);Ie(this,Y0);Rt(this,{provider:e,address:r,name:n}),ue(this,Cd,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,Cd)==null&&ue(this,Cd,(async()=>{try{return await Q(this,Y0).supportsInterface("0x9061b923")}catch(e){if(Ps(e,"CALL_EXCEPTION"))return!1;throw ue(this,Cd,null),e}})()),await Q(this,Cd)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await $e(this,Ad,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,Ad,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,Ad,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,Ad,H1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await $e(this,Ad,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}://${sY("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:uJ(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 uJ(t){t.to&&Tt(t.to)===fF&&(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)===fF&&(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,Sd;const wv=class wv{constructor(e,r){Ie(this,bg);Ie(this,wg);Ie(this,Sd);ue(this,bg,e),ue(this,wg,Tt(r)),ue(this,Sd,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,Sd).values())}attachPlugin(e){if(Q(this,Sd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Sd).set(e.name,e.clone()),this}getPlugin(e){return Q(this,Sd).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 dF(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:uF(a.maxFee,9),maxPriorityFeePerGas:uF(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 hF=!1;function A8e(){if(hF)return;hF=!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:[dF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[dF("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,_d,Al,xg,c3;class S8e{constructor(e){Ie(this,xg);Ie(this,Vf);Ie(this,Ba);Ie(this,_d);Ie(this,Al);ue(this,Vf,e),ue(this,Ba,null),ue(this,_d,4e3),ue(this,Al,-2)}get pollingInterval(){return Q(this,_d)}set pollingInterval(e){ue(this,_d,e)}start(){Q(this,Ba)||(ue(this,Ba,Q(this,Vf)._setTimeout($e(this,xg,c3).bind(this),Q(this,_d))),$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,_d=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,_d)))};var Q0,J0,Id;class _k{constructor(e){Ie(this,Q0);Ie(this,J0);Ie(this,Id);ue(this,Q0,e),ue(this,Id,!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,Id)||(ue(this,Id,!0),Q(this,J0).call(this,-2),Q(this,Q0).on("block",Q(this,J0)))}stop(){Q(this,Id)&&(ue(this,Id,!1),Q(this,Q0).off("block",Q(this,J0)))}pause(e){this.stop()}resume(){this.start()}}Q0=new WeakMap,J0=new WeakMap,Id=new WeakMap;var Eg,zf;class _8e extends _k{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 _k{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 _k{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,Td,La,y4,dJ;class Ik{constructor(e,r){Ie(this,y4);Ie(this,Hf);Ie(this,Ag);Ie(this,Sg);Ie(this,Td);Ie(this,La);ue(this,Hf,e),ue(this,Ag,u_(r)),ue(this,Sg,$e(this,y4,dJ).bind(this)),ue(this,Td,!1),ue(this,La,-2)}start(){Q(this,Td)||(ue(this,Td,!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,Td)&&(ue(this,Td,!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,Td=new WeakMap,La=new WeakMap,y4=new WeakSet,dJ=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 hJ{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,Pd,As,_g,Zo,Z0,kd,Gf,zw,Fa,Ig,Tg,xr,Wo,h_,p_,Zm,v_,Xm,f3;class pJ{constructor(e,r){Ie(this,xr);Ie(this,Cs);Ie(this,Pd);Ie(this,As);Ie(this,_g);Ie(this,Zo);Ie(this,Z0);Ie(this,kd);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,kd,new Map),ue(this,Cs,new Map),ue(this,Pd,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,Pd).values())}attachPlugin(e){if(Q(this,Pd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Pd).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,Pd).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 ZQ(x8e(e),this)}_wrapTransactionResponse(e,r){return new Ew(uJ(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 oF(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 oF(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 hJ(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 Ik(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 oY(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,Pd=new WeakMap,As=new WeakMap,_g=new WeakMap,Zo=new WeakMap,Z0=new WeakMap,kd=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,kd).get(n);return i||(i=this._perform(e),Q(this,kd).set(n,i),setTimeout(()=>{Q(this,kd).get(n)===i&&Q(this,kd).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 pF(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(vF,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 gF(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 gF(this,e)}async populateTransaction(e){const r=N1(this,"populateTransaction"),n=await gF(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 XM=class XM 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 XM(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_=XM;function F8e(t){return JSON.parse(JSON.stringify(t))}var Qs,Sl,X0,Md,ep,kg,yh,m_,b_;class vJ{constructor(e){Ie(this,yh);Ie(this,Qs);Ie(this,Sl);Ie(this,X0);Ie(this,Md);Ie(this,ep);Ie(this,kg);ue(this,Qs,e),ue(this,Sl,null),ue(this,X0,$e(this,yh,m_).bind(this)),ue(this,Md,!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,Md)||(ue(this,Md,!0),$e(this,yh,m_).call(this,-2))}stop(){Q(this,Md)&&(ue(this,Md,!1),ue(this,kg,!0),$e(this,yh,b_).call(this),Q(this,Qs).off("block",Q(this,X0)))}pause(e){e&&$e(this,yh,b_).call(this),Q(this,Qs).off("block",Q(this,X0))}resume(){this.start()}}Qs=new WeakMap,Sl=new WeakMap,X0=new WeakMap,Md=new WeakMap,ep=new WeakMap,kg=new WeakMap,yh=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 vJ{constructor(r,n){super(r);Ie(this,tp);ue(this,tp,F8e(n))}_recover(r){return new Ik(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 vJ{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 yF(t){return t&&typeof t.pollingInterval=="number"}const gJ={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 fh.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(fh.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 pJ{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({},gJ,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 Ik(this,r.filter):new j8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new hJ("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 Rd;class z8e extends V8e{constructor(r,n){super(r,n);Ie(this,Rd);let i=this._getOption("pollingInterval");i==null&&(i=gJ.pollingInterval),ue(this,Rd,i)}_getSubscriber(r){const n=super._getSubscriber(r);return yF(n)&&(n.pollingInterval=Q(this,Rd)),n}get pollingInterval(){return Q(this,Rd)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");ue(this,Rd,r),this._forEachSubscriber(n=>{yF(n)&&(n.pollingInterval=Q(this,Rd))})}}Rd=new WeakMap;var Rg,U$;let Ty=(U$=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,U$);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 eR=class eR 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 eR(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(Ek(r)).serialized}async signTypedData(r,n,i){const s=await fh.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(fh.hash(s.domain,n,s.value)).serialized}};Og=new WeakMap;let D5=eR;const N5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",G8e=/^[a-z]*$/i;function mF(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 mF(mF(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=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",nL=X$[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&&nL?nL(()=>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,ZK=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=JP(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 iL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(iL||(iL={}));var sL;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(sL||(sL={}));function D2e(t,e){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,unstable_viewTransition:a}=e===void 0?{}:e,c=tk(),l=hx(),f=YK(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},XK="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 pv(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(pv).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 pv(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=>`${pv(r)}: ${pv(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Ps(t,e){return t&&t.code===e}function rk(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: ${pv(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+pv(a))}}s.push(`code=${e}`),s.push(`version=${XK}`),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 eY(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 tY(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 rY(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]+oL[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 nY(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 nY(t,e,!0)}function iY(t,e){return nY(t,e,!1)}const A8=BigInt(0),Lc=BigInt(1),vv=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<=-vv&&t<=vv,"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 aL="0123456789abcdef";function px(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=aL[r>>4],e+=aL[r&15];return BigInt(e)}return Tt(t)}function cr(t,e){switch(typeof t){case"bigint":return pe(t>=-vv&&t<=vv,"overflow",e||"value",t),Number(t);case"number":return pe(Number.isInteger(t),"underflow",e||"value",t),pe(t>=-vv&&t<=vv,"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),aY(t,e,r))}const c6e=Object.freeze({error:o6e,ignore:aY,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&&(tY(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 cY(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 cL=cY();const h6e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p6e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let YA=!1;async function lY(t,e){try{const r=t.match(h6e);if(!r)throw new Error("invalid data");return new Yd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?i6e(r[3]):g6e(r[3]))}catch{return new Yd(599,"BAD REQUEST (invalid data: URI)",{},null,new Hl(t))}}function fY(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 Yd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hl(r))}}return e}const c6={data:lY,ipfs:fY("https://gateway.ipfs.io/ipfs/")},uY=new WeakMap;var L0,gd;class v6e{constructor(e){Ie(this,L0);Ie(this,gd);ue(this,L0,[]),ue(this,gd,!1),uY.set(e,()=>{if(!Q(this,gd)){ue(this,gd,!0);for(const r of Q(this,L0))setTimeout(()=>{r()},0);ue(this,L0,[])}})}addListener(e){Le(!Q(this,gd),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),Q(this,L0).push(e)}get cancelled(){return Q(this,gd)}checkSignal(){Le(!this.cancelled,"cancelled","CANCELLED",{})}}L0=new WeakMap,gd=new WeakMap;function l6(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var Yv,Qv,Pc,Bf,Jv,Zv,Pi,Yo,Lf,F0,j0,U0,bl,kc,yd,$0,Ym;const u4=class u4{constructor(e){Ie(this,$0);Ie(this,Yv);Ie(this,Qv);Ie(this,Pc);Ie(this,Bf);Ie(this,Jv);Ie(this,Zv);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,yd);ue(this,Zv,String(e)),ue(this,Yv,!1),ue(this,Qv,!0),ue(this,Pc,{}),ue(this,Bf,""),ue(this,Jv,3e5),ue(this,kc,{slotInterval:d6e,maxAttempts:u6e}),ue(this,yd,null)}get url(){return Q(this,Zv)}set url(e){ue(this,Zv,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,Jv,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,yd)||cL}set getUrlFunc(e){ue(this,yd,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,lL()+this.timeout,0,this,new Yd(0,"",{},null,this))}cancel(){Le(Q(this,bl)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=uY.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,yd,Q(this,yd)),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");cL=e}static createGetUrlFunc(e){return cY()}static createDataGateway(){return lY}static createIpfsGatewayFunc(e){return fY(e)}};Yv=new WeakMap,Qv=new WeakMap,Pc=new WeakMap,Bf=new WeakMap,Jv=new WeakMap,Zv=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,yd=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(lL()<=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 Yd){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 Yd(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,Xv,q0;const JM=class JM{constructor(e,r,n,i,s){Ie(this,Dw);Ie(this,Nw);Ie(this,Bw);Ie(this,Qo);Ie(this,Xv);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,Xv,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,Xv)}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,Xv=new WeakMap,q0=new WeakMap;let Yd=JM;function lL(){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),gv=BigInt(1),b6e=BigInt(5),D1={};let Rv="0000";for(;Rv.length<80;)Rv+=Rv;function i0(t){let e=Rv;for(;e.length=-i&&tAc?t=C5(P0(t,n),n):t=-C5(P0(-t,n),n)}else{const i=gv<=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)-gv),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 dd(D1,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 dd(D1,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=fL(t,e+1,n);return r(e+1+n+i),uL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),uL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=fL(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=dY(e,0);return pe(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function dL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function hY(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(hY(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=dL(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=dL(e.length);return r.unshift(183+r.length),r.concat(e)}const hL="0123456789abcdef";function Tp(t){let e="0x";for(const r of hY(t))e+=hL[r>>4],e+=hL[r&15];return e}const pY=["wei","kwei","mwei","gwei","szabo","finney","ether"];function lh(t,e){let r=18;if(typeof e=="string"){const n=pY.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=pY.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={},vY=new WeakMap;function m0(t){return vY.get(t)}function pL(t,e){vY.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 Kg?G7(m0(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Kg&&(o=G7(m0(o),o,r)),n[i]=o),n},{})}var eg;const bv=class bv 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,eg);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(pL(this,Object.freeze(i.map((l,f)=>{const u=s[f];return u!=null&&a.get(u)===1?u:null}))),ue(this,eg,[]),Q(this,eg)==null&&Q(this,eg),!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 pL(c,m0(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&Sm(`index ${s}`,i),r&&i instanceof bv&&(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]=vL(r)}}}Ff=new WeakMap,V0=new WeakMap,tg=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,md,Up,Y7,gY;const ZM=class ZM{constructor(e,r,n){Ie(this,Up);de(this,"allowLoose");Ie(this,Co);Ie(this,Jo);Ie(this,z0);Ie(this,H0);Ie(this,md);Rt(this,{allowLoose:!!r}),ue(this,Co,Xi(e)),ue(this,z0,0),ue(this,H0,null),ue(this,md,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 ZM(Q(this,Co).slice(Q(this,Jo)+e),this.allowLoose,Q(this,md));return ue(r,H0,this),r}readBytes(e,r){let n=$e(this,Up,gY).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,md=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,md)<1||Q(this,z0)<=Q(this,md)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${Q(this,md)} ( 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}})},gY=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=ZM;function ra(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ik(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 yY(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 Yg(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 mY(t,e){ik(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 gL(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(!bY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class sk{clone(){return this._cloneInto()}}const P6e={}.toString;function wY(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(Qg(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 xY=class extends sk{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,yY(e);const n=Qg(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 xY(t,e).update(r).digest();T8.create=(t,e)=>new xY(t,e);function M6e(t,e,r,n){yY(t);const i=wY({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=Qg(e),l=Qg(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 ok(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 ak extends sk{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){Yg(this);const{view:r,buffer:n,blockLen:i}=this;e=Qg(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]),Zu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xu=new Uint32Array(64);let L6e=class extends ak{constructor(){super(64,32,8,!1),this.A=Zu[0]|0,this.B=Zu[1]|0,this.C=Zu[2]|0,this.D=Zu[3]|0,this.E=Zu[4]|0,this.F=Zu[5]|0,this.G=Zu[6]|0,this.H=Zu[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)Xu[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){const p=Xu[u-15],g=Xu[u-2],y=al(p,7)^al(p,18)^p>>>3,b=al(g,17)^al(g,19)^g>>>10;Xu[u]=b+Xu[u-7]+y+Xu[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]+Xu[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(){Xu.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 EY(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 CY(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,AY=(t,e,r)=>t<>>32-r,SY=(t,e,r)=>e<>>32-r,_Y=(t,e,r)=>e<>>64-r,IY=(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:EY,split:CY,toBig:F6e,shrSH:j6e,shrSL:U6e,rotrSH:$6e,rotrSL:q6e,rotrBH:V6e,rotrBL:z6e,rotr32H:H6e,rotr32L:G6e,rotlSH:AY,rotlSL:SY,rotlBH:_Y,rotlBL:IY,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))),ed=new Uint32Array(80),td=new Uint32Array(80);let r3e=class extends ak{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)ed[O]=e.getUint32(r),td[O]=e.getUint32(r+=4);for(let O=16;O<80;O++){const L=ed[O-15]|0,F=td[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),$=ed[O-2]|0,ie=td[O-2]|0,le=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),k=vr.add4L(_,K,td[O-7],td[O-16]),R=vr.add4H(k,z,le,ed[O-7],ed[O-16]);ed[O]=R|0,td[O]=k|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],td[O]),ie=vr.add5H($,C,L,z,e3e[O],ed[O]),le=$|0,K=vr.rotrSH(n,i,28)^vr.rotrBH(n,i,34)^vr.rotrBH(n,i,39),k=vr.rotrSL(n,i,28)^vr.rotrBL(n,i,34)^vr.rotrBL(n,i,39),R=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,le|0),l=a|0,f=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=vr.add3L(le,k,v);n=vr.add3H(m,ie,K,R),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(){ed.fill(0),td.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 ck=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 yL=n3e(),mL=yL.crypto||yL.msCrypto;function i3e(t){switch(t){case"sha256":return Cy.create();case"sha512":return ck.create()}pe(!1,"invalid hashing algorithm name","algorithm",t)}function s3e(t,e){const r={sha256:Cy,sha512:ck}[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:ck}[i];return pe(s!=null,"invalid pbkdf2 algorithm","algorithm",i),ok(s,t,e,{c:r,dkLen:n})}function a3e(t){Le(mL!=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 mL.getRandomValues(e),e}let TY=!1;const PY=function(t,e,r){return s3e(t,e).update(r).digest()};let kY=PY;function Ay(t,e,r){const n=Ue(e,"key"),i=Ue(r,"data");return Me(kY(t,n,i))}Ay._=PY;Ay.lock=function(){TY=!0};Ay.register=function(t){if(TY)throw new Error("computeHmac is locked");kY=t};Object.freeze(Ay);const[MY,RY,OY]=[[],[],[]],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],MY.push(2*(5*n+r)),RY.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?_Y(t,e,r):AY(t,e,r),wL=(t,e,r)=>r>32?IY(t,e,r):SY(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=bL(l,f,1)^r[a],p=wL(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=RY[o],c=bL(i,s,a),l=wL(i,s,a),f=MY[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 lk extends sk{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){Yg(this);const{blockLen:r,state:n}=this;e=Qg(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(mY(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 lk(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 lk(e,t,r)),y3e=g3e(1,136,256/8);let DY=!1;const NY=function(t){return y3e(t)};let BY=NY;function br(t){const e=Ue(t,"data");return Me(BY(e))}br._=NY;br.lock=function(){DY=!0};br.register=function(t){if(DY)throw new TypeError("keccak256 is locked");BY=t};Object.freeze(br);const m3e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),LY=Uint8Array.from({length:16},(t,e)=>e),b3e=LY.map(t=>(9*t+5)%16);let fk=[LY],uk=[b3e];for(let t=0;t<4;t++)for(let e of[fk,uk])e.push(e[t].map(r=>m3e[r]));const FY=[[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=fk.map((t,e)=>t.map(r=>FY[e][r])),x3e=uk.map((t,e)=>t.map(r=>FY[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 xL(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 ak{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=fk[g],S=uk[g],O=w3e[g],L=x3e[g];for(let F=0;F<16;F++){const z=d6(n+xL(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+xL(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 jY=!1;const UY=function(t){return S3e(t)};let $Y=UY;function Sy(t){const e=Ue(t,"data");return Me($Y(e))}Sy._=UY;Sy.lock=function(){jY=!0};Sy.register=function(t){if(jY)throw new TypeError("ripemd160 is locked");$Y=t};Object.freeze(Sy);let qY=!1;const VY=function(t,e,r,n,i){return o3e(t,e,r,n,i)};let zY=VY;function Ph(t,e,r,n,i){const s=Ue(t,"password"),o=Ue(e,"salt");return Me(zY(s,o,r,n,i))}Ph._=VY;Ph.lock=function(){qY=!0};Ph.register=function(t){if(qY)throw new Error("pbkdf2 is locked");zY=t};Object.freeze(Ph);let HY=!1;const GY=function(t){return new Uint8Array(a3e(t))};let WY=GY;function ca(t){return WY(t)}ca._=GY;ca.lock=function(){HY=!0};ca.register=function(t){if(HY)throw new Error("randomBytes is locked");WY=t};Object.freeze(ca);const jr=(t,e)=>t<>>32-e;function EL(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,le=f,K=u,k=p,R=g,v=y,m=b,M=I,N=C,x=S,E=O,w=L,T=F;for(let P=0;P<8;P+=2)le^=jr(z+x|0,7),v^=jr(le+z|0,9),x^=jr(v+le|0,13),z^=jr(x+v|0,18),m^=jr(K+_|0,7),E^=jr(m+K|0,9),_^=jr(E+m|0,13),K^=jr(_+E|0,18),w^=jr(M+k|0,7),$^=jr(w+M|0,9),k^=jr($+w|0,13),M^=jr(k+$|0,18),ie^=jr(T+N|0,7),R^=jr(ie+T|0,9),N^=jr(R+ie|0,13),T^=jr(N+R|0,18),_^=jr(z+ie|0,7),$^=jr(_+z|0,9),ie^=jr($+_|0,13),z^=jr(ie+$|0,18),k^=jr(K+le|0,7),R^=jr(k+K|0,9),le^=jr(R+k|0,13),K^=jr(le+R|0,18),N^=jr(M+m|0,7),v^=jr(N+M|0,9),m^=jr(v+N|0,13),M^=jr(m+v|0,18),x^=jr(T+w|0,7),E^=jr(x+T|0,9),w^=jr(E+x|0,13),T^=jr(w+E|0,18);i[s++]=o+z|0,i[s++]=a+_|0,i[s++]=c+$|0,i[s++]=l+ie|0,i[s++]=f+le|0,i[s++]=u+K|0,i[s++]=p+k|0,i[s++]=g+R|0,i[s++]=y+v|0,i[s++]=b+m|0,i[s++]=I+M|0,i[s++]=C+N|0,i[s++]=S+x|0,i[s++]=O+E|0,i[s++]=L+w|0,i[s++]=F+T|0}function Ov(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),EL(r,s,t,e+=16,r,o)}function KY(t,e,r){const n=wY({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=ok(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 YY(t,e,r,n,i){const s=ok(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}=KY(t,e,r);for(let g=0;g{Ov(c,I,c,I+=a,i),p()}),Ov(c,(n-1)*a,l,b,i),p(),await gL(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 Jg(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;rsQ;t>>=P8,e+=1);return e}function D3e(t,e){return t>>BigInt(e)&P8}const N3e=(t,e,r)=>t|(r?P8:sQ)<(T3e<new Uint8Array(t),CL=t=>Uint8Array.from(t);function aQ(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(CL([0]),u),n=a(),u.length!==0&&(i=a(CL([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:vk,bitSet:N3e,bytesToHex:Jg,bytesToNumberBE:up,bytesToNumberLE:hk,concatBytes:hw,createHmacDrbg:aQ,ensureBytes:Ic,equalBytes:M3e,hexToBytes:Zg,hexToNumber:dk,numberToBytesBE:Xg,numberToBytesLE:pk,numberToHexUnpadded:oQ,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),AL=BigInt(5),SL=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 cQ(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}=cQ(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:vk(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?pk(c,s):Xg(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?hk(c):up(c)}});return Object.freeze(a)}function lQ(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 fQ(t){const e=lQ(t);return e+Math.ceil(e/2)}function W3e(t,e,r=!1){const n=t.length,i=lQ(e),s=fQ(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?up(t):hk(t),a=_o(o,e-si)+si;return r?pk(a,i):Xg(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 uQ(t){return V3e(t.Fp),vx(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cQ(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q3e(t){const e=uQ(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 _L=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,_L),{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),le=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,le),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,_),le=r.mul(b,le),K=r.sub($,le),K=r.mul(b,K),K=r.add(K,_),_=r.add($,$),$=r.add(_,$),$=r.add($,le),$=r.mul($,K),z=r.add(z,$),le=r.mul(O,L),le=r.add(le,le),$=r.mul(le,K),F=r.sub(F,$),_=r.mul(le,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,le=r.mul(e.b,_L);let K=r.mul(I,O),k=r.mul(C,L),R=r.mul(S,F),v=r.add(I,C),m=r.add(O,L);v=r.mul(v,m),m=r.add(K,k),v=r.sub(v,m),m=r.add(I,S);let M=r.add(O,F);return m=r.mul(m,M),M=r.add(K,R),m=r.sub(m,M),M=r.add(C,S),z=r.add(L,F),M=r.mul(M,z),z=r.add(k,R),M=r.sub(M,z),$=r.mul(ie,m),z=r.mul(le,R),$=r.add(z,$),z=r.sub(k,$),$=r.add(k,$),_=r.mul(z,$),k=r.add(K,K),k=r.add(k,K),R=r.mul(ie,R),m=r.mul(le,m),k=r.add(k,R),R=r.sub(K,R),R=r.mul(ie,R),m=r.add(m,R),K=r.mul(k,m),_=r.add(_,K),K=r.mul(M,m),z=r.mul(v,z),z=r.sub(z,K),K=r.mul(v,k),$=r.mul(M,$),$=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:le,f:K}=this.wNAF(_);$=g.constTimeNegate(L,$),le=g.constTimeNegate(z,le),le=new u(r.mul(le.px,O.beta),le.py,le.pz),C=$.add(le),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 Jg(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=uQ(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 KfJg(Xg(m,e.nByteLength));function y(m){const M=n>>Ua;return m>M}function b(m){return y(m)?a(-m):m}const I=(m,M,N)=>up(m.slice(M,N));class C{constructor(M,N,x){this.r=M,this.s=N,this.recovery=x,this.assertValidity()}static fromCompact(M){const N=e.nByteLength;return M=Ic("compactSignature",M,N*2),new C(I(M,0,N),I(M,N,2*N))}static fromDER(M){const{r:N,s:x}=k0.toSig(Ic("DER",M));return new C(N,x)}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(M){return new C(this.r,this.s,M)}recoverPublicKey(M){const{r:N,s:x,recovery:E}=this,w=_(Ic("msgHash",M));if(E==null||![0,1,2,3].includes(E))throw new Error("recovery id invalid");const T=E===2||E===3?N+e.n:N;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=E&1?"03":"02",H=l.fromHex(P+g(T)),oe=c(T),j=a(-w*oe),X=a(x*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 Zg(this.toDERHex())}toDERHex(){return k0.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Zg(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=fQ(e.n);return W3e(e.randomBytes(m),e.n)},precompute(m=8,M=l.BASE){return M._setWindowSize(m),M.multiply(BigInt(3)),M}};function O(m,M=!0){return l.fromPrivateKey(m).toRawBytes(M)}function L(m){const M=m instanceof Uint8Array,N=typeof m=="string",x=(M||N)&&m.length;return M?x===i||x===s:N?x===2*i||x===2*s:m instanceof l}function F(m,M,N=!0){if(L(m))throw new Error("first arg must be private key");if(!L(M))throw new Error("second arg must be public key");return l.fromHex(M).multiply(f(m)).toRawBytes(N)}const z=e.bits2int||function(m){const M=up(m),N=m.length*8-e.nBitLength;return N>0?M>>BigInt(N):M},_=e.bits2int_modN||function(m){return a(z(m))},$=vk(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 Xg(m,e.nByteLength)}function le(m,M,N=K){if(["recovered","canonical"].some(ee=>ee in N))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:E}=e;let{lowS:w,prehash:T,extraEntropy:P}=N;w==null&&(w=!0),m=Ic("msgHash",m),T&&(m=Ic("prehashed msgHash",x(m)));const H=_(m),oe=f(M),j=[ie(oe),ie(H)];if(P!=null){const ee=P===!0?E(r.BYTES):P;j.push(Ic("extraEntropy",ee))}const X=hw(...j),G=H;function Z(ee){const B=z(ee);if(!p(B))return;const te=c(B),fe=l.BASE.multiply(B).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},k={lowS:e.lowS,prehash:!1};function R(m,M,N=K){const{seed:x,k2sig:E}=le(m,M,N),w=e;return aQ(w.hash.outputLen,w.nByteLength,w.hmac)(x,E)}l.BASE._setWindowSize(8);function v(m,M,N,x=k){var fe;const E=m;if(M=Ic("msgHash",M),N=Ic("publicKey",N),"strict"in x)throw new Error("options.strict was renamed to lowS");const{lowS:w,prehash:T}=x;let P,H;try{if(typeof E=="string"||E instanceof Uint8Array)try{P=C.fromDER(E)}catch(Ee){if(!(Ee instanceof k0.Err))throw Ee;P=C.fromCompact(E)}else if(typeof E=="object"&&typeof E.r=="bigint"&&typeof E.s=="bigint"){const{r:Ee,s:_e}=E;P=new C(Ee,_e)}else throw new Error("PARSE");H=l.fromHex(N)}catch(Ee){if(Ee.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(w&&P.hasHighS())return!1;T&&(M=e.hash(M));const{r:oe,s:j}=P,X=_(M),G=c(j),Z=a(X*G),ee=a(oe*G),B=(fe=l.BASE.multiplyAndAddUnsafe(H,Z,ee))==null?void 0:fe.toAffine();return B?a(B.x)===oe:!1}return{CURVE:e,getPublicKey:O,getSharedSecret:F,sign:R,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 dQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),IL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),i5e=BigInt(1),X7=BigInt(2),TL=(t,e)=>(t+e/X7)/e;function s5e(t){const e=dQ,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(dQ,void 0,void 0,{sqrt:s5e}),sd=n5e({a:BigInt(0),b:BigInt(7),Fp:e_,n:IL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=IL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=TL(s*t,e),c=TL(-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);sd.ProjectivePoint;const mu="0x0000000000000000000000000000000000000000",ey="0x0000000000000000000000000000000000000000000000000000000000000000",o5e=`Ethereum Signed Message: +`,PL=BigInt(0),kL=BigInt(1),ML=BigInt(2),RL=BigInt(27),OL=BigInt(28),p6=BigInt(35),N1={};function DL(t){return qc(es(t),32)}var rg,ng,ig,G0,So;let bu=(So=class{constructor(e,r,n,i){Ie(this,rg);Ie(this,ng);Ie(this,ig);Ie(this,G0);Th(e,N1,"Signature"),ue(this,rg,r),ue(this,ng,n),ue(this,ig,i),ue(this,G0,null)}get r(){return Q(this,rg)}set r(e){pe(fp(e)===32,"invalid r","value",e),ue(this,rg,Me(e))}get s(){return Q(this,ng)}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,ng,r)}get v(){return Q(this,ig)}set v(e){const r=cr(e,"value");pe(r===27||r===28,"invalid v","v",e),ue(this,ig,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(N1,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==RL||r==OL?PL:(pe(r>=p6,"invalid EIP-155 v","v",e),(r-p6)/ML)}static getChainIdV(e,r){return Tt(e)*ML+BigInt(35+r-27)}static getNormalizedV(e){const r=Tt(e);return r===PL||r===RL?27:r===kL||r===OL?28:(pe(r>=p6,"invalid v","v",e),r&kL?27:28)}static from(e){function r(l,f){pe(l,f,"signature",e)}if(e==null)return new So(N1,ey,ey,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(N1,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(N1,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=DL(n),s=function(l,f){if(l!=null)return DL(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(N1,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}},rg=new WeakMap,ng=new WeakMap,ig=new WeakMap,G0=new WeakMap,So);var jf,Ml;let Qd=(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=sd.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(sd.getSharedSecret(Xi(Q(this,jf)),Ue(r),!1))}static computePublicKey(e,r){let n=Ue(e,"key");if(n.length===32){const s=sd.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=sd.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=sd.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=sd.ProjectivePoint.fromHex(Ml.computePublicKey(e).substring(2)),s=sd.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 NL(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 gk={};for(let t=0;t<10;t++)gk[String(t)]=String(t);for(let t=0;t<26;t++)gk[String.fromCharCode(65+t)]=String(10+t);const BL=15;function l5e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>gk[n]).join("");for(;e.length>=BL;){let n=e.substring(0,BL);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===LL}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 Pu{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 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 pQ(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 vQ(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)}),Kg.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");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=nk(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 gQ{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 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");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 pQ(r,this.coders,i)}decode(r){return vQ(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 FL=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),jL=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 le=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 yQ(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 bQ(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 wQ(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 wQ(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 wQ(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 xQ(t){return`{${N5e(t)}}`}function B5e(t){let e=[];for(let r=0,n=t.length;r>24&255}function AQ(t){return t&16777215}let t_,UL,r_,n3;function z5e(){let t=yQ(F5e);t_=new Map(mQ(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),UL=new Set(vw(t)),r_=new Map,n3=new Map;for(let[e,r]of bQ(t)){if(!UL.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 SQ(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 IQ(t){return _Q(t).map(AQ)}function W5e(t){return G5e(_Q(t))}const $L=45,TQ=".",PQ=65039,kQ=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_,MQ,M0,i_,RQ,Dv,t9,z1,v0,qL,s_;function yk(){if(n_)return;let t=yQ(_5e);const e=()=>vw(t),r=()=>new Set(e()),n=(f,u)=>u.forEach(p=>f.add(p));n_=new Map(bQ(t)),MQ=r(),M0=e(),i_=new Set(e().map(f=>M0[f])),M0=new Set(M0),RQ=r(),r();let i=mQ(t),s=t();const o=()=>{let f=new Set;return e().forEach(u=>n(f,i[u])),n(f,e()),f};Dv=gw(f=>{let u=gw(t).map(p=>p+96);if(u.length){let p=f>=s;u[0]-=32,u=ty(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(),z1=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)||z1.set(f,g)});for(let{V:f,M:u}of new Set(z1.values())){let p=[];for(let y of f){let b=Dv.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 Dv){for(let u of f.P)l(u);for(let u of f.Q)l(u)}for(let f of v0)!z1.has(f)&&!c.has(f)&&z1.set(f,kQ);n(v0,IQ(v0)),qL=D5e(t).map(f=>K5e.from(f)).sort(L5e),s_=new Map;for(let f of qL){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===PQ?u.push(...g):u=g}for(let p of u)p.V=f}}function mk(t){return(OQ(t)?"":`${bk(M8([t]))} `)+xQ(t)}function bk(t){return`"${t}"‎`}function Y5e(t){if(t.length>=4&&t[2]==$L&&t[3]==$L)throw new Error(`invalid label extension: "${ty(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=FL.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=Dv;for(let r of t){let n=e.filter(i=>mw(i,r));if(!n.length)throw Dv.some(i=>mw(i,r))?NQ(e[0],r):DQ(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 ${bk(M8(e,63))}: ${i}`)}return ty(n)}).join(TQ)}function DQ(t){return new Error(`disallowed character: ${mk(t)}`)}function NQ(t,e){let r=mk(e),n=Dv.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 NQ(t,r);if(t.M){let r=IQ(e);for(let n=1,i=r.length;njL)throw new Error(`excessive non-spacing marks: ${bk(M8(r.slice(n-1,s)))} (${s-n}/${jL})`);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(!MQ.has(o))throw DQ(o)}}}return i.length&&n.push(e(i)),n}function o4e(t){return t.filter(e=>e!=PQ)}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 BQ=new Uint8Array(32);BQ.fill(0);function VL(t){return pe(t.length!==0,"invalid ENS name; empty component","comp",t),t}function LQ(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 Kp(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=Qd.computePublicKey(t,!1):e=t.publicKey,Jt(br("0x"+e.substring(4)).substring(26))}function M5(t,e){return gx(Qd.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 zL(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 wk(t,e){try{return Kp(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 xk(t){return Kp(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,sg,og,ag,cg,lg,fg,ug,dg,hg,pg,vg,K0,bd,Uf,wd,gg,i3;const Rf=class Rf{constructor(){Ie(this,gg);Ie(this,wl);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,vg);Ie(this,K0);Ie(this,bd);Ie(this,Uf);Ie(this,wd);ue(this,wl,null),ue(this,sg,null),ue(this,ag,0),ue(this,cg,Mi),ue(this,lg,null),ue(this,fg,null),ue(this,ug,null),ue(this,og,"0x"),ue(this,dg,Mi),ue(this,hg,Mi),ue(this,pg,null),ue(this,vg,null),ue(this,K0,null),ue(this,bd,null),ue(this,wd,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,sg);return e==null&&this.type===3?mu:e}set to(e){ue(this,sg,e==null?null:Jt(e))}get nonce(){return Q(this,ag)}set nonce(e){ue(this,ag,cr(e,"value"))}get gasLimit(){return Q(this,cg)}set gasLimit(e){ue(this,cg,Tt(e))}get gasPrice(){const e=Q(this,lg);return e==null&&(this.type===0||this.type===1)?Mi:e}set gasPrice(e){ue(this,lg,e==null?null:Tt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Q(this,fg);return e??(this.type===2||this.type===3?Mi:null)}set maxPriorityFeePerGas(e){ue(this,fg,e==null?null:Tt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Q(this,ug);return e??(this.type===2||this.type===3?Mi:null)}set maxFeePerGas(e){ue(this,ug,e==null?null:Tt(e,"maxFeePerGas"))}get data(){return Q(this,og)}set data(e){ue(this,og,Me(e))}get value(){return Q(this,dg)}set value(e){ue(this,dg,Tt(e,"value"))}get chainId(){return Q(this,hg)}set chainId(e){ue(this,hg,Tt(e))}get signature(){return Q(this,pg)||null}set signature(e){ue(this,pg,e==null?null:bu.from(e))}get accessList(){const e=Q(this,vg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){ue(this,vg,e==null?null:Kp(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,bd);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,wd,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,bd);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,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,vg=new WeakMap,K0=new WeakMap,bd=new WeakMap,Uf=new WeakMap,wd=new WeakMap,gg=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 Ck(t){return typeof t=="string"&&(t=Ai(t)),br(Vr([Ai(o5e),Ai(String(t.length)),t]))}function A4e(t,e){const r=Ck(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 FQ(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=nk(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(iY(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(FQ(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(FQ(n,e[i]))}),Me(Vr(r))}function dp(t,e){return br(Sr(t,e))}const jQ=new Uint8Array(32);jQ.fill(0);const T4e=BigInt(-1),UQ=BigInt(0),$Q=BigInt(1),P4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function k4e(t){const e=Ue(t),r=e.length%32;return r?Vr([e,jQ.slice(r)]):Me(e)}const M4e=Ya($Q,32),R4e=Ya(UQ,32),HL={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},i9=["name","version","chainId","verifyingContract","salt"];function GL(t){return function(e){return pe(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const O4e={name:GL("name"),version:GL("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+$Q)*T4e:UQ;return function(o){const a=Tt(o,"value");return pe(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Ya(r?nk(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 WL(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,yg,d4,qQ;const Da=class Da{constructor(e){Ie(this,d4);de(this,"primaryType");Ie(this,Lw);Ie(this,$f);Ie(this,yg);ue(this,$f,new Map),ue(this,yg,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,WL(c,s[c])+f.map(u=>WL(u,s[u])).join(""))}}get types(){return JSON.parse(Q(this,Lw))}getEncoder(e){let r=Q(this,yg).get(e);return r||(r=$e(this,d4,qQ).call(this,e),Q(this,yg).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=HL[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:HL[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,yg=new WeakMap,d4=new WeakSet,qQ=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 fh=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(" ")),VQ="constant external internal payable private public pure view override",B4e=eo(VQ.split(" ")),zQ="constructor error event fallback function receive struct",HQ=eo(zQ.split(" ")),GQ="calldata memory storage payable indexed",L4e=eo(GQ.split(" ")),F4e="tuple returns",j4e=[zQ,GQ,F4e,VQ].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$_]*)"),WQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),KQ=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(KQ)){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 KL(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(HQ)){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 YQ(t){let e=wu(t,B4e);return KL(e,eo("constant payable nonpayable".split(" "))),KL(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 QQ(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 YL(t){const e=t.match(KQ);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"),QL="_ParamTypeInternal",JL="_ErrorInternal",ZL="_EventInternal",XL="_ConstructorInternal",eF="_FallbackInternal",tF="_FunctionInternal",rF="_StructInternal";var mg,s3;const Na=class Na{constructor(e,r,n,i,s,o,a,c){Ie(this,mg);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:QL}),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,mg,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=YL(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(WQ),"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=YL(e.type),new Na(On,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[No]===QL}};mg=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,mg,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],mg,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(HQ)){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(WQ),"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:JL})}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]===JL}}class Pl extends D8{constructor(r,n,i,s){super(r,"event",n,i);de(this,"anonymous");Object.defineProperty(this,No,{value:ZL}),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]===ZL}}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:XL}),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=QQ(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]===XL}}class Df extends kp{constructor(r,n,i){super(r,"fallback",n);de(this,"payable");Object.defineProperty(this,No,{value:eF}),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=YQ(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]===eF}}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:tF}),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=YQ(r);let a=[];wu(r,eo(["returns"])).has("returns")&&(a=au(r));const c=QQ(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]===tF}}class hp extends D8{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,No,{value:rF})}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]===rF}}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,nF=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 xd,H1;const p4=class p4{constructor(){Ie(this,xd)}getDefaultValue(e){const r=e.map(i=>$e(this,xd,H1).call(this,is.from(i)));return new v6(r,"_").defaultValue()}encode(e,r){eY(r.length,e.length,"types/values length mismatch");const n=e.map(o=>$e(this,xd,H1).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,xd,H1).call(this,is.from(o)));return new v6(i,"_").decode(new K7(r,n,nF))}static _setDefaultMaxInflation(e){pe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),nF=e}static defaultAbiCoder(){return o9==null&&(o9=new p4),o9}static getBuiltinCallException(e,r,n){return K4e(e,r,n,p4.defaultAbiCoder())}};xd=new WeakSet,H1=function(e){if(e.isArray())return new v5e($e(this,xd,H1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new v6(e.components.map(n=>$e(this,xd,H1).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 iF{constructor(e){de(this,"hash");de(this,"_isIndexed");Rt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const sF={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"},oF={"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&&sF[t.toString()]&&(e=sF[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=iY(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 iF(null);else if(o[y])b=new iF(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)}),Kg.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 JQ=BigInt(0);function Nv(t){return t??null}function ni(t){return t==null?null:t.toString()}class aF{constructor(e,r,n){de(this,"gasPrice");de(this,"maxFeePerGas");de(this,"maxPriorityFeePerGas");Rt(this,{gasPrice:Nv(e),maxFeePerGas:Nv(r),maxPriorityFeePerGas:Nv(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=Kp(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:Nv(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:Nv(e.prevRandao),extraData:e.extraData,baseFeePerGas:Nv(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=JQ;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()"}),eJ(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()"}),XQ(this,e)}replaceableTransaction(e){pe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new XM(this,this.provider);return ue(r,Ed,e),r}};Ed=new WeakMap;let Ew=XM;function X4e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function XQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function eJ(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 Ak 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 tJ extends mx{constructor(r,n){super(r,r.provider);de(this,"error");Rt(this,{error:n})}}var bg;class t8e extends ZQ{constructor(r,n,i){super(i,n);Ie(this,bg);ue(this,bg,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?Q(this,bg).getEvent(r.topics[0]):null;if(n)try{return new Ak(r,Q(this,bg),n)}catch(i){return new tJ(r,i)}return r})}}bg=new WeakMap;var Uw;class Sk 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 rJ extends oY{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 rJ{constructor(e,r,n,i,s){super(e,r,n,new Ak(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 cF=BigInt(0);function nJ(t){return t&&typeof t.call=="function"}function iJ(t){return t&&typeof t.estimateGas=="function"}function N8(t){return t&&typeof t.resolveName=="function"}function sJ(t){return t&&typeof t.sendTransaction=="function"}function oJ(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 aJ(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 aJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await ts(a.from,oJ(t.runner)));const c=t.interface,l=Tt(a.value||cF,"overrides.value")===cF,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(nJ(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 rk(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;Le(sJ(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 Sk(t.interface,l,c)},i=async function(o){const a=Mp(t.runner,"estimateGas");return Le(iJ(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 aJ(l.pop()),u.from&&(u.from=await ts(u.from,oJ(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(sJ(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 Sk(t.interface,p,u)},o=async function(...l){const f=Mp(t.runner,"estimateGas");return Le(iJ(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(nJ(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 rk(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"),cJ=new WeakMap;function c8e(t,e){cJ.set(t[R5],e)}function Ko(t){return cJ.get(t[R5])}function l8e(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function _k(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 _k(t,e)).tag)||null}async function lF(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 _k(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 rJ(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 U$;U$=R5;const Fb=class Fb{constructor(e,r,n,i){de(this,"target");de(this,"interface");de(this,"runner");de(this,"filters");de(this,U$);de(this,"fallback");pe(typeof e=="string"||hQ(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 Sk(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 _k(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 Ak(u,this.interface,p)}catch(g){return new tJ(u,g)}return new mx(u,f)})}async on(e,r){const n=await lF(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await lF(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 lJ=new RegExp("^(ipfs)://(.*)$","i"),fF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),lJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Cd,Y0,Ad,G1,v4,fJ;const wv=class wv{constructor(e,r,n){Ie(this,Ad);de(this,"provider");de(this,"address");de(this,"name");Ie(this,Cd);Ie(this,Y0);Rt(this,{provider:e,address:r,name:n}),ue(this,Cd,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,Cd)==null&&ue(this,Cd,(async()=>{try{return await Q(this,Y0).supportsInterface("0x9061b923")}catch(e){if(Ps(e,"CALL_EXCEPTION"))return!1;throw ue(this,Cd,null),e}})()),await Q(this,Cd)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await $e(this,Ad,G1).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,Ad,G1).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,Ad,G1).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,Ad,G1).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await $e(this,Ad,G1).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}://${sY("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 ny(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:ny,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(ny),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:ny,baseFeePerGas:Br(Tt)},{prevRandao:["mixHash"]});function y8e(t){const e=g8e(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:uJ(r)),e}const m8e=bx({transactionIndex:cr,blockNumber:cr,transactionHash:Zi,address:Jt,topics:B8(Zi),data:ny,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(ny),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 uJ(t){t.to&&Tt(t.to)===uF&&(t.to="0x0000000000000000000000000000000000000000");const e=bx({hash:Zi,index:Br(cr,void 0),type:r=>r==="0x"||r==null?0:cr(r),accessList:Br(Kp,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:ny,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)===uF&&(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 wg,xg,Sd;const xv=class xv{constructor(e,r){Ie(this,wg);Ie(this,xg);Ie(this,Sd);ue(this,wg,e),ue(this,xg,Tt(r)),ue(this,Sd,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return Q(this,wg)}set name(e){ue(this,wg,e)}get chainId(){return Q(this,xg)}set chainId(e){ue(this,xg,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,Sd).values())}attachPlugin(e){if(Q(this,Sd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Sd).set(e.name,e.clone()),this}getPlugin(e){return Q(this,Sd).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new xv(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 hF(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:dF(a.maxFee,9),maxPriorityFeePerGas:dF(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 pF=!1;function A8e(){if(pF)return;pF=!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:[hF("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[hF("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,_d,Al,Eg,c3;class S8e{constructor(e){Ie(this,Eg);Ie(this,Vf);Ie(this,Ba);Ie(this,_d);Ie(this,Al);ue(this,Vf,e),ue(this,Ba,null),ue(this,_d,4e3),ue(this,Al,-2)}get pollingInterval(){return Q(this,_d)}set pollingInterval(e){ue(this,_d,e)}start(){Q(this,Ba)||(ue(this,Ba,Q(this,Vf)._setTimeout($e(this,Eg,c3).bind(this),Q(this,_d))),$e(this,Eg,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,_d=new WeakMap,Al=new WeakMap,Eg=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,Eg,c3).bind(this),Q(this,_d)))};var Q0,J0,Id;class Ik{constructor(e){Ie(this,Q0);Ie(this,J0);Ie(this,Id);ue(this,Q0,e),ue(this,Id,!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,Id)||(ue(this,Id,!0),Q(this,J0).call(this,-2),Q(this,Q0).on("block",Q(this,J0)))}stop(){Q(this,Id)&&(ue(this,Id,!1),Q(this,Q0).off("block",Q(this,J0)))}pause(e){this.stop()}resume(){this.start()}}Q0=new WeakMap,J0=new WeakMap,Id=new WeakMap;var Cg,zf;class _8e extends Ik{constructor(r,n){super(r);Ie(this,Cg);Ie(this,zf);ue(this,Cg,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,Cg));i!=null&&(Q(this,zf)===-2?ue(this,zf,i.number):i.number>Q(this,zf)&&(n.emit(Q(this,Cg),i.number),ue(this,zf,i.number)))}}Cg=new WeakMap,zf=new WeakMap;var g4;class I8e extends Ik{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 Ag;class T8e extends Ik{constructor(r,n){super(r);Ie(this,Ag);ue(this,Ag,n)}async _poll(r,n){const i=await n.getTransactionReceipt(Q(this,Ag));i&&n.emit(Q(this,Ag),i)}}Ag=new WeakMap;var Hf,Sg,_g,Td,La,y4,dJ;class Tk{constructor(e,r){Ie(this,y4);Ie(this,Hf);Ie(this,Sg);Ie(this,_g);Ie(this,Td);Ie(this,La);ue(this,Hf,e),ue(this,Sg,u_(r)),ue(this,_g,$e(this,y4,dJ).bind(this)),ue(this,Td,!1),ue(this,La,-2)}start(){Q(this,Td)||(ue(this,Td,!0),Q(this,La)===-2&&Q(this,Hf).getBlockNumber().then(e=>{ue(this,La,e)}),Q(this,Hf).on("block",Q(this,_g)))}stop(){Q(this,Td)&&(ue(this,Td,!1),Q(this,Hf).off("block",Q(this,_g)))}pause(e){this.stop(),e&&ue(this,La,-2)}resume(){this.start()}}Hf=new WeakMap,Sg=new WeakMap,_g=new WeakMap,Td=new WeakMap,La=new WeakMap,y4=new WeakSet,dJ=async function(e){if(Q(this,La)===-2)return;const r=u_(Q(this,Sg));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 hJ{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,Pd,As,Ig,Zo,Z0,kd,Gf,zw,Fa,Tg,Pg,xr,Wo,h_,p_,Zm,v_,Xm,f3;class pJ{constructor(e,r){Ie(this,xr);Ie(this,Cs);Ie(this,Pd);Ie(this,As);Ie(this,Ig);Ie(this,Zo);Ie(this,Z0);Ie(this,kd);Ie(this,Gf);Ie(this,zw);Ie(this,Fa);Ie(this,Tg);Ie(this,Pg);if(ue(this,Pg,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,kd,new Map),ue(this,Cs,new Map),ue(this,Pd,new Map),ue(this,As,null),ue(this,Ig,!1),ue(this,zw,1),ue(this,Fa,new Map),ue(this,Tg,!1)}get pollingInterval(){return Q(this,Pg).pollingInterval}get provider(){return this}get plugins(){return Array.from(Q(this,Pd).values())}attachPlugin(e){if(Q(this,Pd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return Q(this,Pd).set(e.name,e.connect(this)),this}getPlugin(e){return Q(this,Pd).get(e)||null}get disableCcipRead(){return Q(this,Tg)}set disableCcipRead(e){ue(this,Tg,!!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 ZQ(x8e(e),this)}_wrapTransactionResponse(e,r){return new Ew(uJ(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 aF(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 aF(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 hJ(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 Tk(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 oY(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,Ig)}destroy(){this.removeAllListeners();for(const e of Q(this,Fa).keys())this._clearTimeout(e);ue(this,Ig,!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,Pd=new WeakMap,As=new WeakMap,Ig=new WeakMap,Zo=new WeakMap,Z0=new WeakMap,kd=new WeakMap,Gf=new WeakMap,zw=new WeakMap,Fa=new WeakMap,Tg=new WeakMap,Pg=new WeakMap,xr=new WeakSet,Wo=async function(e){const r=Q(this,Pg).cacheTimeout;if(r<0)return await this._perform(e);const n=l3(e.method,e);let i=Q(this,kd).get(n);return i||(i=this._perform(e),Q(this,kd).set(n,i),setTimeout(()=>{Q(this,kd).get(n)===i&&Q(this,kd).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 vF(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(gF,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 B1(t,e){if(t.provider)return t.provider;Le(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function yF(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 B1(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await yF(this,e)}async populateTransaction(e){const r=B1(this,"populateTransaction"),n=await yF(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 B1(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return B1(this,"call").call(await this.populateCall(e))}async resolveName(e){return await B1(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=B1(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=bw.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var kg,u3;const eR=class eR extends j8{constructor(r,n){super(n);Ie(this,kg);de(this,"address");Rt(this,{address:r})}async getAddress(){return this.address}connect(r){return new eR(this.address,r)}async signTransaction(r){$e(this,kg,u3).call(this,"transactions","signTransaction")}async signMessage(r){$e(this,kg,u3).call(this,"messages","signMessage")}async signTypedData(r,n,i){$e(this,kg,u3).call(this,"typed-data","signTypedData")}};kg=new WeakSet,u3=function(r,n){Le(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let y_=eR;function F8e(t){return JSON.parse(JSON.stringify(t))}var Qs,Sl,X0,Md,ep,Mg,yh,m_,b_;class vJ{constructor(e){Ie(this,yh);Ie(this,Qs);Ie(this,Sl);Ie(this,X0);Ie(this,Md);Ie(this,ep);Ie(this,Mg);ue(this,Qs,e),ue(this,Sl,null),ue(this,X0,$e(this,yh,m_).bind(this)),ue(this,Md,!1),ue(this,ep,null),ue(this,Mg,!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,Md)||(ue(this,Md,!0),$e(this,yh,m_).call(this,-2))}stop(){Q(this,Md)&&(ue(this,Md,!1),ue(this,Mg,!0),$e(this,yh,b_).call(this),Q(this,Qs).off("block",Q(this,X0)))}pause(e){e&&$e(this,yh,b_).call(this),Q(this,Qs).off("block",Q(this,X0))}resume(){this.start()}}Qs=new WeakMap,Sl=new WeakMap,X0=new WeakMap,Md=new WeakMap,ep=new WeakMap,Mg=new WeakMap,yh=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,Mg))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 vJ{constructor(r,n){super(r);Ie(this,tp);ue(this,tp,F8e(n))}_recover(r){return new Tk(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 vJ{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 L1(t){return t&&t.toLowerCase()}function mF(t){return t&&typeof t.pollingInterval=="number"}const gJ={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 fh.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(fh.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,Rg,Wf,_l,Oc,ja,Ao,Hw,w_;class V8e extends pJ{constructor(r,n){super(r,n);Ie(this,Hw);Ie(this,rp);Ie(this,Rg);Ie(this,Wf);Ie(this,_l);Ie(this,Oc);Ie(this,ja);Ie(this,Ao);ue(this,Rg,1),ue(this,rp,Object.assign({},gJ,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,Rg)._++,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 Tk(this,r.filter):new j8e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new hJ("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=Kp(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:[L1(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[L1(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[L1(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[L1(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(L1):r.filter.address=L1(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,Rg)._++,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,Rg=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 Rd;class z8e extends V8e{constructor(r,n){super(r,n);Ie(this,Rd);let i=this._getOption("pollingInterval");i==null&&(i=gJ.pollingInterval),ue(this,Rd,i)}_getSubscriber(r){const n=super._getSubscriber(r);return mF(n)&&(n.pollingInterval=Q(this,Rd)),n}get pollingInterval(){return Q(this,Rd)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");ue(this,Rd,r),this._forEachSubscriber(n=>{mF(n)&&(n.pollingInterval=Q(this,Rd))})}}Rd=new WeakMap;var Og,$$;let Ty=($$=class extends z8e{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);Ie(this,Og);typeof r=="string"?ue(this,Og,new Hl(r)):ue(this,Og,r.clone())}_getConnection(){return Q(this,Og).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}},Og=new WeakMap,$$);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 Dg;const tR=class tR extends j8{constructor(r,n){super(n);de(this,"address");Ie(this,Dg);pe(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),ue(this,Dg,r);const i=gx(this.signingKey.publicKey);Rt(this,{address:i})}get signingKey(){return Q(this,Dg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new tR(Q(this,Dg),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(Ck(r)).serialized}async signTypedData(r,n,i){const s=await fh.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(fh.hash(s.domain,n,s.value)).serialized}};Dg=new WeakMap;let D5=tR;const N5=" !#$%&'()*+,-./<=>?@[]^_`{|}~",G8e=/^[a-z]*$/i;function bF(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 bF(bF(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 Ng,Gw,np,Ww,C_;class Q8e extends Y8e{constructor(r,n,i){super(r);Ie(this,Ww);Ie(this,Ng);Ie(this,Gw);Ie(this,np);ue(this,Ng,n),ue(this,Gw,i),ue(this,np,null)}get _data(){return Q(this,Ng)}_decodeWords(){return K8e(Q(this,Ng))}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=yJ(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)&yJ(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 mJ{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 Tk(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 Pk extends mJ{constructor(e,r){if(super("ECC",e,Pk),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=xJ(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 wF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function yEe(t,e,r){const n=JSON.parse(t),i=xx(e),s=xJ(n);if(s.name==="pbkdf2"){r&&(r(0),await wF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=Ph(i,p,g,y,b);return r&&(r(1),await wF(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 EJ(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 CJ(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/${XK}`,y=r.mnemonic.path||wJ,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 AJ(t,e,r){r==null&&(r={});const n=xx(e),i=EJ(r),s=Iy(n,i.salt,i.N,i.r,i.p,64);return CJ(Ue(s),i,t,r)}async function SJ(t,e,r){r==null&&(r={});const n=xx(e),i=EJ(r),s=await _y(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return CJ(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]),Jd=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 IJ(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 Qd(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&~Jd),n&Jd&&(i+="'"));const{IR:s,IL:o}=_J(n,this.chainCode,this.publicKey,null),a=Qd.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 IJ(this,r)}}function xF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function EF(t,e){const r=JSON.parse(t),n=xx(e),i=Jt(ti(r,"ethaddr:string!")),s=bJ(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 Pk(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 Qd(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 SJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return AJ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return bF(e)?i=await yEe(e,r,n):xF(e)&&(n&&(n(0),await CF(0)),i=EF(e,r),n&&(n(1),await CF(0))),$e(s=Ol,Yw,__).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return bF(e)?n=gEe(e,r):xF(e)?n=EF(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 TJ="3.7.7",xEe=TJ,Py=typeof Buffer=="function",AF=typeof TextDecoder=="function"?new TextDecoder:void 0,SF=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),_F=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),PJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),kJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),MJ=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},kk=typeof btoa=="function"?t=>btoa(t):Py?t=>Buffer.from(t,"binary").toString("base64"):MJ,I_=Py?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?PJ(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,RJ=t=>t.replace(SEe,AEe),IF=Py?t=>Buffer.from(t,"utf8").toString("base64"):SF?t=>I_(SF.encode(t)):t=>kk(RJ(t)),Nv=(t,e=!1)=>e?PJ(IF(t)):IF(t),TF=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))}},OJ=t=>t.replace(_Ee,IEe),DJ=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},Mk=typeof atob=="function"?t=>atob(kJ(t)):Py?t=>Buffer.from(t,"base64").toString("binary"):DJ,NJ=Py?t=>_F(Buffer.from(t,"base64")):t=>_F(Mk(t).split("").map(e=>e.charCodeAt(0))),BJ=t=>NJ(LJ(t)),TEe=Py?t=>Buffer.from(t,"base64").toString("utf8"):AF?t=>AF.decode(NJ(t)):t=>OJ(Mk(t)),LJ=t=>kJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),T_=t=>TEe(LJ(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)},FJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),jJ=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,FJ(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 BJ(this)})},UJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,FJ(r));t("toBase64",function(e){return p3(this,e)}),t("toBase64URI",function(){return p3(this,!0)}),t("toBase64URL",function(){return p3(this,!0)})},kEe=()=>{jJ(),UJ()},PF={version:TJ,VERSION:xEe,atob:Mk,atobPolyfill:DJ,btoa:kk,btoaPolyfill:MJ,fromBase64:T_,toBase64:Nv,encode:Nv,encodeURI:TF,encodeURL:TF,utob:RJ,btou:OJ,decode:T_,isValid:PEe,fromUint8Array:p3,toUint8Array:BJ,extendString:jJ,extendUint8Array:UJ,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]),kF=(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,fh.hash(t.domain,e,t.message)},Rk=t=>Ue(BEe(t));function rs(){return rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Dk(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 WJ(t,e,r){const n=Ex(e),i=await Promise.all(t.signers.map(async s=>{if(Dk(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Ok(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:Nk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Bk={decode:t=>GJ(t),encode:t=>Nk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>WJ(t,e,r),encodeSigners:(t,e,r,n)=>Sb(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Bk.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:Dk,isUnrecoveredSignatureMember:zJ,isUnrecoveredSignature:HJ,decodeSignature:GJ,encodeSignature:Nk,recoverSignature:WJ,encodeSigners:Sb,SignatureCoder:Bk});const Lk={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"),[Lk.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:Lk}),GEe=Object.freeze({__proto__:null});const KJ=1,YJ={version:KJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var w0=Object.freeze({__proto__:null,config:HEe,context:GEe,signature:zEe,version:KJ,DeployedWalletContext:YJ});const Fk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function QJ(t){return br(JJ(t))}function JJ(t){return Sr(["bytes32","bytes32"],[Fk,t])}function ZJ(t){const e=Ue(t);if(e.length===64&&Me(e.slice(0,32))===Fk)return Me(e.slice(32,64))}function WEe(t){return ZJ(t)!==void 0}var KEe=Object.freeze({__proto__:null,SetImageHashPrefix:Fk,hashSetImageHash:QJ,messageSetImageHash:JJ,decodeMessageSetImageHash:ZJ,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 XJ 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 Ok(t.address,e,t.signature,r))throw new XJ(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(Mu(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(Ru(t))return{encoded:xs.node(za(t)),weight:0n};if(ku(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 jk(t){return $k(t)?jk(t.suffix[t.suffix.length-1]):t.config}function Uk(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(Uk)}function eZ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function $k(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(eZ)}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 tZ(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 tZ(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(Xd(s))),i=Sr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Sr(["uint8","bytes"],[Ri.Chained,i])}function Xd(t){if(yu(t))return Me(t);if(Sx(t)||$k(t))return $8(Xd(t),(t.suffix||[]).map(Xd));const e=Uk(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(Mu(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(Ru(t))return Sr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(ku(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)]:Mu(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):ku(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 Xd(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 Ru(t)&&sZ(t.nodeHash)?{weight:0,trimmed:rs({},iZ(t.nodeHash))}:Ax(t)||ro(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&ku(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const q8={decode:t=>U8(t),encode:t=>Xd(t),trim:t=>q5(t),supportsNoChainId:!0,recover:(t,e,r)=>qk(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:Xd(t),i=r.map(s=>yu(s)?s:Xd(s));return $8(n,i)},hashSetImageHash:function(t){return QJ(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:XJ,recoverTopology:vp,partEncoder:xs,encodeSigners:_b,encodeTree:Ib,deepestConfigOfSignature:jk,isUnrecoveredSignature:Uk,isUnrecoveredChainedSignature:Sx,isSignature:eZ,isChainedSignature:$k,decodeSignature:U8,decodeSignatureBody:v3,decodeChainedSignature:tZ,setImageHashStruct:rZ,recoverSignature:qk,encodeChain:$8,encodeSignature:Xd,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 ku(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)}):Mu(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 Mu(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Ru(t){return t.nodeHash!==void 0}function Vk(t){return ro(t)||ku(t)||Mu(t)||Ru(t)}function Gc(t){return t.left!==void 0&&t.right!==void 0}function QEe(t){return Gc(t)||Vk(t)}function nZ(t){return Sr(["uint96","address"],[t.weight,t.address])}function iZ(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 sZ(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 nZ(t);if(ku(t))return dp(["string","bytes32"],[`Sequence static digest: +`)!==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 yJ(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=yJ(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)&yJ(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 iy{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 iy(v9,i,e,r,n)}static fromEntropy(e,r,n){const i=Ue(e,"entropy"),s=p9(i,n);return new iy(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 mJ{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 Pk(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},F1=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 kk extends mJ{constructor(e,r){if(super("ECC",e,kk),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(F1(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=xJ(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 xF(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function yEe(t,e,r){const n=JSON.parse(t),i=xx(e),s=xJ(n);if(s.name==="pbkdf2"){r&&(r(0),await xF(0));const{salt:p,count:g,dkLen:y,algorithm:b}=s,I=Ph(i,p,g,y,b);return r&&(r(1),await xF(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 EJ(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 CJ(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 sy(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/${XK}`,y=r.mnemonic.path||wJ,b=r.mnemonic.locale||"en",I=t.slice(32,64),C=Ue(r.mnemonic.entropy,"account.mnemonic.entropy"),S=ca(16),O=new sy(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 AJ(t,e,r){r==null&&(r={});const n=xx(e),i=EJ(r),s=Iy(n,i.salt,i.N,i.r,i.p,64);return CJ(Ue(s),i,t,r)}async function SJ(t,e,r){r==null&&(r={});const n=xx(e),i=EJ(r),s=await _y(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return CJ(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]),Jd=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 IJ(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 Qd(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&~Jd),n&Jd&&(i+="'"));const{IR:s,IL:o}=_J(n,this.chainCode,this.publicKey,null),a=Qd.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 IJ(this,r)}}function EF(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function CF(t,e){const r=JSON.parse(t),n=xx(e),i=Jt(ti(r,"ethaddr:string!")),s=bJ(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 kk(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 Qd(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 SJ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return AJ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return wF(e)?i=await yEe(e,r,n):EF(e)&&(n&&(n(0),await AF(0)),i=CF(e,r),n&&(n(1),await AF(0))),$e(s=Ol,Yw,__).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return wF(e)?n=gEe(e,r):EF(e)?n=CF(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=iy.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 TJ="3.7.7",xEe=TJ,Py=typeof Buffer=="function",SF=typeof TextDecoder=="function"?new TextDecoder:void 0,_F=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),IF=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),PJ=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),kJ=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),MJ=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},Mk=typeof btoa=="function"?t=>btoa(t):Py?t=>Buffer.from(t,"binary").toString("base64"):MJ,I_=Py?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?PJ(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,RJ=t=>t.replace(SEe,AEe),TF=Py?t=>Buffer.from(t,"utf8").toString("base64"):_F?t=>I_(_F.encode(t)):t=>Mk(RJ(t)),Bv=(t,e=!1)=>e?PJ(TF(t)):TF(t),PF=t=>Bv(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))}},OJ=t=>t.replace(_Ee,IEe),DJ=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},Rk=typeof atob=="function"?t=>atob(kJ(t)):Py?t=>Buffer.from(t,"base64").toString("binary"):DJ,NJ=Py?t=>IF(Buffer.from(t,"base64")):t=>IF(Rk(t).split("").map(e=>e.charCodeAt(0))),BJ=t=>NJ(LJ(t)),TEe=Py?t=>Buffer.from(t,"base64").toString("utf8"):SF?t=>SF.decode(NJ(t)):t=>OJ(Rk(t)),LJ=t=>kJ(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),T_=t=>TEe(LJ(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)},FJ=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),jJ=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,FJ(r));t("fromBase64",function(){return T_(this)}),t("toBase64",function(e){return Bv(this,e)}),t("toBase64URI",function(){return Bv(this,!0)}),t("toBase64URL",function(){return Bv(this,!0)}),t("toUint8Array",function(){return BJ(this)})},UJ=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,FJ(r));t("toBase64",function(e){return p3(this,e)}),t("toBase64URI",function(){return p3(this,!0)}),t("toBase64URL",function(){return p3(this,!0)})},kEe=()=>{jJ(),UJ()},kF={version:TJ,VERSION:xEe,atob:Rk,atobPolyfill:DJ,btoa:Mk,btoaPolyfill:MJ,fromBase64:T_,toBase64:Bv,encode:Bv,encodeURI:PF,encodeURL:PF,utob:RJ,btou:OJ,decode:T_,isValid:PEe,fromUint8Array:p3,toUint8Array:BJ,extendString:jJ,extendUint8Array:UJ,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"),Lv=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]),MF=(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,fh.hash(t.domain,e,t.message)},Ok=t=>Ue(BEe(t));function rs(){return rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(Nk(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 WJ(t,e,r){const n=Ex(e),i=await Promise.all(t.signers.map(async s=>{if(Nk(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!Dk(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:Bk({version:1,threshold:t.threshold,signers:s}),weight:i}}const Lk={decode:t=>GJ(t),encode:t=>Bk(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>WJ(t,e,r),encodeSigners:(t,e,r,n)=>Sb(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Lk.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:Nk,isUnrecoveredSignatureMember:zJ,isUnrecoveredSignature:HJ,decodeSignature:GJ,encodeSignature:Bk,recoverSignature:WJ,encodeSigners:Sb,SignatureCoder:Lk});const Fk={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"),[Fk.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:Fk}),GEe=Object.freeze({__proto__:null});const KJ=1,YJ={version:KJ,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var w0=Object.freeze({__proto__:null,config:HEe,context:GEe,signature:zEe,version:KJ,DeployedWalletContext:YJ});const jk="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function QJ(t){return br(JJ(t))}function JJ(t){return Sr(["bytes32","bytes32"],[jk,t])}function ZJ(t){const e=Ue(t);if(e.length===64&&Me(e.slice(0,32))===jk)return Me(e.slice(32,64))}function WEe(t){return ZJ(t)!==void 0}var KEe=Object.freeze({__proto__:null,SetImageHashPrefix:jk,hashSetImageHash:QJ,messageSetImageHash:JJ,decodeMessageSetImageHash:ZJ,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 XJ 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 Dk(t.address,e,t.signature,r))throw new XJ(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(Mu(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(Ru(t))return{encoded:xs.node(za(t)),weight:0n};if(ku(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 Uk(t){return qk(t)?Uk(t.suffix[t.suffix.length-1]):t.config}function $k(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($k)}function eZ(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function qk(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(eZ)}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 tZ(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 tZ(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(Xd(s))),i=Sr(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Sr(["uint8","bytes"],[Ri.Chained,i])}function Xd(t){if(yu(t))return Me(t);if(Sx(t)||qk(t))return $8(Xd(t),(t.suffix||[]).map(Xd));const e=$k(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(Mu(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(Ru(t))return Sr(["uint8","bytes32"],[Gn.Node,t.nodeHash]);if(ku(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)]:Mu(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):ku(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 Xd(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,ey,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,ey,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 Ru(t)&&sZ(t.nodeHash)?{weight:0,trimmed:rs({},iZ(t.nodeHash))}:Ax(t)||ro(t)&&t.signature!==void 0?{weight:Number(t.weight),trimmed:t}:!e&&ku(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const q8={decode:t=>U8(t),encode:t=>Xd(t),trim:t=>q5(t),supportsNoChainId:!0,recover:(t,e,r)=>Vk(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:Xd(t),i=r.map(s=>yu(s)?s:Xd(s));return $8(n,i)},hashSetImageHash:function(t){return QJ(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:XJ,recoverTopology:vp,partEncoder:xs,encodeSigners:_b,encodeTree:Ib,deepestConfigOfSignature:Uk,isUnrecoveredSignature:$k,isUnrecoveredChainedSignature:Sx,isSignature:eZ,isChainedSignature:qk,decodeSignature:U8,decodeSignatureBody:v3,decodeChainedSignature:tZ,setImageHashStruct:rZ,recoverSignature:Vk,encodeChain:$8,encodeSignature:Xd,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 ku(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)}):Mu(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 Mu(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Ru(t){return t.nodeHash!==void 0}function zk(t){return ro(t)||ku(t)||Mu(t)||Ru(t)}function Gc(t){return t.left!==void 0&&t.right!==void 0}function QEe(t){return Gc(t)||zk(t)}function nZ(t){return Sr(["uint96","address"],[t.weight,t.address])}function iZ(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 sZ(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 nZ(t);if(ku(t))return dp(["string","bytes32"],[`Sequence static digest: `,t.subdigest]);if(Mu(t)){const e=za(t.tree);return dp(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return Ru(t)?t.nodeHash:dp(["bytes32","bytes32"],[za(t.left),za(t.right)])}function JEe(t){const e=[];let r=t;for(;!Vk(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 zk(t){return dp(["bytes32","uint256"],[dp(["bytes32","uint256"],[za(t.tree),t.threshold]),t.checkpoint])}function oZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Lv(t){return ro(t)||ku(t)?[t]:Mu(t)?[{threshold:t.threshold,weight:t.weight,members:Lv(t.tree)}]:Ru(t)?[]:[...Lv(t.left),...Lv(t.right)]}function k_(t){return Ru(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 aZ=(t,e)=>t.map(r=>oZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function Hk(t){if(t.length===0)throw new Error("Empty members array");return aZ(t,Hk).reduce((r,n)=>({left:r,right:n}))}function Gk(t){if(t.length===0)throw new Error("Empty members array");const e=aZ(t,Gk);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 Wk(t){return t.length>8?Gk(t):Hk(t)}function cZ(t,e=Wk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function V5(t,e){return ku(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();Mu(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):!Ru(t)}const V8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>zk(t),hasSubdigest:(t,e)=>V5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>M_(t.tree),fromSimple:t=>{var e;return cZ(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:Wk(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:ku,topologyToJSON:Rb,topologyFromJSON:Ob,isNestedLeaf:Mu,isNodeLeaf:Ru,isLeaf:Vk,isNode:Gc,isTopology:QEe,encodeSignerLeaf:nZ,decodeSignerLeaf:iZ,isEncodedSignerLeaf:sZ,hashNode:za,leftFace:JEe,isWalletConfig:ZEe,imageHash:zk,isSimpleNestedMember:oZ,topologyToMembers:Lv,hasUnknownNodes:k_,toSimpleWalletConfig:XEe,legacyTopologyBuilder:Hk,merkleTopologyBuilder:Gk,optimized2SignersTopologyBuilder:Wk,toWalletConfig:cZ,hasSubdigest:V5,signersOf:M_,isComplete:z5,ConfigCoder:V8}),tCe=Object.freeze({__proto__:null});const rCe={config:V8,signature:q8},lZ=2,fZ={version:lZ,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:lZ,DeployedWalletContext:fZ}),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:YJ,2:fZ};var cCe=Object.freeze({__proto__:null,addressOf:R_,isValidCounterfactual:iCe,isValidVersionedContext:sCe,latestContext:oCe,defaultContexts:aCe});const z8=`tuple( +`,e,t.threshold,t.weight])}return Ru(t)?t.nodeHash:dp(["bytes32","bytes32"],[za(t.left),za(t.right)])}function JEe(t){const e=[];let r=t;for(;!zk(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 Hk(t){return dp(["bytes32","uint256"],[dp(["bytes32","uint256"],[za(t.tree),t.threshold]),t.checkpoint])}function oZ(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Fv(t){return ro(t)||ku(t)?[t]:Mu(t)?[{threshold:t.threshold,weight:t.weight,members:Fv(t.tree)}]:Ru(t)?[]:[...Fv(t.left),...Fv(t.right)]}function k_(t){return Ru(t)?!0:Gc(t)?k_(t.left)||k_(t.right):!1}function XEe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Fv(t.tree)}}const aZ=(t,e)=>t.map(r=>oZ(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function Gk(t){if(t.length===0)throw new Error("Empty members array");return aZ(t,Gk).reduce((r,n)=>({left:r,right:n}))}function Wk(t){if(t.length===0)throw new Error("Empty members array");const e=aZ(t,Wk);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 Kk(t){return t.length>8?Wk(t):Gk(t)}function cZ(t,e=Kk){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function V5(t,e){return ku(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();Mu(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):!Ru(t)}const V8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>Hk(t),hasSubdigest:(t,e)=>V5(t.tree,e),checkpointOf:t=>BigInt(t.checkpoint),signersOf:t=>M_(t.tree),fromSimple:t=>{var e;return cZ(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=Fv(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:Kk(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:ku,topologyToJSON:Rb,topologyFromJSON:Ob,isNestedLeaf:Mu,isNodeLeaf:Ru,isLeaf:zk,isNode:Gc,isTopology:QEe,encodeSignerLeaf:nZ,decodeSignerLeaf:iZ,isEncodedSignerLeaf:sZ,hashNode:za,leftFace:JEe,isWalletConfig:ZEe,imageHash:Hk,isSimpleNestedMember:oZ,topologyToMembers:Fv,hasUnknownNodes:k_,toSimpleWalletConfig:XEe,legacyTopologyBuilder:Gk,merkleTopologyBuilder:Wk,optimized2SignersTopologyBuilder:Kk,toWalletConfig:cZ,hasSubdigest:V5,signersOf:M_,isComplete:z5,ConfigCoder:V8}),tCe=Object.freeze({__proto__:null});const rCe={config:V8,signature:q8},lZ=2,fZ={version:lZ,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:lZ,DeployedWalletContext:fZ}),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:YJ,2:fZ};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 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 uZ(t,e){return Ls.defaultAbiCoder().encode(["uint256",z8],[t,Aw(e)])}function dZ(t,e){return br(uZ(t,e))}function dCe(t,e,r,n){return Ex({address:t,chainId:e,digest:dZ(r,n)})}function hCe(t,e,r){return Ex({address:t,chainId:e,digest:br(Ls.defaultAbiCoder().encode(["string",z8],["guest:",Aw(r)]))})}function hZ(t,e){return e.map(r=>Kk(t,r))}function Kk(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 pZ(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)?pZ(e)?e:hZ(t,e).map(n=>n.transaction):H8(e)?[e]:[Kk(t,e).transaction]}function vZ(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 gZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&vZ(t)}function mCe(t){const e=new Fi(Ms.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),gZ(t)?[Aw(t.transactions),t.nonce,t.signature]:[Aw(t.transactions),0,new Uint8Array([])])}const yZ="0x61c2926c",mZ=`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 uZ(t,e){return Ls.defaultAbiCoder().encode(["uint256",z8],[t,Aw(e)])}function dZ(t,e){return br(uZ(t,e))}function dCe(t,e,r,n){return Ex({address:t,chainId:e,digest:dZ(r,n)})}function hCe(t,e,r){return Ex({address:t,chainId:e,digest:br(Ls.defaultAbiCoder().encode(["string",z8],["guest:",Aw(r)]))})}function hZ(t,e){return e.map(r=>Yk(t,r))}function Yk(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 pZ(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)?pZ(e)?e:hZ(t,e).map(n=>n.transaction):H8(e)?[e]:[Yk(t,e).transaction]}function vZ(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 gZ(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&vZ(t)}function mCe(t){const e=new Fi(Ms.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),gZ(t)?[Aw(t.transactions),t.nonce,t.signature]:[Aw(t.transactions),0,new Uint8Array([])])}const yZ="0x61c2926c",mZ=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`,O_=(t,e)=>{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))===yZ){const o=s.slice(4),a=Ls.defaultAbiCoder().decode([mZ],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:uZ,digestOfTransactions:dZ,subdigestOfTransactions:dCe,subdigestOfGuestModuleTransactions:hCe,toSequenceTransactions:hZ,toSequenceTransaction:Kk,isSequenceTransaction:H8,hasSequenceTransactions:pZ,sequenceTxAbiEncode:Aw,fromTxAbiEncode:pCe,encodeNonce:vCe,decodeNonce:gCe,fromTransactionish:yCe,isTransactionBundle:vZ,isSignedTransactionBundle:gZ,encodeBundleExecData:mCe,selfExecuteSelector:yZ,selfExecuteAbi:mZ,unwind:O_});const bZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",wCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function wZ(t,e,r,n){try{return await t.call({data:Vr([bZ,Ls.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var xCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:bZ,EIP_6492_SUFFIX:wCe,validateEIP6492Offchain:wZ});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 wZ(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:Lk,signature:Bk},{config:V8,signature:q8}];function xZ(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 xZ(t)}var _s=Object.freeze({__proto__:null,ALL_CODERS:D_,coderFor:xZ,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 OF;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 DF extends NCe{constructor(e){if(super(NF(e)?{provider:e.provider}:Dp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=NF(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 NF(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 Bd=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 CZ{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),Yk.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 AZ 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,AZ.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},SZ=class _Z extends li{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_Z.prototype)}},$r=class IZ extends li{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,IZ.prototype)}},TZ=class PZ extends li{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PZ.prototype)}},kZ=class MZ extends li{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MZ.prototype)}},RZ=class OZ extends li{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,OZ.prototype)}},Yk=class DZ extends li{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,DZ.prototype)}},NZ=class BZ extends li{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BZ.prototype)}},LZ=class FZ extends li{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FZ.prototype)}},jZ=class UZ extends li{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UZ.prototype)}},$Z=class qZ extends li{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qZ.prototype)}},VZ=class zZ extends li{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zZ.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 HZ=class GZ extends li{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GZ.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 WZ=class KZ extends li{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,KZ.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:SZ,[-1]:$r,[-2]:TZ,[-3]:kZ,[-4]:RZ,[-5]:Yk,[-6]:NZ,[-7]:LZ,[-8]:jZ,[-9]:$Z,[-10]:VZ,1e3:G8,1001:W8,1003:K8,1005:Y8,2001:HZ,2002:Q8,2003:J8,3e3:WZ};var H5=Object.freeze({__proto__:null,WebRPCVersion:BCe,WebRPCSchemaVersion:LCe,WebRPCSchemaHash:FCe,ETHTxnStatus:Bd,TransferType:jCe,FeeTokenType:UCe,SortOrder:$Ce,Relayer:CZ,WebrpcError:li,WebrpcEndpointError:SZ,WebrpcRequestFailedError:$r,WebrpcBadRouteError:TZ,WebrpcBadMethodError:kZ,WebrpcBadRequestError:RZ,WebrpcBadResponseError:Yk,WebrpcServerPanicError:NZ,WebrpcInternalErrorError:LZ,WebrpcClientDisconnectedError:jZ,WebrpcStreamLostError:$Z,WebrpcStreamFinishedError:VZ,UnauthorizedError:G8,PermissionDeniedError:W8,MethodNotFoundError:K8,AbortedError:Y8,InvalidArgumentError:HZ,UnavailableError:Q8,QueryFailedError:J8,NotFoundError:WZ,errors:qCe});const zCe=[Bd.DROPPED,Bd.SUCCEEDED,Bd.PARTIALLY_FAILED,Bd.FAILED],HCe=[Bd.DROPPED,Bd.PARTIALLY_FAILED,Bd.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 CZ(e.url,this._fetch),YCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=$J(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 LF=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 FF=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(cd({},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(cd({},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=kF(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=cd({},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=LF(c),u=cd({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=LF(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=Rk({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 BF(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=cd({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:kF(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 BF(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 cd({},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||RF.DefaultMigrations,this.migrator=new MF.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 MF.Migrator(e.tracker,(r=e.migrations)!=null?r:RF.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($J(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 FF({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=FF.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=Rk({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"]),jF=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"])},UF=t=>Ue(t),$F=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}},qF=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 VF,zF;function iAe(){return VF||(VF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sAe(){return zF||(zF=[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 YZ(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 HF(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}YZ(t=>({...t,get:(e,r,n)=>HF(e,r)||t.get(e,r,n),has:(e,r)=>!!HF(e,r)||t.has(e,r)}));const hAe=["continue","continuePrimaryKey","advance"],GF={},$_=new WeakMap,QZ=new WeakMap,pAe={get(t,e){if(!hAe.includes(e))return t[e];let r=GF[e];return r||(r=GF[e]=function(...n){$_.set(this,QZ.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(QZ.set(r,e),X8.set(r,U_(e));e;)yield r,e=await($_.get(r)||e.continue()),$_.delete(r)}function WF(t,e){return e===Symbol.asyncIterator&&L_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&L_(t,[IDBIndex,IDBObjectStore])}YZ(t=>({...t,get(e,r,n){return WF(e,r)?vAe:t.get(e,r,n)},has(e,r){return WF(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 JZ{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 ZZ(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 KF,YF;function SAe(){return KF||(KF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _Ae(){return YF||(YF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const XZ=new WeakMap,q_=new WeakMap,eX=new WeakMap,x9=new WeakMap,Qk=new WeakMap;function IAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(eh(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&XZ.set(r,t)}).catch(()=>{}),Qk.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||eX.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return eh(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 eX.set(n,e.sort?e.sort():[e]),eh(n)}:_Ae().includes(t)?function(...e){return t.apply(E9(this),e),eh(XZ.get(this))}:function(...e){return eh(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 eh(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),Qk.set(e,t)),e}const E9=t=>Qk.get(t);function RAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=eh(o);return n&&o.addEventListener("upgradeneeded",c=>{n(eh(o.result),c.oldVersion,c.newVersion,eh(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 QF(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)=>QF(e,r)||t.get(e,r,n),has:(e,r)=>!!QF(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{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))===yZ){const o=s.slice(4),a=Ls.defaultAbiCoder().decode([mZ],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:uZ,digestOfTransactions:dZ,subdigestOfTransactions:dCe,subdigestOfGuestModuleTransactions:hCe,toSequenceTransactions:hZ,toSequenceTransaction:Yk,isSequenceTransaction:H8,hasSequenceTransactions:pZ,sequenceTxAbiEncode:Aw,fromTxAbiEncode:pCe,encodeNonce:vCe,decodeNonce:gCe,fromTransactionish:yCe,isTransactionBundle:vZ,isSignedTransactionBundle:gZ,encodeBundleExecData:mCe,selfExecuteSelector:yZ,selfExecuteAbi:mZ,unwind:O_});const bZ="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",wCe="0x6492649264926492649264926492649264926492649264926492649264926492";async function wZ(t,e,r,n){try{return await t.call({data:Vr([bZ,Ls.defaultAbiCoder().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}catch{return!1}}var xCe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:bZ,EIP_6492_SUFFIX:wCe,validateEIP6492Offchain:wZ});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 wZ(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:Fk,signature:Lk},{config:V8,signature:q8}];function xZ(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 xZ(t)}var _s=Object.freeze({__proto__:null,ALL_CODERS:D_,coderFor:xZ,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 DF;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 NF extends NCe{constructor(e){if(super(BF(e)?{provider:e.provider}:Dp({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=BF(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 BF(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 Bd=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 CZ{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),Qk.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 AZ 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,AZ.prototype)}static new(e){return new this(e.error,e.code,e.message||e.msg,e.status,e.cause)}},SZ=class _Z extends li{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_Z.prototype)}},$r=class IZ extends li{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,IZ.prototype)}},TZ=class PZ extends li{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PZ.prototype)}},kZ=class MZ extends li{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MZ.prototype)}},RZ=class OZ extends li{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,OZ.prototype)}},Qk=class DZ extends li{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,DZ.prototype)}},NZ=class BZ extends li{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,BZ.prototype)}},LZ=class FZ extends li{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,FZ.prototype)}},jZ=class UZ extends li{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,UZ.prototype)}},$Z=class qZ extends li{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,qZ.prototype)}},VZ=class zZ extends li{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zZ.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 HZ=class GZ extends li{constructor(e="InvalidArgument",r=2001,n="Invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,GZ.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 WZ=class KZ extends li{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,KZ.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:SZ,[-1]:$r,[-2]:TZ,[-3]:kZ,[-4]:RZ,[-5]:Qk,[-6]:NZ,[-7]:LZ,[-8]:jZ,[-9]:$Z,[-10]:VZ,1e3:G8,1001:W8,1003:K8,1005:Y8,2001:HZ,2002:Q8,2003:J8,3e3:WZ};var H5=Object.freeze({__proto__:null,WebRPCVersion:BCe,WebRPCSchemaVersion:LCe,WebRPCSchemaHash:FCe,ETHTxnStatus:Bd,TransferType:jCe,FeeTokenType:UCe,SortOrder:$Ce,Relayer:CZ,WebrpcError:li,WebrpcEndpointError:SZ,WebrpcRequestFailedError:$r,WebrpcBadRouteError:TZ,WebrpcBadMethodError:kZ,WebrpcBadRequestError:RZ,WebrpcBadResponseError:Qk,WebrpcServerPanicError:NZ,WebrpcInternalErrorError:LZ,WebrpcClientDisconnectedError:jZ,WebrpcStreamLostError:$Z,WebrpcStreamFinishedError:VZ,UnauthorizedError:G8,PermissionDeniedError:W8,MethodNotFoundError:K8,AbortedError:Y8,InvalidArgumentError:HZ,UnavailableError:Q8,QueryFailedError:J8,NotFoundError:WZ,errors:qCe});const zCe=[Bd.DROPPED,Bd.SUCCEEDED,Bd.PARTIALLY_FAILED,Bd.FAILED],HCe=[Bd.DROPPED,Bd.PARTIALLY_FAILED,Bd.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 CZ(e.url,this._fetch),YCe(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=$J(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?Lv(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 FF=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 jF=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(cd({},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(cd({},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=MF(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=cd({},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=FF(c),u=cd({},i,{parts:f});return l(u),this.coders.signature.hasEnoughSigningPower(this.config,f)}}),a=FF(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=Ok({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 LF(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=cd({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:MF(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 LF(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 cd({},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||OF.DefaultMigrations,this.migrator=new RF.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 RF.Migrator(e.tracker,(r=e.migrations)!=null?r:OF.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($J(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 jF({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=jF.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=Ok({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"]),UF=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"])},$F=t=>Ue(t),qF=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}},VF=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 zF,HF;function iAe(){return zF||(zF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sAe(){return HF||(HF=[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 YZ(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 GF(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}YZ(t=>({...t,get:(e,r,n)=>GF(e,r)||t.get(e,r,n),has:(e,r)=>!!GF(e,r)||t.has(e,r)}));const hAe=["continue","continuePrimaryKey","advance"],WF={},$_=new WeakMap,QZ=new WeakMap,pAe={get(t,e){if(!hAe.includes(e))return t[e];let r=WF[e];return r||(r=WF[e]=function(...n){$_.set(this,QZ.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(QZ.set(r,e),X8.set(r,U_(e));e;)yield r,e=await($_.get(r)||e.continue()),$_.delete(r)}function KF(t,e){return e===Symbol.asyncIterator&&L_(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&L_(t,[IDBIndex,IDBObjectStore])}YZ(t=>({...t,get(e,r,n){return KF(e,r)?vAe:t.get(e,r,n)},has(e,r){return KF(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 JZ{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 ZZ(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 YF,QF;function SAe(){return YF||(YF=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _Ae(){return QF||(QF=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const XZ=new WeakMap,q_=new WeakMap,eX=new WeakMap,x9=new WeakMap,Jk=new WeakMap;function IAe(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(eh(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&XZ.set(r,t)}).catch(()=>{}),Jk.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||eX.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return eh(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 eX.set(n,e.sort?e.sort():[e]),eh(n)}:_Ae().includes(t)?function(...e){return t.apply(E9(this),e),eh(XZ.get(this))}:function(...e){return eh(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 eh(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),Jk.set(e,t)),e}const E9=t=>Jk.get(t);function RAe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=eh(o);return n&&o.addEventListener("upgradeneeded",c=>{n(eh(o.result),c.oldVersion,c.newVersion,eh(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 JF(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)=>JF(e,r)||t.get(e,r,n),has:(e,r)=>!!JF(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=W1(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:jv.namespace,a=e==null?void 0:e.owners,c=(n=e==null?void 0:e.graphqlUrl)!=null?n:jv.graphqlUrl,l=(i=e==null?void 0:e.rateLimitRetryDelayMs)!=null?i:jv.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 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 tX{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 rX(t){return t.left!==void 0&&t.right!==void 0}function nX(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:rX,isPlainNested:nX,isPlainV2Config:z_,MemoryTrackerStore:tX,recreateBigNumbers:jv,IndexedDBStore:UAe});class Jk{constructor(e,r=new tX,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(rX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return nX(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 le=b.checkpoint;if(c){if(F>=le)continue}else if(F<=le)continue}const $=new Map((await Promise.all(f.map(async function(le){const K=await i.store.loadSignatureOfSubdigest(le,_.subdigest);if(!K)return[le,void 0];const k=Me(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(le,_.subdigest,K):K),R=yt.signer.tryRecoverSigner(_.subdigest,k)!==le;return[le,{isDynamic:R,signature:k}]}))).filter(le=>!!le[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 JZ(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:Jk});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 Zk extends js{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Zk.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 Xk extends js{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Xk.prototype)}}class eM extends js{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eM.prototype)}}class tM extends js{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tM.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 rM extends js{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.prototype)}}class nM extends js{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class iM extends js{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends js{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class oM extends js{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends js{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}class cM extends js{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cM.prototype)}}const zAe={0:Zk,[-1]:xo,[-2]:Xk,[-3]:eM,[-4]:tM,[-5]:eE,[-6]:rM,[-7]:nM,[-8]:iM,[-9]:sM,[-10]:oM,1:aM,2:cM};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 Jk(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 JF{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 iX}class iX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new JF}invalidateCache(){this.cache=new JF}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 Jk&&this.tracker.updateProvider(e)}}var sX=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:iX});const G_=new sX.arweave.ArweaveReader({graphqlUrl:"https://arweave-search.goldsky.com/graphql"});var uh=(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))(uh||{}),ul=(t=>(t.SECURITY="security",t))(ul||{});const ZF="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",oX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:ZF},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:ZF}},aX="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},lM=(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=>lM("https://${network}-indexer.sequence.app",{network:t}),s9e=t=>lM("https://${network}-relayer.sequence.app",{network:t}),o9e=t=>lM("https://nodes.sequence.app/${network}",{network:t});function a9e(t){return _w(fM,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"}}})],fM=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 DF(e.connect(new Ty(t))):new DF(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(uh.NETWORKS_USER_EDITS),networksUserAdditions:new Np(uh.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 dh=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"},cX={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={...cX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},lX={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={...lX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},fX={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={...fX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},uX={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={...uX,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]:cX,[ge.POLYGON_AMOY]:g9e,[ge.POLYGON_ZKEVM]:{...dl,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:lX,[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]:fX,[ge.XAI_SEPOLIA]:m9e,[ge.HOMEVERSE]:uX,[ge.HOMEVERSE_TESTNET]:b9e,[ge.XR_SEPOLIA]:w9e},E9e=t=>x9e[t]||null;function dX(t,e){e(t.get()),t.subscribe(e)}const Uv=`[ + `;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=jv.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 W1(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:W1(t[0]),right:W1(t[1])}:or.config.isNode(t)?{left:W1(t.left),right:W1(t.right)}:or.config.isNestedLeaf(t)?Gl({},t,{tree:W1(t.tree)}):t}var LAe=Object.freeze({__proto__:null,defaults:jv,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 tX{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 Uv(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=>Uv(i)):typeof n=="object"&&n!==null?e[r]=Uv(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=>Uv(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=>Uv(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=>Uv(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 rX(t){return t.left!==void 0&&t.right!==void 0}function nX(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:rX,isPlainNested:nX,isPlainV2Config:z_,MemoryTrackerStore:tX,recreateBigNumbers:Uv,IndexedDBStore:UAe});class Zk{constructor(e,r=new tX,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(rX(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return nX(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 le=b.checkpoint;if(c){if(F>=le)continue}else if(F<=le)continue}const $=new Map((await Promise.all(f.map(async function(le){const K=await i.store.loadSignatureOfSubdigest(le,_.subdigest);if(!K)return[le,void 0];const k=Me(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(le,_.subdigest,K):K),R=yt.signer.tryRecoverSigner(_.subdigest,k)!==le;return[le,{isDynamic:R,signature:k}]}))).filter(le=>!!le[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 JZ(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:Zk});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 Xk extends js{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Xk.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 eM extends js{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eM.prototype)}}class tM extends js{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tM.prototype)}}class rM extends js{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rM.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 nM extends js{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nM.prototype)}}class iM extends js{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iM.prototype)}}class sM extends js{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,sM.prototype)}}class oM extends js{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oM.prototype)}}class aM extends js{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aM.prototype)}}class cM extends js{constructor(e="InvalidArgument",r=1,n="invalid argument",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cM.prototype)}}class lM extends js{constructor(e="NotFound",r=2,n="not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lM.prototype)}}const zAe={0:Xk,[-1]:xo,[-2]:eM,[-3]:tM,[-4]:rM,[-5]:eE,[-6]:nM,[-7]:iM,[-8]:sM,[-9]:oM,[-10]:aM,1:cM,2:lM};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:yv(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=yv(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:yv(r.tx.nonce),signature:r.tx.signature,chainID:yv(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?yv(t.value):void 0,data:t.data!==void 0?Me(t.data):void 0,gasLimit:t.gasLimit!==void 0?yv(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function D0(t){return Number(t)}function yv(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 Zk(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 ZF{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 iX}class iX{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new ZF}invalidateCache(){this.cache=new ZF}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 Zk&&this.tracker.updateProvider(e)}}var sX=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:iX});const G_=new sX.arweave.ArweaveReader({graphqlUrl:"https://arweave-search.goldsky.com/graphql"});var uh=(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))(uh||{}),ul=(t=>(t.SECURITY="security",t))(ul||{});const XF="0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3",oX={1:{version:1,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",walletCreationCode:XF},2:{version:2,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",walletCreationCode:XF}},aX="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 oy(){return oy=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},fM=(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=>fM("https://${network}-indexer.sequence.app",{network:t}),s9e=t=>fM("https://${network}-relayer.sequence.app",{network:t}),o9e=t=>fM("https://nodes.sequence.app/${network}",{network:t});function a9e(t){return _w(uM,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 oy({},r,{rpcUrl:n,indexerUrl:i9e(r.name),relayer:{url:s9e(r.name),provider:{url:n}}},e)},l9e=[oy({},Sw[ge.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),oy({},Sw[ge.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})],uM=r9e([oy({},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 NF(e.connect(new Ty(t))):new NF(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(uh.NETWORKS_USER_EDITS),networksUserAdditions:new Np(uh.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 dh=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"},cX={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={...cX,chainId:ge.POLYGON_AMOY,symbol:"aPOL",name:"Amoy Polygon"},lX={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={...lX,chainId:ge.BSC_TESTNET,symbol:"BNB",name:"Testnet BNB"},fX={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={...fX,chainId:ge.XAI_SEPOLIA,logoURI:"",symbol:"sXAI",name:"Sepolia XAI"},uX={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={...uX,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]:cX,[ge.POLYGON_AMOY]:g9e,[ge.POLYGON_ZKEVM]:{...dl,chainId:ge.POLYGON_ZKEVM},[ge.BSC]:lX,[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]:fX,[ge.XAI_SEPOLIA]:m9e,[ge.HOMEVERSE]:uX,[ge.HOMEVERSE_TESTNET]:b9e,[ge.XR_SEPOLIA]:w9e},E9e=t=>x9e[t]||null;function dX(t,e){e(t.get()),t.subscribe(e)}const $v=`[ { "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" } -]`,uM=`[ +]`,dM=`[ { "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" } - ]`,dM=`[ + ]`,hM=`[ { "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 Ix{constructor(e){de(this,"isFetchingBalances",Nr(!1));de(this,"isFetchingTokenInfo",Nr(!1));de(this,"balances",Nr([]));de(this,"userAddedTokens",Nr([]));de(this,"local",{userAddedTokens:new Np(uh.TOKENS_USER_ADDITIONS)});this.store=e;const r=this.store.get(Bn);dX(r.networks,n=>{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:dh.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===dh.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:oX,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 $F(n,i);s.salt=UF(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=UF(r),s=await jF(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await $F(s,o);a.salt=i,await(await m3(ul.SECURITY)).put(ul.SECURITY,a,"mnemonic")}async decryptRecoveryMnemonic(e,r){const n=await qF(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await jF(r,n),s=await qF(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",W_=({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"}})})]})},hM="/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(be,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(be,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(be,{padding:"6",marginTop:"16",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:hM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(He,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(be,{marginTop:"8",children:W.jsxs(qr,{flexDirection:"column",gap:"6",children:[W.jsx(He,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(He,{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(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(be,{children:W.jsx(Xt,{as:ZK,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(be,{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(be,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(He,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(W_,{label:"Password",value:n,onChange:p=>{i(p.target.value),c(!1)}}),W.jsx(be,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(He,{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(be,{children:W.jsx(Xt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{f()}})})]}):W.jsx(be,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})})})]}),s&&W.jsx(Ec,{size:"md",onClose:()=>o(!1),children:W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(be,{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"})]})]})})]})}function I9e(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}`}const T9e={"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 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(""),[g,y]=D.useState(!1),[b,I]=D.useState(!1),[C,S]=D.useState(!1),[O,L]=D.useState(!1),[F,z]=D.useState(!1),[_,$]=D.useState(!1),ie=yn(t.isLoadingAccount);D.useEffect(()=>{if(L(!1),!pw(n))return;$(!0);const N=Jt(n);m(N)},[n]);const le=()=>{const N=Jt(n);g?t.signInWithRecoveryMnemonic(N,a.trim(),l):t.signInWithRecoveryMnemonic(N,a.trim())},K=(N=a)=>N.replace(/\s+/g," ").trim().split(" ").length==12,k=()=>(l==null?void 0:l.length)>=8,R=async N=>{if(i(""),o([]),c(N),z(!1),!!K(N)){$(!0);try{const x=F5.fromPhrase(N),E=[...(await G_.walletsOfSigner({signer:x.address})).map(({wallet:w})=>w),...(T9e[x.address]??[]).map(({wallet:w})=>w)];S(!0),o(E),E.length===1&&i(E[0])}catch(x){console.error(x)}$(!1)}},v=async N=>{i(N),z(!1)},m=async N=>{try{const x=F5.fromPhrase(a),E=new Z8([x]),P=(await new _x({address:N,tracker:G_,contexts:oX,orchestrator:E,networks:r}).status(ge.MAINNET)).config,j=_s.genericCoderFor(P.version).config.signersOf(P).some(X=>X.address===x.address);z(j),j||L(!0)}catch(x){L(!0),console.error(x)}$(!1)},M=()=>{I(!b),i(s[0])};return W.jsx(be,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:W.jsxs(be,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(be,{padding:"6",marginTop:"16",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:hM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(He,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(be,{marginTop:"12",children:[W.jsxs(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(He,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(He,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(He,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(be,{flexDirection:"column",marginTop:"12",children:[W.jsxs(be,{children:[W.jsx(Kwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:N=>R(N.target.value)}),a&&!K()&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),C&&K()&&W.jsxs(be,{flexDirection:"column",gap:"8",marginTop:"3",marginLeft:"1",children:[W.jsx(ZT,{color:"primary",labelLocation:"right",label:W.jsx(He,{color:"text80",underline:"true",children:"Use Password to Encrypt Mnemonic (Optional)"}),checked:g,onCheckedChange:N=>{y(N===!0)}}),g&&W.jsxs(be,{flexDirection:"column",gap:"3",children:[W.jsxs(be,{children:[W.jsx(W_,{label:"Create Password (min 8 characters)",value:l,onChange:N=>f(N.target.value)}),l&&!k()&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(be,{children:[W.jsx(W_,{label:"Confirm Password",value:u,onChange:N=>p(N.target.value)}),l&&u&&l!==u&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Passwords must match"})]})]}),W.jsxs(be,{children:[W.jsx(Iu,{color:"white"}),W.jsx(be,{justifyContent:"flex-end",children:W.jsx(He,{marginRight:"1",variant:"small",color:"text80",cursor:"pointer",underline:"true",onClick:()=>{M()},children:b?"Go back to default wallet":"Enter another wallet"})})]}),b&&s.length>1&&W.jsx(be,{flexDirection:"column",gap:"4",children:W.jsx(be,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(N=>W.jsx(Xt,{size:"lg",shape:"square",label:I9e(N,18,4),onClick:()=>{i(N)}},N))})}),W.jsxs(be,{children:[W.jsx(Wn,{name:"wallet",label:b?"Enter Address Manually":"Sequence Wallet Address",labelLocation:"left",disabled:!b,value:n,onChange:N=>v(N.target.value)}),O&&W.jsx(be,{justifyContent:"center",marginTop:"2",children:W.jsx(He,{variant:"small",color:"negative",children:"Wallet does not match recovery phrase"})})]})]}),_&&W.jsx(be,{alignItems:"center",justifyContent:"center",marginTop:"4",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})})]})]}),W.jsxs(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[ie&&W.jsx(be,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})}),!ie&&W.jsxs(W.Fragment,{children:[W.jsx(be,{children:W.jsx(Xt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!pw(n)||g&&(!l||l.length<8)||l!==u||F===!1,onClick:()=>{le()},width:"full",marginTop:"16"})}),W.jsx(be,{children:W.jsx(Xt,{as:ZK,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]})})}const k9e="modulepreload",M9e=function(t){return"/"+t},XF={},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 XF)return;XF[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 pM={exports:{}},$v=typeof Reflect=="object"?Reflect:null,ej=$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)}pM.exports=dn;pM.exports.once=L9e;dn.EventEmitter=dn;dn.prototype._events=void 0;dn.prototype._eventsCount=0;dn.prototype._maxListeners=void 0;var tj=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 tj},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+".");tj=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")ej(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{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:dh.NATIVE,contractAddress:mu,tokenID:"",accountAddress:e,balance:c.toString(),chainId:o.chainId,blockHash:ey,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,$v,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:ey,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===dh.NATIVE?s=await r.getBalance(n):s=await new Nn(e.contractAddress,$v,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,$v,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:oX,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 qF(n,i);s.salt=$F(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=$F(r),s=await UF(n,i),o=JSON.stringify({wallet:r,mnemonic:e}),a=await qF(s,o);a.salt=i,await(await m3(ul.SECURITY)).put(ul.SECURITY,a,"mnemonic")}async decryptRecoveryMnemonic(e,r){const n=await VF(r,e);return JSON.parse(n)}async decryptRecoveryMnemonicWithPassword(e,r){const n=e.salt,i=await UF(r,n),s=await VF(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",W_=({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"}})})]})},pM="/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(be,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:[W.jsxs(be,{width:"full",style:{maxWidth:"800px"},children:[W.jsx(be,{padding:"6",marginTop:"16",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:pM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(He,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),!e&&W.jsxs(W.Fragment,{children:[W.jsx(be,{marginTop:"8",children:W.jsxs(qr,{flexDirection:"column",gap:"6",children:[W.jsx(He,{variant:"medium",color:"warning",textAlign:"center",children:"Warning section"}),W.jsx(He,{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(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(be,{children:W.jsx(Xt,{as:ZK,to:"/recovery",variant:"primary",size:"lg",shape:"square",label:"Start Recovery",width:"full",marginTop:"16"})}),W.jsx(be,{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(be,{flexDirection:"column",marginTop:"8",justifyContent:"center",alignItems:"center",children:[W.jsx(He,{variant:"large",color:"text100",marginBottom:"8",children:"Weclome back!"}),W.jsx(W_,{label:"Password",value:n,onChange:p=>{i(p.target.value),c(!1)}}),W.jsx(be,{alignSelf:"flex-start",height:"6",children:a&&W.jsx(He,{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(be,{children:W.jsx(Xt,{variant:"text",label:"The dog ate my password (Forgot Password)",onClick:()=>{f()}})})]}):W.jsx(be,{marginTop:"8",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})})})]}),s&&W.jsx(Ec,{size:"md",onClose:()=>o(!1),children:W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"16",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:'Click "Reset" to START OVER and re-enter your mnemonic'}),W.jsxs(be,{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"})]})]})})]})}function I9e(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}`}const T9e={"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 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(""),[g,y]=D.useState(!1),[b,I]=D.useState(!1),[C,S]=D.useState(!1),[O,L]=D.useState(!1),[F,z]=D.useState(!1),[_,$]=D.useState(!1),ie=yn(t.isLoadingAccount);D.useEffect(()=>{if(L(!1),!pw(n))return;$(!0);const N=Jt(n);m(N)},[n]);const le=()=>{const N=Jt(n);g?t.signInWithRecoveryMnemonic(N,a.trim(),l):t.signInWithRecoveryMnemonic(N,a.trim())},K=(N=a)=>N.replace(/\s+/g," ").trim().split(" ").length==12,k=()=>(l==null?void 0:l.length)>=8,R=async N=>{if(i(""),o([]),c(N),z(!1),!!K(N)){$(!0);try{const x=F5.fromPhrase(N),E=[...(await G_.walletsOfSigner({signer:x.address})).map(({wallet:w})=>w),...(T9e[x.address]??[]).map(({wallet:w})=>w)];S(!0),o(E),E.length===1&&i(E[0])}catch(x){console.error(x)}$(!1)}},v=async N=>{i(N),z(!1)},m=async N=>{try{const x=F5.fromPhrase(a),E=new Z8([x]),P=(await new _x({address:N,tracker:G_,contexts:oX,orchestrator:E,networks:r}).status(ge.MAINNET)).config,j=_s.genericCoderFor(P.version).config.signersOf(P).some(X=>X.address===x.address);z(j),j||L(!0)}catch(x){L(!0),console.error(x)}$(!1)},M=()=>{I(!b),i(s[0])};return W.jsx(be,{background:"backgroundPrimary",width:"full",height:"full",paddingX:"8",alignItems:"center",justifyContent:"center",children:W.jsxs(be,{width:"full",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsx(be,{padding:"6",marginTop:"16",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"6",children:[W.jsx("img",{src:pM,alt:"Sequence Logo",style:{width:"100px",height:"100px"}}),W.jsxs(He,{variant:"large",color:"text100",textAlign:"center",children:["Sequence ",W.jsx("br",{})," Wallet Recovery"]})]})}),W.jsxs(be,{marginTop:"12",children:[W.jsxs(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[W.jsx(He,{variant:"medium",color:"text100",textAlign:"center",children:"Enter your recovery phrase"}),W.jsxs(He,{variant:"normal",color:"text50",marginTop:"4",textAlign:"center",children:["This is the recovery phrase you create on"," ",W.jsx(He,{variant:"link",cursor:"pointer",color:"text80",onClick:()=>window.open("https://sequence.app/settings/recovery"),children:"sequence.app/settings/recovery"})]})]}),W.jsxs(be,{flexDirection:"column",marginTop:"12",children:[W.jsxs(be,{children:[W.jsx(Kwe,{name:"mnemonic",label:"Recovery Phrase",labelLocation:"top",value:a,onChange:N=>R(N.target.value)}),a&&!K()&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Mnemonic must be 12 words"})]}),C&&K()&&W.jsxs(be,{flexDirection:"column",gap:"8",marginTop:"3",marginLeft:"1",children:[W.jsx(ZT,{color:"primary",labelLocation:"right",label:W.jsx(He,{color:"text80",underline:"true",children:"Use Password to Encrypt Mnemonic (Optional)"}),checked:g,onCheckedChange:N=>{y(N===!0)}}),g&&W.jsxs(be,{flexDirection:"column",gap:"3",children:[W.jsxs(be,{children:[W.jsx(W_,{label:"Create Password (min 8 characters)",value:l,onChange:N=>f(N.target.value)}),l&&!k()&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Password not long enough"})]}),W.jsxs(be,{children:[W.jsx(W_,{label:"Confirm Password",value:u,onChange:N=>p(N.target.value)}),l&&u&&l!==u&&W.jsx(He,{variant:"small",color:"negative",marginLeft:"1",marginTop:"2",children:"Passwords must match"})]})]}),W.jsxs(be,{children:[W.jsx(Iu,{color:"white"}),W.jsx(be,{justifyContent:"flex-end",children:W.jsx(He,{marginRight:"1",variant:"small",color:"text80",cursor:"pointer",underline:"true",onClick:()=>{M()},children:b?"Go back to default wallet":"Enter another wallet"})})]}),b&&s.length>1&&W.jsx(be,{flexDirection:"column",gap:"4",children:W.jsx(be,{display:"grid",gap:"4",style:{gridTemplateColumns:"1fr 1fr 1fr"},children:s.map(N=>W.jsx(Xt,{size:"lg",shape:"square",label:I9e(N,18,4),onClick:()=>{i(N)}},N))})}),W.jsxs(be,{children:[W.jsx(Wn,{name:"wallet",label:b?"Enter Address Manually":"Sequence Wallet Address",labelLocation:"left",disabled:!b,value:n,onChange:N=>v(N.target.value)}),O&&W.jsx(be,{justifyContent:"center",marginTop:"2",children:W.jsx(He,{variant:"small",color:"negative",children:"Wallet does not match recovery phrase"})})]})]}),_&&W.jsx(be,{alignItems:"center",justifyContent:"center",marginTop:"4",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})})]})]}),W.jsxs(be,{alignItems:"center",justifyContent:"center",flexDirection:"column",children:[ie&&W.jsx(be,{marginTop:"16",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{width:"16",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})}),!ie&&W.jsxs(W.Fragment,{children:[W.jsx(be,{children:W.jsx(Xt,{variant:"primary",size:"lg",shape:"square",label:"Continue",disabled:!a||!pw(n)||g&&(!l||l.length<8)||l!==u||F===!1,onClick:()=>{le()},width:"full",marginTop:"16"})}),W.jsx(be,{children:W.jsx(Xt,{as:ZK,to:"/",variant:"text",size:"lg",shape:"square",label:"Go back to start",width:"full",marginTop:"6"})})]})]})]})})}const k9e="modulepreload",M9e=function(t){return"/"+t},ej={},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 ej)return;ej[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 vM={exports:{}},qv=typeof Reflect=="object"?Reflect:null,tj=qv&&typeof qv.apply=="function"?qv.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},E3;qv&&typeof qv.ownKeys=="function"?E3=qv.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)}vM.exports=dn;vM.exports.once=L9e;dn.EventEmitter=dn;dn.prototype._events=void 0;dn.prototype._eventsCount=0;dn.prototype._maxListeners=void 0;var rj=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 rj},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+".");rj=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")tj(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 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 Q_=="function"?Q_(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 Y_},__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:Q_},Symbol.toStringTag,{value:"Module"})),Tx=$$(mSe);var _9={},Pm={},sj;function bSe(){if(sj)return Pm;sj=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={},oj;function wSe(){return oj||(oj=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={},aj;function xSe(){return aj||(aj=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 cj;function EX(){return cj||(cj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(wSe(),t),e.__exportStar(xSe(),t)}(I9)),I9}var lj;function ESe(){if(lj)return s0;lj=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 fj;function CSe(){return fj||(fj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(bSe(),t),e.__exportStar(ESe(),t)}(_9)),_9}var j1={},uj;function ASe(){if(uj)return j1;uj=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={},dj;function SSe(){if(dj)return km;dj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.IWatch=void 0;class t{}return km.IWatch=t,km}var hj;function _Se(){return hj||(hj=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=gM=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 gM=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 yM={};Object.defineProperty(yM,"__esModule",{value:!0});var AX=yM.getWindowMetadata=void 0;const pj=gn;function LSe(){let t,e;try{t=pj.getDocumentOrThrow(),e=pj.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=yM.getWindowMetadata=LSe;var Tw={},FSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),SX="%[a-f0-9]{2}",vj=new RegExp("("+SX+")|([^%]+?)","gi"),gj=new RegExp("("+SX+")+","gi");function J_(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([],J_(r),J_(n))}function jSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(vj)||[],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(le=>u(le,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:{}};/** +***************************************************************************** */var K_=function(t,e){return K_=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])},K_(t,e)};function X9e(t,e){K_(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Y_=function(){return Y_=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 Q_=="function"?Q_(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 Y_},__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:Q_},Symbol.toStringTag,{value:"Module"})),Tx=q$(mSe);var _9={},Pm={},oj;function bSe(){if(oj)return Pm;oj=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={},aj;function wSe(){return aj||(aj=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={},cj;function xSe(){return cj||(cj=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 lj;function EX(){return lj||(lj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(wSe(),t),e.__exportStar(xSe(),t)}(I9)),I9}var fj;function ESe(){if(fj)return s0;fj=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 uj;function CSe(){return uj||(uj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Tx;e.__exportStar(bSe(),t),e.__exportStar(ESe(),t)}(_9)),_9}var U1={},dj;function ASe(){if(dj)return U1;dj=1,Object.defineProperty(U1,"__esModule",{value:!0}),U1.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 U1.Watch=t,U1.default=t,U1}var P9={},km={},hj;function SSe(){if(hj)return km;hj=1,Object.defineProperty(km,"__esModule",{value:!0}),km.IWatch=void 0;class t{}return km.IWatch=t,km}var pj;function _Se(){return pj||(pj=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=yM=gn.getNavigator=gn.getNavigatorOrThrow=Px=gn.getDocument=gn.getDocumentOrThrow=gn.getFromWindowOrThrow=gn.getFromWindow=void 0;function Yp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}gn.getFromWindow=Yp;function Ry(t){const e=Yp(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 Yp("document")}var Px=gn.getDocument=TSe;function PSe(){return Ry("navigator")}gn.getNavigatorOrThrow=PSe;function kSe(){return Yp("navigator")}var yM=gn.getNavigator=kSe;function MSe(){return Ry("location")}gn.getLocationOrThrow=MSe;function RSe(){return Yp("location")}var CX=gn.getLocation=RSe;function OSe(){return Ry("crypto")}gn.getCryptoOrThrow=OSe;function DSe(){return Yp("crypto")}gn.getCrypto=DSe;function NSe(){return Ry("localStorage")}gn.getLocalStorageOrThrow=NSe;function BSe(){return Yp("localStorage")}gn.getLocalStorage=BSe;var mM={};Object.defineProperty(mM,"__esModule",{value:!0});var AX=mM.getWindowMetadata=void 0;const vj=gn;function LSe(){let t,e;try{t=vj.getDocumentOrThrow(),e=vj.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=mM.getWindowMetadata=LSe;var Tw={},FSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),SX="%[a-f0-9]{2}",gj=new RegExp("("+SX+")|([^%]+?)","gi"),yj=new RegExp("("+SX+")+","gi");function J_(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([],J_(r),J_(n))}function jSe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(gj)||[],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(le=>u(le,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=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 P(j,X,j).update(Z)[G]()}},F=function(j,X,G){return function(Z,ee){return new P(j,X,ee).update(Z)[G]()}},z=function(j,X,G){return function(Z,ee,B,te){return v["cshake"+j].update(Z,ee,B,te)[G]()}},_=function(j,X,G){return function(Z,ee,B,te){return v["kmac"+j].update(Z,ee,B,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}P.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,B=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},P.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 B=0;B=57344?Z+=3:(te=65536+((te&1023)<<10|j.charCodeAt(++B)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},P.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];B%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},P.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,X=this.s,G=this.outputBlocks,Z=this.extraBytes,ee=0,B=0,te=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(te);for(var Ee=new Uint32Array(fe);B>8&255,te[fe+2]=Ee>>16&255,te[fe+3]=Ee>>24&255;B%j===0&&oe(X)}return Z&&(fe=B<<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){P.call(this,j,X,G)}H.prototype=new P,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var oe=function(j){var X,G,Z,ee,B,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,Ge,$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],B=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=B^(_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|B>>>31),G=Te^(B<<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,Ge=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&Ge,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^~Ge&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]=Ge^~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(M=0;M{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 wj=WSe();var Z_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Z_||(Z_={}));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 xj="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),!(bj>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(mj)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+=xj[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){wj&&this.throwError("platform missing String.prototype.normalize",Cn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:wj})}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"}),yj){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}mj=!!e,yj=!!r}static setLogLevel(e){const r=C3[e.toLowerCase()];if(r==null){Cn.globalLogger().warn("invalid log level - "+e);return}bj=r}static from(e){return new Cn(e)}}Cn.errors=Tc;Cn.levels=Z_;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)||mM(t)}function Ej(t){return typeof t=="number"&&t==t&&t%1===0}function mM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Ej(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(mM(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 Cj(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 bM(t){return"0x"+HSe.keccak_256(di(t))}var wM={exports:{}};const XSe={},e7e=Object.freeze(Object.defineProperty({__proto__:null,default:XSe},Symbol.toStringTag,{value:"Module"})),rE=$$(e7e);wM.exports;(function(t){(function(e,r){function n(R,v){if(!R)throw new Error(v||"Assertion failed")}function i(R,v){R.super_=v;var m=function(){};m.prototype=v.prototype,R.prototype=new m,R.prototype.constructor=R}function s(R,v,m){if(s.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(R||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,M){if(typeof v=="number")return this._initNumber(v,m,M);if(typeof v=="object")return this._initArray(v,m,M);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var N=0;v[0]==="-"&&(N++,this.negative=1),N=0;N-=3)E=v[N]|v[N-1]<<8|v[N-2]<<16,this.words[x]|=E<>>26-w&67108863,w+=24,w>=26&&(w-=26,x++);else if(M==="le")for(N=0,x=0;N>>26-w&67108863,w+=24,w>=26&&(w-=26,x++);return this._strip()};function a(R,v){var m=R.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 "+R)}function c(R,v,m){var M=a(R,m);return m-1>=v&&(M|=a(R,m-1)<<4),M}s.prototype._parseHex=function(v,m,M){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var N=0;N=m;N-=2)w=c(v,m,N)<=18?(x-=18,E+=1,this.words[E]|=w>>>26):x+=8;else{var T=v.length-m;for(N=T%2===0?m+1:m;N=18?(x-=18,E+=1,this.words[E]|=w>>>26):x+=8}this._strip()};function l(R,v,m,M){for(var N=0,x=0,E=Math.min(R.length,m),w=v;w=49?x=T-49+10:T>=17?x=T-17+10:x=T,n(T>=0&&x1&&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 M;if(v===16||v==="hex"){M="";for(var N=0,x=0,E=0;E>>24-N&16777215,N+=2,N>=26&&(N-=26,E--),x!==0||E!==this.length-1?M=p[6-T.length]+T+M:M=T+M}for(x!==0&&(M=x.toString(16)+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(v===(v|0)&&v>=2&&v<=36){var P=g[v],H=y[v];M="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(H).toString(v);oe=oe.idivn(H),oe.isZero()?M=j+M:M=p[P-j.length]+j+M}for(this.isZero()&&(M="0"+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}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,M){this._strip();var N=this.byteLength(),x=M||Math.max(1,N);n(N<=x,"byte array longer than desired length"),n(x>0,"Requested array length <= 0");var E=b(v,x),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](E,N),E},s.prototype._toArrayLikeLE=function(v,m){for(var M=0,N=0,x=0,E=0;x>8&255),M>16&255),E===6?(M>24&255),N=0,E=0):(N=w>>>24,E+=2)}if(M=0&&(v[M--]=w>>8&255),M>=0&&(v[M--]=w>>16&255),E===6?(M>=0&&(v[M--]=w>>24&255),N=0,E=0):(N=w>>>24,E+=2)}if(M>=0)for(v[M--]=N;M>=0;)v[M--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,M=0;return m>=4096&&(M+=13,m>>>=13),m>=64&&(M+=7,m>>>=7),m>=8&&(M+=4,m>>>=4),m>=2&&(M+=2,m>>>=2),M+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,M=0;return m&8191||(M+=13,m>>>=13),m&127||(M+=7,m>>>=7),m&15||(M+=4,m>>>=4),m&3||(M+=2,m>>>=2),m&1||M++,M},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(R){for(var v=new Array(R.bitLength()),m=0;m>>N&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 M=0;Mv.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,M;this.length>v.length?(m=this,M=v):(m=v,M=this);for(var N=0;Nv.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,M=v%26;this._expand(m),M>0&&m--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-M),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 M=v/26|0,N=v%26;return this._expand(M+1),m?this.words[M]=this.words[M]|1<v.length?(M=this,N=v):(M=v,N=this);for(var x=0,E=0;E>>26;for(;x!==0&&E>>26;if(this.length=M.length,x!==0)this.words[this.length]=x,this.length++;else if(M!==this)for(;Ev.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 M=this.cmp(v);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,x;M>0?(N=this,x=v):(N=v,x=this);for(var E=0,w=0;w>26,this.words[w]=m&67108863;for(;E!==0&&w>26,this.words[w]=m&67108863;if(E===0&&w>>26,oe=T&67108863,j=Math.min(P,v.length-1),X=Math.max(0,P-R.length+1);X<=j;X++){var G=P-X|0;N=R.words[G]|0,x=v.words[X]|0,E=N*x+oe,H+=E/67108864|0,oe=E&67108863}m.words[P]=oe|0,T=H|0}return T!==0?m.words[P]=T|0:m.length--,m._strip()}var S=function(v,m,M){var N=v.words,x=m.words,E=M.words,w=0,T,P,H,oe=N[0]|0,j=oe&8191,X=oe>>>13,G=N[1]|0,Z=G&8191,ee=G>>>13,B=N[2]|0,te=B&8191,fe=B>>>13,Ee=N[3]|0,_e=Ee&8191,Re=Ee>>>13,Te=N[4]|0,De=Te&8191,ze=Te>>>13,Xe=N[5]|0,Qe=Xe&8191,ke=Xe>>>13,Ne=N[6]|0,et=Ne&8191,Je=Ne>>>13,it=N[7]|0,rt=it&8191,We=it>>>13,lt=N[8]|0,pt=lt&8191,Ke=lt>>>13,vt=N[9]|0,bt=vt&8191,tt=vt>>>13,_t=x[0]|0,Ct=_t&8191,It=_t>>>13,er=x[1]|0,ur=er&8191,wt=er>>>13,lr=x[2]|0,ir=lr&8191,Pt=lr>>>13,Ot=x[3]|0,Dt=Ot&8191,dt=Ot>>>13,Bt=x[4]|0,kt=Bt&8191,ut=Bt>>>13,Vt=x[5]|0,zt=Vt&8191,ht=Vt>>>13,xt=x[6]|0,Nt=xt&8191,Ge=xt>>>13,$t=x[7]|0,Et=$t&8191,ct=$t>>>13,Ht=x[8]|0,Dr=Ht&8191,Ut=Ht>>>13,Ir=x[9]|0,tr=Ir&8191,Rr=Ir>>>13;M.negative=v.negative^m.negative,M.length=19,T=Math.imul(j,Ct),P=Math.imul(j,It),P=P+Math.imul(X,Ct)|0,H=Math.imul(X,It);var vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vi>>>26)|0,vi&=67108863,T=Math.imul(Z,Ct),P=Math.imul(Z,It),P=P+Math.imul(ee,Ct)|0,H=Math.imul(ee,It),T=T+Math.imul(j,ur)|0,P=P+Math.imul(j,wt)|0,P=P+Math.imul(X,ur)|0,H=H+Math.imul(X,wt)|0;var gi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(gi>>>26)|0,gi&=67108863,T=Math.imul(te,Ct),P=Math.imul(te,It),P=P+Math.imul(fe,Ct)|0,H=Math.imul(fe,It),T=T+Math.imul(Z,ur)|0,P=P+Math.imul(Z,wt)|0,P=P+Math.imul(ee,ur)|0,H=H+Math.imul(ee,wt)|0,T=T+Math.imul(j,ir)|0,P=P+Math.imul(j,Pt)|0,P=P+Math.imul(X,ir)|0,H=H+Math.imul(X,Pt)|0;var yi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(yi>>>26)|0,yi&=67108863,T=Math.imul(_e,Ct),P=Math.imul(_e,It),P=P+Math.imul(Re,Ct)|0,H=Math.imul(Re,It),T=T+Math.imul(te,ur)|0,P=P+Math.imul(te,wt)|0,P=P+Math.imul(fe,ur)|0,H=H+Math.imul(fe,wt)|0,T=T+Math.imul(Z,ir)|0,P=P+Math.imul(Z,Pt)|0,P=P+Math.imul(ee,ir)|0,H=H+Math.imul(ee,Pt)|0,T=T+Math.imul(j,Dt)|0,P=P+Math.imul(j,dt)|0,P=P+Math.imul(X,Dt)|0,H=H+Math.imul(X,dt)|0;var Si=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Si>>>26)|0,Si&=67108863,T=Math.imul(De,Ct),P=Math.imul(De,It),P=P+Math.imul(ze,Ct)|0,H=Math.imul(ze,It),T=T+Math.imul(_e,ur)|0,P=P+Math.imul(_e,wt)|0,P=P+Math.imul(Re,ur)|0,H=H+Math.imul(Re,wt)|0,T=T+Math.imul(te,ir)|0,P=P+Math.imul(te,Pt)|0,P=P+Math.imul(fe,ir)|0,H=H+Math.imul(fe,Pt)|0,T=T+Math.imul(Z,Dt)|0,P=P+Math.imul(Z,dt)|0,P=P+Math.imul(ee,Dt)|0,H=H+Math.imul(ee,dt)|0,T=T+Math.imul(j,kt)|0,P=P+Math.imul(j,ut)|0,P=P+Math.imul(X,kt)|0,H=H+Math.imul(X,ut)|0;var _n=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(Qe,Ct),P=Math.imul(Qe,It),P=P+Math.imul(ke,Ct)|0,H=Math.imul(ke,It),T=T+Math.imul(De,ur)|0,P=P+Math.imul(De,wt)|0,P=P+Math.imul(ze,ur)|0,H=H+Math.imul(ze,wt)|0,T=T+Math.imul(_e,ir)|0,P=P+Math.imul(_e,Pt)|0,P=P+Math.imul(Re,ir)|0,H=H+Math.imul(Re,Pt)|0,T=T+Math.imul(te,Dt)|0,P=P+Math.imul(te,dt)|0,P=P+Math.imul(fe,Dt)|0,H=H+Math.imul(fe,dt)|0,T=T+Math.imul(Z,kt)|0,P=P+Math.imul(Z,ut)|0,P=P+Math.imul(ee,kt)|0,H=H+Math.imul(ee,ut)|0,T=T+Math.imul(j,zt)|0,P=P+Math.imul(j,ht)|0,P=P+Math.imul(X,zt)|0,H=H+Math.imul(X,ht)|0;var us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(us>>>26)|0,us&=67108863,T=Math.imul(et,Ct),P=Math.imul(et,It),P=P+Math.imul(Je,Ct)|0,H=Math.imul(Je,It),T=T+Math.imul(Qe,ur)|0,P=P+Math.imul(Qe,wt)|0,P=P+Math.imul(ke,ur)|0,H=H+Math.imul(ke,wt)|0,T=T+Math.imul(De,ir)|0,P=P+Math.imul(De,Pt)|0,P=P+Math.imul(ze,ir)|0,H=H+Math.imul(ze,Pt)|0,T=T+Math.imul(_e,Dt)|0,P=P+Math.imul(_e,dt)|0,P=P+Math.imul(Re,Dt)|0,H=H+Math.imul(Re,dt)|0,T=T+Math.imul(te,kt)|0,P=P+Math.imul(te,ut)|0,P=P+Math.imul(fe,kt)|0,H=H+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,P=P+Math.imul(Z,ht)|0,P=P+Math.imul(ee,zt)|0,H=H+Math.imul(ee,ht)|0,T=T+Math.imul(j,Nt)|0,P=P+Math.imul(j,Ge)|0,P=P+Math.imul(X,Nt)|0,H=H+Math.imul(X,Ge)|0;var ds=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ds>>>26)|0,ds&=67108863,T=Math.imul(rt,Ct),P=Math.imul(rt,It),P=P+Math.imul(We,Ct)|0,H=Math.imul(We,It),T=T+Math.imul(et,ur)|0,P=P+Math.imul(et,wt)|0,P=P+Math.imul(Je,ur)|0,H=H+Math.imul(Je,wt)|0,T=T+Math.imul(Qe,ir)|0,P=P+Math.imul(Qe,Pt)|0,P=P+Math.imul(ke,ir)|0,H=H+Math.imul(ke,Pt)|0,T=T+Math.imul(De,Dt)|0,P=P+Math.imul(De,dt)|0,P=P+Math.imul(ze,Dt)|0,H=H+Math.imul(ze,dt)|0,T=T+Math.imul(_e,kt)|0,P=P+Math.imul(_e,ut)|0,P=P+Math.imul(Re,kt)|0,H=H+Math.imul(Re,ut)|0,T=T+Math.imul(te,zt)|0,P=P+Math.imul(te,ht)|0,P=P+Math.imul(fe,zt)|0,H=H+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Nt)|0,P=P+Math.imul(Z,Ge)|0,P=P+Math.imul(ee,Nt)|0,H=H+Math.imul(ee,Ge)|0,T=T+Math.imul(j,Et)|0,P=P+Math.imul(j,ct)|0,P=P+Math.imul(X,Et)|0,H=H+Math.imul(X,ct)|0;var hs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(hs>>>26)|0,hs&=67108863,T=Math.imul(pt,Ct),P=Math.imul(pt,It),P=P+Math.imul(Ke,Ct)|0,H=Math.imul(Ke,It),T=T+Math.imul(rt,ur)|0,P=P+Math.imul(rt,wt)|0,P=P+Math.imul(We,ur)|0,H=H+Math.imul(We,wt)|0,T=T+Math.imul(et,ir)|0,P=P+Math.imul(et,Pt)|0,P=P+Math.imul(Je,ir)|0,H=H+Math.imul(Je,Pt)|0,T=T+Math.imul(Qe,Dt)|0,P=P+Math.imul(Qe,dt)|0,P=P+Math.imul(ke,Dt)|0,H=H+Math.imul(ke,dt)|0,T=T+Math.imul(De,kt)|0,P=P+Math.imul(De,ut)|0,P=P+Math.imul(ze,kt)|0,H=H+Math.imul(ze,ut)|0,T=T+Math.imul(_e,zt)|0,P=P+Math.imul(_e,ht)|0,P=P+Math.imul(Re,zt)|0,H=H+Math.imul(Re,ht)|0,T=T+Math.imul(te,Nt)|0,P=P+Math.imul(te,Ge)|0,P=P+Math.imul(fe,Nt)|0,H=H+Math.imul(fe,Ge)|0,T=T+Math.imul(Z,Et)|0,P=P+Math.imul(Z,ct)|0,P=P+Math.imul(ee,Et)|0,H=H+Math.imul(ee,ct)|0,T=T+Math.imul(j,Dr)|0,P=P+Math.imul(j,Ut)|0,P=P+Math.imul(X,Dr)|0,H=H+Math.imul(X,Ut)|0;var Vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,T=Math.imul(bt,Ct),P=Math.imul(bt,It),P=P+Math.imul(tt,Ct)|0,H=Math.imul(tt,It),T=T+Math.imul(pt,ur)|0,P=P+Math.imul(pt,wt)|0,P=P+Math.imul(Ke,ur)|0,H=H+Math.imul(Ke,wt)|0,T=T+Math.imul(rt,ir)|0,P=P+Math.imul(rt,Pt)|0,P=P+Math.imul(We,ir)|0,H=H+Math.imul(We,Pt)|0,T=T+Math.imul(et,Dt)|0,P=P+Math.imul(et,dt)|0,P=P+Math.imul(Je,Dt)|0,H=H+Math.imul(Je,dt)|0,T=T+Math.imul(Qe,kt)|0,P=P+Math.imul(Qe,ut)|0,P=P+Math.imul(ke,kt)|0,H=H+Math.imul(ke,ut)|0,T=T+Math.imul(De,zt)|0,P=P+Math.imul(De,ht)|0,P=P+Math.imul(ze,zt)|0,H=H+Math.imul(ze,ht)|0,T=T+Math.imul(_e,Nt)|0,P=P+Math.imul(_e,Ge)|0,P=P+Math.imul(Re,Nt)|0,H=H+Math.imul(Re,Ge)|0,T=T+Math.imul(te,Et)|0,P=P+Math.imul(te,ct)|0,P=P+Math.imul(fe,Et)|0,H=H+Math.imul(fe,ct)|0,T=T+Math.imul(Z,Dr)|0,P=P+Math.imul(Z,Ut)|0,P=P+Math.imul(ee,Dr)|0,H=H+Math.imul(ee,Ut)|0,T=T+Math.imul(j,tr)|0,P=P+Math.imul(j,Rr)|0,P=P+Math.imul(X,tr)|0,H=H+Math.imul(X,Rr)|0;var ps=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ps>>>26)|0,ps&=67108863,T=Math.imul(bt,ur),P=Math.imul(bt,wt),P=P+Math.imul(tt,ur)|0,H=Math.imul(tt,wt),T=T+Math.imul(pt,ir)|0,P=P+Math.imul(pt,Pt)|0,P=P+Math.imul(Ke,ir)|0,H=H+Math.imul(Ke,Pt)|0,T=T+Math.imul(rt,Dt)|0,P=P+Math.imul(rt,dt)|0,P=P+Math.imul(We,Dt)|0,H=H+Math.imul(We,dt)|0,T=T+Math.imul(et,kt)|0,P=P+Math.imul(et,ut)|0,P=P+Math.imul(Je,kt)|0,H=H+Math.imul(Je,ut)|0,T=T+Math.imul(Qe,zt)|0,P=P+Math.imul(Qe,ht)|0,P=P+Math.imul(ke,zt)|0,H=H+Math.imul(ke,ht)|0,T=T+Math.imul(De,Nt)|0,P=P+Math.imul(De,Ge)|0,P=P+Math.imul(ze,Nt)|0,H=H+Math.imul(ze,Ge)|0,T=T+Math.imul(_e,Et)|0,P=P+Math.imul(_e,ct)|0,P=P+Math.imul(Re,Et)|0,H=H+Math.imul(Re,ct)|0,T=T+Math.imul(te,Dr)|0,P=P+Math.imul(te,Ut)|0,P=P+Math.imul(fe,Dr)|0,H=H+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,tr)|0,P=P+Math.imul(Z,Rr)|0,P=P+Math.imul(ee,tr)|0,H=H+Math.imul(ee,Rr)|0;var vs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vs>>>26)|0,vs&=67108863,T=Math.imul(bt,ir),P=Math.imul(bt,Pt),P=P+Math.imul(tt,ir)|0,H=Math.imul(tt,Pt),T=T+Math.imul(pt,Dt)|0,P=P+Math.imul(pt,dt)|0,P=P+Math.imul(Ke,Dt)|0,H=H+Math.imul(Ke,dt)|0,T=T+Math.imul(rt,kt)|0,P=P+Math.imul(rt,ut)|0,P=P+Math.imul(We,kt)|0,H=H+Math.imul(We,ut)|0,T=T+Math.imul(et,zt)|0,P=P+Math.imul(et,ht)|0,P=P+Math.imul(Je,zt)|0,H=H+Math.imul(Je,ht)|0,T=T+Math.imul(Qe,Nt)|0,P=P+Math.imul(Qe,Ge)|0,P=P+Math.imul(ke,Nt)|0,H=H+Math.imul(ke,Ge)|0,T=T+Math.imul(De,Et)|0,P=P+Math.imul(De,ct)|0,P=P+Math.imul(ze,Et)|0,H=H+Math.imul(ze,ct)|0,T=T+Math.imul(_e,Dr)|0,P=P+Math.imul(_e,Ut)|0,P=P+Math.imul(Re,Dr)|0,H=H+Math.imul(Re,Ut)|0,T=T+Math.imul(te,tr)|0,P=P+Math.imul(te,Rr)|0,P=P+Math.imul(fe,tr)|0,H=H+Math.imul(fe,Rr)|0;var Us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Us>>>26)|0,Us&=67108863,T=Math.imul(bt,Dt),P=Math.imul(bt,dt),P=P+Math.imul(tt,Dt)|0,H=Math.imul(tt,dt),T=T+Math.imul(pt,kt)|0,P=P+Math.imul(pt,ut)|0,P=P+Math.imul(Ke,kt)|0,H=H+Math.imul(Ke,ut)|0,T=T+Math.imul(rt,zt)|0,P=P+Math.imul(rt,ht)|0,P=P+Math.imul(We,zt)|0,H=H+Math.imul(We,ht)|0,T=T+Math.imul(et,Nt)|0,P=P+Math.imul(et,Ge)|0,P=P+Math.imul(Je,Nt)|0,H=H+Math.imul(Je,Ge)|0,T=T+Math.imul(Qe,Et)|0,P=P+Math.imul(Qe,ct)|0,P=P+Math.imul(ke,Et)|0,H=H+Math.imul(ke,ct)|0,T=T+Math.imul(De,Dr)|0,P=P+Math.imul(De,Ut)|0,P=P+Math.imul(ze,Dr)|0,H=H+Math.imul(ze,Ut)|0,T=T+Math.imul(_e,tr)|0,P=P+Math.imul(_e,Rr)|0,P=P+Math.imul(Re,tr)|0,H=H+Math.imul(Re,Rr)|0;var lo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(lo>>>26)|0,lo&=67108863,T=Math.imul(bt,kt),P=Math.imul(bt,ut),P=P+Math.imul(tt,kt)|0,H=Math.imul(tt,ut),T=T+Math.imul(pt,zt)|0,P=P+Math.imul(pt,ht)|0,P=P+Math.imul(Ke,zt)|0,H=H+Math.imul(Ke,ht)|0,T=T+Math.imul(rt,Nt)|0,P=P+Math.imul(rt,Ge)|0,P=P+Math.imul(We,Nt)|0,H=H+Math.imul(We,Ge)|0,T=T+Math.imul(et,Et)|0,P=P+Math.imul(et,ct)|0,P=P+Math.imul(Je,Et)|0,H=H+Math.imul(Je,ct)|0,T=T+Math.imul(Qe,Dr)|0,P=P+Math.imul(Qe,Ut)|0,P=P+Math.imul(ke,Dr)|0,H=H+Math.imul(ke,Ut)|0,T=T+Math.imul(De,tr)|0,P=P+Math.imul(De,Rr)|0,P=P+Math.imul(ze,tr)|0,H=H+Math.imul(ze,Rr)|0;var In=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(In>>>26)|0,In&=67108863,T=Math.imul(bt,zt),P=Math.imul(bt,ht),P=P+Math.imul(tt,zt)|0,H=Math.imul(tt,ht),T=T+Math.imul(pt,Nt)|0,P=P+Math.imul(pt,Ge)|0,P=P+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,Ge)|0,T=T+Math.imul(rt,Et)|0,P=P+Math.imul(rt,ct)|0,P=P+Math.imul(We,Et)|0,H=H+Math.imul(We,ct)|0,T=T+Math.imul(et,Dr)|0,P=P+Math.imul(et,Ut)|0,P=P+Math.imul(Je,Dr)|0,H=H+Math.imul(Je,Ut)|0,T=T+Math.imul(Qe,tr)|0,P=P+Math.imul(Qe,Rr)|0,P=P+Math.imul(ke,tr)|0,H=H+Math.imul(ke,Rr)|0;var zi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(zi>>>26)|0,zi&=67108863,T=Math.imul(bt,Nt),P=Math.imul(bt,Ge),P=P+Math.imul(tt,Nt)|0,H=Math.imul(tt,Ge),T=T+Math.imul(pt,Et)|0,P=P+Math.imul(pt,ct)|0,P=P+Math.imul(Ke,Et)|0,H=H+Math.imul(Ke,ct)|0,T=T+Math.imul(rt,Dr)|0,P=P+Math.imul(rt,Ut)|0,P=P+Math.imul(We,Dr)|0,H=H+Math.imul(We,Ut)|0,T=T+Math.imul(et,tr)|0,P=P+Math.imul(et,Rr)|0,P=P+Math.imul(Je,tr)|0,H=H+Math.imul(Je,Rr)|0;var fo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(fo>>>26)|0,fo&=67108863,T=Math.imul(bt,Et),P=Math.imul(bt,ct),P=P+Math.imul(tt,Et)|0,H=Math.imul(tt,ct),T=T+Math.imul(pt,Dr)|0,P=P+Math.imul(pt,Ut)|0,P=P+Math.imul(Ke,Dr)|0,H=H+Math.imul(Ke,Ut)|0,T=T+Math.imul(rt,tr)|0,P=P+Math.imul(rt,Rr)|0,P=P+Math.imul(We,tr)|0,H=H+Math.imul(We,Rr)|0;var $s=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(bt,Dr),P=Math.imul(bt,Ut),P=P+Math.imul(tt,Dr)|0,H=Math.imul(tt,Ut),T=T+Math.imul(pt,tr)|0,P=P+Math.imul(pt,Rr)|0,P=P+Math.imul(Ke,tr)|0,H=H+Math.imul(Ke,Rr)|0;var tf=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(tf>>>26)|0,tf&=67108863,T=Math.imul(bt,tr),P=Math.imul(bt,Rr),P=P+Math.imul(tt,tr)|0,H=Math.imul(tt,Rr);var Jc=(w+T|0)+((P&8191)<<13)|0;return w=(H+(P>>>13)|0)+(Jc>>>26)|0,Jc&=67108863,E[0]=vi,E[1]=gi,E[2]=yi,E[3]=Si,E[4]=_n,E[5]=us,E[6]=ds,E[7]=hs,E[8]=Vi,E[9]=ps,E[10]=vs,E[11]=Us,E[12]=lo,E[13]=In,E[14]=zi,E[15]=fo,E[16]=$s,E[17]=tf,E[18]=Jc,w!==0&&(E[19]=w,M.length++),M};Math.imul||(S=C);function O(R,v,m){m.negative=v.negative^R.negative,m.length=R.length+v.length;for(var M=0,N=0,x=0;x>>26)|0,N+=E>>>26,E&=67108863}m.words[x]=w,M=E,E=N}return M!==0?m.words[x]=M:m.length--,m._strip()}function L(R,v,m){return O(R,v,m)}s.prototype.mulTo=function(v,m){var M,N=this.length+v.length;return this.length===10&&v.length===10?M=S(this,v,m):N<63?M=C(this,v,m):N<1024?M=O(this,v,m):M=L(this,v,m),M},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 M=0,N=0;N>=26,M+=x/67108864|0,M+=E>>>26,this.words[N]=E&67108863}return M!==0&&(this.words[N]=M,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 M=this,N=0;N=0);var m=v%26,M=(v-m)/26,N=67108863>>>26-m<<26-m,x;if(m!==0){var E=0;for(x=0;x>>26-m}E&&(this.words[x]=E,this.length++)}if(M!==0){for(x=this.length-1;x>=0;x--)this.words[x+M]=this.words[x];for(x=0;x=0);var N;m?N=(m-m%26)/26:N=0;var x=v%26,E=Math.min((v-x)/26,this.length),w=67108863^67108863>>>x<E)for(this.length-=E,P=0;P=0&&(H!==0||P>=N);P--){var oe=this.words[P]|0;this.words[P]=H<<26-x|oe>>>x,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,M){return n(this.negative===0),this.iushrn(v,m,M)},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,M=(v-m)/26,N=1<=0);var m=v%26,M=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(m!==0&&M++,this.length=Math.min(M,this.length),m!==0){var N=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[x+M]=E&67108863}for(;x>26,this.words[x+M]=E&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,x=0;x>26,this.words[x]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var M=this.length-v.length,N=this.clone(),x=v,E=x.words[x.length-1]|0,w=this._countBits(E);M=26-w,M!==0&&(x=x.ushln(M),N.iushln(M),E=x.words[x.length-1]|0);var T=N.length-x.length,P;if(m!=="mod"){P=new s(null),P.length=T+1,P.words=new Array(P.length);for(var H=0;H=0;j--){var X=(N.words[x.length+j]|0)*67108864+(N.words[x.length+j-1]|0);for(X=Math.min(X/E|0,67108863),N._ishlnsubmul(x,X,j);N.negative!==0;)X--,N.negative=0,N._ishlnsubmul(x,1,j),N.isZero()||(N.negative^=1);P&&(P.words[j]=X)}return P&&P._strip(),N._strip(),m!=="div"&&M!==0&&N.iushrn(M),{div:P||null,mod:N}},s.prototype.divmod=function(v,m,M){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,x,E;return this.negative!==0&&v.negative===0?(E=this.neg().divmod(v,m),m!=="mod"&&(N=E.div.neg()),m!=="div"&&(x=E.mod.neg(),M&&x.negative!==0&&x.iadd(v)),{div:N,mod:x}):this.negative===0&&v.negative!==0?(E=this.divmod(v.neg(),m),m!=="mod"&&(N=E.div.neg()),{div:N,mod:E.mod}):this.negative&v.negative?(E=this.neg().divmod(v.neg(),m),m!=="div"&&(x=E.mod.neg(),M&&x.negative!==0&&x.isub(v)),{div:E.div,mod:x}):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 M=m.div.negative!==0?m.mod.isub(v):m.mod,N=v.ushrn(1),x=v.andln(1),E=M.cmp(N);return E<0||x===1&&E===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 M=(1<<26)%v,N=0,x=this.length-1;x>=0;x--)N=(M*N+(this.words[x]|0))%v;return m?-N:N},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 M=0,N=this.length-1;N>=0;N--){var x=(this.words[N]|0)+M*67108864;this.words[N]=x/v|0,M=x%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,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var N=new s(1),x=new s(0),E=new s(0),w=new s(1),T=0;m.isEven()&&M.isEven();)m.iushrn(1),M.iushrn(1),++T;for(var P=M.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;)(N.isOdd()||x.isOdd())&&(N.iadd(P),x.isub(H)),N.iushrn(1),x.iushrn(1);for(var X=0,G=1;!(M.words[0]&G)&&X<26;++X,G<<=1);if(X>0)for(M.iushrn(X);X-- >0;)(E.isOdd()||w.isOdd())&&(E.iadd(P),w.isub(H)),E.iushrn(1),w.iushrn(1);m.cmp(M)>=0?(m.isub(M),N.isub(E),x.isub(w)):(M.isub(m),E.isub(N),w.isub(x))}return{a:E,b:w,gcd:M.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var N=new s(1),x=new s(0),E=M.clone();m.cmpn(1)>0&&M.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;)N.isOdd()&&N.iadd(E),N.iushrn(1);for(var P=0,H=1;!(M.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(M.iushrn(P);P-- >0;)x.isOdd()&&x.iadd(E),x.iushrn(1);m.cmp(M)>=0?(m.isub(M),N.isub(x)):(M.isub(m),x.isub(N))}var oe;return m.cmpn(1)===0?oe=N:oe=x,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(),M=v.clone();m.negative=0,M.negative=0;for(var N=0;m.isEven()&&M.isEven();N++)m.iushrn(1),M.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;M.isEven();)M.iushrn(1);var x=m.cmp(M);if(x<0){var E=m;m=M,M=E}else if(x===0||M.cmpn(1)===0)break;m.isub(M)}while(!0);return M.iushln(N)},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,M=(v-m)/26,N=1<>>26,w&=67108863,this.words[E]=w}return x!==0&&(this.words[E]=x,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 M;if(this.length>1)M=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var N=this.words[0]|0;M=N===v?0:Nv.length)return 1;if(this.length=0;M--){var N=this.words[M]|0,x=v.words[M]|0;if(N!==x){Nx&&(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(R,v){this.name=R,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,M;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),M=m.bitLength();while(M>this.n);var N=M0?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 M=4194303,N=Math.min(v.length,9),x=0;x>>22,E=w}E>>>=22,v.words[x-10]=E,E===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,M=0;M>>=26,v.words[M]=x,m=N}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 le;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(R){if(typeof R=="string"){var v=s._prime(R);this.m=v.p,this.prime=v}else n(R.gtn(1),"modulus must be greater than 1"),this.m=R,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 M=v.add(m);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var M=v.iadd(m);return M.cmp(this.m)>=0&&M.isub(this.m),M},K.prototype.sub=function(v,m){this._verify2(v,m);var M=v.sub(m);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var M=v.isub(m);return M.cmpn(0)<0&&M.iadd(this.m),M},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 M=this.m.add(new s(1)).iushrn(2);return this.pow(v,M)}for(var N=this.m.subn(1),x=0;!N.isZero()&&N.andln(1)===0;)x++,N.iushrn(1);n(!N.isZero());var E=new s(1).toRed(this),w=E.redNeg(),T=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,T).cmp(w)!==0;)P.redIAdd(w);for(var H=this.pow(P,N),oe=this.pow(v,N.addn(1).iushrn(1)),j=this.pow(v,N),X=x;j.cmp(E)!==0;){for(var G=j,Z=0;G.cmp(E)!==0;Z++)G=G.redSqr();n(Z=0;x--){for(var H=m.words[x],oe=P-1;oe>=0;oe--){var j=H>>oe&1;if(E!==N[0]&&(E=this.sqr(E)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==M&&(x!==0||oe!==0))&&(E=this.mul(E,N[w]),T=0,w=0)}P=26}return E},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 k(v)};function k(R){K.call(this,R),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(k,K),k.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},k.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},k.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var M=v.imul(m),N=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=M.isub(N).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},k.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var M=v.mul(m),N=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=M.isub(N).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},k.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,Ei)})(wM);var t7e=wM.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 Aj;(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"})(Aj||(Aj={}));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)),bM(QSe([R9(o7e),R9(String(t.length)),t]))}const a7e="address/5.7.0",ob=new Cn(a7e);function Sj(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(bM(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 xM={};for(let t=0;t<10;t++)xM[String(t)]=String(t);for(let t=0;t<26;t++)xM[String.fromCharCode(65+t)]=String(10+t);const _j=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=>xM[n]).join("");for(;e.length>=_j;){let n=e.substring(0,_j);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=Sj(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=Sj("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 X_={exports:{}};typeof Object.create=="function"?X_.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:X_.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=X_.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={},Ij=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=Ij.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=Ij.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}CM(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 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=jc.toArray(t.entropy,t.entropyEnc||"hex"),r=jc.toArray(t.nonce,t.nonceEnc||"hex"),n=jc.toArray(t.pers,t.persEnc||"hex");EM(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var YX=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=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 Mj(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=Mj(r),n=Mj(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 AM(this,e)};ec.prototype.keyFromPrivate=function(e,r){return AM.fromPrivate(this,e,r)};ec.prototype.keyFromPublic=function(e,r){return AM.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",nI=new Cn(K_e);let F9=null;function ld(){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&&nI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ld().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=ld().keyFromPublic(di(this.publicKey)),n=ld().keyFromPublic(di(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=ld().keyFromPrivate(di(this.privateKey)),n=di(e);n.length!==32&&nI.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=ld().keyFromPrivate(di(this.privateKey)),n=ld().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"+ld().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"+ld().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ea(r):nI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Rj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Rj||(Rj={}));function J_e(t){const e=JX(t);return u7e(Cj(bM(Cj(e,1)),12))}function Z_e(t,e){return J_e(Q_e(di(t),e))}var SM={},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 iI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}fr.readInt32BE=iI;function sI(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=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]}fr.readInt32LE=oI;function aI(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=aI;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=iI(t,e),n=iI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}fr.readInt64BE=nIe;function iIe(t,e){e===void 0&&(e=0);var r=sI(t,e),n=sI(t,e+4);return r*4294967296+n}fr.readUint64BE=iIe;function sIe(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}fr.readInt64LE=sIe;function oIe(t,e){e===void 0&&(e=0);var r=aI(t,e),n=aI(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,M^=L,M=M>>>16|M<<16,k=k+M|0,$^=k,$=$>>>20|$<<12,F=F+ie|0,N^=F,N=N>>>16|N<<16,R=R+N|0,ie^=R,ie=ie>>>20|ie<<12,z=z+le|0,x^=z,x=x>>>16|x<<16,v=v+x|0,le^=v,le=le>>>20|le<<12,F=F+ie|0,N^=F,N=N>>>24|N<<8,R=R+N|0,ie^=R,ie=ie>>>25|ie<<7,z=z+le|0,x^=z,x=x>>>24|x<<8,v=v+x|0,le^=v,le=le>>>25|le<<7,L=L+$|0,M^=L,M=M>>>24|M<<8,k=k+M|0,$^=k,$=$>>>25|$<<7,O=O+_|0,m^=O,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,O=O+$|0,x^=O,x=x>>>16|x<<16,R=R+x|0,$^=R,$=$>>>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+le|0,M^=F,M=M>>>16|M<<16,K=K+M|0,le^=K,le=le>>>20|le<<12,z=z+_|0,N^=z,N=N>>>16|N<<16,k=k+N|0,_^=k,_=_>>>20|_<<12,F=F+le|0,M^=F,M=M>>>24|M<<8,K=K+M|0,le^=K,le=le>>>25|le<<7,z=z+_|0,N^=z,N=N>>>24|N<<8,k=k+N|0,_^=k,_=_>>>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,x^=O,x=x>>>24|x<<8,R=R+x|0,$^=R,$=$>>>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(le+f|0,t,28),ws.writeUint32LE(K+u|0,t,32),ws.writeUint32LE(k+p|0,t,36),ws.writeUint32LE(R+g|0,t,40),ws.writeUint32LE(v+y|0,t,44),ws.writeUint32LE(m+b|0,t,48),ws.writeUint32LE(M+I|0,t,52),ws.writeUint32LE(N+C|0,t,56),ws.writeUint32LE(x+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],le=this._r[5],K=this._r[6],k=this._r[7],R=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var M=a[c+2]|a[c+3]<<8;p+=(m>>>13|M<<3)&8191;var N=a[c+4]|a[c+5]<<8;g+=(M>>>10|N<<6)&8191;var x=a[c+6]|a[c+7]<<8;y+=(N>>>7|x<<9)&8191;var E=a[c+8]|a[c+9]<<8;b+=(x>>>4|E<<12)&8191,I+=E>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(E>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var P=a[c+14]|a[c+15]<<8;O+=(T>>>8|P<<8)&8191,L+=P>>>5|f;var H=0,oe=H;oe+=u*F,oe+=p*(5*v),oe+=g*(5*R),oe+=y*(5*k),oe+=b*(5*K),H=oe>>>13,oe&=8191,oe+=I*(5*le),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*R),j+=b*(5*k),H=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*le),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*R),H=X>>>13,X&=8191,X+=I*(5*k),X+=C*(5*K),X+=S*(5*le),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*R),G+=C*(5*k),G+=S*(5*K),G+=O*(5*le),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*R),Z+=S*(5*k),Z+=O*(5*K),Z+=L*(5*le),H+=Z>>>13,Z&=8191;var ee=H;ee+=u*le,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*R),ee+=O*(5*k),ee+=L*(5*K),H+=ee>>>13,ee&=8191;var B=H;B+=u*K,B+=p*le,B+=g*ie,B+=y*$,B+=b*_,H=B>>>13,B&=8191,B+=I*z,B+=C*F,B+=S*(5*v),B+=O*(5*R),B+=L*(5*k),H+=B>>>13,B&=8191;var te=H;te+=u*k,te+=p*K,te+=g*le,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*R),H+=te>>>13,te&=8191;var fe=H;fe+=u*R,fe+=p*k,fe+=g*K,fe+=y*le,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*R,Ee+=g*k,Ee+=y*K,Ee+=b*le,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=B,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 IM={};(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[le-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,le=0,K=0,k=0,R=0,v=0,m=0,M=0,N=0,x=0,E=0,w=0,T=0,P=0,H=0,oe=0,j=0,X=0,G=0,Z=0,ee=0,B=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,le+=_*ke,K+=_*Ne,k+=_*et,R+=_*Je,v+=_*it,m+=_*rt,M+=_*We,N+=_*lt,x+=_*pt,E+=_*Ke,w+=_*vt,T+=_*bt,P+=_*tt,H+=_*_t,oe+=_*Ct,_=F[1],le+=_*Qe,K+=_*ke,k+=_*Ne,R+=_*et,v+=_*Je,m+=_*it,M+=_*rt,N+=_*We,x+=_*lt,E+=_*pt,w+=_*Ke,T+=_*vt,P+=_*bt,H+=_*tt,oe+=_*_t,j+=_*Ct,_=F[2],K+=_*Qe,k+=_*ke,R+=_*Ne,v+=_*et,m+=_*Je,M+=_*it,N+=_*rt,x+=_*We,E+=_*lt,w+=_*pt,T+=_*Ke,P+=_*vt,H+=_*bt,oe+=_*tt,j+=_*_t,X+=_*Ct,_=F[3],k+=_*Qe,R+=_*ke,v+=_*Ne,m+=_*et,M+=_*Je,N+=_*it,x+=_*rt,E+=_*We,w+=_*lt,T+=_*pt,P+=_*Ke,H+=_*vt,oe+=_*bt,j+=_*tt,X+=_*_t,G+=_*Ct,_=F[4],R+=_*Qe,v+=_*ke,m+=_*Ne,M+=_*et,N+=_*Je,x+=_*it,E+=_*rt,w+=_*We,T+=_*lt,P+=_*pt,H+=_*Ke,oe+=_*vt,j+=_*bt,X+=_*tt,G+=_*_t,Z+=_*Ct,_=F[5],v+=_*Qe,m+=_*ke,M+=_*Ne,N+=_*et,x+=_*Je,E+=_*it,w+=_*rt,T+=_*We,P+=_*lt,H+=_*pt,oe+=_*Ke,j+=_*vt,X+=_*bt,G+=_*tt,Z+=_*_t,ee+=_*Ct,_=F[6],m+=_*Qe,M+=_*ke,N+=_*Ne,x+=_*et,E+=_*Je,w+=_*it,T+=_*rt,P+=_*We,H+=_*lt,oe+=_*pt,j+=_*Ke,X+=_*vt,G+=_*bt,Z+=_*tt,ee+=_*_t,B+=_*Ct,_=F[7],M+=_*Qe,N+=_*ke,x+=_*Ne,E+=_*et,w+=_*Je,T+=_*it,P+=_*rt,H+=_*We,oe+=_*lt,j+=_*pt,X+=_*Ke,G+=_*vt,Z+=_*bt,ee+=_*tt,B+=_*_t,te+=_*Ct,_=F[8],N+=_*Qe,x+=_*ke,E+=_*Ne,w+=_*et,T+=_*Je,P+=_*it,H+=_*rt,oe+=_*We,j+=_*lt,X+=_*pt,G+=_*Ke,Z+=_*vt,ee+=_*bt,B+=_*tt,te+=_*_t,fe+=_*Ct,_=F[9],x+=_*Qe,E+=_*ke,w+=_*Ne,T+=_*et,P+=_*Je,H+=_*it,oe+=_*rt,j+=_*We,X+=_*lt,G+=_*pt,Z+=_*Ke,ee+=_*vt,B+=_*bt,te+=_*tt,fe+=_*_t,Ee+=_*Ct,_=F[10],E+=_*Qe,w+=_*ke,T+=_*Ne,P+=_*et,H+=_*Je,oe+=_*it,j+=_*rt,X+=_*We,G+=_*lt,Z+=_*pt,ee+=_*Ke,B+=_*vt,te+=_*bt,fe+=_*tt,Ee+=_*_t,_e+=_*Ct,_=F[11],w+=_*Qe,T+=_*ke,P+=_*Ne,H+=_*et,oe+=_*Je,j+=_*it,X+=_*rt,G+=_*We,Z+=_*lt,ee+=_*pt,B+=_*Ke,te+=_*vt,fe+=_*bt,Ee+=_*tt,_e+=_*_t,Re+=_*Ct,_=F[12],T+=_*Qe,P+=_*ke,H+=_*Ne,oe+=_*et,j+=_*Je,X+=_*it,G+=_*rt,Z+=_*We,ee+=_*lt,B+=_*pt,te+=_*Ke,fe+=_*vt,Ee+=_*bt,_e+=_*tt,Re+=_*_t,Te+=_*Ct,_=F[13],P+=_*Qe,H+=_*ke,oe+=_*Ne,j+=_*et,X+=_*Je,G+=_*it,Z+=_*rt,ee+=_*We,B+=_*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,B+=_*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,B+=_*rt,te+=_*We,fe+=_*lt,Ee+=_*pt,_e+=_*Ke,Re+=_*vt,Te+=_*bt,De+=_*tt,ze+=_*_t,Xe+=_*Ct,ie+=38*j,le+=38*X,K+=38*G,k+=38*Z,R+=38*ee,v+=38*B,m+=38*te,M+=38*fe,N+=38*Ee,x+=38*_e,E+=38*Re,w+=38*Te,T+=38*De,P+=38*ze,H+=38*Xe,$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=le+$+65535,$=Math.floor(_/65536),le=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=N+$+65535,$=Math.floor(_/65536),N=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*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,_=le+$+65535,$=Math.floor(_/65536),le=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=N+$+65535,$=Math.floor(_/65536),N=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),L[0]=ie,L[1]=le,L[2]=K,L[3]=k,L[4]=R,L[5]=v,L[6]=m,L[7]=M,L[8]=N,L[9]=x,L[10]=E,L[11]=w,L[12]=T,L[13]=P,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(),le=n(),K=n(),k=n(),R=n();for(let N=0;N<31;N++)z[N]=L[N];z[31]=L[31]&127|64,z[0]&=248,l(_,F);for(let N=0;N<16;N++)ie[N]=_[N];$[0]=K[0]=1;for(let N=254;N>=0;--N){const x=z[N>>>3]>>>(N&7)&1;a($,ie,x),a(le,K,x),f(k,$,le),u($,$,le),f(le,ie,K),u(ie,ie,K),g(K,k),g(R,$),p($,le,$),p(le,ie,k),f(k,$,le),u($,$,le),g(ie,$),u(le,K,R),p($,le,s),f($,$,K),p(le,le,$),p($,K,R),p(K,ie,_),g(ie,k),a($,ie,x),a(le,K,x)}for(let N=0;N<16;N++)_[N+16]=$[N],_[N+32]=le[N],_[N+48]=ie[N],_[N+64]=K[N];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const M=new Uint8Array(32);return c(M,m),M}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})(IM);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 Bj={...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 Lj=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={},TM={exports:{}};TM.exports;(function(t){(function(e,r){function n(K,k){if(!K)throw new Error(k||"Assertion failed")}function i(K,k){K.super_=k;var R=function(){};R.prototype=k.prototype,K.prototype=new R,K.prototype.constructor=K}function s(K,k,R){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((k==="le"||k==="be")&&(R=k,k=10),this._init(K||0,k||10,R||"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(k){return k instanceof s?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===s.wordSize&&Array.isArray(k.words)},s.max=function(k,R){return k.cmp(R)>0?k:R},s.min=function(k,R){return k.cmp(R)<0?k:R},s.prototype._init=function(k,R,v){if(typeof k=="number")return this._initNumber(k,R,v);if(typeof k=="object")return this._initArray(k,R,v);R==="hex"&&(R=16),n(R===(R|0)&&R>=2&&R<=36),k=k.toString().replace(/\s+/g,"");var m=0;k[0]==="-"&&(m++,this.negative=1),m=0;m-=3)N=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[M]|=N<>>26-x&67108863,x+=24,x>=26&&(x-=26,M++);else if(v==="le")for(m=0,M=0;m>>26-x&67108863,x+=24,x>=26&&(x-=26,M++);return this.strip()};function a(K,k){var R=K.charCodeAt(k);return R>=65&&R<=70?R-55:R>=97&&R<=102?R-87:R-48&15}function c(K,k,R){var v=a(K,R);return R-1>=k&&(v|=a(K,R-1)<<4),v}s.prototype._parseHex=function(k,R,v){this.length=Math.ceil((k.length-R)/6),this.words=new Array(this.length);for(var m=0;m=R;m-=2)x=c(k,R,m)<=18?(M-=18,N+=1,this.words[N]|=x>>>26):M+=8;else{var E=k.length-R;for(m=E%2===0?R+1:R;m=18?(M-=18,N+=1,this.words[N]|=x>>>26):M+=8}this.strip()};function l(K,k,R,v){for(var m=0,M=Math.min(K.length,R),N=k;N=49?m+=x-49+10:x>=17?m+=x-17+10:m+=x}return m}s.prototype._parseBase=function(k,R,v){this.words=[0],this.length=1;for(var m=0,M=1;M<=67108863;M*=R)m++;m--,M=M/R|0;for(var N=k.length-v,x=N%m,E=Math.min(N,N-x)+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(k,R){k=k||10,R=R|0||1;var v;if(k===16||k==="hex"){v="";for(var m=0,M=0,N=0;N>>24-m&16777215,M!==0||N!==this.length-1?v=f[6-E.length]+E+v:v=E+v,m+=2,m>=26&&(m-=26,N--)}for(M!==0&&(v=M.toString(16)+v);v.length%R!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(k|0)&&k>=2&&k<=36){var w=u[k],T=p[k];v="";var P=this.clone();for(P.negative=0;!P.isZero();){var H=P.modn(T).toString(k);P=P.idivn(T),P.isZero()?v=H+v:v=f[w-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%R!==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 k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(k,R){return n(typeof o<"u"),this.toArrayLike(o,k,R)},s.prototype.toArray=function(k,R){return this.toArrayLike(Array,k,R)},s.prototype.toArrayLike=function(k,R,v){var m=this.byteLength(),M=v||Math.max(1,m);n(m<=M,"byte array longer than desired length"),n(M>0,"Requested array length <= 0"),this.strip();var N=R==="le",x=new k(M),E,w,T=this.clone();if(N){for(w=0;!T.isZero();w++)E=T.andln(255),T.iushrn(8),x[w]=E;for(;w=4096&&(v+=13,R>>>=13),R>=64&&(v+=7,R>>>=7),R>=8&&(v+=4,R>>>=4),R>=2&&(v+=2,R>>>=2),v+R},s.prototype._zeroBits=function(k){if(k===0)return 26;var R=k,v=0;return R&8191||(v+=13,R>>>=13),R&127||(v+=7,R>>>=7),R&15||(v+=4,R>>>=4),R&3||(v+=2,R>>>=2),R&1||v++,v},s.prototype.bitLength=function(){var k=this.words[this.length-1],R=this._countBits(k);return(this.length-1)*26+R};function g(K){for(var k=new Array(K.bitLength()),R=0;R>>m}return k}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,R=0;Rk.length?this.clone().ior(k):k.clone().ior(this)},s.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},s.prototype.iuand=function(k){var R;this.length>k.length?R=k:R=this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},s.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},s.prototype.iuxor=function(k){var R,v;this.length>k.length?(R=this,v=k):(R=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},s.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},s.prototype.inotn=function(k){n(typeof k=="number"&&k>=0);var R=Math.ceil(k/26)|0,v=k%26;this._expand(R),v>0&&R--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(k){return this.clone().inotn(k)},s.prototype.setn=function(k,R){n(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),R?this.words[v]=this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var M=0,N=0;N>>26;for(;M!==0&&N>>26;if(this.length=v.length,M!==0)this.words[this.length]=M,this.length++;else if(v!==this)for(;Nk.length?this.clone().iadd(k):k.clone().iadd(this)},s.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var R=this.iadd(k);return k.negative=1,R._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v=this.cmp(k);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,M;v>0?(m=this,M=k):(m=k,M=this);for(var N=0,x=0;x>26,this.words[x]=R&67108863;for(;N!==0&&x>26,this.words[x]=R&67108863;if(N===0&&x>>26,P=E&67108863,H=Math.min(w,k.length-1),oe=Math.max(0,w-K.length+1);oe<=H;oe++){var j=w-oe|0;m=K.words[j]|0,M=k.words[oe]|0,N=m*M+P,T+=N/67108864|0,P=N&67108863}R.words[w]=P|0,E=T|0}return E!==0?R.words[w]=E|0:R.length--,R.strip()}var b=function(k,R,v){var m=k.words,M=R.words,N=v.words,x=0,E,w,T,P=m[0]|0,H=P&8191,oe=P>>>13,j=m[1]|0,X=j&8191,G=j>>>13,Z=m[2]|0,ee=Z&8191,B=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=M[0]|0,tt=bt&8191,_t=bt>>>13,Ct=M[1]|0,It=Ct&8191,er=Ct>>>13,ur=M[2]|0,wt=ur&8191,lr=ur>>>13,ir=M[3]|0,Pt=ir&8191,Ot=ir>>>13,Dt=M[4]|0,dt=Dt&8191,Bt=Dt>>>13,kt=M[5]|0,ut=kt&8191,Vt=kt>>>13,zt=M[6]|0,ht=zt&8191,xt=zt>>>13,Nt=M[7]|0,Ge=Nt&8191,$t=Nt>>>13,Et=M[8]|0,ct=Et&8191,Ht=Et>>>13,Dr=M[9]|0,Ut=Dr&8191,Ir=Dr>>>13;v.negative=k.negative^R.negative,v.length=19,E=Math.imul(H,tt),w=Math.imul(H,_t),w=w+Math.imul(oe,tt)|0,T=Math.imul(oe,_t);var tr=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,E=Math.imul(X,tt),w=Math.imul(X,_t),w=w+Math.imul(G,tt)|0,T=Math.imul(G,_t),E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,E=Math.imul(ee,tt),w=Math.imul(ee,_t),w=w+Math.imul(B,tt)|0,T=Math.imul(B,_t),E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(vi>>>26)|0,vi&=67108863,E=Math.imul(fe,tt),w=Math.imul(fe,_t),w=w+Math.imul(Ee,tt)|0,T=Math.imul(Ee,_t),E=E+Math.imul(ee,It)|0,w=w+Math.imul(ee,er)|0,w=w+Math.imul(B,It)|0,T=T+Math.imul(B,er)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(gi>>>26)|0,gi&=67108863,E=Math.imul(Re,tt),w=Math.imul(Re,_t),w=w+Math.imul(Te,tt)|0,T=Math.imul(Te,_t),E=E+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,E=E+Math.imul(ee,wt)|0,w=w+Math.imul(ee,lr)|0,w=w+Math.imul(B,wt)|0,T=T+Math.imul(B,lr)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(yi>>>26)|0,yi&=67108863,E=Math.imul(ze,tt),w=Math.imul(ze,_t),w=w+Math.imul(Xe,tt)|0,T=Math.imul(Xe,_t),E=E+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,E=E+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,E=E+Math.imul(ee,Pt)|0,w=w+Math.imul(ee,Ot)|0,w=w+Math.imul(B,Pt)|0,T=T+Math.imul(B,Ot)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Si>>>26)|0,Si&=67108863,E=Math.imul(ke,tt),w=Math.imul(ke,_t),w=w+Math.imul(Ne,tt)|0,T=Math.imul(Ne,_t),E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,dt)|0,w=w+Math.imul(ee,Bt)|0,w=w+Math.imul(B,dt)|0,T=T+Math.imul(B,Bt)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,E=Math.imul(Je,tt),w=Math.imul(Je,_t),w=w+Math.imul(it,tt)|0,T=Math.imul(it,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,ut)|0,w=w+Math.imul(ee,Vt)|0,w=w+Math.imul(B,ut)|0,T=T+Math.imul(B,Vt)|0,E=E+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,E=E+Math.imul(H,Ge)|0,w=w+Math.imul(H,$t)|0,w=w+Math.imul(oe,Ge)|0,T=T+Math.imul(oe,$t)|0;var us=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(us>>>26)|0,us&=67108863,E=Math.imul(We,tt),w=Math.imul(We,_t),w=w+Math.imul(lt,tt)|0,T=Math.imul(lt,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,ht)|0,w=w+Math.imul(ee,xt)|0,w=w+Math.imul(B,ht)|0,T=T+Math.imul(B,xt)|0,E=E+Math.imul(X,Ge)|0,w=w+Math.imul(X,$t)|0,w=w+Math.imul(G,Ge)|0,T=T+Math.imul(G,$t)|0,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(ds>>>26)|0,ds&=67108863,E=Math.imul(Ke,tt),w=Math.imul(Ke,_t),w=w+Math.imul(vt,tt)|0,T=Math.imul(vt,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,Ge)|0,w=w+Math.imul(ee,$t)|0,w=w+Math.imul(B,Ge)|0,T=T+Math.imul(B,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(hs>>>26)|0,hs&=67108863,E=Math.imul(Ke,It),w=Math.imul(Ke,er),w=w+Math.imul(vt,It)|0,T=Math.imul(vt,er),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(fe,Ge)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,Ge)|0,T=T+Math.imul(Ee,$t)|0,E=E+Math.imul(ee,ct)|0,w=w+Math.imul(ee,Ht)|0,w=w+Math.imul(B,ct)|0,T=T+Math.imul(B,Ht)|0,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,E=Math.imul(Ke,wt),w=Math.imul(Ke,lr),w=w+Math.imul(vt,wt)|0,T=Math.imul(vt,lr),E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(Re,Ge)|0,w=w+Math.imul(Re,$t)|0,w=w+Math.imul(Te,Ge)|0,T=T+Math.imul(Te,$t)|0,E=E+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,E=E+Math.imul(ee,Ut)|0,w=w+Math.imul(ee,Ir)|0,w=w+Math.imul(B,Ut)|0,T=T+Math.imul(B,Ir)|0;var ps=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(ps>>>26)|0,ps&=67108863,E=Math.imul(Ke,Pt),w=Math.imul(Ke,Ot),w=w+Math.imul(vt,Pt)|0,T=Math.imul(vt,Ot),E=E+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,E=E+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,E=E+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,E=E+Math.imul(ze,Ge)|0,w=w+Math.imul(ze,$t)|0,w=w+Math.imul(Xe,Ge)|0,T=T+Math.imul(Xe,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(vs>>>26)|0,vs&=67108863,E=Math.imul(Ke,dt),w=Math.imul(Ke,Bt),w=w+Math.imul(vt,dt)|0,T=Math.imul(vt,Bt),E=E+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,E=E+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,E=E+Math.imul(ke,Ge)|0,w=w+Math.imul(ke,$t)|0,w=w+Math.imul(Ne,Ge)|0,T=T+Math.imul(Ne,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Us>>>26)|0,Us&=67108863,E=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(vt,ut)|0,T=Math.imul(vt,Vt),E=E+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,E=E+Math.imul(Je,Ge)|0,w=w+Math.imul(Je,$t)|0,w=w+Math.imul(it,Ge)|0,T=T+Math.imul(it,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(lo>>>26)|0,lo&=67108863,E=Math.imul(Ke,ht),w=Math.imul(Ke,xt),w=w+Math.imul(vt,ht)|0,T=Math.imul(vt,xt),E=E+Math.imul(We,Ge)|0,w=w+Math.imul(We,$t)|0,w=w+Math.imul(lt,Ge)|0,T=T+Math.imul(lt,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(In>>>26)|0,In&=67108863,E=Math.imul(Ke,Ge),w=Math.imul(Ke,$t),w=w+Math.imul(vt,Ge)|0,T=Math.imul(vt,$t),E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(zi>>>26)|0,zi&=67108863,E=Math.imul(Ke,ct),w=Math.imul(Ke,Ht),w=w+Math.imul(vt,ct)|0,T=Math.imul(vt,Ht),E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,E=Math.imul(Ke,Ut),w=Math.imul(Ke,Ir),w=w+Math.imul(vt,Ut)|0,T=Math.imul(vt,Ir);var $s=(x+E|0)+((w&8191)<<13)|0;return x=(T+(w>>>13)|0)+($s>>>26)|0,$s&=67108863,N[0]=tr,N[1]=Rr,N[2]=vi,N[3]=gi,N[4]=yi,N[5]=Si,N[6]=_n,N[7]=us,N[8]=ds,N[9]=hs,N[10]=Vi,N[11]=ps,N[12]=vs,N[13]=Us,N[14]=lo,N[15]=In,N[16]=zi,N[17]=fo,N[18]=$s,x!==0&&(N[19]=x,v.length++),v};Math.imul||(b=y);function I(K,k,R){R.negative=k.negative^K.negative,R.length=K.length+k.length;for(var v=0,m=0,M=0;M>>26)|0,m+=N>>>26,N&=67108863}R.words[M]=x,v=N,N=m}return v!==0?R.words[M]=v:R.length--,R.strip()}function C(K,k,R){var v=new S;return v.mulp(K,k,R)}s.prototype.mulTo=function(k,R){var v,m=this.length+k.length;return this.length===10&&k.length===10?v=b(this,k,R):m<63?v=y(this,k,R):m<1024?v=I(this,k,R):v=C(this,k,R),v};function S(K,k){this.x=K,this.y=k}S.prototype.makeRBT=function(k){for(var R=new Array(k),v=s.prototype._countBits(k)-1,m=0;m>=1;return m},S.prototype.permute=function(k,R,v,m,M,N){for(var x=0;x>>1)M++;return 1<>>13,v[2*N+1]=M&8191,M=M>>>13;for(N=2*R;N>=26,R+=m/67108864|0,R+=M>>>26,this.words[v]=M&67108863}return R!==0&&(this.words[v]=R,this.length++),this},s.prototype.muln=function(k){return this.clone().imuln(k)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(k){var R=g(k);if(R.length===0)return new s(1);for(var v=this,m=0;m=0);var R=k%26,v=(k-R)/26,m=67108863>>>26-R<<26-R,M;if(R!==0){var N=0;for(M=0;M>>26-R}N&&(this.words[M]=N,this.length++)}if(v!==0){for(M=this.length-1;M>=0;M--)this.words[M+v]=this.words[M];for(M=0;M=0);var m;R?m=(R-R%26)/26:m=0;var M=k%26,N=Math.min((k-M)/26,this.length),x=67108863^67108863>>>M<N)for(this.length-=N,w=0;w=0&&(T!==0||w>=m);w--){var P=this.words[w]|0;this.words[w]=T<<26-M|P>>>M,T=P&x}return E&&T!==0&&(E.words[E.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(k,R,v){return n(this.negative===0),this.iushrn(k,R,v)},s.prototype.shln=function(k){return this.clone().ishln(k)},s.prototype.ushln=function(k){return this.clone().iushln(k)},s.prototype.shrn=function(k){return this.clone().ishrn(k)},s.prototype.ushrn=function(k){return this.clone().iushrn(k)},s.prototype.testn=function(k){n(typeof k=="number"&&k>=0);var R=k%26,v=(k-R)/26,m=1<=0);var R=k%26,v=(k-R)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(R!==0&&v++,this.length=Math.min(v,this.length),R!==0){var m=67108863^67108863>>>R<=67108864;R++)this.words[R]-=67108864,R===this.length-1?this.words[R+1]=1:this.words[R+1]++;return this.length=Math.max(this.length,R+1),this},s.prototype.isubn=function(k){if(n(typeof k=="number"),n(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var R=0;R>26)-(E/67108864|0),this.words[M+v]=N&67108863}for(;M>26,this.words[M+v]=N&67108863;if(x===0)return this.strip();for(n(x===-1),x=0,M=0;M>26,this.words[M]=N&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(k,R){var v=this.length-k.length,m=this.clone(),M=k,N=M.words[M.length-1]|0,x=this._countBits(N);v=26-x,v!==0&&(M=M.ushln(v),m.iushln(v),N=M.words[M.length-1]|0);var E=m.length-M.length,w;if(R!=="mod"){w=new s(null),w.length=E+1,w.words=new Array(w.length);for(var T=0;T=0;H--){var oe=(m.words[M.length+H]|0)*67108864+(m.words[M.length+H-1]|0);for(oe=Math.min(oe/N|0,67108863),m._ishlnsubmul(M,oe,H);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(M,1,H),m.isZero()||(m.negative^=1);w&&(w.words[H]=oe)}return w&&w.strip(),m.strip(),R!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(k,R,v){if(n(!k.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,M,N;return this.negative!==0&&k.negative===0?(N=this.neg().divmod(k,R),R!=="mod"&&(m=N.div.neg()),R!=="div"&&(M=N.mod.neg(),v&&M.negative!==0&&M.iadd(k)),{div:m,mod:M}):this.negative===0&&k.negative!==0?(N=this.divmod(k.neg(),R),R!=="mod"&&(m=N.div.neg()),{div:m,mod:N.mod}):this.negative&k.negative?(N=this.neg().divmod(k.neg(),R),R!=="div"&&(M=N.mod.neg(),v&&M.negative!==0&&M.isub(k)),{div:N.div,mod:M}):k.length>this.length||this.cmp(k)<0?{div:new s(0),mod:this}:k.length===1?R==="div"?{div:this.divn(k.words[0]),mod:null}:R==="mod"?{div:null,mod:new s(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new s(this.modn(k.words[0]))}:this._wordDiv(k,R)},s.prototype.div=function(k){return this.divmod(k,"div",!1).div},s.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},s.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},s.prototype.divRound=function(k){var R=this.divmod(k);if(R.mod.isZero())return R.div;var v=R.div.negative!==0?R.mod.isub(k):R.mod,m=k.ushrn(1),M=k.andln(1),N=v.cmp(m);return N<0||M===1&&N===0?R.div:R.div.negative!==0?R.div.isubn(1):R.div.iaddn(1)},s.prototype.modn=function(k){n(k<=67108863);for(var R=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(R*v+(this.words[m]|0))%k;return v},s.prototype.idivn=function(k){n(k<=67108863);for(var R=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+R*67108864;this.words[v]=m/k|0,R=m%k}return this.strip()},s.prototype.divn=function(k){return this.clone().idivn(k)},s.prototype.egcd=function(k){n(k.negative===0),n(!k.isZero());var R=this,v=k.clone();R.negative!==0?R=R.umod(k):R=R.clone();for(var m=new s(1),M=new s(0),N=new s(0),x=new s(1),E=0;R.isEven()&&v.isEven();)R.iushrn(1),v.iushrn(1),++E;for(var w=v.clone(),T=R.clone();!R.isZero();){for(var P=0,H=1;!(R.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(R.iushrn(P);P-- >0;)(m.isOdd()||M.isOdd())&&(m.iadd(w),M.isub(T)),m.iushrn(1),M.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;)(N.isOdd()||x.isOdd())&&(N.iadd(w),x.isub(T)),N.iushrn(1),x.iushrn(1);R.cmp(v)>=0?(R.isub(v),m.isub(N),M.isub(x)):(v.isub(R),N.isub(m),x.isub(M))}return{a:N,b:x,gcd:v.iushln(E)}},s.prototype._invmp=function(k){n(k.negative===0),n(!k.isZero());var R=this,v=k.clone();R.negative!==0?R=R.umod(k):R=R.clone();for(var m=new s(1),M=new s(0),N=v.clone();R.cmpn(1)>0&&v.cmpn(1)>0;){for(var x=0,E=1;!(R.words[0]&E)&&x<26;++x,E<<=1);if(x>0)for(R.iushrn(x);x-- >0;)m.isOdd()&&m.iadd(N),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;)M.isOdd()&&M.iadd(N),M.iushrn(1);R.cmp(v)>=0?(R.isub(v),m.isub(M)):(v.isub(R),M.isub(m))}var P;return R.cmpn(1)===0?P=m:P=M,P.cmpn(0)<0&&P.iadd(k),P},s.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var R=this.clone(),v=k.clone();R.negative=0,v.negative=0;for(var m=0;R.isEven()&&v.isEven();m++)R.iushrn(1),v.iushrn(1);do{for(;R.isEven();)R.iushrn(1);for(;v.isEven();)v.iushrn(1);var M=R.cmp(v);if(M<0){var N=R;R=v,v=N}else if(M===0||v.cmpn(1)===0)break;R.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(k){return this.egcd(k).a.umod(k)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(k){return this.words[0]&k},s.prototype.bincn=function(k){n(typeof k=="number");var R=k%26,v=(k-R)/26,m=1<>>26,x&=67108863,this.words[N]=x}return M!==0&&(this.words[N]=M,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(k){var R=k<0;if(this.negative!==0&&!R)return-1;if(this.negative===0&&R)return 1;this.strip();var v;if(this.length>1)v=1;else{R&&(k=-k),n(k<=67108863,"Number is too big");var m=this.words[0]|0;v=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,M=k.words[v]|0;if(m!==M){mM&&(R=1);break}}return R},s.prototype.gtn=function(k){return this.cmpn(k)===1},s.prototype.gt=function(k){return this.cmp(k)===1},s.prototype.gten=function(k){return this.cmpn(k)>=0},s.prototype.gte=function(k){return this.cmp(k)>=0},s.prototype.ltn=function(k){return this.cmpn(k)===-1},s.prototype.lt=function(k){return this.cmp(k)===-1},s.prototype.lten=function(k){return this.cmpn(k)<=0},s.prototype.lte=function(k){return this.cmp(k)<=0},s.prototype.eqn=function(k){return this.cmpn(k)===0},s.prototype.eq=function(k){return this.cmp(k)===0},s.red=function(k){return new ie(k)},s.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(k){return this.red=k,this},s.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},s.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},s.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},s.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},s.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},s.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},s.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},s.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},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(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var O={k256:null,p224:null,p192:null,p25519:null};function L(K,k){this.name=K,this.p=new s(k,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 k=new s(null);return k.words=new Array(Math.ceil(this.n/13)),k},L.prototype.ireduce=function(k){var R=k,v;do this.split(R,this.tmp),R=this.imulK(R),R=R.iadd(this.tmp),v=R.bitLength();while(v>this.n);var m=v0?R.isub(this.p):R.strip!==void 0?R.strip():R._strip(),R},L.prototype.split=function(k,R){k.iushrn(this.n,0,R)},L.prototype.imulK=function(k){return k.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(k,R){for(var v=4194303,m=Math.min(k.length,9),M=0;M>>22,N=x}N>>>=22,k.words[M-10]=N,N===0&&k.length>10?k.length-=10:k.length-=9},F.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var R=0,v=0;v>>=26,k.words[v]=M,R=m}return R!==0&&(k.words[k.length++]=R),k},s._prime=function(k){if(O[k])return O[k];var R;if(k==="k256")R=new F;else if(k==="p224")R=new z;else if(k==="p192")R=new _;else if(k==="p25519")R=new $;else throw new Error("Unknown prime "+k);return O[k]=R,R};function ie(K){if(typeof K=="string"){var k=s._prime(K);this.m=k.p,this.prime=k}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(k){n(k.negative===0,"red works only with positives"),n(k.red,"red works only with red numbers")},ie.prototype._verify2=function(k,R){n((k.negative|R.negative)===0,"red works only with positives"),n(k.red&&k.red===R.red,"red works only with red numbers")},ie.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},ie.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},ie.prototype.add=function(k,R){this._verify2(k,R);var v=k.add(R);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(k,R){this._verify2(k,R);var v=k.iadd(R);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(k,R){this._verify2(k,R);var v=k.sub(R);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(k,R){this._verify2(k,R);var v=k.isub(R);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(k,R){return this._verify1(k),this.imod(k.ushln(R))},ie.prototype.imul=function(k,R){return this._verify2(k,R),this.imod(k.imul(R))},ie.prototype.mul=function(k,R){return this._verify2(k,R),this.imod(k.mul(R))},ie.prototype.isqr=function(k){return this.imul(k,k.clone())},ie.prototype.sqr=function(k){return this.mul(k,k)},ie.prototype.sqrt=function(k){if(k.isZero())return k.clone();var R=this.m.andln(3);if(n(R%2===1),R===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),M=0;!m.isZero()&&m.andln(1)===0;)M++,m.iushrn(1);n(!m.isZero());var N=new s(1).toRed(this),x=N.redNeg(),E=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,E).cmp(x)!==0;)w.redIAdd(x);for(var T=this.pow(w,m),P=this.pow(k,m.addn(1).iushrn(1)),H=this.pow(k,m),oe=M;H.cmp(N)!==0;){for(var j=H,X=0;j.cmp(N)!==0;X++)j=j.redSqr();n(X=0;M--){for(var T=R.words[M],P=w-1;P>=0;P--){var H=T>>P&1;if(N!==m[0]&&(N=this.sqr(N)),H===0&&x===0){E=0;continue}x<<=1,x|=H,E++,!(E!==v&&(M!==0||P!==0))&&(N=this.mul(N,m[x]),E=0,x=0)}w=26}return N},ie.prototype.convertTo=function(k){var R=k.umod(this.m);return R===k?R.clone():R},ie.prototype.convertFrom=function(k){var R=k.clone();return R.red=null,R},s.mont=function(k){return new le(k)};function le(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(le,ie),le.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},le.prototype.convertFrom=function(k){var R=this.imod(k.mul(this.rinv));return R.red=null,R},le.prototype.imul=function(k,R){if(k.isZero()||R.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(R),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),N=M;return M.cmp(this.m)>=0?N=M.isub(this.m):M.cmpn(0)<0&&(N=M.iadd(this.m)),N._forceRed(this)},le.prototype.mul=function(k,R){if(k.isZero()||R.isZero())return new s(0)._forceRed(this);var v=k.mul(R),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),N=M;return M.cmp(this.m)>=0?N=M.isub(this.m):M.cmpn(0)<0&&(N=M.iadd(this.m)),N._forceRed(this)},le.prototype.invm=function(k){var R=this.imod(k._invmp(this.m).mul(this.r2));return R._forceRed(this)}})(t,Ei)})(TM);var Ou=TM.exports,PM={};(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 kM={exports:{}},U9;kM.exports=function(e){return U9||(U9=new Ld(null)),U9.generate(e)};function Ld(t){this.rand=t}kM.exports.Rand=Ld;Ld.prototype.generate=function(e){return this._rand(e)};Ld.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}RM(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=Ou,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=Ou,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})(MM);var vE={},$9,jj;function oPe(){return jj||(jj=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=MM,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=PM,mee=Yp;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=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=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=yp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var X5=Ou,OM=ma,dPe=OM.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 Uj(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=Uj(r),n=Uj(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),OM.encode(o,e)};var eu=Ou,bee=cPe,vPe=ma,z9=vE,gPe=vee,wee=vPe.assert,DM=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 DM(this,e)};tc.prototype.keyFromPrivate=function(e,r){return DM.fromPrivate(this,e,r)};tc.prototype.keyFromPublic=function(e,r){return DM.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,$j=Nx.parseBytes,jy=Nx.cachedProperty;function Li(t,e){this.eddsa=t,this._secret=$j(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=$j(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=Ou,mE=ma,qj=mE.assert,bE=mE.cachedProperty,wPe=mE.parseBytes;function Jp(t,e){this.eddsa=t,typeof e!="object"&&(e=wPe(e)),Array.isArray(e)&&(qj(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),qj(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,Vj=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],le=f[4],K=f[5],k=f[6],R=f[7],v,m,M,N,x,E,w,T;g>=128;){for(var P=0;P<16;P++){var H=8*P+p;a[P]=e.readUint32BE(u,H),c[P]=e.readUint32BE(u,H+4)}for(var P=0;P<80;P++){var oe=y,j=b,X=I,G=C,Z=S,ee=O,B=L,te=F,fe=z,Ee=_,_e=$,Re=ie,Te=le,De=K,ze=k,Xe=R;if(v=F,m=R,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|le<<18)^(S>>>18|le<<14)^(le>>>9|S<<23),m=(le>>>14|S<<18)^(le>>>18|S<<14)^(S>>>9|le<<23),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=S&O^~S&L,m=le&K^~le&k,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=i[P*2],m=i[P*2+1],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=a[P%16],m=c[P%16],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,M=w&65535|T<<16,N=x&65535|E<<16,v=M,m=N,x=m&65535,E=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),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=z&_^z&$^_&$,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,te=w&65535|T<<16,Xe=x&65535|E<<16,v=G,m=Re,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=M,m=N,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,G=w&65535|T<<16,Re=x&65535|E<<16,b=oe,I=j,C=X,S=G,O=Z,L=ee,F=B,y=te,_=fe,$=Ee,ie=_e,le=Re,K=Te,k=De,R=ze,z=Xe,P%16===15)for(var H=0;H<16;H++)v=a[H],m=c[H],x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=a[(H+9)%16],m=c[(H+9)%16],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+1)%16],N=c[(H+1)%16],v=(M>>>1|N<<31)^(M>>>8|N<<24)^M>>>7,m=(N>>>1|M<<31)^(N>>>8|M<<24)^(N>>>7|M<<25),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+14)%16],N=c[(H+14)%16],v=(M>>>19|N<<13)^(N>>>29|M<<3)^M>>>6,m=(N>>>19|M<<13)^(M>>>29|N<<3)^(N>>>6|M<<26),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,a[H]=w&65535|T<<16,c[H]=x&65535|E<<16}v=y,m=z,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=z=x&65535|E<<16,v=b,m=_,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=x&65535|E<<16,v=I,m=$,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=$=x&65535|E<<16,v=C,m=ie,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=x&65535|E<<16,v=S,m=le,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=le=x&65535|E<<16,v=O,m=K,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[5]=O=w&65535|T<<16,f[5]=K=x&65535|E<<16,v=L,m=k,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=k=x&65535|E<<16,v=F,m=R,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=R=x&65535|E<<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]=B[15]-32767-(ee[14]>>16&1);const fe=ee[15]>>16&1;ee[14]&=65535,b(B,ee,1-fe)}for(let te=0;te<16;te++)G[2*te]=B[te]&255,G[2*te+1]=B[te]>>8}function C(G,Z){let ee=0;for(let B=0;B<32;B++)ee|=G[B]^Z[B];return(1&ee-1>>>8)-1}function S(G,Z){const ee=new Uint8Array(32),B=new Uint8Array(32);return I(ee,G),I(B,Z),C(ee,B)}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 B=0;B<16;B++)G[B]=Z[B]+ee[B]}function z(G,Z,ee){for(let B=0;B<16;B++)G[B]=Z[B]-ee[B]}function _(G,Z,ee){let B,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],Ge=ee[11],$t=ee[12],Et=ee[13],ct=ee[14],Ht=ee[15];B=Z[0],fe+=B*Ot,Ee+=B*Dt,_e+=B*dt,Re+=B*Bt,Te+=B*kt,De+=B*ut,ze+=B*Vt,Xe+=B*zt,Qe+=B*ht,ke+=B*xt,Ne+=B*Nt,et+=B*Ge,Je+=B*$t,it+=B*Et,rt+=B*ct,We+=B*Ht,B=Z[1],Ee+=B*Ot,_e+=B*Dt,Re+=B*dt,Te+=B*Bt,De+=B*kt,ze+=B*ut,Xe+=B*Vt,Qe+=B*zt,ke+=B*ht,Ne+=B*xt,et+=B*Nt,Je+=B*Ge,it+=B*$t,rt+=B*Et,We+=B*ct,lt+=B*Ht,B=Z[2],_e+=B*Ot,Re+=B*Dt,Te+=B*dt,De+=B*Bt,ze+=B*kt,Xe+=B*ut,Qe+=B*Vt,ke+=B*zt,Ne+=B*ht,et+=B*xt,Je+=B*Nt,it+=B*Ge,rt+=B*$t,We+=B*Et,lt+=B*ct,pt+=B*Ht,B=Z[3],Re+=B*Ot,Te+=B*Dt,De+=B*dt,ze+=B*Bt,Xe+=B*kt,Qe+=B*ut,ke+=B*Vt,Ne+=B*zt,et+=B*ht,Je+=B*xt,it+=B*Nt,rt+=B*Ge,We+=B*$t,lt+=B*Et,pt+=B*ct,Ke+=B*Ht,B=Z[4],Te+=B*Ot,De+=B*Dt,ze+=B*dt,Xe+=B*Bt,Qe+=B*kt,ke+=B*ut,Ne+=B*Vt,et+=B*zt,Je+=B*ht,it+=B*xt,rt+=B*Nt,We+=B*Ge,lt+=B*$t,pt+=B*Et,Ke+=B*ct,vt+=B*Ht,B=Z[5],De+=B*Ot,ze+=B*Dt,Xe+=B*dt,Qe+=B*Bt,ke+=B*kt,Ne+=B*ut,et+=B*Vt,Je+=B*zt,it+=B*ht,rt+=B*xt,We+=B*Nt,lt+=B*Ge,pt+=B*$t,Ke+=B*Et,vt+=B*ct,bt+=B*Ht,B=Z[6],ze+=B*Ot,Xe+=B*Dt,Qe+=B*dt,ke+=B*Bt,Ne+=B*kt,et+=B*ut,Je+=B*Vt,it+=B*zt,rt+=B*ht,We+=B*xt,lt+=B*Nt,pt+=B*Ge,Ke+=B*$t,vt+=B*Et,bt+=B*ct,tt+=B*Ht,B=Z[7],Xe+=B*Ot,Qe+=B*Dt,ke+=B*dt,Ne+=B*Bt,et+=B*kt,Je+=B*ut,it+=B*Vt,rt+=B*zt,We+=B*ht,lt+=B*xt,pt+=B*Nt,Ke+=B*Ge,vt+=B*$t,bt+=B*Et,tt+=B*ct,_t+=B*Ht,B=Z[8],Qe+=B*Ot,ke+=B*Dt,Ne+=B*dt,et+=B*Bt,Je+=B*kt,it+=B*ut,rt+=B*Vt,We+=B*zt,lt+=B*ht,pt+=B*xt,Ke+=B*Nt,vt+=B*Ge,bt+=B*$t,tt+=B*Et,_t+=B*ct,Ct+=B*Ht,B=Z[9],ke+=B*Ot,Ne+=B*Dt,et+=B*dt,Je+=B*Bt,it+=B*kt,rt+=B*ut,We+=B*Vt,lt+=B*zt,pt+=B*ht,Ke+=B*xt,vt+=B*Nt,bt+=B*Ge,tt+=B*$t,_t+=B*Et,Ct+=B*ct,It+=B*Ht,B=Z[10],Ne+=B*Ot,et+=B*Dt,Je+=B*dt,it+=B*Bt,rt+=B*kt,We+=B*ut,lt+=B*Vt,pt+=B*zt,Ke+=B*ht,vt+=B*xt,bt+=B*Nt,tt+=B*Ge,_t+=B*$t,Ct+=B*Et,It+=B*ct,er+=B*Ht,B=Z[11],et+=B*Ot,Je+=B*Dt,it+=B*dt,rt+=B*Bt,We+=B*kt,lt+=B*ut,pt+=B*Vt,Ke+=B*zt,vt+=B*ht,bt+=B*xt,tt+=B*Nt,_t+=B*Ge,Ct+=B*$t,It+=B*Et,er+=B*ct,ur+=B*Ht,B=Z[12],Je+=B*Ot,it+=B*Dt,rt+=B*dt,We+=B*Bt,lt+=B*kt,pt+=B*ut,Ke+=B*Vt,vt+=B*zt,bt+=B*ht,tt+=B*xt,_t+=B*Nt,Ct+=B*Ge,It+=B*$t,er+=B*Et,ur+=B*ct,wt+=B*Ht,B=Z[13],it+=B*Ot,rt+=B*Dt,We+=B*dt,lt+=B*Bt,pt+=B*kt,Ke+=B*ut,vt+=B*Vt,bt+=B*zt,tt+=B*ht,_t+=B*xt,Ct+=B*Nt,It+=B*Ge,er+=B*$t,ur+=B*Et,wt+=B*ct,lr+=B*Ht,B=Z[14],rt+=B*Ot,We+=B*Dt,lt+=B*dt,pt+=B*Bt,Ke+=B*kt,vt+=B*ut,bt+=B*Vt,tt+=B*zt,_t+=B*ht,Ct+=B*xt,It+=B*Nt,er+=B*Ge,ur+=B*$t,wt+=B*Et,lr+=B*ct,ir+=B*Ht,B=Z[15],We+=B*Ot,lt+=B*Dt,pt+=B*dt,Ke+=B*Bt,vt+=B*kt,bt+=B*ut,tt+=B*Vt,_t+=B*zt,Ct+=B*ht,It+=B*xt,er+=B*Nt,ur+=B*Ge,wt+=B*$t,lr+=B*Et,ir+=B*ct,Pt+=B*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,B=fe+te+65535,te=Math.floor(B/65536),fe=B-te*65536,B=Ee+te+65535,te=Math.floor(B/65536),Ee=B-te*65536,B=_e+te+65535,te=Math.floor(B/65536),_e=B-te*65536,B=Re+te+65535,te=Math.floor(B/65536),Re=B-te*65536,B=Te+te+65535,te=Math.floor(B/65536),Te=B-te*65536,B=De+te+65535,te=Math.floor(B/65536),De=B-te*65536,B=ze+te+65535,te=Math.floor(B/65536),ze=B-te*65536,B=Xe+te+65535,te=Math.floor(B/65536),Xe=B-te*65536,B=Qe+te+65535,te=Math.floor(B/65536),Qe=B-te*65536,B=ke+te+65535,te=Math.floor(B/65536),ke=B-te*65536,B=Ne+te+65535,te=Math.floor(B/65536),Ne=B-te*65536,B=et+te+65535,te=Math.floor(B/65536),et=B-te*65536,B=Je+te+65535,te=Math.floor(B/65536),Je=B-te*65536,B=it+te+65535,te=Math.floor(B/65536),it=B-te*65536,B=rt+te+65535,te=Math.floor(B/65536),rt=B-te*65536,B=We+te+65535,te=Math.floor(B/65536),We=B-te*65536,fe+=te-1+37*(te-1),te=1,B=fe+te+65535,te=Math.floor(B/65536),fe=B-te*65536,B=Ee+te+65535,te=Math.floor(B/65536),Ee=B-te*65536,B=_e+te+65535,te=Math.floor(B/65536),_e=B-te*65536,B=Re+te+65535,te=Math.floor(B/65536),Re=B-te*65536,B=Te+te+65535,te=Math.floor(B/65536),Te=B-te*65536,B=De+te+65535,te=Math.floor(B/65536),De=B-te*65536,B=ze+te+65535,te=Math.floor(B/65536),ze=B-te*65536,B=Xe+te+65535,te=Math.floor(B/65536),Xe=B-te*65536,B=Qe+te+65535,te=Math.floor(B/65536),Qe=B-te*65536,B=ke+te+65535,te=Math.floor(B/65536),ke=B-te*65536,B=Ne+te+65535,te=Math.floor(B/65536),Ne=B-te*65536,B=et+te+65535,te=Math.floor(B/65536),et=B-te*65536,B=Je+te+65535,te=Math.floor(B/65536),Je=B-te*65536,B=it+te+65535,te=Math.floor(B/65536),it=B-te*65536,B=rt+te+65535,te=Math.floor(B/65536),rt=B-te*65536,B=We+te+65535,te=Math.floor(B/65536),We=B-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 B;for(B=0;B<16;B++)ee[B]=Z[B];for(B=253;B>=0;B--)$(ee,ee),B!==2&&B!==4&&_(ee,ee,Z);for(B=0;B<16;B++)G[B]=ee[B]}function le(G,Z){const ee=i();let B;for(B=0;B<16;B++)ee[B]=Z[B];for(B=250;B>=0;B--)$(ee,ee),B!==1&&_(ee,ee,Z);for(B=0;B<16;B++)G[B]=ee[B]}function K(G,Z){const ee=i(),B=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(B,G[0],G[1]),F(De,Z[0],Z[1]),_(B,B,De),_(te,G[3],Z[3]),_(te,te,l),_(fe,G[2],Z[2]),F(fe,fe,fe),z(Ee,B,ee),z(_e,fe,te),F(Re,fe,te),F(Te,B,ee),_(G[0],Ee,_e),_(G[1],Te,Re),_(G[2],Re,_e),_(G[3],Ee,Te)}function k(G,Z,ee){for(let B=0;B<4;B++)b(G[B],Z[B],ee)}function R(G,Z){const ee=i(),B=i(),te=i();ie(te,Z[2]),_(ee,Z[0],te),_(B,Z[1],te),I(G,B),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 B=255;B>=0;--B){const te=ee[B/8|0]>>(B&7)&1;k(G,Z,te),K(Z,G),K(G,G),k(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 M(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),B=[i(),i(),i(),i()];m(B,Z),R(ee,B);const te=new Uint8Array(64);return te.set(G),te.set(ee,32),{publicKey:ee,secretKey:te}}t.generateKeyPairFromSeed=M;function N(G){const Z=(0,e.randomBytes)(32,G),ee=M(Z);return(0,n.wipe)(Z),ee}t.generateKeyPair=N;function x(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=x;const E=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,B,te,fe;for(B=63;B>=32;--B){for(ee=0,te=B-32,fe=B-12;te>4)*E[te],ee=Z[te]>>8,Z[te]&=255;for(te=0;te<32;te++)Z[te]-=ee*E[te];for(B=0;B<32;B++)Z[B+1]+=Z[B]>>8,G[B]=Z[B]&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 P(G,Z){const ee=new Float64Array(64),B=[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(B,_e),R(fe,B),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=P;function H(G,Z){const ee=i(),B=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),le(ee,ee),_(ee,ee,te),_(ee,ee,fe),_(ee,ee,fe),_(G[0],ee,fe),$(B,G[0]),_(B,B,fe),S(B,te)&&_(G[0],G[0],p),$(B,G[0]),_(B,B,fe),S(B,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 B=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),R(B,te),!C(ee,B)}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(),B=i(),te=Z[1];F(ee,a,te),z(B,a,te),ie(B,B),_(ee,ee,B);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})(NM);const _Pe="EdDSA",IPe="JWT",e4=".",wE="base64url",See="utf8",_ee="utf8",TPe=":",PPe="did",kPe="key",zj="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 Hj(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,zj),r=MPe+Bi(_3([e,t]),zj);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 fI(t){const e=t.split(e4),r=Hj(e[0]),n=Hj(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 Gj(t=Oh.randomBytes(OPe)){return NM.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=NM.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 Wj(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,Kj=Object.getOwnPropertySymbols,HPe=Object.prototype.hasOwnProperty,GPe=Object.prototype.propertyIsEnumerable,Yj=(t,e,r)=>e in t?zPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qj=(t,e)=>{for(var r in e||(e={}))HPe.call(e,r)&&Yj(t,r,e[r]);if(Kj)for(var r of Kj(e))GPe.call(e,r)&&Yj(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()&&!!gM()&&navigator.product===WPe}function Bx(){return!r4()&&!!gM()&&!!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=Qj(Qj({},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 fd(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 Jj(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Zj(){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 BM(){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,Xj=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,gke=Object.prototype.propertyIsEnumerable,eU=(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)&&eU(t,r,e[r]);if(Xj)for(var r of Xj(e))gke.call(e,r)&&eU(t,r,e[r]);return t},mke=(t,e)=>hke(t,pke(e));const bke="did:pkh:",LM=t=>t==null?void 0:t.split(":"),wke=t=>{const e=t&&LM(t);if(e)return t.includes(bke)?e[3]:e[1]},uI=t=>{const e=t&&LM(t);if(e)return e[2]+":"+e[3]},n4=t=>{const e=t&&LM(t);if(e)return e.pop()};async function tU(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,uI(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=>` + */(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 P(j,X,j).update(Z)[G]()}},F=function(j,X,G){return function(Z,ee){return new P(j,X,ee).update(Z)[G]()}},z=function(j,X,G){return function(Z,ee,B,te){return v["cshake"+j].update(Z,ee,B,te)[G]()}},_=function(j,X,G){return function(Z,ee,B,te){return v["kmac"+j].update(Z,ee,B,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}P.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,B=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},P.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 B=0;B=57344?Z+=3:(te=65536+((te&1023)<<10|j.charCodeAt(++B)&1023),Z+=4)}return Z+=this.encode(Z*8),this.update(j),Z},P.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];B%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},P.prototype.arrayBuffer=function(){this.finalize();var j=this.blockCount,X=this.s,G=this.outputBlocks,Z=this.extraBytes,ee=0,B=0,te=this.outputBits>>3,fe;Z?fe=new ArrayBuffer(G+1<<2):fe=new ArrayBuffer(te);for(var Ee=new Uint32Array(fe);B>8&255,te[fe+2]=Ee>>16&255,te[fe+3]=Ee>>24&255;B%j===0&&oe(X)}return Z&&(fe=B<<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){P.call(this,j,X,G)}H.prototype=new P,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var oe=function(j){var X,G,Z,ee,B,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,Ge,$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],B=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=B^(_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|B>>>31),G=Te^(B<<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,Ge=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&Ge,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^~Ge&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]=Ge^~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(M=0;M{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 xj=WSe();var Z_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Z_||(Z_={}));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 Ej="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),!(wj>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(bj)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+=Ej[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){xj&&this.throwError("platform missing String.prototype.normalize",Cn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xj})}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"}),mj){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bj=!!e,mj=!!r}static setLogLevel(e){const r=C3[e.toLowerCase()];if(r==null){Cn.globalLogger().warn("invalid log level - "+e);return}wj=r}static from(e){return new Cn(e)}}Cn.errors=Tc;Cn.levels=Z_;const KSe="bytes/5.7.0",ei=new Cn(KSe);function IX(t){return!!t.toHexString}function Vv(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Vv(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function YSe(t){return Ll(t)&&!(t.length%2)||bM(t)}function Cj(t){return typeof t=="number"&&t==t&&t%1===0}function bM(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Cj(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),Vv(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),Vv(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),Vv(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(bM(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 Aj(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 zv(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=zv(e.r,32),e.s==null||!Ll(e.s)?ei.throwArgumentError("signature missing or invalid s","signature",t):e.s=zv(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=zv(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 wM(t){return"0x"+HSe.keccak_256(di(t))}var xM={exports:{}};const XSe={},e7e=Object.freeze(Object.defineProperty({__proto__:null,default:XSe},Symbol.toStringTag,{value:"Module"})),rE=q$(e7e);xM.exports;(function(t){(function(e,r){function n(R,v){if(!R)throw new Error(v||"Assertion failed")}function i(R,v){R.super_=v;var m=function(){};m.prototype=v.prototype,R.prototype=new m,R.prototype.constructor=R}function s(R,v,m){if(s.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((v==="le"||v==="be")&&(m=v,v=10),this._init(R||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,M){if(typeof v=="number")return this._initNumber(v,m,M);if(typeof v=="object")return this._initArray(v,m,M);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),v=v.toString().replace(/\s+/g,"");var N=0;v[0]==="-"&&(N++,this.negative=1),N=0;N-=3)E=v[N]|v[N-1]<<8|v[N-2]<<16,this.words[x]|=E<>>26-w&67108863,w+=24,w>=26&&(w-=26,x++);else if(M==="le")for(N=0,x=0;N>>26-w&67108863,w+=24,w>=26&&(w-=26,x++);return this._strip()};function a(R,v){var m=R.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 "+R)}function c(R,v,m){var M=a(R,m);return m-1>=v&&(M|=a(R,m-1)<<4),M}s.prototype._parseHex=function(v,m,M){this.length=Math.ceil((v.length-m)/6),this.words=new Array(this.length);for(var N=0;N=m;N-=2)w=c(v,m,N)<=18?(x-=18,E+=1,this.words[E]|=w>>>26):x+=8;else{var T=v.length-m;for(N=T%2===0?m+1:m;N=18?(x-=18,E+=1,this.words[E]|=w>>>26):x+=8}this._strip()};function l(R,v,m,M){for(var N=0,x=0,E=Math.min(R.length,m),w=v;w=49?x=T-49+10:T>=17?x=T-17+10:x=T,n(T>=0&&x1&&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 M;if(v===16||v==="hex"){M="";for(var N=0,x=0,E=0;E>>24-N&16777215,N+=2,N>=26&&(N-=26,E--),x!==0||E!==this.length-1?M=p[6-T.length]+T+M:M=T+M}for(x!==0&&(M=x.toString(16)+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(v===(v|0)&&v>=2&&v<=36){var P=g[v],H=y[v];M="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var j=oe.modrn(H).toString(v);oe=oe.idivn(H),oe.isZero()?M=j+M:M=p[P-j.length]+j+M}for(this.isZero()&&(M="0"+M);M.length%m!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}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,M){this._strip();var N=this.byteLength(),x=M||Math.max(1,N);n(N<=x,"byte array longer than desired length"),n(x>0,"Requested array length <= 0");var E=b(v,x),w=m==="le"?"LE":"BE";return this["_toArrayLike"+w](E,N),E},s.prototype._toArrayLikeLE=function(v,m){for(var M=0,N=0,x=0,E=0;x>8&255),M>16&255),E===6?(M>24&255),N=0,E=0):(N=w>>>24,E+=2)}if(M=0&&(v[M--]=w>>8&255),M>=0&&(v[M--]=w>>16&255),E===6?(M>=0&&(v[M--]=w>>24&255),N=0,E=0):(N=w>>>24,E+=2)}if(M>=0)for(v[M--]=N;M>=0;)v[M--]=0},Math.clz32?s.prototype._countBits=function(v){return 32-Math.clz32(v)}:s.prototype._countBits=function(v){var m=v,M=0;return m>=4096&&(M+=13,m>>>=13),m>=64&&(M+=7,m>>>=7),m>=8&&(M+=4,m>>>=4),m>=2&&(M+=2,m>>>=2),M+m},s.prototype._zeroBits=function(v){if(v===0)return 26;var m=v,M=0;return m&8191||(M+=13,m>>>=13),m&127||(M+=7,m>>>=7),m&15||(M+=4,m>>>=4),m&3||(M+=2,m>>>=2),m&1||M++,M},s.prototype.bitLength=function(){var v=this.words[this.length-1],m=this._countBits(v);return(this.length-1)*26+m};function I(R){for(var v=new Array(R.bitLength()),m=0;m>>N&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 M=0;Mv.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,M;this.length>v.length?(m=this,M=v):(m=v,M=this);for(var N=0;Nv.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,M=v%26;this._expand(m),M>0&&m--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-M),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 M=v/26|0,N=v%26;return this._expand(M+1),m?this.words[M]=this.words[M]|1<v.length?(M=this,N=v):(M=v,N=this);for(var x=0,E=0;E>>26;for(;x!==0&&E>>26;if(this.length=M.length,x!==0)this.words[this.length]=x,this.length++;else if(M!==this)for(;Ev.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 M=this.cmp(v);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,x;M>0?(N=this,x=v):(N=v,x=this);for(var E=0,w=0;w>26,this.words[w]=m&67108863;for(;E!==0&&w>26,this.words[w]=m&67108863;if(E===0&&w>>26,oe=T&67108863,j=Math.min(P,v.length-1),X=Math.max(0,P-R.length+1);X<=j;X++){var G=P-X|0;N=R.words[G]|0,x=v.words[X]|0,E=N*x+oe,H+=E/67108864|0,oe=E&67108863}m.words[P]=oe|0,T=H|0}return T!==0?m.words[P]=T|0:m.length--,m._strip()}var S=function(v,m,M){var N=v.words,x=m.words,E=M.words,w=0,T,P,H,oe=N[0]|0,j=oe&8191,X=oe>>>13,G=N[1]|0,Z=G&8191,ee=G>>>13,B=N[2]|0,te=B&8191,fe=B>>>13,Ee=N[3]|0,_e=Ee&8191,Re=Ee>>>13,Te=N[4]|0,De=Te&8191,ze=Te>>>13,Xe=N[5]|0,Qe=Xe&8191,ke=Xe>>>13,Ne=N[6]|0,et=Ne&8191,Je=Ne>>>13,it=N[7]|0,rt=it&8191,We=it>>>13,lt=N[8]|0,pt=lt&8191,Ke=lt>>>13,vt=N[9]|0,bt=vt&8191,tt=vt>>>13,_t=x[0]|0,Ct=_t&8191,It=_t>>>13,er=x[1]|0,ur=er&8191,wt=er>>>13,lr=x[2]|0,ir=lr&8191,Pt=lr>>>13,Ot=x[3]|0,Dt=Ot&8191,dt=Ot>>>13,Bt=x[4]|0,kt=Bt&8191,ut=Bt>>>13,Vt=x[5]|0,zt=Vt&8191,ht=Vt>>>13,xt=x[6]|0,Nt=xt&8191,Ge=xt>>>13,$t=x[7]|0,Et=$t&8191,ct=$t>>>13,Ht=x[8]|0,Dr=Ht&8191,Ut=Ht>>>13,Ir=x[9]|0,tr=Ir&8191,Rr=Ir>>>13;M.negative=v.negative^m.negative,M.length=19,T=Math.imul(j,Ct),P=Math.imul(j,It),P=P+Math.imul(X,Ct)|0,H=Math.imul(X,It);var vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vi>>>26)|0,vi&=67108863,T=Math.imul(Z,Ct),P=Math.imul(Z,It),P=P+Math.imul(ee,Ct)|0,H=Math.imul(ee,It),T=T+Math.imul(j,ur)|0,P=P+Math.imul(j,wt)|0,P=P+Math.imul(X,ur)|0,H=H+Math.imul(X,wt)|0;var gi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(gi>>>26)|0,gi&=67108863,T=Math.imul(te,Ct),P=Math.imul(te,It),P=P+Math.imul(fe,Ct)|0,H=Math.imul(fe,It),T=T+Math.imul(Z,ur)|0,P=P+Math.imul(Z,wt)|0,P=P+Math.imul(ee,ur)|0,H=H+Math.imul(ee,wt)|0,T=T+Math.imul(j,ir)|0,P=P+Math.imul(j,Pt)|0,P=P+Math.imul(X,ir)|0,H=H+Math.imul(X,Pt)|0;var yi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(yi>>>26)|0,yi&=67108863,T=Math.imul(_e,Ct),P=Math.imul(_e,It),P=P+Math.imul(Re,Ct)|0,H=Math.imul(Re,It),T=T+Math.imul(te,ur)|0,P=P+Math.imul(te,wt)|0,P=P+Math.imul(fe,ur)|0,H=H+Math.imul(fe,wt)|0,T=T+Math.imul(Z,ir)|0,P=P+Math.imul(Z,Pt)|0,P=P+Math.imul(ee,ir)|0,H=H+Math.imul(ee,Pt)|0,T=T+Math.imul(j,Dt)|0,P=P+Math.imul(j,dt)|0,P=P+Math.imul(X,Dt)|0,H=H+Math.imul(X,dt)|0;var Si=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Si>>>26)|0,Si&=67108863,T=Math.imul(De,Ct),P=Math.imul(De,It),P=P+Math.imul(ze,Ct)|0,H=Math.imul(ze,It),T=T+Math.imul(_e,ur)|0,P=P+Math.imul(_e,wt)|0,P=P+Math.imul(Re,ur)|0,H=H+Math.imul(Re,wt)|0,T=T+Math.imul(te,ir)|0,P=P+Math.imul(te,Pt)|0,P=P+Math.imul(fe,ir)|0,H=H+Math.imul(fe,Pt)|0,T=T+Math.imul(Z,Dt)|0,P=P+Math.imul(Z,dt)|0,P=P+Math.imul(ee,Dt)|0,H=H+Math.imul(ee,dt)|0,T=T+Math.imul(j,kt)|0,P=P+Math.imul(j,ut)|0,P=P+Math.imul(X,kt)|0,H=H+Math.imul(X,ut)|0;var _n=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(_n>>>26)|0,_n&=67108863,T=Math.imul(Qe,Ct),P=Math.imul(Qe,It),P=P+Math.imul(ke,Ct)|0,H=Math.imul(ke,It),T=T+Math.imul(De,ur)|0,P=P+Math.imul(De,wt)|0,P=P+Math.imul(ze,ur)|0,H=H+Math.imul(ze,wt)|0,T=T+Math.imul(_e,ir)|0,P=P+Math.imul(_e,Pt)|0,P=P+Math.imul(Re,ir)|0,H=H+Math.imul(Re,Pt)|0,T=T+Math.imul(te,Dt)|0,P=P+Math.imul(te,dt)|0,P=P+Math.imul(fe,Dt)|0,H=H+Math.imul(fe,dt)|0,T=T+Math.imul(Z,kt)|0,P=P+Math.imul(Z,ut)|0,P=P+Math.imul(ee,kt)|0,H=H+Math.imul(ee,ut)|0,T=T+Math.imul(j,zt)|0,P=P+Math.imul(j,ht)|0,P=P+Math.imul(X,zt)|0,H=H+Math.imul(X,ht)|0;var us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(us>>>26)|0,us&=67108863,T=Math.imul(et,Ct),P=Math.imul(et,It),P=P+Math.imul(Je,Ct)|0,H=Math.imul(Je,It),T=T+Math.imul(Qe,ur)|0,P=P+Math.imul(Qe,wt)|0,P=P+Math.imul(ke,ur)|0,H=H+Math.imul(ke,wt)|0,T=T+Math.imul(De,ir)|0,P=P+Math.imul(De,Pt)|0,P=P+Math.imul(ze,ir)|0,H=H+Math.imul(ze,Pt)|0,T=T+Math.imul(_e,Dt)|0,P=P+Math.imul(_e,dt)|0,P=P+Math.imul(Re,Dt)|0,H=H+Math.imul(Re,dt)|0,T=T+Math.imul(te,kt)|0,P=P+Math.imul(te,ut)|0,P=P+Math.imul(fe,kt)|0,H=H+Math.imul(fe,ut)|0,T=T+Math.imul(Z,zt)|0,P=P+Math.imul(Z,ht)|0,P=P+Math.imul(ee,zt)|0,H=H+Math.imul(ee,ht)|0,T=T+Math.imul(j,Nt)|0,P=P+Math.imul(j,Ge)|0,P=P+Math.imul(X,Nt)|0,H=H+Math.imul(X,Ge)|0;var ds=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ds>>>26)|0,ds&=67108863,T=Math.imul(rt,Ct),P=Math.imul(rt,It),P=P+Math.imul(We,Ct)|0,H=Math.imul(We,It),T=T+Math.imul(et,ur)|0,P=P+Math.imul(et,wt)|0,P=P+Math.imul(Je,ur)|0,H=H+Math.imul(Je,wt)|0,T=T+Math.imul(Qe,ir)|0,P=P+Math.imul(Qe,Pt)|0,P=P+Math.imul(ke,ir)|0,H=H+Math.imul(ke,Pt)|0,T=T+Math.imul(De,Dt)|0,P=P+Math.imul(De,dt)|0,P=P+Math.imul(ze,Dt)|0,H=H+Math.imul(ze,dt)|0,T=T+Math.imul(_e,kt)|0,P=P+Math.imul(_e,ut)|0,P=P+Math.imul(Re,kt)|0,H=H+Math.imul(Re,ut)|0,T=T+Math.imul(te,zt)|0,P=P+Math.imul(te,ht)|0,P=P+Math.imul(fe,zt)|0,H=H+Math.imul(fe,ht)|0,T=T+Math.imul(Z,Nt)|0,P=P+Math.imul(Z,Ge)|0,P=P+Math.imul(ee,Nt)|0,H=H+Math.imul(ee,Ge)|0,T=T+Math.imul(j,Et)|0,P=P+Math.imul(j,ct)|0,P=P+Math.imul(X,Et)|0,H=H+Math.imul(X,ct)|0;var hs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(hs>>>26)|0,hs&=67108863,T=Math.imul(pt,Ct),P=Math.imul(pt,It),P=P+Math.imul(Ke,Ct)|0,H=Math.imul(Ke,It),T=T+Math.imul(rt,ur)|0,P=P+Math.imul(rt,wt)|0,P=P+Math.imul(We,ur)|0,H=H+Math.imul(We,wt)|0,T=T+Math.imul(et,ir)|0,P=P+Math.imul(et,Pt)|0,P=P+Math.imul(Je,ir)|0,H=H+Math.imul(Je,Pt)|0,T=T+Math.imul(Qe,Dt)|0,P=P+Math.imul(Qe,dt)|0,P=P+Math.imul(ke,Dt)|0,H=H+Math.imul(ke,dt)|0,T=T+Math.imul(De,kt)|0,P=P+Math.imul(De,ut)|0,P=P+Math.imul(ze,kt)|0,H=H+Math.imul(ze,ut)|0,T=T+Math.imul(_e,zt)|0,P=P+Math.imul(_e,ht)|0,P=P+Math.imul(Re,zt)|0,H=H+Math.imul(Re,ht)|0,T=T+Math.imul(te,Nt)|0,P=P+Math.imul(te,Ge)|0,P=P+Math.imul(fe,Nt)|0,H=H+Math.imul(fe,Ge)|0,T=T+Math.imul(Z,Et)|0,P=P+Math.imul(Z,ct)|0,P=P+Math.imul(ee,Et)|0,H=H+Math.imul(ee,ct)|0,T=T+Math.imul(j,Dr)|0,P=P+Math.imul(j,Ut)|0,P=P+Math.imul(X,Dr)|0,H=H+Math.imul(X,Ut)|0;var Vi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,T=Math.imul(bt,Ct),P=Math.imul(bt,It),P=P+Math.imul(tt,Ct)|0,H=Math.imul(tt,It),T=T+Math.imul(pt,ur)|0,P=P+Math.imul(pt,wt)|0,P=P+Math.imul(Ke,ur)|0,H=H+Math.imul(Ke,wt)|0,T=T+Math.imul(rt,ir)|0,P=P+Math.imul(rt,Pt)|0,P=P+Math.imul(We,ir)|0,H=H+Math.imul(We,Pt)|0,T=T+Math.imul(et,Dt)|0,P=P+Math.imul(et,dt)|0,P=P+Math.imul(Je,Dt)|0,H=H+Math.imul(Je,dt)|0,T=T+Math.imul(Qe,kt)|0,P=P+Math.imul(Qe,ut)|0,P=P+Math.imul(ke,kt)|0,H=H+Math.imul(ke,ut)|0,T=T+Math.imul(De,zt)|0,P=P+Math.imul(De,ht)|0,P=P+Math.imul(ze,zt)|0,H=H+Math.imul(ze,ht)|0,T=T+Math.imul(_e,Nt)|0,P=P+Math.imul(_e,Ge)|0,P=P+Math.imul(Re,Nt)|0,H=H+Math.imul(Re,Ge)|0,T=T+Math.imul(te,Et)|0,P=P+Math.imul(te,ct)|0,P=P+Math.imul(fe,Et)|0,H=H+Math.imul(fe,ct)|0,T=T+Math.imul(Z,Dr)|0,P=P+Math.imul(Z,Ut)|0,P=P+Math.imul(ee,Dr)|0,H=H+Math.imul(ee,Ut)|0,T=T+Math.imul(j,tr)|0,P=P+Math.imul(j,Rr)|0,P=P+Math.imul(X,tr)|0,H=H+Math.imul(X,Rr)|0;var ps=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(ps>>>26)|0,ps&=67108863,T=Math.imul(bt,ur),P=Math.imul(bt,wt),P=P+Math.imul(tt,ur)|0,H=Math.imul(tt,wt),T=T+Math.imul(pt,ir)|0,P=P+Math.imul(pt,Pt)|0,P=P+Math.imul(Ke,ir)|0,H=H+Math.imul(Ke,Pt)|0,T=T+Math.imul(rt,Dt)|0,P=P+Math.imul(rt,dt)|0,P=P+Math.imul(We,Dt)|0,H=H+Math.imul(We,dt)|0,T=T+Math.imul(et,kt)|0,P=P+Math.imul(et,ut)|0,P=P+Math.imul(Je,kt)|0,H=H+Math.imul(Je,ut)|0,T=T+Math.imul(Qe,zt)|0,P=P+Math.imul(Qe,ht)|0,P=P+Math.imul(ke,zt)|0,H=H+Math.imul(ke,ht)|0,T=T+Math.imul(De,Nt)|0,P=P+Math.imul(De,Ge)|0,P=P+Math.imul(ze,Nt)|0,H=H+Math.imul(ze,Ge)|0,T=T+Math.imul(_e,Et)|0,P=P+Math.imul(_e,ct)|0,P=P+Math.imul(Re,Et)|0,H=H+Math.imul(Re,ct)|0,T=T+Math.imul(te,Dr)|0,P=P+Math.imul(te,Ut)|0,P=P+Math.imul(fe,Dr)|0,H=H+Math.imul(fe,Ut)|0,T=T+Math.imul(Z,tr)|0,P=P+Math.imul(Z,Rr)|0,P=P+Math.imul(ee,tr)|0,H=H+Math.imul(ee,Rr)|0;var vs=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(vs>>>26)|0,vs&=67108863,T=Math.imul(bt,ir),P=Math.imul(bt,Pt),P=P+Math.imul(tt,ir)|0,H=Math.imul(tt,Pt),T=T+Math.imul(pt,Dt)|0,P=P+Math.imul(pt,dt)|0,P=P+Math.imul(Ke,Dt)|0,H=H+Math.imul(Ke,dt)|0,T=T+Math.imul(rt,kt)|0,P=P+Math.imul(rt,ut)|0,P=P+Math.imul(We,kt)|0,H=H+Math.imul(We,ut)|0,T=T+Math.imul(et,zt)|0,P=P+Math.imul(et,ht)|0,P=P+Math.imul(Je,zt)|0,H=H+Math.imul(Je,ht)|0,T=T+Math.imul(Qe,Nt)|0,P=P+Math.imul(Qe,Ge)|0,P=P+Math.imul(ke,Nt)|0,H=H+Math.imul(ke,Ge)|0,T=T+Math.imul(De,Et)|0,P=P+Math.imul(De,ct)|0,P=P+Math.imul(ze,Et)|0,H=H+Math.imul(ze,ct)|0,T=T+Math.imul(_e,Dr)|0,P=P+Math.imul(_e,Ut)|0,P=P+Math.imul(Re,Dr)|0,H=H+Math.imul(Re,Ut)|0,T=T+Math.imul(te,tr)|0,P=P+Math.imul(te,Rr)|0,P=P+Math.imul(fe,tr)|0,H=H+Math.imul(fe,Rr)|0;var Us=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(Us>>>26)|0,Us&=67108863,T=Math.imul(bt,Dt),P=Math.imul(bt,dt),P=P+Math.imul(tt,Dt)|0,H=Math.imul(tt,dt),T=T+Math.imul(pt,kt)|0,P=P+Math.imul(pt,ut)|0,P=P+Math.imul(Ke,kt)|0,H=H+Math.imul(Ke,ut)|0,T=T+Math.imul(rt,zt)|0,P=P+Math.imul(rt,ht)|0,P=P+Math.imul(We,zt)|0,H=H+Math.imul(We,ht)|0,T=T+Math.imul(et,Nt)|0,P=P+Math.imul(et,Ge)|0,P=P+Math.imul(Je,Nt)|0,H=H+Math.imul(Je,Ge)|0,T=T+Math.imul(Qe,Et)|0,P=P+Math.imul(Qe,ct)|0,P=P+Math.imul(ke,Et)|0,H=H+Math.imul(ke,ct)|0,T=T+Math.imul(De,Dr)|0,P=P+Math.imul(De,Ut)|0,P=P+Math.imul(ze,Dr)|0,H=H+Math.imul(ze,Ut)|0,T=T+Math.imul(_e,tr)|0,P=P+Math.imul(_e,Rr)|0,P=P+Math.imul(Re,tr)|0,H=H+Math.imul(Re,Rr)|0;var lo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(lo>>>26)|0,lo&=67108863,T=Math.imul(bt,kt),P=Math.imul(bt,ut),P=P+Math.imul(tt,kt)|0,H=Math.imul(tt,ut),T=T+Math.imul(pt,zt)|0,P=P+Math.imul(pt,ht)|0,P=P+Math.imul(Ke,zt)|0,H=H+Math.imul(Ke,ht)|0,T=T+Math.imul(rt,Nt)|0,P=P+Math.imul(rt,Ge)|0,P=P+Math.imul(We,Nt)|0,H=H+Math.imul(We,Ge)|0,T=T+Math.imul(et,Et)|0,P=P+Math.imul(et,ct)|0,P=P+Math.imul(Je,Et)|0,H=H+Math.imul(Je,ct)|0,T=T+Math.imul(Qe,Dr)|0,P=P+Math.imul(Qe,Ut)|0,P=P+Math.imul(ke,Dr)|0,H=H+Math.imul(ke,Ut)|0,T=T+Math.imul(De,tr)|0,P=P+Math.imul(De,Rr)|0,P=P+Math.imul(ze,tr)|0,H=H+Math.imul(ze,Rr)|0;var In=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(In>>>26)|0,In&=67108863,T=Math.imul(bt,zt),P=Math.imul(bt,ht),P=P+Math.imul(tt,zt)|0,H=Math.imul(tt,ht),T=T+Math.imul(pt,Nt)|0,P=P+Math.imul(pt,Ge)|0,P=P+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,Ge)|0,T=T+Math.imul(rt,Et)|0,P=P+Math.imul(rt,ct)|0,P=P+Math.imul(We,Et)|0,H=H+Math.imul(We,ct)|0,T=T+Math.imul(et,Dr)|0,P=P+Math.imul(et,Ut)|0,P=P+Math.imul(Je,Dr)|0,H=H+Math.imul(Je,Ut)|0,T=T+Math.imul(Qe,tr)|0,P=P+Math.imul(Qe,Rr)|0,P=P+Math.imul(ke,tr)|0,H=H+Math.imul(ke,Rr)|0;var zi=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(zi>>>26)|0,zi&=67108863,T=Math.imul(bt,Nt),P=Math.imul(bt,Ge),P=P+Math.imul(tt,Nt)|0,H=Math.imul(tt,Ge),T=T+Math.imul(pt,Et)|0,P=P+Math.imul(pt,ct)|0,P=P+Math.imul(Ke,Et)|0,H=H+Math.imul(Ke,ct)|0,T=T+Math.imul(rt,Dr)|0,P=P+Math.imul(rt,Ut)|0,P=P+Math.imul(We,Dr)|0,H=H+Math.imul(We,Ut)|0,T=T+Math.imul(et,tr)|0,P=P+Math.imul(et,Rr)|0,P=P+Math.imul(Je,tr)|0,H=H+Math.imul(Je,Rr)|0;var fo=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(fo>>>26)|0,fo&=67108863,T=Math.imul(bt,Et),P=Math.imul(bt,ct),P=P+Math.imul(tt,Et)|0,H=Math.imul(tt,ct),T=T+Math.imul(pt,Dr)|0,P=P+Math.imul(pt,Ut)|0,P=P+Math.imul(Ke,Dr)|0,H=H+Math.imul(Ke,Ut)|0,T=T+Math.imul(rt,tr)|0,P=P+Math.imul(rt,Rr)|0,P=P+Math.imul(We,tr)|0,H=H+Math.imul(We,Rr)|0;var $s=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(bt,Dr),P=Math.imul(bt,Ut),P=P+Math.imul(tt,Dr)|0,H=Math.imul(tt,Ut),T=T+Math.imul(pt,tr)|0,P=P+Math.imul(pt,Rr)|0,P=P+Math.imul(Ke,tr)|0,H=H+Math.imul(Ke,Rr)|0;var tf=(w+T|0)+((P&8191)<<13)|0;w=(H+(P>>>13)|0)+(tf>>>26)|0,tf&=67108863,T=Math.imul(bt,tr),P=Math.imul(bt,Rr),P=P+Math.imul(tt,tr)|0,H=Math.imul(tt,Rr);var Jc=(w+T|0)+((P&8191)<<13)|0;return w=(H+(P>>>13)|0)+(Jc>>>26)|0,Jc&=67108863,E[0]=vi,E[1]=gi,E[2]=yi,E[3]=Si,E[4]=_n,E[5]=us,E[6]=ds,E[7]=hs,E[8]=Vi,E[9]=ps,E[10]=vs,E[11]=Us,E[12]=lo,E[13]=In,E[14]=zi,E[15]=fo,E[16]=$s,E[17]=tf,E[18]=Jc,w!==0&&(E[19]=w,M.length++),M};Math.imul||(S=C);function O(R,v,m){m.negative=v.negative^R.negative,m.length=R.length+v.length;for(var M=0,N=0,x=0;x>>26)|0,N+=E>>>26,E&=67108863}m.words[x]=w,M=E,E=N}return M!==0?m.words[x]=M:m.length--,m._strip()}function L(R,v,m){return O(R,v,m)}s.prototype.mulTo=function(v,m){var M,N=this.length+v.length;return this.length===10&&v.length===10?M=S(this,v,m):N<63?M=C(this,v,m):N<1024?M=O(this,v,m):M=L(this,v,m),M},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 M=0,N=0;N>=26,M+=x/67108864|0,M+=E>>>26,this.words[N]=E&67108863}return M!==0&&(this.words[N]=M,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 M=this,N=0;N=0);var m=v%26,M=(v-m)/26,N=67108863>>>26-m<<26-m,x;if(m!==0){var E=0;for(x=0;x>>26-m}E&&(this.words[x]=E,this.length++)}if(M!==0){for(x=this.length-1;x>=0;x--)this.words[x+M]=this.words[x];for(x=0;x=0);var N;m?N=(m-m%26)/26:N=0;var x=v%26,E=Math.min((v-x)/26,this.length),w=67108863^67108863>>>x<E)for(this.length-=E,P=0;P=0&&(H!==0||P>=N);P--){var oe=this.words[P]|0;this.words[P]=H<<26-x|oe>>>x,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,M){return n(this.negative===0),this.iushrn(v,m,M)},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,M=(v-m)/26,N=1<=0);var m=v%26,M=(v-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(m!==0&&M++,this.length=Math.min(M,this.length),m!==0){var N=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[x+M]=E&67108863}for(;x>26,this.words[x+M]=E&67108863;if(w===0)return this._strip();for(n(w===-1),w=0,x=0;x>26,this.words[x]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(v,m){var M=this.length-v.length,N=this.clone(),x=v,E=x.words[x.length-1]|0,w=this._countBits(E);M=26-w,M!==0&&(x=x.ushln(M),N.iushln(M),E=x.words[x.length-1]|0);var T=N.length-x.length,P;if(m!=="mod"){P=new s(null),P.length=T+1,P.words=new Array(P.length);for(var H=0;H=0;j--){var X=(N.words[x.length+j]|0)*67108864+(N.words[x.length+j-1]|0);for(X=Math.min(X/E|0,67108863),N._ishlnsubmul(x,X,j);N.negative!==0;)X--,N.negative=0,N._ishlnsubmul(x,1,j),N.isZero()||(N.negative^=1);P&&(P.words[j]=X)}return P&&P._strip(),N._strip(),m!=="div"&&M!==0&&N.iushrn(M),{div:P||null,mod:N}},s.prototype.divmod=function(v,m,M){if(n(!v.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,x,E;return this.negative!==0&&v.negative===0?(E=this.neg().divmod(v,m),m!=="mod"&&(N=E.div.neg()),m!=="div"&&(x=E.mod.neg(),M&&x.negative!==0&&x.iadd(v)),{div:N,mod:x}):this.negative===0&&v.negative!==0?(E=this.divmod(v.neg(),m),m!=="mod"&&(N=E.div.neg()),{div:N,mod:E.mod}):this.negative&v.negative?(E=this.neg().divmod(v.neg(),m),m!=="div"&&(x=E.mod.neg(),M&&x.negative!==0&&x.isub(v)),{div:E.div,mod:x}):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 M=m.div.negative!==0?m.mod.isub(v):m.mod,N=v.ushrn(1),x=v.andln(1),E=M.cmp(N);return E<0||x===1&&E===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 M=(1<<26)%v,N=0,x=this.length-1;x>=0;x--)N=(M*N+(this.words[x]|0))%v;return m?-N:N},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 M=0,N=this.length-1;N>=0;N--){var x=(this.words[N]|0)+M*67108864;this.words[N]=x/v|0,M=x%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,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var N=new s(1),x=new s(0),E=new s(0),w=new s(1),T=0;m.isEven()&&M.isEven();)m.iushrn(1),M.iushrn(1),++T;for(var P=M.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;)(N.isOdd()||x.isOdd())&&(N.iadd(P),x.isub(H)),N.iushrn(1),x.iushrn(1);for(var X=0,G=1;!(M.words[0]&G)&&X<26;++X,G<<=1);if(X>0)for(M.iushrn(X);X-- >0;)(E.isOdd()||w.isOdd())&&(E.iadd(P),w.isub(H)),E.iushrn(1),w.iushrn(1);m.cmp(M)>=0?(m.isub(M),N.isub(E),x.isub(w)):(M.isub(m),E.isub(N),w.isub(x))}return{a:E,b:w,gcd:M.iushln(T)}},s.prototype._invmp=function(v){n(v.negative===0),n(!v.isZero());var m=this,M=v.clone();m.negative!==0?m=m.umod(v):m=m.clone();for(var N=new s(1),x=new s(0),E=M.clone();m.cmpn(1)>0&&M.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;)N.isOdd()&&N.iadd(E),N.iushrn(1);for(var P=0,H=1;!(M.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(M.iushrn(P);P-- >0;)x.isOdd()&&x.iadd(E),x.iushrn(1);m.cmp(M)>=0?(m.isub(M),N.isub(x)):(M.isub(m),x.isub(N))}var oe;return m.cmpn(1)===0?oe=N:oe=x,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(),M=v.clone();m.negative=0,M.negative=0;for(var N=0;m.isEven()&&M.isEven();N++)m.iushrn(1),M.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;M.isEven();)M.iushrn(1);var x=m.cmp(M);if(x<0){var E=m;m=M,M=E}else if(x===0||M.cmpn(1)===0)break;m.isub(M)}while(!0);return M.iushln(N)},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,M=(v-m)/26,N=1<>>26,w&=67108863,this.words[E]=w}return x!==0&&(this.words[E]=x,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 M;if(this.length>1)M=1;else{m&&(v=-v),n(v<=67108863,"Number is too big");var N=this.words[0]|0;M=N===v?0:Nv.length)return 1;if(this.length=0;M--){var N=this.words[M]|0,x=v.words[M]|0;if(N!==x){Nx&&(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(R,v){this.name=R,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,M;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),M=m.bitLength();while(M>this.n);var N=M0?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 M=4194303,N=Math.min(v.length,9),x=0;x>>22,E=w}E>>>=22,v.words[x-10]=E,E===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,M=0;M>>=26,v.words[M]=x,m=N}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 le;else throw new Error("Unknown prime "+v);return F[v]=m,m};function K(R){if(typeof R=="string"){var v=s._prime(R);this.m=v.p,this.prime=v}else n(R.gtn(1),"modulus must be greater than 1"),this.m=R,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 M=v.add(m);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},K.prototype.iadd=function(v,m){this._verify2(v,m);var M=v.iadd(m);return M.cmp(this.m)>=0&&M.isub(this.m),M},K.prototype.sub=function(v,m){this._verify2(v,m);var M=v.sub(m);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},K.prototype.isub=function(v,m){this._verify2(v,m);var M=v.isub(m);return M.cmpn(0)<0&&M.iadd(this.m),M},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 M=this.m.add(new s(1)).iushrn(2);return this.pow(v,M)}for(var N=this.m.subn(1),x=0;!N.isZero()&&N.andln(1)===0;)x++,N.iushrn(1);n(!N.isZero());var E=new s(1).toRed(this),w=E.redNeg(),T=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,T).cmp(w)!==0;)P.redIAdd(w);for(var H=this.pow(P,N),oe=this.pow(v,N.addn(1).iushrn(1)),j=this.pow(v,N),X=x;j.cmp(E)!==0;){for(var G=j,Z=0;G.cmp(E)!==0;Z++)G=G.redSqr();n(Z=0;x--){for(var H=m.words[x],oe=P-1;oe>=0;oe--){var j=H>>oe&1;if(E!==N[0]&&(E=this.sqr(E)),j===0&&w===0){T=0;continue}w<<=1,w|=j,T++,!(T!==M&&(x!==0||oe!==0))&&(E=this.mul(E,N[w]),T=0,w=0)}P=26}return E},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 k(v)};function k(R){K.call(this,R),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(k,K),k.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},k.prototype.convertFrom=function(v){var m=this.imod(v.mul(this.rinv));return m.red=null,m},k.prototype.imul=function(v,m){if(v.isZero()||m.isZero())return v.words[0]=0,v.length=1,v;var M=v.imul(m),N=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=M.isub(N).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},k.prototype.mul=function(v,m){if(v.isZero()||m.isZero())return new s(0)._forceRed(this);var M=v.mul(m),N=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=M.isub(N).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},k.prototype.invm=function(v){var m=this.imod(v._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,Ei)})(xM);var t7e=xM.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 Sj;(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"})(Sj||(Sj={}));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)),wM(QSe([R9(o7e),R9(String(t.length)),t]))}const a7e="address/5.7.0",ob=new Cn(a7e);function _j(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(wM(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 EM={};for(let t=0;t<10;t++)EM[String(t)]=String(t);for(let t=0;t<26;t++)EM[String.fromCharCode(65+t)]=String(10+t);const Ij=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=>EM[n]).join("");for(;e.length>=Ij;){let n=e.substring(0,Ij);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=_j(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=_j("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={},Qp=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 X_={exports:{}};typeof Object.create=="function"?X_.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:X_.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=X_.exports,d7e=Qp,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={},Tj=Mr,L7e=Qp;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=Tj.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=Tj.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 ay=Mr,z7e=Oy,H7e=Zl,O9=ay.rotl32,Rm=ay.sum32,G7e=ay.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)}ay.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 Jp=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){Jp.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}AM(as,Jp.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=Jp,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 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=jc.toArray(t.entropy,t.entropyEnc||"hex"),r=jc.toArray(t.nonce,t.nonceEnc||"hex"),n=jc.toArray(t.pers,t.persEnc||"hex");CM(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var YX=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=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 Rj(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=Rj(r),n=Rj(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 SM(this,e)};ec.prototype.keyFromPrivate=function(e,r){return SM.fromPrivate(this,e,r)};ec.prototype.keyFromPublic=function(e,r){return SM.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",nI=new Cn(K_e);let F9=null;function ld(){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&&nI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ld().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=ld().keyFromPublic(di(this.publicKey)),n=ld().keyFromPublic(di(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=ld().keyFromPrivate(di(this.privateKey)),n=di(e);n.length!==32&&nI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return TX({recoveryParam:i.recoveryParam,r:zv("0x"+i.r.toString(16),32),s:zv("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ld().keyFromPrivate(di(this.privateKey)),n=ld().keyFromPublic(di(JX(e)));return zv("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"+ld().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"+ld().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?ea(r):nI.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Oj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Oj||(Oj={}));function J_e(t){const e=JX(t);return u7e(Aj(wM(Aj(e,1)),12))}function Z_e(t,e){return J_e(Q_e(di(t),e))}var _M={},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 iI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}fr.readInt32BE=iI;function sI(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=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]}fr.readInt32LE=oI;function aI(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=aI;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=iI(t,e),n=iI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}fr.readInt64BE=nIe;function iIe(t,e){e===void 0&&(e=0);var r=sI(t,e),n=sI(t,e+4);return r*4294967296+n}fr.readUint64BE=iIe;function sIe(t,e){e===void 0&&(e=0);var r=oI(t,e),n=oI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}fr.readInt64LE=sIe;function oIe(t,e){e===void 0&&(e=0);var r=aI(t,e),n=aI(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,M^=L,M=M>>>16|M<<16,k=k+M|0,$^=k,$=$>>>20|$<<12,F=F+ie|0,N^=F,N=N>>>16|N<<16,R=R+N|0,ie^=R,ie=ie>>>20|ie<<12,z=z+le|0,x^=z,x=x>>>16|x<<16,v=v+x|0,le^=v,le=le>>>20|le<<12,F=F+ie|0,N^=F,N=N>>>24|N<<8,R=R+N|0,ie^=R,ie=ie>>>25|ie<<7,z=z+le|0,x^=z,x=x>>>24|x<<8,v=v+x|0,le^=v,le=le>>>25|le<<7,L=L+$|0,M^=L,M=M>>>24|M<<8,k=k+M|0,$^=k,$=$>>>25|$<<7,O=O+_|0,m^=O,m=m>>>24|m<<8,K=K+m|0,_^=K,_=_>>>25|_<<7,O=O+$|0,x^=O,x=x>>>16|x<<16,R=R+x|0,$^=R,$=$>>>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+le|0,M^=F,M=M>>>16|M<<16,K=K+M|0,le^=K,le=le>>>20|le<<12,z=z+_|0,N^=z,N=N>>>16|N<<16,k=k+N|0,_^=k,_=_>>>20|_<<12,F=F+le|0,M^=F,M=M>>>24|M<<8,K=K+M|0,le^=K,le=le>>>25|le<<7,z=z+_|0,N^=z,N=N>>>24|N<<8,k=k+N|0,_^=k,_=_>>>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,x^=O,x=x>>>24|x<<8,R=R+x|0,$^=R,$=$>>>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(le+f|0,t,28),ws.writeUint32LE(K+u|0,t,32),ws.writeUint32LE(k+p|0,t,36),ws.writeUint32LE(R+g|0,t,40),ws.writeUint32LE(v+y|0,t,44),ws.writeUint32LE(m+b|0,t,48),ws.writeUint32LE(M+I|0,t,52),ws.writeUint32LE(N+C|0,t,56),ws.writeUint32LE(x+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],le=this._r[5],K=this._r[6],k=this._r[7],R=this._r[8],v=this._r[9];l>=16;){var m=a[c+0]|a[c+1]<<8;u+=m&8191;var M=a[c+2]|a[c+3]<<8;p+=(m>>>13|M<<3)&8191;var N=a[c+4]|a[c+5]<<8;g+=(M>>>10|N<<6)&8191;var x=a[c+6]|a[c+7]<<8;y+=(N>>>7|x<<9)&8191;var E=a[c+8]|a[c+9]<<8;b+=(x>>>4|E<<12)&8191,I+=E>>>1&8191;var w=a[c+10]|a[c+11]<<8;C+=(E>>>14|w<<2)&8191;var T=a[c+12]|a[c+13]<<8;S+=(w>>>11|T<<5)&8191;var P=a[c+14]|a[c+15]<<8;O+=(T>>>8|P<<8)&8191,L+=P>>>5|f;var H=0,oe=H;oe+=u*F,oe+=p*(5*v),oe+=g*(5*R),oe+=y*(5*k),oe+=b*(5*K),H=oe>>>13,oe&=8191,oe+=I*(5*le),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*R),j+=b*(5*k),H=j>>>13,j&=8191,j+=I*(5*K),j+=C*(5*le),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*R),H=X>>>13,X&=8191,X+=I*(5*k),X+=C*(5*K),X+=S*(5*le),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*R),G+=C*(5*k),G+=S*(5*K),G+=O*(5*le),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*R),Z+=S*(5*k),Z+=O*(5*K),Z+=L*(5*le),H+=Z>>>13,Z&=8191;var ee=H;ee+=u*le,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*R),ee+=O*(5*k),ee+=L*(5*K),H+=ee>>>13,ee&=8191;var B=H;B+=u*K,B+=p*le,B+=g*ie,B+=y*$,B+=b*_,H=B>>>13,B&=8191,B+=I*z,B+=C*F,B+=S*(5*v),B+=O*(5*R),B+=L*(5*k),H+=B>>>13,B&=8191;var te=H;te+=u*k,te+=p*K,te+=g*le,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*R),H+=te>>>13,te&=8191;var fe=H;fe+=u*R,fe+=p*k,fe+=g*K,fe+=y*le,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*R,Ee+=g*k,Ee+=y*K,Ee+=b*le,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=B,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 TM={};(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[le-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,le=0,K=0,k=0,R=0,v=0,m=0,M=0,N=0,x=0,E=0,w=0,T=0,P=0,H=0,oe=0,j=0,X=0,G=0,Z=0,ee=0,B=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,le+=_*ke,K+=_*Ne,k+=_*et,R+=_*Je,v+=_*it,m+=_*rt,M+=_*We,N+=_*lt,x+=_*pt,E+=_*Ke,w+=_*vt,T+=_*bt,P+=_*tt,H+=_*_t,oe+=_*Ct,_=F[1],le+=_*Qe,K+=_*ke,k+=_*Ne,R+=_*et,v+=_*Je,m+=_*it,M+=_*rt,N+=_*We,x+=_*lt,E+=_*pt,w+=_*Ke,T+=_*vt,P+=_*bt,H+=_*tt,oe+=_*_t,j+=_*Ct,_=F[2],K+=_*Qe,k+=_*ke,R+=_*Ne,v+=_*et,m+=_*Je,M+=_*it,N+=_*rt,x+=_*We,E+=_*lt,w+=_*pt,T+=_*Ke,P+=_*vt,H+=_*bt,oe+=_*tt,j+=_*_t,X+=_*Ct,_=F[3],k+=_*Qe,R+=_*ke,v+=_*Ne,m+=_*et,M+=_*Je,N+=_*it,x+=_*rt,E+=_*We,w+=_*lt,T+=_*pt,P+=_*Ke,H+=_*vt,oe+=_*bt,j+=_*tt,X+=_*_t,G+=_*Ct,_=F[4],R+=_*Qe,v+=_*ke,m+=_*Ne,M+=_*et,N+=_*Je,x+=_*it,E+=_*rt,w+=_*We,T+=_*lt,P+=_*pt,H+=_*Ke,oe+=_*vt,j+=_*bt,X+=_*tt,G+=_*_t,Z+=_*Ct,_=F[5],v+=_*Qe,m+=_*ke,M+=_*Ne,N+=_*et,x+=_*Je,E+=_*it,w+=_*rt,T+=_*We,P+=_*lt,H+=_*pt,oe+=_*Ke,j+=_*vt,X+=_*bt,G+=_*tt,Z+=_*_t,ee+=_*Ct,_=F[6],m+=_*Qe,M+=_*ke,N+=_*Ne,x+=_*et,E+=_*Je,w+=_*it,T+=_*rt,P+=_*We,H+=_*lt,oe+=_*pt,j+=_*Ke,X+=_*vt,G+=_*bt,Z+=_*tt,ee+=_*_t,B+=_*Ct,_=F[7],M+=_*Qe,N+=_*ke,x+=_*Ne,E+=_*et,w+=_*Je,T+=_*it,P+=_*rt,H+=_*We,oe+=_*lt,j+=_*pt,X+=_*Ke,G+=_*vt,Z+=_*bt,ee+=_*tt,B+=_*_t,te+=_*Ct,_=F[8],N+=_*Qe,x+=_*ke,E+=_*Ne,w+=_*et,T+=_*Je,P+=_*it,H+=_*rt,oe+=_*We,j+=_*lt,X+=_*pt,G+=_*Ke,Z+=_*vt,ee+=_*bt,B+=_*tt,te+=_*_t,fe+=_*Ct,_=F[9],x+=_*Qe,E+=_*ke,w+=_*Ne,T+=_*et,P+=_*Je,H+=_*it,oe+=_*rt,j+=_*We,X+=_*lt,G+=_*pt,Z+=_*Ke,ee+=_*vt,B+=_*bt,te+=_*tt,fe+=_*_t,Ee+=_*Ct,_=F[10],E+=_*Qe,w+=_*ke,T+=_*Ne,P+=_*et,H+=_*Je,oe+=_*it,j+=_*rt,X+=_*We,G+=_*lt,Z+=_*pt,ee+=_*Ke,B+=_*vt,te+=_*bt,fe+=_*tt,Ee+=_*_t,_e+=_*Ct,_=F[11],w+=_*Qe,T+=_*ke,P+=_*Ne,H+=_*et,oe+=_*Je,j+=_*it,X+=_*rt,G+=_*We,Z+=_*lt,ee+=_*pt,B+=_*Ke,te+=_*vt,fe+=_*bt,Ee+=_*tt,_e+=_*_t,Re+=_*Ct,_=F[12],T+=_*Qe,P+=_*ke,H+=_*Ne,oe+=_*et,j+=_*Je,X+=_*it,G+=_*rt,Z+=_*We,ee+=_*lt,B+=_*pt,te+=_*Ke,fe+=_*vt,Ee+=_*bt,_e+=_*tt,Re+=_*_t,Te+=_*Ct,_=F[13],P+=_*Qe,H+=_*ke,oe+=_*Ne,j+=_*et,X+=_*Je,G+=_*it,Z+=_*rt,ee+=_*We,B+=_*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,B+=_*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,B+=_*rt,te+=_*We,fe+=_*lt,Ee+=_*pt,_e+=_*Ke,Re+=_*vt,Te+=_*bt,De+=_*tt,ze+=_*_t,Xe+=_*Ct,ie+=38*j,le+=38*X,K+=38*G,k+=38*Z,R+=38*ee,v+=38*B,m+=38*te,M+=38*fe,N+=38*Ee,x+=38*_e,E+=38*Re,w+=38*Te,T+=38*De,P+=38*ze,H+=38*Xe,$=1,_=ie+$+65535,$=Math.floor(_/65536),ie=_-$*65536,_=le+$+65535,$=Math.floor(_/65536),le=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=N+$+65535,$=Math.floor(_/65536),N=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*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,_=le+$+65535,$=Math.floor(_/65536),le=_-$*65536,_=K+$+65535,$=Math.floor(_/65536),K=_-$*65536,_=k+$+65535,$=Math.floor(_/65536),k=_-$*65536,_=R+$+65535,$=Math.floor(_/65536),R=_-$*65536,_=v+$+65535,$=Math.floor(_/65536),v=_-$*65536,_=m+$+65535,$=Math.floor(_/65536),m=_-$*65536,_=M+$+65535,$=Math.floor(_/65536),M=_-$*65536,_=N+$+65535,$=Math.floor(_/65536),N=_-$*65536,_=x+$+65535,$=Math.floor(_/65536),x=_-$*65536,_=E+$+65535,$=Math.floor(_/65536),E=_-$*65536,_=w+$+65535,$=Math.floor(_/65536),w=_-$*65536,_=T+$+65535,$=Math.floor(_/65536),T=_-$*65536,_=P+$+65535,$=Math.floor(_/65536),P=_-$*65536,_=H+$+65535,$=Math.floor(_/65536),H=_-$*65536,_=oe+$+65535,$=Math.floor(_/65536),oe=_-$*65536,ie+=$-1+37*($-1),L[0]=ie,L[1]=le,L[2]=K,L[3]=k,L[4]=R,L[5]=v,L[6]=m,L[7]=M,L[8]=N,L[9]=x,L[10]=E,L[11]=w,L[12]=T,L[13]=P,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(),le=n(),K=n(),k=n(),R=n();for(let N=0;N<31;N++)z[N]=L[N];z[31]=L[31]&127|64,z[0]&=248,l(_,F);for(let N=0;N<16;N++)ie[N]=_[N];$[0]=K[0]=1;for(let N=254;N>=0;--N){const x=z[N>>>3]>>>(N&7)&1;a($,ie,x),a(le,K,x),f(k,$,le),u($,$,le),f(le,ie,K),u(ie,ie,K),g(K,k),g(R,$),p($,le,$),p(le,ie,k),f(k,$,le),u($,$,le),g(ie,$),u(le,K,R),p($,le,s),f($,$,K),p(le,le,$),p($,K,R),p(K,ie,_),g(ie,k),a($,ie,x),a(le,K,x)}for(let N=0;N<16;N++)_[N+16]=$[N],_[N+32]=le[N],_[N+48]=ie[N],_[N+64]=K[N];const v=_.subarray(32),m=_.subarray(16);y(v,v),p(m,m,v);const M=new Uint8Array(32);return c(M,m),M}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})(TM);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 Lj={...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 Fj=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={},PM={exports:{}};PM.exports;(function(t){(function(e,r){function n(K,k){if(!K)throw new Error(k||"Assertion failed")}function i(K,k){K.super_=k;var R=function(){};R.prototype=k.prototype,K.prototype=new R,K.prototype.constructor=K}function s(K,k,R){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((k==="le"||k==="be")&&(R=k,k=10),this._init(K||0,k||10,R||"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(k){return k instanceof s?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===s.wordSize&&Array.isArray(k.words)},s.max=function(k,R){return k.cmp(R)>0?k:R},s.min=function(k,R){return k.cmp(R)<0?k:R},s.prototype._init=function(k,R,v){if(typeof k=="number")return this._initNumber(k,R,v);if(typeof k=="object")return this._initArray(k,R,v);R==="hex"&&(R=16),n(R===(R|0)&&R>=2&&R<=36),k=k.toString().replace(/\s+/g,"");var m=0;k[0]==="-"&&(m++,this.negative=1),m=0;m-=3)N=k[m]|k[m-1]<<8|k[m-2]<<16,this.words[M]|=N<>>26-x&67108863,x+=24,x>=26&&(x-=26,M++);else if(v==="le")for(m=0,M=0;m>>26-x&67108863,x+=24,x>=26&&(x-=26,M++);return this.strip()};function a(K,k){var R=K.charCodeAt(k);return R>=65&&R<=70?R-55:R>=97&&R<=102?R-87:R-48&15}function c(K,k,R){var v=a(K,R);return R-1>=k&&(v|=a(K,R-1)<<4),v}s.prototype._parseHex=function(k,R,v){this.length=Math.ceil((k.length-R)/6),this.words=new Array(this.length);for(var m=0;m=R;m-=2)x=c(k,R,m)<=18?(M-=18,N+=1,this.words[N]|=x>>>26):M+=8;else{var E=k.length-R;for(m=E%2===0?R+1:R;m=18?(M-=18,N+=1,this.words[N]|=x>>>26):M+=8}this.strip()};function l(K,k,R,v){for(var m=0,M=Math.min(K.length,R),N=k;N=49?m+=x-49+10:x>=17?m+=x-17+10:m+=x}return m}s.prototype._parseBase=function(k,R,v){this.words=[0],this.length=1;for(var m=0,M=1;M<=67108863;M*=R)m++;m--,M=M/R|0;for(var N=k.length-v,x=N%m,E=Math.min(N,N-x)+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(k,R){k=k||10,R=R|0||1;var v;if(k===16||k==="hex"){v="";for(var m=0,M=0,N=0;N>>24-m&16777215,M!==0||N!==this.length-1?v=f[6-E.length]+E+v:v=E+v,m+=2,m>=26&&(m-=26,N--)}for(M!==0&&(v=M.toString(16)+v);v.length%R!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(k===(k|0)&&k>=2&&k<=36){var w=u[k],T=p[k];v="";var P=this.clone();for(P.negative=0;!P.isZero();){var H=P.modn(T).toString(k);P=P.idivn(T),P.isZero()?v=H+v:v=f[w-H.length]+H+v}for(this.isZero()&&(v="0"+v);v.length%R!==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 k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(k,R){return n(typeof o<"u"),this.toArrayLike(o,k,R)},s.prototype.toArray=function(k,R){return this.toArrayLike(Array,k,R)},s.prototype.toArrayLike=function(k,R,v){var m=this.byteLength(),M=v||Math.max(1,m);n(m<=M,"byte array longer than desired length"),n(M>0,"Requested array length <= 0"),this.strip();var N=R==="le",x=new k(M),E,w,T=this.clone();if(N){for(w=0;!T.isZero();w++)E=T.andln(255),T.iushrn(8),x[w]=E;for(;w=4096&&(v+=13,R>>>=13),R>=64&&(v+=7,R>>>=7),R>=8&&(v+=4,R>>>=4),R>=2&&(v+=2,R>>>=2),v+R},s.prototype._zeroBits=function(k){if(k===0)return 26;var R=k,v=0;return R&8191||(v+=13,R>>>=13),R&127||(v+=7,R>>>=7),R&15||(v+=4,R>>>=4),R&3||(v+=2,R>>>=2),R&1||v++,v},s.prototype.bitLength=function(){var k=this.words[this.length-1],R=this._countBits(k);return(this.length-1)*26+R};function g(K){for(var k=new Array(K.bitLength()),R=0;R>>m}return k}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,R=0;Rk.length?this.clone().ior(k):k.clone().ior(this)},s.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},s.prototype.iuand=function(k){var R;this.length>k.length?R=k:R=this;for(var v=0;vk.length?this.clone().iand(k):k.clone().iand(this)},s.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},s.prototype.iuxor=function(k){var R,v;this.length>k.length?(R=this,v=k):(R=k,v=this);for(var m=0;mk.length?this.clone().ixor(k):k.clone().ixor(this)},s.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},s.prototype.inotn=function(k){n(typeof k=="number"&&k>=0);var R=Math.ceil(k/26)|0,v=k%26;this._expand(R),v>0&&R--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-v),this.strip()},s.prototype.notn=function(k){return this.clone().inotn(k)},s.prototype.setn=function(k,R){n(typeof k=="number"&&k>=0);var v=k/26|0,m=k%26;return this._expand(v+1),R?this.words[v]=this.words[v]|1<k.length?(v=this,m=k):(v=k,m=this);for(var M=0,N=0;N>>26;for(;M!==0&&N>>26;if(this.length=v.length,M!==0)this.words[this.length]=M,this.length++;else if(v!==this)for(;Nk.length?this.clone().iadd(k):k.clone().iadd(this)},s.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var R=this.iadd(k);return k.negative=1,R._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var v=this.cmp(k);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,M;v>0?(m=this,M=k):(m=k,M=this);for(var N=0,x=0;x>26,this.words[x]=R&67108863;for(;N!==0&&x>26,this.words[x]=R&67108863;if(N===0&&x>>26,P=E&67108863,H=Math.min(w,k.length-1),oe=Math.max(0,w-K.length+1);oe<=H;oe++){var j=w-oe|0;m=K.words[j]|0,M=k.words[oe]|0,N=m*M+P,T+=N/67108864|0,P=N&67108863}R.words[w]=P|0,E=T|0}return E!==0?R.words[w]=E|0:R.length--,R.strip()}var b=function(k,R,v){var m=k.words,M=R.words,N=v.words,x=0,E,w,T,P=m[0]|0,H=P&8191,oe=P>>>13,j=m[1]|0,X=j&8191,G=j>>>13,Z=m[2]|0,ee=Z&8191,B=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=M[0]|0,tt=bt&8191,_t=bt>>>13,Ct=M[1]|0,It=Ct&8191,er=Ct>>>13,ur=M[2]|0,wt=ur&8191,lr=ur>>>13,ir=M[3]|0,Pt=ir&8191,Ot=ir>>>13,Dt=M[4]|0,dt=Dt&8191,Bt=Dt>>>13,kt=M[5]|0,ut=kt&8191,Vt=kt>>>13,zt=M[6]|0,ht=zt&8191,xt=zt>>>13,Nt=M[7]|0,Ge=Nt&8191,$t=Nt>>>13,Et=M[8]|0,ct=Et&8191,Ht=Et>>>13,Dr=M[9]|0,Ut=Dr&8191,Ir=Dr>>>13;v.negative=k.negative^R.negative,v.length=19,E=Math.imul(H,tt),w=Math.imul(H,_t),w=w+Math.imul(oe,tt)|0,T=Math.imul(oe,_t);var tr=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,E=Math.imul(X,tt),w=Math.imul(X,_t),w=w+Math.imul(G,tt)|0,T=Math.imul(G,_t),E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,E=Math.imul(ee,tt),w=Math.imul(ee,_t),w=w+Math.imul(B,tt)|0,T=Math.imul(B,_t),E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(vi>>>26)|0,vi&=67108863,E=Math.imul(fe,tt),w=Math.imul(fe,_t),w=w+Math.imul(Ee,tt)|0,T=Math.imul(Ee,_t),E=E+Math.imul(ee,It)|0,w=w+Math.imul(ee,er)|0,w=w+Math.imul(B,It)|0,T=T+Math.imul(B,er)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(gi>>>26)|0,gi&=67108863,E=Math.imul(Re,tt),w=Math.imul(Re,_t),w=w+Math.imul(Te,tt)|0,T=Math.imul(Te,_t),E=E+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,E=E+Math.imul(ee,wt)|0,w=w+Math.imul(ee,lr)|0,w=w+Math.imul(B,wt)|0,T=T+Math.imul(B,lr)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(yi>>>26)|0,yi&=67108863,E=Math.imul(ze,tt),w=Math.imul(ze,_t),w=w+Math.imul(Xe,tt)|0,T=Math.imul(Xe,_t),E=E+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,E=E+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,E=E+Math.imul(ee,Pt)|0,w=w+Math.imul(ee,Ot)|0,w=w+Math.imul(B,Pt)|0,T=T+Math.imul(B,Ot)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Si>>>26)|0,Si&=67108863,E=Math.imul(ke,tt),w=Math.imul(ke,_t),w=w+Math.imul(Ne,tt)|0,T=Math.imul(Ne,_t),E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,dt)|0,w=w+Math.imul(ee,Bt)|0,w=w+Math.imul(B,dt)|0,T=T+Math.imul(B,Bt)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(_n>>>26)|0,_n&=67108863,E=Math.imul(Je,tt),w=Math.imul(Je,_t),w=w+Math.imul(it,tt)|0,T=Math.imul(it,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,ut)|0,w=w+Math.imul(ee,Vt)|0,w=w+Math.imul(B,ut)|0,T=T+Math.imul(B,Vt)|0,E=E+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,E=E+Math.imul(H,Ge)|0,w=w+Math.imul(H,$t)|0,w=w+Math.imul(oe,Ge)|0,T=T+Math.imul(oe,$t)|0;var us=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(us>>>26)|0,us&=67108863,E=Math.imul(We,tt),w=Math.imul(We,_t),w=w+Math.imul(lt,tt)|0,T=Math.imul(lt,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,ht)|0,w=w+Math.imul(ee,xt)|0,w=w+Math.imul(B,ht)|0,T=T+Math.imul(B,xt)|0,E=E+Math.imul(X,Ge)|0,w=w+Math.imul(X,$t)|0,w=w+Math.imul(G,Ge)|0,T=T+Math.imul(G,$t)|0,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(ds>>>26)|0,ds&=67108863,E=Math.imul(Ke,tt),w=Math.imul(Ke,_t),w=w+Math.imul(vt,tt)|0,T=Math.imul(vt,_t),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(ee,Ge)|0,w=w+Math.imul(ee,$t)|0,w=w+Math.imul(B,Ge)|0,T=T+Math.imul(B,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(hs>>>26)|0,hs&=67108863,E=Math.imul(Ke,It),w=Math.imul(Ke,er),w=w+Math.imul(vt,It)|0,T=Math.imul(vt,er),E=E+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,E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(fe,Ge)|0,w=w+Math.imul(fe,$t)|0,w=w+Math.imul(Ee,Ge)|0,T=T+Math.imul(Ee,$t)|0,E=E+Math.imul(ee,ct)|0,w=w+Math.imul(ee,Ht)|0,w=w+Math.imul(B,ct)|0,T=T+Math.imul(B,Ht)|0,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,E=Math.imul(Ke,wt),w=Math.imul(Ke,lr),w=w+Math.imul(vt,wt)|0,T=Math.imul(vt,lr),E=E+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,E=E+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,E=E+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,E=E+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,E=E+Math.imul(Re,Ge)|0,w=w+Math.imul(Re,$t)|0,w=w+Math.imul(Te,Ge)|0,T=T+Math.imul(Te,$t)|0,E=E+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,E=E+Math.imul(ee,Ut)|0,w=w+Math.imul(ee,Ir)|0,w=w+Math.imul(B,Ut)|0,T=T+Math.imul(B,Ir)|0;var ps=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(ps>>>26)|0,ps&=67108863,E=Math.imul(Ke,Pt),w=Math.imul(Ke,Ot),w=w+Math.imul(vt,Pt)|0,T=Math.imul(vt,Ot),E=E+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,E=E+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,E=E+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,E=E+Math.imul(ze,Ge)|0,w=w+Math.imul(ze,$t)|0,w=w+Math.imul(Xe,Ge)|0,T=T+Math.imul(Xe,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(vs>>>26)|0,vs&=67108863,E=Math.imul(Ke,dt),w=Math.imul(Ke,Bt),w=w+Math.imul(vt,dt)|0,T=Math.imul(vt,Bt),E=E+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,E=E+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,E=E+Math.imul(ke,Ge)|0,w=w+Math.imul(ke,$t)|0,w=w+Math.imul(Ne,Ge)|0,T=T+Math.imul(Ne,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(Us>>>26)|0,Us&=67108863,E=Math.imul(Ke,ut),w=Math.imul(Ke,Vt),w=w+Math.imul(vt,ut)|0,T=Math.imul(vt,Vt),E=E+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,E=E+Math.imul(Je,Ge)|0,w=w+Math.imul(Je,$t)|0,w=w+Math.imul(it,Ge)|0,T=T+Math.imul(it,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(lo>>>26)|0,lo&=67108863,E=Math.imul(Ke,ht),w=Math.imul(Ke,xt),w=w+Math.imul(vt,ht)|0,T=Math.imul(vt,xt),E=E+Math.imul(We,Ge)|0,w=w+Math.imul(We,$t)|0,w=w+Math.imul(lt,Ge)|0,T=T+Math.imul(lt,$t)|0,E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(In>>>26)|0,In&=67108863,E=Math.imul(Ke,Ge),w=Math.imul(Ke,$t),w=w+Math.imul(vt,Ge)|0,T=Math.imul(vt,$t),E=E+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,E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(zi>>>26)|0,zi&=67108863,E=Math.imul(Ke,ct),w=Math.imul(Ke,Ht),w=w+Math.imul(vt,ct)|0,T=Math.imul(vt,Ht),E=E+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=(x+E|0)+((w&8191)<<13)|0;x=(T+(w>>>13)|0)+(fo>>>26)|0,fo&=67108863,E=Math.imul(Ke,Ut),w=Math.imul(Ke,Ir),w=w+Math.imul(vt,Ut)|0,T=Math.imul(vt,Ir);var $s=(x+E|0)+((w&8191)<<13)|0;return x=(T+(w>>>13)|0)+($s>>>26)|0,$s&=67108863,N[0]=tr,N[1]=Rr,N[2]=vi,N[3]=gi,N[4]=yi,N[5]=Si,N[6]=_n,N[7]=us,N[8]=ds,N[9]=hs,N[10]=Vi,N[11]=ps,N[12]=vs,N[13]=Us,N[14]=lo,N[15]=In,N[16]=zi,N[17]=fo,N[18]=$s,x!==0&&(N[19]=x,v.length++),v};Math.imul||(b=y);function I(K,k,R){R.negative=k.negative^K.negative,R.length=K.length+k.length;for(var v=0,m=0,M=0;M>>26)|0,m+=N>>>26,N&=67108863}R.words[M]=x,v=N,N=m}return v!==0?R.words[M]=v:R.length--,R.strip()}function C(K,k,R){var v=new S;return v.mulp(K,k,R)}s.prototype.mulTo=function(k,R){var v,m=this.length+k.length;return this.length===10&&k.length===10?v=b(this,k,R):m<63?v=y(this,k,R):m<1024?v=I(this,k,R):v=C(this,k,R),v};function S(K,k){this.x=K,this.y=k}S.prototype.makeRBT=function(k){for(var R=new Array(k),v=s.prototype._countBits(k)-1,m=0;m>=1;return m},S.prototype.permute=function(k,R,v,m,M,N){for(var x=0;x>>1)M++;return 1<>>13,v[2*N+1]=M&8191,M=M>>>13;for(N=2*R;N>=26,R+=m/67108864|0,R+=M>>>26,this.words[v]=M&67108863}return R!==0&&(this.words[v]=R,this.length++),this},s.prototype.muln=function(k){return this.clone().imuln(k)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(k){var R=g(k);if(R.length===0)return new s(1);for(var v=this,m=0;m=0);var R=k%26,v=(k-R)/26,m=67108863>>>26-R<<26-R,M;if(R!==0){var N=0;for(M=0;M>>26-R}N&&(this.words[M]=N,this.length++)}if(v!==0){for(M=this.length-1;M>=0;M--)this.words[M+v]=this.words[M];for(M=0;M=0);var m;R?m=(R-R%26)/26:m=0;var M=k%26,N=Math.min((k-M)/26,this.length),x=67108863^67108863>>>M<N)for(this.length-=N,w=0;w=0&&(T!==0||w>=m);w--){var P=this.words[w]|0;this.words[w]=T<<26-M|P>>>M,T=P&x}return E&&T!==0&&(E.words[E.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(k,R,v){return n(this.negative===0),this.iushrn(k,R,v)},s.prototype.shln=function(k){return this.clone().ishln(k)},s.prototype.ushln=function(k){return this.clone().iushln(k)},s.prototype.shrn=function(k){return this.clone().ishrn(k)},s.prototype.ushrn=function(k){return this.clone().iushrn(k)},s.prototype.testn=function(k){n(typeof k=="number"&&k>=0);var R=k%26,v=(k-R)/26,m=1<=0);var R=k%26,v=(k-R)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(R!==0&&v++,this.length=Math.min(v,this.length),R!==0){var m=67108863^67108863>>>R<=67108864;R++)this.words[R]-=67108864,R===this.length-1?this.words[R+1]=1:this.words[R+1]++;return this.length=Math.max(this.length,R+1),this},s.prototype.isubn=function(k){if(n(typeof k=="number"),n(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var R=0;R>26)-(E/67108864|0),this.words[M+v]=N&67108863}for(;M>26,this.words[M+v]=N&67108863;if(x===0)return this.strip();for(n(x===-1),x=0,M=0;M>26,this.words[M]=N&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(k,R){var v=this.length-k.length,m=this.clone(),M=k,N=M.words[M.length-1]|0,x=this._countBits(N);v=26-x,v!==0&&(M=M.ushln(v),m.iushln(v),N=M.words[M.length-1]|0);var E=m.length-M.length,w;if(R!=="mod"){w=new s(null),w.length=E+1,w.words=new Array(w.length);for(var T=0;T=0;H--){var oe=(m.words[M.length+H]|0)*67108864+(m.words[M.length+H-1]|0);for(oe=Math.min(oe/N|0,67108863),m._ishlnsubmul(M,oe,H);m.negative!==0;)oe--,m.negative=0,m._ishlnsubmul(M,1,H),m.isZero()||(m.negative^=1);w&&(w.words[H]=oe)}return w&&w.strip(),m.strip(),R!=="div"&&v!==0&&m.iushrn(v),{div:w||null,mod:m}},s.prototype.divmod=function(k,R,v){if(n(!k.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,M,N;return this.negative!==0&&k.negative===0?(N=this.neg().divmod(k,R),R!=="mod"&&(m=N.div.neg()),R!=="div"&&(M=N.mod.neg(),v&&M.negative!==0&&M.iadd(k)),{div:m,mod:M}):this.negative===0&&k.negative!==0?(N=this.divmod(k.neg(),R),R!=="mod"&&(m=N.div.neg()),{div:m,mod:N.mod}):this.negative&k.negative?(N=this.neg().divmod(k.neg(),R),R!=="div"&&(M=N.mod.neg(),v&&M.negative!==0&&M.isub(k)),{div:N.div,mod:M}):k.length>this.length||this.cmp(k)<0?{div:new s(0),mod:this}:k.length===1?R==="div"?{div:this.divn(k.words[0]),mod:null}:R==="mod"?{div:null,mod:new s(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new s(this.modn(k.words[0]))}:this._wordDiv(k,R)},s.prototype.div=function(k){return this.divmod(k,"div",!1).div},s.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},s.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},s.prototype.divRound=function(k){var R=this.divmod(k);if(R.mod.isZero())return R.div;var v=R.div.negative!==0?R.mod.isub(k):R.mod,m=k.ushrn(1),M=k.andln(1),N=v.cmp(m);return N<0||M===1&&N===0?R.div:R.div.negative!==0?R.div.isubn(1):R.div.iaddn(1)},s.prototype.modn=function(k){n(k<=67108863);for(var R=(1<<26)%k,v=0,m=this.length-1;m>=0;m--)v=(R*v+(this.words[m]|0))%k;return v},s.prototype.idivn=function(k){n(k<=67108863);for(var R=0,v=this.length-1;v>=0;v--){var m=(this.words[v]|0)+R*67108864;this.words[v]=m/k|0,R=m%k}return this.strip()},s.prototype.divn=function(k){return this.clone().idivn(k)},s.prototype.egcd=function(k){n(k.negative===0),n(!k.isZero());var R=this,v=k.clone();R.negative!==0?R=R.umod(k):R=R.clone();for(var m=new s(1),M=new s(0),N=new s(0),x=new s(1),E=0;R.isEven()&&v.isEven();)R.iushrn(1),v.iushrn(1),++E;for(var w=v.clone(),T=R.clone();!R.isZero();){for(var P=0,H=1;!(R.words[0]&H)&&P<26;++P,H<<=1);if(P>0)for(R.iushrn(P);P-- >0;)(m.isOdd()||M.isOdd())&&(m.iadd(w),M.isub(T)),m.iushrn(1),M.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;)(N.isOdd()||x.isOdd())&&(N.iadd(w),x.isub(T)),N.iushrn(1),x.iushrn(1);R.cmp(v)>=0?(R.isub(v),m.isub(N),M.isub(x)):(v.isub(R),N.isub(m),x.isub(M))}return{a:N,b:x,gcd:v.iushln(E)}},s.prototype._invmp=function(k){n(k.negative===0),n(!k.isZero());var R=this,v=k.clone();R.negative!==0?R=R.umod(k):R=R.clone();for(var m=new s(1),M=new s(0),N=v.clone();R.cmpn(1)>0&&v.cmpn(1)>0;){for(var x=0,E=1;!(R.words[0]&E)&&x<26;++x,E<<=1);if(x>0)for(R.iushrn(x);x-- >0;)m.isOdd()&&m.iadd(N),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;)M.isOdd()&&M.iadd(N),M.iushrn(1);R.cmp(v)>=0?(R.isub(v),m.isub(M)):(v.isub(R),M.isub(m))}var P;return R.cmpn(1)===0?P=m:P=M,P.cmpn(0)<0&&P.iadd(k),P},s.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var R=this.clone(),v=k.clone();R.negative=0,v.negative=0;for(var m=0;R.isEven()&&v.isEven();m++)R.iushrn(1),v.iushrn(1);do{for(;R.isEven();)R.iushrn(1);for(;v.isEven();)v.iushrn(1);var M=R.cmp(v);if(M<0){var N=R;R=v,v=N}else if(M===0||v.cmpn(1)===0)break;R.isub(v)}while(!0);return v.iushln(m)},s.prototype.invm=function(k){return this.egcd(k).a.umod(k)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(k){return this.words[0]&k},s.prototype.bincn=function(k){n(typeof k=="number");var R=k%26,v=(k-R)/26,m=1<>>26,x&=67108863,this.words[N]=x}return M!==0&&(this.words[N]=M,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(k){var R=k<0;if(this.negative!==0&&!R)return-1;if(this.negative===0&&R)return 1;this.strip();var v;if(this.length>1)v=1;else{R&&(k=-k),n(k<=67108863,"Number is too big");var m=this.words[0]|0;v=m===k?0:mk.length)return 1;if(this.length=0;v--){var m=this.words[v]|0,M=k.words[v]|0;if(m!==M){mM&&(R=1);break}}return R},s.prototype.gtn=function(k){return this.cmpn(k)===1},s.prototype.gt=function(k){return this.cmp(k)===1},s.prototype.gten=function(k){return this.cmpn(k)>=0},s.prototype.gte=function(k){return this.cmp(k)>=0},s.prototype.ltn=function(k){return this.cmpn(k)===-1},s.prototype.lt=function(k){return this.cmp(k)===-1},s.prototype.lten=function(k){return this.cmpn(k)<=0},s.prototype.lte=function(k){return this.cmp(k)<=0},s.prototype.eqn=function(k){return this.cmpn(k)===0},s.prototype.eq=function(k){return this.cmp(k)===0},s.red=function(k){return new ie(k)},s.prototype.toRed=function(k){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(k){return this.red=k,this},s.prototype.forceRed=function(k){return n(!this.red,"Already a number in reduction context"),this._forceRed(k)},s.prototype.redAdd=function(k){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},s.prototype.redIAdd=function(k){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},s.prototype.redSub=function(k){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},s.prototype.redISub=function(k){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},s.prototype.redShl=function(k){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},s.prototype.redMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},s.prototype.redIMul=function(k){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},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(k){return n(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var O={k256:null,p224:null,p192:null,p25519:null};function L(K,k){this.name=K,this.p=new s(k,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 k=new s(null);return k.words=new Array(Math.ceil(this.n/13)),k},L.prototype.ireduce=function(k){var R=k,v;do this.split(R,this.tmp),R=this.imulK(R),R=R.iadd(this.tmp),v=R.bitLength();while(v>this.n);var m=v0?R.isub(this.p):R.strip!==void 0?R.strip():R._strip(),R},L.prototype.split=function(k,R){k.iushrn(this.n,0,R)},L.prototype.imulK=function(k){return k.imul(this.k)};function F(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,L),F.prototype.split=function(k,R){for(var v=4194303,m=Math.min(k.length,9),M=0;M>>22,N=x}N>>>=22,k.words[M-10]=N,N===0&&k.length>10?k.length-=10:k.length-=9},F.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var R=0,v=0;v>>=26,k.words[v]=M,R=m}return R!==0&&(k.words[k.length++]=R),k},s._prime=function(k){if(O[k])return O[k];var R;if(k==="k256")R=new F;else if(k==="p224")R=new z;else if(k==="p192")R=new _;else if(k==="p25519")R=new $;else throw new Error("Unknown prime "+k);return O[k]=R,R};function ie(K){if(typeof K=="string"){var k=s._prime(K);this.m=k.p,this.prime=k}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ie.prototype._verify1=function(k){n(k.negative===0,"red works only with positives"),n(k.red,"red works only with red numbers")},ie.prototype._verify2=function(k,R){n((k.negative|R.negative)===0,"red works only with positives"),n(k.red&&k.red===R.red,"red works only with red numbers")},ie.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},ie.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},ie.prototype.add=function(k,R){this._verify2(k,R);var v=k.add(R);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(k,R){this._verify2(k,R);var v=k.iadd(R);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(k,R){this._verify2(k,R);var v=k.sub(R);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(k,R){this._verify2(k,R);var v=k.isub(R);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(k,R){return this._verify1(k),this.imod(k.ushln(R))},ie.prototype.imul=function(k,R){return this._verify2(k,R),this.imod(k.imul(R))},ie.prototype.mul=function(k,R){return this._verify2(k,R),this.imod(k.mul(R))},ie.prototype.isqr=function(k){return this.imul(k,k.clone())},ie.prototype.sqr=function(k){return this.mul(k,k)},ie.prototype.sqrt=function(k){if(k.isZero())return k.clone();var R=this.m.andln(3);if(n(R%2===1),R===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(k,v)}for(var m=this.m.subn(1),M=0;!m.isZero()&&m.andln(1)===0;)M++,m.iushrn(1);n(!m.isZero());var N=new s(1).toRed(this),x=N.redNeg(),E=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,E).cmp(x)!==0;)w.redIAdd(x);for(var T=this.pow(w,m),P=this.pow(k,m.addn(1).iushrn(1)),H=this.pow(k,m),oe=M;H.cmp(N)!==0;){for(var j=H,X=0;j.cmp(N)!==0;X++)j=j.redSqr();n(X=0;M--){for(var T=R.words[M],P=w-1;P>=0;P--){var H=T>>P&1;if(N!==m[0]&&(N=this.sqr(N)),H===0&&x===0){E=0;continue}x<<=1,x|=H,E++,!(E!==v&&(M!==0||P!==0))&&(N=this.mul(N,m[x]),E=0,x=0)}w=26}return N},ie.prototype.convertTo=function(k){var R=k.umod(this.m);return R===k?R.clone():R},ie.prototype.convertFrom=function(k){var R=k.clone();return R.red=null,R},s.mont=function(k){return new le(k)};function le(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(le,ie),le.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},le.prototype.convertFrom=function(k){var R=this.imod(k.mul(this.rinv));return R.red=null,R},le.prototype.imul=function(k,R){if(k.isZero()||R.isZero())return k.words[0]=0,k.length=1,k;var v=k.imul(R),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),N=M;return M.cmp(this.m)>=0?N=M.isub(this.m):M.cmpn(0)<0&&(N=M.iadd(this.m)),N._forceRed(this)},le.prototype.mul=function(k,R){if(k.isZero()||R.isZero())return new s(0)._forceRed(this);var v=k.mul(R),m=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=v.isub(m).iushrn(this.shift),N=M;return M.cmp(this.m)>=0?N=M.isub(this.m):M.cmpn(0)<0&&(N=M.iadd(this.m)),N._forceRed(this)},le.prototype.invm=function(k){var R=this.imod(k._invmp(this.m).mul(this.r2));return R._forceRed(this)}})(t,Ei)})(PM);var Ou=PM.exports,kM={};(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 MM={exports:{}},U9;MM.exports=function(e){return U9||(U9=new Ld(null)),U9.generate(e)};function Ld(t){this.rand=t}MM.exports.Rand=Ld;Ld.prototype.generate=function(e){return this._rand(e)};Ld.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}OM(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 mv=Ou,gee=nE,hE=dE,tPe=ma;function Fy(t){hE.call(this,"mont",t),this.a=new mv(t.a,16).toRed(this.red),this.b=new mv(t.b,16).toRed(this.red),this.i4=new mv(4).toRed(this.red).redInvm(),this.two=new mv(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 mv(e,16),this.z=new mv(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=Ou,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})(RM);var vE={},$9,Uj;function oPe(){return Uj||(Uj=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=RM,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=kM,mee=Qp;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=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=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=yp.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var X5=Ou,DM=ma,dPe=DM.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 $j(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=$j(r),n=$j(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),DM.encode(o,e)};var eu=Ou,bee=cPe,vPe=ma,z9=vE,gPe=vee,wee=vPe.assert,NM=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 NM(this,e)};tc.prototype.keyFromPrivate=function(e,r){return NM.fromPrivate(this,e,r)};tc.prototype.keyFromPublic=function(e,r){return NM.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,qj=Nx.parseBytes,jy=Nx.cachedProperty;function Li(t,e){this.eddsa=t,this._secret=qj(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=qj(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=Ou,mE=ma,Vj=mE.assert,bE=mE.cachedProperty,wPe=mE.parseBytes;function Zp(t,e){this.eddsa=t,typeof e!="object"&&(e=wPe(e)),Array.isArray(e)&&(Vj(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Vj(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(Zp,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});bE(Zp,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});bE(Zp,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});bE(Zp,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Zp.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Zp.prototype.toHex=function(){return mE.encode(this.toBytes(),"hex").toUpperCase()};var xPe=Zp,EPe=kx,CPe=vE,fy=ma,APe=fy.assert,Eee=fy.parseBytes,Cee=mPe,zj=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],le=f[4],K=f[5],k=f[6],R=f[7],v,m,M,N,x,E,w,T;g>=128;){for(var P=0;P<16;P++){var H=8*P+p;a[P]=e.readUint32BE(u,H),c[P]=e.readUint32BE(u,H+4)}for(var P=0;P<80;P++){var oe=y,j=b,X=I,G=C,Z=S,ee=O,B=L,te=F,fe=z,Ee=_,_e=$,Re=ie,Te=le,De=K,ze=k,Xe=R;if(v=F,m=R,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=(S>>>14|le<<18)^(S>>>18|le<<14)^(le>>>9|S<<23),m=(le>>>14|S<<18)^(le>>>18|S<<14)^(S>>>9|le<<23),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=S&O^~S&L,m=le&K^~le&k,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=i[P*2],m=i[P*2+1],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=a[P%16],m=c[P%16],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,M=w&65535|T<<16,N=x&65535|E<<16,v=M,m=N,x=m&65535,E=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),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,v=y&b^y&I^b&I,m=z&_^z&$^_&$,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,te=w&65535|T<<16,Xe=x&65535|E<<16,v=G,m=Re,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=M,m=N,x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,G=w&65535|T<<16,Re=x&65535|E<<16,b=oe,I=j,C=X,S=G,O=Z,L=ee,F=B,y=te,_=fe,$=Ee,ie=_e,le=Re,K=Te,k=De,R=ze,z=Xe,P%16===15)for(var H=0;H<16;H++)v=a[H],m=c[H],x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=a[(H+9)%16],m=c[(H+9)%16],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+1)%16],N=c[(H+1)%16],v=(M>>>1|N<<31)^(M>>>8|N<<24)^M>>>7,m=(N>>>1|M<<31)^(N>>>8|M<<24)^(N>>>7|M<<25),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,M=a[(H+14)%16],N=c[(H+14)%16],v=(M>>>19|N<<13)^(N>>>29|M<<3)^M>>>6,m=(N>>>19|M<<13)^(M>>>29|N<<3)^(N>>>6|M<<26),x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,a[H]=w&65535|T<<16,c[H]=x&65535|E<<16}v=y,m=z,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[0],m=f[0],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[0]=y=w&65535|T<<16,f[0]=z=x&65535|E<<16,v=b,m=_,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[1],m=f[1],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[1]=b=w&65535|T<<16,f[1]=_=x&65535|E<<16,v=I,m=$,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[2],m=f[2],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[2]=I=w&65535|T<<16,f[2]=$=x&65535|E<<16,v=C,m=ie,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[3],m=f[3],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[3]=C=w&65535|T<<16,f[3]=ie=x&65535|E<<16,v=S,m=le,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[4],m=f[4],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[4]=S=w&65535|T<<16,f[4]=le=x&65535|E<<16,v=O,m=K,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[5],m=f[5],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[5]=O=w&65535|T<<16,f[5]=K=x&65535|E<<16,v=L,m=k,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[6],m=f[6],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[6]=L=w&65535|T<<16,f[6]=k=x&65535|E<<16,v=F,m=R,x=m&65535,E=m>>>16,w=v&65535,T=v>>>16,v=l[7],m=f[7],x+=m&65535,E+=m>>>16,w+=v&65535,T+=v>>>16,E+=x>>>16,w+=E>>>16,T+=w>>>16,l[7]=F=w&65535|T<<16,f[7]=R=x&65535|E<<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]=B[15]-32767-(ee[14]>>16&1);const fe=ee[15]>>16&1;ee[14]&=65535,b(B,ee,1-fe)}for(let te=0;te<16;te++)G[2*te]=B[te]&255,G[2*te+1]=B[te]>>8}function C(G,Z){let ee=0;for(let B=0;B<32;B++)ee|=G[B]^Z[B];return(1&ee-1>>>8)-1}function S(G,Z){const ee=new Uint8Array(32),B=new Uint8Array(32);return I(ee,G),I(B,Z),C(ee,B)}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 B=0;B<16;B++)G[B]=Z[B]+ee[B]}function z(G,Z,ee){for(let B=0;B<16;B++)G[B]=Z[B]-ee[B]}function _(G,Z,ee){let B,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],Ge=ee[11],$t=ee[12],Et=ee[13],ct=ee[14],Ht=ee[15];B=Z[0],fe+=B*Ot,Ee+=B*Dt,_e+=B*dt,Re+=B*Bt,Te+=B*kt,De+=B*ut,ze+=B*Vt,Xe+=B*zt,Qe+=B*ht,ke+=B*xt,Ne+=B*Nt,et+=B*Ge,Je+=B*$t,it+=B*Et,rt+=B*ct,We+=B*Ht,B=Z[1],Ee+=B*Ot,_e+=B*Dt,Re+=B*dt,Te+=B*Bt,De+=B*kt,ze+=B*ut,Xe+=B*Vt,Qe+=B*zt,ke+=B*ht,Ne+=B*xt,et+=B*Nt,Je+=B*Ge,it+=B*$t,rt+=B*Et,We+=B*ct,lt+=B*Ht,B=Z[2],_e+=B*Ot,Re+=B*Dt,Te+=B*dt,De+=B*Bt,ze+=B*kt,Xe+=B*ut,Qe+=B*Vt,ke+=B*zt,Ne+=B*ht,et+=B*xt,Je+=B*Nt,it+=B*Ge,rt+=B*$t,We+=B*Et,lt+=B*ct,pt+=B*Ht,B=Z[3],Re+=B*Ot,Te+=B*Dt,De+=B*dt,ze+=B*Bt,Xe+=B*kt,Qe+=B*ut,ke+=B*Vt,Ne+=B*zt,et+=B*ht,Je+=B*xt,it+=B*Nt,rt+=B*Ge,We+=B*$t,lt+=B*Et,pt+=B*ct,Ke+=B*Ht,B=Z[4],Te+=B*Ot,De+=B*Dt,ze+=B*dt,Xe+=B*Bt,Qe+=B*kt,ke+=B*ut,Ne+=B*Vt,et+=B*zt,Je+=B*ht,it+=B*xt,rt+=B*Nt,We+=B*Ge,lt+=B*$t,pt+=B*Et,Ke+=B*ct,vt+=B*Ht,B=Z[5],De+=B*Ot,ze+=B*Dt,Xe+=B*dt,Qe+=B*Bt,ke+=B*kt,Ne+=B*ut,et+=B*Vt,Je+=B*zt,it+=B*ht,rt+=B*xt,We+=B*Nt,lt+=B*Ge,pt+=B*$t,Ke+=B*Et,vt+=B*ct,bt+=B*Ht,B=Z[6],ze+=B*Ot,Xe+=B*Dt,Qe+=B*dt,ke+=B*Bt,Ne+=B*kt,et+=B*ut,Je+=B*Vt,it+=B*zt,rt+=B*ht,We+=B*xt,lt+=B*Nt,pt+=B*Ge,Ke+=B*$t,vt+=B*Et,bt+=B*ct,tt+=B*Ht,B=Z[7],Xe+=B*Ot,Qe+=B*Dt,ke+=B*dt,Ne+=B*Bt,et+=B*kt,Je+=B*ut,it+=B*Vt,rt+=B*zt,We+=B*ht,lt+=B*xt,pt+=B*Nt,Ke+=B*Ge,vt+=B*$t,bt+=B*Et,tt+=B*ct,_t+=B*Ht,B=Z[8],Qe+=B*Ot,ke+=B*Dt,Ne+=B*dt,et+=B*Bt,Je+=B*kt,it+=B*ut,rt+=B*Vt,We+=B*zt,lt+=B*ht,pt+=B*xt,Ke+=B*Nt,vt+=B*Ge,bt+=B*$t,tt+=B*Et,_t+=B*ct,Ct+=B*Ht,B=Z[9],ke+=B*Ot,Ne+=B*Dt,et+=B*dt,Je+=B*Bt,it+=B*kt,rt+=B*ut,We+=B*Vt,lt+=B*zt,pt+=B*ht,Ke+=B*xt,vt+=B*Nt,bt+=B*Ge,tt+=B*$t,_t+=B*Et,Ct+=B*ct,It+=B*Ht,B=Z[10],Ne+=B*Ot,et+=B*Dt,Je+=B*dt,it+=B*Bt,rt+=B*kt,We+=B*ut,lt+=B*Vt,pt+=B*zt,Ke+=B*ht,vt+=B*xt,bt+=B*Nt,tt+=B*Ge,_t+=B*$t,Ct+=B*Et,It+=B*ct,er+=B*Ht,B=Z[11],et+=B*Ot,Je+=B*Dt,it+=B*dt,rt+=B*Bt,We+=B*kt,lt+=B*ut,pt+=B*Vt,Ke+=B*zt,vt+=B*ht,bt+=B*xt,tt+=B*Nt,_t+=B*Ge,Ct+=B*$t,It+=B*Et,er+=B*ct,ur+=B*Ht,B=Z[12],Je+=B*Ot,it+=B*Dt,rt+=B*dt,We+=B*Bt,lt+=B*kt,pt+=B*ut,Ke+=B*Vt,vt+=B*zt,bt+=B*ht,tt+=B*xt,_t+=B*Nt,Ct+=B*Ge,It+=B*$t,er+=B*Et,ur+=B*ct,wt+=B*Ht,B=Z[13],it+=B*Ot,rt+=B*Dt,We+=B*dt,lt+=B*Bt,pt+=B*kt,Ke+=B*ut,vt+=B*Vt,bt+=B*zt,tt+=B*ht,_t+=B*xt,Ct+=B*Nt,It+=B*Ge,er+=B*$t,ur+=B*Et,wt+=B*ct,lr+=B*Ht,B=Z[14],rt+=B*Ot,We+=B*Dt,lt+=B*dt,pt+=B*Bt,Ke+=B*kt,vt+=B*ut,bt+=B*Vt,tt+=B*zt,_t+=B*ht,Ct+=B*xt,It+=B*Nt,er+=B*Ge,ur+=B*$t,wt+=B*Et,lr+=B*ct,ir+=B*Ht,B=Z[15],We+=B*Ot,lt+=B*Dt,pt+=B*dt,Ke+=B*Bt,vt+=B*kt,bt+=B*ut,tt+=B*Vt,_t+=B*zt,Ct+=B*ht,It+=B*xt,er+=B*Nt,ur+=B*Ge,wt+=B*$t,lr+=B*Et,ir+=B*ct,Pt+=B*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,B=fe+te+65535,te=Math.floor(B/65536),fe=B-te*65536,B=Ee+te+65535,te=Math.floor(B/65536),Ee=B-te*65536,B=_e+te+65535,te=Math.floor(B/65536),_e=B-te*65536,B=Re+te+65535,te=Math.floor(B/65536),Re=B-te*65536,B=Te+te+65535,te=Math.floor(B/65536),Te=B-te*65536,B=De+te+65535,te=Math.floor(B/65536),De=B-te*65536,B=ze+te+65535,te=Math.floor(B/65536),ze=B-te*65536,B=Xe+te+65535,te=Math.floor(B/65536),Xe=B-te*65536,B=Qe+te+65535,te=Math.floor(B/65536),Qe=B-te*65536,B=ke+te+65535,te=Math.floor(B/65536),ke=B-te*65536,B=Ne+te+65535,te=Math.floor(B/65536),Ne=B-te*65536,B=et+te+65535,te=Math.floor(B/65536),et=B-te*65536,B=Je+te+65535,te=Math.floor(B/65536),Je=B-te*65536,B=it+te+65535,te=Math.floor(B/65536),it=B-te*65536,B=rt+te+65535,te=Math.floor(B/65536),rt=B-te*65536,B=We+te+65535,te=Math.floor(B/65536),We=B-te*65536,fe+=te-1+37*(te-1),te=1,B=fe+te+65535,te=Math.floor(B/65536),fe=B-te*65536,B=Ee+te+65535,te=Math.floor(B/65536),Ee=B-te*65536,B=_e+te+65535,te=Math.floor(B/65536),_e=B-te*65536,B=Re+te+65535,te=Math.floor(B/65536),Re=B-te*65536,B=Te+te+65535,te=Math.floor(B/65536),Te=B-te*65536,B=De+te+65535,te=Math.floor(B/65536),De=B-te*65536,B=ze+te+65535,te=Math.floor(B/65536),ze=B-te*65536,B=Xe+te+65535,te=Math.floor(B/65536),Xe=B-te*65536,B=Qe+te+65535,te=Math.floor(B/65536),Qe=B-te*65536,B=ke+te+65535,te=Math.floor(B/65536),ke=B-te*65536,B=Ne+te+65535,te=Math.floor(B/65536),Ne=B-te*65536,B=et+te+65535,te=Math.floor(B/65536),et=B-te*65536,B=Je+te+65535,te=Math.floor(B/65536),Je=B-te*65536,B=it+te+65535,te=Math.floor(B/65536),it=B-te*65536,B=rt+te+65535,te=Math.floor(B/65536),rt=B-te*65536,B=We+te+65535,te=Math.floor(B/65536),We=B-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 B;for(B=0;B<16;B++)ee[B]=Z[B];for(B=253;B>=0;B--)$(ee,ee),B!==2&&B!==4&&_(ee,ee,Z);for(B=0;B<16;B++)G[B]=ee[B]}function le(G,Z){const ee=i();let B;for(B=0;B<16;B++)ee[B]=Z[B];for(B=250;B>=0;B--)$(ee,ee),B!==1&&_(ee,ee,Z);for(B=0;B<16;B++)G[B]=ee[B]}function K(G,Z){const ee=i(),B=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(B,G[0],G[1]),F(De,Z[0],Z[1]),_(B,B,De),_(te,G[3],Z[3]),_(te,te,l),_(fe,G[2],Z[2]),F(fe,fe,fe),z(Ee,B,ee),z(_e,fe,te),F(Re,fe,te),F(Te,B,ee),_(G[0],Ee,_e),_(G[1],Te,Re),_(G[2],Re,_e),_(G[3],Ee,Te)}function k(G,Z,ee){for(let B=0;B<4;B++)b(G[B],Z[B],ee)}function R(G,Z){const ee=i(),B=i(),te=i();ie(te,Z[2]),_(ee,Z[0],te),_(B,Z[1],te),I(G,B),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 B=255;B>=0;--B){const te=ee[B/8|0]>>(B&7)&1;k(G,Z,te),K(Z,G),K(G,G),k(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 M(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),B=[i(),i(),i(),i()];m(B,Z),R(ee,B);const te=new Uint8Array(64);return te.set(G),te.set(ee,32),{publicKey:ee,secretKey:te}}t.generateKeyPairFromSeed=M;function N(G){const Z=(0,e.randomBytes)(32,G),ee=M(Z);return(0,n.wipe)(Z),ee}t.generateKeyPair=N;function x(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=x;const E=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,B,te,fe;for(B=63;B>=32;--B){for(ee=0,te=B-32,fe=B-12;te>4)*E[te],ee=Z[te]>>8,Z[te]&=255;for(te=0;te<32;te++)Z[te]-=ee*E[te];for(B=0;B<32;B++)Z[B+1]+=Z[B]>>8,G[B]=Z[B]&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 P(G,Z){const ee=new Float64Array(64),B=[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(B,_e),R(fe,B),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=P;function H(G,Z){const ee=i(),B=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),le(ee,ee),_(ee,ee,te),_(ee,ee,fe),_(ee,ee,fe),_(G[0],ee,fe),$(B,G[0]),_(B,B,fe),S(B,te)&&_(G[0],G[0],p),$(B,G[0]),_(B,B,fe),S(B,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 B=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),R(B,te),!C(ee,B)}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(),B=i(),te=Z[1];F(ee,a,te),z(B,a,te),ie(B,B),_(ee,ee,B);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})(BM);const _Pe="EdDSA",IPe="JWT",e4=".",wE="base64url",See="utf8",_ee="utf8",TPe=":",PPe="did",kPe="key",Hj="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 Gj(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,Hj),r=MPe+Bi(_3([e,t]),Hj);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 fI(t){const e=t.split(e4),r=Gj(e[0]),n=Gj(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 Wj(t=Oh.randomBytes(OPe)){return BM.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=BM.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 Hv(t){const[e,r]=t.split(VPe);return{namespace:e,reference:r}}function Kj(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,Yj=Object.getOwnPropertySymbols,HPe=Object.prototype.hasOwnProperty,GPe=Object.prototype.propertyIsEnumerable,Qj=(t,e,r)=>e in t?zPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jj=(t,e)=>{for(var r in e||(e={}))HPe.call(e,r)&&Qj(t,r,e[r]);if(Yj)for(var r of Yj(e))GPe.call(e,r)&&Qj(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()&&!!yM()&&navigator.product===WPe}function Bx(){return!r4()&&!!yM()&&!!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=Jj(Jj({},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 Gv(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 fd(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 Zj(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Xj(){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 LM(){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=Hv(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,eU=Object.getOwnPropertySymbols,vke=Object.prototype.hasOwnProperty,gke=Object.prototype.propertyIsEnumerable,tU=(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)&&tU(t,r,e[r]);if(eU)for(var r of eU(e))gke.call(e,r)&&tU(t,r,e[r]);return t},mke=(t,e)=>hke(t,pke(e));const bke="did:pkh:",FM=t=>t==null?void 0:t.split(":"),wke=t=>{const e=t&&FM(t);if(e)return t.includes(bke)?e[3]:e[1]},uI=t=>{const e=t&&FM(t);if(e)return e[2]+":"+e[3]},n4=t=>{const e=t&&FM(t);if(e)return e.pop()};async function rU(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,uI(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 rU(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 nU(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",Fd="base64pad",Dm="base64url",Fx="utf8",jee=0,cu=1,jx=2,kke=0,iU=1,Nb=12,FM=32;function Mke(){const t=IM.generateKeyPair();return{privateKey:Bi(t.secretKey,no),publicKey:Bi(t.publicKey,no)}}function dI(){const t=Oh.randomBytes(FM);return Bi(t,no)}function Rke(t,e){const r=IM.sharedKey(Di(t,no),Di(e,no),!0),n=new RIe(Rx.SHA256,r).expand(FM);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 SM.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 SM.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=Fd}=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=Fd}=t,n=Di(e,r),i=n.slice(kke,iU),s=iU;if(jp(i)===cu){const l=s+FM,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 sU(t){return t.type===cu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function oU(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 fI(t).payload}const qke="irn";function hI(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,aU=Object.getOwnPropertySymbols,Gke=Object.prototype.hasOwnProperty,Wke=Object.prototype.propertyIsEnumerable,cU=(t,e,r)=>e in t?Vke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lU=(t,e)=>{for(var r in e||(e={}))Gke.call(e,r)&&cU(t,r,e[r]);if(aU)for(var r of aU(e))Wke.call(e,r)&&cU(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 fU(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 uU(t){return`${t.protocol}:${t.topic}@${t.version}?`+Tw.stringify(lU(Kke(lU({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 jM(t){return t.includes(":")}function cb(t){return jM(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 dU(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 UM(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 hU(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 hU(t==null?void 0:t.methods)?hU(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||!UM(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)||!UM(t.id)||!ri(t.jsonrpc,!1))}function xMe(t){return!(Po(t)||!ri(t.name,!1))}function pU(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 vU(t,e,r){let n=null;const i=AMe(t),s=SMe(e),o=Object.keys(i),a=Object.keys(s),c=gU(Object.keys(t)),l=gU(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. +`)};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 nU(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 iU(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",Fd="base64pad",Dm="base64url",Fx="utf8",jee=0,cu=1,jx=2,kke=0,sU=1,Nb=12,jM=32;function Mke(){const t=TM.generateKeyPair();return{privateKey:Bi(t.secretKey,no),publicKey:Bi(t.publicKey,no)}}function dI(){const t=Oh.randomBytes(jM);return Bi(t,no)}function Rke(t,e){const r=TM.sharedKey(Di(t,no),Di(e,no),!0),n=new RIe(Rx.SHA256,r).expand(jM);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 _M.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 _M.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=Fd}=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=Fd}=t,n=Di(e,r),i=n.slice(kke,sU),s=sU;if(jp(i)===cu){const l=s+jM,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 oU(t){return t.type===cu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function aU(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 fI(t).payload}const qke="irn";function hI(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,cU=Object.getOwnPropertySymbols,Gke=Object.prototype.hasOwnProperty,Wke=Object.prototype.propertyIsEnumerable,lU=(t,e,r)=>e in t?Vke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fU=(t,e)=>{for(var r in e||(e={}))Gke.call(e,r)&&lU(t,r,e[r]);if(cU)for(var r of cU(e))Wke.call(e,r)&&lU(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 uU(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 dU(t){return`${t.protocol}:${t.topic}@${t.version}?`+Tw.stringify(fU(Kke(fU({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 UM(t){return t.includes(":")}function cb(t){return UM(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 hU(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 $M(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 pU(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 pU(t==null?void 0:t.methods)?pU(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||!$M(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)||!$M(t.id)||!ri(t.jsonrpc,!1))}function xMe(t){return!(Po(t)||!ri(t.name,!1))}function vU(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 gU(t,e,r){let n=null;const i=AMe(t),s=SMe(e),o=Object.keys(i),a=Object.keys(s),c=yU(Object.keys(t)),l=yU(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=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=$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=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 gU(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 UM(t)&&t<=e.max&&t>=e.min}function yU(){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 mU=at.FIVE_SECONDS,qy={pulse:"heartbeat_pulse"};let DMe=class Hee extends OMe{constructor(e){super(e),this.events=new va.EventEmitter,this.interval=mU,this.interval=(e==null?void 0:e.interval)||mU}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 pI="base64:";function VMe(t){if(typeof t=="string")return t;Gee();const e=Buffer.from(t).toString("base64");return pI+e}function zMe(t){return typeof t!="string"||!t.startsWith(pI)?t:(Gee(),Buffer.from(t.slice(pI.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 bU(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=>wU(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(bU(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 wU(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 bU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function wU(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 xU(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 xU(r(i),n)>"u")},async getItem(i){return await xU(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",EU=1,cRe=async(t,e,r)=>{const n=aRe,i=await e.getItem(n);if(i&&i>=EU){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,EU),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=vI());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=vI([].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=$M){this.level=e??"error",this.levelValue=W1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new AU(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 AU(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=$M){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=$M){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,SU=Object.getOwnPropertySymbols,MRe=Object.prototype.hasOwnProperty,RRe=Object.prototype.propertyIsEnumerable,_U=(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)&&_U(t,r,e[r]);if(SU)for(var r of SU(e))RRe.call(e,r)&&_U(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",qM="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"},[qM]:{code:-32e3,message:"Server error"}},Zee=qM;function nOe(t){return rOe.includes(t)}function IU(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={},TU;function sOe(){if(TU)return Ef;TU=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={},PU;function oOe(){if(PU)return Cf;PU=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 ud(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(ud(t))}function jd(t,e,r){return{id:r||ud(),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"?IU(Jee):(typeof t=="string"&&(t=Object.assign(Object.assign({},IU(qM)),{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 kU(t){return tte(t,uOe)}function MU(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 VM(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(jd(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",RU=t=>t.split("?")[0],OU=10,yOe=vOe();let mOe=class{constructor(e){if(this.url=e,this.events=new va.EventEmitter,this.registering=!1,!MU(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(!MU(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,RU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>OU&&this.events.setMaxListeners(OU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${RU(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]",le="[object WeakMap]",K="[object ArrayBuffer]",k="[object DataView]",R="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",x="[object Uint8Array]",E="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",P=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[R]=j[v]=j[m]=j[M]=j[N]=j[x]=j[E]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[k]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[z]=j[_]=j[le]=!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,B=ee&&!0&&t&&!t.nodeType&&t,te=B&&B.exports===ee,fe=te&&X.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Re(ce,xe){for(var qe=-1,gt=ce==null?0:ce.length,tn=0,rr=[];++qe-1}function Si(ce,xe){var qe=this.__data__,gt=rf(qe,ce);return gt<0?(++this.size,qe.push([ce,xe])):qe[gt][1]=xe,this}tr.prototype.clear=Rr,tr.prototype.delete=vi,tr.prototype.get=gi,tr.prototype.has=yi,tr.prototype.set=Si;function _n(ce){var xe=-1,qe=ce==null?0:ce.length;for(this.clear();++xeUn))return!1;var rn=rr.get(ce);if(rn&&rr.get(xe))return rn==xe;var pn=-1,gs=!0,Pn=qe&s?new vs:void 0;for(rr.set(ce,xe),rr.set(xe,ce);++pn-1&&ce%1==0&&ce-1&&ce%1==0&&ce<=o}function Uh(ce){var xe=typeof ce;return ce!=null&&(xe=="object"||xe=="function")}function lf(ce){return ce!=null&&typeof ce=="object"}var f1=_e?Xe(_e):Bh;function zy(ce){return $o(ce)?r1(ce):i1(ce)}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,zM="core",Jl=`${nte}@2:${zM}:`,xOe={name:zM,logger:"error"},EOe={database:":memory:"},COe="crypto",DU="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,gI="2.17.2",vn={link_mode:"link_mode",relay:"relay"},NOe="0.3",BOe="WALLETCONNECT_CLIENT_ID",NU="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,BU=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|BU,t/=128;for(;t&XDe;)e[r++]=t&255|BU,t>>>=7;return e[r]=t|0,ute.bytes=r-n+1,e}var tNe=yI,rNe=128,LU=127;function yI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw yI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&LU)<=rNe);return yI.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),jU=t=>dte.encodingLength(t),mI=(t,e)=>{const r=e.byteLength,n=jU(t),i=n+jU(r),s=new Uint8Array(i+r);return FU(t,s,0),FU(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?mI(this.code,r):r.then(n=>mI(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=>mI(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 UU={...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 $U=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=dI(),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=Gj(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=Gj(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(oU(a))return Dke(c,o==null?void 0:o.encoding);if(sU(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(oU(a)){const c=Bke(s,o==null?void 0:o.encoding);return Lp(c)}if(sU(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=Fd)=>{const o=kw({encoded:i,encoding:s});return jp(o.type)},this.getPayloadSenderPublicKey=(i,s=Fd)=>{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(DU)}catch{e=dI(),await this.keychain.set(DU,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=hI(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,qU=Object.getOwnPropertySymbols,DNe=Object.prototype.hasOwnProperty,NNe=Object.prototype.propertyIsEnumerable,VU=(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)&&VU(t,r,e[r]);if(qU)for(var r of qU(e))NNe.call(e,r)&&VU(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=hI(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=hI(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,zU=Object.getOwnPropertySymbols,FNe=Object.prototype.hasOwnProperty,jNe=Object.prototype.propertyIsEnumerable,HU=(t,e,r)=>e in t?LNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GU=(t,e)=>{for(var r in e||(e={}))FNe.call(e,r)&&HU(t,r,e[r]);if(zU)for(var r of zU(e))jNe.call(e,r)&&HU(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,GU({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 yU())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:gI,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}),VM(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(GU({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 yU();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,WU=Object.getOwnPropertySymbols,qNe=Object.prototype.hasOwnProperty,VNe=Object.prototype.propertyIsEnumerable,KU=(t,e,r)=>e in t?$Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,YU=(t,e)=>{for(var r in e||(e={}))qNe.call(e,r)&&KU(t,r,e[r]);if(WU)for(var r of WU(e))VNe.call(e,r)&&KU(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=YU(YU({},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 vM,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=dI(),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=uU({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}=fU(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 uU({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=jd(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=>fd(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=fU(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(fd(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{VM(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:jd(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(fI(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(fI(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,QU=Object.getOwnPropertySymbols,QNe=Object.prototype.hasOwnProperty,JNe=Object.prototype.propertyIsEnumerable,JU=(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)&&JU(t,r,e[r]);if(QU)for(var r of QU(e))JNe.call(e,r)&&JU(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(!BM())try{const i={eventId:Zj(),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,gI)}}};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=Zj(),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-${gI}${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,ZU=Object.getOwnPropertySymbols,eBe=Object.prototype.hasOwnProperty,tBe=Object.prototype.propertyIsEnumerable,XU=(t,e,r)=>e in t?XNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e$=(t,e)=>{for(var r in e||(e={}))eBe.call(e,r)&&XU(t,r,e[r]);if(ZU)for(var r of ZU(e))tBe.call(e,r)&&XU(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=zM,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(e$(e$({},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(NU,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(NU)||[],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",HM=`${bte}@${wte}:${xte}:`,Z9={name:xte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},t$="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,r$=Object.getOwnPropertySymbols,yBe=Object.prototype.hasOwnProperty,mBe=Object.prototype.propertyIsEnumerable,n$=(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)&&n$(t,r,e[r]);if(r$)for(var r of r$(e))mBe.call(e,r)&&n$(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 vM,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=ud(),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=ud(),{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=ud(),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,t$);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=ud(),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:x}=zv(a[0]);let E=Ske(x,"request",b);T3(C)&&(E=Ike(E,C.pop())),C.push(E)}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:le,resolve:K,reject:k}=y0(z,"Request expired"),R=async({error:x,session:E})=>{if(this.events.off(Ar("session_request",m),v),x)k(x);else if(E){E.self.publicKey=L,await this.client.session.set(E.topic,E),await this.setExpiry(E.topic,E.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:E.peer.metadata});const w=this.client.session.get(E.topic);await this.deleteProposal(M),K({session:w})}},v=async x=>{var E,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),x.error){const Z=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return x.error.code===Z.code?void 0:(this.events.off(Ar("session_connect"),R),k(x.error.message))}await this.deleteProposal(M),this.events.off(Ar("session_connect"),R);const{cacaos:P,responder:H}=x.result,oe=[],j=[];for(const Z of P){await tU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),k(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ee}=Z,B=T3(ee.resources),te=[uI(ee.iss)],fe=n4(ee.iss);if(B){const Ee=rU(B),_e=nU(B);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:dU([...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)),(E=this.client.metadata.redirect)!=null&&E.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:P,session:G})},m=ud(),M=ud();this.events.once(Ar("session_connect"),R),this.events.once(Ar("session_request",m),v);let N;try{if(s){const x=jd("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,x);const E=await this.client.core.crypto.encode("",x,{type:jx,encoding:Dm});N=S6(n,S,E)}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:M})])}catch(x){throw this.events.off(Ar("session_connect"),R),this.events.off(Ar("session_request",m),v),x}return await this.setProposal(M,Vn({id:M},ie)),await this.setAuthRequest(m,{request:xc(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:N??O,response:le}},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 tU({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=[uI(C.iss)],L=n4(C.iss);if(S){const F=rU(S),z=nU(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:dU([...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(t$).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=jd(i,s,c);let p;const g=!!f;try{const I=g?Dm:Fd;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:Fd;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:Fd;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;fd(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=>{fd(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(jd("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:jd("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=vU(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(fd(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=vU(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(!pU(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(!pU(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=Jj(r,"topic")||"",i=decodeURIComponent(Jj(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(BM()||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:Fd});try{VM(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(fd(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(fd(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(fd(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,HM),this.core=e,this.logger=r}}let xBe=class extends e1{constructor(e,r){super(e,r,sBe,HM),this.core=e,this.logger=r}};class EBe extends e1{constructor(e,r){super(e,r,aBe,HM,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:{}};/** + 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 yU(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 $M(t)&&t<=e.max&&t>=e.min}function mU(){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 Xp{}let OMe=class extends Xp{constructor(e){super()}};const bU=at.FIVE_SECONDS,qy={pulse:"heartbeat_pulse"};let DMe=class Hee extends OMe{constructor(e){super(e),this.events=new va.EventEmitter,this.interval=bU,this.interval=(e==null?void 0:e.interval)||bU}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 pI="base64:";function VMe(t){if(typeof t=="string")return t;Gee();const e=Buffer.from(t).toString("base64");return pI+e}function zMe(t){return typeof t!="string"||!t.startsWith(pI)?t:(Gee(),Buffer.from(t.slice(pI.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 wU(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=>xU(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(wU(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 xU(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 wU(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function xU(t){typeof t.dispose=="function"&&await Ti(t.dispose)}function e1(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=e1(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 EU(t,e=Ux()){return e("readonly",r=>e1(r.get(t)))}function YMe(t,e,r=Ux()){return r("readwrite",n=>(n.put(e,t),e1(n.transaction)))}function QMe(t,e=Ux()){return e("readwrite",r=>(r.delete(t),e1(r.transaction)))}function JMe(t=Ux()){return t("readwrite",e=>(e.clear(),e1(e.transaction)))}function ZMe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},e1(t.transaction)}function XMe(t=Ux()){return t("readonly",e=>{if(e.getAllKeys)return e1(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 EU(r(i),n)>"u")},async getItem(i){return await EU(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",CU=1,cRe=async(t,e,r)=>{const n=aRe,i=await e.getItem(n);if(i&&i>=CU){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,CU),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=vI());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,$1(l,c,"error","log"),$1(l,c,"fatal","error"),$1(l,c,"warn","error"),$1(l,c,"info","log"),$1(l,c,"debug","log"),$1(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=q1(L,y,"error"),this.fatal=q1(L,y,"fatal"),this.warn=q1(L,y,"warn"),this.info=q1(L,y,"info"),this.debug=q1(L,y,"debug"),this.trace=q1(L,y,"trace"),C&&(this.serializers=C,this._serialize=S),e&&(this._logEvent=vI([].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 $1(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 q1(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=qM){this.level=e??"error",this.levelValue=K1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new SU(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===K1.levels.values.error?console.error(e):r===K1.levels.values.warn?console.warn(e):r===K1.levels.values.debug?console.debug(e):r===K1.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 SU(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=qM){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=qM){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,_U=Object.getOwnPropertySymbols,MRe=Object.prototype.hasOwnProperty,RRe=Object.prototype.propertyIsEnumerable,IU=(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)&&IU(t,r,e[r]);if(_U)for(var r of _U(e))RRe.call(e,r)&&IU(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 Xp{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},URe=class extends Xp{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 Xp{constructor(e,r){super(),this.relayer=e,this.logger=r}},VRe=class extends Xp{constructor(e){super()}},zRe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},HRe=class extends Xp{constructor(e,r){super(),this.relayer=e,this.logger=r}},GRe=class extends Xp{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",VM="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"},[VM]:{code:-32e3,message:"Server error"}},Zee=VM;function nOe(t){return rOe.includes(t)}function TU(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={},PU;function sOe(){if(PU)return Ef;PU=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={},kU;function oOe(){if(kU)return Cf;kU=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 ud(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(ud(t))}function jd(t,e,r){return{id:r||ud(),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"?TU(Jee):(typeof t=="string"&&(t=Object.assign(Object.assign({},TU(VM)),{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 MU(t){return tte(t,uOe)}function RU(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 zM(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(jd(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",OU=t=>t.split("?")[0],DU=10,yOe=vOe();let mOe=class{constructor(e){if(this.url=e,this.events=new va.EventEmitter,this.registering=!1,!RU(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(!RU(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,OU(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>DU&&this.events.setMaxListeners(DU)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${OU(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]",le="[object WeakMap]",K="[object ArrayBuffer]",k="[object DataView]",R="[object Float32Array]",v="[object Float64Array]",m="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",x="[object Uint8Array]",E="[object Uint8ClampedArray]",w="[object Uint16Array]",T="[object Uint32Array]",P=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,j={};j[R]=j[v]=j[m]=j[M]=j[N]=j[x]=j[E]=j[w]=j[T]=!0,j[a]=j[c]=j[K]=j[f]=j[k]=j[u]=j[p]=j[g]=j[b]=j[I]=j[S]=j[F]=j[z]=j[_]=j[le]=!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,B=ee&&!0&&t&&!t.nodeType&&t,te=B&&B.exports===ee,fe=te&&X.process,Ee=function(){try{return fe&&fe.binding&&fe.binding("util")}catch{}}(),_e=Ee&&Ee.isTypedArray;function Re(ce,xe){for(var qe=-1,gt=ce==null?0:ce.length,tn=0,rr=[];++qe-1}function Si(ce,xe){var qe=this.__data__,gt=rf(qe,ce);return gt<0?(++this.size,qe.push([ce,xe])):qe[gt][1]=xe,this}tr.prototype.clear=Rr,tr.prototype.delete=vi,tr.prototype.get=gi,tr.prototype.has=yi,tr.prototype.set=Si;function _n(ce){var xe=-1,qe=ce==null?0:ce.length;for(this.clear();++xeUn))return!1;var rn=rr.get(ce);if(rn&&rr.get(xe))return rn==xe;var pn=-1,gs=!0,Pn=qe&s?new vs:void 0;for(rr.set(ce,xe),rr.set(xe,ce);++pn-1&&ce%1==0&&ce-1&&ce%1==0&&ce<=o}function Uh(ce){var xe=typeof ce;return ce!=null&&(xe=="object"||xe=="function")}function lf(ce){return ce!=null&&typeof ce=="object"}var u1=_e?Xe(_e):Bh;function zy(ce){return $o(ce)?n1(ce):s1(ce)}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,HM="core",Jl=`${nte}@2:${HM}:`,xOe={name:HM,logger:"error"},EOe={database:":memory:"},COe="crypto",NU="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,gI="2.17.2",vn={link_mode:"link_mode",relay:"relay"},NOe="0.3",BOe="WALLETCONNECT_CLIENT_ID",BU="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,LU=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|LU,t/=128;for(;t&XDe;)e[r++]=t&255|LU,t>>>=7;return e[r]=t|0,ute.bytes=r-n+1,e}var tNe=yI,rNe=128,FU=127;function yI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw yI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&FU)<=rNe);return yI.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),UU=t=>dte.encodingLength(t),mI=(t,e)=>{const r=e.byteLength,n=UU(t),i=n+UU(r),s=new Uint8Array(i+r);return jU(t,s,0),jU(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?mI(this.code,r):r.then(n=>mI(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=>mI(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 $U={...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 qU=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=dI(),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=Wj(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=Wj(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(aU(a))return Dke(c,o==null?void 0:o.encoding);if(oU(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(aU(a)){const c=Bke(s,o==null?void 0:o.encoding);return Lp(c)}if(oU(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=Fd)=>{const o=kw({encoded:i,encoding:s});return jp(o.type)},this.getPayloadSenderPublicKey=(i,s=Fd)=>{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(NU)}catch{e=dI(),await this.keychain.set(NU,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=hI(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 Gv(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,VU=Object.getOwnPropertySymbols,DNe=Object.prototype.hasOwnProperty,NNe=Object.prototype.propertyIsEnumerable,zU=(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)&&zU(t,r,e[r]);if(VU)for(var r of VU(e))NNe.call(e,r)&&zU(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=hI(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=hI(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 Gv(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 Gv(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 Gv(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,HU=Object.getOwnPropertySymbols,FNe=Object.prototype.hasOwnProperty,jNe=Object.prototype.propertyIsEnumerable,GU=(t,e,r)=>e in t?LNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,WU=(t,e)=>{for(var r in e||(e={}))FNe.call(e,r)&&GU(t,r,e[r]);if(HU)for(var r of HU(e))jNe.call(e,r)&&GU(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,WU({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 Gv(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 Gv(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 mU())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:gI,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}),zM(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(WU({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 mU();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,KU=Object.getOwnPropertySymbols,qNe=Object.prototype.hasOwnProperty,VNe=Object.prototype.propertyIsEnumerable,YU=(t,e,r)=>e in t?$Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QU=(t,e)=>{for(var r in e||(e={}))qNe.call(e,r)&&YU(t,r,e[r]);if(KU)for(var r of KU(e))VNe.call(e,r)&&YU(t,r,e[r]);return t};class t1 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=QU(QU({},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 gM,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=dI(),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=dU({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}=uU(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 dU({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=jd(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=>fd(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=uU(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(fd(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 t1(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{zM(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:jd(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(fI(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(fI(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,JU=Object.getOwnPropertySymbols,QNe=Object.prototype.hasOwnProperty,JNe=Object.prototype.propertyIsEnumerable,ZU=(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)&&ZU(t,r,e[r]);if(JU)for(var r of JU(e))JNe.call(e,r)&&ZU(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(!LM())try{const i={eventId:Xj(),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,gI)}}};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=Xj(),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-${gI}${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,XU=Object.getOwnPropertySymbols,eBe=Object.prototype.hasOwnProperty,tBe=Object.prototype.propertyIsEnumerable,e$=(t,e,r)=>e in t?XNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,t$=(t,e)=>{for(var r in e||(e={}))eBe.call(e,r)&&e$(t,r,e[r]);if(XU)for(var r of XU(e))tBe.call(e,r)&&e$(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=HM,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(t$(t$({},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(BU,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(BU)||[],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",GM=`${bte}@${wte}:${xte}:`,Z9={name:xte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},r$="WALLETCONNECT_DEEPLINK_CHOICE",iBe="proposal",Ete="Proposal expired",sBe="session",V1=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,n$=Object.getOwnPropertySymbols,yBe=Object.prototype.hasOwnProperty,mBe=Object.prototype.propertyIsEnumerable,i$=(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)&&i$(t,r,e[r]);if(n$)for(var r of n$(e))mBe.call(e,r)&&i$(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 gM,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(V1)},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(V1)),{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=ud(),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=ud(),{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(V1)),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=ud(),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,r$);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=ud(),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:x}=Hv(a[0]);let E=Ske(x,"request",b);T3(C)&&(E=Ike(E,C.pop())),C.push(E)}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:le,resolve:K,reject:k}=y0(z,"Request expired"),R=async({error:x,session:E})=>{if(this.events.off(Ar("session_request",m),v),x)k(x);else if(E){E.self.publicKey=L,await this.client.session.set(E.topic,E),await this.setExpiry(E.topic,E.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:E.peer.metadata});const w=this.client.session.get(E.topic);await this.deleteProposal(M),K({session:w})}},v=async x=>{var E,w,T;if(await this.deletePendingAuthRequest(m,{message:"fulfilled",code:0}),x.error){const Z=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return x.error.code===Z.code?void 0:(this.events.off(Ar("session_connect"),R),k(x.error.message))}await this.deleteProposal(M),this.events.off(Ar("session_connect"),R);const{cacaos:P,responder:H}=x.result,oe=[],j=[];for(const Z of P){await rU({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),k(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ee}=Z,B=T3(ee.resources),te=[uI(ee.iss)],fe=n4(ee.iss);if(B){const Ee=nU(B),_e=iU(B);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(V1),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:hU([...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)),(E=this.client.metadata.redirect)!=null&&E.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:P,session:G})},m=ud(),M=ud();this.events.once(Ar("session_connect"),R),this.events.once(Ar("session_request",m),v);let N;try{if(s){const x=jd("wc_sessionAuthenticate",_,m);this.client.core.history.set(S,x);const E=await this.client.core.crypto.encode("",x,{type:jx,encoding:Dm});N=S6(n,S,E)}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:M})])}catch(x){throw this.events.off(Ar("session_connect"),R),this.events.off(Ar("session_request",m),v),x}return await this.setProposal(M,Vn({id:M},ie)),await this.setAuthRequest(m,{request:xc(Vn({},_),{verifyContext:{}}),pairingTopic:S,transportType:o}),{uri:N??O,response:le}},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 rU({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=[uI(C.iss)],L=n4(C.iss);if(S){const F=nU(S),z=iU(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(V1),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:hU([...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(r$).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=jd(i,s,c);let p;const g=!!f;try{const I=g?Dm:Fd;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:Fd;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:Fd;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;fd(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=>{fd(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(V1)),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(jd("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:jd("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=gU(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(fd(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=gU(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(!vU(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(!vU(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=>Hv(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Hv(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=Zj(r,"topic")||"",i=decodeURIComponent(Zj(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(LM()||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:Fd});try{zM(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(fd(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(fd(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(fd(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 t1{constructor(e,r){super(e,r,iBe,GM),this.core=e,this.logger=r}}let xBe=class extends t1{constructor(e,r){super(e,r,sBe,GM),this.core=e,this.logger=r}};class EBe extends t1{constructor(e,r){super(e,r,aBe,GM,n=>n.id),this.core=e,this.logger=r}}class CBe extends t1{constructor(e,r){super(e,r,uBe,IE,()=>R3),this.core=e,this.logger=r}}class ABe extends t1{constructor(e,r){super(e,r,dBe,IE),this.core=e,this.logger=r}}class SBe extends t1{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 - */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,le=30,K="...",k=800,R=16,v=1,m=2,M=3,N=1/0,x=9007199254740991,E=17976931348623157e292,w=NaN,T=4294967295,P=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]",B="[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+/,Ge=/\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+",Du="["+lo+"]",Bh="["+In+"]",i1="[^"+hs+rf+n1+lo+In+Jc+"]",cc="\\ud83c[\\udffb-\\udfff]",s1="(?:"+of+"|"+cc+")",gr="[^"+hs+"]",Nu="(?:\\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))?",Bu=s1+"?",c1="["+r1+"]?",Fh="(?:"+o1+"(?:"+[gr,Nu,Zc].join("|")+")"+c1+Bu+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l1=c1+Bu+Fh,Xc="(?:"+[Du,Nu,Zc].join("|")+")"+l1,$o="(?:"+[gr+of+"?",of,Nu,Zc,sf].join("|")+")",cf=RegExp(nf,"g"),Vy=RegExp(of,"g"),Lu=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 ce={À:"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"},xe={"&":"&","<":"<",">":">",'"':""","'":"'"},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 we=pn&&pn.require&&pn.require("util").types;return we||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(we,Oe,Pe){switch(Pe.length){case 0:return we.call(Oe);case 1:return we.call(Oe,Pe[0]);case 2:return we.call(Oe,Pe[0],Pe[1]);case 3:return we.call(Oe,Pe[0],Pe[1],Pe[2])}return we.apply(Oe,Pe)}function RE(we,Oe,Pe,mt){for(var Zt=-1,Lr=we==null?0:we.length;++Zt-1}function Hy(we,Oe,Pe){for(var mt=-1,Zt=we==null?0:we.length;++mt-1;);return Pe}function Qx(we,Oe){for(var Pe=we.length;Pe--&&Fu(Oe,we[Pe],0)>-1;);return Pe}function $E(we,Oe){for(var Pe=we.length,mt=0;Pe--;)we[Pe]===Oe&&++mt;return mt}var qE=Ky(ce),VE=Ky(xe);function zE(we){return"\\"+gt[we]}function HE(we,Oe){return we==null?r:we[Oe]}function Yr(we){return Uh.test(we)}function Jx(we){return lf.test(we)}function fc(we){for(var Oe,Pe=[];!(Oe=we.next()).done;)Pe.push(Oe.value);return Pe}function zh(we){var Oe=-1,Pe=Array(we.size);return we.forEach(function(mt,Zt){Pe[++Oe]=[Zt,mt]}),Pe}function Jy(we,Oe){return function(Pe){return we(Oe(Pe))}}function nr(we,Oe){for(var Pe=-1,mt=we.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(Qu(d))return TR(d,ye);if(Ve==De||Ve==j||ft&&!J){if(he=Ce||ft?{}:WR(d),!ye)return Ce?bne(d,qre(he,d)):mne(d,iR(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),EO(d)?d.forEach(function(Yt){he.add(xa(Yt,h,A,Yt,d,se))}):wO(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 sR(A,d,h)}}function sR(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 oR(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:AO(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=DR(),lR=DR(!0);function nl(d,h){return d&&iC(d,h,_i)}function sC(d,h){return d&&lR(d,h,_i)}function f2(d,h){return el(h,function(A){return bf(d[A])})}function Zh(d,h){h=Ku(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 wR(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>x)return A;do h%2&&(A+=d),h=Ae(h/2),h&&(d+=d);while(h);return A}function yr(d,h){return kC(QR(d,h,bo),d+"")}function cne(d){return nR(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=Ku(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 IR=ae||function(d){return Er.clearTimeout(d)};function TR(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 PR(d,h){var A=h?bC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function kR(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 MR(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 LR(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,`{ + */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,le=30,K="...",k=800,R=16,v=1,m=2,M=3,N=1/0,x=9007199254740991,E=17976931348623157e292,w=NaN,T=4294967295,P=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]",B="[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+/,Ge=/\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",n1="\\ufe0e\\ufe0f",rf=zi+fo+$s+tf,nf="['’]",sf="["+hs+"]",Nh="["+rf+"]",of="["+Us+"]",i1="\\d+",Du="["+lo+"]",Bh="["+In+"]",s1="[^"+hs+rf+i1+lo+In+Jc+"]",cc="\\ud83c[\\udffb-\\udfff]",o1="(?:"+of+"|"+cc+")",gr="[^"+hs+"]",Nu="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+Jc+"]",a1="\\u200d",Lh="(?:"+Bh+"|"+s1+")",Uo="(?:"+xn+"|"+s1+")",af="(?:"+nf+"(?:d|ll|m|re|s|t|ve))?",c1="(?:"+nf+"(?:D|LL|M|RE|S|T|VE))?",Bu=o1+"?",l1="["+n1+"]?",Fh="(?:"+a1+"(?:"+[gr,Nu,Zc].join("|")+")"+l1+Bu+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",f1=l1+Bu+Fh,Xc="(?:"+[Du,Nu,Zc].join("|")+")"+f1,$o="(?:"+[gr+of+"?",of,Nu,Zc,sf].join("|")+")",cf=RegExp(nf,"g"),Vy=RegExp(of,"g"),Lu=RegExp(cc+"(?="+cc+")|"+$o+f1,"g"),uo=RegExp([xn+"?"+Bh+"+"+af+"(?="+[Nh,xn,"$"].join("|")+")",Uo+"+"+c1+"(?="+[Nh,xn+Lh,"$"].join("|")+")",xn+"?"+Lh+"+"+af,xn+"+"+c1,jh,lc,i1,Xc].join("|"),"g"),Uh=RegExp("["+a1+hs+Us+n1+"]"),lf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,u1=["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 ce={À:"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"},xe={"&":"&","<":"<",">":">",'"':""","'":"'"},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 we=pn&&pn.require&&pn.require("util").types;return we||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(we,Oe,Pe){switch(Pe.length){case 0:return we.call(Oe);case 1:return we.call(Oe,Pe[0]);case 2:return we.call(Oe,Pe[0],Pe[1]);case 3:return we.call(Oe,Pe[0],Pe[1],Pe[2])}return we.apply(Oe,Pe)}function RE(we,Oe,Pe,mt){for(var Zt=-1,Lr=we==null?0:we.length;++Zt-1}function Hy(we,Oe,Pe){for(var mt=-1,Zt=we==null?0:we.length;++mt-1;);return Pe}function Qx(we,Oe){for(var Pe=we.length;Pe--&&Fu(Oe,we[Pe],0)>-1;);return Pe}function $E(we,Oe){for(var Pe=we.length,mt=0;Pe--;)we[Pe]===Oe&&++mt;return mt}var qE=Ky(ce),VE=Ky(xe);function zE(we){return"\\"+gt[we]}function HE(we,Oe){return we==null?r:we[Oe]}function Yr(we){return Uh.test(we)}function Jx(we){return lf.test(we)}function fc(we){for(var Oe,Pe=[];!(Oe=we.next()).done;)Pe.push(Oe.value);return Pe}function zh(we){var Oe=-1,Pe=Array(we.size);return we.forEach(function(mt,Zt){Pe[++Oe]=[Zt,mt]}),Pe}function Jy(we,Oe){return function(Pe){return we(Oe(Pe))}}function nr(we,Oe){for(var Pe=-1,mt=we.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(Qu(d))return PR(d,ye);if(Ve==De||Ve==j||ft&&!J){if(he=Ce||ft?{}:KR(d),!ye)return Ce?bne(d,qre(he,d)):mne(d,sR(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),CO(d)?d.forEach(function(Yt){he.add(xa(Yt,h,A,Yt,d,se))}):xO(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 oR(A,d,h)}}function oR(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 aR(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=d1,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:SO(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=NR(),fR=NR(!0);function nl(d,h){return d&&iC(d,h,_i)}function sC(d,h){return d&&fR(d,h,_i)}function f2(d,h){return el(h,function(A){return bf(d[A])})}function Zh(d,h){h=Ku(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 xR(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>x)return A;do h%2&&(A+=d),h=Ae(h/2),h&&(d+=d);while(h);return A}function yr(d,h){return kC(JR(d,h,bo),d+"")}function cne(d){return iR(T1(d))}function lne(d,h){var A=T1(d);return x2(A,Jh(h,0,A.length))}function om(d,h,A,U){if(!Mn(d))return d;h=Ku(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 TR=ae||function(d){return Er.clearTimeout(d)};function PR(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 w1(h).set(new w1(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 kR(d,h){var A=h?bC(d.buffer):d.buffer;return new d.constructor(A,d.byteOffset,d.length)}function MR(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 RR(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 FR(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 sr(d)||t0(d)||!!(em&&d&&d[em])}function mf(d,h){var A=typeof d;return h=h??x,!!h&&(A=="number"||A!="symbol"&&Si.test(d))&&d>-1&&d%1==0&&d0){if(++h>=k)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,cO(d,A)});function lO(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 lO(this)}function Wie(){return new wa(this.value(),this.__chain__)}function Kie(){this.__values__===r&&(this.__values__=CO(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=rO(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 SR(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:cR;return A(d,Wt(h,3))}var rse=BR(nO),nse=BR(iO);function ise(d,h){return Gi(C2(d,h),1)}function sse(d,h){return Gi(C2(d,h),N)}function ose(d,h,A){return A=A===r?1:hr(A),Gi(C2(d,h),A)}function fO(d,h){var A=sr(d)?ho:Gu;return A(d,Wt(h,3))}function uO(d,h){var A=sr(d)?OE:aR;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&&Fu(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 Gu(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:pR;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]),mR(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,Gu)}function pse(d,h,A){var U=sr(d)?DE:Kx,J=arguments.length<3;return U(d,Wt(h,4),A,J,aR)}function vse(d,h){var A=sr(d)?el:cR;return A(d,_2(Wt(h,3)))}function gse(d){var h=sr(d)?nR: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]]),mR(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 dO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,gf(d,_,r,r,r,r,h)}function hO(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)}),pO=yr(function(d,h,A){var U=I|C;if(A.length){var J=nr(A,S1(pO));U|=F}return gf(h,U,d,A,J)});function vO(d,h,A){h=A?r:h;var U=gf(d,O,r,r,r,r,r,h);return U.placeholder=vO.placeholder,U}function gO(d,h,A){h=A?r:h;var U=gf(d,L,r,r,r,r,r,h);return U.placeholder=gO.placeholder,U}function yO(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,BO=h-pc;return Ve?dr(BO,se-xf):BO}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&&IR(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 IR(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 oR(d,1,h)}),Ase=yr(function(d,h,A){return oR(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 hO(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=uR(function(){return arguments}())?uR: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 Qu=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"||Qu(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==B||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 bO(d){return typeof d=="number"&&d==hr(d)}function I2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=x}function Mn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var wO=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 xO(d)&&d!=+d}function Xse(d){if(Bne(d))throw new Zt(s);return dR(d)}function eoe(d){return d===null}function toe(d){return d==null}function xO(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 bO(d)&&d>=-x&&d<=x}var EO=$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 CO(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===N||d===-N){var h=d<0?-1:1;return h*E}return d===d?d:0}function hr(d){var h=wf(d),A=h%1;return h===h?A?h-A:h:0}function AO(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=ju(d);var A=vi.test(d);return A||yi.test(d)?rr(d.slice(2),A?2:8):Rr.test(d)?w:+d}function SO(d){return il(d,mo(d))}function coe(d){return d?Jh(hr(d),-x,x):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])}),_O=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:iR(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 TO(d,_2(Wt(h)))}var Roe=yf(function(d,h){return d==null?{}:sne(d,h)});function TO(d,h){if(d==null)return{};var A=fn(CC(d),function(U){return[U]});return h=Wt(h),bR(d,A,function(U,J){return h(U,J[0])})}function Ooe(d,h,A){h=Ku(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?MO(h):h)});function MO(d){return jC(Qr(d).toLowerCase())}function RO(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=NR("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))?Yu(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,qR);var J=P2({},h.imports,U.imports,qR),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+"]")+` +`)}function One(d){return sr(d)||t0(d)||!!(em&&d&&d[em])}function mf(d,h){var A=typeof d;return h=h??x,!!h&&(A=="number"||A!="symbol"&&Si.test(d))&&d>-1&&d%1==0&&d0){if(++h>=k)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,lO(d,A)});function fO(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 fO(this)}function Wie(){return new wa(this.value(),this.__chain__)}function Kie(){this.__values__===r&&(this.__values__=AO(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=nO(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 _R(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:lR;return A(d,Wt(h,3))}var rse=LR(iO),nse=LR(sO);function ise(d,h){return Gi(C2(d,h),1)}function sse(d,h){return Gi(C2(d,h),N)}function ose(d,h,A){return A=A===r?1:hr(A),Gi(C2(d,h),A)}function uO(d,h){var A=sr(d)?ho:Gu;return A(d,Wt(h,3))}function dO(d,h){var A=sr(d)?OE:cR;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:T1(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&&Fu(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 Gu(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:vR;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]),bR(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,Gu)}function pse(d,h,A){var U=sr(d)?DE:Kx,J=arguments.length<3;return U(d,Wt(h,4),A,J,cR)}function vse(d,h){var A=sr(d)?el:lR;return A(d,_2(Wt(h,3)))}function gse(d){var h=sr(d)?iR: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)?h1: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]]),bR(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 hO(d,h,A){return h=A?r:h,h=d&&h==null?d.length:h,gf(d,_,r,r,r,r,h)}function pO(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,_1(OC));U|=F}return gf(d,U,h,A,J)}),vO=yr(function(d,h,A){var U=I|C;if(A.length){var J=nr(A,_1(vO));U|=F}return gf(h,U,d,A,J)});function gO(d,h,A){h=A?r:h;var U=gf(d,O,r,r,r,r,r,h);return U.placeholder=gO.placeholder,U}function yO(d,h,A){h=A?r:h;var U=gf(d,L,r,r,r,r,r,h);return U.placeholder=yO.placeholder,U}function mO(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,LO=h-pc;return Ve?dr(LO,se-xf):LO}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&&TR(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 TR(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 aR(d,1,h)}),Ase=yr(function(d,h,A){return aR(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 pO(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=dR(function(){return arguments}())?dR: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 Qu=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"||Qu(d)||I1(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==B||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 wO(d){return typeof d=="number"&&d==hr(d)}function I2(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=x}function Mn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function qn(d){return d!=null&&typeof d=="object"}var xO=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 EO(d)&&d!=+d}function Xse(d){if(Bne(d))throw new Zt(s);return hR(d)}function eoe(d){return d===null}function toe(d){return d==null}function EO(d){return typeof d=="number"||qn(d)&&Hs(d)==Re}function fm(d){if(!qn(d)||Hs(d)!=De)return!1;var h=x1(d);if(h===null)return!0;var A=Gr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&y1.call(A)==XE}var BC=ba?Vs(ba):ene;function roe(d){return wO(d)&&d>=-x&&d<=x}var CO=$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 I1=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 AO(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:T1;return A(d)}function wf(d){if(!d)return d===0?d:0;if(d=Aa(d),d===N||d===-N){var h=d<0?-1:1;return h*E}return d===d?d:0}function hr(d){var h=wf(d),A=h%1;return h===h?A?h-A:h:0}function SO(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=ju(d);var A=vi.test(d);return A||yi.test(d)?rr(d.slice(2),A?2:8):Rr.test(d)?w:+d}function _O(d){return il(d,mo(d))}function coe(d){return d?Jh(hr(d),-x,x):d===0?d:0}function Qr(d){return d==null?"":Vo(d)}var loe=A1(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])}),IO=A1(function(d,h){il(h,mo(h),d)}),P2=A1(function(d,h,A,U){il(h,mo(h),d,U)}),foe=A1(function(d,h,A,U){il(h,_i(h),d,U)}),uoe=yf(nC);function doe(d,h){var A=C1(d);return h==null?A:sR(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 PO(d,_2(Wt(h)))}var Roe=yf(function(d,h){return d==null?{}:sne(d,h)});function PO(d,h){if(d==null)return{};var A=fn(CC(d),function(U){return[U]});return h=Wt(h),wR(d,A,function(U,J){return h(U,J[0])})}function Ooe(d,h,A){h=Ku(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=S1(function(d,h,A){return h=h.toLowerCase(),d+(A?RO(h):h)});function RO(d){return jC(Qr(d).toLowerCase())}function OO(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=S1(function(d,h,A){return d+(A?"-":"")+h.toLowerCase()}),Yoe=S1(function(d,h,A){return d+(A?" ":"")+h.toLowerCase()}),Qoe=BR("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))?Yu(po(d),0,A):d.split(h,A)):[]}var sae=S1(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,VR);var J=P2({},h.imports,U.imports,VR),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+=`'; @@ -945,12 +945,12 @@ __p += '`),Or&&(Ve+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ve+`return __p -}`;var pr=DO(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 ju(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 Yu(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 Yu(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 Yu(U,J).join("")}function hae(d,h){var A=le,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?Yu(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=NR("toUpperCase");function OO(d,h,A){return d=Qr(d),h=A?r:h,h===r?Jx(d)?KE(d):LE(d):d.match(h)||[]}var DO=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;++Jx)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},Uu=YE();pn?((pn.exports=Uu)._=Uu,rn._=Uu):Er._=Uu}).call(Ei)})(c4,c4.exports);var IBe=c4.exports,bI={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 M=v.shift();return{done:M===void 0,value:M}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,M){this.append(M,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 M=this.map[v];this.map[v]=M?M+", "+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 M in this.map)this.map.hasOwnProperty(M)&&v.call(m,this.map[M],M,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,M){v.push(M)}),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,M){v.push([M,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,M){v.onload=function(){m(v.result)},v.onerror=function(){M(v.error)}})}function C(v){var m=new FileReader,M=I(m);return m.readAsArrayBuffer(v),M}function S(v){var m=new FileReader,M=I(m);return m.readAsText(v),M}function O(v){for(var m=new Uint8Array(v),M=new Array(m.length),N=0;N-1?m:v}function $(v,m){m=m||{};var M=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,!M&&v._bodyInit!=null&&(M=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")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(M){if(M){var N=M.split("="),x=N.shift().replace(/\+/g," "),E=N.join("=").replace(/\+/g," ");m.append(decodeURIComponent(x),decodeURIComponent(E))}}),m}function le(v){var m=new y,M=v.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(N){var x=N.split(":"),E=x.shift().trim();if(E){var w=x.join(":").trim();m.append(E,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 k=[301,302,303,307,308];K.redirect=function(v,m){if(k.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,M){this.message=m,this.name=M;var N=Error(m);this.stack=N.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function R(v,m){return new Promise(function(M,N){var x=new $(v,m);if(x.signal&&x.signal.aborted)return N(new o.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function w(){E.abort()}E.onload=function(){var T={status:E.status,statusText:E.statusText,headers:le(E.getAllResponseHeaders()||"")};T.url="responseURL"in E?E.responseURL:T.headers.get("X-Request-URL");var P="response"in E?E.response:E.responseText;M(new K(P,T))},E.onerror=function(){N(new TypeError("Network request failed"))},E.ontimeout=function(){N(new TypeError("Network request failed"))},E.onabort=function(){N(new o.DOMException("Aborted","AbortError"))},E.open(x.method,x.url,!0),x.credentials==="include"?E.withCredentials=!0:x.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&a.blob&&(E.responseType="blob"),x.headers.forEach(function(T,P){E.setRequestHeader(P,T)}),x.signal&&(x.signal.addEventListener("abort",w),E.onreadystatechange=function(){E.readyState===4&&x.signal.removeEventListener("abort",w)}),E.send(typeof x._bodyInit>"u"?null:x._bodyInit)})}return R.polyfill=!0,s.fetch||(s.fetch=R,s.Headers=y,s.Request=$,s.Response=K),o.Headers=y,o.Request=$,o.Response=K,o.fetch=R,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})(bI,bI.exports);var TBe=bI.exports;const i$=Su(TBe);var PBe=Object.defineProperty,kBe=Object.defineProperties,MBe=Object.getOwnPropertyDescriptors,s$=Object.getOwnPropertySymbols,RBe=Object.prototype.hasOwnProperty,OBe=Object.prototype.propertyIsEnumerable,o$=(t,e,r)=>e in t?PBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a$=(t,e)=>{for(var r in e||(e={}))RBe.call(e,r)&&o$(t,r,e[r]);if(s$)for(var r of s$(e))OBe.call(e,r)&&o$(t,r,e[r]);return t},c$=(t,e)=>kBe(t,MBe(e));const DBe={Accept:"application/json","Content-Type":"application/json"},NBe="POST",l$={headers:DBe,method:NBe},f$=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,!kU(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 i$(this.url,c$(a$({},l$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!kU(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 i$(e,c$(a$({},l$),{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()>f$&&this.events.setMaxListeners(f$)}};const u$="error",BBe="wss://relay.walletconnect.org",LBe="wc",FBe="universal_provider",d$=`${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,h$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,p$=(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)&&p$(t,r,e[r]);if(h$)for(var r of h$(e))zBe.call(e,r)&&p$(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=v$(t),n=v$(e);return IBe.merge(r,n)}function v$(t){var e,r,n,i;const s={};if(!Mw(t))return s;for(const[o,a]of Object.entries(t)){const c=jM(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 g$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=jM(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,y$=Object.getOwnPropertySymbols,ZBe=Object.prototype.hasOwnProperty,XBe=Object.prototype.propertyIsEnumerable,m$=(t,e,r)=>e in t?YBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b$=(t,e)=>{for(var r in e||(e={}))ZBe.call(e,r)&&m$(t,r,e[r]);if(y$)for(var r of y$(e))XBe.call(e,r)&&m$(t,r,e[r]);return t},w$=(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:w$(b$({},o.sessionProperties||{}),{capabilities:w$(b$({},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(jd("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,x$=Object.getOwnPropertySymbols,hLe=Object.prototype.hasOwnProperty,pLe=Object.prototype.propertyIsEnumerable,E$=(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)&&E$(t,r,e[r]);if(x$)for(var r of x$(e))pLe.call(e,r)&&E$(t,r,e[r]);return t},nS=(t,e)=>uLe(t,dLe(e));let vLe=class _te{constructor(e){this.events=new vM,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)||u$})),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=g$(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=g$(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||u$,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(`${d$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${d$}/${e}`)}};const gLe=vLe,yLe="wc",mLe="ethereum_provider",bLe=`${yLe}@2:${mLe}:`,wLe="https://rpc.walletconnect.org/v1/",wI=["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"],xI=["chainChanged","accountsChanged"],ELe=["chainChanged","accountsChanged","message","disconnect","connect"];var CLe=Object.defineProperty,ALe=Object.defineProperties,SLe=Object.getOwnPropertyDescriptors,C$=Object.getOwnPropertySymbols,_Le=Object.prototype.hasOwnProperty,ILe=Object.prototype.propertyIsEnumerable,A$=(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)&&A$(t,r,e[r]);if(C$)for(var r of C$(e))ILe.call(e,r)&&A$(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||wI,events:s||xI,rpcMap:Y1({},e.length?{[l4(e)]:a[l4(e)]}:{})},l=s==null?void 0:s.filter(g=>!xI.includes(g)),f=n==null?void 0:n.filter(g=>!wI.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=Wj(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=Wj(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)||wI:[],c=i.length?(e==null?void 0:e.events)||xI:[],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-CaDRg2eB.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:{}};/*! +}`;var pr=NO(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 ju(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 Yu(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 Yu(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 Yu(U,J).join("")}function hae(d,h){var A=le,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?Yu(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=S1(function(d,h,A){return d+(A?" ":"")+h.toUpperCase()}),jC=BR("toUpperCase");function DO(d,h,A){return d=Qr(d),h=A?r:h,h===r?Jx(d)?KE(d):LE(d):d.match(h)||[]}var NO=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;++Jx)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=v1[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},Uu=YE();pn?((pn.exports=Uu)._=Uu,rn._=Uu):Er._=Uu}).call(Ei)})(c4,c4.exports);var IBe=c4.exports,bI={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 M=v.shift();return{done:M===void 0,value:M}}};return a.iterable&&(m[Symbol.iterator]=function(){return m}),m}function y(v){this.map={},v instanceof y?v.forEach(function(m,M){this.append(M,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 M=this.map[v];this.map[v]=M?M+", "+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 M in this.map)this.map.hasOwnProperty(M)&&v.call(m,this.map[M],M,this)},y.prototype.keys=function(){var v=[];return this.forEach(function(m,M){v.push(M)}),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,M){v.push([M,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,M){v.onload=function(){m(v.result)},v.onerror=function(){M(v.error)}})}function C(v){var m=new FileReader,M=I(m);return m.readAsArrayBuffer(v),M}function S(v){var m=new FileReader,M=I(m);return m.readAsText(v),M}function O(v){for(var m=new Uint8Array(v),M=new Array(m.length),N=0;N-1?m:v}function $(v,m){m=m||{};var M=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,!M&&v._bodyInit!=null&&(M=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")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(M)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function ie(v){var m=new FormData;return v.trim().split("&").forEach(function(M){if(M){var N=M.split("="),x=N.shift().replace(/\+/g," "),E=N.join("=").replace(/\+/g," ");m.append(decodeURIComponent(x),decodeURIComponent(E))}}),m}function le(v){var m=new y,M=v.replace(/\r?\n[\t ]+/g," ");return M.split(/\r?\n/).forEach(function(N){var x=N.split(":"),E=x.shift().trim();if(E){var w=x.join(":").trim();m.append(E,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 k=[301,302,303,307,308];K.redirect=function(v,m){if(k.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,M){this.message=m,this.name=M;var N=Error(m);this.stack=N.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function R(v,m){return new Promise(function(M,N){var x=new $(v,m);if(x.signal&&x.signal.aborted)return N(new o.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function w(){E.abort()}E.onload=function(){var T={status:E.status,statusText:E.statusText,headers:le(E.getAllResponseHeaders()||"")};T.url="responseURL"in E?E.responseURL:T.headers.get("X-Request-URL");var P="response"in E?E.response:E.responseText;M(new K(P,T))},E.onerror=function(){N(new TypeError("Network request failed"))},E.ontimeout=function(){N(new TypeError("Network request failed"))},E.onabort=function(){N(new o.DOMException("Aborted","AbortError"))},E.open(x.method,x.url,!0),x.credentials==="include"?E.withCredentials=!0:x.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&a.blob&&(E.responseType="blob"),x.headers.forEach(function(T,P){E.setRequestHeader(P,T)}),x.signal&&(x.signal.addEventListener("abort",w),E.onreadystatechange=function(){E.readyState===4&&x.signal.removeEventListener("abort",w)}),E.send(typeof x._bodyInit>"u"?null:x._bodyInit)})}return R.polyfill=!0,s.fetch||(s.fetch=R,s.Headers=y,s.Request=$,s.Response=K),o.Headers=y,o.Request=$,o.Response=K,o.fetch=R,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})(bI,bI.exports);var TBe=bI.exports;const s$=Su(TBe);var PBe=Object.defineProperty,kBe=Object.defineProperties,MBe=Object.getOwnPropertyDescriptors,o$=Object.getOwnPropertySymbols,RBe=Object.prototype.hasOwnProperty,OBe=Object.prototype.propertyIsEnumerable,a$=(t,e,r)=>e in t?PBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c$=(t,e)=>{for(var r in e||(e={}))RBe.call(e,r)&&a$(t,r,e[r]);if(o$)for(var r of o$(e))OBe.call(e,r)&&a$(t,r,e[r]);return t},l$=(t,e)=>kBe(t,MBe(e));const DBe={Accept:"application/json","Content-Type":"application/json"},NBe="POST",f$={headers:DBe,method:NBe},u$=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,!MU(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 s$(this.url,l$(c$({},f$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!MU(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 s$(e,l$(c$({},f$),{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()>u$&&this.events.setMaxListeners(u$)}};const d$="error",BBe="wss://relay.walletconnect.org",LBe="wc",FBe="universal_provider",h$=`${LBe}@2:${FBe}:`,Cte="https://rpc.walletconnect.org/v1/",Y1="generic",jBe=`${Cte}bundler`,ac={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var UBe=Object.defineProperty,$Be=Object.defineProperties,qBe=Object.getOwnPropertyDescriptors,p$=Object.getOwnPropertySymbols,VBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,v$=(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)&&v$(t,r,e[r]);if(p$)for(var r of p$(e))zBe.call(e,r)&&v$(t,r,e[r]);return t},HBe=(t,e)=>$Be(t,qBe(e));function ua(t,e,r){var n;const i=Hv(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Cte}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function r1(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=g$(t),n=g$(e);return IBe.merge(r,n)}function g$(t){var e,r,n,i;const s={};if(!Mw(t))return s;for(const[o,a]of Object.entries(t)){const c=UM(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 y$(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=UM(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=r1(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,m$=Object.getOwnPropertySymbols,ZBe=Object.prototype.hasOwnProperty,XBe=Object.prototype.propertyIsEnumerable,b$=(t,e,r)=>e in t?YBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w$=(t,e)=>{for(var r in e||(e={}))ZBe.call(e,r)&&b$(t,r,e[r]);if(m$)for(var r of m$(e))XBe.call(e,r)&&b$(t,r,e[r]);return t},x$=(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(r1(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:x$(w$({},o.sessionProperties||{}),{capabilities:x$(w$({},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(jd("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=r1(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=r1(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=r1(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=r1(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=r1(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=Y1,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=Hv(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,E$=Object.getOwnPropertySymbols,hLe=Object.prototype.hasOwnProperty,pLe=Object.prototype.propertyIsEnumerable,C$=(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)&&C$(t,r,e[r]);if(E$)for(var r of E$(e))pLe.call(e,r)&&C$(t,r,e[r]);return t},nS=(t,e)=>uLe(t,dLe(e));let vLe=class _te{constructor(e){this.events=new gM,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)||d$})),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=y$(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=y$(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===Y1?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||d$,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[Y1]?this.rpcProviders[Y1].updateNamespace(o):this.rpcProviders[Y1]=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[Y1]}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(`${h$}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${h$}/${e}`)}};const gLe=vLe,yLe="wc",mLe="ethereum_provider",bLe=`${yLe}@2:${mLe}:`,wLe="https://rpc.walletconnect.org/v1/",wI=["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"],xI=["chainChanged","accountsChanged"],ELe=["chainChanged","accountsChanged","message","disconnect","connect"];var CLe=Object.defineProperty,ALe=Object.defineProperties,SLe=Object.getOwnPropertyDescriptors,A$=Object.getOwnPropertySymbols,_Le=Object.prototype.hasOwnProperty,ILe=Object.prototype.propertyIsEnumerable,S$=(t,e,r)=>e in t?CLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Q1=(t,e)=>{for(var r in e||(e={}))_Le.call(e,r)&&S$(t,r,e[r]);if(A$)for(var r of A$(e))ILe.call(e,r)&&S$(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||wI,events:s||xI,rpcMap:Q1({},e.length?{[l4(e)]:a[l4(e)]}:{})},l=s==null?void 0:s.filter(g=>!xI.includes(g)),f=n==null?void 0:n.filter(g=>!wI.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(Q1({namespaces:Q1({},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=Kj(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(Q1({},e),{chains:this.rpc.chains}),r).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})}),i=n.session;if(i){const s=Kj(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(Q1({},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)||wI:[],c=i.length?(e==null?void 0:e.events)||xI:[],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-CMBogj9u.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(Q1({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(E){return Object.prototype.toString.call(E)==="[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(x){var E=Object.getOwnPropertyNames(x);return E.push.apply(E,Object.getOwnPropertySymbols(x)),E}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(x){x&&(this._conf=x,x.delimiter&&(this.delimiter=x.delimiter),x.maxListeners!==r&&(this._maxListeners=x.maxListeners),x.wildcard&&(this.wildcard=x.wildcard),x.newListener&&(this._newListener=x.newListener),x.removeListener&&(this._removeListener=x.removeListener),x.verboseMemoryLeak&&(this.verboseMemoryLeak=x.verboseMemoryLeak),x.ignoreErrors&&(this.ignoreErrors=x.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(x,E){var w="(node) warning: possible EventEmitter memory leak detected. "+x+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+E+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=x,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(x,E,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[x];case 2:return[x,E];case 3:return[x,E,w];default:for(var P=new Array(T);T--;)P[T]=arguments[T];return P}};function I(x,E){for(var w={},T,P=x.length,H=0,oe=0;oe0;)x=H[X],oe.call(j,x,w[x]);this._listeners={},this._listenersCount=0,G()}}});function S(x,E,w,T){var P=Object.assign({},E);if(!x)return P;if(typeof x!="object")throw TypeError("options must be an object");var H=Object.keys(x),oe=H.length,j,X,G;function Z(B){throw Error('Invalid "'+j+'" option value'+(B?". Reason: "+B:""))}for(var ee=0;ee0;)if(j===x[X])return H;oe(E)}}var F=L(["function"]),z=L(["object","function"]);function _(x,E,w){var T,P,H=0,oe,j=new x(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 x.prototype.cancel=="function"&&typeof Z=="function";function ee(){P&&(P=null),H&&(clearTimeout(H),H=0)}var B=function(fe){ee(),X(fe)},te=function(fe){ee(),G(fe)};T?E(B,te,Z):(P=[function(fe){te(fe||Error("canceled"))}],E(B,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");P.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(P){for(var G=P.length,Z=1;Z0;)te=ze[j],te!=="_listeners"&&(Xe=ie(x,E,w[te],T+1,P),Xe&&(B?B.push.apply(B,Xe):B=Xe));return B}else if(Te==="**"){for(Re=T+1===P||T+2===P&&De==="*",Re&&w._listeners&&(B=ie(x,E,w,P,P)),ze=u(w),j=ze.length;j-- >0;)te=ze[j],te!=="_listeners"&&(te==="*"||te==="**"?(w[te]._listeners&&!Re&&(Xe=ie(x,E,w[te],P,P),Xe&&(B?B.push.apply(B,Xe):B=Xe)),Xe=ie(x,E,w[te],T,P)):te===De?Xe=ie(x,E,w[te],T+2,P):Xe=ie(x,E,w[te],T,P),Xe&&(B?B.push.apply(B,Xe):B=Xe));return B}else w[Te]&&(B=ie(x,E,w[Te],T+1,P));if(fe=w["*"],fe&&ie(x,E,fe,T+1,P),Ee=w["**"],Ee)if(T0;)te=ze[j],te!=="_listeners"&&(te===De?ie(x,E,Ee[te],T+2,P):te===Te?ie(x,E,Ee[te],T+1,P):(_e={},_e[te]=Ee[te],ie(x,E,{"**":_e},T+1,P)));else Ee._listeners?ie(x,E,Ee,P,P):Ee["*"]&&Ee["*"]._listeners&&ie(x,E,Ee["*"],P,P);return B}function le(x,E,w){var T=0,P=0,H,oe=this.delimiter,j=oe.length,X;if(typeof x=="string")if((H=x.indexOf(oe))!==-1){X=new Array(5);do X[T++]=x.slice(P,H),P=H+j;while((H=x.indexOf(oe,P))!==-1);X[T++]=x.slice(P)}else X=[x],T=1;else X=x,T=x.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=E,!0;return!0}function K(x,E,w,T){for(var P=u(x),H=P.length,oe,j,X,G=x._listeners,Z;H-- >0;)j=P[H],oe=x[j],j==="_listeners"?X=w:X=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&E.push(Z?X:X.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,E,X,Z);return E}function k(x){for(var E=u(x),w=E.length,T,P,H;w-- >0;)P=E[w],T=x[P],T&&(H=!0,P!=="_listeners"&&!k(T)&&delete x[P]);return H}function R(x,E,w){this.emitter=x,this.event=E,this.listener=w}R.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(x,E,w){if(w===!0)P=!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,P=w.promisify,H=w.nextTick,oe=w.objectify}if(T||H||P){var j=E,X=E._origin||E;if(H&&!o)throw Error("process.nextTick is not supported");P===r&&(P=E.constructor.name==="AsyncFunction"),E=function(){var G=arguments,Z=this,ee=this.event;return P?H?Promise.resolve():new Promise(function(B){f(B)}).then(function(){return Z.event=ee,j.apply(Z,G)}):(H?process.nextTick:f)(function(){Z.event=ee,j.apply(Z,G)})},E._async=!0,E._origin=X}return[E,oe?new R(this,x,E):this]}function m(x){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,x)}m.EventEmitter2=m,m.prototype.listenTo=function(x,E,w){if(typeof x!="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 P(H){if(typeof H!="object")throw TypeError("events must be an object");var oe=w.reducers,j=$.call(T,x),X;j===-1?X=new C(T,x,w):X=T._observers[j];for(var G=u(H),Z=G.length,ee,B=typeof oe=="function",te=0;te0;)P=w[T],(!x||P._target===x)&&(P.unsubscribe(E),H=!0);return H},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(x){x!==r&&(this._maxListeners=x,this._conf||(this._conf={}),this._conf.maxListeners=x)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(x,E,w){return this._once(x,E,!1,w)},m.prototype.prependOnceListener=function(x,E,w){return this._once(x,E,!0,w)},m.prototype._once=function(x,E,w,T){return this._many(x,1,E,w,T)},m.prototype.many=function(x,E,w,T){return this._many(x,E,w,!1,T)},m.prototype.prependMany=function(x,E,w,T){return this._many(x,E,w,!0,T)},m.prototype._many=function(x,E,w,T,P){var H=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--E===0&&H.off(x,oe),w.apply(this,arguments)}return oe._origin=w,this._on(x,oe,T,P)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var x=arguments[0],E,w=this.wildcard,T,P,H,oe,j;if(x==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(E=x,x!=="newListener"&&x!=="removeListener"&&typeof x=="object")){if(P=x.length,a){for(H=0;H3)for(T=new Array(X-1),oe=1;oe3)for(P=new Array(G-1),j=1;j0&&this._events[x].length>this._maxListeners&&(this._events[x].warned=!0,y.call(this,this._events[x].length,x))):this._events[x]=E,P)},m.prototype.off=function(x,E){if(typeof E!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var P=typeof x=="string"?x.split(this.delimiter):x.slice();if(T=ie.call(this,null,P,this.listenerTree,0),!T)return this}else{if(!this._events[x])return this;w=this._events[x],T.push({_listeners:w})}for(var H=0;H0){for(T=this._all,E=0,w=T.length;E0;)T=E[w[H]],typeof T=="function"?P.push(T):P.push.apply(P,T);return P}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],X=typeof x=="string"?x.split(this.delimiter):x.slice();return ie.call(this,j,X,oe,0),j}return E?(T=E[x],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(x){var E=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,x):E?u(E):[]},m.prototype.listenerCount=function(x){return this.listeners(x).length},m.prototype.hasListeners=function(x){if(this.wildcard){var E=[],w=typeof x=="string"?x.split(this.delimiter):x.slice();return ie.call(this,E,w,this.listenerTree,0),E.length>0}var T=this._events,P=this._all;return!!(P&&P.length||T&&(x===r?u(T).length:T[x]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(x,E){var w=this,T=typeof E;return T==="number"?E={timeout:E}:T==="function"&&(E={filter:E}),E=S(E,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:O}),_(E.Promise,function(P,H,oe){function j(){var X=E.filter;if(!(X&&!X.apply(w,arguments)))if(w.off(x,j),E.handleError){var G=arguments[0];G?H(G):P(b.apply(null,arguments).slice(1))}else P(b.apply(null,arguments))}oe(function(){w.off(x,j)}),w._on(x,j,!1)},{timeout:E.timeout,overload:E.overload})};function M(x,E,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:O});var T=w.Promise;return _(T,function(P,H,oe){var j;if(typeof x.addEventListener=="function"){j=function(){P(b.apply(null,arguments))},oe(function(){x.removeEventListener(E,j)}),x.addEventListener(E,j,{once:!0});return}var X=function(){G&&x.removeListener("error",G),P(b.apply(null,arguments))},G;E!=="error"&&(G=function(Z){x.removeListener(E,X),H(Z)},x.once("error",G)),oe(function(){G&&x.removeListener("error",G),x.removeListener(E,X)}),x.once(E,X)},{timeout:w.timeout,overload:w.overload})}var N=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(x){if(typeof x!="number"||x<0||Number.isNaN(x))throw TypeError("n must be a non-negative number");N._maxListeners=x},enumerable:!0},once:{value:M,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Tte);var kLe=Tte.exports,EI=function(){return EI=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!==CI)throw new Error("ethauth: not an ethauth proof");return p=PF.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 sX.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 AI(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)},S$=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));AI(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(AI(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?[_$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return _$(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 _$(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(!GM.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 S$(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 S$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Rk(r),n,i)}}const cFe=["method"],I$=["connect","disconnect","chainChanged","accountsChanged"];class GM extends pJ{constructor(e,r,n=fM,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(I$.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(I$.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}}GM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function Dte(t){return typeof t=="object"?Dte(t.chainId):Number(t)}class lFe extends GM{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(uh.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});de(this,"defaultNetwork",new Np(uh.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===dh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:E6e(n)}):e.contractType===dh.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,uM,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,dM,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),AI(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:aX,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 T$=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:aX,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 P$=["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(uh.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 P$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=P$[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 WM{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(uh.COLLECTIBLES)});this.store=e;const r=this.store.get(Bn);dX(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===dh.ERC721){const f=new Nn(e.address,uM,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===dh.ERC1155){const f=new Nn(e.address,dM,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(be,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(He,{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(be,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(He,{variant:"medium",color:"text80",children:t.collectibleInfoResponse.name??"Collectible"})}),W.jsx(be,{style:{height:"200px"},children:W.jsx(r8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image??"",width:"full"})}),W.jsx(be,{justifyContent:"flex-end",children:W.jsx(He,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(lh(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(be,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(ME,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(be,{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(WM),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(be,{children:W.jsx(He,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(be,{alignItems:"center",justifyContent:"center",children:W.jsx(He,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{flexDirection:"column",gap:"2",children:W.jsxs(be,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(He,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(He,{variant:"medium",color:"text100",children:Number(lh(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(be,{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(WM),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(be,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})]}),W.jsxs(be,{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:FH,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(be,{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(be,{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 k$({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(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(He,{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(be,{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(Iu,{})]})}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(be,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(be,{children:W.jsx(He,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(be,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(vwe,{value:o,onValueChange:f=>a(f),children:[W.jsx(be,{marginBottom:"10",children:W.jsx(pwe,{value:o,tabs:[{label:"Networks",value:Ft.MAINNET},{label:"Test Networks",value:Ft.TESTNET}]})}),W.jsx(VB,{value:Ft.MAINNET,children:W.jsxs(be,{flexDirection:"column",gap:"2",children:[W.jsxs(be,{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(k$,{network:f},u))})]})}),W.jsx(VB,{value:Ft.TESTNET,children:W.jsx(be,{flexDirection:"column",gap:"2",children:s.map((f,u)=>W.jsx(k$,{network:f},u))})})]})})]})}function oS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(be,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(be,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(ch,{size:"md"}),W.jsxs(be,{flexDirection:"column",gap:"1",children:[W.jsxs(be,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(He,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(ME,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(He,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(He,{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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{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(be,{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(He,{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(be,{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(He,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function wFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=GP("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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(be,{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(lh((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(He,{variant:"small",color:"text50",children:["Current balance:"," ",lh((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(be,{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(ZT,{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(be,{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=GP("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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(be,{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(lh(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(He,{variant:"small",color:"text50",children:["Current balance:"," ",lh(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(be,{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(ZT,{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(be,{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=ek();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(be,{marginTop:"2",children:[W.jsx(qA,{onClick:t,children:W.jsx(be,{padding:"1",children:W.jsx(He,{variant:"normal",fontWeight:"bold",children:"Token List"})})}),W.jsx(qA,{disabled:!0,children:W.jsx(be,{width:"16",children:W.jsx(Iu,{color:"white"})})}),W.jsx(qA,{onClick:()=>{e.logout(),r("/")},children:W.jsx(be,{padding:"1",children:W.jsx(He,{variant:"normal",fontWeight:"bold",children:"Log out"})})})]})})]})}function CFe(){const t=Pr(Ix),e=yn(t.userAddedTokens);return W.jsxs(be,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsxs(be,{flexDirection:"column",alignItems:"center",gap:"4",marginBottom:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Token List"}),W.jsx(He,{variant:"normal",color:"text50",children:"Tokens added by you can be removed here"})]}),W.jsxs(be,{width:"full",height:"full",flexDirection:"column",marginTop:"4",paddingBottom:"12",gap:"4",children:[e.length===0&&W.jsx(be,{height:"full",alignItems:"center",justifyContent:"center",children:W.jsx(He,{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(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{variant:"medium",color:"text80",children:r.symbol}),W.jsx(He,{variant:"normal",color:"text50",children:r.address}),W.jsx(ME,{chainId:r.chainId})]}),W.jsx(be,{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:dh.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(be,{children:W.jsx(He,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{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(be,{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=lh(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(be,{flexDirection:"row",alignItems:"center",children:[W.jsx(He,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(be,{marginLeft:"auto",children:W.jsx(He,{color:"text80",children:s})})]}),W.jsxs(be,{flexDirection:"row",children:[W.jsx(ME,{chainId:e.chainId}),W.jsxs(be,{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===dh.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(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})]}),c&&W.jsx(AFe,{onClose:()=>l(!1)}),!c&&W.jsx(be,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Xt,{label:"Import token",leftIcon:FH,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(be,{children:r&&W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:r.app}),W.jsxs(be,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Network"}),W.jsx(He,{variant:"md",color:"text100",children:`${My(Number(r.networkId))}`})]}),W.jsxs(be,{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(be,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(He,{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(He,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(be,{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(be,{children:n&&W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(He,{variant:"md",color:"text100",children:a})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(be,{alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Network"}),W.jsx(He,{variant:"md",color:"text100",children:`${My(n.chainId)}`})]}),W.jsxs(qr,{flexDirection:"column",gap:"4",children:[W.jsx(He,{variant:"md",color:"text100",children:"Signee"}),W.jsx(qr,{children:W.jsx(He,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(zH,{label:"Message Content",children:W.jsx(qr,{children:W.jsx(He,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(be,{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(WM),[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}),k=await F.decimals();u(Number(lh(K==null?void 0:K.args[1],k??18)));return}catch{}const z=new Nn(O,C9e,L);if(await z.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Nn(O,uM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const k=await ie.name();l({name:k});return}if(await z.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Nn(O,dM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const k=await ie.uri(K);l({name:k});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(be,{children:y&&W.jsx(be,{children:W.jsxs(be,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(He,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(He,{variant:"md",color:"text100",children:p})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(be,{alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(He,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(He,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Amount"}),W.jsx(He,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(zH,{label:"Transaction Data",children:W.jsx(be,{flexDirection:"column",gap:"2",children:y.txn.map((S,O)=>W.jsx(qr,{children:W.jsx(He,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},O))})}),W.jsxs(be,{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(be,{children:W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(be,{flexDirection:"column",children:W.jsx(qr,{children:W.jsxs(He,{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 vh(e)=="symbol"?e:e+""}function BFe(t,e){if(vh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}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)}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: "+vh(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: "+vh(t)+". Please use a boolean."):(jte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function UFe(){if((typeof window>"u"?"undefined":vh(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 M$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ute(t){return M$(t)?Object.keys(t).reduce(function(e,r){var n=M$(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||vd(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 vd(t){"@babel/helpers - typeof";return vd=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},vd(t)}var R$=HFe.log;function WFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(vd(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=vd(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&&vd(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&&vd(l.video)==="object"){var p=l.video.facingMode;p=p&&(vd(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),R$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return R$("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||gh(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 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)}function eje(t){if(!(gh(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(!(gh(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 O$=["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=D$(t);let r=0,n=O$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=O$[i],o=D$(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 N$=new WeakMap;function KM(t,e){var r;const n=N$.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 N$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function wje(t,e,r=fy){const n={...fy,...r},i=await KM(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,le,K,k,R,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=le=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=k=new Uint32Array(q),i.HEAPF32=R=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var M=[],N=[],x=[];function E(){var q=i.preRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(P)),Qe(M)}function w(){Qe(N)}function T(){var q=i.postRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(oe)),Qe(x)}function P(q){M.unshift(q)}function H(q){N.unshift(q)}function oe(q){x.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 B="data:application/octet-stream;base64,",te=q=>q.startsWith(B);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){k[this.ptr+4>>2]=V}get_type(){return k[this.ptr+4>>2]}set_destructor(V){k[this.ptr+8>>2]=V}get_destructor(){return k[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){k[this.ptr+16>>2]=V}get_adjusted_ptr(){return k[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(k[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,Ge=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||Ge(`type "${ae}" must have a positive integer typeid pointer`),Ot.hasOwnProperty(q)){if(re.ignoreDuplicateRegistrations)return;Ge(`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}Ge(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&&Ge("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&&Ge("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&&Ge("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)&&Ge(`Cannot register public name '${q}' twice`),fo(i,q,q),i.hasOwnProperty(re)&&Ge(`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||Ge(`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&&Ge(`null is not a valid ${this.name}`),0;V.$$||Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`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&&Ge(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,re),re):0;(!V||!V.$$)&&Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&Ge(`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&&Ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?re=V.$$.smartPtr:Ge(`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:Ge("Unsupporting sharing policy")}return re}function of(q,V){if(V===null)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;V.$$||Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&Ge(`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(Du.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 Du(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},Nu=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"&&Ge(`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=Bu(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=Bu(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,Lu=()=>{$o.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=Vy},uo={toValue:q=>(q||Ge("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(le[ae>>1])};case 4:return re?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(k[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&&Ge(`${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},ce=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},xe=(q,V)=>{switch(V){case 4:return function(re){return this.fromWireType(R[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:xe(V,re),destructorFunction:null})},gt=(q,V,re,ae,ve,me,Se,Ae)=>{var Be=Bu(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=>le[ae>>1];case 4:return re?ae=>K[ae>>2]:ae=>k[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=k[Se>>2],Be=k[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=k[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),Ge("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)&&le[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=>le[Ae>>1]):V===4&&(ae=fi,ve=RE,Se=ho,me=Ae=>k[Ae>>2]),Et(q,{name:re,fromWireType:Ae=>{for(var Be=k[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"&&Ge(`Cannot pass non-string to C++ string type ${re}`);var Ye=Se(Be),st=zh(4+Ye+V);return k[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&&(k[V>>2]=uo.toHandle(ae)),ve},Fu=(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);k[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",ju=()=>{if(!ju.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]}`);ju.strings=ae}return ju.strings},Vs=(q,V)=>{for(var re=0;re{var re=0;return ju().forEach((ae,ve)=>{var me=V+re;k[q+ve*4>>2]=me,Vs(ae,me),re+=ae.length+1}),0},Vh=(q,V)=>{var re=ju();k[q>>2]=re.length;var ae=0;return re.forEach(ve=>ae+=ve.length+1),k[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=k[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"),Lu();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:Fu,Y:FE,Z:Gx,ra:Wx,da:Wy,ha:Yy,ea:Qy,fa:Vh,ia:Yx,$:Qx,S:VE,J:g1,C:ZE,Q:Uu,R:rl,r:p1,b:GE,D:v1,la:y1,c:Oe,ka:XE,h:YE,i:Lr,s:Yn,N:$u,w:Xy,I:tC,K:JE,z:r2,H:b1,aa:w1,_:i2,l:Pe,f:we,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 Uu(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 we(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 $u(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,E(),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 KM(YM,t)}async function Cje(t,e){return wje(YM,t,e)}async function Aje(t,e){return xje(YM,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]),SI=new Map(Jte);function _je(t){for(const[e,r]of SI)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 B$(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 _I 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(!SI.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 B$(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=>SI.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 B$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}N3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=_I);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 L$=t=>!are(t)&&!Array.isArray(t)&&cre(t)&&!lb(t),F$=t=>are(t)||!cre(t);function lre(t,e){if(F$(t)||F$(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)||L$(s)&&L$(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),M=D.useRef(null),[N,x]=D.useState({}),[E,w]=D.useState({}),T=D.useCallback(async(X,G)=>{var Z,ee,B;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()),x((B=(ee=fe==null?void 0:fe.getCapabilities)===null||ee===void 0?void 0:ee.call(fe))!==null&&B!==void 0?B:{}),m.current=te,M.current=fe,{type:"start",data:{videoEl:X,stream:te,constraints:G}}},[]),P=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,M.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:B,stream:te,constraints:fe}}=ee;return Z||X!==B||G!==fe?P(B,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,P]),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 P(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[P]),j=D.useCallback(async X=>{const G=M.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();x(Z),w(ee)}},[]);return D.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:N,settings:E,startCamera:H,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:le}=function(v){const{videoElementRef:m,onScan:M,onFound:N,retryDelay:x=100,scanDelay:E=0,formats:w=[],audio:T=!0,allowMultiple:P=!1}=v,H=D.useRef(new _I({formats:w})),oe=D.useRef(null),j=D.useRef(null);D.useEffect(()=>{H.current=new _I({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:B,lastScanHadContent:te}=G;if(Z-ee!B.includes(De.rawValue)),_e=fe.length>0;let Re=G.lastOnScan;(Ee||P&&_e&&Z-Re>=E)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(De=>console.error("Error playing the sound",De)),Re=Z,M(fe)),_e&&N(fe),!_e&&te&&N(fe);const Te={lastScan:Z,lastOnScan:Re,lastScanHadContent:_e,contentBefore:Ee?fe.map(De=>De.rawValue):B};j.current=window.requestAnimationFrame(X(Te))}}},[m.current,M,N,x]);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,M,N,x){const E=N;if(E==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=M;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||x===void 0)O6(E);else{const T=w.offsetWidth,P=w.offsetHeight,H=w.videoWidth,oe=w.videoHeight,j=Math.max(T/H,P/oe),X=H*j,G=oe*j,Z=X/H,ee=G/oe,B=(T-X)/2,te=(P-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+B),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})}});E.width=w.offsetWidth,E.height=w.offsetHeight;const Re=E.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.");x(_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&&(le(),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]),k=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 M=m.getContext("2d");if(M==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(N){p==null||p(N),console.error("error",N)}}else m.width=v.videoWidth,m.height=v.videoHeight,M.drawImage(v,0,0,v.videoWidth,v.videoHeight),await $.stopCamera(),F(!1)};D.useEffect(()=>{(async()=>await k())()},[K]);const R=D.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return D.useEffect(()=>{if(R){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()}},[R]),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 k(),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(be,{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",minHeight:"500px"}}}),W.jsxs(be,{children:[W.jsx(Wn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(be,{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=GP("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),[le,K]=D.useState(!1),[k,R]=D.useState(!1),[v,m]=D.useState(!1),[M,N]=D.useState(!1),[x,E]=D.useState(!1),[w,T]=D.useState(!1),P=yn(n.signClientWarningType),H=Te=>{_(void 0),n.isSendingCollectibleTransaction.set(void 0),F(Te),N(!0)},oe=Te=>{F(void 0),n.isSendingTokenTransaction.set(void 0),_(Te),E(!0)},j=async(Te=!1)=>{(p===void 0||Te)&&R(!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 T$(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 T$(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 B(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(be,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(be,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:hM,alt:"Sequence Logo",width:"40"}),W.jsxs(be,{marginLeft:"auto",children:[W.jsx(Xt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>ie(!0)}),W.jsx(EFe,{onTokenListClick:()=>K(!0)})]})]}),W.jsxs(be,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(He,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(He,{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(He,{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(be,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(be,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:p.info.icon,alt:p.info.name,style:{width:"20px",height:"20px"}}),W.jsx(He,{variant:"normal",color:"text100",children:p.info.name})]}),g&&W.jsxs(He,{variant:"normal",color:"text100",children:["(",g,")"]}),W.jsxs(be,{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(be,{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(be,{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(be,{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(be,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(be,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Coins"}),W.jsx(be,{marginLeft:"auto",children:W.jsx(swe,{label:"Filter zero balances",checked:S,onCheckedChange:O})})]}),W.jsx(IFe,{filterZeroBalances:S,onSendClick:H})]}),W.jsxs(be,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(He,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(gFe,{onSendClick:oe})]})]})]}),$&&W.jsx(Ec,{onClose:()=>ie(!1),children:W.jsx(mFe,{})}),le&&W.jsx(Ec,{onClose:()=>K(!1),children:W.jsx(CFe,{})}),k&&W.jsx(Ec,{size:"md",onClose:()=>R(!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)),R(!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")):B(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()}})}),P&&W.jsx(Ec,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(RFe,{warningType:P})}),M&&W.jsx(Ec,{size:"md",onClose:()=>N(!1),children:W.jsx(xFe,{tokenBalance:L,onClose:(Te,De)=>{N(!1),Te&&De&&G(Te,De)}})}),x&&W.jsx(Ec,{size:"md",onClose:()=>E(!1),children:W.jsx(wFe,{collectibleInfo:z,onClose:(Te,De)=>{E(!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:"/",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 _}; + */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(E){return Object.prototype.toString.call(E)==="[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(x){var E=Object.getOwnPropertyNames(x);return E.push.apply(E,Object.getOwnPropertySymbols(x)),E}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(x){x&&(this._conf=x,x.delimiter&&(this.delimiter=x.delimiter),x.maxListeners!==r&&(this._maxListeners=x.maxListeners),x.wildcard&&(this.wildcard=x.wildcard),x.newListener&&(this._newListener=x.newListener),x.removeListener&&(this._removeListener=x.removeListener),x.verboseMemoryLeak&&(this.verboseMemoryLeak=x.verboseMemoryLeak),x.ignoreErrors&&(this.ignoreErrors=x.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(x,E){var w="(node) warning: possible EventEmitter memory leak detected. "+x+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+E+"."),typeof process<"u"&&process.emitWarning){var T=new Error(w);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=x,process.emitWarning(T)}else console.error(w),console.trace&&console.trace()}var b=function(x,E,w){var T=arguments.length;switch(T){case 0:return[];case 1:return[x];case 2:return[x,E];case 3:return[x,E,w];default:for(var P=new Array(T);T--;)P[T]=arguments[T];return P}};function I(x,E){for(var w={},T,P=x.length,H=0,oe=0;oe0;)x=H[X],oe.call(j,x,w[x]);this._listeners={},this._listenersCount=0,G()}}});function S(x,E,w,T){var P=Object.assign({},E);if(!x)return P;if(typeof x!="object")throw TypeError("options must be an object");var H=Object.keys(x),oe=H.length,j,X,G;function Z(B){throw Error('Invalid "'+j+'" option value'+(B?". Reason: "+B:""))}for(var ee=0;ee0;)if(j===x[X])return H;oe(E)}}var F=L(["function"]),z=L(["object","function"]);function _(x,E,w){var T,P,H=0,oe,j=new x(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 x.prototype.cancel=="function"&&typeof Z=="function";function ee(){P&&(P=null),H&&(clearTimeout(H),H=0)}var B=function(fe){ee(),X(fe)},te=function(fe){ee(),G(fe)};T?E(B,te,Z):(P=[function(fe){te(fe||Error("canceled"))}],E(B,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");P.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(P){for(var G=P.length,Z=1;Z0;)te=ze[j],te!=="_listeners"&&(Xe=ie(x,E,w[te],T+1,P),Xe&&(B?B.push.apply(B,Xe):B=Xe));return B}else if(Te==="**"){for(Re=T+1===P||T+2===P&&De==="*",Re&&w._listeners&&(B=ie(x,E,w,P,P)),ze=u(w),j=ze.length;j-- >0;)te=ze[j],te!=="_listeners"&&(te==="*"||te==="**"?(w[te]._listeners&&!Re&&(Xe=ie(x,E,w[te],P,P),Xe&&(B?B.push.apply(B,Xe):B=Xe)),Xe=ie(x,E,w[te],T,P)):te===De?Xe=ie(x,E,w[te],T+2,P):Xe=ie(x,E,w[te],T,P),Xe&&(B?B.push.apply(B,Xe):B=Xe));return B}else w[Te]&&(B=ie(x,E,w[Te],T+1,P));if(fe=w["*"],fe&&ie(x,E,fe,T+1,P),Ee=w["**"],Ee)if(T0;)te=ze[j],te!=="_listeners"&&(te===De?ie(x,E,Ee[te],T+2,P):te===Te?ie(x,E,Ee[te],T+1,P):(_e={},_e[te]=Ee[te],ie(x,E,{"**":_e},T+1,P)));else Ee._listeners?ie(x,E,Ee,P,P):Ee["*"]&&Ee["*"]._listeners&&ie(x,E,Ee["*"],P,P);return B}function le(x,E,w){var T=0,P=0,H,oe=this.delimiter,j=oe.length,X;if(typeof x=="string")if((H=x.indexOf(oe))!==-1){X=new Array(5);do X[T++]=x.slice(P,H),P=H+j;while((H=x.indexOf(oe,P))!==-1);X[T++]=x.slice(P)}else X=[x],T=1;else X=x,T=x.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=E,!0;return!0}function K(x,E,w,T){for(var P=u(x),H=P.length,oe,j,X,G=x._listeners,Z;H-- >0;)j=P[H],oe=x[j],j==="_listeners"?X=w:X=w?w.concat(j):[j],Z=T||typeof j=="symbol",G&&E.push(Z?X:X.join(this.delimiter)),typeof oe=="object"&&K.call(this,oe,E,X,Z);return E}function k(x){for(var E=u(x),w=E.length,T,P,H;w-- >0;)P=E[w],T=x[P],T&&(H=!0,P!=="_listeners"&&!k(T)&&delete x[P]);return H}function R(x,E,w){this.emitter=x,this.event=E,this.listener=w}R.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function v(x,E,w){if(w===!0)P=!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,P=w.promisify,H=w.nextTick,oe=w.objectify}if(T||H||P){var j=E,X=E._origin||E;if(H&&!o)throw Error("process.nextTick is not supported");P===r&&(P=E.constructor.name==="AsyncFunction"),E=function(){var G=arguments,Z=this,ee=this.event;return P?H?Promise.resolve():new Promise(function(B){f(B)}).then(function(){return Z.event=ee,j.apply(Z,G)}):(H?process.nextTick:f)(function(){Z.event=ee,j.apply(Z,G)})},E._async=!0,E._origin=X}return[E,oe?new R(this,x,E):this]}function m(x){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,x)}m.EventEmitter2=m,m.prototype.listenTo=function(x,E,w){if(typeof x!="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 P(H){if(typeof H!="object")throw TypeError("events must be an object");var oe=w.reducers,j=$.call(T,x),X;j===-1?X=new C(T,x,w):X=T._observers[j];for(var G=u(H),Z=G.length,ee,B=typeof oe=="function",te=0;te0;)P=w[T],(!x||P._target===x)&&(P.unsubscribe(E),H=!0);return H},m.prototype.delimiter=".",m.prototype.setMaxListeners=function(x){x!==r&&(this._maxListeners=x,this._conf||(this._conf={}),this._conf.maxListeners=x)},m.prototype.getMaxListeners=function(){return this._maxListeners},m.prototype.event="",m.prototype.once=function(x,E,w){return this._once(x,E,!1,w)},m.prototype.prependOnceListener=function(x,E,w){return this._once(x,E,!0,w)},m.prototype._once=function(x,E,w,T){return this._many(x,1,E,w,T)},m.prototype.many=function(x,E,w,T){return this._many(x,E,w,!1,T)},m.prototype.prependMany=function(x,E,w,T){return this._many(x,E,w,!0,T)},m.prototype._many=function(x,E,w,T,P){var H=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function oe(){return--E===0&&H.off(x,oe),w.apply(this,arguments)}return oe._origin=w,this._on(x,oe,T,P)},m.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var x=arguments[0],E,w=this.wildcard,T,P,H,oe,j;if(x==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(E=x,x!=="newListener"&&x!=="removeListener"&&typeof x=="object")){if(P=x.length,a){for(H=0;H3)for(T=new Array(X-1),oe=1;oe3)for(P=new Array(G-1),j=1;j0&&this._events[x].length>this._maxListeners&&(this._events[x].warned=!0,y.call(this,this._events[x].length,x))):this._events[x]=E,P)},m.prototype.off=function(x,E){if(typeof E!="function")throw new Error("removeListener only takes instances of Function");var w,T=[];if(this.wildcard){var P=typeof x=="string"?x.split(this.delimiter):x.slice();if(T=ie.call(this,null,P,this.listenerTree,0),!T)return this}else{if(!this._events[x])return this;w=this._events[x],T.push({_listeners:w})}for(var H=0;H0){for(T=this._all,E=0,w=T.length;E0;)T=E[w[H]],typeof T=="function"?P.push(T):P.push.apply(P,T);return P}else{if(this.wildcard){if(oe=this.listenerTree,!oe)return[];var j=[],X=typeof x=="string"?x.split(this.delimiter):x.slice();return ie.call(this,j,X,oe,0),j}return E?(T=E[x],T?typeof T=="function"?[T]:T:[]):[]}},m.prototype.eventNames=function(x){var E=this._events;return this.wildcard?K.call(this,this.listenerTree,[],null,x):E?u(E):[]},m.prototype.listenerCount=function(x){return this.listeners(x).length},m.prototype.hasListeners=function(x){if(this.wildcard){var E=[],w=typeof x=="string"?x.split(this.delimiter):x.slice();return ie.call(this,E,w,this.listenerTree,0),E.length>0}var T=this._events,P=this._all;return!!(P&&P.length||T&&(x===r?u(T).length:T[x]))},m.prototype.listenersAny=function(){return this._all?this._all:[]},m.prototype.waitFor=function(x,E){var w=this,T=typeof E;return T==="number"?E={timeout:E}:T==="function"&&(E={filter:E}),E=S(E,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:O}),_(E.Promise,function(P,H,oe){function j(){var X=E.filter;if(!(X&&!X.apply(w,arguments)))if(w.off(x,j),E.handleError){var G=arguments[0];G?H(G):P(b.apply(null,arguments).slice(1))}else P(b.apply(null,arguments))}oe(function(){w.off(x,j)}),w._on(x,j,!1)},{timeout:E.timeout,overload:E.overload})};function M(x,E,w){w=S(w,{Promise,timeout:0,overload:!1},{Promise:O});var T=w.Promise;return _(T,function(P,H,oe){var j;if(typeof x.addEventListener=="function"){j=function(){P(b.apply(null,arguments))},oe(function(){x.removeEventListener(E,j)}),x.addEventListener(E,j,{once:!0});return}var X=function(){G&&x.removeListener("error",G),P(b.apply(null,arguments))},G;E!=="error"&&(G=function(Z){x.removeListener(E,X),H(Z)},x.once("error",G)),oe(function(){G&&x.removeListener("error",G),x.removeListener(E,X)}),x.once(E,X)},{timeout:w.timeout,overload:w.overload})}var N=m.prototype;Object.defineProperties(m,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(x){if(typeof x!="number"||x<0||Number.isNaN(x))throw TypeError("n must be a non-negative number");N._maxListeners=x},enumerable:!0},once:{value:M,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=m})()})(Tte);var kLe=Tte.exports,EI=function(){return EI=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!==CI)throw new Error("ethauth: not an ethauth proof");return p=kF.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 sX.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 AI(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)},_$=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 Lv(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));AI(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(AI(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 Lv(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:Lv(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?[I$(p,await l.status(p))]:await Promise.all(l.networks.map(async function(g){const y=await l.status(g.chainId);return I$(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 I$(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(!WM.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 _$(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 _$(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Ok(r),n,i)}}const cFe=["method"],T$=["connect","disconnect","chainChanged","accountsChanged"];class WM extends pJ{constructor(e,r,n=uM,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(T$.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(T$.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}}WM.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function Dte(t){return typeof t=="object"?Dte(t.chainId):Number(t)}class lFe extends WM{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(uh.LAST_CONNECTED_EXTERNAL_PROVIDER_INFO)});de(this,"defaultNetwork",new Np(uh.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===dh.NATIVE?(console.info("Sending native token with address, on chainId: ",e.contractAddress,a),p={to:r,value:E6e(n)}):e.contractType===dh.ERC20&&(console.info("Sending ERC20 token with address, on chainId: ",e.contractAddress,a),p=await new Nn(e.contractAddress,$v,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,dM,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,hM,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),AI(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:aX,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 P$=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:aX,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 k$=["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(uh.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 k$)if(await this.isGatewayAccessible(r)){this.gatewayURL=r,this.localStore.set(r);return}this.gatewayURL=k$[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 KM{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(uh.COLLECTIBLES)});this.store=e;const r=this.store.get(Bn);dX(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===dh.ERC721){const f=new Nn(e.address,dM,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===dh.ERC1155){const f=new Nn(e.address,hM,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(be,{background:"backgroundMuted",width:"fit",height:"fit",borderRadius:"sm",paddingTop:e,paddingBottom:r,paddingX:"2",children:W.jsx(He,{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(be,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsx(He,{variant:"medium",color:"text80",children:t.collectibleInfoResponse.name??"Collectible"})}),W.jsx(be,{style:{height:"200px"},children:W.jsx(r8,{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:t.collectibleInfoResponse.image??"",width:"full"})}),W.jsx(be,{justifyContent:"flex-end",children:W.jsx(He,{variant:"medium",color:"text100",children:t.collectibleInfoParams.contractType==="ERC1155"?Number(lh(t.collectibleInfoResponse.balance,t.collectibleInfoResponse.decimals??0)):1})}),W.jsxs(be,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(ME,{chainId:t.collectibleInfoParams.chainId}),W.jsxs(be,{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(KM),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(be,{children:W.jsx(He,{variant:"medium",color:"text80",children:"Import ERC721 or ERC1155 Collectible"})}),W.jsxs(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})}),b&&!b.isOwner&&!s&&W.jsx(be,{alignItems:"center",justifyContent:"center",children:W.jsx(He,{variant:"medium",color:"warning",children:"You do not own this collectible"})}),b&&b.isOwner&&!s&&W.jsx(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(qr,{flexDirection:"column",gap:"2",children:W.jsxs(be,{flexDirection:"row",gap:"6",children:[W.jsx("img",{src:b.image??"",alt:b.name??"",style:{width:"120px",height:"auto"}}),W.jsxs(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{variant:"medium",color:"text100",children:b.name??""}),W.jsx(W.Fragment,{children:b.balance&&W.jsxs(W.Fragment,{children:[W.jsx(He,{variant:"small",color:"text80",children:"Your Balance:"}),W.jsx(He,{variant:"medium",color:"text100",children:Number(lh(b.balance,b.decimals??0))})]})})]})]})})}),W.jsxs(be,{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(KM),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(be,{width:"full",flexDirection:"row",flexWrap:"wrap",gap:"4",marginBottom:"8",children:[i.map(a=>W.jsx(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})]}),W.jsxs(be,{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:jH,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(be,{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(be,{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 M$({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(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"flex-end",gap:"5",children:[W.jsx(He,{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(be,{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(Iu,{})]})}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(be,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsx(be,{children:W.jsx(He,{variant:"large",color:"text80",children:"Networks"})}),W.jsx(be,{width:"full",marginTop:"4",paddingBottom:"4",children:W.jsxs(vwe,{value:o,onValueChange:f=>a(f),children:[W.jsx(be,{marginBottom:"10",children:W.jsx(pwe,{value:o,tabs:[{label:"Networks",value:Ft.MAINNET},{label:"Test Networks",value:Ft.TESTNET}]})}),W.jsx(zB,{value:Ft.MAINNET,children:W.jsxs(be,{flexDirection:"column",gap:"2",children:[W.jsxs(be,{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(M$,{network:f},u))})]})}),W.jsx(zB,{value:Ft.TESTNET,children:W.jsx(be,{flexDirection:"column",gap:"2",children:s.map((f,u)=>W.jsx(M$,{network:f},u))})})]})})]})}function oS({symbol:t,chainId:e,to:r,amount:n}){return W.jsxs(be,{flexDirection:"column",width:"full",gap:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Pending transaction"}),W.jsxs(be,{background:"backgroundMuted",flexDirection:"row",width:"full",height:"fit",borderRadius:"sm",paddingX:"4",paddingY:"2",alignItems:"center",gap:"5",children:[W.jsx(ch,{size:"md"}),W.jsxs(be,{flexDirection:"column",gap:"1",children:[W.jsxs(be,{flexDirection:"row",alignItems:"center",gap:"1",children:[W.jsxs(He,{variant:"small",color:"text100",children:["Sending ",n," ",t," on"]}),W.jsx(ME,{chainId:e,paddingTop:"0",paddingBottom:"1"}),W.jsxs(He,{variant:"small",color:"text80",children:["to ",r]})]}),W.jsx(He,{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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",paddingX:"16",paddingBottom:"1",children:"Select an external wallet to send transactions"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{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(be,{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(He,{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(be,{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(He,{variant:"normal",color:"text100",children:a.info.name})]})},a.info.uuid))]})]})})}function wFe({collectibleInfo:t,onClose:e}){var y,b,I;const r=GP("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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(be,{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(lh((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(He,{variant:"small",color:"text50",children:["Current balance:"," ",lh((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(be,{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(ZT,{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(be,{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=GP("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(be,{flexDirection:"column",paddingY:"5",alignItems:"center",children:[W.jsxs(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(be,{style:{minWidth:r?"100vw":"520px"},paddingX:"6",flexDirection:"column",gap:"4",width:"full",marginTop:"6",children:[W.jsxs(be,{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(lh(t==null?void 0:t.balance,((b=t==null?void 0:t.contractInfo)==null?void 0:b.decimals)??18))}})}),W.jsxs(He,{variant:"small",color:"text50",children:["Current balance:"," ",lh(t==null?void 0:t.balance,((y=t==null?void 0:t.contractInfo)==null?void 0:y.decimals)??18)]})]}),W.jsxs(be,{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(ZT,{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(be,{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=tk();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(be,{marginTop:"2",children:[W.jsx(qA,{onClick:t,children:W.jsx(be,{padding:"1",children:W.jsx(He,{variant:"normal",fontWeight:"bold",children:"Token List"})})}),W.jsx(qA,{disabled:!0,children:W.jsx(be,{width:"16",children:W.jsx(Iu,{color:"white"})})}),W.jsx(qA,{onClick:()=>{e.logout(),r("/")},children:W.jsx(be,{padding:"1",children:W.jsx(He,{variant:"normal",fontWeight:"bold",children:"Log out"})})})]})})]})}function CFe(){const t=Pr(Ix),e=yn(t.userAddedTokens);return W.jsxs(be,{flexDirection:"column",paddingY:"4",paddingX:"8",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",children:[W.jsxs(be,{flexDirection:"column",alignItems:"center",gap:"4",marginBottom:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Token List"}),W.jsx(He,{variant:"normal",color:"text50",children:"Tokens added by you can be removed here"})]}),W.jsxs(be,{width:"full",height:"full",flexDirection:"column",marginTop:"4",paddingBottom:"12",gap:"4",children:[e.length===0&&W.jsx(be,{height:"full",alignItems:"center",justifyContent:"center",children:W.jsx(He,{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(be,{flexDirection:"column",gap:"2",children:[W.jsx(He,{variant:"medium",color:"text80",children:r.symbol}),W.jsx(He,{variant:"normal",color:"text50",children:r.address}),W.jsx(ME,{chainId:r.chainId})]}),W.jsx(be,{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:dh.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(be,{children:W.jsx(He,{variant:"medium",color:"text80",children:"Import ERC20 Token"})}),W.jsxs(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{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(be,{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=lh(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(be,{flexDirection:"row",alignItems:"center",children:[W.jsx(He,{variant:"medium",color:"text80",children:((a=e.contractInfo)==null?void 0:a.symbol)??"Native Token"}),W.jsx(be,{marginLeft:"auto",children:W.jsx(He,{color:"text80",children:s})})]}),W.jsxs(be,{flexDirection:"row",children:[W.jsx(ME,{chainId:e.chainId}),W.jsxs(be,{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===dh.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(be,{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(be,{marginTop:"4",alignItems:"center",justifyContent:"center",children:W.jsx(ch,{size:"lg"})})]}),c&&W.jsx(AFe,{onClose:()=>l(!1)}),!c&&W.jsx(be,{width:"full",alignItems:"center",justifyContent:"center",marginBottom:"4",children:W.jsx(Xt,{label:"Import token",leftIcon:jH,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(be,{children:r&&W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(He,{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(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:r.app}),W.jsxs(be,{flexDirection:"row",alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Network"}),W.jsx(He,{variant:"md",color:"text100",children:`${My(Number(r.networkId))}`})]}),W.jsxs(be,{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(be,{flexDirection:"column",gap:"2",children:[t.length!==0&&W.jsx(He,{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(He,{variant:"normal",fontWeight:"bold",color:"text100",children:r.peer.metadata.name}),W.jsxs(be,{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:Hg,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(be,{children:n&&W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"4",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to sign this message?"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(He,{variant:"md",color:"text100",children:a})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(be,{alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Network"}),W.jsx(He,{variant:"md",color:"text100",children:`${My(n.chainId)}`})]}),W.jsxs(qr,{flexDirection:"column",gap:"4",children:[W.jsx(He,{variant:"md",color:"text100",children:"Signee"}),W.jsx(qr,{children:W.jsx(He,{variant:"md",color:"text100",children:`${i}`})})]}),W.jsx(HH,{label:"Message Content",children:W.jsx(qr,{children:W.jsx(He,{variant:"code",color:"text80",style:{overflowWrap:"anywhere",whiteSpace:"pre-wrap"},children:s})})}),W.jsxs(be,{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(KM),[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,$v,L);try{const ie=await F.symbol();s("ERC20"),l({name:ie});const K=new Fi($v).parseTransaction({data:S}),k=await F.decimals();u(Number(lh(K==null?void 0:K.args[1],k??18)));return}catch{}const z=new Nn(O,C9e,L);if(await z.supportsInterface("0x80ac58cd")){s("ERC721");const ie=new Nn(O,dM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).tokenId.toString();a(K);const k=await ie.name();l({name:k});return}if(await z.supportsInterface("0xd9b67a26")){s("ERC1155");const ie=new Nn(O,hM,L),K=ie.interface.decodeFunctionData("safeTransferFrom",S).id.toString();a(K);const k=await ie.uri(K);l({name:k});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(be,{children:y&&W.jsx(be,{children:W.jsxs(be,{flexDirection:"column",padding:"10",gap:"4",children:[W.jsx(He,{alignSelf:"center",variant:"md",fontWeight:"bold",color:"text100",children:"Would you like to approve this transaction?"}),W.jsx(Iu,{color:"gradientPrimary",width:"full",height:"px"}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Requested at"}),W.jsx(He,{variant:"md",color:"text100",children:p})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[W.jsx(He,{variant:"md",color:"text100",children:"Origin"}),W.jsxs(be,{alignItems:"center",gap:"3",children:[W.jsx(He,{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(He,{variant:"md",color:"text100",children:"Token Standard"}),W.jsx(He,{variant:"md",color:"text100",children:`${i}`})]}),i==="ERC721"||i==="ERC1155"&&W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Token ID"}),W.jsx(He,{variant:"md",color:"text100",children:`${o}`})]}),W.jsxs(qr,{flexDirection:"row",justifyContent:"space-between",children:[W.jsx(He,{variant:"md",color:"text100",children:"Amount"}),W.jsx(He,{variant:"md",color:"text100",children:`${f??0} ${c.name}`})]}),W.jsx(HH,{label:"Transaction Data",children:W.jsx(be,{flexDirection:"column",gap:"2",children:y.txn.map((S,O)=>W.jsx(qr,{children:W.jsx(He,{variant:"code",color:"text80",style:{whiteSpace:"pre-wrap"},children:JSON.stringify(S,null,4)||"Native token transfer"})},O))})}),W.jsxs(be,{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(be,{children:W.jsxs(be,{flexDirection:"column",padding:"10",alignItems:"center",gap:"6",children:[W.jsx(He,{variant:"md",fontWeight:"bold",color:"text100",children:"Warning:"}),W.jsx(be,{flexDirection:"column",children:W.jsx(qr,{children:W.jsxs(He,{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 vh(e)=="symbol"?e:e+""}function BFe(t,e){if(vh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}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)}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: "+vh(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: "+vh(t)+". Please use a boolean."):(jte=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function UFe(){if((typeof window>"u"?"undefined":vh(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 R$(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ute(t){return R$(t)?Object.keys(t).reduce(function(e,r){var n=R$(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||vd(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 vd(t){"@babel/helpers - typeof";return vd=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},vd(t)}var O$=HFe.log;function WFe(t,e){var r=t&&t.navigator;if(r.mediaDevices){var n=function(l){if(vd(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=vd(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&&vd(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&&vd(l.video)==="object"){var p=l.video.facingMode;p=p&&(vd(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),O$("chrome: "+JSON.stringify(l)),f(l)})}l.video=n(l.video)}return O$("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||Wv(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 Wv(t){"@babel/helpers - typeof";return Wv=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},Wv(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 Wv(c)==="object"&&Wv(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"&&Wv(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||gh(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 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)}function eje(t){if(!(gh(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(!(gh(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 D$=["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=N$(t);let r=0,n=D$.length-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=D$[i],o=N$(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 B$=new WeakMap;function YM(t,e){var r;const n=B$.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 B$.set(t,{moduleOverrides:i,modulePromise:s}),s}async function wje(t,e,r=uy){const n={...uy,...r},i=await YM(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,le,K,k,R,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=le=new Uint16Array(q),i.HEAP32=K=new Int32Array(q),i.HEAPU32=k=new Uint32Array(q),i.HEAPF32=R=new Float32Array(q),i.HEAPF64=v=new Float64Array(q)}var M=[],N=[],x=[];function E(){var q=i.preRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(P)),Qe(M)}function w(){Qe(N)}function T(){var q=i.postRun;q&&(typeof q=="function"&&(q=[q]),q.forEach(oe)),Qe(x)}function P(q){M.unshift(q)}function H(q){N.unshift(q)}function oe(q){x.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 B="data:application/octet-stream;base64,",te=q=>q.startsWith(B);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(),o1=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){k[this.ptr+4>>2]=V}get_type(){return k[this.ptr+4>>2]}set_destructor(V){k[this.ptr+8>>2]=V}get_destructor(){return k[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){k[this.ptr+16>>2]=V}get_adjusted_ptr(){return k[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(k[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,Ge=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||Ge(`type "${ae}" must have a positive integer typeid pointer`),Ot.hasOwnProperty(q)){if(re.ignoreDuplicateRegistrations)return;Ge(`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}Ge(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&&Ge("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&&Ge("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&&Ge("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)&&Ge(`Cannot register public name '${q}' twice`),fo(i,q,q),i.hasOwnProperty(re)&&Ge(`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,n1=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||Ge(`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&&Ge(`null is not a valid ${this.name}`),0;V.$$||Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`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&&Ge(`null is not a valid ${this.name}`),this.isSmartPointer?(re=this.rawConstructor(),q!==null&&q.push(this.rawDestructor,re),re):0;(!V||!V.$$)&&Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&Ge(`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&&Ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?re=V.$$.smartPtr:Ge(`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:Ge("Unsupporting sharing policy")}return re}function of(q,V){if(V===null)return this.isReference&&Ge(`null is not a valid ${this.name}`),0;V.$$||Ge(`Cannot pass "${ce(V)}" as a ${this.name}`),V.$$.ptr||Ge(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&Ge(`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 i1=()=>{Object.assign(Du.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 Du(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)},s1=(q,V,re)=>{q=q.replace(/p/g,"i");var ae=i["dynCall_"+q];return ae(V,...re)},cc=[],o1,gr=q=>{var V=cc[q];return V||(q>=cc.length&&(cc.length=q+1),cc[q]=V=o1.get(q)),V},Nu=function(q,V){let re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(q.includes("j"))return s1(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"&&Ge(`unknown function pointer with signature ${q}: ${V}`),ae},a1=(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([", "]))},c1=(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=n1(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),E1=0;E1{for(var re=[],ae=0;ae>2]);return re};function l1(q){for(var V=1;V{var Se=Bu(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},f1=(q,V,re,ae,ve,me,Se,Ae,Be,Ye)=>{var st=Bu(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,Lu=()=>{$o.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=Vy},uo={toValue:q=>(q||Ge("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),u1=(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(le[ae>>1])};case 4:return re?function(ae){return this.fromWireType(K[ae>>2])}:function(ae){return this.fromWireType(k[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:u1(V,re,ae),destructorFunction:null}),$s(V,ve)},Hr=(q,V)=>{var re=Ot[q];return re===void 0&&Ge(`${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},ce=q=>{if(q===null)return"null";var V=typeof q;return V==="object"||V==="array"||V==="function"?q.toString():""+q},xe=(q,V)=>{switch(V){case 4:return function(re){return this.fromWireType(R[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:xe(V,re),destructorFunction:null})},gt=(q,V,re,ae,ve,me,Se,Ae)=>{var Be=Bu(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=>le[ae>>1];case 4:return re?ae=>K[ae>>2]:ae=>k[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=k[Se>>2],Be=k[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=k[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),Ge("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)&&le[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=>le[Ae>>1]):V===4&&(ae=fi,ve=RE,Se=ho,me=Ae=>k[Ae>>2]),Et(q,{name:re,fromWireType:Ae=>{for(var Be=k[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"&&Ge(`Cannot pass non-string to C++ string type ${re}`);var Ye=Se(Be),st=zh(4+Ye+V);return k[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})},d1=(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},h1=()=>{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(h1()):(q=DE(q),uo.toHandle(h1()[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,p1=(q,V,re)=>{var ae=[],ve=q.toWireType(ae,re);return ae.length&&(k[V>>2]=uo.toHandle(ae)),ve},Fu=(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);k[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",ju=()=>{if(!ju.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]}`);ju.strings=ae}return ju.strings},Vs=(q,V)=>{for(var re=0;re{var re=0;return ju().forEach((ae,ve)=>{var me=V+re;k[q+ve*4>>2]=me,Vs(ae,me),re+=ae.length+1}),0},Vh=(q,V)=>{var re=ju();k[q>>2]=re.length;var ae=0;return re.forEach(ve=>ae+=ve.length+1),k[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=k[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(),i1(),Lh=i.UnboundTypeError=a1(Error,"UnboundTypeError"),Lu();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:c1,sa:lc,E:f1,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:d1,ja:Hy,T:tl,xa:cf,ya:NE,U:Fu,Y:FE,Z:Gx,ra:Wx,da:Wy,ha:Yy,ea:Qy,fa:Vh,ia:Yx,$:Qx,S:VE,J:y1,C:ZE,Q:Uu,R:rl,r:v1,b:GE,D:g1,la:m1,c:Oe,ka:XE,h:YE,i:Lr,s:Yn,N:$u,w:Xy,I:tC,K:JE,z:r2,H:w1,aa:x1,_:i2,l:Pe,f:we,e:KE,g:WE,M:b1,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 Uu(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 we(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 v1(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 $u(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 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 y1(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 m1(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 b1(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 w1(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 x1(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,E(),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 YM(QM,t)}async function Cje(t,e){return wje(QM,t,e)}async function Aje(t,e){return xje(QM,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]),SI=new Map(Jte);function _je(t){for(const[e,r]of SI)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 L$(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 _I 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(!SI.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 L$(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=>SI.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 L$(r,"Failed to execute 'detect' on 'BarcodeDetector'")}}}N3=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=_I);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 F$=t=>!are(t)&&!Array.isArray(t)&&cre(t)&&!lb(t),j$=t=>are(t)||!cre(t);function lre(t,e){if(j$(t)||j$(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)||F$(s)&&F$(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),M=D.useRef(null),[N,x]=D.useState({}),[E,w]=D.useState({}),T=D.useCallback(async(X,G)=>{var Z,ee,B;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()),x((B=(ee=fe==null?void 0:fe.getCapabilities)===null||ee===void 0?void 0:ee.call(fe))!==null&&B!==void 0?B:{}),m.current=te,M.current=fe,{type:"start",data:{videoEl:X,stream:te,constraints:G}}},[]),P=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,M.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:B,stream:te,constraints:fe}}=ee;return Z||X!==B||G!==fe?P(B,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,P]),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 P(G,Z)}),(await v.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[P]),j=D.useCallback(async X=>{const G=M.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();x(Z),w(ee)}},[]);return D.useEffect(()=>()=>{(async()=>await oe())()},[oe]),{capabilities:N,settings:E,startCamera:H,stopCamera:oe,updateConstraints:j}}(),{startScanning:ie,stopScanning:le}=function(v){const{videoElementRef:m,onScan:M,onFound:N,retryDelay:x=100,scanDelay:E=0,formats:w=[],audio:T=!0,allowMultiple:P=!1}=v,H=D.useRef(new _I({formats:w})),oe=D.useRef(null),j=D.useRef(null);D.useEffect(()=>{H.current=new _I({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:B,lastScanHadContent:te}=G;if(Z-ee!B.includes(De.rawValue)),_e=fe.length>0;let Re=G.lastOnScan;(Ee||P&&_e&&Z-Re>=E)&&(T&&oe.current&&oe.current.paused&&oe.current.play().catch(De=>console.error("Error playing the sound",De)),Re=Z,M(fe)),_e&&N(fe),!_e&&te&&N(fe);const Te={lastScan:Z,lastOnScan:Re,lastScanHadContent:_e,contentBefore:Ee?fe.map(De=>De.rawValue):B};j.current=window.requestAnimationFrame(X(Te))}}},[m.current,M,N,x]);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,M,N,x){const E=N;if(E==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const w=M;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||x===void 0)O6(E);else{const T=w.offsetWidth,P=w.offsetHeight,H=w.videoWidth,oe=w.videoHeight,j=Math.max(T/H,P/oe),X=H*j,G=oe*j,Z=X/H,ee=G/oe,B=(T-X)/2,te=(P-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+B),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})}});E.width=w.offsetWidth,E.height=w.offsetHeight;const Re=E.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.");x(_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&&(le(),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]),k=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 M=m.getContext("2d");if(M==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(N){p==null||p(N),console.error("error",N)}}else m.width=v.videoWidth,m.height=v.videoHeight,M.drawImage(v,0,0,v.videoWidth,v.videoHeight),await $.stopCamera(),F(!1)};D.useEffect(()=>{(async()=>await k())()},[K]);const R=D.useMemo(()=>K.shouldStream&&L,[K.shouldStream,L]);return D.useEffect(()=>{if(R){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()}},[R]),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 k(),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(be,{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",minHeight:"500px"}}}),W.jsxs(be,{children:[W.jsx(Wn,{label:"Paste Connection String",labelLocation:"top",name:"signClientUri",value:r??"",onChange:s=>{n(s.target.value)}}),W.jsx(be,{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=GP("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),[le,K]=D.useState(!1),[k,R]=D.useState(!1),[v,m]=D.useState(!1),[M,N]=D.useState(!1),[x,E]=D.useState(!1),[w,T]=D.useState(!1),P=yn(n.signClientWarningType),H=Te=>{_(void 0),n.isSendingCollectibleTransaction.set(void 0),F(Te),N(!0)},oe=Te=>{F(void 0),n.isSendingTokenTransaction.set(void 0),_(Te),E(!0)},j=async(Te=!1)=>{(p===void 0||Te)&&R(!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 P$(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 P$(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 B(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(be,{flexDirection:"column",background:"backgroundPrimary",width:"full",height:"full",alignItems:"center",justifyContent:"center",children:[W.jsxs(be,{flexDirection:"row",width:"full",background:"backgroundMuted",paddingX:"8",paddingY:"4",alignItems:"center",children:[W.jsx("img",{src:pM,alt:"Sequence Logo",width:"40"}),W.jsxs(be,{marginLeft:"auto",children:[W.jsx(Xt,{label:"Networks",variant:"text",marginRight:"8",onClick:()=>ie(!0)}),W.jsx(EFe,{onTokenListClick:()=>K(!0)})]})]}),W.jsxs(be,{width:"full",paddingX:"8",style:{maxWidth:"800px"},marginBottom:"16",children:[W.jsxs(qr,{flexDirection:"column",alignItems:"center",padding:"6",marginTop:"10",children:[W.jsx(He,{variant:"large",color:"text80",marginBottom:"4",children:"Your recovered wallet address"}),W.jsx(He,{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(He,{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(be,{flexDirection:"row",alignItems:"center",gap:"2",children:W.jsxs(be,{flexDirection:"column",alignItems:"center",gap:"2",children:[W.jsxs(be,{flexDirection:"row",gap:"2",children:[W.jsx("img",{src:p.info.icon,alt:p.info.name,style:{width:"20px",height:"20px"}}),W.jsx(He,{variant:"normal",color:"text100",children:p.info.name})]}),g&&W.jsxs(He,{variant:"normal",color:"text100",children:["(",g,")"]}),W.jsxs(be,{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(be,{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(be,{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(be,{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(be,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsxs(be,{width:"full",flexDirection:"row",alignItems:"center",marginBottom:"4",children:[W.jsx(He,{variant:"large",color:"text80",children:"Coins"}),W.jsx(be,{marginLeft:"auto",children:W.jsx(swe,{label:"Filter zero balances",checked:S,onCheckedChange:O})})]}),W.jsx(IFe,{filterZeroBalances:S,onSendClick:H})]}),W.jsxs(be,{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",marginTop:"8",children:[W.jsx(He,{variant:"large",color:"text80",marginBottom:"4",children:"Collectibles"}),W.jsx(gFe,{onSendClick:oe})]})]})]}),$&&W.jsx(Ec,{onClose:()=>ie(!1),children:W.jsx(mFe,{})}),le&&W.jsx(Ec,{onClose:()=>K(!1),children:W.jsx(CFe,{})}),k&&W.jsx(Ec,{size:"md",onClose:()=>R(!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)),R(!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")):B(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()}})}),P&&W.jsx(Ec,{size:"md",onClose:()=>n.signClientWarningType.set(!1),children:W.jsx(RFe,{warningType:P})}),M&&W.jsx(Ec,{size:"md",onClose:()=>N(!1),children:W.jsx(xFe,{tokenBalance:L,onClose:(Te,De)=>{N(!1),Te&&De&&G(Te,De)}})}),x&&W.jsx(Ec,{size:"md",onClose:()=>E(!1),children:W.jsx(wFe,{collectibleInfo:z,onClose:(Te,De)=>{E(!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:"/",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 4aca91b..ce25962 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Sequence Wallet Recovery - +