From 535ed815bf02ff40ef9fdb5912f44ef7b089f71e Mon Sep 17 00:00:00 2001 From: innkeeping Date: Mon, 21 Oct 2024 22:20:52 -0500 Subject: [PATCH] Updates --- ...Bk-WrKMy.js => MarkdownEditor-i8hTFDFw.js} | 12 +- assets/_user.lazy-8M_haES4.js | 1 + assets/_user.lazy-C2rT8sI3.js | 28 + assets/carousel.config-B-IV_rf8.js | 1 + assets/ccip-DXiuzO4m.js | 1 - assets/ccip-DY8iYutS.js | 1 + assets/createPublicClient-Cfohbp00.js | 3 + ...e-CVqc1jrB.js => hooks.module-B4ln6dBc.js} | 2 +- assets/index-A8JLZe8e.js | 1 - assets/index-B3TQFcLX.css | 1 + assets/index-B5Pv1XMp.js | 1 - assets/index-B7VpxOmb.js | 1 - assets/index-B8ZBBeEU.js | 1 + assets/index-BIHNXQx0.js | 7 - .../{index-BK4Ob9ME.js => index-BvckYYJA.js} | 2 +- .../{index-DASPBQ9R.js => index-BvsjdEAn.js} | 4 +- assets/index-C-OIITd4.js | 3 + assets/index-C3hIRnWv.js | 1 + assets/index-C43Yg2RY.js | 1 - assets/index-C5noiB26.js | 1 - assets/index-CBbCnkZc.js | 1 + assets/index-CE1nPMQM.js | 1 - .../{index-BpiWtdP0.js => index-CEnfT4ng.js} | 2 +- assets/index-CG3ncPiq.js | 1 - assets/index-CM2WSMdR.js | 1 - assets/index-CfDvdQsj.js | 1 + assets/index-CxpOZJfG.js | 1 + assets/index-D0FpL0lt.js | 1 - assets/index-D2yzApFw.js | 1 + assets/index-D58BRKR5.js | 3 - assets/index-D6TI4Nno.js | 1 + assets/index-D8OIyjTI.js | 7 + assets/index-D93eCjLG.js | 1 - assets/index-DHgdPR2R.js | 1 - assets/index-DHo_2D51.js | 1 + assets/index-DMnbdnsj.js | 1 - assets/index-DMvc0v07.js | 1 + assets/index-DQLbHeQa.css | 1 - .../{index-Bcq5aE4i.js => index-DRDR3tf1.js} | 2 +- .../{index-Bn7sbfQV.js => index-DSHVXTMI.js} | 4 +- assets/index-DaPtt4Xr.js | 1 + .../{index-Dje23Sct.js => index-Dk-UNE0C.js} | 1966 ++++++--------- assets/index-DuayBvKr.js | 1 + assets/index-Dz1hz39G.js | 1 + assets/index-GELomcY8.js | 1 + assets/index-U6IpoprS.js | 1 - assets/index-v3G8vvJw.js | 1 + assets/index.lazy-Bi0RnwqO.js | 1 + assets/index.lazy-BqQPRno_.js | 1 + assets/index.lazy-C71-UQbD.js | 1 + assets/index.lazy-CMTI4f6x.js | 68 + assets/index.lazy-Cf4BJ7np.js | 1 - assets/index.lazy-D7Gh5HMF.js | 2197 ----------------- assets/index.lazy-DuPpiF-W.js | 1 + assets/index.lazy-k3vVhG3m.js | 1 + assets/isAddressEqual-CzhKTe3O.js | 1 - assets/isAddressEqual-Dn7cKeu3.js | 1 + ...56k1-B-W0FJZ_.js => secp256k1-DDh0VLbn.js} | 2 +- assets/useAccount-C9KkC4ZK.js | 18 + assets/utils-CaYZp6PS.js | 2111 ++++++++++++++++ ...odal-DG2UkRHg.js => w3m-modal-z0Fgb4-A.js} | 8 +- index.html | 5 +- 62 files changed, 3040 insertions(+), 3455 deletions(-) rename assets/{MarkdownEditor-Bk-WrKMy.js => MarkdownEditor-i8hTFDFw.js} (96%) create mode 100644 assets/_user.lazy-8M_haES4.js create mode 100644 assets/_user.lazy-C2rT8sI3.js create mode 100644 assets/carousel.config-B-IV_rf8.js delete mode 100644 assets/ccip-DXiuzO4m.js create mode 100644 assets/ccip-DY8iYutS.js create mode 100644 assets/createPublicClient-Cfohbp00.js rename assets/{hooks.module-CVqc1jrB.js => hooks.module-B4ln6dBc.js} (99%) delete mode 100644 assets/index-A8JLZe8e.js create mode 100644 assets/index-B3TQFcLX.css delete mode 100644 assets/index-B5Pv1XMp.js delete mode 100644 assets/index-B7VpxOmb.js create mode 100644 assets/index-B8ZBBeEU.js delete mode 100644 assets/index-BIHNXQx0.js rename assets/{index-BK4Ob9ME.js => index-BvckYYJA.js} (99%) rename assets/{index-DASPBQ9R.js => index-BvsjdEAn.js} (91%) create mode 100644 assets/index-C-OIITd4.js create mode 100644 assets/index-C3hIRnWv.js delete mode 100644 assets/index-C43Yg2RY.js delete mode 100644 assets/index-C5noiB26.js create mode 100644 assets/index-CBbCnkZc.js delete mode 100644 assets/index-CE1nPMQM.js rename assets/{index-BpiWtdP0.js => index-CEnfT4ng.js} (98%) delete mode 100644 assets/index-CG3ncPiq.js delete mode 100644 assets/index-CM2WSMdR.js create mode 100644 assets/index-CfDvdQsj.js create mode 100644 assets/index-CxpOZJfG.js delete mode 100644 assets/index-D0FpL0lt.js create mode 100644 assets/index-D2yzApFw.js delete mode 100644 assets/index-D58BRKR5.js create mode 100644 assets/index-D6TI4Nno.js create mode 100644 assets/index-D8OIyjTI.js delete mode 100644 assets/index-D93eCjLG.js delete mode 100644 assets/index-DHgdPR2R.js create mode 100644 assets/index-DHo_2D51.js delete mode 100644 assets/index-DMnbdnsj.js create mode 100644 assets/index-DMvc0v07.js delete mode 100644 assets/index-DQLbHeQa.css rename assets/{index-Bcq5aE4i.js => index-DRDR3tf1.js} (99%) rename assets/{index-Bn7sbfQV.js => index-DSHVXTMI.js} (92%) create mode 100644 assets/index-DaPtt4Xr.js rename assets/{index-Dje23Sct.js => index-Dk-UNE0C.js} (56%) create mode 100644 assets/index-DuayBvKr.js create mode 100644 assets/index-Dz1hz39G.js create mode 100644 assets/index-GELomcY8.js delete mode 100644 assets/index-U6IpoprS.js create mode 100644 assets/index-v3G8vvJw.js create mode 100644 assets/index.lazy-Bi0RnwqO.js create mode 100644 assets/index.lazy-BqQPRno_.js create mode 100644 assets/index.lazy-C71-UQbD.js create mode 100644 assets/index.lazy-CMTI4f6x.js delete mode 100644 assets/index.lazy-Cf4BJ7np.js delete mode 100644 assets/index.lazy-D7Gh5HMF.js create mode 100644 assets/index.lazy-DuPpiF-W.js create mode 100644 assets/index.lazy-k3vVhG3m.js delete mode 100644 assets/isAddressEqual-CzhKTe3O.js create mode 100644 assets/isAddressEqual-Dn7cKeu3.js rename assets/{secp256k1-B-W0FJZ_.js => secp256k1-DDh0VLbn.js} (95%) create mode 100644 assets/useAccount-C9KkC4ZK.js create mode 100644 assets/utils-CaYZp6PS.js rename assets/{w3m-modal-DG2UkRHg.js => w3m-modal-z0Fgb4-A.js} (93%) diff --git a/assets/MarkdownEditor-Bk-WrKMy.js b/assets/MarkdownEditor-i8hTFDFw.js similarity index 96% rename from assets/MarkdownEditor-Bk-WrKMy.js rename to assets/MarkdownEditor-i8hTFDFw.js index 7317cc4..908852b 100644 --- a/assets/MarkdownEditor-Bk-WrKMy.js +++ b/assets/MarkdownEditor-i8hTFDFw.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DASPBQ9R.js","assets/index-Dje23Sct.js","assets/index-DQLbHeQa.css","assets/index.lazy-D7Gh5HMF.js","assets/isAddressEqual-CzhKTe3O.js","assets/secp256k1-B-W0FJZ_.js","assets/index-lHEOM186.css","assets/index-B5Pv1XMp.js","assets/index-BIHNXQx0.js","assets/index-C5noiB26.js","assets/index-U6IpoprS.js","assets/index-CM2WSMdR.js","assets/index-C43Yg2RY.js","assets/index-A8JLZe8e.js","assets/index-D58BRKR5.js","assets/index-DHgdPR2R.js","assets/index-D93eCjLG.js","assets/index-CG3ncPiq.js","assets/index-D0FpL0lt.js","assets/index-B7VpxOmb.js","assets/dockerfile-BuNIbK2j.js","assets/simple-mode-C4Nsj8zu.js","assets/factor-D8pE9siL.js","assets/nsis-CEAdamBV.js","assets/pug-BmUsPMDj.js","assets/javascript-iSgyE4tI.js","assets/index-DMnbdnsj.js","assets/index-CE1nPMQM.js"])))=>i.map(i=>d[i]); -import{b6 as w,e as k,j as R,cM as Lo,g as dC,cN as v7,cO as w7,b8 as V,f as vx}from"./index-Dje23Sct.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,a as eu,m as on,b as Ar,f as li,e as $r,u as Pi,g as Jn,h as _l,v as k7,E as C7,t as pC,i as _7,j as P7,k as T7,l as E7}from"./index.lazy-D7Gh5HMF.js";var $7=Object.defineProperty,A7=(n,e,t)=>e in n?$7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ai=(n,e,t)=>(A7(n,typeof e!="symbol"?e+"":e,t),t);let Q7=class gC{constructor(e=new Map){this.map=e}clone(){return new gC(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},tu=class{constructor(){Ai(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function vo(n,e){return e(n),n}function n1(){}function kx(n,e){return n===e}const Bf=new Map;let R7=class{constructor(e={}){Ai(this,"subscriptions",new tu),Ai(this,"singletonSubscriptions",new Map),Ai(this,"graph",new tu),Ai(this,"state",new Map),Ai(this,"distinctNodes",new Map),Ai(this,"executionMaps",new Map),Ai(this,"definitionRegistry",new Set);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?kx:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?kx:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!==void 0&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.subscriptions.use(u,p=>{for(const g of p)g(d)}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vo(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return vo(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Bf.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vo(t.type==="cell"?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{t.init(this,r)}))}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new tu,s=new Q7,o=new tu,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function be(n,e=n1,t=!0){return vo(Symbol(),r=>{Bf.set(r,{type:"cell",distinct:t,initial:n,init:e})})}function gt(n=n1,e=!1){return vo(Symbol(),t=>{Bf.set(t,{type:"signal",distinct:e,init:n})})}function os(n=n1){return vo(Symbol(),e=>{Bf.set(e,{type:"signal",distinct:!1,init:n})})}const mC=w.createContext(null);function lc(){const n=w.useContext(mC);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function Nt(n){const e=lc();e.register(n);const t=w.useCallback(r=>e.sub(n,r),[e,n]);return w.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function yt(...n){const e=lc(),t=w.useMemo(()=>e.getValues(n),[]),r=w.useRef(t),i=w.useCallback(s=>{const o=l=>{r.current=l,s()};return e.subMultiple(n,o)},[e,...n]);return w.useSyncExternalStore(i,()=>r.current,()=>r.current)}function at(n){const e=lc();return e.register(n),w.useCallback(t=>{e.pub(n,t)},[e,n])}function ui(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function ct(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function OC(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function ac(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function bC(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function M7(n,e){return e(n),n}function Es(){}function Nn(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function L7({children:n,plugins:e}){const t=w.useMemo(()=>M7(new R7,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return w.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),w.createElement(mC.Provider,{value:t},n)}function I7(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D7=I7(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;ti.map(i=>d[i]); +import{X as w,f as k,j as R,cN as Lo,q as dC,cO as v7,cP as w7,Z as V,o as vx}from"./index-Dk-UNE0C.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,a as eu,m as on,b as Ar,f as li,e as $r,u as Pi,g as Jn,h as _l,v as k7,E as C7,t as pC,i as _7,j as P7,k as T7}from"./index.lazy-CMTI4f6x.js";import{b as E7}from"./utils-CaYZp6PS.js";var $7=Object.defineProperty,A7=(n,e,t)=>e in n?$7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ai=(n,e,t)=>(A7(n,typeof e!="symbol"?e+"":e,t),t);let Q7=class gC{constructor(e=new Map){this.map=e}clone(){return new gC(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},tu=class{constructor(){Ai(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function vo(n,e){return e(n),n}function n1(){}function kx(n,e){return n===e}const Bf=new Map;let R7=class{constructor(e={}){Ai(this,"subscriptions",new tu),Ai(this,"singletonSubscriptions",new Map),Ai(this,"graph",new tu),Ai(this,"state",new Map),Ai(this,"distinctNodes",new Map),Ai(this,"executionMaps",new Map),Ai(this,"definitionRegistry",new Set);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?kx:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?kx:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!==void 0&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.subscriptions.use(u,p=>{for(const g of p)g(d)}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vo(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return vo(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Bf.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vo(t.type==="cell"?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{t.init(this,r)}))}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new tu,s=new Q7,o=new tu,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function be(n,e=n1,t=!0){return vo(Symbol(),r=>{Bf.set(r,{type:"cell",distinct:t,initial:n,init:e})})}function gt(n=n1,e=!1){return vo(Symbol(),t=>{Bf.set(t,{type:"signal",distinct:e,init:n})})}function os(n=n1){return vo(Symbol(),e=>{Bf.set(e,{type:"signal",distinct:!1,init:n})})}const mC=w.createContext(null);function lc(){const n=w.useContext(mC);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function Nt(n){const e=lc();e.register(n);const t=w.useCallback(r=>e.sub(n,r),[e,n]);return w.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function yt(...n){const e=lc(),t=w.useMemo(()=>e.getValues(n),[]),r=w.useRef(t),i=w.useCallback(s=>{const o=l=>{r.current=l,s()};return e.subMultiple(n,o)},[e,...n]);return w.useSyncExternalStore(i,()=>r.current,()=>r.current)}function at(n){const e=lc();return e.register(n),w.useCallback(t=>{e.pub(n,t)},[e,n])}function ui(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function ct(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function OC(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function ac(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function bC(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function M7(n,e){return e(n),n}function Es(){}function Nn(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function L7({children:n,plugins:e}){const t=w.useMemo(()=>M7(new R7,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return w.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),w.createElement(mC.Provider,{value:t},n)}function I7(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D7=I7(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;to8;try{An(n,()=>{const i=le()||function(f){return f.getEditorState().read(()=>{const d=le();return d!==null?d.clone():null})}(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f0){let y=0;for(let v=0;v0)for(const[f,d]of s)if(z(d)){const p=d.getChildrenKeys();let g=f.firstChild;for(let m=0;m0){for(let f=0;f{TC(n,e,t)})}function _x(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style;return!(t!==null&&t!==s||r!==null&&r!==o||i!==null&&i!==l)}function Px(n,e){const t=n.mergeWithSibling(e),r=pt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Tx(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&oe(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(_x(e,r)){r=Px(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&oe(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(_x(r,t)){r=Px(r,t);break}break}t.remove()}}else r.remove()}function k1(n){return Ex(n.anchor),Ex(n.focus),n}function Ex(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),oe(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!z(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let u8=1;const h8=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function C1(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Xe(jr(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Kf(e)==null)}function fc(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!C1(e)&&P1(e)===n}catch{return!1}}function _1(n){return n instanceof ld}function P1(n){let e=n;for(;e!=null;){const t=Kf(e);if(_1(t))return t;e=ed(e)}return null}function Kf(n){return n?n.__lexicalEditor:null}function ao(n){return n.isToken()||n.isSegmented()}function f8(n){return n.nodeType===ls}function Th(n){let e=n;for(;e!=null;){if(f8(e))return e;e=e.firstChild}return null}function Dg(n,e,t){const r=hi[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~hi.superscript:e==="superscript"&&(i&=~hi.subscript),i}function AC(n){return oe(n)||fi(n)||Xe(n)}function QC(n,e){if(e!=null)return void(n.__key=e);bn(),s2();const t=pt(),r=ki(),i=""+u8++;r._nodeMap.set(i,n),z(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=CC,n.__key=i}function As(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling();if(i===null)if(s!==null){const o=s.getWritable();r.__first=s.__key,o.__prev=null}else r.__first=null;else{const o=i.getWritable();if(s!==null){const l=s.getWritable();l.__prev=o.__key,o.__next=l.__key}else o.__next=null;t.__prev=null}if(s===null)if(i!==null){const o=i.getWritable();r.__last=i.__key,o.__next=null}else r.__last=null;else{const o=s.getWritable();if(i!==null){const l=i.getWritable();l.__next=o.__key,o.__prev=l.__key}else o.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Eh(n){s2();const e=n.getLatest(),t=e.__parent,r=ki(),i=pt(),s=r._nodeMap,o=i._dirtyElements;t!==null&&function(a,c,u){let h=a;for(;h!==null;){if(u.has(h))return;const f=c.get(h);if(f===void 0)break;u.set(h,!1),h=f.__parent}}(t,s,o);const l=e.__key;i._dirtyType=CC,z(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function zt(n){bn();const e=pt(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=ht(t);r!==null&&r.getWritable()}if(n!==null){const r=ht(n);r!==null&&r.getWritable()}}}function Zi(){return gc()?null:pt()._compositionKey}function ht(n,e){const t=(e||ki())._nodeMap.get(n);return t===void 0?null:t}function RC(n,e){const t=n[`__lexicalKey_${pt()._key}`];return t!==void 0?ht(t,e):null}function jr(n,e){let t=n;for(;t!=null;){const r=RC(t,e);if(r!==null)return r;t=ed(t)}return null}function MC(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function $x(n){return n.read(()=>ze().getTextContent())}function ze(){return LC(ki())}function LC(n){return n._nodeMap.get("root")}function en(n){bn();const e=ki();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function mo(n){const e=pt(),t=function(r,i){let s=r;for(;s!=null;){const o=s[`__lexicalKey_${i._key}`];if(o!==void 0)return o;s=ed(s)}return null}(n,e);return t===null?n===e.getRootElement()?ht("root"):null:ht(t)}function Ax(n,e){return e?n.getTextContentSize():0}function IC(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function T1(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function DC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function NC(n){return n.nodeType===ls?n.nodeValue:null}function E1(n,e,t){const r=Xr(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=NC(i);const a=jr(i);if(l!==null&&oe(a)){if(l===Gf&&t){const c=t.length;l=t,s=c,o=c}l!==null&&$1(a,l,s,o,n)}}}function $1(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===Gf&&(l=e.slice(0,-1));const a=s.getTextContent();if(i||l!==a){if(l===""){if(zt(null),p1||Uf||g1)s.remove();else{const g=pt();setTimeout(()=>{g.update(()=>{s.isAttached()&&s.remove()})},20)}return}const c=s.getParent(),u=ol(),h=s.getTextContentSize(),f=Zi(),d=s.getKey();if(s.isToken()||f!==null&&d===f&&!o||U(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===h&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const p=le();if(!U(p)||t===null||r===null)return void s.setTextContent(l);if(p.setTextNodeRange(s,t,s,r),s.isSegmented()){const g=Ot(s.getTextContent());s.replace(g),s=g}s.setTextContent(l)}}}function d8(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(s){const o=s.getPreviousSibling();return(oe(o)||z(o)&&o.isInline())&&!o.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function Qx(n){return n==="ArrowLeft"}function Rx(n){return n==="ArrowRight"}function jl(n,e){return nr?n:e}function Mx(n){return n==="Enter"}function Pl(n){return n==="Backspace"}function Tl(n){return n==="Delete"}function Lx(n,e,t){return n.toLowerCase()==="a"&&jl(e,t)}function p8(){const n=ze();en(k1(n.select(0,n.getChildrenSize())))}function ra(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=Ph(i);return t[e]=s,s}return i}function A1(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&ue(33,s);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(o),h=u==="destroyed"&&i==="created";(u===void 0||h)&&c.set(o,h?"updated":i)}function Ix(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function Ca(n,e){const t=n.offset;if(n.type==="element")return Ix(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?Ix(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function VC(n){const e=td(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function ge(n,e,t){return l2(n,e,t)}function Jf(n){return!Ht(n)&&!n.isLastChild()&&!n.isInline()}function $h(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&ue(75,e),t}function ed(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Ng(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function td(n){const e=n._window;return e===null&&ue(78),e}function g8(n){let e=n.getParentOrThrow();for(;e!==null;){if(Qt(e))return e;e=e.getParentOrThrow()}return e}function Qt(n){return Ht(n)||z(n)&&n.isShadowRoot()}function m8(n){const e=n.constructor.clone(n);return QC(e,null),e}function Zn(n){const e=pt(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&ue(97);const i=r.replace;if(i!==null){const s=i(n);return s instanceof n.constructor||ue(98),s}return n}function op(n,e){!Ht(n.getParent())||z(e)||Xe(e)||ue(99)}function lp(n){return(Xe(n)||z(n)&&!n.canBeEmpty())&&!n.isInline()}function Q1(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function O8(n,e,t){let r=n._blockCursorElement;if(U(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,s=i.getNode(),o=i.offset;let l=!1,a=null;if(o===s.getChildrenSize())lp(s.getChildAtIndex(o-1))&&(l=!0);else{const c=s.getChildAtIndex(o);if(lp(c)){const u=c.getPreviousSibling();(u===null||lp(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(s.__key);return r===null&&(n._blockCursorElement=r=function(u){const h=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let d=h.blockCursor;if(d!==void 0){if(typeof d=="string"){const p=Ph(d);d=h.blockCursor=p}d!==void 0&&f.classList.add(...d)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Q1(r,n,e)}function Xr(n){return br?(n||window).getSelection():null}function b8(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Qt(n)&&ue(102);const r=o=>{const l=o.getParentOrThrow(),a=Qt(l),c=o!==t||a?m8(o):o;if(a)return z(o)&&z(c)||ue(133),o.insertAfter(c),[o,c,c];{const[u,h,f]=r(l),d=o.getNextSiblings();return f.append(c,...d),[u,h,c]}},[i,s]=r(t);return[i,s]}function x8(n){return ur(n)&&n.tagName==="A"}function ur(n){return n.nodeType===1}function Vg(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ah(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function co(n){if(Ht(n)||Xe(n)&&!n.isInline())return!0;if(!z(n)||Qt(n))return!1;const e=n.getFirstChild(),t=e===null||fi(e)||oe(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ap(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function y8(){return pt()}const Dx=new WeakMap,v8=new Map;function w8(n){if(!n._readOnly&&n.isEmpty())return v8;n._readOnly||ue(192);let e=Dx.get(n);if(!e){e=new Map,Dx.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let s=e.get(i);s||(s=new Map,e.set(i,s)),s.set(t,r)}}return e}function R1(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ZC(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(z(o)&&ZC(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Gi,an,_a,nd,Zg,Bg,Ls,ar,Fg,Pa,At="",ln="",Er=null,rr="",si="",BC=!1,Ta=!1,eh=null;function Qh(n,e){const t=Ls.get(n);if(e!==null){const r=Xg(n);r.parentNode===e&&e.removeChild(r)}if(ar.has(n)||an._keyToDOMMap.delete(n),z(t)){const r=Mh(t,Ls);zg(r,0,r.length-1,null)}t!==void 0&&A1(Pa,_a,nd,t,"destroyed")}function zg(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&Qh(s,r)}}function xs(n,e){n.setProperty("text-align",e)}const S8="40px";function FC(n,e){const t=Gi.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||S8;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function zC(n,e){const t=n.style;e===0?xs(t,""):e===O1?xs(t,"left"):e===b1?xs(t,"center"):e===x1?xs(t,"right"):e===y1?xs(t,"justify"):e===v1?xs(t,"start"):e===w1&&xs(t,"end")}function Rh(n,e,t){const r=ar.get(n);r===void 0&&ue(60);const i=r.createDOM(Gi,an);if(function(s,o,l){const a=l._keyToDOMMap;o["__lexicalKey_"+l._key]=s,a.set(s,o)}(n,i,an),oe(r)?i.setAttribute("data-lexical-text","true"):Xe(r)&&i.setAttribute("data-lexical-decorator","true"),z(r)){const s=r.__indent,o=r.__size;if(s!==0&&FC(i,s),o!==0){const a=o-1;(function(c,u,h,f){const d=ln;ln="",jg(c,h,0,u,f,null),XC(h,f),ln=d})(Mh(r,ar),a,r,i)}const l=r.__format;l!==0&&zC(i,l),r.isInline()||jC(null,r,i),Jf(r)&&(At+=mi,si+=mi)}else{const s=r.getTextContent();if(Xe(r)){const o=r.decorate(an,Gi);o!==null&&qC(n,o),i.contentEditable="false"}else oe(r)&&(r.isDirectionless()||(ln+=s));At+=s,si+=s}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const s=e.__lexicalLineBreak;s!=null?e.insertBefore(i,s):e.appendChild(i)}return A1(Pa,_a,nd,r,"created"),i}function jg(n,e,t,r,i,s){const o=At;At="";let l=t;for(;l<=r;++l){Rh(n[l],i,s);const a=ar.get(n[l]);a!==null&&oe(a)&&(Er===null&&(Er=a.getFormat()),rr===""&&(rr=a.getStyle()))}Jf(e)&&(At+=mi),i.__lexicalTextContent=At,At=o+At}function Nx(n,e){const t=e.get(n);return fi(t)||Xe(t)&&t.isInline()}function jC(n,e,t){const r=n!==null&&(n.__size===0||Nx(n.__last,Ls)),i=e.__size===0||Nx(e.__last,ar);if(r){if(!i){const s=t.__lexicalLineBreak;if(s!=null)try{t.removeChild(s)}catch(o){if(typeof o=="object"&&o!=null){const l=`${o.toString()} Parent: ${t.tagName}, child: ${s.tagName}.`;throw new Error(l)}throw o}t.__lexicalLineBreak=null}}else if(i){const s=document.createElement("br");t.__lexicalLineBreak=s,t.appendChild(s)}}function XC(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ln||r!==eh){const s=ln==="",o=s?eh:(i=ln,J7.test(i)?"rtl":e8.test(i)?"ltr":null);if(o!==r){const l=e.classList,a=Gi.theme;let c=r!==null?a[r]:void 0,u=o!==null?a[o]:void 0;if(c!==void 0){if(typeof c=="string"){const h=Ph(c);c=a[r]=h}l.remove(...c)}if(o===null||s&&o==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const h=Ph(u);u=a[o]=h}u!==void 0&&l.add(...u)}e.dir=o}Ta||(n.getWritable().__dir=o)}eh=o,e.__lexicalDirTextContent=ln,e.__lexicalDir=o}var i}function k8(n,e,t){const r=ln;var i;ln="",Er=null,rr="",function(s,o,l){const a=At,c=s.__size,u=o.__size;if(At="",c===1&&u===1){const h=s.__first,f=o.__first;if(h===f)Xl(h,l);else{const p=Xg(h),g=Rh(f,null,null);try{l.replaceChild(g,p)}catch(m){if(typeof m=="object"&&m!=null){const b=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${g.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(b)}throw m}Qh(h,null)}const d=ar.get(f);oe(d)&&(Er===null&&(Er=d.getFormat()),rr===""&&(rr=d.getStyle()))}else{const h=Mh(s,Ls),f=Mh(o,ar);if(c===0)u!==0&&jg(f,o,0,u-1,l,null);else if(u===0){if(c!==0){const d=l.__lexicalLineBreak==null;zg(h,0,c-1,d?null:l),d&&(l.textContent="")}}else(function(d,p,g,m,b,O){const x=m-1,y=b-1;let v,C,S=(T=O,T.firstChild),_=0,P=0;for(var T;_<=x&&P<=y;){const D=p[_],N=g[P];if(D===N)S=cp(Xl(N,O)),_++,P++;else{v===void 0&&(v=new Set(p)),C===void 0&&(C=new Set(g));const H=C.has(D),X=v.has(N);if(H)if(X){const Y=$h(an,N);Y===S?S=cp(Xl(N,O)):(S!=null?O.insertBefore(Y,S):O.appendChild(Y),Xl(N,O)),_++,P++}else Rh(N,O,S),P++;else S=cp(Xg(D)),Qh(D,O),_++}const Z=ar.get(N);Z!==null&&oe(Z)&&(Er===null&&(Er=Z.getFormat()),rr===""&&(rr=Z.getStyle()))}const M=_>x,Q=P>y;if(M&&!Q){const D=g[y+1];jg(g,d,P,y,O,D===void 0?null:an.getElementByKey(D))}else Q&&!M&&zg(p,_,x,O)})(o,h,f,c,u,l)}Jf(o)&&(At+=mi),l.__lexicalTextContent=At,At=a+At}(n,e,t),XC(e,t),No(i=e)&&Er!=null&&Er!==i.__textFormat&&!Ta&&(i.setTextFormat(Er),i.setTextStyle(rr)),function(s){No(s)&&rr!==""&&rr!==s.__textStyle&&!Ta&&s.setTextStyle(rr)}(e),ln=r}function Mh(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&ue(101),t.push(r),r=i.__next}return t}function Xl(n,e){const t=Ls.get(n);let r=ar.get(n);t!==void 0&&r!==void 0||ue(61);const i=BC||Bg.has(n)||Zg.has(n),s=$h(an,n);if(t===r&&!i){if(z(t)){const o=s.__lexicalTextContent;o!==void 0&&(At+=o,si+=o);const l=s.__lexicalDirTextContent;l!==void 0&&(ln+=l)}else{const o=t.getTextContent();oe(t)&&!t.isDirectionless()&&(ln+=o),si+=o,At+=o}return s}if(t!==r&&i&&A1(Pa,_a,nd,r,"updated"),r.updateDOM(t,s,Gi)){const o=Rh(n,null,null);return e===null&&ue(62),e.replaceChild(o,s),Qh(n,null),o}if(z(t)&&z(r)){const o=r.__indent;o!==t.__indent&&FC(s,o);const l=r.__format;l!==t.__format&&zC(s,l),i&&(k8(t,r,s),Ht(r)||r.isInline()||jC(t,r,s)),Jf(r)&&(At+=mi,si+=mi)}else{const o=r.getTextContent();if(Xe(r)){const l=r.decorate(an,Gi);l!==null&&qC(n,l)}else oe(r)&&!r.isDirectionless()&&(ln+=o);At+=o,si+=o}if(!Ta&&Ht(r)&&r.__cachedText!==si){const o=r.getWritable();o.__cachedText=si,r=o}return s}function qC(n,e){let t=an._pendingDecorators;const r=an._decorators;if(t===null){if(r[n]===e)return;t=MC(an)}t[n]=e}function cp(n){let e=n.nextSibling;return e!==null&&e===an._blockCursorElement&&(e=e.nextSibling),e}function C8(n,e,t,r,i,s){At="",si="",ln="",BC=r===Do,eh=null,an=t,Gi=t._config,_a=t._nodes,nd=an._listeners.mutation,Zg=i,Bg=s,Ls=n._nodeMap,ar=e._nodeMap,Ta=e._readOnly,Fg=new Map(t._keyToDOMMap);const o=new Map;return Pa=o,Xl("root",null),an=void 0,_a=void 0,Zg=void 0,Bg=void 0,Ls=void 0,ar=void 0,Gi=void 0,Fg=void 0,Pa=void 0,o}function Xg(n){const e=Fg.get(n);return e===void 0&&ue(75,n),e}const ti=Object.freeze({}),qg=30,Wg=[["keydown",function(n,e){if(ia=n.timeStamp,WC=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;ge(e,r1,n)||t!=null&&(function(l,a,c,u){return Rx(l)&&!a&&!u&&!c}(t,i,o,s)?ge(e,yC,n):function(l,a,c,u,h){return Rx(l)&&!u&&!c&&(a||h)}(t,i,r,o,s)?ge(e,V7,n):function(l,a,c,u){return Qx(l)&&!a&&!u&&!c}(t,i,o,s)?ge(e,i1,n):function(l,a,c,u,h){return Qx(l)&&!u&&!c&&(a||h)}(t,i,r,o,s)?ge(e,Z7,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,s)?ge(e,s1,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,s)?ge(e,o1,n):function(l,a){return Mx(l)&&a}(t,r)?(sa=!0,ge(e,Io,n)):function(l){return l===" "}(t)?ge(e,vC,n):function(l,a){return nr&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),sa=!0,ge(e,wo,!0)):function(l,a){return Mx(l)&&!a}(t,r)?(sa=!1,ge(e,Io,n)):function(l,a,c,u){return nr?!a&&!c&&(Pl(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Pl(l)}(t,o,s,i)?Pl(t)?ge(e,qf,n):(n.preventDefault(),ge(e,$s,!0)):function(l){return l==="Escape"}(t)?ge(e,uc,n):function(l,a,c,u,h){return nr?!(c||u||h)&&(Tl(l)||l.toLowerCase()==="d"&&a):!(a||u||h)&&Tl(l)}(t,i,r,o,s)?Tl(t)?ge(e,Wf,n):(n.preventDefault(),ge(e,$s,!1)):function(l,a,c){return Pl(l)&&(nr?a:c)}(t,o,i)?(n.preventDefault(),ge(e,Sa,!0)):function(l,a,c){return Tl(l)&&(nr?a:c)}(t,o,i)?(n.preventDefault(),ge(e,Sa,!1)):function(l,a){return nr&&a&&Pl(l)}(t,s)?(n.preventDefault(),ge(e,ka,!0)):function(l,a){return nr&&a&&Tl(l)}(t,s)?(n.preventDefault(),ge(e,ka,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,o,i,s)?ge(e,l1,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&jl(c,u)}(t,r,s,i)?(n.preventDefault(),ge(e,jf,void 0)):function(l,a,c,u){return nr?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,s,i)?(n.preventDefault(),ge(e,Xf,void 0)):$t(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(nr?c:u)}(t,r,s,i)?(n.preventDefault(),ge(e,Yf,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(nr?c:u)}(t,r,s,i)?(n.preventDefault(),ge(e,h1,n)):Lx(t,s,i)&&(n.preventDefault(),ge(e,Lg,n)):!Wi&&Lx(t,s,i)&&(n.preventDefault(),ge(e,Lg,n)),function(l,a,c,u){return l||a||c||u}(i,r,o,s)&&ge(e,SC,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&An(e,()=>{Xe(jr(t))||(Yg=!0)})}],["compositionstart",function(n,e){An(e,()=>{const t=le();if(U(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();zt(r.key),(n.timeStamp{up(e,n.data)})}],["input",function(n,e){n.stopPropagation(),An(e,()=>{const t=le(),r=n.data,i=GC(n);if(r!=null&&U(t)&&UC(t,i,r,n.timeStamp,!1)){El&&(up(e,r),El=!1);const s=t.anchor.getNode(),o=Xr(e._window);if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;kh&&!t.isCollapsed()&&oe(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===NC(o.anchorNode)||ge(e,So,r);const u=r.length;Wi&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),p1||Uf||g1||!e.isComposing()||(ia=0,zt(null))}else E1(!1,e,r!==null?r:void 0),El&&(up(e,r||void 0),El=!1);bn(),EC(pt())}),uo=null}],["click",function(n,e){An(e,()=>{const t=le(),r=Xr(e._window),i=ol();if(r){if(U(t)){const s=t.anchor,o=s.getNode();s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Ht(o)&&ze().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()&&(z(o)?o.select(0):o.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const s=r.anchorNode;if(s!==null){const o=s.nodeType;(o===hc||o===ls)&&en(I1(i,r,e,n))}}}ge(e,Ff,n)})}],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];kh&&Wg.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,s=GC(t);i==="deleteCompositionText"||Wi&&VC(r)||i!=="insertCompositionText"&&An(r,()=>{const o=le();if(i==="deleteContentBackward"){if(o===null){const d=ol();if(!U(d))return;en(d.clone())}if(U(o)){const d=o.anchor.key===o.focus.key;if(l=t.timeStamp,WC==="MediaLast"&&l{An(r,()=>{zt(null)})},qg),U(o)){const p=o.anchor.getNode();p.markDirty(),o.format=p.getFormat(),oe(p)||ue(142),o.style=p.getStyle()}}else{zt(null),t.preventDefault();const p=o.anchor.getNode().getTextContent(),g=o.anchor.offset===0&&o.focus.offset===p.length;W7&&d&&!g||ge(r,$s,!0)}return}}var l;if(!U(o))return;const a=t.data;uo!==null&&E1(!1,r,uo),o.dirty&&uo===null||!o.isCollapsed()||Ht(o.anchor.getNode())||s===null||o.applyDOMRange(s),uo=null;const c=o.anchor,u=o.focus,h=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ge(r,So,t);break;case"insertFromComposition":zt(null),ge(r,So,t);break;case"insertLineBreak":zt(null),ge(r,wo,!1);break;case"insertParagraph":zt(null),sa&&!Uf?(sa=!1,ge(r,wo,!1)):ge(r,wa,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ge(r,zf,t);break;case"deleteByComposition":(function(d,p){return d!==p||z(d)||z(p)||!d.isToken()||!p.isToken()})(h,f)&&ge(r,Rg,t);break;case"deleteByDrag":case"deleteByCut":ge(r,Rg,t);break;case"deleteContent":ge(r,$s,!1);break;case"deleteWordBackward":ge(r,Sa,!0);break;case"deleteWordForward":ge(r,Sa,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ge(r,ka,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ge(r,ka,!1);break;case"formatStrikeThrough":ge(r,ai,"strikethrough");break;case"formatBold":ge(r,ai,"bold");break;case"formatItalic":ge(r,ai,"italic");break;case"formatUnderline":ge(r,ai,"underline");break;case"historyUndo":ge(r,jf,void 0);break;case"historyRedo":ge(r,Xf,void 0)}else{if(a===` `)t.preventDefault(),ge(r,wo,!1);else if(a===mi)t.preventDefault(),ge(r,wa,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&UC(o,s,a,t.timeStamp,!0)?(t.preventDefault(),ge(r,So,a)):uo=a;HC=t.timeStamp}})}(n,e)]);let ia=0,WC=null,HC=0,uo=null;const Lh=new WeakMap;let Hg=!1,Yg=!1,sa=!1,El=!1,YC=[0,"",0,"root",0];function UC(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=pt(),c=Xr(a._window),u=c!==null?c.anchorNode:null,h=s.key,f=a.getElementByKey(h),d=t.length;return h!==o.key||!oe(l)||(!i&&(!kh||HC1||(i||!kh)&&f!==null&&!l.isComposing()&&u!==Th(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||d8(n,l)}function Vx(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===ls&&e!==0&&e!==n.nodeValue.length}function Zx(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Hg&&(Hg=!1,Vx(r,i)&&Vx(s,o))||An(e,()=>{if(!t)return void en(null);if(!fc(e,r,s))return;const l=le();if(U(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=td(e).event,h=u?u.timeStamp:performance.now(),[f,d,p,g,m]=YC,b=ze(),O=e.isComposing()===!1&&b.getTextContent()==="";if(hl)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},iV=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},sV=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},g5=function(n,e){return n==="v"?nV(e):rV(e)},m5=function(n,e){return n==="v"?iV(e):sV(e)},oV=function(n,e){return n==="h"&&e==="rtl"?-1:1},lV=function(n,e,t,r,i){var s=oV(n,window.getComputedStyle(e).direction),o=s*r,l=t.target,a=e.contains(l),c=!1,u=o>0,h=0,f=0;do{var d=m5(n,l),p=d[0],g=d[1],m=d[2],b=g-m-s*p;(p||b)&&g5(n,l)&&(h+=b,f+=p),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(e.contains(l)||e===l));return(u&&(Math.abs(h)<1||!i)||!u&&(Math.abs(f)<1||!i))&&(c=!0),c},gu=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Ev=function(n){return[n.deltaX,n.deltaY]},$v=function(n){return n&&"current"in n?n.current:n},aV=function(n,e){return n[0]===e[0]&&n[1]===e[1]},cV=function(n){return` .block-interactivity-`.concat(n,` {pointer-events: none;} .allow-interactivity-`).concat(n,` {pointer-events: all;} -`)},uV=0,io=[];function hV(n){var e=k.useRef([]),t=k.useRef([0,0]),r=k.useRef(),i=k.useState(uV++)[0],s=k.useState(d5)[0],o=k.useRef(n);k.useEffect(function(){o.current=n},[n]),k.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var g=AN([n.lockRef.current],(n.shards||[]).map($v),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var l=k.useCallback(function(g,m){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=gu(g),O=t.current,x="deltaX"in g?g.deltaX:O[0]-b[0],y="deltaY"in g?g.deltaY:O[1]-b[1],v,C=g.target,S=Math.abs(x)>Math.abs(y)?"h":"v";if("touches"in g&&S==="h"&&C.type==="range")return!1;var _=Tv(S,C);if(!_)return!0;if(_?v=S:(v=S==="v"?"h":"v",_=Tv(S,C)),!_)return!1;if(!r.current&&"changedTouches"in g&&(x||y)&&(r.current=v),!v)return!0;var P=r.current||v;return lV(P,m,g,P==="h"?x:y,!0)},[]),a=k.useCallback(function(g){var m=g;if(!(!io.length||io[io.length-1]!==s)){var b="deltaY"in m?Ev(m):gu(m),O=e.current.filter(function(v){return v.name===m.type&&(v.target===m.target||m.target===v.shadowParent)&&aV(v.delta,b)})[0];if(O&&O.should){m.cancelable&&m.preventDefault();return}if(!O){var x=(o.current.shards||[]).map($v).filter(Boolean).filter(function(v){return v.contains(m.target)}),y=x.length>0?l(m,x[0]):!o.current.noIsolation;y&&m.cancelable&&m.preventDefault()}}},[]),c=k.useCallback(function(g,m,b,O){var x={name:g,delta:m,target:b,should:O,shadowParent:fV(b)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(y){return y!==x})},1)},[]),u=k.useCallback(function(g){t.current=gu(g),r.current=void 0},[]),h=k.useCallback(function(g){c(g.type,Ev(g),g.target,l(g,n.lockRef.current))},[]),f=k.useCallback(function(g){c(g.type,gu(g),g.target,l(g,n.lockRef.current))},[]);k.useEffect(function(){return io.push(s),n.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",a,ro),document.addEventListener("touchmove",a,ro),document.addEventListener("touchstart",u,ro),function(){io=io.filter(function(g){return g!==s}),document.removeEventListener("wheel",a,ro),document.removeEventListener("touchmove",a,ro),document.removeEventListener("touchstart",u,ro)}},[]);var d=n.removeScrollBar,p=n.inert;return k.createElement(k.Fragment,null,p?k.createElement(s,{styles:cV(i)}):null,d?k.createElement(eV,{gapMode:n.gapMode}):null)}function fV(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const dV=BN(f5,hV);var kd=k.forwardRef(function(n,e){return k.createElement(Sd,Ii({},n,{ref:e,sideCar:dV}))});kd.classNames=Sd.classNames;var b0="Popover",[O5,ste]=Od(b0,[pl]),Cc=pl(),[pV,gs]=O5(b0),b5=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=n,l=Cc(e),a=k.useRef(null),[c,u]=k.useState(!1),[h=!1,f]=yi({prop:r,defaultProp:i,onChange:s});return R.jsx(p0,{...l,children:R.jsx(pV,{scope:e,contentId:di(),triggerRef:a,open:h,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(d=>!d),[f]),hasCustomAnchor:c,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:t})})};b5.displayName=b0;var x5="PopoverAnchor",y5=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(x5,t),s=Cc(t),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=i;return k.useEffect(()=>(o(),()=>l()),[o,l]),R.jsx(wd,{...s,...r,ref:e})});y5.displayName=x5;var v5="PopoverTrigger",x0=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(v5,t),s=Cc(t),o=tt(e,i.triggerRef),l=R.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_5(i.open),...r,ref:o,onClick:Pe(n.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:R.jsx(wd,{asChild:!0,...s,children:l})});x0.displayName=v5;var y0="PopoverPortal",[gV,mV]=O5(y0,{forceMount:void 0}),w5=n=>{const{__scopePopover:e,forceMount:t,children:r,container:i}=n,s=gs(y0,e);return R.jsx(gV,{scope:e,forceMount:t,children:R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:r})})})};w5.displayName=y0;var Fo="PopoverContent",Cd=k.forwardRef((n,e)=>{const t=mV(Fo,n.__scopePopover),{forceMount:r=t.forceMount,...i}=n,s=gs(Fo,n.__scopePopover);return R.jsx(ps,{present:r||s.open,children:s.modal?R.jsx(OV,{...i,ref:e}):R.jsx(bV,{...i,ref:e})})});Cd.displayName=Fo;var OV=k.forwardRef((n,e)=>{const t=gs(Fo,n.__scopePopover),r=k.useRef(null),i=tt(e,r),s=k.useRef(!1);return k.useEffect(()=>{const o=r.current;if(o)return O0(o)},[]),R.jsx(kd,{as:Ns,allowPinchZoom:!0,children:R.jsx(S5,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(n.onCloseAutoFocus,o=>{var l;o.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Pe(n.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0,c=l.button===2||a;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(n.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),bV=k.forwardRef((n,e)=>{const t=gs(Fo,n.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return R.jsx(S5,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=n.onCloseAutoFocus)==null||o.call(n,s),s.defaultPrevented||(r.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,c;(a=n.onInteractOutside)==null||a.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),S5=k.forwardRef((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,...h}=n,f=gs(Fo,t),d=Cc(t);return s0(),R.jsx(bd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:R.jsx(g0,{"data-state":_5(f.open),role:"dialog",id:f.contentId,...d,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k5="PopoverClose",xV=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(k5,t);return R.jsx(Me.button,{type:"button",...r,ref:e,onClick:Pe(n.onClick,()=>i.onOpenChange(!1))})});xV.displayName=k5;var yV="PopoverArrow",C5=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=Cc(t);return R.jsx(m0,{...i,...r,ref:e})});C5.displayName=yV;function _5(n){return n?"open":"closed"}var v0=b5,vV=y5,w0=w5,wV=Cd,S0=C5;function SV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,kV(i,...e)]}function kV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function CV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,_V(i,...e)]}function _V(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function P5(n){const e=n+"CollectionProvider",[t,r]=CV(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=d=>{const{scope:p,children:g}=d,m=w.useRef(null),b=w.useRef(new Map).current;return R.jsx(i,{scope:p,itemMap:b,collectionRef:m,children:g})};o.displayName=e;const l=n+"CollectionSlot",a=w.forwardRef((d,p)=>{const{scope:g,children:m}=d,b=s(l,g),O=tt(p,b.collectionRef);return R.jsx(Ns,{ref:O,children:m})});a.displayName=l;const c=n+"CollectionItemSlot",u="data-radix-collection-item",h=w.forwardRef((d,p)=>{const{scope:g,children:m,...b}=d,O=w.useRef(null),x=tt(p,O),y=s(c,g);return w.useEffect(()=>(y.itemMap.set(O,{ref:O,...b}),()=>void y.itemMap.delete(O))),R.jsx(Ns,{[u]:"",ref:x,children:m})});h.displayName=c;function f(d){const p=s(n+"CollectionConsumer",d);return w.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const b=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((y,v)=>b.indexOf(y.ref.current)-b.indexOf(v.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:a,ItemSlot:h},f,r]}function PV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,TV(i,...e)]}function TV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var EV=k.createContext(void 0);function _d(n){const e=k.useContext(EV);return n||e||"ltr"}var Ap="rovingFocusGroup.onEntryFocus",$V={bubbles:!1,cancelable:!0},Pd="RovingFocusGroup",[_m,T5,AV]=P5(Pd),[QV,Td]=PV(Pd,[AV]),[RV,MV]=QV(Pd),E5=k.forwardRef((n,e)=>R.jsx(_m.Provider,{scope:n.__scopeRovingFocusGroup,children:R.jsx(_m.Slot,{scope:n.__scopeRovingFocusGroup,children:R.jsx(LV,{...n,ref:e})})}));E5.displayName=Pd;var LV=k.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=n,f=k.useRef(null),d=tt(e,f),p=_d(s),[g=null,m]=yi({prop:o,defaultProp:l,onChange:a}),[b,O]=k.useState(!1),x=Hr(c),y=T5(t),v=k.useRef(!1),[C,S]=k.useState(0);return k.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(Ap,x),()=>_.removeEventListener(Ap,x)},[x]),R.jsx(RV,{scope:t,orientation:r,dir:p,loop:i,currentTabStopId:g,onItemFocus:k.useCallback(_=>m(_),[m]),onItemShiftTab:k.useCallback(()=>O(!0),[]),onFocusableItemAdd:k.useCallback(()=>S(_=>_+1),[]),onFocusableItemRemove:k.useCallback(()=>S(_=>_-1),[]),children:R.jsx(Me.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...n.style},onMouseDown:Pe(n.onMouseDown,()=>{v.current=!0}),onFocus:Pe(n.onFocus,_=>{const P=!v.current;if(_.target===_.currentTarget&&P&&!b){const T=new CustomEvent(Ap,$V);if(_.currentTarget.dispatchEvent(T),!T.defaultPrevented){const M=y().filter(H=>H.focusable),Q=M.find(H=>H.active),D=M.find(H=>H.id===g),Z=[Q,D,...M].filter(Boolean).map(H=>H.ref.current);Q5(Z,u)}}v.current=!1}),onBlur:Pe(n.onBlur,()=>O(!1))})})}),$5="RovingFocusGroupItem",A5=k.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,...o}=n,l=di(),a=s||l,c=MV($5,t),u=c.currentTabStopId===a,h=T5(t),{onFocusableItemAdd:f,onFocusableItemRemove:d}=c;return k.useEffect(()=>{if(r)return f(),()=>d()},[r,f,d]),R.jsx(_m.ItemSlot,{scope:t,id:a,focusable:r,active:i,children:R.jsx(Me.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...o,ref:e,onMouseDown:Pe(n.onMouseDown,p=>{r?c.onItemFocus(a):p.preventDefault()}),onFocus:Pe(n.onFocus,()=>c.onItemFocus(a)),onKeyDown:Pe(n.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=NV(p,c.orientation,c.dir);if(g!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let b=h().filter(O=>O.focusable).map(O=>O.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const O=b.indexOf(p.currentTarget);b=c.loop?VV(b,O+1):b.slice(O+1)}setTimeout(()=>Q5(b))}})})})});A5.displayName=$5;var IV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DV(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function NV(n,e,t){const r=DV(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return IV[r]}function Q5(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function VV(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var R5=E5,k0=A5,ZV="Separator",Av="horizontal",BV=["horizontal","vertical"],M5=k.forwardRef((n,e)=>{const{decorative:t,orientation:r=Av,...i}=n,s=FV(r)?r:Av,l=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return R.jsx(Me.div,{"data-orientation":s,...l,...i,ref:e})});M5.displayName=ZV;function FV(n){return BV.includes(n)}var zV=M5;function jV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,XV(i,...e)]}function XV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var qV="Toggle",L5=k.forwardRef((n,e)=>{const{pressed:t,defaultPressed:r=!1,onPressedChange:i,...s}=n,[o=!1,l]=yi({prop:t,onChange:i,defaultProp:r});return R.jsx(Me.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...s,ref:e,onClick:Pe(n.onClick,()=>{n.disabled||l(!o)})})});L5.displayName=qV;var gl="ToggleGroup",[I5,D5]=jV(gl,[Td]),N5=Td(),C0=w.forwardRef((n,e)=>{const{type:t,...r}=n;if(t==="single"){const i=r;return R.jsx(WV,{...i,ref:e})}if(t==="multiple"){const i=r;return R.jsx(HV,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${gl}\``)});C0.displayName=gl;var[V5,Z5]=I5(gl),WV=w.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=yi({prop:t,defaultProp:r,onChange:i});return R.jsx(V5,{scope:n.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:l,onItemDeactivate:w.useCallback(()=>l(""),[l]),children:R.jsx(B5,{...s,ref:e})})}),HV=w.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o=[],l]=yi({prop:t,defaultProp:r,onChange:i}),a=w.useCallback(u=>l((h=[])=>[...h,u]),[l]),c=w.useCallback(u=>l((h=[])=>h.filter(f=>f!==u)),[l]);return R.jsx(V5,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:a,onItemDeactivate:c,children:R.jsx(B5,{...s,ref:e})})});C0.displayName=gl;var[YV,UV]=I5(gl),B5=w.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:l=!0,...a}=n,c=N5(t),u=_d(o),h={role:"group",dir:u,...a};return R.jsx(YV,{scope:t,rovingFocus:i,disabled:r,children:i?R.jsx(R5,{asChild:!0,...c,orientation:s,dir:u,loop:l,children:R.jsx(Me.div,{...h,ref:e})}):R.jsx(Me.div,{...h,ref:e})})}),Gh="ToggleGroupItem",F5=w.forwardRef((n,e)=>{const t=Z5(Gh,n.__scopeToggleGroup),r=UV(Gh,n.__scopeToggleGroup),i=N5(n.__scopeToggleGroup),s=t.value.includes(n.value),o=r.disabled||n.disabled,l={...n,pressed:s,disabled:o},a=w.useRef(null);return r.rovingFocus?R.jsx(k0,{asChild:!0,...i,focusable:!o,active:s,ref:a,children:R.jsx(Qv,{...l,ref:e})}):R.jsx(Qv,{...l,ref:e})});F5.displayName=Gh;var Qv=w.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:r,...i}=n,s=Z5(Gh,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return R.jsx(L5,{...l,...i,ref:e,onPressedChange:a=>{a?s.onItemActivate(r):s.onItemDeactivate(r)}})}),GV=C0,KV=F5,_0="Toolbar",[JV,ote]=SV(_0,[Td,D5]),P0=Td(),z5=D5(),[eZ,j5]=JV(_0),X5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,orientation:r="horizontal",dir:i,loop:s=!0,...o}=n,l=P0(t),a=_d(i);return R.jsx(eZ,{scope:t,orientation:r,dir:a,children:R.jsx(R5,{asChild:!0,...l,orientation:r,dir:a,loop:s,children:R.jsx(Me.div,{role:"toolbar","aria-orientation":r,dir:a,...o,ref:e})})})});X5.displayName=_0;var q5="ToolbarSeparator",W5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=j5(q5,t);return R.jsx(zV,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});W5.displayName=q5;var tZ="ToolbarButton",T0=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=P0(t);return R.jsx(k0,{asChild:!0,...i,focusable:!n.disabled,children:R.jsx(Me.button,{type:"button",...r,ref:e})})});T0.displayName=tZ;var nZ="ToolbarLink",rZ=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=P0(t);return R.jsx(k0,{asChild:!0,...i,focusable:!0,children:R.jsx(Me.a,{...r,ref:e,onKeyDown:Pe(n.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});rZ.displayName=nZ;var H5="ToolbarToggleGroup",Y5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=j5(H5,t),s=z5(t);return R.jsx(GV,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});Y5.displayName=H5;var iZ="ToolbarToggleItem",U5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=z5(t),s={__scopeToolbar:n.__scopeToolbar};return R.jsx(T0,{asChild:!0,...s,children:R.jsx(KV,{...i,...r,ref:e})})});U5.displayName=iZ;var E0=X5,G5=W5,Hi=T0,Ed=Y5,ch=U5;function K5(n,e){return n===null||n===e?!1:n.dataset.editorDialog!==void 0||n.dataset.toolbarItem!==void 0||n.dataset.editorDropdown?!0:K5(n.parentElement,e)}function sZ(){const n=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0")),e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,[...e.entries()].map(([t,r])=>[4,6,8,10].includes(t)?`-${n[r]}`:n[r]).join("")}const J5=n=>n===0?"th":"td",eP={center:W.centeredCell,left:W.leftAlignedCell,right:W.rightAlignedCell},oZ=({mdastNode:n,parentEditor:e,lexicalTable:t})=>{const[r,i]=w.useState(null),[s,o]=yt(Tt,In),l=w.useMemo(()=>g=>(g.__cacheKey||(g.__cacheKey=sZ()),g.__cacheKey),[]),a=w.useCallback(g=>{const m=t.getColCount();if(g===null){i(null);return}let[b,O]=g;if(b>m-1&&(b=0,O++),b<0&&(b=m-1,O-=1),O>t.getRowCount()-1){i(null),e.update(()=>{if(t.getLatest().getNextSibling())t.getLatest().selectNext();else{const y=qe();t.insertAfter(y),y.select()}});return}if(O<0){i(null),e.update(()=>{t.getLatest().selectPrevious()});return}i([b,O])},[t,e]);w.useEffect(()=>{t.focusEmitter.subscribe(a)},[t,a]);const c=w.useCallback(g=>{g.preventDefault(),e.update(()=>{t.addRowToBottom(),i([0,t.getRowCount()])})},[e,t]),u=w.useCallback(g=>{g.preventDefault(),e.update(()=>{t.addColumnToRight(),i([t.getColCount(),0])})},[e,t]),[h,f]=w.useState([-1,-1]),d=w.useCallback(g=>{let m=g.target;for(;m&&!["TH","TD"].includes(m.tagName);){if(m===g.currentTarget)return;m=m.parentElement}if(m===null)return;const b=m.parentElement,x=b.parentElement.tagName==="TFOOT"?-1:Array.from(b.children).indexOf(m),y=m.tagName==="TH"?-1:Array.from(b.parentElement.children).indexOf(b);f([x,y])},[]),p=mt();return w.createElement("table",{className:W.tableEditor,onMouseOver:d,onMouseLeave:()=>{f([-1,-1])}},w.createElement("colgroup",null,o?null:w.createElement("col",null),Array.from({length:n.children[0].children.length},(g,m)=>{const O=(n.align??[])[m]??"left",x=eP[O];return w.createElement("col",{key:m,className:x})}),o?null:w.createElement("col",null)),o||w.createElement("thead",null,w.createElement("tr",null,w.createElement("th",{className:W.tableToolsColumn}),Array.from({length:n.children[0].children.length},(g,m)=>w.createElement("th",{key:m,"data-tool-cell":!0},w.createElement(cZ,{setActiveCellWithBoundaries:a,parentEditor:e,colIndex:m,highlightedCoordinates:h,lexicalTable:t,align:(n.align??[])[m]}))),w.createElement("th",{className:W.tableToolsColumn,"data-tool-cell":!0},w.createElement("button",{className:W.iconButton,type:"button",title:p("table.deleteTable","Delete table"),onClick:g=>{g.preventDefault(),e.update(()=>{t.selectNext(),t.remove()})}},s("delete_small"))))),w.createElement("tbody",null,n.children.map((g,m)=>{const b=J5(m);return w.createElement("tr",{key:m},o||w.createElement(b,{className:W.toolCell,"data-tool-cell":!0},w.createElement(uZ,{setActiveCellWithBoundaries:a,parentEditor:e,rowIndex:m,highlightedCoordinates:h,lexicalTable:t})),g.children.map((O,x)=>{var y;return w.createElement(lZ,{align:(y=n.align)==null?void 0:y[x],key:l(O),contents:O.children,setActiveCell:a,rowIndex:m,colIndex:x,lexicalTable:t,parentEditor:e,activeCell:o?[-1,-1]:r})}),o||m===0&&w.createElement("th",{rowSpan:t.getRowCount(),"data-tool-cell":!0},w.createElement("button",{type:"button",className:W.addColumnButton,onClick:u},s("add_column"))))})),o||w.createElement("tfoot",null,w.createElement("tr",null,w.createElement("th",null),w.createElement("th",{colSpan:t.getColCount()},w.createElement("button",{type:"button",className:W.addRowButton,onClick:c},s("add_row"))),w.createElement("th",null))))},lZ=({align:n,...e})=>{const{activeCell:t,setActiveCell:r}=e,i=!!(t&&t[0]===e.colIndex&&t[1]===e.rowIndex),s=eP[n??"left"],o=J5(e.rowIndex);return w.createElement(o,{className:s,"data-active":i,onClick:()=>{r([e.colIndex,e.rowIndex])}},w.createElement(aZ,{...e,focus:i}))},aZ=({focus:n,setActiveCell:e,parentEditor:t,lexicalTable:r,contents:i,colIndex:s,rowIndex:o})=>{const[l,a,c,u,h,f,d,p]=yt(H1,U1,Y1,G1,o_,yc,s_,Ci),[g]=w.useState(()=>{const b=h2({nodes:c,theme:X1});return b.update(()=>{G2({root:ze(),mdastRoot:{type:"root",children:[{type:"paragraph",children:i}]},visitors:l,jsxComponentDescriptors:u,directiveDescriptors:h,codeBlockEditorDescriptors:f})}),b}),m=w.useCallback(b=>{g.getEditorState().read(()=>{const O=H2({root:ze(),jsxComponentDescriptors:u,visitors:a,jsxIsAvailable:d});t.update(()=>{r.updateCellContents(s,o,O.children[0].children)},{discrete:!0}),t.dispatchCommand(Ea,void 0)}),e(b)},[s,g,a,u,d,r,t,o,e]);return w.useEffect(()=>Yn(g.registerCommand(l1,b=>{b.preventDefault();const O=b.shiftKey?[s-1,o]:[s+1,o];return m(O),!0},cr),g.registerCommand(f1,()=>(e([s,o]),!1),lt),g.registerCommand(Io,b=>{b==null||b.preventDefault();const O=b!=null&&b.shiftKey?[s,o-1]:[s,o+1];return m(O),!0},cr),g.registerCommand(d1,b=>{const O=b.relatedTarget;return K5(O,p.getRootElement())?!1:(m(null),!0)},Ie),g.registerCommand(Ea,()=>(m(null),!0),Ie)),[s,g,p,o,m,e]),w.useEffect(()=>{n&&g.focus()},[n,g]),w.createElement(FI,{initialEditor:g},w.createElement(S_,{contentEditable:w.createElement(v_,null),placeholder:w.createElement("div",null),ErrorBoundary:w_}),w.createElement(x2,null))},cZ=({parentEditor:n,highlightedCoordinates:e,align:t,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:s})=>{const[o,l]=yt(Gs,Tt),a=w.useCallback(f=>{n.update(()=>{r.insertColumnAt(f)}),s([f,0])},[n,r,s]),c=w.useCallback(f=>{n.update(()=>{r.deleteColumnAt(f)})},[n,r]),u=w.useCallback((f,d)=>{n.update(()=>{r.setColumnAlign(f,d)})},[n,r]),h=mt();return w.createElement(v0,null,w.createElement(x0,{className:W.tableColumnEditorTrigger,"data-active":e[0]===i+1,title:h("table.columnMenu","Column menu")},l("more_horiz")),w.createElement(w0,{container:o==null?void 0:o.current},w.createElement(Cd,{className:Fe(W.tableColumnEditorPopoverContent),onOpenAutoFocus:f=>{f.preventDefault()},sideOffset:5,side:"top"},w.createElement(E0,{className:W.tableColumnEditorToolbar},w.createElement(Ed,{className:W.toggleGroupRoot,onValueChange:f=>{u(i,f)},value:t??"left",type:"single","aria-label":h("table.textAlignment","Text alignment")},w.createElement(ch,{value:"left",title:h("table.alignLeft","Align left")},l("format_align_left")),w.createElement(ch,{value:"center",title:h("table.alignCenter","Align center")},l("format_align_center")),w.createElement(ch,{value:"right",title:h("table.alignRight","Align right")},l("format_align_right"))),w.createElement(G5,null),w.createElement(Hi,{onClick:a.bind(null,i),title:h("table.insertColumnLeft","Insert a column to the left of this one")},l("insert_col_left")),w.createElement(Hi,{onClick:a.bind(null,i+1),title:h("table.insertColumnRight","Insert a column to the right of this one")},l("insert_col_right")),w.createElement(Hi,{onClick:c.bind(null,i),title:h("table.deleteColumn","Delete this column")},l("delete_small"))),w.createElement(S0,{className:W.popoverArrow}))))},uZ=({parentEditor:n,highlightedCoordinates:e,lexicalTable:t,rowIndex:r,setActiveCellWithBoundaries:i})=>{const[s,o]=yt(Gs,Tt),l=w.useCallback(u=>{n.update(()=>{t.insertRowAt(u)}),i([0,u])},[n,t,i]),a=w.useCallback(u=>{n.update(()=>{t.deleteRowAt(u)})},[n,t]),c=mt();return w.createElement(v0,null,w.createElement(x0,{className:W.tableColumnEditorTrigger,"data-active":e[1]===r,title:c("table.rowMenu","Row menu")},o("more_horiz")),w.createElement(w0,{container:s==null?void 0:s.current},w.createElement(Cd,{className:Fe(W.tableColumnEditorPopoverContent),onOpenAutoFocus:u=>{u.preventDefault()},sideOffset:5,side:"bottom"},w.createElement(E0,{className:W.tableColumnEditorToolbar},w.createElement(Hi,{onClick:l.bind(null,r),title:c("table.insertRowAbove","Insert a row above this one")},o("insert_row_above")),w.createElement(Hi,{onClick:l.bind(null,r+1),title:c("table.insertRowBelow","Insert a row below this one")},o("insert_row_below")),w.createElement(Hi,{onClick:a.bind(null,r),title:c("table.deleteRow","Delete this row")},o("delete_small"))),w.createElement(S0,{className:W.popoverArrow}))))};var hZ=Object.defineProperty,fZ=(n,e,t)=>e in n?hZ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Rv=(n,e,t)=>(fZ(n,typeof e!="symbol"?e+"":e,t),t);const Mv={type:"tableCell",children:[]};function dZ(){let n=Es;return{publish:e=>{n(e)},subscribe:e=>{n=e}}}class _c extends al{constructor(e,t){super(t),Rv(this,"__mdastNode"),Rv(this,"focusEmitter",dZ()),this.__mdastNode=e??{type:"table",children:[]}}static getType(){return"table"}static clone(e){return new _c(structuredClone(e.__mdastNode),e.__key)}static importJSON(e){return $0(e.mdastNode)}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:"table",version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){var e;return((e=this.__mdastNode.children[0])==null?void 0:e.children.length)||0}createDOM(){return document.createElement("div")}updateDOM(){return!1}updateCellContents(e,t,r){const s=this.getWritable().__mdastNode,o=s.children[t],l=o.children,a=l[e],c=Array.from(l),u={...a,children:r},h={...o,children:c};c[e]=u,s.children[t]=h}insertColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;i0&&r.align.splice(e,0,"left")}deleteColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;istructuredClone(Mv))};r.children.splice(e,0,i)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){const i=this.getWritable().__mdastNode;i.align==null&&(i.align=[]),i.align[e]=t}decorate(e){return w.createElement(oZ,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}}function pZ(n){return n instanceof _c}function $0(n){return new _c(n)}const gZ={testLexicalNode:pZ,visitLexicalNode({actions:n,mdastParent:e,lexicalNode:t}){n.appendToParent(e,t.getMdastNode())}},mZ={testNode:"table",visitNode({mdastNode:n,lexicalParent:e}){e.append($0(n))}};function OZ(n=1,e=1){const t={type:"table",children:[]};for(let r=0;r{n.link(n.pipe(tP,ui(({rows:e,columns:t})=>()=>$0(OZ(e,t)))),t0)}),bZ=Nn({init(n){n.pubIn({[Fh]:CI(),[Bh]:LI(),[Oi]:mZ,[us]:_c,[hs]:gZ,[K1]:AI({tableCellPadding:!0,tablePipeAlign:!0})})}}),xZ=new Set(["http:","https:","mailto:","sms:","tel:"]);let A0=class nP extends xr{static getType(){return"link"}static clone(e){return new nP(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),fr(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,s=this.__target,o=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),s!==e.__target&&(s?t.target=s:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:yZ,priority:1})}}static importJSON(e){const t=La(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!xZ.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=La(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!U(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function yZ(n){let e=null;if(x8(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=La(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function La(n,e){return Zn(new A0(n,e))}function Pm(n){return n instanceof A0}const Tm=Si();var Q0="Dialog",[rP,lte]=Od(Q0),[vZ,yr]=rP(Q0),iP=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=n,l=k.useRef(null),a=k.useRef(null),[c=!1,u]=yi({prop:r,defaultProp:i,onChange:s});return R.jsx(vZ,{scope:e,triggerRef:l,contentRef:a,contentId:di(),titleId:di(),descriptionId:di(),open:c,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(h=>!h),[u]),modal:o,children:t})};iP.displayName=Q0;var sP="DialogTrigger",wZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(sP,t),s=tt(e,i.triggerRef);return R.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L0(i.open),...r,ref:s,onClick:Pe(n.onClick,i.onOpenToggle)})});wZ.displayName=sP;var R0="DialogPortal",[SZ,oP]=rP(R0,{forceMount:void 0}),lP=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=yr(R0,e);return R.jsx(SZ,{scope:e,forceMount:t,children:k.Children.map(r,o=>R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:o})}))})};lP.displayName=R0;var Kh="DialogOverlay",aP=k.forwardRef((n,e)=>{const t=oP(Kh,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=yr(Kh,n.__scopeDialog);return s.modal?R.jsx(ps,{present:r||s.open,children:R.jsx(kZ,{...i,ref:e})}):null});aP.displayName=Kh;var kZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(Kh,t);return R.jsx(kd,{as:Ns,allowPinchZoom:!0,shards:[i.contentRef],children:R.jsx(Me.div,{"data-state":L0(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Zs="DialogContent",cP=k.forwardRef((n,e)=>{const t=oP(Zs,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=yr(Zs,n.__scopeDialog);return R.jsx(ps,{present:r||s.open,children:s.modal?R.jsx(CZ,{...i,ref:e}):R.jsx(_Z,{...i,ref:e})})});cP.displayName=Zs;var CZ=k.forwardRef((n,e)=>{const t=yr(Zs,n.__scopeDialog),r=k.useRef(null),i=tt(e,t.contentRef,r);return k.useEffect(()=>{const s=r.current;if(s)return O0(s)},[]),R.jsx(uP,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(n.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pe(n.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&s.preventDefault()}),onFocusOutside:Pe(n.onFocusOutside,s=>s.preventDefault())})}),_Z=k.forwardRef((n,e)=>{const t=yr(Zs,n.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return R.jsx(uP,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=n.onCloseAutoFocus)==null||o.call(n,s),s.defaultPrevented||(r.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,c;(a=n.onInteractOutside)==null||a.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),uP=k.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=n,l=yr(Zs,t),a=k.useRef(null),c=tt(e,a);return s0(),R.jsxs(R.Fragment,{children:[R.jsx(bd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:R.jsx(wc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":L0(l.open),...o,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),R.jsxs(R.Fragment,{children:[R.jsx(TZ,{titleId:l.titleId}),R.jsx($Z,{contentRef:a,descriptionId:l.descriptionId})]})]})}),M0="DialogTitle",hP=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(M0,t);return R.jsx(Me.h2,{id:i.titleId,...r,ref:e})});hP.displayName=M0;var fP="DialogDescription",PZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(fP,t);return R.jsx(Me.p,{id:i.descriptionId,...r,ref:e})});PZ.displayName=fP;var dP="DialogClose",pP=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(dP,t);return R.jsx(Me.button,{type:"button",...r,ref:e,onClick:Pe(n.onClick,()=>i.onOpenChange(!1))})});pP.displayName=dP;function L0(n){return n?"open":"closed"}var gP="DialogTitleWarning",[ate,mP]=jI(gP,{contentName:Zs,titleName:M0,docsSlug:"dialog"}),TZ=({titleId:n})=>{const e=mP(gP),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},uV=0,io=[];function hV(n){var e=k.useRef([]),t=k.useRef([0,0]),r=k.useRef(),i=k.useState(uV++)[0],s=k.useState(d5)[0],o=k.useRef(n);k.useEffect(function(){o.current=n},[n]),k.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var g=AN([n.lockRef.current],(n.shards||[]).map($v),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var l=k.useCallback(function(g,m){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=gu(g),O=t.current,x="deltaX"in g?g.deltaX:O[0]-b[0],y="deltaY"in g?g.deltaY:O[1]-b[1],v,C=g.target,S=Math.abs(x)>Math.abs(y)?"h":"v";if("touches"in g&&S==="h"&&C.type==="range")return!1;var _=Tv(S,C);if(!_)return!0;if(_?v=S:(v=S==="v"?"h":"v",_=Tv(S,C)),!_)return!1;if(!r.current&&"changedTouches"in g&&(x||y)&&(r.current=v),!v)return!0;var P=r.current||v;return lV(P,m,g,P==="h"?x:y,!0)},[]),a=k.useCallback(function(g){var m=g;if(!(!io.length||io[io.length-1]!==s)){var b="deltaY"in m?Ev(m):gu(m),O=e.current.filter(function(v){return v.name===m.type&&(v.target===m.target||m.target===v.shadowParent)&&aV(v.delta,b)})[0];if(O&&O.should){m.cancelable&&m.preventDefault();return}if(!O){var x=(o.current.shards||[]).map($v).filter(Boolean).filter(function(v){return v.contains(m.target)}),y=x.length>0?l(m,x[0]):!o.current.noIsolation;y&&m.cancelable&&m.preventDefault()}}},[]),c=k.useCallback(function(g,m,b,O){var x={name:g,delta:m,target:b,should:O,shadowParent:fV(b)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(y){return y!==x})},1)},[]),u=k.useCallback(function(g){t.current=gu(g),r.current=void 0},[]),h=k.useCallback(function(g){c(g.type,Ev(g),g.target,l(g,n.lockRef.current))},[]),f=k.useCallback(function(g){c(g.type,gu(g),g.target,l(g,n.lockRef.current))},[]);k.useEffect(function(){return io.push(s),n.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",a,ro),document.addEventListener("touchmove",a,ro),document.addEventListener("touchstart",u,ro),function(){io=io.filter(function(g){return g!==s}),document.removeEventListener("wheel",a,ro),document.removeEventListener("touchmove",a,ro),document.removeEventListener("touchstart",u,ro)}},[]);var d=n.removeScrollBar,p=n.inert;return k.createElement(k.Fragment,null,p?k.createElement(s,{styles:cV(i)}):null,d?k.createElement(eV,{gapMode:n.gapMode}):null)}function fV(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const dV=BN(f5,hV);var kd=k.forwardRef(function(n,e){return k.createElement(Sd,Ii({},n,{ref:e,sideCar:dV}))});kd.classNames=Sd.classNames;var b0="Popover",[O5,ote]=Od(b0,[pl]),Cc=pl(),[pV,gs]=O5(b0),b5=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=n,l=Cc(e),a=k.useRef(null),[c,u]=k.useState(!1),[h=!1,f]=yi({prop:r,defaultProp:i,onChange:s});return R.jsx(p0,{...l,children:R.jsx(pV,{scope:e,contentId:di(),triggerRef:a,open:h,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(d=>!d),[f]),hasCustomAnchor:c,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:t})})};b5.displayName=b0;var x5="PopoverAnchor",y5=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(x5,t),s=Cc(t),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=i;return k.useEffect(()=>(o(),()=>l()),[o,l]),R.jsx(wd,{...s,...r,ref:e})});y5.displayName=x5;var v5="PopoverTrigger",x0=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(v5,t),s=Cc(t),o=tt(e,i.triggerRef),l=R.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_5(i.open),...r,ref:o,onClick:Pe(n.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:R.jsx(wd,{asChild:!0,...s,children:l})});x0.displayName=v5;var y0="PopoverPortal",[gV,mV]=O5(y0,{forceMount:void 0}),w5=n=>{const{__scopePopover:e,forceMount:t,children:r,container:i}=n,s=gs(y0,e);return R.jsx(gV,{scope:e,forceMount:t,children:R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:r})})})};w5.displayName=y0;var Fo="PopoverContent",Cd=k.forwardRef((n,e)=>{const t=mV(Fo,n.__scopePopover),{forceMount:r=t.forceMount,...i}=n,s=gs(Fo,n.__scopePopover);return R.jsx(ps,{present:r||s.open,children:s.modal?R.jsx(OV,{...i,ref:e}):R.jsx(bV,{...i,ref:e})})});Cd.displayName=Fo;var OV=k.forwardRef((n,e)=>{const t=gs(Fo,n.__scopePopover),r=k.useRef(null),i=tt(e,r),s=k.useRef(!1);return k.useEffect(()=>{const o=r.current;if(o)return O0(o)},[]),R.jsx(kd,{as:Ns,allowPinchZoom:!0,children:R.jsx(S5,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(n.onCloseAutoFocus,o=>{var l;o.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Pe(n.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0,c=l.button===2||a;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(n.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),bV=k.forwardRef((n,e)=>{const t=gs(Fo,n.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return R.jsx(S5,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=n.onCloseAutoFocus)==null||o.call(n,s),s.defaultPrevented||(r.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,c;(a=n.onInteractOutside)==null||a.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),S5=k.forwardRef((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,...h}=n,f=gs(Fo,t),d=Cc(t);return s0(),R.jsx(bd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:R.jsx(g0,{"data-state":_5(f.open),role:"dialog",id:f.contentId,...d,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k5="PopoverClose",xV=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=gs(k5,t);return R.jsx(Me.button,{type:"button",...r,ref:e,onClick:Pe(n.onClick,()=>i.onOpenChange(!1))})});xV.displayName=k5;var yV="PopoverArrow",C5=k.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=Cc(t);return R.jsx(m0,{...i,...r,ref:e})});C5.displayName=yV;function _5(n){return n?"open":"closed"}var v0=b5,vV=y5,w0=w5,wV=Cd,S0=C5;function SV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,kV(i,...e)]}function kV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function CV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,_V(i,...e)]}function _V(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function P5(n){const e=n+"CollectionProvider",[t,r]=CV(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=d=>{const{scope:p,children:g}=d,m=w.useRef(null),b=w.useRef(new Map).current;return R.jsx(i,{scope:p,itemMap:b,collectionRef:m,children:g})};o.displayName=e;const l=n+"CollectionSlot",a=w.forwardRef((d,p)=>{const{scope:g,children:m}=d,b=s(l,g),O=tt(p,b.collectionRef);return R.jsx(Ns,{ref:O,children:m})});a.displayName=l;const c=n+"CollectionItemSlot",u="data-radix-collection-item",h=w.forwardRef((d,p)=>{const{scope:g,children:m,...b}=d,O=w.useRef(null),x=tt(p,O),y=s(c,g);return w.useEffect(()=>(y.itemMap.set(O,{ref:O,...b}),()=>void y.itemMap.delete(O))),R.jsx(Ns,{[u]:"",ref:x,children:m})});h.displayName=c;function f(d){const p=s(n+"CollectionConsumer",d);return w.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const b=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((y,v)=>b.indexOf(y.ref.current)-b.indexOf(v.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:a,ItemSlot:h},f,r]}function PV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,TV(i,...e)]}function TV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var EV=k.createContext(void 0);function _d(n){const e=k.useContext(EV);return n||e||"ltr"}var Ap="rovingFocusGroup.onEntryFocus",$V={bubbles:!1,cancelable:!0},Pd="RovingFocusGroup",[_m,T5,AV]=P5(Pd),[QV,Td]=PV(Pd,[AV]),[RV,MV]=QV(Pd),E5=k.forwardRef((n,e)=>R.jsx(_m.Provider,{scope:n.__scopeRovingFocusGroup,children:R.jsx(_m.Slot,{scope:n.__scopeRovingFocusGroup,children:R.jsx(LV,{...n,ref:e})})}));E5.displayName=Pd;var LV=k.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=n,f=k.useRef(null),d=tt(e,f),p=_d(s),[g=null,m]=yi({prop:o,defaultProp:l,onChange:a}),[b,O]=k.useState(!1),x=Hr(c),y=T5(t),v=k.useRef(!1),[C,S]=k.useState(0);return k.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(Ap,x),()=>_.removeEventListener(Ap,x)},[x]),R.jsx(RV,{scope:t,orientation:r,dir:p,loop:i,currentTabStopId:g,onItemFocus:k.useCallback(_=>m(_),[m]),onItemShiftTab:k.useCallback(()=>O(!0),[]),onFocusableItemAdd:k.useCallback(()=>S(_=>_+1),[]),onFocusableItemRemove:k.useCallback(()=>S(_=>_-1),[]),children:R.jsx(Me.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...n.style},onMouseDown:Pe(n.onMouseDown,()=>{v.current=!0}),onFocus:Pe(n.onFocus,_=>{const P=!v.current;if(_.target===_.currentTarget&&P&&!b){const T=new CustomEvent(Ap,$V);if(_.currentTarget.dispatchEvent(T),!T.defaultPrevented){const M=y().filter(H=>H.focusable),Q=M.find(H=>H.active),D=M.find(H=>H.id===g),Z=[Q,D,...M].filter(Boolean).map(H=>H.ref.current);Q5(Z,u)}}v.current=!1}),onBlur:Pe(n.onBlur,()=>O(!1))})})}),$5="RovingFocusGroupItem",A5=k.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,...o}=n,l=di(),a=s||l,c=MV($5,t),u=c.currentTabStopId===a,h=T5(t),{onFocusableItemAdd:f,onFocusableItemRemove:d}=c;return k.useEffect(()=>{if(r)return f(),()=>d()},[r,f,d]),R.jsx(_m.ItemSlot,{scope:t,id:a,focusable:r,active:i,children:R.jsx(Me.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...o,ref:e,onMouseDown:Pe(n.onMouseDown,p=>{r?c.onItemFocus(a):p.preventDefault()}),onFocus:Pe(n.onFocus,()=>c.onItemFocus(a)),onKeyDown:Pe(n.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=NV(p,c.orientation,c.dir);if(g!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let b=h().filter(O=>O.focusable).map(O=>O.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const O=b.indexOf(p.currentTarget);b=c.loop?VV(b,O+1):b.slice(O+1)}setTimeout(()=>Q5(b))}})})})});A5.displayName=$5;var IV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DV(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function NV(n,e,t){const r=DV(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return IV[r]}function Q5(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function VV(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var R5=E5,k0=A5,ZV="Separator",Av="horizontal",BV=["horizontal","vertical"],M5=k.forwardRef((n,e)=>{const{decorative:t,orientation:r=Av,...i}=n,s=FV(r)?r:Av,l=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return R.jsx(Me.div,{"data-orientation":s,...l,...i,ref:e})});M5.displayName=ZV;function FV(n){return BV.includes(n)}var zV=M5;function jV(n,e=[]){let t=[];function r(s,o){const l=k.createContext(o),a=t.length;t=[...t,o];function c(h){const{scope:f,children:d,...p}=h,g=(f==null?void 0:f[n][a])||l,m=k.useMemo(()=>p,Object.values(p));return R.jsx(g.Provider,{value:m,children:d})}function u(h,f){const d=(f==null?void 0:f[n][a])||l,p=k.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=t.map(o=>k.createContext(o));return function(l){const a=(l==null?void 0:l[n])||s;return k.useMemo(()=>({[`__scope${n}`]:{...l,[n]:a}}),[l,a])}};return i.scopeName=n,[r,XV(i,...e)]}function XV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:a,scopeName:c})=>{const h=a(s)[`__scope${c}`];return{...l,...h}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var qV="Toggle",L5=k.forwardRef((n,e)=>{const{pressed:t,defaultPressed:r=!1,onPressedChange:i,...s}=n,[o=!1,l]=yi({prop:t,onChange:i,defaultProp:r});return R.jsx(Me.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":n.disabled?"":void 0,...s,ref:e,onClick:Pe(n.onClick,()=>{n.disabled||l(!o)})})});L5.displayName=qV;var gl="ToggleGroup",[I5,D5]=jV(gl,[Td]),N5=Td(),C0=w.forwardRef((n,e)=>{const{type:t,...r}=n;if(t==="single"){const i=r;return R.jsx(WV,{...i,ref:e})}if(t==="multiple"){const i=r;return R.jsx(HV,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${gl}\``)});C0.displayName=gl;var[V5,Z5]=I5(gl),WV=w.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o,l]=yi({prop:t,defaultProp:r,onChange:i});return R.jsx(V5,{scope:n.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:l,onItemDeactivate:w.useCallback(()=>l(""),[l]),children:R.jsx(B5,{...s,ref:e})})}),HV=w.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[o=[],l]=yi({prop:t,defaultProp:r,onChange:i}),a=w.useCallback(u=>l((h=[])=>[...h,u]),[l]),c=w.useCallback(u=>l((h=[])=>h.filter(f=>f!==u)),[l]);return R.jsx(V5,{scope:n.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:a,onItemDeactivate:c,children:R.jsx(B5,{...s,ref:e})})});C0.displayName=gl;var[YV,UV]=I5(gl),B5=w.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:l=!0,...a}=n,c=N5(t),u=_d(o),h={role:"group",dir:u,...a};return R.jsx(YV,{scope:t,rovingFocus:i,disabled:r,children:i?R.jsx(R5,{asChild:!0,...c,orientation:s,dir:u,loop:l,children:R.jsx(Me.div,{...h,ref:e})}):R.jsx(Me.div,{...h,ref:e})})}),Gh="ToggleGroupItem",F5=w.forwardRef((n,e)=>{const t=Z5(Gh,n.__scopeToggleGroup),r=UV(Gh,n.__scopeToggleGroup),i=N5(n.__scopeToggleGroup),s=t.value.includes(n.value),o=r.disabled||n.disabled,l={...n,pressed:s,disabled:o},a=w.useRef(null);return r.rovingFocus?R.jsx(k0,{asChild:!0,...i,focusable:!o,active:s,ref:a,children:R.jsx(Qv,{...l,ref:e})}):R.jsx(Qv,{...l,ref:e})});F5.displayName=Gh;var Qv=w.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:r,...i}=n,s=Z5(Gh,t),o={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return R.jsx(L5,{...l,...i,ref:e,onPressedChange:a=>{a?s.onItemActivate(r):s.onItemDeactivate(r)}})}),GV=C0,KV=F5,_0="Toolbar",[JV,lte]=SV(_0,[Td,D5]),P0=Td(),z5=D5(),[eZ,j5]=JV(_0),X5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,orientation:r="horizontal",dir:i,loop:s=!0,...o}=n,l=P0(t),a=_d(i);return R.jsx(eZ,{scope:t,orientation:r,dir:a,children:R.jsx(R5,{asChild:!0,...l,orientation:r,dir:a,loop:s,children:R.jsx(Me.div,{role:"toolbar","aria-orientation":r,dir:a,...o,ref:e})})})});X5.displayName=_0;var q5="ToolbarSeparator",W5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=j5(q5,t);return R.jsx(zV,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});W5.displayName=q5;var tZ="ToolbarButton",T0=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=P0(t);return R.jsx(k0,{asChild:!0,...i,focusable:!n.disabled,children:R.jsx(Me.button,{type:"button",...r,ref:e})})});T0.displayName=tZ;var nZ="ToolbarLink",rZ=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=P0(t);return R.jsx(k0,{asChild:!0,...i,focusable:!0,children:R.jsx(Me.a,{...r,ref:e,onKeyDown:Pe(n.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});rZ.displayName=nZ;var H5="ToolbarToggleGroup",Y5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=j5(H5,t),s=z5(t);return R.jsx(GV,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});Y5.displayName=H5;var iZ="ToolbarToggleItem",U5=k.forwardRef((n,e)=>{const{__scopeToolbar:t,...r}=n,i=z5(t),s={__scopeToolbar:n.__scopeToolbar};return R.jsx(T0,{asChild:!0,...s,children:R.jsx(KV,{...i,...r,ref:e})})});U5.displayName=iZ;var E0=X5,G5=W5,Hi=T0,Ed=Y5,ch=U5;function K5(n,e){return n===null||n===e?!1:n.dataset.editorDialog!==void 0||n.dataset.toolbarItem!==void 0||n.dataset.editorDropdown?!0:K5(n.parentElement,e)}function sZ(){const n=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0")),e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,[...e.entries()].map(([t,r])=>[4,6,8,10].includes(t)?`-${n[r]}`:n[r]).join("")}const J5=n=>n===0?"th":"td",eP={center:W.centeredCell,left:W.leftAlignedCell,right:W.rightAlignedCell},oZ=({mdastNode:n,parentEditor:e,lexicalTable:t})=>{const[r,i]=w.useState(null),[s,o]=yt(Tt,In),l=w.useMemo(()=>g=>(g.__cacheKey||(g.__cacheKey=sZ()),g.__cacheKey),[]),a=w.useCallback(g=>{const m=t.getColCount();if(g===null){i(null);return}let[b,O]=g;if(b>m-1&&(b=0,O++),b<0&&(b=m-1,O-=1),O>t.getRowCount()-1){i(null),e.update(()=>{if(t.getLatest().getNextSibling())t.getLatest().selectNext();else{const y=qe();t.insertAfter(y),y.select()}});return}if(O<0){i(null),e.update(()=>{t.getLatest().selectPrevious()});return}i([b,O])},[t,e]);w.useEffect(()=>{t.focusEmitter.subscribe(a)},[t,a]);const c=w.useCallback(g=>{g.preventDefault(),e.update(()=>{t.addRowToBottom(),i([0,t.getRowCount()])})},[e,t]),u=w.useCallback(g=>{g.preventDefault(),e.update(()=>{t.addColumnToRight(),i([t.getColCount(),0])})},[e,t]),[h,f]=w.useState([-1,-1]),d=w.useCallback(g=>{let m=g.target;for(;m&&!["TH","TD"].includes(m.tagName);){if(m===g.currentTarget)return;m=m.parentElement}if(m===null)return;const b=m.parentElement,x=b.parentElement.tagName==="TFOOT"?-1:Array.from(b.children).indexOf(m),y=m.tagName==="TH"?-1:Array.from(b.parentElement.children).indexOf(b);f([x,y])},[]),p=mt();return w.createElement("table",{className:W.tableEditor,onMouseOver:d,onMouseLeave:()=>{f([-1,-1])}},w.createElement("colgroup",null,o?null:w.createElement("col",null),Array.from({length:n.children[0].children.length},(g,m)=>{const O=(n.align??[])[m]??"left",x=eP[O];return w.createElement("col",{key:m,className:x})}),o?null:w.createElement("col",null)),o||w.createElement("thead",null,w.createElement("tr",null,w.createElement("th",{className:W.tableToolsColumn}),Array.from({length:n.children[0].children.length},(g,m)=>w.createElement("th",{key:m,"data-tool-cell":!0},w.createElement(cZ,{setActiveCellWithBoundaries:a,parentEditor:e,colIndex:m,highlightedCoordinates:h,lexicalTable:t,align:(n.align??[])[m]}))),w.createElement("th",{className:W.tableToolsColumn,"data-tool-cell":!0},w.createElement("button",{className:W.iconButton,type:"button",title:p("table.deleteTable","Delete table"),onClick:g=>{g.preventDefault(),e.update(()=>{t.selectNext(),t.remove()})}},s("delete_small"))))),w.createElement("tbody",null,n.children.map((g,m)=>{const b=J5(m);return w.createElement("tr",{key:m},o||w.createElement(b,{className:W.toolCell,"data-tool-cell":!0},w.createElement(uZ,{setActiveCellWithBoundaries:a,parentEditor:e,rowIndex:m,highlightedCoordinates:h,lexicalTable:t})),g.children.map((O,x)=>{var y;return w.createElement(lZ,{align:(y=n.align)==null?void 0:y[x],key:l(O),contents:O.children,setActiveCell:a,rowIndex:m,colIndex:x,lexicalTable:t,parentEditor:e,activeCell:o?[-1,-1]:r})}),o||m===0&&w.createElement("th",{rowSpan:t.getRowCount(),"data-tool-cell":!0},w.createElement("button",{type:"button",className:W.addColumnButton,onClick:u},s("add_column"))))})),o||w.createElement("tfoot",null,w.createElement("tr",null,w.createElement("th",null),w.createElement("th",{colSpan:t.getColCount()},w.createElement("button",{type:"button",className:W.addRowButton,onClick:c},s("add_row"))),w.createElement("th",null))))},lZ=({align:n,...e})=>{const{activeCell:t,setActiveCell:r}=e,i=!!(t&&t[0]===e.colIndex&&t[1]===e.rowIndex),s=eP[n??"left"],o=J5(e.rowIndex);return w.createElement(o,{className:s,"data-active":i,onClick:()=>{r([e.colIndex,e.rowIndex])}},w.createElement(aZ,{...e,focus:i}))},aZ=({focus:n,setActiveCell:e,parentEditor:t,lexicalTable:r,contents:i,colIndex:s,rowIndex:o})=>{const[l,a,c,u,h,f,d,p]=yt(H1,U1,Y1,G1,o_,yc,s_,Ci),[g]=w.useState(()=>{const b=h2({nodes:c,theme:X1});return b.update(()=>{G2({root:ze(),mdastRoot:{type:"root",children:[{type:"paragraph",children:i}]},visitors:l,jsxComponentDescriptors:u,directiveDescriptors:h,codeBlockEditorDescriptors:f})}),b}),m=w.useCallback(b=>{g.getEditorState().read(()=>{const O=H2({root:ze(),jsxComponentDescriptors:u,visitors:a,jsxIsAvailable:d});t.update(()=>{r.updateCellContents(s,o,O.children[0].children)},{discrete:!0}),t.dispatchCommand(Ea,void 0)}),e(b)},[s,g,a,u,d,r,t,o,e]);return w.useEffect(()=>Yn(g.registerCommand(l1,b=>{b.preventDefault();const O=b.shiftKey?[s-1,o]:[s+1,o];return m(O),!0},cr),g.registerCommand(f1,()=>(e([s,o]),!1),lt),g.registerCommand(Io,b=>{b==null||b.preventDefault();const O=b!=null&&b.shiftKey?[s,o-1]:[s,o+1];return m(O),!0},cr),g.registerCommand(d1,b=>{const O=b.relatedTarget;return K5(O,p.getRootElement())?!1:(m(null),!0)},Ie),g.registerCommand(Ea,()=>(m(null),!0),Ie)),[s,g,p,o,m,e]),w.useEffect(()=>{n&&g.focus()},[n,g]),w.createElement(FI,{initialEditor:g},w.createElement(S_,{contentEditable:w.createElement(v_,null),placeholder:w.createElement("div",null),ErrorBoundary:w_}),w.createElement(x2,null))},cZ=({parentEditor:n,highlightedCoordinates:e,align:t,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:s})=>{const[o,l]=yt(Gs,Tt),a=w.useCallback(f=>{n.update(()=>{r.insertColumnAt(f)}),s([f,0])},[n,r,s]),c=w.useCallback(f=>{n.update(()=>{r.deleteColumnAt(f)})},[n,r]),u=w.useCallback((f,d)=>{n.update(()=>{r.setColumnAlign(f,d)})},[n,r]),h=mt();return w.createElement(v0,null,w.createElement(x0,{className:W.tableColumnEditorTrigger,"data-active":e[0]===i+1,title:h("table.columnMenu","Column menu")},l("more_horiz")),w.createElement(w0,{container:o==null?void 0:o.current},w.createElement(Cd,{className:Fe(W.tableColumnEditorPopoverContent),onOpenAutoFocus:f=>{f.preventDefault()},sideOffset:5,side:"top"},w.createElement(E0,{className:W.tableColumnEditorToolbar},w.createElement(Ed,{className:W.toggleGroupRoot,onValueChange:f=>{u(i,f)},value:t??"left",type:"single","aria-label":h("table.textAlignment","Text alignment")},w.createElement(ch,{value:"left",title:h("table.alignLeft","Align left")},l("format_align_left")),w.createElement(ch,{value:"center",title:h("table.alignCenter","Align center")},l("format_align_center")),w.createElement(ch,{value:"right",title:h("table.alignRight","Align right")},l("format_align_right"))),w.createElement(G5,null),w.createElement(Hi,{onClick:a.bind(null,i),title:h("table.insertColumnLeft","Insert a column to the left of this one")},l("insert_col_left")),w.createElement(Hi,{onClick:a.bind(null,i+1),title:h("table.insertColumnRight","Insert a column to the right of this one")},l("insert_col_right")),w.createElement(Hi,{onClick:c.bind(null,i),title:h("table.deleteColumn","Delete this column")},l("delete_small"))),w.createElement(S0,{className:W.popoverArrow}))))},uZ=({parentEditor:n,highlightedCoordinates:e,lexicalTable:t,rowIndex:r,setActiveCellWithBoundaries:i})=>{const[s,o]=yt(Gs,Tt),l=w.useCallback(u=>{n.update(()=>{t.insertRowAt(u)}),i([0,u])},[n,t,i]),a=w.useCallback(u=>{n.update(()=>{t.deleteRowAt(u)})},[n,t]),c=mt();return w.createElement(v0,null,w.createElement(x0,{className:W.tableColumnEditorTrigger,"data-active":e[1]===r,title:c("table.rowMenu","Row menu")},o("more_horiz")),w.createElement(w0,{container:s==null?void 0:s.current},w.createElement(Cd,{className:Fe(W.tableColumnEditorPopoverContent),onOpenAutoFocus:u=>{u.preventDefault()},sideOffset:5,side:"bottom"},w.createElement(E0,{className:W.tableColumnEditorToolbar},w.createElement(Hi,{onClick:l.bind(null,r),title:c("table.insertRowAbove","Insert a row above this one")},o("insert_row_above")),w.createElement(Hi,{onClick:l.bind(null,r+1),title:c("table.insertRowBelow","Insert a row below this one")},o("insert_row_below")),w.createElement(Hi,{onClick:a.bind(null,r),title:c("table.deleteRow","Delete this row")},o("delete_small"))),w.createElement(S0,{className:W.popoverArrow}))))};var hZ=Object.defineProperty,fZ=(n,e,t)=>e in n?hZ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Rv=(n,e,t)=>(fZ(n,typeof e!="symbol"?e+"":e,t),t);const Mv={type:"tableCell",children:[]};function dZ(){let n=Es;return{publish:e=>{n(e)},subscribe:e=>{n=e}}}class _c extends al{constructor(e,t){super(t),Rv(this,"__mdastNode"),Rv(this,"focusEmitter",dZ()),this.__mdastNode=e??{type:"table",children:[]}}static getType(){return"table"}static clone(e){return new _c(structuredClone(e.__mdastNode),e.__key)}static importJSON(e){return $0(e.mdastNode)}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:"table",version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){var e;return((e=this.__mdastNode.children[0])==null?void 0:e.children.length)||0}createDOM(){return document.createElement("div")}updateDOM(){return!1}updateCellContents(e,t,r){const s=this.getWritable().__mdastNode,o=s.children[t],l=o.children,a=l[e],c=Array.from(l),u={...a,children:r},h={...o,children:c};c[e]=u,s.children[t]=h}insertColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;i0&&r.align.splice(e,0,"left")}deleteColumnAt(e){const r=this.getWritable().__mdastNode;for(let i=0;istructuredClone(Mv))};r.children.splice(e,0,i)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){const i=this.getWritable().__mdastNode;i.align==null&&(i.align=[]),i.align[e]=t}decorate(e){return w.createElement(oZ,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}}function pZ(n){return n instanceof _c}function $0(n){return new _c(n)}const gZ={testLexicalNode:pZ,visitLexicalNode({actions:n,mdastParent:e,lexicalNode:t}){n.appendToParent(e,t.getMdastNode())}},mZ={testNode:"table",visitNode({mdastNode:n,lexicalParent:e}){e.append($0(n))}};function OZ(n=1,e=1){const t={type:"table",children:[]};for(let r=0;r{n.link(n.pipe(tP,ui(({rows:e,columns:t})=>()=>$0(OZ(e,t)))),t0)}),bZ=Nn({init(n){n.pubIn({[Fh]:CI(),[Bh]:LI(),[Oi]:mZ,[us]:_c,[hs]:gZ,[K1]:AI({tableCellPadding:!0,tablePipeAlign:!0})})}}),xZ=new Set(["http:","https:","mailto:","sms:","tel:"]);let A0=class nP extends xr{static getType(){return"link"}static clone(e){return new nP(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),fr(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,s=this.__target,o=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),s!==e.__target&&(s?t.target=s:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:yZ,priority:1})}}static importJSON(e){const t=La(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!xZ.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=La(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!U(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function yZ(n){let e=null;if(x8(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=La(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function La(n,e){return Zn(new A0(n,e))}function Pm(n){return n instanceof A0}const Tm=Si();var Q0="Dialog",[rP,ate]=Od(Q0),[vZ,yr]=rP(Q0),iP=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=n,l=k.useRef(null),a=k.useRef(null),[c=!1,u]=yi({prop:r,defaultProp:i,onChange:s});return R.jsx(vZ,{scope:e,triggerRef:l,contentRef:a,contentId:di(),titleId:di(),descriptionId:di(),open:c,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(h=>!h),[u]),modal:o,children:t})};iP.displayName=Q0;var sP="DialogTrigger",wZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(sP,t),s=tt(e,i.triggerRef);return R.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L0(i.open),...r,ref:s,onClick:Pe(n.onClick,i.onOpenToggle)})});wZ.displayName=sP;var R0="DialogPortal",[SZ,oP]=rP(R0,{forceMount:void 0}),lP=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=yr(R0,e);return R.jsx(SZ,{scope:e,forceMount:t,children:k.Children.map(r,o=>R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:o})}))})};lP.displayName=R0;var Kh="DialogOverlay",aP=k.forwardRef((n,e)=>{const t=oP(Kh,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=yr(Kh,n.__scopeDialog);return s.modal?R.jsx(ps,{present:r||s.open,children:R.jsx(kZ,{...i,ref:e})}):null});aP.displayName=Kh;var kZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(Kh,t);return R.jsx(kd,{as:Ns,allowPinchZoom:!0,shards:[i.contentRef],children:R.jsx(Me.div,{"data-state":L0(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Zs="DialogContent",cP=k.forwardRef((n,e)=>{const t=oP(Zs,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=yr(Zs,n.__scopeDialog);return R.jsx(ps,{present:r||s.open,children:s.modal?R.jsx(CZ,{...i,ref:e}):R.jsx(_Z,{...i,ref:e})})});cP.displayName=Zs;var CZ=k.forwardRef((n,e)=>{const t=yr(Zs,n.__scopeDialog),r=k.useRef(null),i=tt(e,t.contentRef,r);return k.useEffect(()=>{const s=r.current;if(s)return O0(s)},[]),R.jsx(uP,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(n.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pe(n.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&s.preventDefault()}),onFocusOutside:Pe(n.onFocusOutside,s=>s.preventDefault())})}),_Z=k.forwardRef((n,e)=>{const t=yr(Zs,n.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return R.jsx(uP,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=n.onCloseAutoFocus)==null||o.call(n,s),s.defaultPrevented||(r.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,c;(a=n.onInteractOutside)==null||a.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),uP=k.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=n,l=yr(Zs,t),a=k.useRef(null),c=tt(e,a);return s0(),R.jsxs(R.Fragment,{children:[R.jsx(bd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:R.jsx(wc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":L0(l.open),...o,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),R.jsxs(R.Fragment,{children:[R.jsx(TZ,{titleId:l.titleId}),R.jsx($Z,{contentRef:a,descriptionId:l.descriptionId})]})]})}),M0="DialogTitle",hP=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(M0,t);return R.jsx(Me.h2,{id:i.titleId,...r,ref:e})});hP.displayName=M0;var fP="DialogDescription",PZ=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(fP,t);return R.jsx(Me.p,{id:i.descriptionId,...r,ref:e})});PZ.displayName=fP;var dP="DialogClose",pP=k.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=yr(dP,t);return R.jsx(Me.button,{type:"button",...r,ref:e,onClick:Pe(n.onClick,()=>i.onOpenChange(!1))})});pP.displayName=dP;function L0(n){return n?"open":"closed"}var gP="DialogTitleWarning",[cte,mP]=jI(gP,{contentName:Zs,titleName:M0,docsSlug:"dialog"}),TZ=({titleId:n})=>{const e=mP(gP),t=`\`${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. @@ -146,8 +146,8 @@ export default function App() { ); } -`,rG={defaultPreset:"react",presets:[{name:"react",meta:"live react",label:"React",sandpackTemplate:"react",sandpackTheme:"light",snippetFileName:"/App.js",snippetLanguage:"jsx",initialSnippetContent:nG}]},YA=be(rG),iG=gt(n=>{n.link(n.pipe(iG,ct(YA),ui(([e,t])=>{const r=e?t.presets.find(i=>i.name===e):t.presets.find(i=>i.name==t.defaultPreset);if(!r)throw new Error(`No sandpack preset found with name ${e}`);return{code:r.initialSnippetContent??"",language:r.snippetLanguage??"jsx",meta:r.meta}})),Md)});function j(n){return new Yo(Pb.define(n))}function $i(n){return V(()=>import("./index-DASPBQ9R.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>e.sql({dialect:e[n]}))}const sG=[I.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./index-B5Pv1XMp.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./index-B5Pv1XMp.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return $i("Cassandra")}}),I.of({name:"CSS",extensions:["css"],load(){return V(()=>Promise.resolve().then(()=>CY),void 0).then(n=>n.css())}}),I.of({name:"Go",extensions:["go"],load(){return V(()=>import("./index-BIHNXQx0.js"),__vite__mapDeps([8,1,2,3,4,5,6])).then(n=>n.go())}}),I.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return V(()=>Promise.resolve().then(()=>eG),void 0).then(n=>n.html())}}),I.of({name:"Java",extensions:["java"],load(){return V(()=>import("./index-C5noiB26.js"),__vite__mapDeps([9,1,2,3,4,5,6])).then(n=>n.java())}}),I.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript())}}),I.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return V(()=>import("./index-U6IpoprS.js"),__vite__mapDeps([10,1,2,3,4,5,6])).then(n=>n.json())}}),I.of({name:"JSX",extensions:["jsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0}))}}),I.of({name:"LESS",extensions:["less"],load(){return V(()=>import("./index-CM2WSMdR.js"),__vite__mapDeps([11,1,2,3,4,5,6])).then(n=>n.less())}}),I.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./index-C43Yg2RY.js"),__vite__mapDeps([12,1,2,3,4,5,6])).then(n=>n.liquid())}}),I.of({name:"MariaDB SQL",load(){return $i("MariaSQL")}}),I.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return V(()=>Promise.resolve().then(()=>mee),void 0).then(n=>n.markdown())}}),I.of({name:"MS SQL",load(){return $i("MSSQL")}}),I.of({name:"MySQL",load(){return $i("MySQL")}}),I.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return V(()=>import("./index-A8JLZe8e.js"),__vite__mapDeps([13,1,2,3,4,5,6])).then(n=>n.php())}}),I.of({name:"PLSQL",extensions:["pls"],load(){return $i("PLSQL")}}),I.of({name:"PostgreSQL",load(){return $i("PostgreSQL")}}),I.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return V(()=>import("./index-D58BRKR5.js"),__vite__mapDeps([14,1,2,3,4,5,6])).then(n=>n.python())}}),I.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./index-DHgdPR2R.js"),__vite__mapDeps([15,1,2,3,4,5,6])).then(n=>n.rust())}}),I.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./index-D93eCjLG.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass({indented:!0}))}}),I.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./index-D93eCjLG.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass())}}),I.of({name:"SQL",extensions:["sql"],load(){return $i("StandardSQL")}}),I.of({name:"SQLite",load(){return $i("SQLite")}}),I.of({name:"TSX",extensions:["tsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),I.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({typescript:!0}))}}),I.of({name:"WebAssembly",extensions:["wat","wast"],load(){return V(()=>import("./index-CG3ncPiq.js"),__vite__mapDeps([17,1,2,3,4,5,6])).then(n=>n.wast())}}),I.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./index-D0FpL0lt.js"),__vite__mapDeps([18,1,2,3,4,5,6])).then(n=>n.xml())}}),I.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./index-B7VpxOmb.js"),__vite__mapDeps([19,1,2,3,4,5,6])).then(n=>n.yaml())}}),I.of({name:"APL",extensions:["dyalog","apl"],load(){return V(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>j(n.apl))}}),I.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return V(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>j(n.asciiArmor))}}),I.of({name:"ASN.1",extensions:["asn","asn1"],load(){return V(()=>import("./asn1-CGOzndHr.js"),[]).then(n=>j(n.asn1({})))}}),I.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return V(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>j(n.asterisk))}}),I.of({name:"Brainfuck",extensions:["b","bf"],load(){return V(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>j(n.brainfuck))}}),I.of({name:"Cobol",extensions:["cob","cpy"],load(){return V(()=>import("./cobol-XrqhtCFE.js"),[]).then(n=>j(n.cobol))}}),I.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.csharp))}}),I.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"ClojureScript",extensions:["cljs"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return V(()=>import("./css-BnMrqG3P.js"),[]).then(n=>j(n.gss))}}),I.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return V(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>j(n.cmake))}}),I.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return V(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>j(n.coffeeScript))}}),I.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return V(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>j(n.commonLisp))}}),I.of({name:"Cypher",extensions:["cyp","cypher"],load(){return V(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>j(n.cypher))}}),I.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return V(()=>import("./python-BuPzkPfP.js"),[]).then(n=>j(n.cython))}}),I.of({name:"Crystal",extensions:["cr"],load(){return V(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>j(n.crystal))}}),I.of({name:"D",extensions:["d"],load(){return V(()=>import("./d-pRatUO7H.js"),[]).then(n=>j(n.d))}}),I.of({name:"Dart",extensions:["dart"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.dart))}}),I.of({name:"diff",extensions:["diff","patch"],load(){return V(()=>import("./diff-DbItnlRl.js"),[]).then(n=>j(n.diff))}}),I.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return V(()=>import("./dockerfile-BuNIbK2j.js"),__vite__mapDeps([20,21])).then(n=>j(n.dockerFile))}}),I.of({name:"DTD",extensions:["dtd"],load(){return V(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>j(n.dtd))}}),I.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return V(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>j(n.dylan))}}),I.of({name:"EBNF",load(){return V(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>j(n.ebnf))}}),I.of({name:"ECL",extensions:["ecl"],load(){return V(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>j(n.ecl))}}),I.of({name:"edn",extensions:["edn"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Eiffel",extensions:["e"],load(){return V(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>j(n.eiffel))}}),I.of({name:"Elm",extensions:["elm"],load(){return V(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>j(n.elm))}}),I.of({name:"Erlang",extensions:["erl"],load(){return V(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>j(n.erlang))}}),I.of({name:"Esper",load(){return V(()=>import("./sql-C4g8LzGK.js"),[]).then(n=>j(n.esper))}}),I.of({name:"Factor",extensions:["factor"],load(){return V(()=>import("./factor-D8pE9siL.js"),__vite__mapDeps([22,21])).then(n=>j(n.factor))}}),I.of({name:"FCL",load(){return V(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>j(n.fcl))}}),I.of({name:"Forth",extensions:["forth","fth","4th"],load(){return V(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>j(n.forth))}}),I.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return V(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>j(n.fortran))}}),I.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.fSharp))}}),I.of({name:"Gas",extensions:["s"],load(){return V(()=>import("./gas-Bneqetm1.js"),[]).then(n=>j(n.gas))}}),I.of({name:"Gherkin",extensions:["feature"],load(){return V(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>j(n.gherkin))}}),I.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return V(()=>import("./groovy-DKLxxR9y.js"),[]).then(n=>j(n.groovy))}}),I.of({name:"Haskell",extensions:["hs"],load(){return V(()=>import("./haskell-BWDZoCOh.js"),[]).then(n=>j(n.haskell))}}),I.of({name:"Haxe",extensions:["hx"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.haxe))}}),I.of({name:"HXML",extensions:["hxml"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.hxml))}}),I.of({name:"HTTP",load(){return V(()=>import("./http-DBlCnlav.js"),[]).then(n=>j(n.http))}}),I.of({name:"IDL",extensions:["pro"],load(){return V(()=>import("./idl-BEugSyMb.js"),[]).then(n=>j(n.idl))}}),I.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return V(()=>import("./javascript-iSgyE4tI.js"),[]).then(n=>j(n.jsonld))}}),I.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return V(()=>import("./jinja2-C4DGRd-O.js"),[]).then(n=>j(n.jinja2))}}),I.of({name:"Julia",extensions:["jl"],load(){return V(()=>import("./julia-DuME0IfC.js"),[]).then(n=>j(n.julia))}}),I.of({name:"Kotlin",extensions:["kt","kts"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.kotlin))}}),I.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return V(()=>import("./livescript-k3uCVVjK.js"),[]).then(n=>j(n.liveScript))}}),I.of({name:"Lua",extensions:["lua"],load(){return V(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>j(n.lua))}}),I.of({name:"mIRC",extensions:["mrc"],load(){return V(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>j(n.mirc))}}),I.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return V(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>j(n.mathematica))}}),I.of({name:"Modelica",extensions:["mo"],load(){return V(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>j(n.modelica))}}),I.of({name:"MUMPS",extensions:["mps"],load(){return V(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>j(n.mumps))}}),I.of({name:"Mbox",extensions:["mbox"],load(){return V(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>j(n.mbox))}}),I.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return V(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>j(n.nginx))}}),I.of({name:"NSIS",extensions:["nsh","nsi"],load(){return V(()=>import("./nsis-CEAdamBV.js"),__vite__mapDeps([23,21])).then(n=>j(n.nsis))}}),I.of({name:"NTriples",extensions:["nt","nq"],load(){return V(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>j(n.ntriples))}}),I.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveC))}}),I.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveCpp))}}),I.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.oCaml))}}),I.of({name:"Octave",extensions:["m"],load(){return V(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>j(n.octave))}}),I.of({name:"Oz",extensions:["oz"],load(){return V(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>j(n.oz))}}),I.of({name:"Pascal",extensions:["p","pas"],load(){return V(()=>import("./pascal-B1wCu0_E.js"),[]).then(n=>j(n.pascal))}}),I.of({name:"Perl",extensions:["pl","pm"],load(){return V(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>j(n.perl))}}),I.of({name:"Pig",extensions:["pig"],load(){return V(()=>import("./pig-CevX1Tat.js"),[]).then(n=>j(n.pig))}}),I.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return V(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>j(n.powerShell))}}),I.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return V(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>j(n.properties))}}),I.of({name:"ProtoBuf",extensions:["proto"],load(){return V(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>j(n.protobuf))}}),I.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return V(()=>import("./pug-BmUsPMDj.js"),__vite__mapDeps([24,25])).then(n=>j(n.pug))}}),I.of({name:"Puppet",extensions:["pp"],load(){return V(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>j(n.puppet))}}),I.of({name:"Q",extensions:["q"],load(){return V(()=>import("./q-ZnEupP5q.js"),[]).then(n=>j(n.q))}}),I.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return V(()=>import("./r-DUYO_cvP.js"),[]).then(n=>j(n.r))}}),I.of({name:"RPM Changes",load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmChanges))}}),I.of({name:"RPM Spec",extensions:["spec"],load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmSpec))}}),I.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return V(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>j(n.ruby))}}),I.of({name:"SAS",extensions:["sas"],load(){return V(()=>import("./sas-B4kiWyti.js"),[]).then(n=>j(n.sas))}}),I.of({name:"Scala",extensions:["scala"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.scala))}}),I.of({name:"Scheme",extensions:["scm","ss"],load(){return V(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>j(n.scheme))}}),I.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return V(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>j(n.shell))}}),I.of({name:"Sieve",extensions:["siv","sieve"],load(){return V(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>j(n.sieve))}}),I.of({name:"Smalltalk",extensions:["st"],load(){return V(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>j(n.smalltalk))}}),I.of({name:"Solr",load(){return V(()=>import("./solr-DehyRSwq.js"),[]).then(n=>j(n.solr))}}),I.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.sml))}}),I.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return V(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>j(n.sparql))}}),I.of({name:"Spreadsheet",alias:["excel","formula"],load(){return V(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>j(n.spreadsheet))}}),I.of({name:"Squirrel",extensions:["nut"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.squirrel))}}),I.of({name:"Stylus",extensions:["styl"],load(){return V(()=>import("./stylus-BdAi1jBa.js"),[]).then(n=>j(n.stylus))}}),I.of({name:"Swift",extensions:["swift"],load(){return V(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>j(n.swift))}}),I.of({name:"sTeX",load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"Tcl",extensions:["tcl"],load(){return V(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>j(n.tcl))}}),I.of({name:"Textile",extensions:["textile"],load(){return V(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>j(n.textile))}}),I.of({name:"TiddlyWiki",load(){return V(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>j(n.tiddlyWiki))}}),I.of({name:"Tiki wiki",load(){return V(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>j(n.tiki))}}),I.of({name:"TOML",extensions:["toml"],load(){return V(()=>import("./toml-BXUEaScT.js"),[]).then(n=>j(n.toml))}}),I.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return V(()=>import("./troff-wAsdV37c.js"),[]).then(n=>j(n.troff))}}),I.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return V(()=>import("./ttcn-CiGrtVSZ.js"),[]).then(n=>j(n.ttcn))}}),I.of({name:"TTCN_CFG",extensions:["cfg"],load(){return V(()=>import("./ttcn-cfg-BIkV9KBc.js"),[]).then(n=>j(n.ttcnCfg))}}),I.of({name:"Turtle",extensions:["ttl"],load(){return V(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>j(n.turtle))}}),I.of({name:"Web IDL",extensions:["webidl"],load(){return V(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>j(n.webIDL))}}),I.of({name:"VB.NET",extensions:["vb"],load(){return V(()=>import("./vb-CmGdzxic.js"),[]).then(n=>j(n.vb))}}),I.of({name:"VBScript",extensions:["vbs"],load(){return V(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>j(n.vbScript))}}),I.of({name:"Velocity",extensions:["vtl"],load(){return V(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>j(n.velocity))}}),I.of({name:"Verilog",extensions:["v"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return V(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>j(n.vhdl))}}),I.of({name:"XQuery",extensions:["xy","xquery"],load(){return V(()=>import("./xquery-WRlm2TX8.js"),[]).then(n=>j(n.xQuery))}}),I.of({name:"Yacas",extensions:["ys"],load(){return V(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>j(n.yacas))}}),I.of({name:"Z80",extensions:["z80"],load(){return V(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>j(n.z80))}}),I.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.mscgen))}}),I.of({name:"Xù",extensions:["xu"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.xu))}}),I.of({name:"MsGenny",extensions:["msgenny"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.msgenny))}}),I.of({name:"Vue",extensions:["vue"],load(){return V(()=>import("./index-DMnbdnsj.js"),__vite__mapDeps([26,1,2,3,4,5,6])).then(n=>n.vue())}}),I.of({name:"Angular Template",load(){return V(()=>import("./index-CE1nPMQM.js"),__vite__mapDeps([27,1,2,3,4,5,6])).then(n=>n.angular())}})],uk="#2e3440",Yb="#3b4252",hk="#434c5e",Bu="#4c566a",fk="#e5e9f0",AO="#eceff4",gg="#8fbcbb",dk="#88c0d0",oG="#81a1c1",tr="#5e81ac",lG="#bf616a",lo="#d08770",mg="#ebcb8b",pk="#a3be8c",aG="#b48ead",gk="#d30102",Ub=AO,Og=Ub,cG="#ffffff",bg=Yb,uG=Ub,mk=Yb,hG=J.theme({"&":{color:uk,backgroundColor:cG},".cm-content":{caretColor:mk},".cm-cursor, .cm-dropCursor":{borderLeftColor:mk},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uG},".cm-panels":{backgroundColor:Ub,color:Bu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Bu}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fk},".cm-activeLine":{backgroundColor:Og},".cm-selectionMatch":{backgroundColor:fk},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Bu}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:AO},".cm-gutters":{backgroundColor:AO,color:uk,border:"none"},".cm-activeLineGutter":{backgroundColor:Og},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:bg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bg,borderBottomColor:bg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Og,color:Bu}}},{dark:!1}),fG=Xc.define([{tag:E.keyword,color:tr},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:lo},{tag:[E.variableName],color:lo},{tag:[E.function(E.variableName)],color:tr},{tag:[E.labelName],color:oG},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:tr},{tag:[E.definition(E.name),E.separator],color:pk},{tag:[E.brace],color:gg},{tag:[E.annotation],color:gk},{tag:[E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:dk},{tag:[E.typeName,E.className],color:mg},{tag:[E.operator,E.operatorKeyword],color:pk},{tag:[E.tagName],color:aG},{tag:[E.squareBracket],color:lG},{tag:[E.angleBracket],color:lo},{tag:[E.attributeName],color:mg},{tag:[E.regexp],color:tr},{tag:[E.quote],color:Yb},{tag:[E.string],color:lo},{tag:E.link,color:gg,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[E.url,E.escape,E.special(E.string)],color:lo},{tag:[E.meta],color:dk},{tag:[E.comment],color:hk,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold",color:tr},{tag:E.emphasis,fontStyle:"italic",color:tr},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.heading,fontWeight:"bold",color:tr},{tag:E.special(E.heading1),fontWeight:"bold",color:tr},{tag:E.heading1,fontWeight:"bold",color:tr},{tag:[E.heading2,E.heading3,E.heading4],fontWeight:"bold",color:tr},{tag:[E.heading5,E.heading6],color:tr},{tag:[E.atom,E.bool,E.special(E.variableName)],color:lo},{tag:[E.processingInstruction,E.inserted],color:gg},{tag:[E.contentSeparator],color:mg},{tag:E.invalid,color:hk,borderBottom:`1px dotted ${gk}`}]),UA=[hG,a$(fG)];function Je(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;en.normalize("NFKD"):n=>n;class Jo{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(Ok(l)):Ok,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ob(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=zn(e);let i=this.normalize(t);for(let s=0,o=r;;s++){let l=i.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(a)return this.value=a,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Af(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let l=new Ro(t,e.sliceString(t,r));return xg.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Af(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ro.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(JA.prototype[Symbol.iterator]=e9.prototype[Symbol.iterator]=function(){return this});function dG(n){try{return new RegExp(n,Gb),!0}catch{return!1}}function Af(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function QO(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Je("input",{class:"cm-textfield",name:"line",value:e}),r=Je("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Qf.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},Je("label",n.state.phrase("Go to line"),": ",t)," ",Je("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,u,h]=s,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=F.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[Qf.of(!1),J.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:r}}const Qf=Se.define(),bk=vt.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Qf)&&(n=t.value);return n},provide:n=>Xa.from(n,e=>e?QO:null)}),pG=n=>{let e=ja(n,QO);if(!e){let t=[Qf.of(!0)];n.state.field(bk,!1)==null&&t.push(Se.appendConfig.of([bk,gG])),n.dispatch({effects:t}),e=ja(n,QO)}return e&&e.dom.querySelector("input").select(),!0},gG=J.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},OG=fe.define({combine(n){return Jr(n,mG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function bG(n){return[SG,wG]}const xG=Oe.mark({class:"cm-selectionMatch"}),yG=Oe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function xk(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=ut.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=ut.Word)}function vG(n,e,t,r){return n(e.sliceDoc(t,t+1))==ut.Word&&n(e.sliceDoc(r-1,r))==ut.Word}const wG=xt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(OG),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Oe.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Oe.none;let a=t.wordAt(i.head);if(!a)return Oe.none;o=t.charCategorizer(i.head),s=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a200)return Oe.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(xk(o,t,i.from,i.to)&&vG(o,t,i.from,i.to)))return Oe.none}else if(s=t.sliceDoc(i.from,i.to),!s)return Oe.none}let l=[];for(let a of n.visibleRanges){let c=new Jo(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||xk(o,t,u,h))&&(i.empty&&u<=i.from&&h>=i.to?l.push(yG.range(u,h)):(u>=i.to||h<=i.from)&&l.push(xG.range(u,h)),l.length>e.maxMatches))return Oe.none}}return Oe.set(l)}},{decorations:n=>n.decorations}),SG=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kG=({state:n,dispatch:e})=>{let{selection:t}=n,r=F.create(t.ranges.map(i=>n.wordAt(i.head)||F.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function CG(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,l=new Jo(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Jo(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(a=>a.from==l.value.from))continue;if(s){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _G=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return kG({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=CG(n,r);return i?(e(n.update({selection:n.selection.addRange(F.range(i.from,i.to),!1),effects:J.scrollIntoView(i.to)})),!0):!1},Sl=fe.define({combine(n){return Jr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new NG(e),scrollToMatch:e=>J.scrollIntoView(e)})}});class t9{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||dG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new $G(this):new TG(this)}getCursor(e,t=0,r){let i=e.doc?e:Ae.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?po(this,i,t,r):fo(this,i,t,r)}}class n9{constructor(e){this.spec=e}}function fo(n,e,t,r){return new Jo(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?PG(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function PG(n,e){return(t,r,i,s)=>((s>t||s+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=fo(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function po(n,e,t,r){return new JA(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?EG(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Rf(n,e){return n.slice(Yt(n,e,!1),e)}function Mf(n,e){return n.slice(e,Yt(n,e))}function EG(n){return(e,t,r)=>!r[0].length||(n(Rf(r.input,r.index))!=ut.Word||n(Mf(r.input,r.index))!=ut.Word)&&(n(Mf(r.input,r.index+r[0].length))!=ut.Word||n(Rf(r.input,r.index+r[0].length))!=ut.Word)}class $G extends n9{nextMatch(e,t,r){let i=po(this.spec,e,r,e.doc.length).next();return i.done&&(i=po(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=po(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=po(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const nc=Se.define(),Kb=Se.define(),Ui=vt.define({create(n){return new yg(RO(n).create(),null)},update(n,e){for(let t of e.effects)t.is(nc)?n=new yg(t.value.create(),n.panel):t.is(Kb)&&(n=new yg(n.query,t.value?Jb:null));return n},provide:n=>Xa.from(n,e=>e.panel)});class yg{constructor(e,t){this.query=e,this.panel=t}}const AG=Oe.mark({class:"cm-searchMatch"}),QG=Oe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),RG=xt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ui))}update(n){let e=n.state.field(Ui);(e!=n.startState.field(Ui)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Oe.none;let{view:t}=this,r=new Dn;for(let i=0,s=t.visibleRanges,o=s.length;is[i+1].from-2*250;)a=s[++i].to;n.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?QG:AG)})}return r.finish()}},{decorations:n=>n.decorations});function Hc(n){return e=>{let t=e.state.field(Ui,!1);return t&&t.query.spec.valid?n(e,t):s9(e)}}const Lf=Hc((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=F.single(r.from,r.to),s=n.state.facet(Sl);return n.dispatch({selection:i,effects:[ex(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),i9(n),!0}),If=Hc((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=F.single(i.from,i.to),o=n.state.facet(Sl);return n.dispatch({selection:s,effects:[ex(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),i9(n),!0}),MG=Hc((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:F.create(t.map(r=>F.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),LG=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let l=new Jo(n.doc,n.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(F.range(l.value.from,l.value.to))}return e(n.update({selection:F.create(s,o),userEvent:"select.search.matches"})),!0},yk=Hc((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=[],l,a,c=[];if(s.from==r&&s.to==i&&(a=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(J.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),s){let u=o.length==0||o[0].from>=s.to?0:s.to-s.from-a.length;l=F.single(s.from-u,s.to-u),c.push(ex(n,s)),c.push(t.facet(Sl).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),IG=Hc((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:J.announce.of(r),userEvent:"input.replace.all"}),!0});function Jb(n){return n.state.facet(Sl).createPanel(n)}function RO(n,e){var t,r,i,s,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=n.facet(Sl);return new t9({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function r9(n){let e=ja(n,Jb);return e&&e.dom.querySelector("[main-field]")}function i9(n){let e=r9(n);e&&e==n.root.activeElement&&e.select()}const s9=n=>{let e=n.state.field(Ui,!1);if(e&&e.panel){let t=r9(n);if(t&&t!=n.root.activeElement){let r=RO(n.state,e.query.spec);r.valid&&n.dispatch({effects:nc.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Kb.of(!0),e?nc.of(RO(n.state,e.query.spec)):Se.appendConfig.of(ZG)]});return!0},o9=n=>{let e=n.state.field(Ui,!1);if(!e||!e.panel)return!1;let t=ja(n,Jb);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Kb.of(!1)}),!0},DG=[{key:"Mod-f",run:s9,scope:"editor search-panel"},{key:"F3",run:Lf,shift:If,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Lf,shift:If,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:o9,scope:"editor search-panel"},{key:"Mod-Shift-l",run:LG},{key:"Mod-Alt-g",run:pG},{key:"Mod-d",run:_G,preventDefault:!0}];class NG{constructor(e){this.view=e;let t=this.query=e.state.field(Ui).query.spec;this.commit=this.commit.bind(this),this.searchField=Je("input",{value:t.search,placeholder:Pn(e,"Find"),"aria-label":Pn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Je("input",{value:t.replace,placeholder:Pn(e,"Replace"),"aria-label":Pn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Je("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Je("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Je("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return Je("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Je("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Lf(e),[Pn(e,"next")]),r("prev",()=>If(e),[Pn(e,"previous")]),r("select",()=>MG(e),[Pn(e,"all")]),Je("label",null,[this.caseField,Pn(e,"match case")]),Je("label",null,[this.reField,Pn(e,"regexp")]),Je("label",null,[this.wordField,Pn(e,"by word")]),...e.state.readOnly?[]:[Je("br"),this.replaceField,r("replace",()=>yk(e),[Pn(e,"replace")]),r("replaceAll",()=>IG(e),[Pn(e,"replace all")])],Je("button",{name:"close",onclick:()=>o9(e),"aria-label":Pn(e,"close"),type:"button"},["×"])])}commit(){let e=new t9({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:nc.of(e)}))}keydown(e){Pj(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?If:Lf)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),yk(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(nc)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Sl).top}}function Pn(n,e){return n.state.phrase(e)}const Fu=30,zu=/[\s\.,:;?!]/;function ex(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-Fu),o=Math.min(i,t+Fu),l=n.state.sliceDoc(s,o);if(s!=r.from){for(let a=0;al.length-Fu;a--)if(!zu.test(l[a-1])&&zu.test(l[a])){l=l.slice(0,a);break}}return J.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const VG=J.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ZG=[Ui,wr.low(RG),VG];class BG{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class Cs{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=e,s=r.facet(rc).markerFilter;s&&(i=s(i,r));let o=Oe.set(i.map(l=>l.from==l.to||l.from==l.to-1&&r.doc.lineAt(l.from).to==l.from?Oe.widget({widget:new UG(l),diagnostic:l}).range(l.from):Oe.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Cs(o,t,el(o))}}function el(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return r=new BG(i,s,o.diagnostic),!1}),r}function FG(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(rc).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(l9))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function zG(n,e){return n.field(Mn,!1)?e:e.concat(Se.appendConfig.of(JG))}const l9=Se.define(),tx=Se.define(),a9=Se.define(),Mn=vt.define({create(){return new Cs(Oe.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=el(t,n.selected.diagnostic,s)||el(t,null,s)}!t.size&&i&&e.state.facet(rc).autoPanel&&(i=null),n=new Cs(t,i,r)}for(let t of e.effects)if(t.is(l9)){let r=e.state.facet(rc).autoPanel?t.value.length?ic.open:null:n.panel;n=Cs.init(t.value,r,e.state)}else t.is(tx)?n=new Cs(n.diagnostics,t.value?ic.open:null,n.selected):t.is(a9)&&(n=new Cs(n.diagnostics,n.panel,t.value));return n},provide:n=>[Xa.from(n,e=>e.panel),J.decorations.from(n,e=>e.diagnostics)]}),jG=Oe.mark({class:"cm-lintRange cm-lintRange-active"});function XG(n,e,t){let{diagnostics:r}=n.state.field(Mn),i=[],s=2e8,o=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:u})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eu9(n,t,!1)))}const WG=n=>{let e=n.state.field(Mn,!1);(!e||!e.panel)&&n.dispatch({effects:zG(n.state,[tx.of(!0)])});let t=ja(n,ic.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},vk=n=>{let e=n.state.field(Mn,!1);return!e||!e.panel?!1:(n.dispatch({effects:tx.of(!1)}),!0)},HG=n=>{let e=n.state.field(Mn,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},YG=[{key:"Mod-Shift-m",run:WG,preventDefault:!0},{key:"F8",run:HG}],rc=fe.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},Jr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function c9(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;rs.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function u9(n,e,t){var r;let i=t?c9(e.actions):[];return Je("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Je("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let d=el(n.state.field(Mn).diagnostics,e);d&&s.apply(n,d.from,d.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,h=u<0?c:[c.slice(0,u),Je("u",c.slice(u,u+1)),c.slice(u+1)];return Je("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&Je("div",{class:"cm-diagnosticSource"},e.source))}class UG extends Sr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Je("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class wk{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=u9(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ic{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)vk(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=c9(s.actions);for(let l=0;l{for(let s=0;svk(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Mn).selected;if(!e)return-1;for(let t=0;t{let c=-1,u;for(let h=r;hr&&(this.items.splice(r,c-r),i=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Mn),r=el(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:a9.of(r)})}static open(e){return new ic(e)}}function GG(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function ju(n){return GG(``,'width="6" height="3"')}const KG=J.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ju("#d11")},".cm-lintRange-warning":{backgroundImage:ju("orange")},".cm-lintRange-info":{backgroundImage:ju("#999")},".cm-lintRange-hint":{backgroundImage:ju("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),JG=[Mn,J.decorations.compute([Mn],n=>{let{selected:e,panel:t}=n.field(Mn);return!e||!t||e.from==e.to?Oe.none:Oe.set([jG.range(e.from,e.to)])}),dX(XG,{hideOn:FG}),KG],h9=[yb(),CX(),jj(),FW(),mq(),Rj(),Nj(),Ae.allowMultipleSelections.of(!0),iq(),a$(yq,{fallback:!0}),Pq(),yW(),AW(),nX(),sX(),Uj(),bG(),Zc.of([...kW,...jH,...DG,...GW,...fq,...$$,...YG])];function Sk(n,[e,t]){return Math.min(t,Math.max(e,n))}function eK(n){const e=k.useRef({value:n,previous:n});return k.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var tK="VisuallyHidden",nx=k.forwardRef((n,e)=>R.jsx(Me.span,{...n,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",...n.style}}));nx.displayName=tK;var nK=nx,rK=[" ","Enter","ArrowUp","ArrowDown"],iK=[" ","Enter"],Yc="Select",[Hd,Yd,sK]=P5(Yc),[kl,Ote]=Od(Yc,[sK,pl]),Ud=pl(),[oK,Os]=kl(Yc),[lK,aK]=kl(Yc),f9=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:h,disabled:f,required:d,form:p}=n,g=Ud(e),[m,b]=k.useState(null),[O,x]=k.useState(null),[y,v]=k.useState(!1),C=_d(c),[S=!1,_]=yi({prop:r,defaultProp:i,onChange:s}),[P,T]=yi({prop:o,defaultProp:l,onChange:a}),M=k.useRef(null),Q=m?p||!!m.closest("form"):!0,[D,N]=k.useState(new Set),Z=Array.from(D).map(H=>H.props.value).join(";");return R.jsx(p0,{...g,children:R.jsxs(oK,{required:d,scope:e,trigger:m,onTriggerChange:b,valueNode:O,onValueNodeChange:x,valueNodeHasChildren:y,onValueNodeHasChildrenChange:v,contentId:di(),value:P,onValueChange:T,open:S,onOpenChange:_,dir:C,triggerPointerDownPosRef:M,disabled:f,children:[R.jsx(Hd.Provider,{scope:e,children:R.jsx(lK,{scope:n.__scopeSelect,onNativeOptionAdd:k.useCallback(H=>{N(X=>new Set(X).add(H))},[]),onNativeOptionRemove:k.useCallback(H=>{N(X=>{const Y=new Set(X);return Y.delete(H),Y})},[]),children:t})}),Q?R.jsxs(R9,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:h,value:P,onChange:H=>T(H.target.value),disabled:f,form:p,children:[P===void 0?R.jsx("option",{value:""}):null,Array.from(D)]},Z):null]})})};f9.displayName=Yc;var d9="SelectTrigger",p9=k.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=Ud(t),o=Os(d9,t),l=o.disabled||r,a=tt(e,o.onTriggerChange),c=Yd(t),u=k.useRef("touch"),[h,f,d]=M9(g=>{const m=c().filter(x=>!x.disabled),b=m.find(x=>x.value===o.value),O=L9(m,g,b);O!==void 0&&o.onValueChange(O.value)}),p=g=>{l||(o.onOpenChange(!0),d()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return R.jsx(wd,{asChild:!0,...s,children:R.jsx(Me.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:l,"data-disabled":l?"":void 0,"data-placeholder":Q9(o.value)?"":void 0,...i,ref:a,onClick:Pe(i.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&p(g)}),onPointerDown:Pe(i.onPointerDown,g=>{u.current=g.pointerType;const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(p(g),g.preventDefault())}),onKeyDown:Pe(i.onKeyDown,g=>{const m=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(m&&g.key===" ")&&rK.includes(g.key)&&(p(),g.preventDefault())})})})});p9.displayName=d9;var g9="SelectValue",m9=k.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:o="",...l}=n,a=Os(g9,t),{onValueNodeHasChildrenChange:c}=a,u=s!==void 0,h=tt(e,a.onValueNodeChange);return hn(()=>{c(u)},[c,u]),R.jsx(Me.span,{...l,ref:h,style:{pointerEvents:"none"},children:Q9(a.value)?R.jsx(R.Fragment,{children:o}):s})});m9.displayName=g9;var cK="SelectIcon",O9=k.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return R.jsx(Me.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});O9.displayName=cK;var uK="SelectPortal",b9=n=>R.jsx(kc,{asChild:!0,...n});b9.displayName=uK;var Hs="SelectContent",x9=k.forwardRef((n,e)=>{const t=Os(Hs,n.__scopeSelect),[r,i]=k.useState();if(hn(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?Lo.createPortal(R.jsx(y9,{scope:n.__scopeSelect,children:R.jsx(Hd.Slot,{scope:n.__scopeSelect,children:R.jsx("div",{children:n.children})})}),s):null}return R.jsx(v9,{...n,ref:e})});x9.displayName=Hs;var ir=10,[y9,bs]=kl(Hs),hK="SelectContentImpl",v9=k.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:l,sideOffset:a,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:p,hideWhenDetached:g,avoidCollisions:m,...b}=n,O=Os(Hs,t),[x,y]=k.useState(null),[v,C]=k.useState(null),S=tt(e,q=>y(q)),[_,P]=k.useState(null),[T,M]=k.useState(null),Q=Yd(t),[D,N]=k.useState(!1),Z=k.useRef(!1);k.useEffect(()=>{if(x)return O0(x)},[x]),s0();const H=k.useCallback(q=>{const[K,...he]=Q().map(Ce=>Ce.ref.current),[de]=he.slice(-1),ve=document.activeElement;for(const Ce of q)if(Ce===ve||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===K&&v&&(v.scrollTop=0),Ce===de&&v&&(v.scrollTop=v.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==ve))return},[Q,v]),X=k.useCallback(()=>H([_,x]),[H,_,x]);k.useEffect(()=>{D&&X()},[D,X]);const{onOpenChange:Y,triggerPointerDownPosRef:ne}=O;k.useEffect(()=>{if(x){let q={x:0,y:0};const K=de=>{var ve,Ce;q={x:Math.abs(Math.round(de.pageX)-(((ve=ne.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(de.pageY)-(((Ce=ne.current)==null?void 0:Ce.y)??0))}},he=de=>{q.x<=10&&q.y<=10?de.preventDefault():x.contains(de.target)||Y(!1),document.removeEventListener("pointermove",K),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",he,{capture:!0})}}},[x,Y,ne]),k.useEffect(()=>{const q=()=>Y(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[Y]);const[pe,ye]=M9(q=>{const K=Q().filter(ve=>!ve.disabled),he=K.find(ve=>ve.ref.current===document.activeElement),de=L9(K,q,he);de&&setTimeout(()=>de.ref.current.focus())}),we=k.useCallback((q,K,he)=>{const de=!Z.current&&!he;(O.value!==void 0&&O.value===K||de)&&(P(q),de&&(Z.current=!0))},[O.value]),De=k.useCallback(()=>x==null?void 0:x.focus(),[x]),Ee=k.useCallback((q,K,he)=>{const de=!Z.current&&!he;(O.value!==void 0&&O.value===K||de)&&M(q)},[O.value]),Le=r==="popper"?MO:w9,Qe=Le===MO?{side:l,sideOffset:a,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:p,hideWhenDetached:g,avoidCollisions:m}:{};return R.jsx(y9,{scope:t,content:x,viewport:v,onViewportChange:C,itemRefCallback:we,selectedItem:_,onItemLeave:De,itemTextRefCallback:Ee,focusSelectedItem:X,selectedItemText:T,position:r,isPositioned:D,searchRef:pe,children:R.jsx(kd,{as:Ns,allowPinchZoom:!0,children:R.jsx(bd,{asChild:!0,trapped:O.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Pe(i,q=>{var K;(K=O.trigger)==null||K.focus({preventScroll:!0}),q.preventDefault()}),children:R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:R.jsx(Le,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:q=>q.preventDefault(),...b,...Qe,onPlaced:()=>N(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,q=>{const K=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!K&&q.key.length===1&&ye(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let de=Q().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(q.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ve=q.target,Ce=de.indexOf(ve);de=de.slice(Ce+1)}setTimeout(()=>H(de)),q.preventDefault()}})})})})})})});v9.displayName=hK;var fK="SelectItemAlignedPosition",w9=k.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=Os(Hs,t),o=bs(Hs,t),[l,a]=k.useState(null),[c,u]=k.useState(null),h=tt(e,S=>u(S)),f=Yd(t),d=k.useRef(!1),p=k.useRef(!0),{viewport:g,selectedItem:m,selectedItemText:b,focusSelectedItem:O}=o,x=k.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&c&&g&&m&&b){const S=s.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),T=b.getBoundingClientRect();if(s.dir!=="rtl"){const ve=T.left-_.left,Ce=P.left-ve,Ne=S.left-Ce,He=S.width+Ne,Rt=Math.max(He,_.width),Mt=window.innerWidth-ir,Vt=Sk(Ce,[ir,Math.max(ir,Mt-Rt)]);l.style.minWidth=He+"px",l.style.left=Vt+"px"}else{const ve=_.right-T.right,Ce=window.innerWidth-P.right-ve,Ne=window.innerWidth-S.right-Ce,He=S.width+Ne,Rt=Math.max(He,_.width),Mt=window.innerWidth-ir,Vt=Sk(Ce,[ir,Math.max(ir,Mt-Rt)]);l.style.minWidth=He+"px",l.style.right=Vt+"px"}const M=f(),Q=window.innerHeight-ir*2,D=g.scrollHeight,N=window.getComputedStyle(c),Z=parseInt(N.borderTopWidth,10),H=parseInt(N.paddingTop,10),X=parseInt(N.borderBottomWidth,10),Y=parseInt(N.paddingBottom,10),ne=Z+H+D+Y+X,pe=Math.min(m.offsetHeight*5,ne),ye=window.getComputedStyle(g),we=parseInt(ye.paddingTop,10),De=parseInt(ye.paddingBottom,10),Ee=S.top+S.height/2-ir,Le=Q-Ee,Qe=m.offsetHeight/2,q=m.offsetTop+Qe,K=Z+H+q,he=ne-K;if(K<=Ee){const ve=M.length>0&&m===M[M.length-1].ref.current;l.style.bottom="0px";const Ce=c.clientHeight-g.offsetTop-g.offsetHeight,Ne=Math.max(Le,Qe+(ve?De:0)+Ce+X),He=K+Ne;l.style.height=He+"px"}else{const ve=M.length>0&&m===M[0].ref.current;l.style.top="0px";const Ne=Math.max(Ee,Z+g.offsetTop+(ve?we:0)+Qe)+he;l.style.height=Ne+"px",g.scrollTop=K-Ee+g.offsetTop}l.style.margin=`${ir}px 0`,l.style.minHeight=pe+"px",l.style.maxHeight=Q+"px",r==null||r(),requestAnimationFrame(()=>d.current=!0)}},[f,s.trigger,s.valueNode,l,c,g,m,b,s.dir,r]);hn(()=>x(),[x]);const[y,v]=k.useState();hn(()=>{c&&v(window.getComputedStyle(c).zIndex)},[c]);const C=k.useCallback(S=>{S&&p.current===!0&&(x(),O==null||O(),p.current=!1)},[x,O]);return R.jsx(pK,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:d,onScrollButtonChange:C,children:R.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:R.jsx(Me.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});w9.displayName=fK;var dK="SelectPopperPosition",MO=k.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=ir,...s}=n,o=Ud(t);return R.jsx(g0,{...o,...s,ref:e,align:r,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)"}})});MO.displayName=dK;var[pK,rx]=kl(Hs,{}),LO="SelectViewport",S9=k.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...i}=n,s=bs(LO,t),o=rx(LO,t),l=tt(e,s.onViewportChange),a=k.useRef(0);return R.jsxs(R.Fragment,{children:[R.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:r}),R.jsx(Hd.Slot,{scope:t,children:R.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Pe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const d=Math.abs(a.current-u.scrollTop);if(d>0){const p=window.innerHeight-ir*2,g=parseFloat(h.style.minHeight),m=parseFloat(h.style.height),b=Math.max(g,m);if(b0?y:0,h.style.justifyContent="flex-end")}}}a.current=u.scrollTop})})})]})});S9.displayName=LO;var k9="SelectGroup",[gK,mK]=kl(k9),OK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=di();return R.jsx(gK,{scope:t,id:i,children:R.jsx(Me.div,{role:"group","aria-labelledby":i,...r,ref:e})})});OK.displayName=k9;var C9="SelectLabel",bK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=mK(C9,t);return R.jsx(Me.div,{id:i.id,...r,ref:e})});bK.displayName=C9;var Df="SelectItem",[xK,_9]=kl(Df),P9=k.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...o}=n,l=Os(Df,t),a=bs(Df,t),c=l.value===r,[u,h]=k.useState(s??""),[f,d]=k.useState(!1),p=tt(e,O=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,O,r,i)}),g=di(),m=k.useRef("touch"),b=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")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 R.jsx(xK,{scope:t,value:r,disabled:i,textId:g,isSelected:c,onItemTextChange:k.useCallback(O=>{h(x=>x||((O==null?void 0:O.textContent)??"").trim())},[]),children:R.jsx(Hd.ItemSlot,{scope:t,value:r,disabled:i,textValue:u,children:R.jsx(Me.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:p,onFocus:Pe(o.onFocus,()=>d(!0)),onBlur:Pe(o.onBlur,()=>d(!1)),onClick:Pe(o.onClick,()=>{m.current!=="mouse"&&b()}),onPointerUp:Pe(o.onPointerUp,()=>{m.current==="mouse"&&b()}),onPointerDown:Pe(o.onPointerDown,O=>{m.current=O.pointerType}),onPointerMove:Pe(o.onPointerMove,O=>{var x;m.current=O.pointerType,i?(x=a.onItemLeave)==null||x.call(a):m.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(o.onPointerLeave,O=>{var x;O.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Pe(o.onKeyDown,O=>{var y;((y=a.searchRef)==null?void 0:y.current)!==""&&O.key===" "||(iK.includes(O.key)&&b(),O.key===" "&&O.preventDefault())})})})})});P9.displayName=Df;var Jl="SelectItemText",T9=k.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,o=Os(Jl,t),l=bs(Jl,t),a=_9(Jl,t),c=aK(Jl,t),[u,h]=k.useState(null),f=tt(e,b=>h(b),a.onItemTextChange,b=>{var O;return(O=l.itemTextRefCallback)==null?void 0:O.call(l,b,a.value,a.disabled)}),d=u==null?void 0:u.textContent,p=k.useMemo(()=>R.jsx("option",{value:a.value,disabled:a.disabled,children:d},a.value),[a.disabled,a.value,d]),{onNativeOptionAdd:g,onNativeOptionRemove:m}=c;return hn(()=>(g(p),()=>m(p)),[g,m,p]),R.jsxs(R.Fragment,{children:[R.jsx(Me.span,{id:a.textId,...s,ref:f}),a.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Lo.createPortal(s.children,o.valueNode):null]})});T9.displayName=Jl;var E9="SelectItemIndicator",yK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return _9(E9,t).isSelected?R.jsx(Me.span,{"aria-hidden":!0,...r,ref:e}):null});yK.displayName=E9;var IO="SelectScrollUpButton",vK=k.forwardRef((n,e)=>{const t=bs(IO,n.__scopeSelect),r=rx(IO,n.__scopeSelect),[i,s]=k.useState(!1),o=tt(e,r.onScrollButtonChange);return hn(()=>{if(t.viewport&&t.isPositioned){let l=function(){const c=a.scrollTop>0;s(c)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?R.jsx($9,{...n,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});vK.displayName=IO;var DO="SelectScrollDownButton",wK=k.forwardRef((n,e)=>{const t=bs(DO,n.__scopeSelect),r=rx(DO,n.__scopeSelect),[i,s]=k.useState(!1),o=tt(e,r.onScrollButtonChange);return hn(()=>{if(t.viewport&&t.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?R.jsx($9,{...n,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});wK.displayName=DO;var $9=k.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...i}=n,s=bs("SelectScrollButton",t),o=k.useRef(null),l=Yd(t),a=k.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return k.useEffect(()=>()=>a(),[a]),hn(()=>{var u;const c=l().find(h=>h.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),R.jsx(Me.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Pe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Pe(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Pe(i.onPointerLeave,()=>{a()})})}),SK="SelectSeparator",A9=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return R.jsx(Me.div,{"aria-hidden":!0,...r,ref:e})});A9.displayName=SK;var NO="SelectArrow",kK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=Ud(t),s=Os(NO,t),o=bs(NO,t);return s.open&&o.position==="popper"?R.jsx(m0,{...i,...r,ref:e}):null});kK.displayName=NO;function Q9(n){return n===""||n===void 0}var R9=k.forwardRef((n,e)=>{const{value:t,...r}=n,i=k.useRef(null),s=tt(e,i),o=eK(t);return k.useEffect(()=>{const l=i.current,a=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(a,"value").set;if(o!==t&&u){const h=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[o,t]),R.jsx(nx,{asChild:!0,children:R.jsx("select",{...r,ref:s,defaultValue:t})})});R9.displayName="BubbleSelect";function M9(n){const e=Hr(n),t=k.useRef(""),r=k.useRef(0),i=k.useCallback(o=>{const l=t.current+o;e(l),function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(l)},[e]),s=k.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function L9(n,e,t){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let o=CK(n,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==t));const a=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==t?a:void 0}function CK(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var _K=f9,PK=p9,TK=m9,EK=O9,$K=b9,AK=x9,QK=S9,RK=P9,MK=T9,LK=A9,[Gd,bte]=Od("Tooltip",[pl]),Kd=pl(),I9="TooltipProvider",IK=700,VO="tooltip.open",[DK,ix]=Gd(I9),D9=n=>{const{__scopeTooltip:e,delayDuration:t=IK,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=n,[o,l]=k.useState(!0),a=k.useRef(!1),c=k.useRef(0);return k.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),R.jsx(DK,{scope:e,isOpenDelayed:o,delayDuration:t,onOpen:k.useCallback(()=>{window.clearTimeout(c.current),l(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:k.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};D9.displayName=I9;var Jd="Tooltip",[NK,Uc]=Gd(Jd),N9=n=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=n,a=ix(Jd,n.__scopeTooltip),c=Kd(e),[u,h]=k.useState(null),f=di(),d=k.useRef(0),p=o??a.disableHoverableContent,g=l??a.delayDuration,m=k.useRef(!1),[b=!1,O]=yi({prop:r,defaultProp:i,onChange:S=>{S?(a.onOpen(),document.dispatchEvent(new CustomEvent(VO))):a.onClose(),s==null||s(S)}}),x=k.useMemo(()=>b?m.current?"delayed-open":"instant-open":"closed",[b]),y=k.useCallback(()=>{window.clearTimeout(d.current),m.current=!1,O(!0)},[O]),v=k.useCallback(()=>{window.clearTimeout(d.current),O(!1)},[O]),C=k.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{m.current=!0,O(!0)},g)},[g,O]);return k.useEffect(()=>()=>window.clearTimeout(d.current),[]),R.jsx(p0,{...c,children:R.jsx(NK,{scope:e,contentId:f,open:b,stateAttribute:x,trigger:u,onTriggerChange:h,onTriggerEnter:k.useCallback(()=>{a.isOpenDelayed?C():y()},[a.isOpenDelayed,C,y]),onTriggerLeave:k.useCallback(()=>{p?v():window.clearTimeout(d.current)},[v,p]),onOpen:y,onClose:v,disableHoverableContent:p,children:t})})};N9.displayName=Jd;var ZO="TooltipTrigger",V9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=Uc(ZO,t),s=ix(ZO,t),o=Kd(t),l=k.useRef(null),a=tt(e,l,i.onTriggerChange),c=k.useRef(!1),u=k.useRef(!1),h=k.useCallback(()=>c.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),R.jsx(wd,{asChild:!0,...o,children:R.jsx(Me.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:a,onPointerMove:Pe(n.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(n.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(n.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Pe(n.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(n.onBlur,i.onClose),onClick:Pe(n.onClick,i.onClose)})})});V9.displayName=ZO;var sx="TooltipPortal",[VK,ZK]=Gd(sx,{forceMount:void 0}),Z9=n=>{const{__scopeTooltip:e,forceMount:t,children:r,container:i}=n,s=Uc(sx,e);return R.jsx(VK,{scope:e,forceMount:t,children:R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:r})})})};Z9.displayName=sx;var tl="TooltipContent",B9=k.forwardRef((n,e)=>{const t=ZK(tl,n.__scopeTooltip),{forceMount:r=t.forceMount,side:i="top",...s}=n,o=Uc(tl,n.__scopeTooltip);return R.jsx(ps,{present:r||o.open,children:o.disableHoverableContent?R.jsx(F9,{side:i,...s,ref:e}):R.jsx(BK,{side:i,...s,ref:e})})}),BK=k.forwardRef((n,e)=>{const t=Uc(tl,n.__scopeTooltip),r=ix(tl,n.__scopeTooltip),i=k.useRef(null),s=tt(e,i),[o,l]=k.useState(null),{trigger:a,onClose:c}=t,u=i.current,{onPointerInTransitChange:h}=r,f=k.useCallback(()=>{l(null),h(!1)},[h]),d=k.useCallback((p,g)=>{const m=p.currentTarget,b={x:p.clientX,y:p.clientY},O=jK(b,m.getBoundingClientRect()),x=XK(b,O),y=qK(g.getBoundingClientRect()),v=HK([...x,...y]);l(v),h(!0)},[h]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(a&&u){const p=m=>d(m,u),g=m=>d(m,a);return a.addEventListener("pointerleave",p),u.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",g)}}},[a,u,d,f]),k.useEffect(()=>{if(o){const p=g=>{const m=g.target,b={x:g.clientX,y:g.clientY},O=(a==null?void 0:a.contains(m))||(u==null?void 0:u.contains(m)),x=!WK(b,o);O?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[a,u,o,c,f]),R.jsx(F9,{...n,ref:s})}),[FK,zK]=Gd(Jd,{isInside:!1}),F9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...l}=n,a=Uc(tl,t),c=Kd(t),{onClose:u}=a;return k.useEffect(()=>(document.addEventListener(VO,u),()=>document.removeEventListener(VO,u)),[u]),k.useEffect(()=>{if(a.trigger){const h=f=>{const d=f.target;d!=null&&d.contains(a.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[a.trigger,u]),R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:R.jsxs(g0,{"data-state":a.stateAttribute,...c,...l,ref:e,style:{...l.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:[R.jsx(F_,{children:r}),R.jsx(FK,{scope:t,isInside:!0,children:R.jsx(nK,{id:a.contentId,role:"tooltip",children:i||r})})]})})});B9.displayName=tl;var z9="TooltipArrow",j9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=Kd(t);return zK(z9,t).isInside?null:R.jsx(m0,{...i,...r,ref:e})});j9.displayName=z9;function jK(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),i=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,i,s)){case s:return"left";case i:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XK(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function qK(n){const{top:e,right:t,bottom:r,left:i}=n;return[{x:i,y:e},{x:t,y:e},{x:t,y:r},{x:i,y:r}]}function WK(n,e){const{x:t,y:r}=n;let i=!1;for(let s=0,o=e.length-1;sr!=u>r&&t<(c-l)*(r-a)/(u-a)+l&&(i=!i)}return i}function HK(n){const e=n.slice();return e.sort((t,r)=>t.xr.x?1:t.yr.y?1:0),YK(e)}function YK(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r=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 t=[];for(let r=n.length-1;r>=0;r--){const i=n[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var X9=D9,q9=N9,W9=V9,H9=Z9,Y9=B9,UK=j9;const Gc=w.forwardRef(({title:n,children:e},t)=>{const r=Nt(Gs);return w.createElement(X9,{delayDuration:100},w.createElement(q9,null,w.createElement(W9,{ref:t,asChild:!0},w.createElement("span",{className:W.tooltipTrigger},e)),w.createElement(H9,{container:r==null?void 0:r.current},w.createElement(Y9,{className:Fe(W.tooltipContent),sideOffset:10},n))))}),GK=w.forwardRef(({children:n,className:e,...t},r)=>w.createElement(RK,{...t,ref:r,className:Fe(e,W.selectItem)},w.createElement(MK,null,n))),KK=({title:n,placeholder:e,className:t})=>{const[r,i]=yt(In,Tt);return w.createElement(Gc,{title:n},w.createElement(PK,{"aria-label":e,className:Fe(W.selectTrigger,t),"data-toolbar-item":!0,disabled:r},w.createElement(TK,{placeholder:e}),w.createElement(EK,{className:W.selectDropdownArrow},i("arrow_drop_down"))))},JK=({children:n,className:e=W.selectContainer})=>{const t=Nt(Gs);return w.createElement($K,{container:t==null?void 0:t.current},w.createElement(AK,{className:Fe(e,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},w.createElement(QK,{"data-editor-dropdown":!0},n)))},U9=n=>w.createElement(_K,{value:n.value||void 0,onValueChange:n.onChange},w.createElement(KK,{title:n.triggerTitle,placeholder:n.placeholder}),w.createElement(JK,null,n.items.map((e,t)=>e==="separator"?w.createElement(LK,{key:t}):w.createElement(GK,{key:t,value:e.value},e.label)))),kk="__EMPTY_VALUE__",eJ=({language:n,nodeKey:e,code:t,focusEmitter:r})=>{const i=mt(),{parentEditor:s,lexicalNode:o}=Rm(),[l,a,c,u,h]=yt(In,FO,zO,Tt,BO),f=tG(e,"codeblock",n,r),{setCode:d}=Rm(),p=w.useRef(null),g=w.useRef(null),m=w.useRef(d);return m.current=d,f.current={getCodemirror:()=>p.current},w.useEffect(()=>((async()=>{const b=[...a,h9,UA,yb(),J.lineWrapping,J.updateListener.of(({state:O})=>{m.current(O.doc.toString())})];if(l&&b.push(Ae.readOnly.of(!0)),n!==""&&c){const O=sG.find(x=>x.name===n||x.alias.includes(n)||x.extensions.includes(n));if(O)try{const x=await O.load();b.push(x.extension)}catch{console.warn("failed to load language support for",n)}}g.current.innerHTML="",p.current=new J({parent:g.current,state:Ae.create({doc:t,extensions:b})})})(),()=>{var b;(b=p.current)==null||b.destroy(),p.current=null}),[l,n]),w.createElement("div",{className:W.codeMirrorWrapper,onKeyDown:b=>{b.stopPropagation()}},w.createElement("div",{className:W.codeMirrorToolbar},w.createElement(U9,{value:n,onChange:b=>{s.update(()=>{o.setLanguage(b===kk?"":b),setTimeout(()=>{s.update(()=>{o.getLatest().select()})})})},triggerTitle:i("codeBlock.selectLanguage","Select code block language"),placeholder:i("codeBlock.inlineLanguage","Language"),items:Object.entries(h).map(([b,O])=>({value:b||kk,label:O}))}),w.createElement("button",{className:W.iconButton,type:"button",title:i("codeblock.delete","Delete code block"),onClick:b=>{b.preventDefault(),s.update(()=>{o.remove()})}},u("delete_small"))),w.createElement("div",{ref:g}))},BO=be({js:"JavaScript",ts:"TypeScript",tsx:"TypeScript (React)",jsx:"JavaScript (React)",css:"CSS"}),tJ=gt(n=>{n.link(n.pipe(tJ,ui(({language:e,code:t})=>({code:t,language:e,meta:""}))),Md)}),FO=be([]),zO=be(!0),nJ=Nn({update(n,e){n.pubIn({[BO]:e==null?void 0:e.codeBlockLanguages,[FO]:(e==null?void 0:e.codeMirrorExtensions)??[],[zO]:(e==null?void 0:e.autoLoadLanguageSupport)??!0})},init(n,e){n.pubIn({[BO]:e==null?void 0:e.codeBlockLanguages,[FO]:(e==null?void 0:e.codeMirrorExtensions)??[],[QF]:rJ((e==null?void 0:e.codeBlockLanguages)??{}),[zO]:(e==null?void 0:e.autoLoadLanguageSupport)??!0})}});function rJ(n){return{match(e,t){return!!Object.hasOwn(n,e??"")&&!t},priority:1,Editor:eJ}}function iJ(n){try{const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?sy(t)?r:i:sy(e)?r:i}catch{return null}}function G9(n){const e=le(),t=window.getSelection(),r=document.activeElement,i=n.getRootElement();if(e!==null&&t!==null&&i!==null&&i.contains(t.anchorNode)&&n.isEditable()){const s=t.getRangeAt(0);let o;if(t.isCollapsed){let l=t.anchorNode;(l==null?void 0:l.nodeType)==3&&(l=l.parentNode),o=l.getBoundingClientRect(),o.width=0}else if(t.anchorNode===i){let l=i;for(;l.firstElementChild!=null;)l=l.firstElementChild;o=l.getBoundingClientRect()}else o=s.getBoundingClientRect();return{top:Math.round(o.top),left:Math.round(o.left),width:Math.round(o.width),height:Math.round(o.height)}}else if(!r||r.className!=="link-input")return null;return null}function sJ({url:n,title:e,onSubmit:t,onCancel:r,linkAutocompleteSuggestions:i}){const{register:s,handleSubmit:o,control:l,setValue:a,reset:c}=AP({values:{url:n,title:e}}),u=mt();return w.createElement("form",{onSubmit:h=>{o(t)(h),h.stopPropagation(),h.preventDefault()},onReset:h=>{h.stopPropagation(),r()},className:Fe(W.multiFieldForm,W.linkDialogEditForm)},w.createElement("div",{className:W.formField},w.createElement("label",{htmlFor:"link-url"},u("createLink.url","URL")),w.createElement(rT,{register:s,initialInputValue:n,inputName:"url",suggestions:i,setValue:a,control:l,placeholder:u("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),w.createElement("div",{className:W.formField},w.createElement("label",{htmlFor:"link-title"},u("createLink.title","Title")),w.createElement("input",{id:"link-title",className:W.textInput,size:40,...s("title")})),w.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},w.createElement("button",{type:"submit",title:u("createLink.saveTooltip","Set URL"),"aria-label":u("createLink.saveTooltip","Set URL"),className:Fe(W.primaryButton)},u("dialogControls.save","Save")),w.createElement("button",{type:"reset",title:u("createLink.cancelTooltip","Cancel change"),"aria-label":u("createLink.cancelTooltip","Cancel change"),className:Fe(W.secondaryButton)},u("dialogControls.cancel","Cancel"))))}const oJ=()=>{const[n,e,t,r,i,s]=yt(Gs,ft,Tt,mn,r3,i3),o=at(K9),l=at(J9),a=at(e3),c=at(t3),u=at(n3);w.useEffect(()=>{const m=()=>{e==null||e.getEditorState().read(()=>{o(!0)})};return window.addEventListener("resize",m),window.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m)}},[e,o]);const[h,f]=w.useState(!1),d=mt(),p=r.rectangle,g=r.type==="preview"&&r.url.startsWith("http");return w.createElement(v0,{open:r.type!=="inactive"},w.createElement(vV,{"data-visible":r.type==="edit",className:W.linkDialogAnchor,style:{top:`${(p==null?void 0:p.top)??0}px`,left:`${(p==null?void 0:p.left)??0}px`,width:`${(p==null?void 0:p.width)??0}px`,height:`${(p==null?void 0:p.height)??0}px`}}),w.createElement(w0,{container:n==null?void 0:n.current},w.createElement(wV,{className:Fe(W.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:m=>{m.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&w.createElement(sJ,{url:r.url,title:r.title,onSubmit:l,onCancel:a.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&w.createElement(w.Fragment,null,w.createElement("a",{className:W.linkDialogPreviewAnchor,href:r.url,...g?{target:"_blank",rel:"noreferrer"}:{},onClick:m=>{s!==null&&(m.preventDefault(),s(r.url))},title:g?d("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},w.createElement("span",null,r.url),g&&t("open_in_new")),w.createElement(vg,{onClick:()=>{c()},title:d("linkPreview.edit","Edit link URL"),"aria-label":d("linkPreview.edit","Edit link URL")},t("edit")),w.createElement(X9,null,w.createElement(q9,{open:h},w.createElement(W9,{asChild:!0},w.createElement(vg,{title:d("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":d("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},t(h?"check":"content_copy"))),w.createElement(H9,{container:n==null?void 0:n.current},w.createElement(Y9,{className:Fe(W.tooltipContent),sideOffset:5},d("linkPreview.copied","Copied!"),w.createElement(UK,null))))),w.createElement(vg,{title:d("linkPreview.remove","Remove link"),"aria-label":d("linkPreview.remove","Remove link"),onClick:()=>{u()}},t("link_off"))),w.createElement(S0,{className:W.popoverArrow}))))},vg=w.forwardRef(({className:n,...e},t)=>w.createElement("button",{className:Fe(W.actionButton,n),ref:t,...e}));function jO(n){if(!n)return null;const e=iJ(n);if(e===null)return null;const t=e.getParent();return Pm(t)?t:Pm(e)?e:null}const K9=gt(),mn=be({type:"inactive"},n=>{n.pub(zh,e=>e.registerCommand(uc,()=>n.getValue(mn).type==="preview"?(n.pub(mn,{type:"inactive"}),!0):!1,lt)),n.pub(zh,e=>e.registerCommand(SC,t=>{if(t.key==="k"&&(Zh?t.metaKey:t.ctrlKey)&&!n.getValue(In)){const r=le();return U(r)?(n.pub(ox),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},Jg)),n.link(n.pipe(t3,ct(mn),ui(([,e])=>{if(e.type==="preview")return{type:"edit",initialUrl:e.url,url:e.url,title:e.title,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),mn),n.sub(n.pipe(J9,ct(ft,mn,Vo)),([e,t,r,i])=>{var s,o;const l=((s=e.url)==null?void 0:s.trim())??"",a=((o=e.title)==null?void 0:o.trim())??"";if(l!==""){if(i!=null&&i.isCollapsed()){const c=a||l;t==null||t.update(()=>{const u=jO(i);if(u)u.setURL(l),u.setTitle(a);else{const h=La(l,{title:a});h.append(Ot(c)),ll([h]),h.select()}},{discrete:!0})}else t==null||t.dispatchCommand(Tm,{url:l,title:a});n.pub(mn,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:a,url:l})}else r.type==="edit"&&r.initialUrl!==""&&(t==null||t.dispatchCommand(Tm,null)),n.pub(mn,{type:"inactive"})}),n.link(n.pipe(e3,ct(mn,ft),ui(([,e,t])=>{if(e.type==="edit")return t==null||t.focus(),e.initialUrl===""?{type:"inactive"}:{type:"preview",url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),mn),n.link(n.pipe(n.combine(Vo,K9),ct(ft,mn,In),ui(([[e],t,r,i])=>{if(U(e)&&t&&!i){const s=jO(e);return s?{type:"preview",url:s.getURL(),linkNodeKey:s.getKey(),title:s.getTitle(),rectangle:G9(t)}:{type:"inactive"}}else return{type:"inactive"}})),mn)}),J9=gt(),e3=os();os();const t3=os(),n3=os(n=>{n.sub(n.pipe(n3,ct(ft)),([,e])=>{e==null||e.dispatchCommand(Tm,null)})}),ox=os(n=>{n.sub(n.pipe(ox,ct(Vo,ft),ac(([,e])=>U(e))),([,e,t])=>{t==null||t.focus(()=>{t.getEditorState().read(()=>{const r=jO(e),i=G9(t);r?n.pub(mn,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):n.pub(mn,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})}),r3=be([]),i3=be(null),lJ=Nn({init(n,e){n.pub(hl,(e==null?void 0:e.LinkDialog)??oJ),n.pub(i3,(e==null?void 0:e.onClickLinkCallback)??null)},update(n,e={}){n.pub(r3,e.linkAutocompleteSuggestions??[])}});function lx(n,e){return w.forwardRef((t,r)=>{const i=Fe(e.className,t.className);return w.createElement(n,{...e,...t,className:i,ref:r})})}function aJ(n){return({title:e,children:t,...r})=>w.createElement(n,{...r},w.createElement(Gc,{title:e},t))}const cJ=({readOnly:n,children:e,className:t})=>w.createElement(E0,{className:Fe("mdxeditor-toolbar",W.toolbarRoot,{[W.readOnlyToolbarRoot]:n},t),...n?{tabIndex:-1}:{}},e),uJ=lx(Hi,{className:W.toolbarButton,"data-toolbar-item":!0}),Kc=aJ(uJ),s3=lx(ch,{className:W.toolbarToggleItem,"data-toolbar-item":!0});lx(Ed,{type:"single",className:W.toolbarToggleSingleGroup});const o3=w.forwardRef(({on:n,title:e,children:t,disabled:r,...i},s)=>w.createElement(Ed,{type:"single",className:W.toolbarToggleSingleGroup,...i,value:n?"on":"off",ref:s},w.createElement(s3,{title:e,value:"on",disabled:r},w.createElement(Gc,{title:e},t)))),l3=({items:n})=>w.createElement("div",{className:W.toolbarGroupOfGroups},n.map((e,t)=>w.createElement(o3,{key:t,title:e.title,on:e.active,onValueChange:r=>{e.onChange(r==="on")},disabled:e.disabled},e.contents))),a3=({value:n,onChange:e,className:t,items:r})=>{const i=mt();return w.createElement("div",{className:W.toolbarGroupOfGroups},w.createElement(Ed,{"aria-label":i("toolbar.toggleGroup","toggle group"),type:"single",className:Fe(W.toolbarToggleSingleGroup,t),onValueChange:e,value:n||"",onFocus:s=>{s.preventDefault()}},r.map((s,o)=>w.createElement(s3,{key:o,"aria-label":s.title,value:s.value},w.createElement(Gc,{title:s.title},s.contents)))))};function Ck(n){return Object.hasOwn(n,"when")}const hJ=({options:n})=>{const e=Nt(dd),t=w.useMemo(()=>{const r=n.find(i=>{if(Ck(i)){if(i.when(e))return!0}else return!0});return r?Ck(r)?r.contents():r.fallback():null},[n,e]);return w.createElement("div",{style:{display:"flex"}},t)},fJ=G5,wg=be(()=>null),Sg=be(""),_k=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components }}` to the toolbarPlugin to customize it.",dJ=Nn({init(n,e){n.pubIn({[wg]:(e==null?void 0:e.toolbarContents)??_k,[Sg]:(e==null?void 0:e.toolbarClassName)??"",[f6]:()=>{const[t,r,i]=yt(wg,In,Sg);return w.createElement(cJ,{className:i,readOnly:r},t())}})},update(n,e){n.pub(wg,(e==null?void 0:e.toolbarContents)??_k),n.pub(Sg,(e==null?void 0:e.toolbarClassName)??"")}});class kt{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}offset(e,t=e){return new kt(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function Ys(n,e,t,r,i,s){if(n==r)return[];let o=ax(n,e,t,r,i,s),l=cx(n,e+o,t,r,i+o,s);e+=o,t-=l,i+=o,s-=l;let a=t-e,c=s-i;if(!a||!c)return[new kt(e,t,i,s)];if(a>c){let h=n.slice(e,t).indexOf(r.slice(i,s));if(h>-1)return[new kt(e,e+h,i,i),new kt(e+h+c,t,s,s)]}else if(c>a){let h=r.slice(i,s).indexOf(n.slice(e,t));if(h>-1)return[new kt(e,e,i,i+h),new kt(t,t,i+h+a,s)]}if(a==1||c==1)return[new kt(e,t,i,s)];let u=h3(n,e,t,r,i,s);if(u){let[h,f,d]=u;return Ys(n,e,h,r,i,f).concat(Ys(n,h+d,t,r,f+d,s))}return pJ(n,e,t,r,i,s)}let ea=1e9;function pJ(n,e,t,r,i,s){let o=t-e,l=s-i;if(ea<1e9&&Math.min(o,l)>ea*16)return Math.min(o,l)>ea*64?[new kt(e,t,i,s)]:Pk(n,e,t,r,i,s);let a=Math.ceil((o+l)/2);kg.reset(a),Cg.reset(a);let c=(d,p)=>n.charCodeAt(e+d)==r.charCodeAt(i+p),u=(d,p)=>n.charCodeAt(t-d-1)==r.charCodeAt(s-p-1),h=(o-l)%2!=0?Cg:null,f=h?null:kg;for(let d=0;dea)return Pk(n,e,t,r,i,s);let p=kg.advance(d,o,l,a,h,!1,c)||Cg.advance(d,o,l,a,f,!0,u);if(p)return gJ(n,e,t,e+p[0],r,i,s,i+p[1])}return[new kt(e,t,i,s)]}class c3{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;tt)this.end+=2;else if(h>r)this.start+=2;else if(s){let f=i+(t-r)-a;if(f>=0&&f=t-u)return[d,i+d-f]}else{let d=t-s.vec[f];if(u>=d)return[u,h]}}}return null}}const kg=new c3,Cg=new c3;function gJ(n,e,t,r,i,s,o,l){let a=!1;return!nl(n,r)&&++r==t&&(a=!0),!nl(i,l)&&++l==o&&(a=!0),a?[new kt(e,t,s,o)]:Ys(n,e,r,i,s,l).concat(Ys(n,r,t,i,l,o))}function u3(n,e){let t=1,r=Math.min(n,e);for(;tt||u>s||n.slice(l,c)!=r.slice(a,u)){if(o==1)return l-e-(nl(n,l)?0:1);o=o>>1}else{if(c==t||u==s)return c-e;l=c,a=u}}}function cx(n,e,t,r,i,s){if(e==t||i==s||n.charCodeAt(t-1)!=r.charCodeAt(s-1))return 0;let o=u3(t-e,s-i);for(let l=t,a=s;;){let c=l-o,u=a-o;if(c>1}else{if(c==e||u==i)return t-c;l=c,a=u}}}function XO(n,e,t,r,i,s,o,l){let a=r.slice(i,s),c=null;for(;;){if(c||o=t)break;let f=n.slice(u,h),d=-1;for(;(d=a.indexOf(f,d+1))!=-1;){let p=ax(n,h,t,r,i+d+f.length,s),g=cx(n,e,u,r,i,i+d),m=f.length+p+g;(!c||c[2]>1}}function h3(n,e,t,r,i,s){let o=t-e,l=s-i;if(oi.fromA-e&&r.toB>i.fromB-e&&(n[t-1]=new kt(r.fromA,i.toA,r.fromB,i.toB),n.splice(t--,1))}}function mJ(n,e,t){for(;;){f3(t,1);let r=!1;for(let i=0;i3||l>3){let a=i==n.length-1?e.length:n[i+1].fromA,c=s.fromA-r,u=a-s.toA,h=Ek(e,s.fromA,Math.min(c,5)),f=Tk(e,s.toA,Math.min(u,5)),d=s.fromA-h,p=f-s.toA;if(!o||!l){let g=Math.max(o,l),[m,b,O]=o?[e,s.fromA,s.toA]:[t,s.fromB,s.toB];d&&p&&(g>d&&e.slice(h,s.fromA)==m.slice(O-d,O)?(s=n[i]=new kt(h,h+o,s.fromB-d,s.toB-d),h=s.fromA,f=Tk(e,s.toA,Math.min(a-s.toA,5))):g>p&&e.slice(s.toA,f)==m.slice(b,b+p)&&(s=n[i]=new kt(f-o,f,s.fromB+p,s.toB+p),f=s.toA,h=Ek(e,s.fromA,Math.min(s.fromA-r,5))),d=s.fromA-h,p=f-s.toA)}if(d||p)s=n[i]=new kt(s.fromA-d,s.toA+p,s.fromB-d,s.toB+p);else if(o){if(!l){let g=Ak(e,s.fromA,s.toA),m,b=g<0?-1:$k(e,s.toA,s.fromA);g>-1&&(m=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+m)?s=n[i]=s.offset(m):b>-1&&(m=s.toA-b)>=c&&t.slice(s.fromA-m,s.fromA)==t.slice(b,s.toA)&&(s=n[i]=s.offset(-m))}}else{let g=Ak(t,s.fromB,s.toB),m,b=g<0?-1:$k(t,s.toB,s.fromB);g>-1&&(m=g-s.fromB)<=u&&t.slice(s.fromB,g)==t.slice(s.toB,s.toB+m)?s=n[i]=s.offset(m):b>-1&&(m=s.toB-b)>=c&&t.slice(s.fromB-m,s.fromB)==t.slice(b,s.toB)&&(s=n[i]=s.offset(-m))}r=s.toA}}return f3(n,3),n}let Rs;try{Rs=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function d3(n){return n>48&&n<58||n>64&&n<91||n>96&&n<123}function p3(n,e){if(e==n.length)return 0;let t=n.charCodeAt(e);return t<192?d3(t)?1:0:Rs?!m3(t)||e==n.length-1?Rs.test(String.fromCharCode(t))?1:0:Rs.test(n.slice(e,e+2))?2:0:0}function g3(n,e){if(!e)return 0;let t=n.charCodeAt(e-1);return t<192?d3(t)?1:0:Rs?!O3(t)||e==1?Rs.test(String.fromCharCode(t))?1:0:Rs.test(n.slice(e-2,e))?2:0:0}function Tk(n,e,t){if(e==n.length||!g3(n,e))return e;for(let r=e,i=e+t;;){let s=p3(n,r);if(!s)return r;if(r+=s,r>i)return e}}function Ek(n,e,t){if(!e||!p3(n,e))return e;for(let r=e,i=e-t;;){let s=g3(n,r);if(!s)return r;if(r-=s,rn>=55296&&n<=56319,O3=n=>n>=56320&&n<=57343;function nl(n,e){return!e||e==n.length||!m3(n.charCodeAt(e-1))||!O3(n.charCodeAt(e))}function bJ(n,e,t){var r;return ea=((r=t==null?void 0:t.scanLimit)!==null&&r!==void 0?r:1e9)>>1,mJ(n,e,Ys(n,0,n.length,e,0,e.length))}function b3(n,e,t){return OJ(bJ(n,e,t),n,e)}const Ir=fe.define({combine:n=>n[0]}),qO=Se.define(),rl=vt.define({create(n){return null},update(n,e){for(let t of e.effects)t.is(qO)&&(n=t.value);return n}});class Mo{constructor(e,t,r,i,s){this.changes=e,this.fromA=t,this.toA=r,this.fromB=i,this.toB=s}offset(e,t){return e||t?new Mo(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,r){return x3(b3(e.toString(),t.toString(),r),e,t,0,0)}static updateA(e,t,r,i,s){return Ik(Lk(e,i,!0,r.length),e,t,r,s)}static updateB(e,t,r,i,s){return Ik(Lk(e,i,!1,t.length),e,t,r,s)}}function Qk(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.to==n&&s.to==e&&nu+1&&g>h+1)break;f.push(d.offset(-a+r,-c+i)),[u,h]=Rk(d.toA+r,d.toB+i,e,t),o++}s.push(new Mo(f,a,Math.max(a,u),c,Math.max(c,h)))}return s}const Xu=1e3;function Mk(n,e,t,r){let i=0,s=n.length;for(;;){if(i==s){let u=0,h=0;i&&({toA:u,toB:h}=n[i-1]);let f=e-(t?u:h);return[u+f,h+f]}let o=i+s>>1,l=n[o],[a,c]=t?[l.fromA,l.toA]:[l.fromB,l.toB];if(a>e)s=o;else if(c<=e)i=o+1;else return r?[l.fromA,l.fromB]:[l.toA,l.toB]}}function Lk(n,e,t,r){let i=[];return e.iterChangedRanges((s,o,l,a)=>{let c=0,u=t?e.length:r,h=0,f=t?r:e.length;s>Xu&&([c,h]=Mk(n,s-Xu,t,!0)),o=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:f,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:c,toA:u,fromB:h,toB:f,diffA:g,diffB:m})}),i}function Ik(n,e,t,r,i){if(!n.length)return e;let s=[];for(let o=0,l=0,a=0,c=0;;o++){let u=o==n.length?null:n[o],h=u?u.fromA+l:t.length,f=u?u.fromB+a:r.length;for(;ch||m.toB+a>f)break;s.push(m.offset(l,a)),c++}if(!u)break;let d=u.toA+l+u.diffA,p=u.toB+a+u.diffB,g=b3(t.sliceString(h,d),r.sliceString(f,p),i);for(let m of x3(g,t,r,h,f))s.push(m);for(l+=u.diffA,a+=u.diffB;cd&&m.fromB+a>p)break;c++}}return s}const xJ={scanLimit:500},y3=xt.fromClass(class{constructor(n){({deco:this.deco,gutter:this.gutter}=Vk(n))}update(n){(n.docChanged||n.viewportChanged||yJ(n.startState,n.state)||vJ(n.startState,n.state))&&({deco:this.deco,gutter:this.gutter}=Vk(n.view))}},{decorations:n=>n.deco}),qu=wr.low(DE({class:"cm-changeGutter",markers:n=>{var e;return((e=n.plugin(y3))===null||e===void 0?void 0:e.gutter)||Ze.empty}}));function yJ(n,e){return n.field(rl,!1)!=e.field(rl,!1)}function vJ(n,e){return n.facet(Ir)!=e.facet(Ir)}const Dk=Oe.line({class:"cm-changedLine"}),wJ=Oe.mark({class:"cm-changedText"}),SJ=Oe.mark({tagName:"ins",class:"cm-insertedLine"}),kJ=Oe.mark({tagName:"del",class:"cm-deletedLine"}),Nk=new class extends Gr{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function CJ(n,e,t,r,i,s){let o=t?n.fromA:n.fromB,l=t?n.toA:n.toB,a=0;if(o!=l){i.add(o,o,Dk),i.add(o,l,t?kJ:SJ),s&&s.add(o,o,Nk);for(let c=e.iterRange(o,l-1),u=o;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,Dk),s&&s.add(u,u,Nk);continue}let h=u+c.value.length;if(r)for(;a=c)break;(s?u.toA:u.toB)>a&&CJ(u,n.state.doc,s,r,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class Wu extends Sr{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Nf=Se.define({map:(n,e)=>n.map(e)}),ta=vt.define({create:()=>Oe.none,update:(n,e)=>{for(let t of e.effects)if(t.is(Nf))return t.value;return n.map(e.changes)},provide:n=>J.decorations.from(n)}),Hu=.01;function Zk(n,e){if(n.size!=e.size)return!1;let t=n.iter(),r=e.iter();for(;t.value;){if(t.from!=r.from||Math.abs(t.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;t.next(),r.next()}return!0}function _J(n,e,t){let r=new Dn,i=new Dn,s=n.state.field(ta).iter(),o=e.state.field(ta).iter(),l=0,a=0,c=0,u=0,h=n.viewport,f=e.viewport;for(let m=0;;m++){let b=mHu&&(u+=C,i.add(a,a,Oe.widget({widget:new Wu(C),block:!0,side:-1})))}if(O>l+1e3&&lh.from&&af.from){let y=Math.min(h.from-l,f.from-a);l+=y,a+=y,m--}else if(b)l=b.toA,a=b.toB;else break;for(;s.value&&s.fromHu&&i.add(e.state.doc.length,e.state.doc.length,Oe.widget({widget:new Wu(d),block:!0,side:1}));let p=r.finish(),g=i.finish();Zk(p,n.state.field(ta))||n.dispatch({effects:Nf.of(p)}),Zk(g,e.state.field(ta))||e.dispatch({effects:Nf.of(g)})}const WO=Se.define({map:(n,e)=>e.mapPos(n)});class PJ extends Sr{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent="⦚ "+e.state.phrase("$ unchanged lines",this.lines)+" ⦚",t.addEventListener("click",r=>{let i=e.posAtDOM(r.target);e.dispatch({effects:WO.of(i)});let{side:s,sibling:o}=e.state.facet(Ir);o&&o().dispatch({effects:WO.of(TJ(i,e.state.field(rl),s=="a"))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}}function TJ(n,e,t){let r=0,i=0;for(let s=0;;s++){let o=s=n)return i+(n-r);[r,i]=t?[o.toA,o.toB]:[o.toB,o.toA]}}const EJ=vt.define({create(n){return Oe.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(WO)&&(n=n.update({filter:r=>r!=t.value}));return n},provide:n=>J.decorations.from(n)});function Bk({margin:n=3,minSize:e=4}){return EJ.init(t=>$J(t,n,e))}function $J(n,e,t){let r=new Dn,i=n.facet(Ir).side=="a",s=n.field(rl),o=1;for(let l=0;;l++){let a=l=t&&r.add(n.doc.line(c).from,n.doc.line(u).to,Oe.replace({widget:new PJ(h),block:!0})),!a)break;o=n.doc.lineAt(Math.min(n.doc.length,i?a.toA:a.toB)).number}return r.finish()}const AJ=J.styleModule.of(new vi({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),QJ=J.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb2266, #22bb2266) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff8866, #88ff8866) bottom/100% 2px no-repeat"},".cm-insertedLine, .cm-deletedLine":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer"},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"}}),Fk=new Ol,Yu=new Ol;class RJ{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||xJ;let t=[wr.low(y3),QJ,AJ,ta,J.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(d=>d.is(Nf)))&&this.measure()})],r=[Ir.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(qu);let i=Ae.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],J.editorAttributes.of({class:"cm-merge-a"}),Yu.of(r),t]}),s=[Ir.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(qu);let o=Ae.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],J.editorAttributes.of({class:"cm-merge-b"}),Yu.of(s),t]});this.chunks=Mo.build(i.doc,o.doc,this.diffConf);let l=[rl.init(()=>this.chunks),Fk.of(e.collapseUnchanged?Bk(e.collapseUnchanged):[])];i=i.update({effects:Se.appendConfig.of(l)}).state,o=o.update({effects:Se.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(a=="a-b"?c:u),this.editorDOM.appendChild(a=="a-b"?u:c),this.a=new J({state:i,parent:c,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new J({state:o,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(r=>r.docChanged)){let r=e[e.length-1],i=e.reduce((o,l)=>o.compose(l.changes),St.empty(e[0].startState.doc.length));this.chunks=t==this.a?Mo.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):Mo.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),t.update([...e,r.state.update({effects:qO.of(this.chunks)})]);let s=t==this.a?this.b:this.a;s.update([s.state.update({effects:qO.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,l=this.b.dom.parentNode;o.remove(),l.remove(),this.editorDOM.insertBefore(s?o:l,this.editorDOM.firstChild),this.editorDOM.appendChild(s?l:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,o=this.revertToA,l=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(l=e.renderRevertControl),this.setupRevertControls(s,o,l)}let t="highlightChanges"in e,r="gutter"in e,i="collapseUnchanged"in e;if(t||r||i){let s=[],o=[];if(t||r){let l=this.a.state.facet(Ir),a=r?e.gutter!==!1:l.markGutter,c=t?e.highlightChanges!==!1:l.highlightChanges;s.push(Yu.reconfigure([Ir.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:a}),a?qu:[]])),o.push(Yu.reconfigure([Ir.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:a}),a?qu:[]]))}if(i){let l=Fk.reconfigure(e.collapseUnchanged?Bk(e.collapseUnchanged):[]);s.push(l),o.push(l)}this.a.dispatch({effects:s}),this.b.dispatch({effects:o})}this.scheduleMeasure()}setupRevertControls(e,t,r){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){_J(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,r=this.a.viewport,i=this.b.viewport;for(let s=0;sr.to||o.fromB>i.to)break;if(o.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function zk(n){let e=n.nextSibling;return n.remove(),e}class Vf{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new Vf(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,l){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ke.contextHash,i]]}addChild(e,t){e.prop(ke.contextHash)!=this.hash&&(e=new Re(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Re(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new Re(Pt.none,i,s,o,this.hashProp)})}}var ee;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(ee||(ee={}));class MJ{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class LJ{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ya(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let i=t;i=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==ee.OrderedList?fx:hx)(t,e,!1);return r>0&&(n.type!=ee.BulletList||ux(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const v3={[ee.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Ve(ee.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Kn(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[ee.ListItem](n,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[ee.OrderedList]:jk,[ee.BulletList]:jk,[ee.Document](){return!0}};function Kn(n){return n==32||n==9||n==10||n==13}function ya(n,e=0){for(;et&&Kn(n.charCodeAt(e-1));)e--;return e}function w3(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf($3.SetextHeading)>-1||r<3?-1:1}function k3(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function hx(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Kn(n.text.charCodeAt(n.pos+1)))&&(!t||k3(e,ee.BulletList)||n.skipSpace(n.pos+2)=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||rn.pos+1||n.next!=49)?-1:r+1-n.pos}function C3(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e6?-1:t}function _3(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e/,T3=/\?>/,YO=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,T3=/\?>/,YO=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*"),ie=w(ee,"?>"),ye=w(te,"]]>"),ge=Y({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),me=I.deserialize({version:14,states:",SOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DS'#DSOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C{'#C{O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C|'#C|O$dOrO,59^OOOP,59^,59^OOOS'#C}'#C}O$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6y-E6yOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6z-E6zOOOP1G.x1G.xOOOS-E6{-E6{OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'jO!bO,59eOOOO-E6w-E6wO'xOpO1G.uO'xOpO1G.uOOOP1G.u1G.uO(QOpO7+$fOOOP7+$f7+$fO(YO!bO<d!d;'S%y;'S;=`&_<%lO%yX>iV{WOr%ysv%yw!}%y!}#O?O#O;'S%y;'S;=`&_<%lO%yX?VT{WxPOr%ysv%yw;'S%y;'S;=`&_<%lO%yX?kV{WOr%ysv%yw#W%y#W#X@Q#X;'S%y;'S;=`&_<%lO%yX@VV{WOr%ysv%yw#T%y#T#U@l#U;'S%y;'S;=`&_<%lO%yX@qV{WOr%ysv%yw#h%y#h#iAW#i;'S%y;'S;=`&_<%lO%yXA]V{WOr%ysv%yw#T%y#T#U>d#U;'S%y;'S;=`&_<%lO%yXAwV{WOr%ysv%yw#c%y#c#dB^#d;'S%y;'S;=`&_<%lO%yXBcV{WOr%ysv%yw#V%y#V#WBx#W;'S%y;'S;=`&_<%lO%yXB}V{WOr%ysv%yw#h%y#h#iCd#i;'S%y;'S;=`&_<%lO%yXCiV{WOr%ysv%yw#m%y#m#nDO#n;'S%y;'S;=`&_<%lO%yXDTV{WOr%ysv%yw#d%y#d#eDj#e;'S%y;'S;=`&_<%lO%yXDoV{WOr%ysv%yw#X%y#X#Y9i#Y;'S%y;'S;=`&_<%lO%yXE]T!PP{WOr%ysv%yw;'S%y;'S;=`&_<%lO%yZEuWaQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n_FhW[UVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZGXYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aGw!a;'S$n;'S;=`&e<%lO$nZHQW!OQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZHqYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_#P$n#P#QIa#Q;'S$n;'S;=`&e<%lO$nZIhYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aJW!a;'S$n;'S;=`&e<%lO$nZJaWwQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n",tokenizers:[oe,se,ie,ye,0,1,2,3],topRules:{Document:[0,6]},tokenPrec:0});function h(e,t){let O=t&&t.getChild("TagName");return O?e.sliceString(O.from,O.to):""}function V(e,t){let O=t&&t.firstChild;return!O||O.name!="OpenTag"?"":h(e,O)}function $e(e,t,O){let n=t&&t.getChildren("Attribute").find(l=>l.from<=O&&l.to>=O),a=n&&n.getChild("AttributeName");return a?e.sliceString(a.from,a.to):""}function P(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ce(e,t){var O;let n=Z(e).resolveInner(t,-1),a=null;for(let l=n;!a&&l.parent;l=l.parent)(l.name=="OpenTag"||l.name=="CloseTag"||l.name=="SelfClosingTag"||l.name=="MismatchedCloseTag")&&(a=l);if(a&&(a.to>t||a.lastChild.type.isError)){let l=a.parent;if(n.name=="TagName")return a.name=="CloseTag"||a.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:l}:{type:"openTag",from:n.from,context:P(l)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:a};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:a};let s=n==a||n.name=="Attribute"?n.childBefore(t):n;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:P(l)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:l}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:a}:s?{type:"attrName",from:t,context:a}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:t,context:n.parent};for(;n.parent&&n.to==t&&!(!((O=n.lastChild)===null||O===void 0)&&O.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:t,context:n.name=="Element"?n:P(n)}:null}class ue{constructor(t,O,n){this.attrs=O,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(a=>({label:a,type:"text"})):[]}}const v=/^[:\-\.\w\u00b7-\uffff]*$/;function R(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function G(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let O=[],n=[],a=Object.create(null);for(let r of t){let m=R(r);O.push(m),r.global&&n.push(m),r.values&&(a[r.name]=r.values.map(G))}let l=[],s=[],S=Object.create(null);for(let r of e){let m=n,y=a;r.attributes&&(m=m.concat(r.attributes.map(o=>typeof o=="string"?O.find(f=>f.label==o)||{label:o,type:"property"}:(o.values&&(y==a&&(y=Object.create(y)),y[o.name]=o.values.map(G)),R(o)))));let u=new ue(r,m,y);S[u.name]=u,l.push(u),r.top&&s.push(u)}s.length||(s=l);for(let r=0;r{var m;let{doc:y}=r.state,u=ce(r.state,r.pos);if(!u||u.type=="tag"&&!r.explicit)return null;let{type:o,from:f,context:$}=u;if(o=="openTag"){let i=s,g=V(y,$);if(g){let c=S[g];i=(c==null?void 0:c.children)||l}return{from:f,options:i.map(c=>c.completion),validFor:v}}else if(o=="closeTag"){let i=V(y,$);return i?{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)==">"?1:0),options:[((m=S[i])===null||m===void 0?void 0:m.closeNameCompletion)||{label:i+">",type:"type"}],validFor:v}:null}else if(o=="attrName"){let i=S[h(y,$)];return{from:f,options:(i==null?void 0:i.attrs)||n,validFor:v}}else if(o=="attrValue"){let i=$e(y,$,f);if(!i)return null;let g=S[h(y,$)],c=((g==null?void 0:g.attrValues)||a)[i];return!c||!c.length?null:{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)=='"'?1:0),options:c,validFor:/^"[^"]*"?$/}}else if(o=="tag"){let i=V(y,$),g=S[i],c=[],d=$&&$.lastChild;i&&(!d||d.name!="CloseTag"||h(y,d)!=i)&&c.push(g?g.closeCompletion:{label:"",type:"type",boost:2});let C=c.concat(((g==null?void 0:g.children)||($?l:s)).map(T=>T.openCompletion));if($&&(g!=null&&g.text.length)){let T=$.firstChild;T.to>r.pos-20&&!/\S/.test(r.state.sliceDoc(T.to,r.pos))&&(C=C.concat(g.text))}return{from:f,options:C,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const W=j.define({name:"xml",parser:me.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),z.add({Element(e){let t=e.firstChild,O=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:O.name=="CloseTag"?O.from:e.to}}}),q.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function _e(e={}){let t=[W.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Se),new D(W,t)}function N(e,t,O=e.length){if(!t)return"";let n=t.firstChild,a=n&&n.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,O)):""}const Se=M.inputHandler.of((e,t,O,n,a)=>{if(e.composing||e.state.readOnly||t!=O||n!=">"&&n!="/"||!W.isActiveAt(e.state,t,-1))return!1;let l=a(),{state:s}=l,S=s.changeByRange(r=>{var m,y,u;let{head:o}=r,f=s.doc.sliceString(o-1,o)==n,$=Z(s).resolveInner(o,-1),i;if(f&&n==">"&&$.name=="EndTag"){let g=$.parent;if(((y=(m=g.parent)===null||m===void 0?void 0:m.lastChild)===null||y===void 0?void 0:y.name)!="CloseTag"&&(i=N(s.doc,g.parent,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=``;return{range:r,changes:{from:o,to:c,insert:d}}}}else if(f&&n=="/"&&$.name=="StartCloseTag"){let g=$.parent;if($.from==o-2&&((u=g.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=N(s.doc,g,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=`${i}>`;return{range:B.cursor(o+d.length,-1),changes:{from:o,to:c,insert:d}}}}return{range:r}});return S.changes.empty?!1:(e.dispatch([l,s.update(S,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{Se as autoCloseTags,pe as completeFromSchema,_e as xml,W as xmlLanguage}; diff --git a/assets/index-CxpOZJfG.js b/assets/index-CxpOZJfG.js new file mode 100644 index 0000000..836a360 --- /dev/null +++ b/assets/index-CxpOZJfG.js @@ -0,0 +1 @@ +import{C as B,E as i,s as W,t as n,b as U,L as C,i as u,j as v,f as E,k as M,a as b,r as N}from"./MarkdownEditor-i8hTFDFw.js";import"./index-Dk-UNE0C.js";import"./index.lazy-CMTI4f6x.js";import"./utils-CaYZp6PS.js";import"./useAccount-C9KkC4ZK.js";import"./createPublicClient-Cfohbp00.js";import"./isAddressEqual-Dn7cKeu3.js";import"./secp256k1-DDh0VLbn.js";const c=63,D=64,j=1,A=2,y=3,H=4,Z=5,F=6,I=7,z=65,K=66,J=8,OO=9,eO=10,aO=11,rO=12,V=13,tO=19,nO=20,oO=29,PO=33,QO=34,sO=47,lO=0,p=1,m=2,d=3,g=4;class s{constructor(e,a,r){this.parent=e,this.depth=a,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+a+(a<<4)+r}}s.top=new s(null,-1,lO);function X(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let o=O.peek(r);if(P(o)||o==-1)return a}}function x(O){return O==32||O==9}function P(O){return O==10||O==13}function _(O){return x(O)||P(O)}function l(O){return O<0||_(O)}const cO=new B({start:s.top,reduce(O,e){return O.type==d&&(e==nO||e==QO)?O.parent:O},shift(O,e,a,r){if(e==y)return new s(O,X(r,r.pos),p);if(e==z||e==Z)return new s(O,X(r,r.pos),m);if(e==c)return O.parent;if(e==tO||e==PO)return new s(O,0,d);if(e==V&&O.type==g)return O.parent;if(e==sO){let o=/[1-9]/.exec(r.read(r.pos,a.pos));if(o)return new s(O,O.depth+ +o[0],g)}return O},hash(O){return O.hash}});function f(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&l(O.peek(a+3))}const fO=new i((O,e)=>{if(O.next==-1&&e.canShift(D))return O.acceptToken(D);let a=O.peek(-1);if((P(a)||a<0)&&e.context.type!=d){if(f(O,45))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(j,3);if(f(O,46))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(A,3);let r=0;for(;O.next==32;)r++,O.advance();(r{if(e.context.type==d){O.next==63&&(O.advance(),l(O.next)&&O.acceptToken(I));return}if(O.next==45)O.advance(),l(O.next)&&O.acceptToken(e.context.type==p&&e.context.depth==X(O,O.pos-1)?H:y);else if(O.next==63)O.advance(),l(O.next)&&O.acceptToken(e.context.type==m&&e.context.depth==X(O,O.pos-1)?F:Z);else{let a=O.pos;for(;;)if(x(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)G(O);else if(O.next==38)$(O);else if(O.next==42){$(O);break}else if(O.next==39||O.next==34){if(T(O,!0))break;return}else if(O.next==91||O.next==123){if(!RO(O))return;break}else{w(O,!0,!1,0);break}for(;x(O.next);)O.advance();if(O.next==58){if(O.pos==a&&e.canShift(oO))return;let r=O.peek(1);l(r)&&O.acceptTokenTo(e.context.type==m&&e.context.depth==X(O,a)?K:z,a)}}},{contextual:!0});function dO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function q(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function Y(O,e){return O.next==37?(O.advance(),q(O.next)&&O.advance(),q(O.next)&&O.advance(),!0):dO(O.next)||e&&O.next==44?(O.advance(),!0):!1}function G(O){if(O.advance(),O.next==60){for(O.advance();;)if(!Y(O,!0)){O.next==62&&O.advance();break}}else for(;Y(O,!1););}function $(O){for(O.advance();!l(O.next)&&S(O.tag)!="f";)O.advance()}function T(O,e){let a=O.next,r=!1,o=O.pos;for(O.advance();;){let t=O.next;if(t<0)break;if(O.advance(),t==a)if(t==39)if(O.next==39)O.advance();else break;else break;else if(t==92&&a==34)O.next>=0&&O.advance();else if(P(t)){if(e)return!1;r=!0}else if(e&&O.pos>=o+1024)return!1}return!r}function RO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!T(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else{if(O.next<0||O.pos>a||P(O.next))return!1;O.advance()}}const SO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function S(O){return O<33?"u":O>125?"s":SO[O-33]}function k(O,e){let a=S(O);return a!="u"&&!(e&&a=="f")}function w(O,e,a,r){if(S(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&k(O.peek(1),a))O.advance();else return!1;let o=O.pos;for(;;){let t=O.next,Q=0,R=r+1;for(;_(t);){if(P(t)){if(e)return!1;R=0}else R++;t=O.peek(++Q)}if(!(t>=0&&(t==58?k(O.peek(Q+1),a):t==35?O.peek(Q-1)!=32:k(t,a)))||!a&&R<=r||R==0&&!a&&(f(O,45,Q)||f(O,46,Q)))break;if(e&&S(t)=="f")return!1;for(let h=Q;h>=0;h--)O.advance();if(e&&O.pos>o+1024)return!1}return!0}const iO=new i((O,e)=>{if(O.next==33)G(O),O.acceptToken(rO);else if(O.next==38||O.next==42){let a=O.next==38?eO:aO;$(O),O.acceptToken(a)}else O.next==39||O.next==34?(T(O,!1),O.acceptToken(OO)):w(O,!1,e.context.type==d,e.context.depth)&&O.acceptToken(J)}),kO=new i((O,e)=>{let a=e.context.type==g?e.context.depth:-1,r=O.pos;O:for(;;){let o=0,t=O.next;for(;t==32;)t=O.peek(++o);if(!o&&(f(O,45,o)||f(O,46,o))||!P(t)&&(a<0&&(a=Math.max(e.context.depth+1,o)),oYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:cO,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[bO],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[fO,XO,iO,kO,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),gO=U.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),L=C.define({name:"yaml",parser:mO.configure({props:[u.add({Stream:O=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromO.pos)return null}}return null},FlowMapping:v({closing:"}"}),FlowSequence:v({closing:"]"})}),E.add({"FlowMapping FlowSequence":M,"BlockSequence Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function UO(){return new b(L)}const xO=C.define({name:"yaml-frontmatter",parser:gO.configure({props:[W({DashLine:n.meta})]})});function CO(O){let{language:e,support:a}=O.content instanceof b?O.content:{language:O.content,support:[]};return new b(xO.configure({wrap:N(r=>r.name=="FrontmatterContent"?{parser:L.parser}:r.name=="Body"?{parser:e.parser}:null)}),a)}export{UO as yaml,CO as yamlFrontmatter,L as yamlLanguage}; diff --git a/assets/index-D0FpL0lt.js b/assets/index-D0FpL0lt.js deleted file mode 100644 index 565d44a..0000000 --- a/assets/index-D0FpL0lt.js +++ /dev/null @@ -1 +0,0 @@ -import{C as A,E as k,s as Y,t as p,b as I,L as j,i as U,f as z,u as q,a as D,o as M,g as Z,p as B}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const _=1,F=2,J=3,H=4,L=5,K=35,ee=36,te=37,ne=11,Oe=13;function ae(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function re(e){return e==9||e==10||e==13||e==32}let X=null,Q=null,E=0;function b(e,t){let O=e.pos+t;if(Q==e&&E==O)return X;for(;re(e.peek(t));)t++;let n="";for(;;){let a=e.peek(t);if(!ae(a))break;n+=String.fromCharCode(a),t++}return Q=e,E=O,X=n||null}function x(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let O=0;O{if(e.next==60){if(e.advance(),e.next==47){e.advance();let O=b(e,0);if(!O)return e.acceptToken(L);if(t.context&&O==t.context.name)return e.acceptToken(F);for(let n=t.context;n;n=n.parent)if(n.name==O)return e.acceptToken(J,-2);e.acceptToken(H)}else if(e.next!=33&&e.next!=63)return e.acceptToken(_)}},{contextual:!0});function w(e,t){return new k(O=>{let n=0,a=t.charCodeAt(0);e:for(;!(O.next<0);O.advance(),n++)if(O.next==a){for(let l=1;l"),ie=w(ee,"?>"),ye=w(te,"]]>"),ge=Y({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),me=I.deserialize({version:14,states:",SOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DS'#DSOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C{'#C{O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C|'#C|O$dOrO,59^OOOP,59^,59^OOOS'#C}'#C}O$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6y-E6yOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6z-E6zOOOP1G.x1G.xOOOS-E6{-E6{OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'jO!bO,59eOOOO-E6w-E6wO'xOpO1G.uO'xOpO1G.uOOOP1G.u1G.uO(QOpO7+$fOOOP7+$f7+$fO(YO!bO<d!d;'S%y;'S;=`&_<%lO%yX>iV{WOr%ysv%yw!}%y!}#O?O#O;'S%y;'S;=`&_<%lO%yX?VT{WxPOr%ysv%yw;'S%y;'S;=`&_<%lO%yX?kV{WOr%ysv%yw#W%y#W#X@Q#X;'S%y;'S;=`&_<%lO%yX@VV{WOr%ysv%yw#T%y#T#U@l#U;'S%y;'S;=`&_<%lO%yX@qV{WOr%ysv%yw#h%y#h#iAW#i;'S%y;'S;=`&_<%lO%yXA]V{WOr%ysv%yw#T%y#T#U>d#U;'S%y;'S;=`&_<%lO%yXAwV{WOr%ysv%yw#c%y#c#dB^#d;'S%y;'S;=`&_<%lO%yXBcV{WOr%ysv%yw#V%y#V#WBx#W;'S%y;'S;=`&_<%lO%yXB}V{WOr%ysv%yw#h%y#h#iCd#i;'S%y;'S;=`&_<%lO%yXCiV{WOr%ysv%yw#m%y#m#nDO#n;'S%y;'S;=`&_<%lO%yXDTV{WOr%ysv%yw#d%y#d#eDj#e;'S%y;'S;=`&_<%lO%yXDoV{WOr%ysv%yw#X%y#X#Y9i#Y;'S%y;'S;=`&_<%lO%yXE]T!PP{WOr%ysv%yw;'S%y;'S;=`&_<%lO%yZEuWaQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n_FhW[UVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZGXYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aGw!a;'S$n;'S;=`&e<%lO$nZHQW!OQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZHqYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_#P$n#P#QIa#Q;'S$n;'S;=`&e<%lO$nZIhYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aJW!a;'S$n;'S;=`&e<%lO$nZJaWwQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n",tokenizers:[oe,se,ie,ye,0,1,2,3],topRules:{Document:[0,6]},tokenPrec:0});function h(e,t){let O=t&&t.getChild("TagName");return O?e.sliceString(O.from,O.to):""}function V(e,t){let O=t&&t.firstChild;return!O||O.name!="OpenTag"?"":h(e,O)}function $e(e,t,O){let n=t&&t.getChildren("Attribute").find(l=>l.from<=O&&l.to>=O),a=n&&n.getChild("AttributeName");return a?e.sliceString(a.from,a.to):""}function P(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ce(e,t){var O;let n=Z(e).resolveInner(t,-1),a=null;for(let l=n;!a&&l.parent;l=l.parent)(l.name=="OpenTag"||l.name=="CloseTag"||l.name=="SelfClosingTag"||l.name=="MismatchedCloseTag")&&(a=l);if(a&&(a.to>t||a.lastChild.type.isError)){let l=a.parent;if(n.name=="TagName")return a.name=="CloseTag"||a.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:l}:{type:"openTag",from:n.from,context:P(l)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:a};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:a};let s=n==a||n.name=="Attribute"?n.childBefore(t):n;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:P(l)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:l}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:a}:s?{type:"attrName",from:t,context:a}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:t,context:n.parent};for(;n.parent&&n.to==t&&!(!((O=n.lastChild)===null||O===void 0)&&O.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:t,context:n.name=="Element"?n:P(n)}:null}class ue{constructor(t,O,n){this.attrs=O,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(a=>({label:a,type:"text"})):[]}}const v=/^[:\-\.\w\u00b7-\uffff]*$/;function R(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function G(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let O=[],n=[],a=Object.create(null);for(let r of t){let m=R(r);O.push(m),r.global&&n.push(m),r.values&&(a[r.name]=r.values.map(G))}let l=[],s=[],S=Object.create(null);for(let r of e){let m=n,y=a;r.attributes&&(m=m.concat(r.attributes.map(o=>typeof o=="string"?O.find(f=>f.label==o)||{label:o,type:"property"}:(o.values&&(y==a&&(y=Object.create(y)),y[o.name]=o.values.map(G)),R(o)))));let u=new ue(r,m,y);S[u.name]=u,l.push(u),r.top&&s.push(u)}s.length||(s=l);for(let r=0;r{var m;let{doc:y}=r.state,u=ce(r.state,r.pos);if(!u||u.type=="tag"&&!r.explicit)return null;let{type:o,from:f,context:$}=u;if(o=="openTag"){let i=s,g=V(y,$);if(g){let c=S[g];i=(c==null?void 0:c.children)||l}return{from:f,options:i.map(c=>c.completion),validFor:v}}else if(o=="closeTag"){let i=V(y,$);return i?{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)==">"?1:0),options:[((m=S[i])===null||m===void 0?void 0:m.closeNameCompletion)||{label:i+">",type:"type"}],validFor:v}:null}else if(o=="attrName"){let i=S[h(y,$)];return{from:f,options:(i==null?void 0:i.attrs)||n,validFor:v}}else if(o=="attrValue"){let i=$e(y,$,f);if(!i)return null;let g=S[h(y,$)],c=((g==null?void 0:g.attrValues)||a)[i];return!c||!c.length?null:{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)=='"'?1:0),options:c,validFor:/^"[^"]*"?$/}}else if(o=="tag"){let i=V(y,$),g=S[i],c=[],d=$&&$.lastChild;i&&(!d||d.name!="CloseTag"||h(y,d)!=i)&&c.push(g?g.closeCompletion:{label:"",type:"type",boost:2});let C=c.concat(((g==null?void 0:g.children)||($?l:s)).map(T=>T.openCompletion));if($&&(g!=null&&g.text.length)){let T=$.firstChild;T.to>r.pos-20&&!/\S/.test(r.state.sliceDoc(T.to,r.pos))&&(C=C.concat(g.text))}return{from:f,options:C,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const W=j.define({name:"xml",parser:me.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),z.add({Element(e){let t=e.firstChild,O=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:O.name=="CloseTag"?O.from:e.to}}}),q.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Ve(e={}){let t=[W.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Se),new D(W,t)}function N(e,t,O=e.length){if(!t)return"";let n=t.firstChild,a=n&&n.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,O)):""}const Se=M.inputHandler.of((e,t,O,n,a)=>{if(e.composing||e.state.readOnly||t!=O||n!=">"&&n!="/"||!W.isActiveAt(e.state,t,-1))return!1;let l=a(),{state:s}=l,S=s.changeByRange(r=>{var m,y,u;let{head:o}=r,f=s.doc.sliceString(o-1,o)==n,$=Z(s).resolveInner(o,-1),i;if(f&&n==">"&&$.name=="EndTag"){let g=$.parent;if(((y=(m=g.parent)===null||m===void 0?void 0:m.lastChild)===null||y===void 0?void 0:y.name)!="CloseTag"&&(i=N(s.doc,g.parent,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=``;return{range:r,changes:{from:o,to:c,insert:d}}}}else if(f&&n=="/"&&$.name=="StartCloseTag"){let g=$.parent;if($.from==o-2&&((u=g.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=N(s.doc,g,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=`${i}>`;return{range:B.cursor(o+d.length,-1),changes:{from:o,to:c,insert:d}}}}return{range:r}});return S.changes.empty?!1:(e.dispatch([l,s.update(S,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{Se as autoCloseTags,pe as completeFromSchema,Ve as xml,W as xmlLanguage}; diff --git a/assets/index-D2yzApFw.js b/assets/index-D2yzApFw.js new file mode 100644 index 0000000..b926f1b --- /dev/null +++ b/assets/index-D2yzApFw.js @@ -0,0 +1 @@ +import{s as o,t as r,b as s,L as n,i as P,c as a,f as i,k as Q,a as c}from"./MarkdownEditor-i8hTFDFw.js";import"./index-Dk-UNE0C.js";import"./index.lazy-CMTI4f6x.js";import"./utils-CaYZp6PS.js";import"./useAccount-C9KkC4ZK.js";import"./createPublicClient-Cfohbp00.js";import"./isAddressEqual-Dn7cKeu3.js";import"./secp256k1-DDh0VLbn.js";const p=o({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[p],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),y=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=m(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function m(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const u=n.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":Q})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function j(){return new c(u)}export{j as json,u as jsonLanguage,y as jsonParseLinter}; diff --git a/assets/index-D58BRKR5.js b/assets/index-D58BRKR5.js deleted file mode 100644 index d7f5b26..0000000 --- a/assets/index-D58BRKR5.js +++ /dev/null @@ -1,3 +0,0 @@ -import{E as h,C as N,s as D,t as n,b as L,g as H,d as B,L as K,i as M,j as X,f as OO,k as iO,a as eO,I as aO,e as nO,N as rO,m as d}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const QO=1,w=194,Z=195,tO=196,_=197,oO=198,dO=199,sO=200,lO=2,E=3,k=201,TO=24,SO=25,pO=49,qO=50,gO=55,mO=56,PO=57,$O=59,hO=60,cO=61,XO=62,fO=63,yO=65,WO=238,zO=71,RO=241,vO=242,_O=243,kO=244,xO=245,UO=246,uO=247,VO=248,j=72,bO=249,GO=250,wO=251,ZO=252,EO=253,jO=254,YO=255,FO=256,CO=73,JO=77,AO=263,IO=112,NO=130,DO=151,LO=152,HO=155,p=10,q=13,R=32,c=9,v=35,BO=40,KO=46,z=123,x=125,Y=39,F=34,MO=92,Oi=111,ii=120,ei=78,ai=117,ni=85,ri=new Set([SO,pO,qO,AO,yO,NO,mO,PO,WO,XO,fO,j,CO,JO,hO,cO,DO,LO,HO,IO]);function f(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qi=new h((O,i)=>{let e;if(O.next<0)O.acceptToken(dO);else if(i.context.flags&P)f(O.next)&&O.acceptToken(oO,1);else if(((e=O.peek(-1))<0||f(e))&&i.canShift(_)){let a=0;for(;O.next==R||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==v)&&O.acceptToken(_,-a)}else f(O.next)&&O.acceptToken(tO,1)},{contextual:!0}),ti=new h((O,i)=>{let e=i.context;if(e.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,t=0;for(;;){if(O.next==R)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),t++}r!=e.indent&&O.next!=p&&O.next!=q&&O.next!=v&&(r[O,i|C])),si=new N({start:oi,reduce(O,i,e,a){return O.flags&P&&ri.has(i)||(i==zO||i==j)&&O.flags&C?O.parent:O},shift(O,i,e,a){return i==w?new $(O,di(a.read(a.pos,e.pos)),0):i==Z?O.parent:i==TO||i==gO||i==$O||i==E?new $(O,0,P):U.has(i)?new $(O,0,U.get(i)|O.flags&P):O},hash(O){return O.hash}}),li=new h(O=>{for(let i=0;i<5;i++){if(O.next!="print".charCodeAt(i))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let i=0;;i++){let e=O.peek(i);if(!(e==R||e==c)){e!=BO&&e!=KO&&e!=p&&e!=q&&e!=v&&O.acceptToken(QO);return}}}),Ti=new h((O,i)=>{let{flags:e}=i.context,a=e&s?F:Y,r=(e&l)>0,t=!(e&T),Q=(e&S)>0,o=O.pos;for(;!(O.next<0);)if(Q&&O.next==z)if(O.peek(1)==z)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(t&&O.next==MO){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Si(O,g)),O.acceptToken(lO);return}break}else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(k,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(k);return}break}else O.advance();O.pos>o&&O.acceptToken(sO)});function Si(O,i){if(i==Oi)for(let e=0;e<2&&O.next>=48&&O.next<=55;e++)O.advance();else if(i==ii)for(let e=0;e<2&&y(O.next);e++)O.advance();else if(i==ai)for(let e=0;e<4&&y(O.next);e++)O.advance();else if(i==ni)for(let e=0;e<8&&y(O.next);e++)O.advance();else if(i==ei&&O.next==z){for(O.advance();O.next>=0&&O.next!=x&&O.next!=Y&&O.next!=F&&O.next!=p;)O.advance();O.next==x&&O.advance()}}const pi=D({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qi={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},gi=L.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[li,ti,Qi,Ti,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qi[O]||-1}],tokenPrec:7652}),u=new rO,J=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(i,e,a)=>{if(a)return!1;let r=i.node.getChild("VariableName");return r&&e(r,O),!0}}const mi={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,i,e){if(e){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")i(a,"variable");else if(a.name=="in")break}},ImportStatement(O,i){var e,a;let{node:r}=O,t=((e=r.firstChild)===null||e===void 0?void 0:e.name)=="from";for(let Q=r.getChild("import");Q;Q=Q.nextSibling)Q.name=="VariableName"&&((a=Q.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&i(Q,t?"variable":"namespace")},AssignStatement(O,i){for(let e=O.node.firstChild;e;e=e.nextSibling)if(e.name=="VariableName")i(e,"variable");else if(e.name==":"||e.name=="AssignOp")break},ParamList(O,i){for(let e=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!e||!/\*|AssignOp/.test(e.name))&&i(a,"variable"),e=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function A(O,i){let e=u.get(i);if(e)return e;let a=[],r=!0;function t(Q,o){let g=O.sliceString(Q.from,Q.to);a.push({label:g,type:o})}return i.cursor(aO.IncludeAnonymous).iterate(Q=>{if(Q.name){let o=mi[Q.name];if(o&&o(Q,t,r)||!r&&J.has(Q.name))return!1;r=!1}else if(Q.to-Q.from>8192){for(let o of A(O,Q.node))a.push(o);return!1}}),u.set(i,a),a}const V=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,I=["String","FormatString","Comment","PropertyName"];function Pi(O){let i=H(O.state).resolveInner(O.pos,-1);if(I.indexOf(i.name)>-1)return null;let e=i.name=="VariableName"||i.to-i.from<20&&V.test(O.state.sliceDoc(i.from,i.to));if(!e&&!O.explicit)return null;let a=[];for(let r=i;r;r=r.parent)J.has(r.name)&&(a=a.concat(A(O.state.doc,r)));return{options:a,from:e?i.from:O.pos,validFor:V}}const $i=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),hi=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: - -`,{label:"if",detail:"block",type:"keyword"}),d("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),d("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),d("import ${module}",{label:"import",detail:"statement",type:"keyword"}),d("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ci=B(I,nO($i.concat(hi)));function b(O){let{node:i,pos:e}=O,a=O.lineIndent(e,-1),r=null;for(;;){let t=i.childBefore(e);if(t)if(t.name=="Comment")e=t.from;else if(t.name=="Body")O.baseIndentFor(t)+O.unit<=a&&(r=t),i=t;else if(t.type.is("Statement"))i=t;else break;else break}return r}function G(O,i){let e=O.baseIndentFor(i),a=O.lineAt(O.pos,-1),r=a.from+a.text.length;return/^\s*($|#)/.test(a.text)&&O.node.toe?null:e+O.unit}const W=K.define({name:"python",parser:gi.configure({props:[M.add({Body:O=>{var i;let e=b(O);return(i=G(O,e||O.node))!==null&&i!==void 0?i:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except |finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":X({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":X({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":X({closing:"]"}),"String FormatString":()=>null,Script:O=>{var i;let e=b(O);return(i=e&&G(O,e))!==null&&i!==void 0?i:O.continue()}}),OO.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":iO,Body:(O,i)=>({from:O.from+1,to:O.to-(O.to==i.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function Ri(){return new eO(W,[W.data.of({autocomplete:Pi}),W.data.of({autocomplete:ci})])}export{ci as globalCompletion,Pi as localCompletionSource,Ri as python,W as pythonLanguage}; diff --git a/assets/index-D6TI4Nno.js b/assets/index-D6TI4Nno.js new file mode 100644 index 0000000..8f2b386 --- /dev/null +++ b/assets/index-D6TI4Nno.js @@ -0,0 +1 @@ +import{f as W,o as j,q as ht}from"./index-Dk-UNE0C.js";var Y={},z={},m={},B={};(function(o){function i(a,r,l){var u=r.slidesToShow,h=r.currentSlide;return l.length>2*u?a+2*u:h>=l.length?l.length+a:a}function t(a,r){if(r.length>2*a){for(var l={},u=r.length-2*a,h=r.length-u,c=u,d=0;d2*a?r.slice(r.length-2*a,r.length).concat(r,r.slice(0,2*a)):r.concat(r,r)}function n(a,r){return r.length>2*a?2*a:r.length}function s(a,r,l){var u,h=a.currentSlide,c=a.slidesToShow,d=a.itemWidth,p=a.totalItems,f=0,v=0,w=h===0,C=r.length-(r.length-2*c);return r.length2*c?((u=h>=C+r.length)&&(v=-d*(f=h-r.length)),w&&(v=-d*(f=C+(r.length-2*c)))):((u=h>=2*r.length)&&(v=-d*(f=h-r.length)),w&&(v=l.showDots?-d*(f=r.length):-d*(f=p/3))),{isReachingTheEnd:u,isReachingTheStart:w,nextSlide:f,nextPosition:v}}Object.defineProperty(o,"__esModule",{value:!0}),o.getOriginalCounterPart=i,o.getOriginalIndexLookupTableByClones=t,o.getClones=e,o.getInitialSlideInInfiniteMode=n,o.checkClonesPosition=s})(B);var O={};Object.defineProperty(O,"__esModule",{value:!0});function dt(o,i,t,e){var n=0,s=e||t;return i&&s&&(n=o[s].partialVisibilityGutter||o[s].paritialVisibilityGutter),n}function ct(o,i){var t;return i[o]&&(t=(100/i[o].items).toFixed(1)),t}function pt(o,i,t){return Math.round(t/(i+(o.centerMode?1:0)))}O.getPartialVisibilityGutter=dt,O.getWidthFromDeviceType=ct,O.getItemClientSideWidth=pt;var y={};Object.defineProperty(y,"__esModule",{value:!0});var U=O;function K(o){var i=o.slidesToShow;return o.totalItems=v&&window.innerWidth<=f&&(l=p)}),l}y.notEnoughChildren=K,y.getInitialState=ft,y.getIfSlideIsVisbile=mt,y.getTransformForCenterMode=nt,y.isInLeftEnd=vt,y.isInRightEnd=rt,y.getTransformForPartialVsibile=st,y.parsePosition=at,y.getTransform=gt,y.getSlidesToSlide=St;var q={};Object.defineProperty(q,"__esModule",{value:!0});var yt=function(o,i,t){var e;return function(){var n=arguments;e||(o.apply(this,n),e=!0,typeof t=="function"&&t(!0),setTimeout(function(){e=!1,typeof t=="function"&&t(!1)},i))}};q.default=yt;var lt={};(function(o){function i(t,e){var n=e.partialVisbile,s=e.partialVisible,a=e.centerMode,r=e.ssr,l=e.responsive;if((n||s)&&a)throw new Error("center mode can not be used at the same time with partialVisible");if(!l)throw r?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(l&&typeof l!="object")throw new Error("responsive prop must be an object")}Object.defineProperty(o,"__esModule",{value:!0}),o.default=i})(lt);var J={};Object.defineProperty(J,"__esModule",{value:!0});var Tt=y;function wt(o,i,t){t===void 0&&(t=0);var e,n,s=o.slidesToShow,a=o.currentSlide,r=o.itemWidth,l=o.totalItems,u=Tt.getSlidesToSlide(o,i),h=a+1+t+s+(0Math.abs(r)))return;var l=S.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,n,this.transformPlaceHolder),u=l.direction,h=l.nextPosition,c=l.canContinue;u&&(this.direction=u,c&&h!==void 0&&this.setTransformDirectly(h)),this.lastX=n}}},i.prototype.handleOut=function(t){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var e=t.type==="touchend"&&!this.props.swipeable,n=(t.type==="mouseleave"||t.type==="mouseup")&&!this.props.draggable;if(!e&&!n&&this.onMove){if(this.setAnimationDirectly(!0),this.direction==="right")if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var s=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(s)}else this.correctItemsPosition(this.state.itemWidth,!0,!0);this.direction==="left"&&(this.lastX-this.initialX>this.props.minimumTouchDrag?(s=Math.round((this.lastX-this.initialX)/this.state.itemWidth),this.previous(s)):this.correctItemsPosition(this.state.itemWidth,!0,!0)),this.resetMoveStatus()}},i.prototype.isInViewport=function(t){var e=t.getBoundingClientRect(),n=e.top,s=n===void 0?0:n,a=e.left,r=a===void 0?0:a,l=e.bottom,u=l===void 0?0:l,h=e.right,c=h===void 0?0:h;return 0<=s&&0<=r&&u<=(window.innerHeight||document.documentElement.clientHeight)&&c<=(window.innerWidth||document.documentElement.clientWidth)},i.prototype.isChildOfCarousel=function(t){return!!(t instanceof Element&&this.listRef&&this.listRef.current)&&this.listRef.current.contains(t)},i.prototype.onKeyUp=function(t){var e=t.target;switch(t.keyCode){case 37:if(this.isChildOfCarousel(e))return this.previous();break;case 39:if(this.isChildOfCarousel(e))return this.next();break;case 9:if(this.isChildOfCarousel(e)&&e instanceof HTMLInputElement&&this.isInViewport(e))return this.next()}},i.prototype.handleEnter=function(t){E.isMouseMoveEvent(t)&&this.autoPlay&&this.props.autoPlay&&this.props.pauseOnHover&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},i.prototype.goToSlide=function(t,e,n){var s=this;if(n===void 0&&(n=!0),!this.isInThrottle){var a=this.state.itemWidth,r=this.props,l=r.afterChange,u=r.beforeChange,h=this.state.currentSlide;typeof u!="function"||e&&(typeof e!="object"||e.skipBeforeChange)||u(t,this.getState()),this.isAnimationAllowed=n,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({currentSlide:t,transform:-a*t},function(){s.props.infinite&&s.correctClonesPosition({domLoaded:!0}),typeof l!="function"||e&&(typeof e!="object"||e.skipAfterChange)||(i.afterChangeTimeout3=setTimeout(function(){l(h,s.getState())},s.props.transitionDuration||P))})}},i.prototype.getState=function(){return this.state},i.prototype.renderLeftArrow=function(t){var e=this,n=this.props,s=n.customLeftArrow,a=n.rtl;return T.createElement(it.LeftArrow,{customLeftArrow:s,getState:function(){return e.getState()},previous:this.previous,disabled:t,rtl:a})},i.prototype.renderRightArrow=function(t){var e=this,n=this.props,s=n.customRightArrow,a=n.rtl;return T.createElement(it.RightArrow,{customRightArrow:s,getState:function(){return e.getState()},next:this.next,disabled:t,rtl:a})},i.prototype.renderButtonGroups=function(){var t=this,e=this.props.customButtonGroup;return e?T.cloneElement(e,{previous:function(){return t.previous()},next:function(){return t.next()},goToSlide:function(n,s){return t.goToSlide(n,s)},carouselState:this.getState()}):null},i.prototype.renderDotsList=function(){var t=this;return T.createElement(Ut.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return t.getState()}})},i.prototype.renderCarouselItems=function(){var t=[];if(this.props.infinite){var e=T.Children.toArray(this.props.children);t=S.getClones(this.state.slidesToShow,e)}return T.createElement(Yt.default,{clones:t,goToSlide:this.goToSlide,state:this.state,notEnoughChildren:S.notEnoughChildren(this.state),props:this.props})},i.prototype.render=function(){var t=this.props,e=t.deviceType,n=t.arrows,s=t.renderArrowsWhenDisabled,a=t.removeArrowOnDeviceType,r=t.infinite,l=t.containerClass,u=t.sliderClass,h=t.customTransition,c=t.additionalTransfrom,d=t.renderDotsOutside,p=t.renderButtonGroupOutside,f=t.className,v=t.rtl,w=S.getInitialState(this.state,this.props),C=w.shouldRenderOnSSR,b=w.shouldRenderAtAll,g=S.isInLeftEnd(this.state),M=S.isInRightEnd(this.state),I=n&&!(a&&(e&&-1{for(let n=0,a=Q.next;(e.context&&(a<0||a==M||a==H||a==$&&Q.peek(n+1)==$)||a==QO||a==eO)&&Q.acceptToken(_),!(a!=K&&a!=OO);)a=Q.peek(++n)},{contextual:!0});let tO=new Set([N,E,z,v,D,L,A,I,J,C,B,F]);const iO=new w({start:!1,shift:(Q,e)=>e==q?Q:tO.has(e)}),XO=R({"func interface struct chan map const type var":O.definitionKeyword,"import package":O.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":O.controlKeyword,range:O.keyword,Bool:O.bool,String:O.string,Rune:O.character,Number:O.number,Nil:O.null,VariableName:O.variableName,DefName:O.definition(O.variableName),TypeName:O.typeName,LabelName:O.labelName,FieldName:O.propertyName,"FunctionDecl/DefName":O.function(O.definition(O.variableName)),"TypeSpec/DefName":O.definition(O.typeName),"CallExpr/VariableName":O.function(O.variableName),LineComment:O.lineComment,BlockComment:O.blockComment,LogicOp:O.logicOperator,ArithOp:O.arithmeticOperator,BitOp:O.bitwiseOperator,"DerefOp .":O.derefOperator,"UpdateOp IncDecOp":O.updateOperator,CompareOp:O.compareOperator,"= :=":O.definitionOperator,"<-":O.operator,'~ "*"':O.modifier,"; ,":O.separator,"... :":O.punctuation,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),nO={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},PO=Y.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuOPQSO7+%hOOQP7+%h7+%hO4cQQO7+%hOOQP1G0Q1G0QO!>^QQO1G0QOOQP1G0U1G0UO!>fQQO1G0UOF|QQO1G0UOOQO,5nAN>nO4cQQOAN>nO!IsQSOAN>nOOQP<nQQO'#FrOOQO,5vAN>vO!LtQQOAN>vP.hQQO'#F|OOQPG25XG25XO!LyQQOG25bO!MOQQO'#FPOOQPG25bG25bO!MZQQOG25bOOQPLD)tLD)tOOQPG24bG24bO!JqQQOLD*|O!9OQQO'#GQO!McQQO,5;kOOQP,5;k,5;kO?tQQO'#FQO!MnQQO'#FQO!MsQQOLD*|OOQP!$'Nh!$'NhOOQO,5VO^!hOh!POr-TOw}O!P-_O!Q-`O!W-^O!]-eO%O!eO%Y!fO~OZ!sO~O^#uO~O!P$xO~On!lO#W%]aV%]a^%]ah%]ar%]aw%]a!P%]a!Q%]a!W%]a!]%]a#T%]a$w%]a%O%]a%Y%]au%]a~O]${O^#QO~OZ#RO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O]$|O!|,WO~PBROj!qOn%QO!QnOi%cP~P*aO!V%WO!|#`O~PBRO!V%YO~OV!}O[oO^YOaoOdoOh!POjcOr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO#Y!RO#^!SO#d!TO#j!UO#m!VO#v!WO#{!XO#}!YO$S!ZO$U![O$V![O$W!]O$Y!^O$[!_O%OQO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~Oi%dX#p%dX#q%dX~PDQOi%]O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-QO!WaO!]!QO!phO!qhO%O+{O%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^%aO%O%_O~O!QnO!a%cO~P*aO!QnOn$mX#T$mX#U$mXV$mX$w$mX!a$mX~P*aOn#TO#T%ea#U%eaV%ea$w%ea!a%ea~O]%fO~PF|OV#ga$w#ga~PDTO[%sO~OZ#rO[#qO]%vO%O#oO~O^!hOh!POn%zOr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO]%[P~O^&OOh!POr!jOw}O!P!OO!Q!kO!WaO!]!QO%Y!fO^%ZXj%ZX~O%O%}O~PKfOjcO^qa]qanqa!Vqa~O^#uO!W&SO~O^!hOh!POr-TOw}O{&WO!P-_O!Q-`O!W-^O!]-eO%O,xO%Y!fO~Oi&^O~PL{O^!hOh!POr!jOw}O!Q!kO!WaO!]!QO%O!eO%Y!fO~O!P#hO~PMwOi&eO%O,yO%Y!fO~O#T&gOV#ZX$w#ZX~P?tO]&kO%O#oO~O^!hOh!POr-TOw}O!P-_O!Q-`O!]-eO%O!eO%Y!fO~O!W&lO#T&mO~P! _O]&qO%O#oO~O#T&sOV#eX$w#eX~P?tO]&vO%O#oO~OjeX~P$XOjcO!|,XO~P2gOn!lO#W&yO#W%]X~O^#VOn#TO!Q#cO!W#SO!|,XO#R#dO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]OV`X#T%eX#U%eX~OZ&zOj$`O$w`X~P!#cOi'OO#p'PO#q'QO~OZ#ROjcO~P!#cO#T'TO#U#iO~O#W'UO~OV'WO!QnO~P*aOV'XO~OjcO~O!|#`OV#za$w#za~PBROi'[O#p']O#q'^O~On#TO!|#`OV%eX$w%eX!a%eX~PBRO!|#`OV$Za$w$Za~PBRO${$rO$|$rO$}'`O~O]${O~O%O!eO]%ZXn%ZX!V%ZX~PKfO!|#`Oi!_Xn!_X!a!`X~PBROi!_Xn!_X!a!`X~O!a'aO~On'bOi%cX~Oi'dO~On'eO!V%bX!a%bX~O!V'gO~O]'jOn'kO!|,YO~PBROn'nO!V'mO!a'oO!|#`O~PBRO!QnO!V'qO!a'rO~P*aO!|#`On$ma#T$ma#U$maV$ma$w$ma!a$ma~PBRO]'sOu'tO~O%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi!|!xi#R!xi#T!xi#U!xi$w!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~O!V!xii!xi!a!xi~P!+YO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi!V!xii!xi!a!xi~O!|!xi~P!-TO!|#`O~P!-TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%q!xi~O!|#`O!V!xii!xi!a!xi~P!/VO!|#`OV#Pi$w#Pi!a#Pi~PBRO]'uOn'wOu'vO~OZ#rO[#qO]'zO%O#oO~Ou'|O~P?tOn'}O]%[X~O](PO~OZeX^mX^!TXj!TX!W!TX~OjcOV$]i$w$]i~O%`(ZOV%^X$w%^Xn%^X!V%^X~Oi(`O~PL{O[(aO!W!tOVlX$wlX~On(bO~P?tO[(aOVlX$wlX~Oi(hO%O,yO%Y!fO~O!V(iO~O#T(kO~O](nO%O#oO~O[oO^YOaoOdoOh!POr!pOu-bOw}O!P!OO!QnO!V-UO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O+zO~P!4vO](sO%O#oO~O#T(tOV#ea$w#ea~O](xO%O#oO~O#k(yOV#ii$w#ii~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-PO!WaO!]!QO!phO!qhO%O+xO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^(|O%O%_O~O#p%dP#q%dP~P/uOi)PO#p'PO#q'QO~O!a)RO~O!QnO#y)VO~P*aOV)WO!|#`O~PBROj#wa~P;_OV)WO!QnO~P*aOi)]O#p']O#q'^O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O,eO~P!:lO!a)bO~Oj!qO!QnO~P*aOj!qO!QnOi%ca~P*aOn)iOi%ca~O!V%ba!a%ba~P?tOn)lO!V%ba!a%ba~O])nO~O])oO~O!V)pO~O!QnO!V)rO!a)sO~P*aO!V)rO!a)sO!|#`O~PBRO])uOn)vO~O])wOn)xO~O^!hOh!POr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO~O]%[a~P!>nOn)|O]%[a~O]${O]tXntX~OjcOV$^q$w$^q~On*PO{&WO~P?tOn*SO!V%rX~O!V*UO~OjcOV$]q$w$]q~O%`(ZOV|a$w|an|a!V|a~O[*]OVla$wla~O[*]O!W!tOVla$wla~On*PO{&WO!W*`O^%WXj%WX~P! _OjcO#j!UO~OjcO!|,XO~PBROZ*dO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O!|#`O~P!BoO#^*eO~P?tO!a*fO~Oj$`O!|,XO~P!BoO#W*hO~Oj#wi~P;_OV*kO!|#`O~PBROn#TO!Q#cO!|#`O!a$QX#T%eX~PBRO#T*lO~O#W*lO~O!a*mO~O!|#`Oi!_in!_i~PBRO!|#`Oi!bXn!bX!a!cX~PBROi!bXn!bX!a!cX~O!a*nO~Oj!qO!QnOi%ci~P*aO!V%bi!a%bi~P?tO!V*qO!a*rO!|#`O~PBRO!V*qO!|#`O~PBRO]*tO~O]*uO~O]*uOu*vO~O]%[i~P!>nO%O!eO!V%ra~On*|O!V%ra~O[+OOVli$wli~O%O+yO~P!4vO#k+QOV#iy$w#iy~O^+RO%O%_O~O]+SO~O!|,XOj#xq~PBROj#wq~P;_O!V+ZO!|#`O~PBRO]+[On+]O~O%O!eO!V%ri~O^#QOn'eO!V%bX~O#^+`O~P?tOj+aO~O^#VO!W#SO!|#`O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~OZ+cO~P!JvO!|#`O!a$Qi~PBRO!|#`Oi!bin!bi~PBRO!V+dO!|#`O~PBRO]+eO~O]+fO~Oi+iO#p+jO#q+kO~O^+lO%O%_O~Oi+pO#p+jO#q+kO~O!a+rO~O#^+sO~P?tO!a+tO~O]+uO~OZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXVeXneX!QeX#ReX#TeX#UeX$weX~O]eX]!TX!VeXieX!aeX~P!NUOjeX~P!NUOZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXn!TX!VeX~O]eX!V!TX~P#!gOh!TXr!TXw!TX{!TX!P!TX!Q!TX!]!TX%O!TX%Y!TX~P#!gOZeX^eX^!TXj!TXneX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeX~O]eXueX~P#$xO]$mXn$mXu$mX~PF|Oj$mXn$mX~P!7`On+|O]%eau%ea~On+}Oj%ea~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-OO!WaO!]!QO!phO!qhO%O+yO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~OZeX]!TX^UXhUXnUXn!TXrUXuUXwUX!PUX!QUX!WUX!W!TX!]UX%OUX%YUX~OnUX!QeX!aeX#TeX#WUX~P#$xOn+|O!|,YO]%eXu%eX~PBROn+}O!|,XOj%eX~PBRO^&OOV%ZXj%ZX$w%ZX]%ZXn%ZX!V%ZXu%ZX%`%ZX#T%ZX[%ZX!a%ZX~P?wO!|,YO]$man$mau$ma~PBRO!|,XOj$man$ma~PBRO%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~Oj!xi~P!+YOn!xiu!xi~P#,hO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%p!xi%q!xi~O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xij!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi~O!|!xi~P#/_On!xiu!xi~P#.TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi%p!xi%q!xi~O!|,WO~P#1^O!|,XO~P#/_O!|,YOn!xiu!xi~P#1^O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OZ!xi]!xi^!xi!W!xi%q!xi~O!|,WO~P#3QO!|,XOj!xi~P!/VO!|,YOn!xiu!xi~P#3QO!|,XOj#Pi~PBROV!TXZeX^mX!W!TX$w!TX~O%`!TX~P#5RO[!TXhmXnmXrmXwmX!PmX!QmX!WmX!]mX%OmX%YmX~P#5ROn#TO!Q,aO!|,XO#R#dOj`X#T%eX#U%eX~PBRO[oO^YOaoOdoOh!POr!pOw}O!P#hO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O!Q-OO%O+yO~P#6{O!Q-PO%O+xO~P#6{O!Q-QO%O+{O~P#6{O#T,bO#U,bO~O#W,cO~O^!hOh!POr-TOw}O!P-_O!Q-WO!W-^O!]-eO%O!eO%Y!fO~O^!hOh!POr-TOw}O!Q-`O!W-^O!]-eO%O!eO%Y!fO~O!P-VO~P#9zO%O+wO~P!4vO!P-XO~O!V-YO!|#`O~PBRO!V-ZO~O!V-[O~O!W-dO~OP%ka%Oa~",goto:"!FW%sPP%tP%wP%zP'SP'XPPPP'`'cP'u'uP)w'u-_PPP0j0m0qP1V4b1VP7s8WP1VP8a8d8hP8p8w1VPP1V8{<`?vPPCY-_-_-_PCdCuCxPC{DQ'u'uDV'uES'u'u'u'uGUIW'uPPJR'uJUMjMjMj'u! r! r!#SP!$`!%d!&d'cP'cPP'cP!&yP!'V!'^!&yP!'a!'h!'n!'w!&yP!'z!(R!&y!(U!(fPP!&yP!(x!)UPP!&y!)Y!)c!&yP!)g!)gP!&yP!&yP!)j!)m!&v!&yP!&yPPP!&yP!&yP!)q!)q!)w!)}!*U!*[!*d!*j!*p!*w!*}!+T!+Z!.q!.x!/O!/X!/m!/s!/z!0Q!0W!0^!0d!0jPPPPPPPPP!0p!1f!1k!1{!2kPP!7P!:^P!>u!?Z!?_!@Z!@fP!@p!D_!Df!Di!DuPPPPPPPPPPPP!FSR!aPRyO!WXOScw!R!T!U!W#O#k#n#u$R$X&O&j&u&|'W'Y']'})W)|*k*w+gQ#pzU#r{#s%uQ#x|U$T!S$U&pQ$^!VQ$y!lR)U'RVROS#nQ#t{T%t#s%uR#t{qrOScw!U!V!W#O#k#n&|'W'Y)W*k+g%PoOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%O]OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^#u!iW^!O!h!t!z#e#h#u#v#y#|#}$P$Q$T$W$v$x%W%Y%a%x%y&O&S&W&]&`&b&d&m'e'|'}(S([(c(i(o(|)l)|*P*Q*S*p*w*|+R+^+j+l,h-U-V-W-X-Y-Z-[-]-_-d'cbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR$O!PT&c#}&dW%`#R&z*d+cQ&Q#vS&V#y&]S&`#}&dR*Y(b'cZOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d%fWOSWYacmnw!O!U!V!W!X!Z!_!q!z#O#Q#S#T#V#^#_#`#a#b#c#h#i#j#k#n#v#|$f$v$x%W%Y%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(i(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S&b#}&d!{-]!h!t#e#u#y$P$Q$T$W%a%x%y&O&W&]&`&m'e'|'}(S([(c(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-dQ#v|S$v!j!pU&P#v$v,hZ,h#x&Q&U&V-TS%{#u&OV){'})|*wR#z}T&[#y&]]&X#y&](S([(o*QZ&Z#y&](S(o*QT([&Y(]'s_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d'r_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!w^'bbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&a#}&dR(d&bS!u]fX!x`&_(e(oQ!r[Q%O!qQ)d'aU)f'b)i*oR+X*nR%R!qR%P!qV)h'b)i*oV)g'b)i*odtOScw#O#k#n&|'Y+gQ$h!WQ&R#wQ&w$[S'S$c$iQ(V&TQ*O(RQ*V(WQ*b(yQ*c(zR+_+Q%PfOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%PgOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^!q#Weg!o!y$[$_$c$j$m$q$}%^%b%d%m'V'p(z({)S)Y)^)c)e)q)t*i*s+T+V+W+Y,f,g,i,j,w,z-aR#fh#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z[,V%^,f,i,p,s,v`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q!Y#^e!y$j$m$q$}%b%d%i%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aY,Q!o,k,n,q,tl,R$[$_$c(z)S*i,g,j,l,o,r,u,w,z_,S%^,f,i,m,p,s,v!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z],V%^,f,i,p,s,v!S#ae!y$j$m$q$}%b%d%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aS,Z!o,tf,[$[$_$c(z)S*i,g,j,u,w,zX,]%^,f,i,v!Q#be!y$j$m$q$}%b%d%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aQ,^!od,_$[$_$c(z)S*i,g,j,w,zV,`%^,f,iprOScw!U!V!W#O#k#n&|'W'Y)W*k+gR)a']etOScw#O#k#n&|'Y+gQ$S!RT&i$R&jR$S!RQ$V!ST&o$U&pQ&U#xR&m$TS(T&S&lV*{*S*|+^R$V!SQ$Y!TT&t$X&uR$Y!TdsOScw#O#k#n&|'Y+gT$p![!]dtOScw#O#k#n&|'Y+gQ*b(yR+_+QQ$a!VQ&{$_Q)T'RR*g)ST&|$`&}Q+b+SQ+m+fR+v+uT+g+a+hR$i!WR$l!YT'Y$k'ZXuOSw#nQ$s!`R'_$sSSO#nR!dSQ%u#sR'y%uUwOS#nR#mwQ&d#}R(g&dQ(c&`R*Z(cS!mX$^R$z!mQ(O%{R)}(OQ&]#yR(_&]Q(]&YR*X(]'r^OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!v^S'f%T+PR)m'fQ'c%RR)j'cW#Oc&|'Y+gR%[#O^#Ue$[$_$c$m)^,zU%e#U,O,PQ,O,fR,P,gQ&j$RR(m&jS*Q(S(oR*y*QQ*T(TR*}*TQ&p$UR(r&pQ&u$XR(w&uQ&}$`R)O&}Q+h+aR+o+hQ'Z$kR)['ZQ!cRQ#luQ#nyQ%Z!|Q&x$]Q'R$bQ'x%tQ(^&[Q(f&cQ(l&iQ(q&oR(v&tVxOS#nWuOSw#nY!|c#O&|'Y+gR%r#kdtOScw#O#k#n&|'Y+gQ$]!UQ$b!VQ$g!WQ)X'WQ*j)WR+U*kdeOScw#O#k#n&|'Y+gQ!oYQ!ya`#gmn,{,|,}-O-P-QQ$[!UQ$_!VQ$c!WQ$j!Xd$m!Z#i#j&g&s'P'T'U(k(tQ$q!_Q$}!qQ%^#QQ%b#SQ%d#TW%h#^,Q,R,SQ%i#_Q%j#`Q%k#aQ%l#bQ%m#cQ'V$fQ'p%cQ(z&xQ({&yQ)S'RQ)Y'XQ)^']Q)c'aU)e'b)i*oQ)q'oQ)t'rQ*i)VQ*s)sQ+T*hQ+V*lQ+W*nQ+Y*rS,f#V'wS,g,b,cQ,i+|Q,j+}Q,k,TQ,l,UQ,m,VQ,n,WQ,o,XQ,p,YQ,q,ZQ,r,[Q,s,]Q,t,^Q,u,_Q,v,`Q,w,aU,z'W)W*kV-a&l*`-^#bZW!O!h!t!z#e#h#u#v#y#|$P$Q$T$W$v$x%W%Y%a%x%y&O&W&]&`&m'e'|'}(S([(c(i(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-d%P[OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^$zdOSacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S!gW-]Q!nYS#{!O-_Q$u!hS%T!t+jS%X!z-UQ%n#e[%o#h#|$x-V-W-XW%w#u'})|*wU&P#v$v,h[&X#y&](S([(o*QQ&f$PQ&h$QQ&n$TQ&r$WS'h%W-YS'i%Y-ZW'l%a(|+R+lS'{%x%yQ(Q&OQ(Y&WQ(d&`Q(p&mU)k'e)l*pQ)z'|Q*[(cS*^(i-[Q+P*`R-c-dS#w|!pS$w!j-TQ&T#xQ(R&QQ(W&UR(X&VT%|#u&OhqOScw!U!V#O#k#n&|'Y+gU$Q!R$R&jU$W!T$X&uQ$e!WY%y#u&O'})|*wQ)`']V-S'W)W*kS&[#y&]S*R(S(oR*z*QY&Y#y&](S(o*QR*W(['``OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:iO,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20,16,68,93,94,96,99,101,105,111,115,117,120,126,129,134,136,141,143,147,149,"Statement",-12,23,31,33,38,46,49,50,51,52,56,57,58,"Type"],["openedBy",13,"(",25,"{",53,"["],["closedBy",14,")",26,"}",54,"]"]],propSources:[XO],skippedNodes:[0,1,2,153],repeatNodeCount:23,tokenData:":b~RvXY#iYZ#i]^#ipq#iqr#zrs$Xuv&Pvw&^wx&yxy(qyz(vz{({{|)T|})e}!O)j!O!P)u!P!Q+}!Q!R,y!R![-t![!]2^!]!^2k!^!_2p!_!`3]!`!a3e!c!}3x!}#O4j#P#Q4o#Q#R4t#R#S4|#S#T9X#T#o3x#o#p9q#p#q9v#q#r:W#r#s:]$g;'S3x;'S;=`4d<%lO3x~#nS$y~XY#iYZ#i]^#ipq#iU$PP%hQ!_!`$SS$XO!|S~$^W[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y<%lO$X~${O[~~%ORO;'S$X;'S;=`%X;=`O$X~%^X[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y;=`<%l$X<%lO$X~%|P;=`<%l$X~&UP%l~!_!`&X~&^O#U~~&cR%j~vw&l!_!`&X#Q#R&q~&qO%p~~&vP%o~!_!`&X~'OWd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k<%lO&y~'mOd~~'pRO;'S&y;'S;=`'y;=`O&y~(OXd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k;=`<%l&y<%lO&y~(nP;=`<%l&y~(vO^~~({O]~~)QP%Y~!_!`&X~)YQ%f~{|)`!_!`&X~)eO#R~~)jOn~~)oQ%g~}!O)`!_!`&X~)zRZS!O!P*T!Q![*`#R#S+w~*WP!O!P*Z~*`Ou~Q*eTaQ!Q![*`!g!h*t#R#S+w#X#Y*t#]#^+rQ*wS{|+T}!O+T!Q![+^#R#S+lQ+WQ!Q![+^#R#S+lQ+cRaQ!Q![+^#R#S+l#]#^+rQ+oP!Q![+^Q+wOaQQ+zP!Q![*`~,SR%k~z{,]!P!Q,b!_!`&X~,bO$z~~,gSP~OY,bZ;'S,b;'S;=`,s<%lO,b~,vP;=`<%l,bQ-O[aQ!O!P*`!Q![-t!d!e.c!g!h*t!q!r/Z!z!{/x#R#S.]#U#V.c#X#Y*t#]#^+r#c#d/Z#l#m/xQ-yUaQ!O!P*`!Q![-t!g!h*t#R#S.]#X#Y*t#]#^+rQ.`P!Q![-tQ.fR!Q!R.o!R!S.o#R#S/QQ.tSaQ!Q!R.o!R!S.o#R#S/Q#]#^+rQ/TQ!Q!R.o!R!S.oQ/^Q!Q!Y/d#R#S/rQ/iRaQ!Q!Y/d#R#S/r#]#^+rQ/uP!Q!Y/dQ/{T!O!P0[!Q![1c!c!i1c#R#S2Q#T#Z1cQ0_S!Q![0k!c!i0k#R#S1V#T#Z0kQ0pVaQ!Q![0k!c!i0k!r!s*t#R#S1V#T#Z0k#]#^+r#d#e*tQ1YR!Q![0k!c!i0k#T#Z0kQ1hWaQ!O!P0k!Q![1c!c!i1c!r!s*t#R#S2Q#T#Z1c#]#^+r#d#e*tQ2TR!Q![1c!c!i1c#T#Z1c~2cP!a~!_!`2f~2kO#W~~2pOV~~2uR!|S}!O3O!^!_3T!_!`$S~3TO!Q~~3YP%m~!_!`&X~3bP#T~!_!`$S~3jQ!|S!_!`$S!`!a3p~3uP%n~!_!`&X~3}V%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~4gP;=`<%l3x~4oO!W~~4tO!V~~4yP%i~!_!`&X~5RV%O~!Q![5h!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~5o^aQ%O~!O!P*`!Q![5h!c!g3x!g!h6k!h!}3x#R#S4|#T#X3x#X#Y6k#Y#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~6pX%O~{|+T}!O+T!Q![7]!c!}3x#R#S8P#T#o3x$g;'S3x;'S;=`4d<%lO3x~7dXaQ%O~!Q![7]!c!}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[aO,1,2,new x("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:Q=>nO[Q]||-1}],tokenPrec:5451}),oO=[X("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),X("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),X("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),X("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),X("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),X("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),X("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),X(`select { + \${} +}`,{label:"select",detail:"statement",type:"keyword"}),X("case ${}:\n${}",{label:"case",type:"keyword"}),X("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),X("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),X("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),X(`if \${} { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),X('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],S=new Z,T=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function o(Q,e){return(n,a)=>{O:for(let t=n.node.firstChild,c=0,i=null;;){for(;!t;){if(!c)break O;c--,t=i.nextSibling,i=i.parent}e&&t.name==e||t.name=="SpecList"?(c++,i=t,t=t.firstChild):(t.name=="DefName"&&a(t,Q),t=t.nextSibling)}return!0}}const cO={FunctionDecl:o("function"),VarDecl:o("var","VarSpec"),ConstDecl:o("constant","ConstSpec"),TypeDecl:o("type","TypeSpec"),ImportDecl:o("constant","ImportSpec"),Parameter:o("var"),__proto__:null};function m(Q,e){let n=S.get(e);if(n)return n;let a=[],t=!0;function c(i,P){let V=Q.sliceString(i.from,i.to);a.push({label:V,type:P})}return e.cursor(b.IncludeAnonymous).iterate(i=>{if(t)t=!1;else if(i.name){let P=cO[i.name];if(P&&P(i,c)||T.has(i.name))return!1}else if(i.to-i.from>8192){for(let P of m(Q,i.node))a.push(P);return!1}}),S.set(e,a),a}const p=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,W=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],rO=Q=>{let e=d(Q.state).resolveInner(Q.pos,-1);if(W.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&p.test(Q.state.sliceDoc(e.from,e.to));if(!n&&!Q.explicit)return null;let a=[];for(let t=e;t;t=t.parent)T.has(t.name)&&(a=a.concat(m(Q.state.doc,t)));return{options:a,from:n?e.from:Q.pos,validFor:p}},r=k.define({name:"go",parser:PO.configure({props:[h.add({IfStatement:l({except:/^\s*({|else\b)/}),LabeledStatement:f,"SwitchBlock SelectBlock":Q=>{let e=Q.textAfter,n=/^\s*\}/.test(e),a=/^\s*(case|default)\b/.test(e);return Q.baseIndent+(n||a?0:Q.unit)},Block:u({closing:"}"}),BlockComment:()=>null,Statement:l({except:/^{/})}),y.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":g,BlockComment(Q){return{from:Q.from+2,to:Q.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let lO=Q=>({label:Q,type:"keyword"});const $O="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(lO);function YO(){let Q=oO.concat($O);return new j(r,[r.data.of({autocomplete:U(W,G(Q))}),r.data.of({autocomplete:rO})])}export{YO as go,r as goLanguage,rO as localCompletionSource,oO as snippets}; diff --git a/assets/index-D93eCjLG.js b/assets/index-D93eCjLG.js deleted file mode 100644 index 954efee..0000000 --- a/assets/index-D93eCjLG.js +++ /dev/null @@ -1 +0,0 @@ -import{E as R,C as G,s as u,t as $,b as w,L as v,f as g,k as V,i as U,c as b,n as q,a as E}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const z=154,X=155,C=156,N=1,D=2,f=3,I=157,F=158,Z=4,K=5,L=159,p=160,W=161,s=162,T=6,h=7,A=8,B=9,c=0,i=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],M=58,J=40,P=95,H=91,l=45,OO=46,m=35,$O=37,j=123,eO=125,o=47,S=42,r=10,_=61,aO=43,QO=38;function d(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function x(O){return O>=48&&O<=57}function k(O){let e;return O.next==o&&((e=O.peek(1))==o||e==S)}const tO=new R((O,e)=>{if(e.dialectEnabled(c)){let a;if(O.next<0&&e.canShift(W))O.acceptToken(W);else if(((a=O.peek(-1))==r||a<0)&&e.canShift(p)){let Q=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),Q++;O.next==r||k(O)?O.acceptToken(p,-Q):Q&&O.acceptToken(s)}else if(O.next==r)O.acceptToken(L,1);else if(i.includes(O.next)){for(O.advance();O.next!=r&&i.includes(O.next);)O.advance();O.acceptToken(s)}}else{let a=0;for(;i.includes(O.next);)O.advance(),a++;a&&O.acceptToken(s)}},{contextual:!0}),nO=new R((O,e)=>{if(k(O)){if(O.advance(),e.dialectEnabled(c)){let a=-1;for(let Q=1;;Q++){let t=O.peek(-Q-1);if(t==r||t<0){a=Q+1;break}else if(!i.includes(t))break}if(a>-1){let Q=O.next==S,t=0;for(O.advance();O.next>=0;)if(O.next==r){O.advance();let n=0;for(;O.next!=r&&i.includes(O.next);)n++,O.advance();if(n=0;)O.advance();O.acceptToken(T)}else{for(O.advance();O.next>=0;){let{next:a}=O;if(O.advance(),a==S&&O.next==o){O.advance();break}}O.acceptToken(h)}}}),rO=new R((O,e)=>{(O.next==aO||O.next==_)&&e.dialectEnabled(c)&&O.acceptToken(O.next==_?A:B,1)}),iO=new R((O,e)=>{if(!e.dialectEnabled(c))return;let a=e.context.depth;if(O.next<0&&a){O.acceptToken(X);return}if(O.peek(-1)==r){let t=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),t++;t!=a&&O.next!=r&&!k(O)&&(t{for(let a=!1,Q=0,t=0;;t++){let{next:n}=O;if(d(n)||n==l||n==P||a&&x(n))!a&&(n!=l||t>0)&&(a=!0),Q===t&&n==l&&Q++,O.advance();else if(n==m&&O.peek(1)==j){O.acceptToken(K,2);break}else{a&&O.acceptToken(n==J?I:Q==2&&e.canShift(Z)?Z:F);break}}}),lO=new R(O=>{if(O.next==eO){for(O.advance();d(O.next)||O.next==l||O.next==P||x(O.next);)O.advance();O.next==m&&O.peek(1)==j?O.acceptToken(D,2):O.acceptToken(N)}}),oO=new R(O=>{if(i.includes(O.peek(-1))){let{next:e}=O;(d(e)||e==P||e==m||e==OO||e==H||e==M||e==l||e==QO)&&O.acceptToken(C)}}),dO=new R(O=>{if(!i.includes(O.peek(-1))){let{next:e}=O;if(e==$O&&(O.advance(),O.acceptToken(f)),d(e)){do O.advance();while(d(O.next));O.acceptToken(f)}}});function Y(O,e){this.parent=O,this.depth=e,this.hash=(O?O.hash+O.hash<<8:0)+e+(e<<4)}const SO=new Y(null,0),cO=new G({start:SO,shift(O,e,a,Q){return e==z?new Y(O,a.pos-Q.pos):e==X?O.parent:O},hash(O){return O.hash}}),sO=u({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":$.definitionKeyword,"Keyword selector":$.keyword,ControlKeyword:$.controlKeyword,NamespaceName:$.namespace,KeyframeName:$.labelName,TagName:$.tagName,"ClassName Suffix":$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName":$.atom,VariableName:$.variableName,SassVariableName:$.special($.variableName),Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":$.definitionOperator,MatchOp:$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,"Important Global Default":$.modifier,Comment:$.blockComment,LineComment:$.lineComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,"InterpolationStart InterpolationContinue InterpolationEnd":$.meta,': "..."':$.punctuation,"PseudoOp #":$.derefOperator,"; ,":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),XO={__proto__:null,not:62,only:62,using:179,as:189,with:193,without:193,hide:207,show:207,from:230,to:232,if:245,through:251,in:257},yO={__proto__:null,url:80,"url-prefix":80,domain:80,regexp:80,lang:94,"nth-child":94,"nth-last-child":94,"nth-of-type":94,"nth-last-of-type":94,dir:94,"host-context":94,selector:172},PO={__proto__:null,"@import":156,"@include":176,"@mixin":182,"@function":182,"@use":186,"@extend":196,"@at-root":200,"@forward":204,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@if":240,"@else":242,"@for":248,"@each":254,"@while":260,"@debug":264,"@warn":264,"@error":264,"@return":264},mO=w.deserialize({version:14,states:"L|Q`Q+tOOO#fQ+tOOP#mOpOOOOQ#U'#Ch'#ChO#rQ(pO'#CjOOQ#U'#Ci'#CiO%_Q)QO'#FxO%rQ.jO'#CnO&jQ#dO'#DWO'aQ(pO'#CgO'hQ)OO'#DYO'sQ#dO'#DaO'xQ#dO'#DeO'}Q#dO'#DnOOQ#U'#Fx'#FxO(SQ(pO'#FxO(ZQ(nO'#DrO%rQ.jO'#DzO%rQ.jO'#EVO%rQ.jO'#EYO%rQ.jO'#E[O(`Q)OO'#EaO)QQ)OO'#EcO%rQ.jO'#EeO)_Q)OO'#EhO%rQ.jO'#EjO)yQ)OO'#ElO*UQ#dO'#EoO*ZQ)OO'#EuO*oQ)OO'#FVOOQ&Z'#Fw'#FwOOQ&Y'#FY'#FYO*yQ(nO'#FYQ`Q+tOOO%rQ.jO'#EwO+UQ(nO'#E{O+ZQ)OO'#FOO%rQ.jO'#FRO%rQ.jO'#FTOOQ&Z'#Fa'#FaO+cQ+uO'#GRO+pQ(oO'#GRQOQ#SOOP,RO#SO'#FvPOOO)CAk)CAkOOQ#U'#Cm'#CmOOQ#U,59W,59WOOQ#i'#Cp'#CpO%rQ.jO'#CsO,aQ.wO'#CuO.|Q.^O,59YO%rQ.jO'#CzOOQ#S'#DO'#DOO/_Q(nO'#DTOOQ#i'#Fz'#FzO/dQ(nO'#C}OOQ#U'#DX'#DXOOQ#U,59r,59rO&jQ#dO,59rO/iQ)OO,59tO'sQ#dO,59{O'xQ#dO,5:PO(`Q)OO,5:TO(`Q)OO,5:VO(`Q)OO,5:WO(`Q)OO'#F`O/tQ(nO,59RO0PQ+tO'#DpO0WQ#TO'#DpOOQ&Z,59R,59ROOQ#U'#D['#D[OOQ#S'#D_'#D_OOQ#U,59t,59tO0]Q(nO,59tO0bQ(nO,59tOOQ#U'#Dc'#DcOOQ#U,59{,59{OOQ#S'#Dg'#DgO0gQ9`O,5:POOQ#U'#Do'#DoOOQ#U,5:Y,5:YO1gQ.jO,5:^O1qQ.jO,5:fO2jQ.jO,5:qO2wQ.YO,5:tO3YQ.jO,5:vOOQ#U'#Cj'#CjO4RQ(pO,5:{O4`Q(pO,5:}OOQ&Z,5:},5:}O4gQ)OO,5:}O4lQ.jO,5;POOQ#S'#D}'#D}O5[Q)OO'#ESO5cQ(nO'#GTO*ZQ)OO'#ERO5wQ(nO'#ETOOQ#S'#GU'#GUO/wQ(nO,5;SO3`Q.YO,5;UOOQ#d'#En'#EnO*yQ(nO,5;WO5|Q)OO,5;WOOQ#S'#Eq'#EqO6UQ(nO,5;ZO6ZQ(nO,5;aO6fQ(nO,5;qOOQ&Z'#GV'#GVOOQ&Y,5;t,5;tOOQ&Y-E9W-E9WO2wQ.YO,5;cO6tQ)OO,5;gO6yQ)OO'#GXO7RQ)OO,5;jO2wQ.YO,5;mO3`Q.YO,5;oOOQ&Z-E9_-E9_O7WQ(oO,5dQ(pO1G/rO?WQ(pO,5;zOOQ#S-E9^-E9^OOQ&Z1G.m1G.mO?eQ(nO,5:[O?jQ+uO,5:[O?qQ)OO'#D`O?xQ.jO'#D^OOQ#U1G/k1G/kO%rQ.jO1G/kO@tQ.jO'#DtOAOQ.kO1G/xOOQ#T1G/x1G/xO*yQ(nO1G0QOA{Q+uO'#GVOOQ&Z1G0]1G0]O/dQ(nO1G0]OOQ&Z1G0`1G0`OOQ&Z1G0b1G0bO/dQ(nO1G0bODeQ)OO1G0bOOQ&Z1G0g1G0gOOQ&Z1G0i1G0iODmQ)OO1G0iODrQ(nO1G0iODwQ)OO1G0kOOQ&Z1G0k1G0kOEVQ.jO'#FfOEgQ#dO1G0kOElQ(nO'#D}OEwQ(nO,5:jOE|Q(nO,5:nO*ZQ)OO,5:lOFUQ)OO'#FeOFiQ(nO,5]AN>]O!1{Q(pO,5;yOOQ#S-E9]-E9]O!2VQ.jO,5;xOOQ#S-E9[-E9[O!2aQ.YO1G1hO!2uQ(nO1G1hO*yQ(nOAN?SO!3QQ(nOAN?ZO/wQ(nOAN?ZO!3YQ.jO,5^z{>c{|>||}Co}!ODQ!O!PDo!P!QFY!Q![Fk![!]Gf!]!^Hb!^!_Hs!_!`I[!`!aIs!a!b#r!b!cJt!c!}#r!}#OL^#O#P#r#P#QLo#Q#RMQ#R#T#r#T#UMg#U#c#r#c#dNx#d#o#r#o#p! _#p#qMQ#q#r! p#r#s!!R#s;'S#r;'S;=`!!j<%lO#rW#uSOy$Rz;'S$R;'S;=`$d<%lO$RW$WSyWOy$Rz;'S$R;'S;=`$d<%lO$RW$gP;=`<%l$RY$m[Oy$Rz!_$R!_!`%c!`#W$R#W#X%v#X#Z$R#Z#[)Z#[#]$R#]#^,V#^;'S$R;'S;=`$d<%lO$RY%jSyWlQOy$Rz;'S$R;'S;=`$d<%lO$RY%{UyWOy$Rz#X$R#X#Y&_#Y;'S$R;'S;=`$d<%lO$RY&dUyWOy$Rz#Y$R#Y#Z&v#Z;'S$R;'S;=`$d<%lO$RY&{UyWOy$Rz#T$R#T#U'_#U;'S$R;'S;=`$d<%lO$RY'dUyWOy$Rz#i$R#i#j'v#j;'S$R;'S;=`$d<%lO$RY'{UyWOy$Rz#`$R#`#a(_#a;'S$R;'S;=`$d<%lO$RY(dUyWOy$Rz#h$R#h#i(v#i;'S$R;'S;=`$d<%lO$RY(}S!kQyWOy$Rz;'S$R;'S;=`$d<%lO$RY)`UyWOy$Rz#`$R#`#a)r#a;'S$R;'S;=`$d<%lO$RY)wUyWOy$Rz#c$R#c#d*Z#d;'S$R;'S;=`$d<%lO$RY*`UyWOy$Rz#U$R#U#V*r#V;'S$R;'S;=`$d<%lO$RY*wUyWOy$Rz#T$R#T#U+Z#U;'S$R;'S;=`$d<%lO$RY+`UyWOy$Rz#`$R#`#a+r#a;'S$R;'S;=`$d<%lO$RY+yS!jQyWOy$Rz;'S$R;'S;=`$d<%lO$RY,[UyWOy$Rz#a$R#a#b,n#b;'S$R;'S;=`$d<%lO$RY,sUyWOy$Rz#d$R#d#e-V#e;'S$R;'S;=`$d<%lO$RY-[UyWOy$Rz#c$R#c#d-n#d;'S$R;'S;=`$d<%lO$RY-sUyWOy$Rz#f$R#f#g.V#g;'S$R;'S;=`$d<%lO$RY.[UyWOy$Rz#h$R#h#i.n#i;'S$R;'S;=`$d<%lO$RY.sUyWOy$Rz#T$R#T#U/V#U;'S$R;'S;=`$d<%lO$RY/[UyWOy$Rz#b$R#b#c/n#c;'S$R;'S;=`$d<%lO$RY/sUyWOy$Rz#h$R#h#i0V#i;'S$R;'S;=`$d<%lO$RY0^S!iQyWOy$Rz;'S$R;'S;=`$d<%lO$R~0mWOY0jZr0jrs1Vs#O0j#O#P1[#P;'S0j;'S;=`2W<%lO0j~1[Oj~~1_RO;'S0j;'S;=`1h;=`O0j~1kXOY0jZr0jrs1Vs#O0j#O#P1[#P;'S0j;'S;=`2W;=`<%l0j<%lO0j~2ZP;=`<%l0jZ2cY!UPOy$Rz!Q$R!Q![3R![!c$R!c!i3R!i#T$R#T#Z3R#Z;'S$R;'S;=`$d<%lO$RY3WYyWOy$Rz!Q$R!Q![3v![!c$R!c!i3v!i#T$R#T#Z3v#Z;'S$R;'S;=`$d<%lO$RY3{YyWOy$Rz!Q$R!Q![4k![!c$R!c!i4k!i#T$R#T#Z4k#Z;'S$R;'S;=`$d<%lO$RY4rYhQyWOy$Rz!Q$R!Q![5b![!c$R!c!i5b!i#T$R#T#Z5b#Z;'S$R;'S;=`$d<%lO$RY5iYhQyWOy$Rz!Q$R!Q![6X![!c$R!c!i6X!i#T$R#T#Z6X#Z;'S$R;'S;=`$d<%lO$RY6^YyWOy$Rz!Q$R!Q![6|![!c$R!c!i6|!i#T$R#T#Z6|#Z;'S$R;'S;=`$d<%lO$RY7TYhQyWOy$Rz!Q$R!Q![7s![!c$R!c!i7s!i#T$R#T#Z7s#Z;'S$R;'S;=`$d<%lO$RY7xYyWOy$Rz!Q$R!Q![8h![!c$R!c!i8h!i#T$R#T#Z8h#Z;'S$R;'S;=`$d<%lO$RY8oShQyWOy$Rz;'S$R;'S;=`$d<%lO$R_9O`Oy$Rz}$R}!O:Q!O!Q$R!Q![:Q![!_$R!_!`;T!`!c$R!c!}:Q!}#R$R#R#S:Q#S#T$R#T#o:Q#o;'S$R;'S;=`$d<%lO$RZ:X^yWcROy$Rz}$R}!O:Q!O!Q$R!Q![:Q![!c$R!c!}:Q!}#R$R#R#S:Q#S#T$R#T#o:Q#o;'S$R;'S;=`$d<%lO$R[;[S![SyWOy$Rz;'S$R;'S;=`$d<%lO$RZ;oS$tPlQOy$Rz;'S$R;'S;=`$d<%lO$RZQSfROy$Rz;'S$R;'S;=`$d<%lO$R~>cOe~_>jU$mPlQOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RZ?TWlQ!aPOy$Rz!O$R!O!P?m!P!Q$R!Q![Br![;'S$R;'S;=`$d<%lO$RZ?rUyWOy$Rz!Q$R!Q![@U![;'S$R;'S;=`$d<%lO$RZ@]YyW$oROy$Rz!Q$R!Q![@U![!g$R!g!h@{!h#X$R#X#Y@{#Y;'S$R;'S;=`$d<%lO$RZAQYyWOy$Rz{$R{|Ap|}$R}!OAp!O!Q$R!Q![BX![;'S$R;'S;=`$d<%lO$RZAuUyWOy$Rz!Q$R!Q![BX![;'S$R;'S;=`$d<%lO$RZB`UyW$oROy$Rz!Q$R!Q![BX![;'S$R;'S;=`$d<%lO$RZBy[yW$oROy$Rz!O$R!O!P@U!P!Q$R!Q![Br![!g$R!g!h@{!h#X$R#X#Y@{#Y;'S$R;'S;=`$d<%lO$RZCtSvROy$Rz;'S$R;'S;=`$d<%lO$RZDVWlQOy$Rz!O$R!O!P?m!P!Q$R!Q![Br![;'S$R;'S;=`$d<%lO$RZDtW$pROy$Rz!O$R!O!PE^!P!Q$R!Q![@U![;'S$R;'S;=`$d<%lO$RYEcUyWOy$Rz!O$R!O!PEu!P;'S$R;'S;=`$d<%lO$RYE|SuQyWOy$Rz;'S$R;'S;=`$d<%lO$RYF_SlQOy$Rz;'S$R;'S;=`$d<%lO$RZFp[$oROy$Rz!O$R!O!P@U!P!Q$R!Q![Br![!g$R!g!h@{!h#X$R#X#Y@{#Y;'S$R;'S;=`$d<%lO$RZGkUtROy$Rz![$R![!]G}!];'S$R;'S;=`$d<%lO$RXHUS}PyWOy$Rz;'S$R;'S;=`$d<%lO$RZHgS!lROy$Rz;'S$R;'S;=`$d<%lO$RYHxUlQOy$Rz!_$R!_!`%c!`;'S$R;'S;=`$d<%lO$R^IaU![SOy$Rz!_$R!_!`%c!`;'S$R;'S;=`$d<%lO$RZIzV!^PlQOy$Rz!_$R!_!`%c!`!aJa!a;'S$R;'S;=`$d<%lO$RXJhS!^PyWOy$Rz;'S$R;'S;=`$d<%lO$RXJwWOy$Rz!c$R!c!}Ka!}#T$R#T#oKa#o;'S$R;'S;=`$d<%lO$RXKh[!oPyWOy$Rz}$R}!OKa!O!Q$R!Q![Ka![!c$R!c!}Ka!}#T$R#T#oKa#o;'S$R;'S;=`$d<%lO$RXLcS!YPOy$Rz;'S$R;'S;=`$d<%lO$R^LtS!WUOy$Rz;'S$R;'S;=`$d<%lO$R[MTUOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RZMjUOy$Rz#b$R#b#cM|#c;'S$R;'S;=`$d<%lO$RZNRUyWOy$Rz#W$R#W#XNe#X;'S$R;'S;=`$d<%lO$RZNlSmRyWOy$Rz;'S$R;'S;=`$d<%lO$RZN{UOy$Rz#f$R#f#gNe#g;'S$R;'S;=`$d<%lO$RZ! dS!eROy$Rz;'S$R;'S;=`$d<%lO$RZ! uS!mROy$Rz;'S$R;'S;=`$d<%lO$R]!!WU!aPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!!mP;=`<%l#r",tokenizers:[iO,oO,lO,dO,RO,tO,nO,rO,0,1,2,3],topRules:{StyleSheet:[0,10],Styles:[1,134]},dialects:{indented:0},specialized:[{term:158,get:O=>XO[O]||-1},{term:157,get:O=>yO[O]||-1},{term:77,get:O=>PO[O]||-1}],tokenPrec:3003}),y=v.define({name:"sass",parser:mO.configure({props:[g.add({Block:V,Comment(O,e){return{from:O.from+2,to:e.sliceDoc(O.to-2,O.to)=="*/"?O.to-2:O.to}}}),U.add({Declaration:b()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),kO=y.configure({dialect:"indented",props:[U.add({"Block RuleSet":O=>O.baseIndent+O.unit}),g.add({Block:O=>({from:O.from,to:O.to})})]}),fO=q(O=>O.name=="VariableName"||O.name=="SassVariableName");function _O(O){return new E(O!=null&&O.indented?kO:y,y.data.of({autocomplete:fO}))}export{_O as sass,fO as sassCompletionSource,y as sassLanguage}; diff --git a/assets/index-DHgdPR2R.js b/assets/index-DHgdPR2R.js deleted file mode 100644 index 9544cd2..0000000 --- a/assets/index-DHgdPR2R.js +++ /dev/null @@ -1 +0,0 @@ -import{E as a,s as o,t as Q,b as Z,L as _,i as q,c as r,f as l,k as w,a as V}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const R=1,g=2,b=3,y=4,T=5,s=98,c=101,p=102,t=114,v=69,X=48,W=46,d=43,f=45,Y=35,z=34,x=124,U=60,h=62;function n(O){return O>=48&&O<=57}function e(O){return n(O)||O==95}const G=new a((O,i)=>{if(n(O.next)){let P=!1;do O.advance();while(e(O.next));if(O.next==W){if(P=!0,O.advance(),n(O.next))do O.advance();while(e(O.next));else if(O.next==W||O.next>127||/\w/.test(String.fromCharCode(O.next)))return}if(O.next==c||O.next==v){if(P=!0,O.advance(),(O.next==d||O.next==f)&&O.advance(),!e(O.next))return;do O.advance();while(e(O.next))}if(O.next==p){let $=O.peek(1);if($==X+3&&O.peek(2)==X+2||$==X+6&&O.peek(2)==X+4)O.advance(3),P=!0;else return}P&&O.acceptToken(T)}else if(O.next==s||O.next==t){if(O.next==s&&O.advance(),O.next!=t)return;O.advance();let P=0;for(;O.next==Y;)P++,O.advance();if(O.next!=z)return;O.advance();O:for(;;){if(O.next<0)return;let $=O.next==z;if(O.advance(),$){for(let S=0;S{O.next==x&&O.acceptToken(R,1)}),u=new a(O=>{O.next==U?O.acceptToken(g,1):O.next==h&&O.acceptToken(b,1)}),k=o({"const macro_rules struct union enum type fn impl trait let static":Q.definitionKeyword,"mod use crate":Q.moduleKeyword,"pub unsafe async mut extern default move":Q.modifier,"for if else loop while match continue break return await":Q.controlKeyword,"as in ref":Q.operatorKeyword,"where _ crate super dyn":Q.keyword,self:Q.self,String:Q.string,Char:Q.character,RawString:Q.special(Q.string),Boolean:Q.bool,Identifier:Q.variableName,"CallExpression/Identifier":Q.function(Q.variableName),BoundIdentifier:Q.definition(Q.variableName),"FunctionItem/BoundIdentifier":Q.function(Q.definition(Q.variableName)),LoopLabel:Q.labelName,FieldIdentifier:Q.propertyName,"CallExpression/FieldExpression/FieldIdentifier":Q.function(Q.propertyName),Lifetime:Q.special(Q.variableName),ScopeIdentifier:Q.namespace,TypeIdentifier:Q.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":Q.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":Q.macroName,'"!"':Q.macroName,UpdateOp:Q.updateOperator,LineComment:Q.lineComment,BlockComment:Q.blockComment,Integer:Q.integer,Float:Q.float,ArithOp:Q.arithmeticOperator,LogicOp:Q.logicOperator,BitOp:Q.bitwiseOperator,CompareOp:Q.compareOperator,"=":Q.definitionOperator,".. ... => ->":Q.punctuation,"( )":Q.paren,"[ ]":Q.squareBracket,"{ }":Q.brace,". DerefOp":Q.derefOperator,"&":Q.operator,", ; ::":Q.separator,"Attribute/...":Q.meta}),j={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},E=Z.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#HkO)xQWO'#DpOOQR'#Iw'#IwO)xQWO'#DpO*ZQWO'#DpOOQO'#Iv'#IvO,SQWO'#J`O,ZQWO'#EiOOQV'#Hp'#HpO,cQYO'#F{OOQV'#El'#ElOOQV'#Em'#EmOOQV'#En'#EnO.YQ_O'#EkO0_Q_O'#EoO2gQWOOO4QQ_O'#FPO7hQWO'#J`OOQV'#FY'#FYO7{Q_O'#F^O:WQ_O'#FaOOQO'#F`'#F`O=sQ_O'#FcO=}Q_O'#FbO@VQWO'#FgOOQO'#J`'#J`OOQV'#Io'#IoOA]Q_O'#InOEPQWO'#InOOQV'#Fw'#FwOF[QWO'#JuOFcQWO'#F|OOQO'#IO'#IOOGrQWO'#GhOOQV'#Im'#ImOOQV'#Il'#IlOOQV'#Hj'#HjQGyQ_OOOKeQ_O'#DUOKlQYO'#CqOOQP'#I_'#I_OOQV'#Hg'#HgQ]Q_OOOLuQWO'#I`ONsQYO'#DXO!!eQWO'#JuO!!lQWO'#JuO!!vQ_O'#DfO!%]Q_O'#E}O!(sQ_O'#FWO!,ZQWO'#FZO!.^QXO'#FbO!.cQ_O'#EeO!!vQ_O'#FmO!0uQWO'#FoO!0zQWO'#FoO!1PQ^O'#FqO!1WQWO'#JuO!1_QWO'#FtO!1dQWO'#FxO!2WQWO'#JjO!2_QWO'#GOO!2_QWO'#G`O!2_QWO'#GbO!2_QWO'#GsOOQO'#Ju'#JuO!2dQWO'#GhO!2lQYO'#GpO!2_QWO'#GqO!3uQ^O'#GtO!3|QWO'#GuO!4hQWO'#HOP!4sOpO'#CcPOOO)CC})CC}OOOO'#Hi'#HiO!5OO`O,59iOOQV,59i,59iO!5ZQYO,5?aOOQO-E;i-E;iOOQO,5:[,5:[OOQP,59Z,59ZO)xQWO,5:[O)xQWO,5:[O!5oQWO,5?kO!5zQYO,5;qO!6PQYO,5;TO!6hQWO,59QO!7kQXO'#CnO!7xQXO'#I`O!9SQWO'#CoO,^QWO'#EiOOQV-E;n-E;nO!9eQWO'#FsOOQV,5WQWO,5:fOOQP,5:h,5:hO!1PQ^O,5:hO!1PQ^O,5:mO$>]QYO,5gQ_O'#HsO$>tQXO,5@QOOQV1G1i1G1iOOQP,5:e,5:eO$>|QXO,5]QYO,5=vO$LRQWO'#KRO$L^QWO,5=xOOQR,5=y,5=yO$LcQWO,5=zO$>]QYO,5>PO$>]QYO,5>POOQO1G.w1G.wO$>]QYO1G.wO$LnQYO,5=pO$LvQZO,59^OOQR,59^,59^O$>]QYO,5=wO% YQZO,5=}OOQR,5=},5=}O%#lQWO1G/_O!6PQYO1G/_O#FYQYO1G2vO%#qQWO1G2vO%$PQYO1G2vOOQV1G/i1G/iO%%YQWO,5:SO%%bQ_O1G/lO%*kQWO1G1^O%+RQWO1G1hOOQO1G1h1G1hO$>]QYO1G1hO%+iQ^O'#EgOOQV1G0k1G0kOOQV1G1s1G1sO!!vQ_O1G1sO!0zQWO1G1uO!1PQ^O1G1wO!.cQ_O1G1wOOQP,5:j,5:jO$>]QYO1G/^OOQO'#Cn'#CnO%+vQWO1G1zOOQV1G2O1G2OO%,OQWO'#CnO%,WQWO1G3TO%,]QWO1G3TO%,bQYO'#GQO%,sQWO'#G]O%-UQYO'#G_O%.hQYO'#GXOOQV1G2U1G2UO%/wQWO1G2UO%/|QWO1G2UO$ARQWO1G2UOOQV1G2f1G2fO%/wQWO1G2fO#CpQWO1G2fO%0UQWO'#GdOOQV1G2h1G2hO%0gQWO1G2hO#C{QWO1G2hO%0lQYO'#GSO$>]QYO1G2lO$AdQWO1G2lOOQV1G2y1G2yO%1xQWO1G2yO%3hQ^O'#GkO%3rQWO1G2nO#DfQWO1G2nO%4QQYO,5]QYO1G2vOOQV1G2w1G2wO%5tQWO1G2wO%5yQWO1G2wO#HXQWO1G2wOOQV1G2z1G2zO.YQ_O1G2zO$>]QYO1G2zO%6RQWO1G2zOOQO,5>l,5>lOOQO-E]QYO1G3UPOOO-E;d-E;dPOOO1G.i1G.iOOQO7+*g7+*gO%7VQYO'#IcO%7nQYO'#IfO%7yQYO'#IfO%8RQYO'#IfO%8^QYO,59eOOQO7+%b7+%bOOQP7+$a7+$aO%8cQ!fO'#JTOOQS'#EX'#EXOOQS'#EY'#EYOOQS'#EZ'#EZOOQS'#JT'#JTO%;UQWO'#EWOOQS'#E`'#E`OOQS'#JR'#JROOQS'#Hn'#HnO%;ZQ!fO,5:oOOQV,5:o,5:oOOQV'#JQ'#JQO%;bQ!fO,5:{OOQV,5:{,5:{O%;iQ!fO,5:|OOQV,5:|,5:|OOQV7+'e7+'eOOQV7+&Z7+&ZO%;pQ!fO,59TOOQO,59T,59TO%>YQWO7+$WO%>_QWO1G1yOOQV1G1y1G1yO!9SQWO1G.uO%>dQWO,5?}O%>nQ_O'#HqO%@|QWO,5?}OOQO1G1X1G1XOOQO7+&}7+&}O%AUQWO,5>^OOQO-E;p-E;pO%AcQWO7+'OO.YQ_O7+'OOOQO7+'O7+'OOOQO7+'P7+'PO%AjQWO7+'POOQO7+'W7+'WOOQP1G0V1G0VO%ArQXO1G/tO!M{QWO1G/tO%BsQXO1G0RO%CkQ^O'#HlO%C{QWO,5?eOOQP1G/u1G/uO%DWQWO1G/uO%D]QWO'#D_OOQO'#Dt'#DtO%DhQWO'#DtO%DmQWO'#I{OOQO'#Iz'#IzO%DuQWO,5:_O%DzQWO'#DtO%EPQWO'#DtOOQP1G0Q1G0QOOQP1G0S1G0SOOQP1G0X1G0XO%EXQXO1G1jO%EdQXO'#FeOOQP,5>_,5>_O!1PQ^O'#FeOOQP-E;q-E;qO$>]QYO1G1jOOQO7+'S7+'SOOQO,5]QYO7+$xOOQV7+'j7+'jO%FsQWO7+(oO%FxQWO7+(oOOQV7+'p7+'pO%/wQWO7+'pO%F}QWO7+'pO%GVQWO7+'pOOQV7+(Q7+(QO%/wQWO7+(QO#CpQWO7+(QOOQV7+(S7+(SO%0gQWO7+(SO#C{QWO7+(SO$>]QYO7+(WO%GeQWO7+(WO#HUQYO7+(cO%GjQWO7+(YO#DfQWO7+(YOOQV7+(c7+(cO%5tQWO7+(cO%5yQWO7+(cO#HXQWO7+(cOOQV7+(g7+(gO$>]QYO7+(pO%GxQWO7+(pO!1dQWO7+(pOOQV7+$v7+$vO%G}QWO7+$vO%HSQZO1G3ZO%JfQWO1G4jOOQO1G4j1G4jOOQR1G.}1G.}O#.WQWO1G.}O%JkQWO'#KQOOQO'#HW'#HWO%J|QWO'#HXO%KXQWO'#KQOOQO'#KP'#KPO%KaQWO,5=qO%KfQYO'#H[O%LrQWO'#GmO%L}QYO'#CtO%MXQWO'#GmO$>]QYO1G3ZOOQR1G3g1G3gO#7aQWO1G3ZO%M^QZO1G3bO$>]QYO1G3bO& mQYO'#IVO& }QWO,5@mOOQR1G3d1G3dOOQR1G3f1G3fO.YQ_O1G3fOOQR1G3k1G3kO&!VQYO7+$cO&!_QYO'#KOOOQQ'#J}'#J}O&!gQYO1G3[O&!lQZO1G3cOOQQ7+$y7+$yO&${QWO7+$yO&%QQWO7+(bOOQV7+(b7+(bO%5tQWO7+(bO$>]QYO7+(bO#FYQYO7+(bO&%YQWO7+(bO!.cQ_O1G/nO&%hQWO7+%WO$?[QWO7+'SO&%pQWO'#EhO&%{Q^O'#EhOOQU'#Ho'#HoO&%{Q^O,5;ROOQV,5;R,5;RO&&VQWO,5;RO&&[Q^O,5;RO!0zQWO7+'_OOQV7+'a7+'aO&&iQWO7+'cO&&qQWO7+'cO&&xQWO7+$xO&'TQ!fO7+'fO&'[Q!fO7+'fOOQV7+(o7+(oO!1dQWO7+(oO&'cQYO,5]QYO'#JrOOQO'#Jq'#JqO&*YQWO,5]QYO'#GUO&,SQYO'#JkOOQQ,5]QYO7+(YO&0SQYO'#HxO&0hQYO1G2WOOQQ1G2W1G2WOOQQ,5]QYO,5]QYO7+(fO&1dQWO'#IRO&1nQWO,5@hOOQO1G3Q1G3QOOQO1G2}1G2}OOQO1G3P1G3POOQO1G3R1G3ROOQO1G3S1G3SOOQO1G3O1G3OO&1vQWO7+(pO$>]QYO,59fO&2RQ^O'#ISO&2xQYO,5?QOOQR1G/P1G/PO&3QQ!bO,5:pO&3VQ!fO,5:rOOQS-E;l-E;lOOQV1G0Z1G0ZOOQV1G0g1G0gOOQV1G0h1G0hO&3^QWO'#JTOOQO1G.o1G.oOOQV<]O&3qQWO,5>]OOQO-E;o-E;oOOQO<WOOQO-E;j-E;jOOQP7+%a7+%aO!1PQ^O,5:`O&5cQWO'#HmO&5wQWO,5?gOOQP1G/y1G/yOOQO,5:`,5:`O&6PQWO,5:`O%DzQWO,5:`O$>]QYO,5`,5>`OOQO-E;r-E;rOOQV7+'l7+'lO&6yQWO<]QYO<]QYO<]QYO<]QYO7+(uOOQO7+*U7+*UOOQR7+$i7+$iO&8cQWO,5@lOOQO'#Gm'#GmO&8kQWO'#GmO&8vQYO'#IUO&8cQWO,5@lOOQR1G3]1G3]O&:cQYO,5=vO&;rQYO,5=XO&;|QWO,5=XOOQO,5=X,5=XOOQR7+(u7+(uO&eQZO7+(|O&@tQWO,5>qOOQO-E]QYO<]QYO,5]QYO,5@^O&D^QYO'#H|O&EsQWO,5@^OOQO1G2e1G2eO%,nQWO,5]QYO,5PO&I]QYO,5@VOOQV<]QYO,5=WO&KuQWO,5@cO&K}QWO,5@cO&MvQ^O'#IPO&KuQWO,5@cOOQO1G2q1G2qO&NTQWO,5=WO&N]QWO<oO&NvQYO,5>dO' UQYO,5>dOOQQ,5>d,5>dOOQQ-E;v-E;vOOQQ7+'r7+'rO' aQYO1G2]O$>]QYO1G2^OOQV<m,5>mOOQO-EnOOQQ,5>n,5>nO'!fQYO,5>nOOQQ-EX,5>XOOQO-E;k-E;kO!1PQ^O1G/zOOQO1G/z1G/zO'%oQWO1G/zO'%tQXO1G1kO$>]QYO1G1kO'&PQWO7+'[OOQVANA`ANA`O'&ZQWOANA`O$>]QYOANA`O'&cQWOANA`OOQVAN>OAN>OO.YQ_OAN>OO'&qQWOANAuOOQVAN@vAN@vO'&vQWOAN@vOOQVANAWANAWOOQVANAYANAYOOQVANA^ANA^O'&{QWOANA^OOQVANAiANAiO%5tQWOANAiO%5yQWOANAiO''TQWOANA`OOQVANAvANAvO.YQ_OANAvO''cQWOANAvO$>]QYOANAvOOQR<pOOQO'#HY'#HYO''vQWO'#HZOOQO,5>p,5>pOOQO-E]QYO<o,5>oOOQQ-E]QYOANAhO'(bQWO1G1rO')UQ^O1G0nO.YQ_O1G0nO'*zQWO,5;UO'+RQWO1G0nP'+WQWO'#ERP&%{Q^O'#HpOOQV7+&X7+&XO'+cQWO7+&XO&&qQWOAN@iO'+hQWOAN>OO!5oQWO,5a,5>aO'+oQWOAN@lO'+tQWOAN@lOOQS-E;s-E;sOOQVAN@lAN@lO'+|QWOAN@lOOQVANAuANAuO',UQWO1G5vO',^QWO1G2dO$>]QYO1G2dO&'|QWO,5>gOOQO,5>g,5>gOOQO-E;y-E;yO',iQWO1G5xO',qQWO1G5xO&(nQYO,5>hO',|QWO,5>hO$>]QYO,5>hOOQO-E;z-E;zO'-XQWO'#JnOOQO1G2a1G2aOOQO,5>f,5>fOOQO-E;x-E;xO&'cQYO,5iOOQO,5>i,5>iOOQO-E;{-E;{OOQQ,5>c,5>cOOQQ-E;u-E;uO'.pQWO1G2sO'/QQWO1G2rO'/]QWO1G5}O'/eQ^O,5>kOOQO'#Go'#GoOOQO,5>k,5>kO'/lQWO,5>kOOQO-E;}-E;}O$>]QYO1G2rO'/zQYO7+'xO'0VQWOANAlOOQVANAlANAlO.YQ_OANAlO'0^QWOANAvOOQS7+%x7+%xO'0eQWO7+%xO'0pQ!fO7+%xO'0}QWO7+%fO!1PQ^O7+%fO'1YQXO7+'VOOQVG26zG26zO'1eQWOG26zO'1sQWOG26zO$>]QYOG26zO'1{QWOG23jOOQVG27aG27aOOQVG26bG26bOOQVG26xG26xOOQVG27TG27TO%5tQWOG27TO'2SQWOG27bOOQVG27bG27bO.YQ_OG27bO'2ZQWOG27bOOQO1G4[1G4[OOQO7+(_7+(_OOQRANA{ANA{OOQVG27SG27SO%5tQWOG27SO&0uQWOG27SO'2fQ^O7+&YO'4PQWO7+'^O'4sQ^O7+&YO.YQ_O7+&YP.YQ_O,5;SP'6PQWO,5;SP'6UQWO,5;SOOQV<]QYO1G4SO%,nQWO'#HyO'7UQWO,5@YO'7dQWO7+(VO.YQ_O7+(VOOQO1G4T1G4TOOQO1G4V1G4VO'7nQWO1G4VO'7|QWO7+(^OOQVG27WG27WO'8XQWOG27WOOQS<e,5>eOOQO-E;w-E;wO'?rQWO<wD_DpPDvHQPPPPPPK`P! P! _PPPPP!!VP!$oP!$oPP!&oP!(rP!(w!)n!*f!*f!*f!(w!+]P!(w!.Q!.TPP!.ZP!(w!(w!(w!(wP!(w!(wP!(w!(w!.y!/dP!/dJ}J}J}PPPP!/d!.y!/sPP!$oP!0^!0a!0g!1h!1t!3t!3t!5r!7t!1t!1t!9p!;_!=O!>k!@U!Am!CS!De!1t!1tP!1tP!1t!1t!Et!1tP!Ge!1t!1tP!Ie!1tP!1t!7t!7t!1t!7t!1t!Kl!Mt!Mw!7t!1t!Mz!M}!M}!M}!NR!$oP!$oP!$oP! P! PP!N]! P! PP!Ni# }! PP! PP#!^##c##k#$Z#$_#$e#$e#$mP#&s#&s#&y#'o#'{! PP! PP#(]#(l! PP! PPP#(x#)W#)d#)|#)^! P! PP! P! P! PP#*S#*S#*Y#*`#*S#*S! P! PP#*m#*v#+Q#+Q#,x#.l#.x#.x#.{#.{5a5a5a5a5a5a5a5aP5a#/O#/U#/p#1{#2R#2b#6^#6d#6j#6|#7W#8w#9R#9b#9h#9n#9x#:S#:Y#:g#:m#:s#:}#;]#;g#=u#>R#>`#>f#>n#>u#?PPPPPPPP#?V#BaP#F^#Jx#Ls#Nr$&^P$&aPPP$)_$)h$)z$/U$1d$1m$3fP!(w$4`$7r$:i$>T$>^$>c$>fPPP$>i$A`$A|P$BaPPPPPPPPPP$BvP$EU$EX$E[$Eb$Ee$Eh$Ek$En$Et$HO$HR$HU$HX$H[$H_$Hb$He$Hh$Hk$Hn$Jt$Jw$Jz#*S$KW$K^$Ka$Kd$Kh$Kl$Ko$KrQ!tPT'V!s'Wi!SOlm!P!T$T$W$y%b)U*f/gQ'i#QR,n'l(OSOY[bfgilmop!O!P!T!Y!Z![!_!`!c!p!q!|!}#Q#U#Z#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$`$a$e$g$h$q$r$y%X%_%b&U&Y&[&b&u&z&|'P'a'l'n'o'}(W(Y(b(d(e(f(j(o(p(r(|)S)U)i*Z*f*i*k*l+Z+n+z,q,s,z-R-T-g-m-t.}/^/b/d/g0e0g0m0}1P1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9s9t9u9v9w9x9z9{9|9}:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f:gS(z$v-oQ*p&eQ*t&hQ-k(yQ-y)ZW0Z+Q0Y4Z7UR4Y0[&w!RObfgilmop!O!P!T!Y!Z![!_!`!c!p#Q#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$e$g$h$q$r$y%_%b&U&Y&[&b&u'l'}(W(Y(b(f(j(o(p(r(|)S)U)i*Z*f*i*k*l+Z+n,s,z-T-g-m-t.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f#r]Ofgilmp!O!P!T!Z![#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i+n,s,z-m.}0}1h1|3_3a3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9hb#[b#Q$y'l(b)S)U*Z-t!h$bo!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7m$b%k!Q!n$O$u%o%p%q%y%{&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g!W:y!Y!_!`*i*l/^3h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fR:|%n$_%u!Q!n$O$u%o%p%q&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g$e%l!Q!n$O$u%n%o%p%q%y%{&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g'hZOY[fgilmop!O!P!T!Y!Z![!_!`!c!p!|!}#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$`$a$e$g$h$q$r%_%b%i%j&U&Y&[&b&u'a'}(W(Y(d(e(f(j(o(p(r(|)i)p)q*f*i*k*l+Z+n,s,z-R-T-g-m.i.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9s9t9u9v9w9x9z9{9|9}:O:P:Q:R:S:T:U:V:W:X:Y:Z:`:a:e:f:g:t:u:x$^%l!Q!n$O$u%n%o%p%q%y%{&P&p&r(q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gQ&j!hQ&k!iQ&l!jQ&m!kQ&s!oQ)[%QQ)]%RQ)^%SQ)_%TQ)b%WQ+`&oS,R']1ZQ.W)`S/r*u4TR4n0s+yTOY[bfgilmop!O!P!Q!T!Y!Z![!_!`!c!n!p!q!|!}#Q#U#Z#e#o#p#q#r#s#t#u#v#w#x#y#z#}$O$T$W$`$a$e$g$h$q$r$u$y%X%_%b%i%j%n%o%p%q%y%{&P&U&Y&[&b&o&p&r&u&z&|'P']'a'l'n'o'}(W(Y(b(d(e(f(j(o(p(q(r(|)S)U)i)p)q)s)x)y*O*P*R*V*Z*[*^*e*f*i*k*l*n*w*x+U+V+Z+h+n+o+z+},q,s,z-R-T-g-i-m-t-v.U.`.i.p.t.x.y.}/Z/[/^/b/d/g/{/}0`0e0g0m0r0w0}1O1P1Y1Z1h1r1y1|2a2h2j2m2s2v3V3_3a3f3h3k3u3{3|4R4U4W4_4c4e4h4t4v4|5[5`5d5g5t5v6R6Y6]6a6p6v6x7S7^7c7g7m7r7{8W8X8g8k8|9U9h9s9t9u9v9w9x9z9{9|9}:O:P:Q:R:S:T:U:V:W:X:Y:Z:`:a:e:f:g:t:u:xQ'[!xQ'h#PQ)l%gU)r%m*T*WR.f)kQ,T']R5P1Z#t%s!Q!n$O$u%p%q&P&p&r(q)x)y*O*R*V*[*^*e*n*w+V+h+o+}-i-v.U.`.t.x.y/Z/[/{/}0`0r0w1O1Y1y2a2h2j2m2v3V3u3{3|4U4e4t5`5d5v6R6Y6p6v6x7c7r8gQ)x%oQ+_&oQ,U']n,^'b'c'd,c,f,h,l/m/n1_3n3q5T5U7kS.q)s2sQ/O*PQ/Q*SQ/q*uS0Q*x4RQ0a+U[0o+Z.j0g4h5y7^Q2v.pS4d0e2rQ4m0sQ5Q1ZQ6T3RQ6z4PQ7O4TQ7X4_R9Y8h&jVOfgilmop!O!P!T!Y!Z![!_!`!c!p#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$e$g$h$q$r%_%b&U&Y&[&b&u']'}(W(Y(b(f(j(o(p(r(|)i*f*i*k*l+Z+n,s,z-T-g-m.}/^/b/d/g0e0g0m0}1Z1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fU&g!g%P%[o,^'b'c'd,c,f,h,l/m/n1_3n3q5T5U7k$nsOfgilm!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y'}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9z9{:O:P:Q:R:S:T:U:V:W:X:Y:eS$tp9xS&O!W#bS&Q!X#cQ&`!bQ*_&RQ*a&VS*d&[:fQ*h&^Q,T']Q-j(wQ/i*jQ0p+[S2f.X0qQ3]/_Q3^/`Q3g/hQ3i/kQ5P1ZU5b2R2g4lU7o5c5e5rQ8]6dS8u7p7qS9_8v8wR9i9`i{Ob!O!P!T$y%_%b)S)U)i-thxOb!O!P!T$y%_%b)S)U)i-tW/v*v/t3w6qQ/}*wW0[+Q0Y4Z7UQ3{/{Q6x3|R8g6v!h$do!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mQ&d!dQ&f!fQ&n!mW&x!q%X&|1PQ'S!rQ)X$}Q)Y%OQ)a%VU)d%Y'T'UQ*s&hS+s&z'PS-Y(k1sQ-u)WQ-x)ZS.a)e)fS0x+c/sQ1S+zQ1W+{S1v-_-`Q2k.bQ3s/pQ5]1xR5h2V${sOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f$zsOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fR3]/_V&T!Y!`*i!i$lo!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7m!k$^o!c!p$e$g$h$q$r&U&b&u(b(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7m!i$co!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7m&e^Ofgilmop!O!P!T!Y!Z![!_!`!c!p#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$e$g$h$q$r%_%b&U&Y&[&b&u'}(W(Y(f(j(o(p(r(|)i*f*i*k*l+Z+n,s,z-T-g-m.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fR(l$fQ-[(kR5Y1sQ(S#|S({$v-oS-Z(k1sQ-l(yW/u*v/t3w6qS1w-_-`Q3v/vR5^1xQ'e#Or,e'b'c'd'j'p)u,c,f,h,l/m/n1_3n3q5U6fR,o'mk,a'b'c'd,c,f,h,l/m/n1_3n3q5UQ'f#Or,e'b'c'd'j'p)u,c,f,h,l/m/n1_3n3q5U6fR,p'mR*g&]X/c*f/d/g3f!}aOb!O!P!T#z$v$y%_%b'}(y)S)U)i)s*f*v*w+Q+Z,s-o-t.j/b/d/g/t/{0Y0g1h2s3f3w3|4Z4h5y6a6q6v7U7^Q3`/aQ6_3bQ8Y6`R9V8Z${rOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f#nfOfglmp!O!P!T!Z![#e#o#p#q#r#s#t#u#v#w#x#z#}$T$W%_%b&Y&['}(W(Y(|)i+n,s,z-m.}0}1h1|3_3a3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h!T9u!Y!_!`*i*l/^3h9u9v9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:e:f#rfOfgilmp!O!P!T!Z![#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i+n,s,z-m.}0}1h1|3_3a3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h!X9u!Y!_!`*i*l/^3h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f$srOfglmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:e:f#U#oh#d$P$Q$V$s%^&W&X'q't'u'v'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9b}:P&S&]/k3[6d:[:]:c:d:h:j:k:l:m:n:o:p:q:r:v:w:{#W#ph#d$P$Q$V$s%^&W&X'q'r't'u'v'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9b!P:Q&S&]/k3[6d:[:]:c:d:h:i:j:k:l:m:n:o:p:q:r:v:w:{#S#qh#d$P$Q$V$s%^&W&X'q'u'v'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9b{:R&S&]/k3[6d:[:]:c:d:h:k:l:m:n:o:p:q:r:v:w:{#Q#rh#d$P$Q$V$s%^&W&X'q'v'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9by:S&S&]/k3[6d:[:]:c:d:h:l:m:n:o:p:q:r:v:w:{#O#sh#d$P$Q$V$s%^&W&X'q'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9bw:T&S&]/k3[6d:[:]:c:d:h:m:n:o:p:q:r:v:w:{!|#th#d$P$Q$V$s%^&W&X'q'x'y'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9bu:U&S&]/k3[6d:[:]:c:d:h:n:o:p:q:r:v:w:{!x#vh#d$P$Q$V$s%^&W&X'q'z'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9bq:W&S&]/k3[6d:[:]:c:d:h:p:q:r:v:w:{!v#wh#d$P$Q$V$s%^&W&X'q'{'|(O(U([(`*b*c,r,w,y-n0z1i1l1}3P4w5V5a6^6e7R7e7h7s7y8j8q8{9[9bo:X&S&]/k3[6d:[:]:c:d:h:q:r:v:w:{$]#{h#`#d$P$Q$V$s%^&S&W&X&]'q'r's't'u'v'w'x'y'z'{'|(O(U([(`*b*c,r,w,y-n/k0z1i1l1}3P3[4w5V5a6^6d6e7R7e7h7s7y8j8q8{9[9b:[:]:c:d:h:i:j:k:l:m:n:o:p:q:r:v:w:{${jOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f$v!aOfgilmp!O!P!T!Y!Z!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fQ&Y![Q&Z!]R:e9{#rpOfgilmp!O!P!T!Z![#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i+n,s,z-m.}0}1h1|3_3a3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9hQ&[!^!W9x!Y!_!`*i*l/^3h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fR:f:zR$moR-f(rR$wqT(}$v-oQ/f*fS3d/d/gR6c3fQ3m/mQ3p/nQ6i3nR6l3qQ$zwQ)V${Q*q&fQ+f&qQ+i&sQ-w)YW.Z)b+j+k+lS/X*]+gW2b.W.[.].^U3W/Y/]0yU5o2c2d2eS6W3X3ZS7w5p5qS8Q6V6XQ8y7xS8}8R8SR9c9O^|O!O!P!T%_%b)iX)R$y)S)U-tQ&r!nQ*^&PQ*|&jQ+P&kQ+T&lQ+W&mQ+]&nQ+l&sQ-})[Q.Q)]Q.T)^Q.V)_Q.Y)aQ.^)bQ2S-uQ2e.WR4U0VU+a&o*u4TR4o0sQ+Y&mQ+k&sS.])b+l^0v+_+`/q/r4m4n7OS2d.W.^S4Q0R0SR5q2eS0R*x4RQ0a+UR7X4_U+d&o*u4TR4p0sQ*z&jQ+O&kQ+S&lQ+g&qQ+j&sS-{)[*|S.P)]+PS.S)^+TU.[)b+k+lQ/Y*]Q0X*{Q0q+[Q2X-|Q2Y-}Q2].QQ2_.TU2c.W.].^Q2g.XS3Z/]0yS5c2R4lQ5j2ZS5p2d2eQ6X3XS7q5e5rQ7x5qQ8R6VQ8v7pQ9O8SR9`8wQ0T*xR6|4RQ*y&jQ*}&kU-z)[*z*|U.O)]+O+PS2W-{-}S2[.P.QQ4X0ZQ5i2YQ5k2]R7T4YQ/w*vQ3t/tQ6r3wR8d6qQ*{&jS-|)[*|Q2Z-}Q4X0ZR7T4YQ+R&lU.R)^+S+TS2^.S.TR5l2_Q0]+QQ4V0YQ7V4ZR8l7UQ+[&nS.X)a+]S2R-u.YR5e2SQ0i+ZQ4f0gQ7`4hR8m7^Q.m)sQ0i+ZQ2p.jQ4f0gQ5|2sQ7`4hQ7}5yR8m7^Q0i+ZR4f0gX'O!q%X&|1PX&{!q%X&|1PW'O!q%X&|1PS+u&z'PR1U+z_|O!O!P!T%_%b)iQ%a!PS)h%_%bR.d)i$^%u!Q!n$O$u%o%p%q&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gQ*U%yR*X%{$c%n!Q!n$O$u%o%p%q%y%{&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gW)t%m%x*T*WQ.e)jR2{.vR.m)sR5|2sQ'W!sR,O'WQ!TOQ$TlQ$WmQ%b!P[%|!T$T$W%b)U/gQ)U$yR/g*f$b%i!Q!n$O$u%o%p%q%y%{&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g[)n%i)p.i:`:t:xQ)p%jQ.i)qQ:`%nQ:t:aR:x:uQ!vUR'Y!vS!OO!TU%]!O%_)iQ%_!PR)i%b#rYOfgilmp!O!P!T!Z![#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i+n,s,z-m.}0}1h1|3_3a3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9hh!yY!|#U$`'a'n(d,q-R9s9|:gQ!|[b#Ub#Q$y'l(b)S)U*Z-t!h$`o!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mQ'a!}Q'n#ZQ(d$aQ,q'oQ-R(e!W9s!Y!_!`*i*l/^3h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fQ9|9tR:g9}Q-U(gR1p-UQ1t-[R5Z1tQ,c'bQ,f'cQ,h'dW1`,c,f,h5UR5U1_Q/d*fS3c/d3fR3f/gfbO!O!P!T$y%_%b)S)U)i-tp#Wb'}(y.j/b/t/{0Y0g1h5y6a6q6v7U7^Q'}#zS(y$v-oQ.j)sW/b*f/d/g3fQ/t*vQ/{*wQ0Y+QQ0g+ZQ1h,sQ5y2sQ6q3wQ6v3|Q7U4ZR7^4hQ,t(OQ1g,rT1j,t1gS(X$Q([Q(^$VU,x(X(^,}R,}(`Q(s$mR-h(sQ-p)OR2P-pQ3n/mQ3q/nT6j3n3qQ)S$yS-r)S-tR-t)UQ4`0aR7Y4``0t+^+_+`+a+d/q/r7OR4q0tQ8i6zR9Z8iQ4S0TR6}4SQ3x/wQ6n3tT6s3x6nQ3}/|Q6t3zU6y3}6t8eR8e6uQ4[0]Q7Q4VT7W4[7QhzOb!O!P!T$y%_%b)S)U)i-tQ$|xW%Zz$|%f)v$b%f!Q!n$O$u%o%p%q%y%{&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR)v%nS4i0i0nS7]4f4gT7b4i7]W&z!q%X&|1PS+r&z+zR+z'PQ1Q+wR4z1QU1[,S,T,UR5R1[S3S/Q7OR6U3SQ2t.mQ5x2pT5}2t5xQ.z)zR3O.z^_O!O!P!T%_%b)iY#Xb$y)S)U-t$l#_fgilmp!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W&Y&['}(W(Y(|*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f!h$io!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mS'j#Q'lQ-P(bR/V*Z&v!RObfgilmop!O!P!T!Y!Z![!_!`!c!p#Q#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$e$g$h$q$r$y%_%b&U&Y&[&b&u'l'}(W(Y(b(f(j(o(p(r(|)S)U)i*Z*f*i*k*l+Z+n,s,z-T-g-m-t.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f[!{Y[#U#Z9s9tW&{!q%X&|1P['`!|!}'n'o9|9}S(c$`$aS+t&z'PU,X'a,q:gS-Q(d(eQ1T+zR1n-RS%t!Q&oQ&q!nQ(V$OQ(w$uS)w%o.pQ)z%pQ)}%qS*]&P&rQ+e&pQ,S']Q-d(qQ.l)sU.w)x)y2vS/O*O*PQ/P*RQ/T*VQ/W*[Q/]*^Q/`*eQ/l*nQ/|*wS0S*x4RQ0a+UQ0c+VQ0y+hQ0{+oQ1X+}Q1{-iQ2T-vQ2`.UQ2i.`Q2z.tQ2|.xQ2}.yQ3X/ZQ3Y/[S3z/{/}Q4^0`Q4l0rQ4s0wQ4x1OQ4}1YQ5O1ZQ5_1yQ5n2aQ5r2hQ5u2jQ5w2mQ5{2sQ6V3VQ6o3uQ6u3{Q6w3|Q7P4UQ7X4_Q7[4eQ7d4tQ7n5`Q7p5dQ7|5vQ8P6RQ8S6YQ8c6pS8f6v6xQ8o7cQ8w7rR9X8g$^%m!Q!n$O$u%o%p%q&P&o&p&r'](q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gQ)j%nQ*T%yR*W%{$y%h!Q!n$O$u%i%j%n%o%p%q%y%{&P&o&p&r'](q)p)q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.i.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g:`:a:t:u:x'pWOY[bfgilmop!O!P!T!Y!Z![!_!`!c!p!|!}#Q#U#Z#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$`$a$e$g$h$q$r$y%_%b&U&Y&[&b&u'a'l'n'o'}(W(Y(b(d(e(f(j(o(p(r(|)S)U)i*Z*f*i*k*l+Z+n,q,s,z-R-T-g-m-t.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9s9t9u9v9w9x9z9{9|9}:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f:g$x%g!Q!n$O$u%i%j%n%o%p%q%y%{&P&o&p&r'](q)p)q)s)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.i.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8g:`:a:t:u:x_&y!q%X&z&|'P+z1PR,V']$zrOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f!j$]o!c!p$e$g$h$q$r&U&b&u(b(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mQ,T']R5P1Z_}O!O!P!T%_%b)i^|O!O!P!T%_%b)iQ#YbX)R$y)S)U-tbhO!O!T3_6]8W8X9U9hS#`f9uQ#dgQ$PiQ$QlQ$VmQ$spW%^!P%_%b)iU&S!Y!`*iQ&W!ZQ&X![Q&]!_Q'q#eQ'r#oS's#p:QQ't#qQ'u#rQ'v#sQ'w#tQ'x#uQ'y#vQ'z#wQ'{#xQ'|#yQ(O#zQ(U#}Q([$TQ(`$WQ*b&YQ*c&[Q,r'}Q,w(WQ,y(YQ-n(|Q/k*lQ0z+nQ1i,sQ1l,zQ1}-mQ3P.}Q3[/^Q4w0}Q5V1hQ5a1|Q6^3aQ6d3hQ6e3kQ7R4WQ7e4vQ7h4|Q7s5gQ7y5tQ8j7SQ8q7gQ8{7{Q9[8kQ9b8|Q:[9wQ:]9xQ:c9zQ:d9{Q:h:OQ:i:PQ:j:RQ:k:SQ:l:TQ:m:UQ:n:VQ:o:WQ:p:XQ:q:YQ:r:ZQ:v:eQ:w:fR:{9v^tO!O!P!T%_%b)i$`#afgilmp!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W&Y&['}(W(Y(|*i*l+n,s,z-m.}/^0}1h1|3a3h3k4W4v4|5g5t7S7g7{8k8|9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fQ6[3_Q8V6]Q9R8WQ9T8XQ9g9UR9m9hQ&V!YQ&^!`R/h*iQ$joQ&a!cQ&t!pU(g$e$g(jS(n$h0eQ(u$qQ(v$rQ*`&UQ*m&bQ+p&uQ-S(fS-b(o4cQ-c(pQ-e(rW/a*f/d/g3fQ/j*kW0f+Z0g4h7^Q1o-TQ1z-gQ3b/bQ4k0mQ5X1rQ7l5[Q8Z6aR8t7m!h$_o!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mR-P(b'qXOY[bfgilmop!O!P!T!Y!Z![!_!`!c!p!|!}#Q#U#Z#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$`$a$e$g$h$q$r$y%_%b&U&Y&[&b&u'a'l'n'o'}(W(Y(b(d(e(f(j(o(p(r(|)S)U)i*Z*f*i*k*l+Z+n,q,s,z-R-T-g-m-t.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9s9t9u9v9w9x9z9{9|9}:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f:g$zqOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f!i$fo!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7m&d^Ofgilmop!O!P!T!Y!Z![!_!`!c!p#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W$e$g$h$q$r%_%b&U&Y&[&b&u'}(W(Y(f(j(o(p(r(|)i*f*i*k*l+Z+n,s,z-T-g-m.}/^/b/d/g0e0g0m0}1h1r1|3_3a3f3h3k4W4c4h4v4|5[5g5t6]6a7S7^7g7m7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f[!zY[$`$a9s9t['_!|!}(d(e9|9}W)o%i%j:`:aU,W'a-R:gW.h)p)q:t:uT2o.i:xQ(i$eQ(m$gR-W(jV(h$e$g(jR-^(kR-](k$znOfgilmp!O!P!T!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W%_%b&Y&['}(W(Y(|)i*i*l+n,s,z-m.}/^0}1h1|3_3a3h3k4W4v4|5g5t6]7S7g7{8W8X8k8|9U9h9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:f!i$ko!c!p$e$g$h$q$r&U&b&u(f(j(o(p(r*f*k+Z-T-g/b/d/g0e0g0m1r3f4c4h5[6a7^7mS'g#O'pj,a'b'c'd,c,f,h,l/m/n1_3n3q5UQ,m'jQ.u)uR8_6f`,b'b'c'd,c,f,h1_5UQ1e,lX3l/m/n3n3qj,a'b'c'd,c,f,h,l/m/n1_3n3q5UQ7j5TR8s7k^uO!O!P!T%_%b)i$`#afgilmp!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W&Y&['}(W(Y(|*i*l+n,s,z-m.}/^0}1h1|3a3h3k4W4v4|5g5t7S7g7{8k8|9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fQ6Z3_Q8U6]Q9Q8WQ9S8XQ9f9UR9l9hR(Q#zR(P#zQ$SlR(]$TR$ooR$noR)Q$vR)P$vQ)O$vR2O-ohwOb!O!P!T$y%_%b)S)U)i-t$l!lz!Q!n$O$u$|%f%n%o%p%q%y%{&P&o&p&r'](q)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR${xR0b+UR0W*xR0U*xR6{4PR/y*vR/x*vR0P*wR0O*wR0_+QR0^+Q%XyObxz!O!P!Q!T!n$O$u$y$|%_%b%f%n%o%p%q%y%{&P&o&p&r'](q)S)U)i)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[k],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nU$u]'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$nU%uV'_Q'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&aV'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&yVOz'`z{&v{!P'`!P!Q*y!Q;'S'`;'S;=`*m<%lO'`S'cVOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S'{UOz'`{!P'`!P!Q(_!Q;'S'`;'S;=`*m<%lO'`S(bUOz(t{!P(t!P!Q(_!Q;'S(t;'S;=`*a<%lO(tS(wVOz)^z{)z{!P)^!P!Q(_!Q;'S)^;'S;=`*g<%lO)^S)eV'PS'OSOz)^z{)z{!P)^!P!Q(_!Q;'S)^;'S;=`*g<%lO)^S)}UOz(tz{)z{!P(t!Q;'S(t;'S;=`*a<%lO(tS*dP;=`<%l(tS*jP;=`<%l)^S*pP;=`<%l'`S*vP;=`<%l&[S+OO'PSU+T]'_QOY+|YZ-xZr+|rs'`sz+|z{+O{!P+|!P!Q4y!Q#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|U,R]'_QOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$nU-P]'_QOY+|YZ-xZr+|rs'`sz+|z{.d{!P+|!P!Q/Z!Q#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|U-}V'_QOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[Q.iV'_QOY.dYZ/OZr.ds#O.d#P;'S.d;'S;=`/T<%lO.dQ/TO'_QQ/WP;=`<%l.dU/`]'_QOY0XYZ3uZr0Xrs(tsz0Xz{.d{!P0X!P!Q/Z!Q#O0X#O#P(t#P;'S0X;'S;=`4a<%lO0XU0^]'_QOY1VYZ2XZr1Vrs)^sz1Vz{2w{!P1V!P!Q/Z!Q#O1V#O#P)^#P;'S1V;'S;=`4g<%lO1VU1`]'_Q'PS'OSOY1VYZ2XZr1Vrs)^sz1Vz{2w{!P1V!P!Q/Z!Q#O1V#O#P)^#P;'S1V;'S;=`4g<%lO1VU2bV'_Q'PS'OSOz)^z{)z{!P)^!P!Q(_!Q;'S)^;'S;=`*g<%lO)^U2|]'_QOY0XYZ3uZr0Xrs(tsz0Xz{2w{!P0X!P!Q.d!Q#O0X#O#P(t#P;'S0X;'S;=`4a<%lO0XU3zV'_QOz)^z{)z{!P)^!P!Q(_!Q;'S)^;'S;=`*g<%lO)^U4dP;=`<%l0XU4jP;=`<%l1VU4pP;=`<%l+|U4vP;=`<%l$nU5QV'_Q'PSOY.dYZ/OZr.ds#O.d#P;'S.d;'S;=`/T<%lO.d_5p]'_Q&|X'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_6rV'_Q&|X'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[_7b_ZX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`8a!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_8j]#PX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_9lV']Q'OS'^XOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[_:[]'QX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_;^i'_Q'vW'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!c$n!c!}<{!}#O$n#O#P&[#P#R$n#R#S<{#S#T$n#T#o<{#o${$n${$|<{$|4w$n4w5b<{5b5i$n5i6S<{6S;'S$n;'S;=`4s<%lO$n_=Uj'_Q_X'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q![<{![!c$n!c!}<{!}#O$n#O#P&[#P#R$n#R#S<{#S#T$n#T#o<{#o${$n${$|<{$|4w$n4w5b<{5b5i$n5i6S<{6S;'S$n;'S;=`4s<%lO$n_?P_(TP'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_@X]#OX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_AZa!qX'_Q'OSOY$nYZ%nZr$nrs&[sv$nvwB`wz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_Bi]'}X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_Cik'_Q'OSOYE^YZGfZrE^rsHvswE^wxFdxzE^z{Ih{!PE^!P!QKl!Q!cE^!c!}Lp!}#OE^#O#P!!l#P#RE^#R#SLp#S#TE^#T#oLp#o${E^${$|Lp$|4wE^4w5bLp5b5iE^5i6SLp6S;'SE^;'S;=`!*}<%lOE^_Ee_'_Q'OSOY$nYZ%nZr$nrs&[sw$nwxFdxz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_Fm]'_Q'OSsXOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_GmX'_Q'OSOw&[wxHYxz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[]HaV'OSsXOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[]H{X'OSOw&[wxHYxz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[_Im_'_QOY+|YZ-xZr+|rs'`sw+|wxJlxz+|z{+O{!P+|!P!Q4y!Q#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|_Js]'_QsXOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_Kq_'_QOY+|YZ-xZr+|rs'`sw+|wxJlxz+|z{.d{!P+|!P!Q/Z!Q#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|_Lyl'_Q'OS'ZXOY$nYZ%nZr$nrs&[sw$nwxFdxz$nz{+O{!P$n!P!Q,z!Q![Nq![!c$n!c!}Nq!}#O$n#O#P&[#P#R$n#R#SNq#S#T$n#T#oNq#o${$n${$|Nq$|4w$n4w5bNq5b5i$n5i6SNq6S;'S$n;'S;=`4s<%lO$n_Nzj'_Q'OS'ZXOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q![Nq![!c$n!c!}Nq!}#O$n#O#P&[#P#R$n#R#SNq#S#T$n#T#oNq#o${$n${$|Nq$|4w$n4w5bNq5b5i$n5i6SNq6S;'S$n;'S;=`4s<%lO$n]!!qZ'OSOzHvz{!#d{!PHv!P!Q!$n!Q#iHv#i#j!%Z#j#lHv#l#m!'V#m;'SHv;'S;=`!*w<%lOHv]!#gXOw'`wx!$Sxz'`z{&v{!P'`!P!Q*y!Q;'S'`;'S;=`*m<%lO'`]!$XVsXOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[]!$qWOw'`wx!$Sxz'`{!P'`!P!Q(_!Q;'S'`;'S;=`*m<%lO'`]!%`^'OSOz&[z{&v{!P&[!P!Q'x!Q![!&[![!c&[!c!i!&[!i#T&[#T#Z!&[#Z#o&[#o#p!({#p;'S&[;'S;=`*s<%lO&[]!&a['OSOz&[z{&v{!P&[!P!Q'x!Q![!'V![!c&[!c!i!'V!i#T&[#T#Z!'V#Z;'S&[;'S;=`*s<%lO&[]!'[['OSOz&[z{&v{!P&[!P!Q'x!Q![!(Q![!c&[!c!i!(Q!i#T&[#T#Z!(Q#Z;'S&[;'S;=`*s<%lO&[]!(V['OSOz&[z{&v{!P&[!P!Q'x!Q![Hv![!c&[!c!iHv!i#T&[#T#ZHv#Z;'S&[;'S;=`*s<%lO&[]!)Q['OSOz&[z{&v{!P&[!P!Q'x!Q![!)v![!c&[!c!i!)v!i#T&[#T#Z!)v#Z;'S&[;'S;=`*s<%lO&[]!){^'OSOz&[z{&v{!P&[!P!Q'x!Q![!)v![!c&[!c!i!)v!i#T&[#T#Z!)v#Z#q&[#q#rHv#r;'S&[;'S;=`*s<%lO&[]!*zP;=`<%lHv_!+QP;=`<%lE^_!+^]}X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!,`]!PX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!-`_(QX'_QOY+|YZ-xZr+|rs'`sz+|z{+O{!P+|!P!Q4y!Q!_+|!_!`!._!`#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|_!.f]#OX'_QOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!/h_(PX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!0p]!eX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!1r`'gX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`!a!2t!a#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!2}]#QX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!4P^(OX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!O$n!O!P!4{!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!5U`!lX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!O$n!O!P!6W!P!Q,z!Q!_$n!_!`!7Y!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!6a]!tX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$nV!7c]'qP'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_!8c_'_Q'xXOY+|YZ-xZr+|rs'`sz+|z{!9b{!P+|!P!Q!:O!Q!_+|!_!`!._!`#O+|#O#P'`#P;'S+|;'S;=`4m<%lO+|_!9iV&}]'_QOY.dYZ/OZr.ds#O.d#P;'S.d;'S;=`/T<%lO.d_!:V]'_QUXOY!;OYZ3uZr!;Ors!>jsz!;Oz{!Aq{!P!;O!P!Q!:O!Q#O!;O#O#P!>j#P;'S!;O;'S;=`!Bk<%lO!;O_!;V]'_QUXOY!jYZ(tZz!>jz{!=x{!P!>j!P!Q!?|!Q;'S!>j;'S;=`!@e<%lO!>j]!>oXUXOY!=SYZ)^Zz!=Sz{!=x{!P!=S!P!Q!?[!Q;'S!=S;'S;=`!@k<%lO!=S]!?aXUXOY!>jYZ(tZz!>jz{!?|{!P!>j!P!Q!?[!Q;'S!>j;'S;=`!@e<%lO!>jX!@RSUXOY!?|Z;'S!?|;'S;=`!@_<%lO!?|X!@bP;=`<%l!?|]!@hP;=`<%l!>j]!@nP;=`<%l!=S_!@x]'_QUXOY!;OYZ3uZr!;Ors!>jsz!;Oz{!@q{!P!;O!P!Q!Aq!Q#O!;O#O#P!>j#P;'S!;O;'S;=`!Bk<%lO!;OZ!AxX'_QUXOY!AqYZ/OZr!Aqrs!?|s#O!Aq#O#P!?|#P;'S!Aq;'S;=`!Be<%lO!AqZ!BhP;=`<%l!Aq_!BnP;=`<%l!;O_!BtP;=`<%l!o![!c&[!c!i#>o!i#T&[#T#Z#>o#Z#o&[#o#p#A`#p;'S&[;'S;=`*s<%lO&[U#>t['OSOz&[z{&v{!P&[!P!Q'x!Q![#?j![!c&[!c!i#?j!i#T&[#T#Z#?j#Z;'S&[;'S;=`*s<%lO&[U#?o['OSOz&[z{&v{!P&[!P!Q'x!Q![#@e![!c&[!c!i#@e!i#T&[#T#Z#@e#Z;'S&[;'S;=`*s<%lO&[U#@j['OSOz&[z{&v{!P&[!P!Q'x!Q![#;}![!c&[!c!i#;}!i#T&[#T#Z#;}#Z;'S&[;'S;=`*s<%lO&[U#Ae['OSOz&[z{&v{!P&[!P!Q'x!Q![#BZ![!c&[!c!i#BZ!i#T&[#T#Z#BZ#Z;'S&[;'S;=`*s<%lO&[U#B`^'OSOz&[z{&v{!P&[!P!Q'x!Q![#BZ![!c&[!c!i#BZ!i#T&[#T#Z#BZ#Z#q&[#q#r#;}#r;'S&[;'S;=`*s<%lO&[U#C_P;=`<%l#;}_#Ck]XX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_#Dm_'{X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_#Ewl'_Q'OS!yW'TPOY$nYZ%nZr$nrs#Gosw$nwx#H]xz$nz{+O{!P$n!P!Q,z!Q![#8W![!c$n!c!}#8W!}#O$n#O#P&[#P#R$n#R#S#8W#S#T$n#T#o#8W#o${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$n]#GvV'OS'^XOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[_#Hd_'_Q'OSOYE^YZGfZrE^rsHvswE^wxFdxzE^z{Ih{!PE^!P!QKl!Q#OE^#O#P!!l#P;'SE^;'S;=`!*}<%lOE^_#Ink'_Q'OS!yW'TPOY$nYZ%nZr$nrs&[st#Kctz$nz{+O{!P$n!P!Q,z!Q![#8W![!c$n!c!}#8W!}#O$n#O#P&[#P#R$n#R#S#8W#S#T$n#T#o#8W#o${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nV#Kji'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$nV#Mbj'_Q'OS'TPOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q![#MX![!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$n_$ ]]wX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$!_a'rX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P#p$n#p#q$#d#q;'S$n;'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[m,u,G,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:O=>j[O]||-1}],tokenPrec:15596}),I=_.define({name:"rust",parser:E.configure({props:[q.add({IfExpression:r({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":r()}),l.add(O=>{if(/(Block|edTokens|List)$/.test(O.name))return w;if(O.name=="BlockComment")return i=>({from:i.from+2,to:i.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function F(){return new V(I)}export{F as rust,I as rustLanguage}; diff --git a/assets/index-DHo_2D51.js b/assets/index-DHo_2D51.js new file mode 100644 index 0000000..077bd84 --- /dev/null +++ b/assets/index-DHo_2D51.js @@ -0,0 +1 @@ +import{s as r,t as O,L as i,i as n,c as $,f as y,k as m,n as P,a as X,b as c,E as S}from"./MarkdownEditor-i8hTFDFw.js";import"./index-Dk-UNE0C.js";import"./index.lazy-CMTI4f6x.js";import"./utils-CaYZp6PS.js";import"./useAccount-C9KkC4ZK.js";import"./createPublicClient-Cfohbp00.js";import"./isAddressEqual-Dn7cKeu3.js";import"./secp256k1-DDh0VLbn.js";const s=110,l=1,f=2,t=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function e(T){return T>=65&&T<=90||T>=97&&T<=122||T>=161}function p(T){return T>=48&&T<=57}const W=new S((T,Q)=>{if(T.next==40){let a=T.peek(-1);(e(a)||p(a)||a==95||a==45)&&T.acceptToken(f,1)}}),d=new S(T=>{if(t.indexOf(T.peek(-1))>-1){let{next:Q}=T;(e(Q)||Q==95||Q==35||Q==46||Q==91||Q==58||Q==45)&&T.acceptToken(s)}}),Z=new S(T=>{if(t.indexOf(T.peek(-1))<0){let{next:Q}=T;if(Q==37&&(T.advance(),T.acceptToken(l)),e(Q)){do T.advance();while(e(T.next));T.acceptToken(l)}}}),w=r({"import charset namespace keyframes media supports when":O.definitionKeyword,"from to selector":O.keyword,NamespaceName:O.namespace,KeyframeName:O.labelName,TagName:O.tagName,ClassName:O.className,PseudoClassName:O.constant(O.className),IdName:O.labelName,"FeatureName PropertyName PropertyVariable":O.propertyName,AttributeName:O.attributeName,NumberLiteral:O.number,KeywordQuery:O.keyword,UnaryQueryOp:O.operatorKeyword,"CallTag ValueName":O.atom,VariableName:O.variableName,"AtKeyword Interpolation":O.special(O.variableName),Callee:O.operatorKeyword,Unit:O.unit,"UniversalSelector NestingSelector":O.definitionOperator,MatchOp:O.compareOperator,"ChildOp SiblingOp, LogicOp":O.logicOperator,BinOp:O.arithmeticOperator,Important:O.modifier,"Comment LineComment":O.blockComment,ColorLiteral:O.color,"ParenthesizedContent StringLiteral":O.string,Escape:O.special(O.string),": ...":O.punctuation,"PseudoOp #":O.derefOperator,"; ,":O.separator,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),z={__proto__:null,lang:40,"nth-child":40,"nth-last-child":40,"nth-of-type":40,"nth-last-of-type":40,dir:40,"host-context":40,and:244,or:244,not:74,only:74,url:86,"url-prefix":86,domain:86,regexp:86,when:117,selector:142,from:172,to:174},h={__proto__:null,"@import":126,"@plugin":126,"@media":152,"@charset":156,"@namespace":160,"@keyframes":166,"@supports":178},g=c.deserialize({version:14,states:"@^O!gQWOOO!nQaO'#CeOOQP'#Cd'#CdO$RQWO'#CgO$xQaO'#EaO%cQWO'#CiO%kQWO'#DZO%pQWO'#D^O%uQaO'#DfOOQP'#Es'#EsO'YQWO'#DlO'yQWO'#DyO(QQWO'#D{O(xQWO'#D}O)TQWO'#EQO'bQWO'#EWO)YQ`O'#FTO)]Q`O'#FTO)hQ`O'#FTO)vQWO'#EYOOQO'#Er'#ErOOQO'#FV'#FVOOQO'#Ec'#EcO){QWO'#EqO*WQWO'#EqQOQWOOOOQP'#Ch'#ChOOQP,59R,59RO$RQWO,59RO*bQWO'#EdO+PQWO,58|O+_QWO,59TO%kQWO,59uO%pQWO,59xO*bQWO,59{O*bQWO,59}OOQO'#De'#DeO*bQWO,5:OO,bQpO'#E}O,iQWO'#DkOOQO,58|,58|O(QQWO,58|O,pQWO,5:{OOQO,5:{,5:{OOQT'#Cl'#ClO-UQeO,59TO.cQ[O,59TOOQP'#D]'#D]OOQP,59u,59uOOQO'#D_'#D_O.hQpO,59xOOQO'#EZ'#EZO.pQ`O,5;oOOQO,5;o,5;oO/OQWO,5:WO/VQWO,5:WOOQS'#Dn'#DnO/rQWO'#DsO/yQ!fO'#FRO0eQWO'#DtOOQS'#FS'#FSO+YQWO,5:eO'bQWO'#DrOOQS'#Cu'#CuO(QQWO'#CwO0jQ!hO'#CyO2^Q!fO,5:gO2oQWO'#DWOOQS'#Ex'#ExO(QQWO'#DQOOQO'#EP'#EPO2tQWO,5:iO2yQWO,5:iOOQO'#ES'#ESO3RQWO,5:lO3WQ!fO,5:rO3iQ`O'#EkO.pQ`O,5;oOOQO,5:|,5:|O3zQWO,5:tOOQO,5:},5:}O4XQWO,5;]OOQO-E8a-E8aOOQP1G.m1G.mOOQP'#Ce'#CeO5RQaO,5;OOOQP'#Df'#DfOOQO-E8b-E8bOOQO1G.h1G.hO(QQWO1G.hO5fQWO1G.hO5nQeO1G.oO.cQ[O1G.oOOQP1G/a1G/aO6{QpO1G/dO7fQaO1G/gO8cQaO1G/iO9`QaO1G/jO:]Q!fO'#FOO:yQ!fO'#ExOOQO'#FO'#FOOOQO,5;i,5;iO<^QWO,5;iOWQWO1G/rO>]Q!fO'#DnO>qQWO,5:ZO>vQ!fO,5:_OOQO'#DP'#DPO'bQWO,5:]O?XQWO'#DwOOQS,5:b,5:bO?`QWO,5:dO'bQWO'#EiO?gQWO,5;mO*bQWO,5:`OOQO1G0P1G0PO?uQ!fO,5:^O@aQ!fO,59cOOQS,59e,59eO(QQWO,59iOOQS,59n,59nO@rQWO,59pOOQO1G0R1G0RO@yQ#tO,59rOARQ!fO,59lOOQO1G0T1G0TOBrQWO1G0TOBwQWO'#ETOOQO1G0W1G0WOOQO1G0^1G0^OOQO,5;V,5;VOOQO-E8i-E8iOCVQ!fO1G0bOCvQWO1G0`O%kQWO'#E_O$RQWO'#E`OEZQWO'#E^OOQO1G0b1G0bPEkQWO'#EcOUAN>UO!!RQWO,5;QOOQO-E8d-E8dO!!]QWOAN>dOOQS<S![;'S%T;'S;=`%f<%lO%Tm>ZY#m]|`Oy%Tz!Q%T!Q![>S![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%Tm?OY|`Oy%Tz{%T{|?n|}%T}!O?n!O!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm?sU|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@^U#m]|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@w[#m]|`Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TbAtS#xQ|`Oy%Tz;'S%T;'S;=`%f<%lO%TkBVScZOy%Tz;'S%T;'S;=`%f<%lO%TmBhXrWOy%Tz}%T}!OCT!O!P=k!P!Q%T!Q![@p![;'S%T;'S;=`%f<%lO%TmCYW|`Oy%Tz!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%TmCy[f]|`Oy%Tz}%T}!OCr!O!Q%T!Q![Cr![!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%ToDtW#iROy%Tz!O%T!O!PE^!P!Q%T!Q![>S![;'S%T;'S;=`%f<%lO%TlEcU|`Oy%Tz!O%T!O!PEu!P;'S%T;'S;=`%f<%lO%TlE|S#s[|`Oy%Tz;'S%T;'S;=`%f<%lO%T~F_VrWOy%Tz{Ft{!P%T!P!QIl!Q;'S%T;'S;=`%f<%lO%T~FyU|`OyFtyzG]z{Hd{;'SFt;'S;=`If<%lOFt~G`TOzG]z{Go{;'SG];'S;=`H^<%lOG]~GrVOzG]z{Go{!PG]!P!QHX!Q;'SG];'S;=`H^<%lOG]~H^OR~~HaP;=`<%lG]~HiW|`OyFtyzG]z{Hd{!PFt!P!QIR!Q;'SFt;'S;=`If<%lOFt~IYS|`R~Oy%Tz;'S%T;'S;=`%f<%lO%T~IiP;=`<%lFt~IsV|`S~OYIlYZ%TZyIlyzJYz;'SIl;'S;=`Jq<%lOIl~J_SS~OYJYZ;'SJY;'S;=`Jk<%lOJY~JnP;=`<%lJY~JtP;=`<%lIlmJ|[#m]Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TkKwU^ZOy%Tz![%T![!]LZ!];'S%T;'S;=`%f<%lO%TcLbS_R|`Oy%Tz;'S%T;'S;=`%f<%lO%TkLsS!ZZOy%Tz;'S%T;'S;=`%f<%lO%ThMUUrWOy%Tz!_%T!_!`Mh!`;'S%T;'S;=`%f<%lO%ThMoS|`rWOy%Tz;'S%T;'S;=`%f<%lO%TlNSW!SSrWOy%Tz!^%T!^!_Mh!_!`%T!`!aMh!a;'S%T;'S;=`%f<%lO%TjNsV!UQrWOy%Tz!_%T!_!`Mh!`!a! Y!a;'S%T;'S;=`%f<%lO%Tb! aS!UQ|`Oy%Tz;'S%T;'S;=`%f<%lO%To! rYg]Oy%Tz!b%T!b!c!!b!c!}!#R!}#T%T#T#o!#R#o#p!$O#p;'S%T;'S;=`%f<%lO%Tm!!iWg]|`Oy%Tz!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%Tm!#Y[g]|`Oy%Tz}%T}!O!#R!O!Q%T!Q![!#R![!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%To!$TW|`Oy%Tz!c%T!c!}!$m!}#T%T#T#o!$m#o;'S%T;'S;=`%f<%lO%To!$r^|`Oy%Tz}%T}!O!$m!O!Q%T!Q![!$m![!c%T!c!}!$m!}#T%T#T#o!$m#o#q%T#q#r!%n#r;'S%T;'S;=`%f<%lO%To!%uSp_|`Oy%Tz;'S%T;'S;=`%f<%lO%To!&W[#h_Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%To!'T[#h_|`Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%Tk!(OSyZOy%Tz;'S%T;'S;=`%f<%lO%Tm!(aSw]Oy%Tz;'S%T;'S;=`%f<%lO%Td!(pUOy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tk!)XS!^ZOy%Tz;'S%T;'S;=`%f<%lO%Tk!)jS!]ZOy%Tz;'S%T;'S;=`%f<%lO%To!){Y#oQOr%Trs!*ksw%Twx!.wxy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tm!*pZ|`OY!*kYZ%TZr!*krs!+csy!*kyz!+vz#O!*k#O#P!-j#P;'S!*k;'S;=`!.q<%lO!*km!+jSo]|`Oy%Tz;'S%T;'S;=`%f<%lO%T]!+yWOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d<%lO!+v]!,hOo]]!,kRO;'S!+v;'S;=`!,t;=`O!+v]!,wXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!+v<%lO!+v]!-gP;=`<%l!+vm!-oU|`Oy!*kyz!+vz;'S!*k;'S;=`!.R;=`<%l!+v<%lO!*km!.UXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!*k<%lO!+vm!.tP;=`<%l!*km!.|Z|`OY!.wYZ%TZw!.wwx!+cxy!.wyz!/oz#O!.w#O#P!1^#P;'S!.w;'S;=`!2e<%lO!.w]!/rWOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W<%lO!/o]!0_RO;'S!/o;'S;=`!0h;=`O!/o]!0kXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!/o<%lO!/o]!1ZP;=`<%l!/om!1cU|`Oy!.wyz!/oz;'S!.w;'S;=`!1u;=`<%l!/o<%lO!.wm!1xXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!.w<%lO!/om!2hP;=`<%l!.w`!2nP;=`<%l$t",tokenizers:[d,Z,W,0,1,2,3,4],topRules:{StyleSheet:[0,5]},specialized:[{term:116,get:T=>z[T]||-1},{term:23,get:T=>h[T]||-1}],tokenPrec:2180}),o=i.define({name:"less",parser:g.configure({props:[n.add({Declaration:$()}),y.add({Block:m})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"@-"}}),u=P(T=>T.name=="VariableName"||T.name=="AtKeyword");function E(){return new X(o,o.data.of({autocomplete:u}))}export{E as less,u as lessCompletionSource,o as lessLanguage}; diff --git a/assets/index-DMnbdnsj.js b/assets/index-DMnbdnsj.js deleted file mode 100644 index 541ee1e..0000000 --- a/assets/index-DMnbdnsj.js +++ /dev/null @@ -1 +0,0 @@ -import{s as p,t as e,L as u,a as l,b as m,l as r,q as b,r as n,v as S}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const c=m.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=S.parser.configure({top:"SingleExpression"}),o=c.configure({props:[p({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),s={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?s:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?s:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=b();function i(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=i(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function k(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof u))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new l(t.language==a.language?T:i(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{k as vue,T as vueLanguage}; diff --git a/assets/index-DMvc0v07.js b/assets/index-DMvc0v07.js new file mode 100644 index 0000000..e7526d3 --- /dev/null +++ b/assets/index-DMvc0v07.js @@ -0,0 +1 @@ +import{s as q,t as r,v as l,L as P,a as g,b as c,q as R,r as i,E as p}from"./MarkdownEditor-i8hTFDFw.js";import"./index-Dk-UNE0C.js";import"./index.lazy-CMTI4f6x.js";import"./utils-CaYZp6PS.js";import"./useAccount-C9KkC4ZK.js";import"./createPublicClient-Cfohbp00.js";import"./isAddressEqual-Dn7cKeu3.js";import"./secp256k1-DDh0VLbn.js";const b=1,$=33,m=34,v=35,x=36,W=new p(O=>{let t=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>t&&O.acceptToken(b)});function n(O,t,a){return new p(e=>{let u=e.pos;for(;e.next!=O&&e.next>=0&&(a||e.next!=38&&(e.next!=123||e.peek(1)!=123));)e.advance();e.pos>u&&e.acceptToken(t)})}const d=n(39,$,!1),C=n(34,m,!1),T=n(39,v,!0),f=n(34,x,!0),A=c.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<O.name=="InterpolationContent"?o:null)}),y=Q.configure({wrap:i((O,t)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?w:o}),top:"Attribute"}),E={parser:U},N={parser:y},s=R();function S(O){return O.configure({wrap:i(z)},"angular")}const k=S(s.language);function z(O,t){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(t.read(O.from,O.to))?N:null;case"Text":return E}return null}function L(O={}){let t=s;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof P))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new g(t.language==s.language?k:S(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/})])}export{L as angular,k as angularLanguage}; diff --git a/assets/index-DQLbHeQa.css b/assets/index-DQLbHeQa.css deleted file mode 100644 index 7443f43..0000000 --- a/assets/index-DQLbHeQa.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root,[data-theme]{background-color:var(--fallback-b1,oklch(var(--b1)/1));color:var(--fallback-bc,oklch(var(--bc)/1))}@supports not (color: oklch(0% 0 0)){:root{color-scheme:light;--fallback-p: #491eff;--fallback-pc: #d4dbff;--fallback-s: #ff41c7;--fallback-sc: #fff9fc;--fallback-a: #00cfbd;--fallback-ac: #00100d;--fallback-n: #2b3440;--fallback-nc: #d7dde4;--fallback-b1: #ffffff;--fallback-b2: #e5e6e6;--fallback-b3: #e5e6e6;--fallback-bc: #1f2937;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}@media (prefers-color-scheme: dark){:root{color-scheme:dark;--fallback-p: #7582ff;--fallback-pc: #050617;--fallback-s: #ff71cf;--fallback-sc: #190211;--fallback-a: #00c7b5;--fallback-ac: #000e0c;--fallback-n: #2a323c;--fallback-nc: #a6adbb;--fallback-b1: #1d232a;--fallback-b2: #191e24;--fallback-b3: #15191e;--fallback-bc: #a6adbb;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}}}html{-webkit-tap-highlight-color:transparent}*{scrollbar-color:color-mix(in oklch,currentColor 35%,transparent) transparent}*:hover{scrollbar-color:color-mix(in oklch,currentColor 60%,transparent) transparent}:root{--p: 68.0919% .11717 191.157653;--b2: 91.2559% .025101 196.720525;--b3: 84.3871% .023211 196.720525;--bc: 19.6249% .005398 196.720525;--pc: 13.6184% .023434 191.157653;--sc: 13.8117% .023282 284.057522;--ac: 80% 0 0;--inc: 13.5377% .028213 233.682793;--suc: 14.1097% .0274 171.845671;--wac: 16.4688% .034161 79.49821;--erc: 14.2034% .038956 3.764619;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--s: 69.0586% .116408 284.057522;--a: 0% 0 0;--n: 28.094% 0 0;--nc: 69.3001% .124858 177.165798;--b1: 98.1246% .02699 196.720525;--in: 67.6883% .141064 233.682793;--su: 70.5487% .137001 171.845671;--wa: 82.3442% .170805 79.49821;--er: 71.0168% .194779 3.764619}@media (prefers-color-scheme: dark){:root{--p: 63.8657% .309019 318.417644;--b2: 25.0775% .018705 236.422189;--b3: 23.1899% .017297 236.422189;--bc: 85.393% .004023 236.422189;--pc: 12.7731% .061804 318.417644;--sc: 11.5242% .029154 281.735175;--ac: 20% 0 0;--inc: 13.8251% .033805 249.753458;--suc: 16.8166% .044807 129.318563;--wac: 90.7678% .029989 46.578391;--erc: 13.9944% .038861 14.402079;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--s: 57.6212% .145772 281.735175;--a: 100% 0 0;--n: 17.9779% .009355 75.02933;--nc: 82.1683% .12001 180.331972;--b1: 26.965% .020113 236.422189;--in: 69.1256% .169026 249.753458;--su: 84.083% .224033 129.318563;--wa: 53.8389% .149943 46.578391;--er: 69.9721% .194306 14.402079}}[data-theme=light]{--p: 68.0919% .11717 191.157653;--b2: 91.2559% .025101 196.720525;--b3: 84.3871% .023211 196.720525;--bc: 19.6249% .005398 196.720525;--pc: 13.6184% .023434 191.157653;--sc: 13.8117% .023282 284.057522;--ac: 80% 0 0;--inc: 13.5377% .028213 233.682793;--suc: 14.1097% .0274 171.845671;--wac: 16.4688% .034161 79.49821;--erc: 14.2034% .038956 3.764619;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--s: 69.0586% .116408 284.057522;--a: 0% 0 0;--n: 28.094% 0 0;--nc: 69.3001% .124858 177.165798;--b1: 98.1246% .02699 196.720525;--in: 67.6883% .141064 233.682793;--su: 70.5487% .137001 171.845671;--wa: 82.3442% .170805 79.49821;--er: 71.0168% .194779 3.764619}[data-theme=dark]{--p: 63.8657% .309019 318.417644;--b2: 25.0775% .018705 236.422189;--b3: 23.1899% .017297 236.422189;--bc: 85.393% .004023 236.422189;--pc: 12.7731% .061804 318.417644;--sc: 11.5242% .029154 281.735175;--ac: 20% 0 0;--inc: 13.8251% .033805 249.753458;--suc: 16.8166% .044807 129.318563;--wac: 90.7678% .029989 46.578391;--erc: 13.9944% .038861 14.402079;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--s: 57.6212% .145772 281.735175;--a: 100% 0 0;--n: 17.9779% .009355 75.02933;--nc: 82.1683% .12001 180.331972;--b1: 26.965% .020113 236.422189;--in: 69.1256% .169026 249.753458;--su: 84.083% .224033 129.318563;--wa: 53.8389% .149943 46.578391;--er: 69.9721% .194306 14.402079}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.alert{display:grid;width:100%;grid-auto-flow:row;align-content:flex-start;align-items:center;justify-items:center;gap:1rem;text-align:center;border-radius:var(--rounded-box, 1rem);border-width:1px;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));padding:1rem;--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--alert-bg: var(--fallback-b2,oklch(var(--b2)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1));background-color:var(--alert-bg)}@media (min-width: 640px){.alert{grid-auto-flow:column;grid-template-columns:auto minmax(auto,1fr);justify-items:start;text-align:start}}@media (hover:hover){.label a:hover{--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}.menu li>*:not(ul,.menu-title,details,.btn):active,.menu li>*:not(ul,.menu-title,details,.btn).active,.menu li>details>summary:active{--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}}.btn{display:inline-flex;height:3rem;min-height:3rem;flex-shrink:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-wrap:wrap;align-items:center;justify-content:center;border-radius:var(--rounded-btn, .5rem);border-color:transparent;border-color:oklch(var(--btn-color, var(--b2)) / var(--tw-border-opacity));padding-left:1rem;padding-right:1rem;text-align:center;font-size:.875rem;line-height:1em;gap:.5rem;font-weight:600;text-decoration-line:none;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);border-width:var(--border-btn, 1px);transition-property:color,background-color,border-color,opacity,box-shadow,transform;--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:var(--fallback-bc,oklch(var(--bc)/1));background-color:oklch(var(--btn-color, var(--b2)) / var(--tw-bg-opacity));--tw-bg-opacity: 1;--tw-border-opacity: 1}.btn-disabled,.btn[disabled],.btn:disabled{pointer-events:none}:where(.btn:is(input[type=checkbox])),:where(.btn:is(input[type=radio])){width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.btn:is(input[type=checkbox]):after,.btn:is(input[type=radio]):after{--tw-content: attr(aria-label);content:var(--tw-content)}.card{position:relative;display:flex;flex-direction:column;border-radius:var(--rounded-box, 1rem)}.card:focus{outline:2px solid transparent;outline-offset:2px}.card-body{display:flex;flex:1 1 auto;flex-direction:column;padding:var(--padding-card, 2rem);gap:.5rem}.card-body :where(p){flex-grow:1}.card figure{display:flex;align-items:center;justify-content:center}.card.image-full{display:grid}.card.image-full:before{position:relative;content:"";z-index:10;border-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));opacity:.75}.card.image-full:before,.card.image-full>*{grid-column-start:1;grid-row-start:1}.card.image-full>figure img{height:100%;-o-object-fit:cover;object-fit:cover}.card.image-full>.card-body{position:relative;z-index:20;--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}.dropdown{position:relative;display:inline-block}.dropdown>*:not(summary):focus{outline:2px solid transparent;outline-offset:2px}.dropdown .dropdown-content{position:absolute}.dropdown:is(:not(details)) .dropdown-content{visibility:hidden;opacity:0;transform-origin:top;--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s}.dropdown-end .dropdown-content{inset-inline-end:0px}.dropdown-left .dropdown-content{bottom:auto;inset-inline-end:100%;top:0;transform-origin:right}.dropdown-right .dropdown-content{bottom:auto;inset-inline-start:100%;top:0;transform-origin:left}.dropdown-bottom .dropdown-content{bottom:auto;top:100%;transform-origin:top}.dropdown-top .dropdown-content{bottom:100%;top:auto;transform-origin:bottom}.dropdown-end.dropdown-right .dropdown-content,.dropdown-end.dropdown-left .dropdown-content{bottom:0;top:auto}.dropdown.dropdown-open .dropdown-content,.dropdown:not(.dropdown-hover):focus .dropdown-content,.dropdown:focus-within .dropdown-content{visibility:visible;opacity:1}@media (hover: hover){.dropdown.dropdown-hover:hover .dropdown-content{visibility:visible;opacity:1}.btm-nav>*.disabled:hover,.btm-nav>*[disabled]:hover{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btn:hover{--tw-border-opacity: 1;border-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn:hover{background-color:color-mix(in oklab,oklch(var(--btn-color, var(--b2)) / var(--tw-bg-opacity, 1)) 90%,black);border-color:color-mix(in oklab,oklch(var(--btn-color, var(--b2)) / var(--tw-border-opacity, 1)) 90%,black)}}@supports not (color: oklch(0% 0 0)){.btn:hover{background-color:var(--btn-color, var(--fallback-b2));border-color:var(--btn-color, var(--fallback-b2))}}.btn.glass:hover{--glass-opacity: 25%;--glass-border-opacity: 15%}.btn-ghost:hover{border-color:transparent}@supports (color: oklch(0% 0 0)){.btn-ghost:hover{background-color:var(--fallback-bc,oklch(var(--bc)/.2))}}.btn-outline.btn-primary:hover{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-primary:hover{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}}.btn-disabled:hover,.btn[disabled]:hover,.btn:disabled:hover{--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .2;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}@supports (color: color-mix(in oklab,black,black)){.btn:is(input[type=checkbox]:checked):hover,.btn:is(input[type=radio]:checked):hover{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}}.dropdown.dropdown-hover:hover .dropdown-content{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(.active,.btn):hover,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(.active,.btn):hover{cursor:pointer;outline:2px solid transparent;outline-offset:2px}@supports (color: oklch(0% 0 0)){:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(.active,.btn):hover,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(.active,.btn):hover{background-color:var(--fallback-bc,oklch(var(--bc)/.1))}}}.dropdown:is(details) summary::-webkit-details-marker{display:none}.label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;justify-content:space-between;padding:.5rem .25rem}.join .dropdown .join-item:first-child:not(:last-child),.join *:first-child:not(:last-child) .dropdown .join-item{border-start-end-radius:inherit;border-end-end-radius:inherit}.link{cursor:pointer;text-decoration-line:underline}.menu{display:flex;flex-direction:column;flex-wrap:wrap;font-size:.875rem;line-height:1.25rem;padding:.5rem}.menu :where(li ul){position:relative;white-space:nowrap;margin-inline-start:1rem;padding-inline-start:.5rem}.menu :where(li:not(.menu-title)>*:not(ul,details,.menu-title,.btn)),.menu :where(li:not(.menu-title)>details>summary:not(.menu-title)){display:grid;grid-auto-flow:column;align-content:flex-start;align-items:center;gap:.5rem;grid-auto-columns:minmax(auto,max-content) auto max-content;-webkit-user-select:none;-moz-user-select:none;user-select:none}.menu li.disabled{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:var(--fallback-bc,oklch(var(--bc)/.3))}.menu :where(li>.menu-dropdown:not(.menu-dropdown-show)){display:none}:where(.menu li){position:relative;display:flex;flex-shrink:0;flex-direction:column;flex-wrap:wrap;align-items:stretch}:where(.menu li) .badge{justify-self:end}.navbar{display:flex;align-items:center;padding:var(--navbar-padding, .5rem);min-height:4rem;width:100%}:where(.navbar>*:not(script,style)){display:inline-flex;align-items:center}.navbar-end{width:50%;justify-content:flex-end}.toast{position:fixed;display:flex;min-width:-moz-fit-content;min-width:fit-content;flex-direction:column;white-space:nowrap;gap:.5rem;padding:1rem}.alert-success{border-color:var(--fallback-su,oklch(var(--su)/.2));--tw-text-opacity: 1;color:var(--fallback-suc,oklch(var(--suc)/var(--tw-text-opacity)));--alert-bg: var(--fallback-su,oklch(var(--su)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1))}.alert-warning{border-color:var(--fallback-wa,oklch(var(--wa)/.2));--tw-text-opacity: 1;color:var(--fallback-wac,oklch(var(--wac)/var(--tw-text-opacity)));--alert-bg: var(--fallback-wa,oklch(var(--wa)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1))}.btm-nav>*:where(.active){border-top-width:2px;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.btm-nav>*.disabled,.btm-nav>*[disabled]{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btm-nav>* .label{font-size:1rem;line-height:1.5rem}@media (prefers-reduced-motion: no-preference){.btn{animation:button-pop var(--animation-btn, .25s) ease-out}}.btn:active:hover,.btn:active:focus{animation:button-pop 0s ease-out;transform:scale(var(--btn-focus-scale, .97))}@supports not (color: oklch(0% 0 0)){.btn{background-color:var(--btn-color, var(--fallback-b2));border-color:var(--btn-color, var(--fallback-b2))}.btn-primary{--btn-color: var(--fallback-p)}}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-primary.btn-active{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}}.btn:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px}.btn-primary{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));outline-color:var(--fallback-p,oklch(var(--p)/1))}@supports (color: oklch(0% 0 0)){.btn-primary{--btn-color: var(--p)}}.btn.glass{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:currentColor}.btn.glass.btn-active{--glass-opacity: 25%;--glass-border-opacity: 15%}.btn-ghost{border-width:1px;border-color:transparent;background-color:transparent;color:currentColor;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:currentColor}.btn-ghost.btn-active{border-color:transparent;background-color:var(--fallback-bc,oklch(var(--bc)/.2))}.btn-outline.btn-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity)))}.btn-outline.btn-primary.btn-active{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}.btn.btn-disabled,.btn[disabled],.btn:disabled{--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .2;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btn:is(input[type=checkbox]:checked),.btn:is(input[type=radio]:checked){--tw-border-opacity: 1;border-color:var(--fallback-p,oklch(var(--p)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}.btn:is(input[type=checkbox]:checked):focus-visible,.btn:is(input[type=radio]:checked):focus-visible{outline-color:var(--fallback-p,oklch(var(--p)/1))}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale, .98))}40%{transform:scale(1.02)}to{transform:scale(1)}}.card :where(figure:first-child){overflow:hidden;border-start-start-radius:inherit;border-start-end-radius:inherit;border-end-start-radius:unset;border-end-end-radius:unset}.card :where(figure:last-child){overflow:hidden;border-start-start-radius:unset;border-start-end-radius:unset;border-end-start-radius:inherit;border-end-end-radius:inherit}.card:focus-visible{outline:2px solid currentColor;outline-offset:2px}.card.bordered{border-width:1px;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}.card.compact .card-body{padding:1rem;font-size:.875rem;line-height:1.25rem}.card-title{display:flex;align-items:center;gap:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.card.image-full :where(figure){overflow:hidden;border-radius:inherit}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}.dropdown.dropdown-open .dropdown-content,.dropdown:focus .dropdown-content,.dropdown:focus-within .dropdown-content{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.join>:where(*:not(:first-child)):is(.btn){margin-inline-start:calc(var(--border-btn) * -1)}.link:focus{outline:2px solid transparent;outline-offset:2px}.link:focus-visible{outline:2px solid currentColor;outline-offset:2px}.loading{pointer-events:none;display:inline-block;aspect-ratio:1 / 1;width:1.5rem;background-color:currentColor;-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.loading-spinner{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.loading-dots{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_qM83%7Banimation:spinner_8HQG 1.05s infinite%7D.spinner_oXPr%7Banimation-delay:.1s%7D.spinner_ZTLf%7Banimation-delay:.2s%7D@keyframes spinner_8HQG%7B0%25,57.14%25%7Banimation-timing-function:cubic-bezier(0.33,.66,.66,1);transform:translate(0)%7D28.57%25%7Banimation-timing-function:cubic-bezier(0.33,0,.66,.33);transform:translateY(-6px)%7D100%25%7Btransform:translate(0)%7D%7D%3C/style%3E%3Ccircle class='spinner_qM83' cx='4' cy='12' r='3'/%3E%3Ccircle class='spinner_qM83 spinner_oXPr' cx='12' cy='12' r='3'/%3E%3Ccircle class='spinner_qM83 spinner_ZTLf' cx='20' cy='12' r='3'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_qM83%7Banimation:spinner_8HQG 1.05s infinite%7D.spinner_oXPr%7Banimation-delay:.1s%7D.spinner_ZTLf%7Banimation-delay:.2s%7D@keyframes spinner_8HQG%7B0%25,57.14%25%7Banimation-timing-function:cubic-bezier(0.33,.66,.66,1);transform:translate(0)%7D28.57%25%7Banimation-timing-function:cubic-bezier(0.33,0,.66,.33);transform:translateY(-6px)%7D100%25%7Btransform:translate(0)%7D%7D%3C/style%3E%3Ccircle class='spinner_qM83' cx='4' cy='12' r='3'/%3E%3Ccircle class='spinner_qM83 spinner_oXPr' cx='12' cy='12' r='3'/%3E%3Ccircle class='spinner_qM83 spinner_ZTLf' cx='20' cy='12' r='3'/%3E%3C/svg%3E")}.loading-md{width:1.5rem}:where(.menu li:empty){--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));opacity:.1;margin:.5rem 1rem;height:1px}.menu :where(li ul):before{position:absolute;bottom:.75rem;inset-inline-start:0px;top:.75rem;width:1px;--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));opacity:.1;content:""}.menu :where(li:not(.menu-title)>*:not(ul,details,.menu-title,.btn)),.menu :where(li:not(.menu-title)>details>summary:not(.menu-title)){border-radius:var(--rounded-btn, .5rem);padding:.5rem 1rem;text-align:start;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s;text-wrap:balance}:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(summary,.active,.btn).focus,:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(summary,.active,.btn):focus,:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):is(summary):not(.active,.btn):focus-visible,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(summary,.active,.btn).focus,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(summary,.active,.btn):focus,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):is(summary):not(.active,.btn):focus-visible{cursor:pointer;background-color:var(--fallback-bc,oklch(var(--bc)/.1));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));outline:2px solid transparent;outline-offset:2px}.menu li>*:not(ul,.menu-title,details,.btn):active,.menu li>*:not(ul,.menu-title,details,.btn).active,.menu li>details>summary:active{--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}.menu :where(li>details>summary)::-webkit-details-marker{display:none}.menu :where(li>details>summary):after,.menu :where(li>.menu-dropdown-toggle):after{justify-self:end;display:block;margin-top:-.5rem;height:.5rem;width:.5rem;transform:rotate(45deg);transition-property:transform,margin-top;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);content:"";transform-origin:75% 75%;box-shadow:2px 2px;pointer-events:none}.menu :where(li>details[open]>summary):after,.menu :where(li>.menu-dropdown-toggle.menu-dropdown-show):after{transform:rotate(225deg);margin-top:0}@keyframes modal-pop{0%{opacity:0}}@keyframes progress-loading{50%{background-position-x:-115%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset}50%{box-shadow:0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset}to{box-shadow:0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset}}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}.table tr.active,.table tr.active:nth-child(2n),.table-zebra tbody tr:nth-child(2n){--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}.table-zebra tr.active,.table-zebra tr.active:nth-child(2n),.table-zebra-zebra tbody tr:nth-child(2n){--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}.toast>*{animation:toast-pop .25s ease-out}@keyframes toast-pop{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.btm-nav-xs>*:where(.active){border-top-width:1px}.btm-nav-sm>*:where(.active){border-top-width:2px}.btm-nav-md>*:where(.active){border-top-width:2px}.btm-nav-lg>*:where(.active){border-top-width:4px}.btn-wide{width:16rem}.menu-horizontal{display:inline-flex;flex-direction:row}.menu-horizontal>li:not(.menu-title)>details>ul{position:absolute}:where(.toast){bottom:0;inset-inline-end:0px;inset-inline-start:auto;top:auto;--tw-translate-x: 0px;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-start){inset-inline-end:auto;inset-inline-start:0px;--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-center){inset-inline-end:50%;inset-inline-start:50%;--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-center):where([dir=rtl],[dir=rtl] *){--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-end){inset-inline-end:0px;inset-inline-start:auto;--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-bottom){bottom:0;top:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-middle){bottom:auto;top:50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.toast:where(.toast-top){bottom:auto;top:0;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.tooltip{position:relative;display:inline-block;--tooltip-offset: calc(100% + 1px + var(--tooltip-tail, 0px))}.tooltip:before{position:absolute;pointer-events:none;z-index:1;content:var(--tw-content);--tw-content: attr(data-tip)}.tooltip:before,.tooltip-top:before{transform:translate(-50%);top:auto;left:50%;right:auto;bottom:var(--tooltip-offset)}.card-compact .card-body{padding:1rem;font-size:.875rem;line-height:1.25rem}.card-compact .card-title{margin-bottom:.25rem}.card-normal .card-body{padding:var(--padding-card, 2rem);font-size:1rem;line-height:1.5rem}.card-normal .card-title{margin-bottom:.75rem}.join.join-vertical>:where(*:not(:first-child)):is(.btn){margin-top:calc(var(--border-btn) * -1)}.join.join-horizontal>:where(*:not(:first-child)):is(.btn){margin-inline-start:calc(var(--border-btn) * -1)}.menu-horizontal>li:not(.menu-title)>details>ul{margin-inline-start:0px;margin-top:1rem;padding-top:.5rem;padding-bottom:.5rem;padding-inline-end:.5rem}.menu-horizontal>li>details>ul:before{content:none}:where(.menu-horizontal>li:not(.menu-title)>details>ul){border-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.menu-sm :where(li:not(.menu-title)>*:not(ul,details,.menu-title)),.menu-sm :where(li:not(.menu-title)>details>summary:not(.menu-title)){border-radius:var(--rounded-btn, .5rem);padding:.25rem .75rem;font-size:.875rem;line-height:1.25rem}.menu-sm .menu-title{padding:.5rem .75rem}.tooltip{position:relative;display:inline-block;text-align:center;--tooltip-tail: .1875rem;--tooltip-color: var(--fallback-n,oklch(var(--n)/1));--tooltip-text-color: var(--fallback-nc,oklch(var(--nc)/1));--tooltip-tail-offset: calc(100% + .0625rem - var(--tooltip-tail))}.tooltip:before,.tooltip:after{opacity:0;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-delay:.1s;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.tooltip:after{position:absolute;content:"";border-style:solid;border-width:var(--tooltip-tail, 0);width:0;height:0;display:block}.tooltip:before{max-width:20rem;white-space:normal;border-radius:.25rem;padding:.25rem .5rem;font-size:.875rem;line-height:1.25rem;background-color:var(--tooltip-color);color:var(--tooltip-text-color);width:-moz-max-content;width:max-content}.tooltip.tooltip-open:before{opacity:1;transition-delay:75ms}.tooltip.tooltip-open:after{opacity:1;transition-delay:75ms}.tooltip:hover:before{opacity:1;transition-delay:75ms}.tooltip:hover:after{opacity:1;transition-delay:75ms}.tooltip:has(:focus-visible):after,.tooltip:has(:focus-visible):before{opacity:1;transition-delay:75ms}.tooltip:not([data-tip]):hover:before,.tooltip:not([data-tip]):hover:after{visibility:hidden;opacity:0}.tooltip:after,.tooltip-top:after{transform:translate(-50%);border-color:var(--tooltip-color) transparent transparent transparent;top:auto;left:50%;right:auto;bottom:var(--tooltip-tail-offset)}.tooltip-primary{--tooltip-color: var(--fallback-p,oklch(var(--p)/1));--tooltip-text-color: var(--fallback-pc,oklch(var(--pc)/1))}.tooltip-secondary{--tooltip-color: var(--fallback-s,oklch(var(--s)/1));--tooltip-text-color: var(--fallback-sc,oklch(var(--sc)/1))}.tooltip-info{--tooltip-color: var(--fallback-in,oklch(var(--in)/1));--tooltip-text-color: var(--fallback-inc,oklch(var(--inc)/1))}.tooltip-success{--tooltip-color: var(--fallback-su,oklch(var(--su)/1));--tooltip-text-color: var(--fallback-suc,oklch(var(--suc)/1))}.tooltip-error{--tooltip-color: var(--fallback-er,oklch(var(--er)/1));--tooltip-text-color: var(--fallback-erc,oklch(var(--erc)/1))}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.right-0{right:0}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[1001\]{z-index:1001}.z-\[1\]{z-index:1}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.min-h-0{min-height:0px}.w-5{width:1.25rem}.w-52{width:13rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.max-w-72{max-width:18rem}.max-w-md{max-width:28rem}.max-w-prose{max-width:65ch}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-1\/4{flex-basis:25%}.scroll-mt-20{scroll-margin-top:5rem}.scroll-mt-32{scroll-margin-top:8rem}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.scroll-smooth{scroll-behavior:smooth}.whitespace-nowrap{white-space:nowrap}.text-balance{text-wrap:balance}.rounded-box{border-radius:var(--rounded-box, 1rem)}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-br-lg{border-bottom-right-radius:.5rem}.border{border-width:1px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.bg-base-100{--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.bg-base-300{--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-info{--tw-bg-opacity: 1;background-color:var(--fallback-in,oklch(var(--in)/var(--tw-bg-opacity)))}.bg-secondary\/25{background-color:var(--fallback-s,oklch(var(--s)/.25))}.bg-transparent{background-color:transparent}.bg-white\/20{background-color:#fff3}.bg-opacity-20{--tw-bg-opacity: .2}.fill-black{fill:#000}.fill-blue-400{fill:#60a5fa}.fill-blue-600{fill:#2563eb}.fill-green-500{fill:#22c55e}.fill-orange-400{fill:#fb923c}.fill-red-500{fill:#ef4444}.fill-yellow-500{fill:#eab308}.stroke-current{stroke:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.text-accent{--tw-text-opacity: 1;color:var(--fallback-a,oklch(var(--a)/var(--tw-text-opacity)))}.text-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity)))}.text-secondary{--tw-text-opacity: 1;color:var(--fallback-s,oklch(var(--s)/var(--tw-text-opacity)))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-secondary{--tw-shadow-color: var(--fallback-s,oklch(var(--s)/1));--tw-shadow: var(--tw-shadow-colored)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media (min-width: 768px){.md\:tooltip-right:before{transform:translateY(-50%);top:50%;left:var(--tooltip-offset);right:auto;bottom:auto}.md\:tooltip-right:after{transform:translateY(-50%);border-color:transparent var(--tooltip-color) transparent transparent;top:50%;left:calc(var(--tooltip-tail-offset) + .0625rem);right:auto;bottom:auto}}.hover\:scale-95:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-yellow-300\/60:hover{background-color:#fde04799}.hover\:bg-yellow-300\/75:hover{background-color:#fde047bf}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-secondary:hover{--tw-text-opacity: 1;color:var(--fallback-s,oklch(var(--s)/var(--tw-text-opacity)))}@media (min-width: 640px){.sm\:px-2{padding-left:.5rem;padding-right:.5rem}}@media (min-width: 768px){.md\:mt-1{margin-top:.25rem}.md\:flex{display:flex}.md\:basis-1\/2{flex-basis:50%}.md\:flex-row{flex-direction:row}.md\:gap-6{gap:1.5rem}.md\:text-6xl{font-size:3.75rem;line-height:1}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:gap-8{gap:2rem}}@media (min-width: 1280px){.xl\:basis-1\/3{flex-basis:33.333333%}}@media (min-width: 1536px){.\32xl\:basis-1\/4{flex-basis:25%}}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center;scroll-behavior:smooth}@media (max-width: 768px){.react-multi-carousel{swiping:true}} diff --git a/assets/index-Bcq5aE4i.js b/assets/index-DRDR3tf1.js similarity index 99% rename from assets/index-Bcq5aE4i.js rename to assets/index-DRDR3tf1.js index a4e4901..f2a6541 100644 --- a/assets/index-Bcq5aE4i.js +++ b/assets/index-DRDR3tf1.js @@ -1,4 +1,4 @@ -import{cx as ll,f as $,cw as Gs,cy as ua,g as ul}from"./index-Dje23Sct.js";import{s as dl,r as Ke,a as un,j as hl,b as fl}from"./hooks.module-CVqc1jrB.js";var da={},_r={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.walletLogo=void 0;const gl=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};dn.walletLogo=gl;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.LINK_API_URL=void 0;hn.LINK_API_URL="https://www.walletlink.org";var L={},Zs={exports:{}};Zs.exports;(function(t){(function(e,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function i(E,o){E.super_=o;var l=function(){};l.prototype=o.prototype,E.prototype=new l,E.prototype.constructor=E}function s(E,o,l){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(E||0,o||10,l||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=ll.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,l){return o.cmp(l)>0?o:l},s.min=function(o,l){return o.cmp(l)<0?o:l},s.prototype._init=function(o,l,f){if(typeof o=="number")return this._initNumber(o,l,f);if(typeof o=="object")return this._initArray(o,l,f);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p=0;p-=3)b=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=b<>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);else if(f==="le")for(p=0,v=0;p>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);return this._strip()};function u(E,o){var l=E.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+E)}function h(E,o,l){var f=u(E,l);return l-1>=o&&(f|=u(E,l-1)<<4),f}s.prototype._parseHex=function(o,l,f){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var p=0;p=l;p-=2)S=h(o,l,p)<=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8;else{var m=o.length-l;for(p=m%2===0?l+1:l;p=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8}this._strip()};function d(E,o,l,f){for(var p=0,v=0,b=Math.min(E.length,l),S=o;S=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v1&&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")]=y}catch{s.prototype.inspect=y}else s.prototype.inspect=y;function y(){return(this.red?""}var _=["","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"],M=[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],C=[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(o,l){o=o||10,l=l|0||1;var f;if(o===16||o==="hex"){f="";for(var p=0,v=0,b=0;b>>24-p&16777215,p+=2,p>=26&&(p-=26,b--),v!==0||b!==this.length-1?f=_[6-m.length]+m+f:f=m+f}for(v!==0&&(f=v.toString(16)+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var c=M[o],w=C[o];f="";var x=this.clone();for(x.negative=0;!x.isZero();){var A=x.modrn(w).toString(o);x=x.idivn(w),x.isZero()?f=A+f:f=_[c-A.length]+A+f}for(this.isZero()&&(f="0"+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,l){return this.toArrayLike(a,o,l)}),s.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var R=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};s.prototype.toArrayLike=function(o,l,f){this._strip();var p=this.byteLength(),v=f||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var b=R(o,v),S=l==="le"?"LE":"BE";return this["_toArrayLike"+S](b,p),b},s.prototype._toArrayLikeLE=function(o,l){for(var f=0,p=0,v=0,b=0;v>8&255),f>16&255),b===6?(f>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f=0&&(o[f--]=S>>8&255),f>=0&&(o[f--]=S>>16&255),b===6?(f>=0&&(o[f--]=S>>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f>=0)for(o[f--]=p;f>=0;)o[f--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var l=o,f=0;return l>=4096&&(f+=13,l>>>=13),l>=64&&(f+=7,l>>>=7),l>=8&&(f+=4,l>>>=4),l>=2&&(f+=2,l>>>=2),f+l},s.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,f=0;return l&8191||(f+=13,l>>>=13),l&127||(f+=7,l>>>=7),l&15||(f+=4,l>>>=4),l&3||(f+=2,l>>>=2),l&1||f++,f},s.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function I(E){for(var o=new Array(E.bitLength()),l=0;l>>p&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var l;this.length>o.length?l=o:l=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var l,f;this.length>o.length?(l=this,f=o):(l=o,f=this);for(var p=0;po.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var l=Math.ceil(o/26)|0,f=o%26;this._expand(l),f>0&&l--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-f),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var f=o/26|0,p=o%26;return this._expand(f+1),l?this.words[f]=this.words[f]|1<o.length?(f=this,p=o):(f=o,p=this);for(var v=0,b=0;b>>26;for(;v!==0&&b>>26;if(this.length=f.length,v!==0)this.words[this.length]=v,this.length++;else if(f!==this)for(;bo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;f>0?(p=this,v=o):(p=o,v=this);for(var b=0,S=0;S>26,this.words[S]=l&67108863;for(;b!==0&&S>26,this.words[S]=l&67108863;if(b===0&&S>>26,x=m&67108863,A=Math.min(c,o.length-1),B=Math.max(0,c-E.length+1);B<=A;B++){var qe=c-B|0;p=E.words[qe]|0,v=o.words[B]|0,b=p*v+x,w+=b/67108864|0,x=b&67108863}l.words[c]=x|0,m=w|0}return m!==0?l.words[c]=m|0:l.length--,l._strip()}var P=function(o,l,f){var p=o.words,v=l.words,b=f.words,S=0,m,c,w,x=p[0]|0,A=x&8191,B=x>>>13,qe=p[1]|0,G=qe&8191,Z=qe>>>13,xi=p[2]|0,te=xi&8191,re=xi>>>13,Pi=p[3]|0,ne=Pi&8191,se=Pi>>>13,Oi=p[4]|0,ie=Oi&8191,oe=Oi>>>13,$i=p[5]|0,ae=$i&8191,ce=$i>>>13,Bi=p[6]|0,le=Bi&8191,ue=Bi>>>13,Fi=p[7]|0,de=Fi&8191,he=Fi>>>13,ji=p[8]|0,fe=ji&8191,ge=ji>>>13,Di=p[9]|0,pe=Di&8191,me=Di>>>13,Hi=v[0]|0,ve=Hi&8191,we=Hi>>>13,Ui=v[1]|0,ye=Ui&8191,be=Ui>>>13,Vi=v[2]|0,_e=Vi&8191,Ee=Vi>>>13,Wi=v[3]|0,Se=Wi&8191,Me=Wi>>>13,zi=v[4]|0,Ce=zi&8191,ke=zi>>>13,qi=v[5]|0,Re=qi&8191,Ie=qi>>>13,Ji=v[6]|0,Ae=Ji&8191,Ne=Ji>>>13,Gi=v[7]|0,Le=Gi&8191,Te=Gi>>>13,Zi=v[8]|0,xe=Zi&8191,Pe=Zi>>>13,Qi=v[9]|0,Oe=Qi&8191,$e=Qi>>>13;f.negative=o.negative^l.negative,f.length=19,m=Math.imul(A,ve),c=Math.imul(A,we),c=c+Math.imul(B,ve)|0,w=Math.imul(B,we);var rs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(rs>>>26)|0,rs&=67108863,m=Math.imul(G,ve),c=Math.imul(G,we),c=c+Math.imul(Z,ve)|0,w=Math.imul(Z,we),m=m+Math.imul(A,ye)|0,c=c+Math.imul(A,be)|0,c=c+Math.imul(B,ye)|0,w=w+Math.imul(B,be)|0;var ns=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ns>>>26)|0,ns&=67108863,m=Math.imul(te,ve),c=Math.imul(te,we),c=c+Math.imul(re,ve)|0,w=Math.imul(re,we),m=m+Math.imul(G,ye)|0,c=c+Math.imul(G,be)|0,c=c+Math.imul(Z,ye)|0,w=w+Math.imul(Z,be)|0,m=m+Math.imul(A,_e)|0,c=c+Math.imul(A,Ee)|0,c=c+Math.imul(B,_e)|0,w=w+Math.imul(B,Ee)|0;var ss=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ss>>>26)|0,ss&=67108863,m=Math.imul(ne,ve),c=Math.imul(ne,we),c=c+Math.imul(se,ve)|0,w=Math.imul(se,we),m=m+Math.imul(te,ye)|0,c=c+Math.imul(te,be)|0,c=c+Math.imul(re,ye)|0,w=w+Math.imul(re,be)|0,m=m+Math.imul(G,_e)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(Z,_e)|0,w=w+Math.imul(Z,Ee)|0,m=m+Math.imul(A,Se)|0,c=c+Math.imul(A,Me)|0,c=c+Math.imul(B,Se)|0,w=w+Math.imul(B,Me)|0;var is=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(is>>>26)|0,is&=67108863,m=Math.imul(ie,ve),c=Math.imul(ie,we),c=c+Math.imul(oe,ve)|0,w=Math.imul(oe,we),m=m+Math.imul(ne,ye)|0,c=c+Math.imul(ne,be)|0,c=c+Math.imul(se,ye)|0,w=w+Math.imul(se,be)|0,m=m+Math.imul(te,_e)|0,c=c+Math.imul(te,Ee)|0,c=c+Math.imul(re,_e)|0,w=w+Math.imul(re,Ee)|0,m=m+Math.imul(G,Se)|0,c=c+Math.imul(G,Me)|0,c=c+Math.imul(Z,Se)|0,w=w+Math.imul(Z,Me)|0,m=m+Math.imul(A,Ce)|0,c=c+Math.imul(A,ke)|0,c=c+Math.imul(B,Ce)|0,w=w+Math.imul(B,ke)|0;var os=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(os>>>26)|0,os&=67108863,m=Math.imul(ae,ve),c=Math.imul(ae,we),c=c+Math.imul(ce,ve)|0,w=Math.imul(ce,we),m=m+Math.imul(ie,ye)|0,c=c+Math.imul(ie,be)|0,c=c+Math.imul(oe,ye)|0,w=w+Math.imul(oe,be)|0,m=m+Math.imul(ne,_e)|0,c=c+Math.imul(ne,Ee)|0,c=c+Math.imul(se,_e)|0,w=w+Math.imul(se,Ee)|0,m=m+Math.imul(te,Se)|0,c=c+Math.imul(te,Me)|0,c=c+Math.imul(re,Se)|0,w=w+Math.imul(re,Me)|0,m=m+Math.imul(G,Ce)|0,c=c+Math.imul(G,ke)|0,c=c+Math.imul(Z,Ce)|0,w=w+Math.imul(Z,ke)|0,m=m+Math.imul(A,Re)|0,c=c+Math.imul(A,Ie)|0,c=c+Math.imul(B,Re)|0,w=w+Math.imul(B,Ie)|0;var as=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(as>>>26)|0,as&=67108863,m=Math.imul(le,ve),c=Math.imul(le,we),c=c+Math.imul(ue,ve)|0,w=Math.imul(ue,we),m=m+Math.imul(ae,ye)|0,c=c+Math.imul(ae,be)|0,c=c+Math.imul(ce,ye)|0,w=w+Math.imul(ce,be)|0,m=m+Math.imul(ie,_e)|0,c=c+Math.imul(ie,Ee)|0,c=c+Math.imul(oe,_e)|0,w=w+Math.imul(oe,Ee)|0,m=m+Math.imul(ne,Se)|0,c=c+Math.imul(ne,Me)|0,c=c+Math.imul(se,Se)|0,w=w+Math.imul(se,Me)|0,m=m+Math.imul(te,Ce)|0,c=c+Math.imul(te,ke)|0,c=c+Math.imul(re,Ce)|0,w=w+Math.imul(re,ke)|0,m=m+Math.imul(G,Re)|0,c=c+Math.imul(G,Ie)|0,c=c+Math.imul(Z,Re)|0,w=w+Math.imul(Z,Ie)|0,m=m+Math.imul(A,Ae)|0,c=c+Math.imul(A,Ne)|0,c=c+Math.imul(B,Ae)|0,w=w+Math.imul(B,Ne)|0;var cs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(cs>>>26)|0,cs&=67108863,m=Math.imul(de,ve),c=Math.imul(de,we),c=c+Math.imul(he,ve)|0,w=Math.imul(he,we),m=m+Math.imul(le,ye)|0,c=c+Math.imul(le,be)|0,c=c+Math.imul(ue,ye)|0,w=w+Math.imul(ue,be)|0,m=m+Math.imul(ae,_e)|0,c=c+Math.imul(ae,Ee)|0,c=c+Math.imul(ce,_e)|0,w=w+Math.imul(ce,Ee)|0,m=m+Math.imul(ie,Se)|0,c=c+Math.imul(ie,Me)|0,c=c+Math.imul(oe,Se)|0,w=w+Math.imul(oe,Me)|0,m=m+Math.imul(ne,Ce)|0,c=c+Math.imul(ne,ke)|0,c=c+Math.imul(se,Ce)|0,w=w+Math.imul(se,ke)|0,m=m+Math.imul(te,Re)|0,c=c+Math.imul(te,Ie)|0,c=c+Math.imul(re,Re)|0,w=w+Math.imul(re,Ie)|0,m=m+Math.imul(G,Ae)|0,c=c+Math.imul(G,Ne)|0,c=c+Math.imul(Z,Ae)|0,w=w+Math.imul(Z,Ne)|0,m=m+Math.imul(A,Le)|0,c=c+Math.imul(A,Te)|0,c=c+Math.imul(B,Le)|0,w=w+Math.imul(B,Te)|0;var ls=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ls>>>26)|0,ls&=67108863,m=Math.imul(fe,ve),c=Math.imul(fe,we),c=c+Math.imul(ge,ve)|0,w=Math.imul(ge,we),m=m+Math.imul(de,ye)|0,c=c+Math.imul(de,be)|0,c=c+Math.imul(he,ye)|0,w=w+Math.imul(he,be)|0,m=m+Math.imul(le,_e)|0,c=c+Math.imul(le,Ee)|0,c=c+Math.imul(ue,_e)|0,w=w+Math.imul(ue,Ee)|0,m=m+Math.imul(ae,Se)|0,c=c+Math.imul(ae,Me)|0,c=c+Math.imul(ce,Se)|0,w=w+Math.imul(ce,Me)|0,m=m+Math.imul(ie,Ce)|0,c=c+Math.imul(ie,ke)|0,c=c+Math.imul(oe,Ce)|0,w=w+Math.imul(oe,ke)|0,m=m+Math.imul(ne,Re)|0,c=c+Math.imul(ne,Ie)|0,c=c+Math.imul(se,Re)|0,w=w+Math.imul(se,Ie)|0,m=m+Math.imul(te,Ae)|0,c=c+Math.imul(te,Ne)|0,c=c+Math.imul(re,Ae)|0,w=w+Math.imul(re,Ne)|0,m=m+Math.imul(G,Le)|0,c=c+Math.imul(G,Te)|0,c=c+Math.imul(Z,Le)|0,w=w+Math.imul(Z,Te)|0,m=m+Math.imul(A,xe)|0,c=c+Math.imul(A,Pe)|0,c=c+Math.imul(B,xe)|0,w=w+Math.imul(B,Pe)|0;var us=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(us>>>26)|0,us&=67108863,m=Math.imul(pe,ve),c=Math.imul(pe,we),c=c+Math.imul(me,ve)|0,w=Math.imul(me,we),m=m+Math.imul(fe,ye)|0,c=c+Math.imul(fe,be)|0,c=c+Math.imul(ge,ye)|0,w=w+Math.imul(ge,be)|0,m=m+Math.imul(de,_e)|0,c=c+Math.imul(de,Ee)|0,c=c+Math.imul(he,_e)|0,w=w+Math.imul(he,Ee)|0,m=m+Math.imul(le,Se)|0,c=c+Math.imul(le,Me)|0,c=c+Math.imul(ue,Se)|0,w=w+Math.imul(ue,Me)|0,m=m+Math.imul(ae,Ce)|0,c=c+Math.imul(ae,ke)|0,c=c+Math.imul(ce,Ce)|0,w=w+Math.imul(ce,ke)|0,m=m+Math.imul(ie,Re)|0,c=c+Math.imul(ie,Ie)|0,c=c+Math.imul(oe,Re)|0,w=w+Math.imul(oe,Ie)|0,m=m+Math.imul(ne,Ae)|0,c=c+Math.imul(ne,Ne)|0,c=c+Math.imul(se,Ae)|0,w=w+Math.imul(se,Ne)|0,m=m+Math.imul(te,Le)|0,c=c+Math.imul(te,Te)|0,c=c+Math.imul(re,Le)|0,w=w+Math.imul(re,Te)|0,m=m+Math.imul(G,xe)|0,c=c+Math.imul(G,Pe)|0,c=c+Math.imul(Z,xe)|0,w=w+Math.imul(Z,Pe)|0,m=m+Math.imul(A,Oe)|0,c=c+Math.imul(A,$e)|0,c=c+Math.imul(B,Oe)|0,w=w+Math.imul(B,$e)|0;var ds=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ds>>>26)|0,ds&=67108863,m=Math.imul(pe,ye),c=Math.imul(pe,be),c=c+Math.imul(me,ye)|0,w=Math.imul(me,be),m=m+Math.imul(fe,_e)|0,c=c+Math.imul(fe,Ee)|0,c=c+Math.imul(ge,_e)|0,w=w+Math.imul(ge,Ee)|0,m=m+Math.imul(de,Se)|0,c=c+Math.imul(de,Me)|0,c=c+Math.imul(he,Se)|0,w=w+Math.imul(he,Me)|0,m=m+Math.imul(le,Ce)|0,c=c+Math.imul(le,ke)|0,c=c+Math.imul(ue,Ce)|0,w=w+Math.imul(ue,ke)|0,m=m+Math.imul(ae,Re)|0,c=c+Math.imul(ae,Ie)|0,c=c+Math.imul(ce,Re)|0,w=w+Math.imul(ce,Ie)|0,m=m+Math.imul(ie,Ae)|0,c=c+Math.imul(ie,Ne)|0,c=c+Math.imul(oe,Ae)|0,w=w+Math.imul(oe,Ne)|0,m=m+Math.imul(ne,Le)|0,c=c+Math.imul(ne,Te)|0,c=c+Math.imul(se,Le)|0,w=w+Math.imul(se,Te)|0,m=m+Math.imul(te,xe)|0,c=c+Math.imul(te,Pe)|0,c=c+Math.imul(re,xe)|0,w=w+Math.imul(re,Pe)|0,m=m+Math.imul(G,Oe)|0,c=c+Math.imul(G,$e)|0,c=c+Math.imul(Z,Oe)|0,w=w+Math.imul(Z,$e)|0;var hs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(hs>>>26)|0,hs&=67108863,m=Math.imul(pe,_e),c=Math.imul(pe,Ee),c=c+Math.imul(me,_e)|0,w=Math.imul(me,Ee),m=m+Math.imul(fe,Se)|0,c=c+Math.imul(fe,Me)|0,c=c+Math.imul(ge,Se)|0,w=w+Math.imul(ge,Me)|0,m=m+Math.imul(de,Ce)|0,c=c+Math.imul(de,ke)|0,c=c+Math.imul(he,Ce)|0,w=w+Math.imul(he,ke)|0,m=m+Math.imul(le,Re)|0,c=c+Math.imul(le,Ie)|0,c=c+Math.imul(ue,Re)|0,w=w+Math.imul(ue,Ie)|0,m=m+Math.imul(ae,Ae)|0,c=c+Math.imul(ae,Ne)|0,c=c+Math.imul(ce,Ae)|0,w=w+Math.imul(ce,Ne)|0,m=m+Math.imul(ie,Le)|0,c=c+Math.imul(ie,Te)|0,c=c+Math.imul(oe,Le)|0,w=w+Math.imul(oe,Te)|0,m=m+Math.imul(ne,xe)|0,c=c+Math.imul(ne,Pe)|0,c=c+Math.imul(se,xe)|0,w=w+Math.imul(se,Pe)|0,m=m+Math.imul(te,Oe)|0,c=c+Math.imul(te,$e)|0,c=c+Math.imul(re,Oe)|0,w=w+Math.imul(re,$e)|0;var fs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(fs>>>26)|0,fs&=67108863,m=Math.imul(pe,Se),c=Math.imul(pe,Me),c=c+Math.imul(me,Se)|0,w=Math.imul(me,Me),m=m+Math.imul(fe,Ce)|0,c=c+Math.imul(fe,ke)|0,c=c+Math.imul(ge,Ce)|0,w=w+Math.imul(ge,ke)|0,m=m+Math.imul(de,Re)|0,c=c+Math.imul(de,Ie)|0,c=c+Math.imul(he,Re)|0,w=w+Math.imul(he,Ie)|0,m=m+Math.imul(le,Ae)|0,c=c+Math.imul(le,Ne)|0,c=c+Math.imul(ue,Ae)|0,w=w+Math.imul(ue,Ne)|0,m=m+Math.imul(ae,Le)|0,c=c+Math.imul(ae,Te)|0,c=c+Math.imul(ce,Le)|0,w=w+Math.imul(ce,Te)|0,m=m+Math.imul(ie,xe)|0,c=c+Math.imul(ie,Pe)|0,c=c+Math.imul(oe,xe)|0,w=w+Math.imul(oe,Pe)|0,m=m+Math.imul(ne,Oe)|0,c=c+Math.imul(ne,$e)|0,c=c+Math.imul(se,Oe)|0,w=w+Math.imul(se,$e)|0;var gs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(gs>>>26)|0,gs&=67108863,m=Math.imul(pe,Ce),c=Math.imul(pe,ke),c=c+Math.imul(me,Ce)|0,w=Math.imul(me,ke),m=m+Math.imul(fe,Re)|0,c=c+Math.imul(fe,Ie)|0,c=c+Math.imul(ge,Re)|0,w=w+Math.imul(ge,Ie)|0,m=m+Math.imul(de,Ae)|0,c=c+Math.imul(de,Ne)|0,c=c+Math.imul(he,Ae)|0,w=w+Math.imul(he,Ne)|0,m=m+Math.imul(le,Le)|0,c=c+Math.imul(le,Te)|0,c=c+Math.imul(ue,Le)|0,w=w+Math.imul(ue,Te)|0,m=m+Math.imul(ae,xe)|0,c=c+Math.imul(ae,Pe)|0,c=c+Math.imul(ce,xe)|0,w=w+Math.imul(ce,Pe)|0,m=m+Math.imul(ie,Oe)|0,c=c+Math.imul(ie,$e)|0,c=c+Math.imul(oe,Oe)|0,w=w+Math.imul(oe,$e)|0;var ps=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ps>>>26)|0,ps&=67108863,m=Math.imul(pe,Re),c=Math.imul(pe,Ie),c=c+Math.imul(me,Re)|0,w=Math.imul(me,Ie),m=m+Math.imul(fe,Ae)|0,c=c+Math.imul(fe,Ne)|0,c=c+Math.imul(ge,Ae)|0,w=w+Math.imul(ge,Ne)|0,m=m+Math.imul(de,Le)|0,c=c+Math.imul(de,Te)|0,c=c+Math.imul(he,Le)|0,w=w+Math.imul(he,Te)|0,m=m+Math.imul(le,xe)|0,c=c+Math.imul(le,Pe)|0,c=c+Math.imul(ue,xe)|0,w=w+Math.imul(ue,Pe)|0,m=m+Math.imul(ae,Oe)|0,c=c+Math.imul(ae,$e)|0,c=c+Math.imul(ce,Oe)|0,w=w+Math.imul(ce,$e)|0;var ms=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ms>>>26)|0,ms&=67108863,m=Math.imul(pe,Ae),c=Math.imul(pe,Ne),c=c+Math.imul(me,Ae)|0,w=Math.imul(me,Ne),m=m+Math.imul(fe,Le)|0,c=c+Math.imul(fe,Te)|0,c=c+Math.imul(ge,Le)|0,w=w+Math.imul(ge,Te)|0,m=m+Math.imul(de,xe)|0,c=c+Math.imul(de,Pe)|0,c=c+Math.imul(he,xe)|0,w=w+Math.imul(he,Pe)|0,m=m+Math.imul(le,Oe)|0,c=c+Math.imul(le,$e)|0,c=c+Math.imul(ue,Oe)|0,w=w+Math.imul(ue,$e)|0;var vs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(vs>>>26)|0,vs&=67108863,m=Math.imul(pe,Le),c=Math.imul(pe,Te),c=c+Math.imul(me,Le)|0,w=Math.imul(me,Te),m=m+Math.imul(fe,xe)|0,c=c+Math.imul(fe,Pe)|0,c=c+Math.imul(ge,xe)|0,w=w+Math.imul(ge,Pe)|0,m=m+Math.imul(de,Oe)|0,c=c+Math.imul(de,$e)|0,c=c+Math.imul(he,Oe)|0,w=w+Math.imul(he,$e)|0;var ws=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ws>>>26)|0,ws&=67108863,m=Math.imul(pe,xe),c=Math.imul(pe,Pe),c=c+Math.imul(me,xe)|0,w=Math.imul(me,Pe),m=m+Math.imul(fe,Oe)|0,c=c+Math.imul(fe,$e)|0,c=c+Math.imul(ge,Oe)|0,w=w+Math.imul(ge,$e)|0;var ys=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ys>>>26)|0,ys&=67108863,m=Math.imul(pe,Oe),c=Math.imul(pe,$e),c=c+Math.imul(me,Oe)|0,w=Math.imul(me,$e);var bs=(S+m|0)+((c&8191)<<13)|0;return S=(w+(c>>>13)|0)+(bs>>>26)|0,bs&=67108863,b[0]=rs,b[1]=ns,b[2]=ss,b[3]=is,b[4]=os,b[5]=as,b[6]=cs,b[7]=ls,b[8]=us,b[9]=ds,b[10]=hs,b[11]=fs,b[12]=gs,b[13]=ps,b[14]=ms,b[15]=vs,b[16]=ws,b[17]=ys,b[18]=bs,S!==0&&(b[19]=S,f.length++),f};Math.imul||(P=T);function k(E,o,l){l.negative=o.negative^E.negative,l.length=E.length+o.length;for(var f=0,p=0,v=0;v>>26)|0,p+=b>>>26,b&=67108863}l.words[v]=S,f=b,b=p}return f!==0?l.words[v]=f:l.length--,l._strip()}function H(E,o,l){return k(E,o,l)}s.prototype.mulTo=function(o,l){var f,p=this.length+o.length;return this.length===10&&o.length===10?f=P(this,o,l):p<63?f=T(this,o,l):p<1024?f=k(this,o,l):f=H(this,o,l),f},s.prototype.mul=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},s.prototype.mulf=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),H(this,o,l)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var f=0,p=0;p>=26,f+=v/67108864|0,f+=b>>>26,this.words[p]=b&67108863}return f!==0&&(this.words[p]=f,this.length++),l?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var l=I(o);if(l.length===0)return new s(1);for(var f=this,p=0;p=0);var l=o%26,f=(o-l)/26,p=67108863>>>26-l<<26-l,v;if(l!==0){var b=0;for(v=0;v>>26-l}b&&(this.words[v]=b,this.length++)}if(f!==0){for(v=this.length-1;v>=0;v--)this.words[v+f]=this.words[v];for(v=0;v=0);var p;l?p=(l-l%26)/26:p=0;var v=o%26,b=Math.min((o-v)/26,this.length),S=67108863^67108863>>>v<b)for(this.length-=b,c=0;c=0&&(w!==0||c>=p);c--){var x=this.words[c]|0;this.words[c]=w<<26-v|x>>>v,w=x&S}return m&&w!==0&&(m.words[m.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,l,f){return n(this.negative===0),this.iushrn(o,l,f)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,f=(o-l)/26,p=1<=0);var l=o%26,f=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(l!==0&&f++,this.length=Math.min(f,this.length),l!==0){var p=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(m/67108864|0),this.words[v+f]=b&67108863}for(;v>26,this.words[v+f]=b&67108863;if(S===0)return this._strip();for(n(S===-1),S=0,v=0;v>26,this.words[v]=b&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,l){var f=this.length-o.length,p=this.clone(),v=o,b=v.words[v.length-1]|0,S=this._countBits(b);f=26-S,f!==0&&(v=v.ushln(f),p.iushln(f),b=v.words[v.length-1]|0);var m=p.length-v.length,c;if(l!=="mod"){c=new s(null),c.length=m+1,c.words=new Array(c.length);for(var w=0;w=0;A--){var B=(p.words[v.length+A]|0)*67108864+(p.words[v.length+A-1]|0);for(B=Math.min(B/b|0,67108863),p._ishlnsubmul(v,B,A);p.negative!==0;)B--,p.negative=0,p._ishlnsubmul(v,1,A),p.isZero()||(p.negative^=1);c&&(c.words[A]=B)}return c&&c._strip(),p._strip(),l!=="div"&&f!==0&&p.iushrn(f),{div:c||null,mod:p}},s.prototype.divmod=function(o,l,f){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var p,v,b;return this.negative!==0&&o.negative===0?(b=this.neg().divmod(o,l),l!=="mod"&&(p=b.div.neg()),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(b=this.divmod(o.neg(),l),l!=="mod"&&(p=b.div.neg()),{div:p,mod:b.mod}):this.negative&o.negative?(b=this.neg().divmod(o.neg(),l),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.isub(o)),{div:b.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,l)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var f=l.div.negative!==0?l.mod.isub(o):l.mod,p=o.ushrn(1),v=o.andln(1),b=f.cmp(p);return b<0||v===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(f*p+(this.words[v]|0))%o;return l?-p:p},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+f*67108864;this.words[p]=v/o|0,f=v%o}return this._strip(),l?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=new s(0),S=new s(1),m=0;l.isEven()&&f.isEven();)l.iushrn(1),f.iushrn(1),++m;for(var c=f.clone(),w=l.clone();!l.isZero();){for(var x=0,A=1;!(l.words[0]&A)&&x<26;++x,A<<=1);if(x>0)for(l.iushrn(x);x-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(w)),p.iushrn(1),v.iushrn(1);for(var B=0,qe=1;!(f.words[0]&qe)&&B<26;++B,qe<<=1);if(B>0)for(f.iushrn(B);B-- >0;)(b.isOdd()||S.isOdd())&&(b.iadd(c),S.isub(w)),b.iushrn(1),S.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(b),v.isub(S)):(f.isub(l),b.isub(p),S.isub(v))}return{a:b,b:S,gcd:f.iushln(m)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=f.clone();l.cmpn(1)>0&&f.cmpn(1)>0;){for(var S=0,m=1;!(l.words[0]&m)&&S<26;++S,m<<=1);if(S>0)for(l.iushrn(S);S-- >0;)p.isOdd()&&p.iadd(b),p.iushrn(1);for(var c=0,w=1;!(f.words[0]&w)&&c<26;++c,w<<=1);if(c>0)for(f.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(b),v.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(v)):(f.isub(l),v.isub(p))}var x;return l.cmpn(1)===0?x=p:x=v,x.cmpn(0)<0&&x.iadd(o),x},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),f=o.clone();l.negative=0,f.negative=0;for(var p=0;l.isEven()&&f.isEven();p++)l.iushrn(1),f.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;f.isEven();)f.iushrn(1);var v=l.cmp(f);if(v<0){var b=l;l=f,f=b}else if(v===0||f.cmpn(1)===0)break;l.isub(f)}while(!0);return f.iushln(p)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var l=o%26,f=(o-l)/26,p=1<>>26,S&=67108863,this.words[b]=S}return v!==0&&(this.words[b]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var f;if(this.length>1)f=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;f=p===o?0:po.length)return 1;if(this.length=0;f--){var p=this.words[f]|0,v=o.words[f]|0;if(p!==v){pv&&(l=1);break}}return l},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new U(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},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(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function O(E,o){this.name=E,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},O.prototype.ireduce=function(o){var l=o,f;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),f=l.bitLength();while(f>this.n);var p=f0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},O.prototype.split=function(o,l){o.iushrn(this.n,0,l)},O.prototype.imulK=function(o){return o.imul(this.k)};function q(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,O),q.prototype.split=function(o,l){for(var f=4194303,p=Math.min(o.length,9),v=0;v>>22,b=S}b>>>=22,o.words[v-10]=b,b===0&&o.length>10?o.length-=10:o.length-=9},q.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,f=0;f>>=26,o.words[f]=v,l=p}return l!==0&&(o.words[o.length++]=l),o},s._prime=function(o){if(N[o])return N[o];var l;if(o==="k256")l=new q;else if(o==="p224")l=new Fe;else if(o==="p192")l=new ze;else if(o==="p25519")l=new Y;else throw new Error("Unknown prime "+o);return N[o]=l,l};function U(E){if(typeof E=="string"){var o=s._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}U.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},U.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},U.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(g(o,o.umod(this.m)._forceRed(this)),o)},U.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},U.prototype.add=function(o,l){this._verify2(o,l);var f=o.add(l);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},U.prototype.iadd=function(o,l){this._verify2(o,l);var f=o.iadd(l);return f.cmp(this.m)>=0&&f.isub(this.m),f},U.prototype.sub=function(o,l){this._verify2(o,l);var f=o.sub(l);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},U.prototype.isub=function(o,l){this._verify2(o,l);var f=o.isub(l);return f.cmpn(0)<0&&f.iadd(this.m),f},U.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},U.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},U.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},U.prototype.isqr=function(o){return this.imul(o,o.clone())},U.prototype.sqr=function(o){return this.mul(o,o)},U.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(o,f)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var b=new s(1).toRed(this),S=b.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,m).cmp(S)!==0;)c.redIAdd(S);for(var w=this.pow(c,p),x=this.pow(o,p.addn(1).iushrn(1)),A=this.pow(o,p),B=v;A.cmp(b)!==0;){for(var qe=A,G=0;qe.cmp(b)!==0;G++)qe=qe.redSqr();n(G=0;v--){for(var w=l.words[v],x=c-1;x>=0;x--){var A=w>>x&1;if(b!==p[0]&&(b=this.sqr(b)),A===0&&S===0){m=0;continue}S<<=1,S|=A,m++,!(m!==f&&(v!==0||x!==0))&&(b=this.mul(b,p[S]),m=0,S=0)}c=26}return b},U.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},U.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},s.mont=function(o){return new J(o)};function J(E){U.call(this,E),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(J,U),J.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},J.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new s(0)._forceRed(this);var f=o.mul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(t,$)})(Zs);var fn=Zs.exports,Mr={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.errorValues=St.standardErrorCodes=void 0;St.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};St.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var gn={},pn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=St,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,M=r){if(_&&Number.isInteger(_)){const C=_.toString();if(g(e.errorValues,C))return e.errorValues[C].message;if(h(_))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const M=_.toString();return!!(e.errorValues[M]||h(_))}t.isValidCode=i;function s(_){var M;if(typeof _=="number")return _;if(a(_))return(M=_.code)!==null&&M!==void 0?M:_.errorCode}t.getErrorCode=s;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function u(_,{shouldIncludeStack:M=!1}={}){const C={};if(_&&typeof _=="object"&&!Array.isArray(_)&&g(_,"code")&&i(_.code)){const R=_;C.code=R.code,R.message&&typeof R.message=="string"?(C.message=R.message,g(R,"data")&&(C.data=R.data)):(C.message=n(C.code),C.data={originalError:d(_)})}else C.code=e.standardErrorCodes.rpc.internal,C.message=y(_,"message")?_.message:r,C.data={originalError:d(_)};return M&&(C.stack=y(_,"stack")?_.stack:void 0),C}t.serialize=u;function h(_){return _>=-32099&&_<=-32e3}function d(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function g(_,M){return Object.prototype.hasOwnProperty.call(_,M)}function y(_,M){return typeof _=="object"&&_!==null&&M in _&&typeof _[M]=="string"}})(pn);Object.defineProperty(gn,"__esModule",{value:!0});gn.standardErrors=void 0;const Ue=St,ha=pn;gn.standardErrors={rpc:{parse:t=>rt(Ue.standardErrorCodes.rpc.parse,t),invalidRequest:t=>rt(Ue.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>rt(Ue.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>rt(Ue.standardErrorCodes.rpc.methodNotFound,t),internal:t=>rt(Ue.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return rt(e,t)},invalidInput:t=>rt(Ue.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>rt(Ue.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>rt(Ue.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>rt(Ue.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>rt(Ue.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>rt(Ue.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Wt(Ue.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Wt(Ue.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Wt(Ue.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Wt(Ue.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Wt(Ue.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Wt(Ue.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pa(e,r,n)}}};function rt(t,e){const[r,n]=fa(e);return new ga(t,r||(0,ha.getMessageFromCode)(t),n)}function Wt(t,e){const[r,n]=fa(e);return new pa(t,r||(0,ha.getMessageFromCode)(t),n)}function fa(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let ga=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},pa=class extends ga{constructor(e,r,n){if(!pl(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function pl(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var mn={},lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.isErrorResponse=void 0;function ml(t){return t.errorMessage!==void 0}lr.isErrorResponse=ml;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.LIB_VERSION=void 0;ur.LIB_VERSION="3.9.3";Object.defineProperty(mn,"__esModule",{value:!0});mn.serializeError=void 0;const vl=lr,wl=ur,yl=St,bl=pn;function _l(t,e){const r=(0,bl.serialize)(El(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",wl.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Sl(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}mn.serializeError=_l;function El(t){return typeof t=="string"?{message:t,code:yl.standardErrorCodes.rpc.internal}:(0,vl.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Sl(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=St;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=gn;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=mn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=pn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Mr);var je={};Object.defineProperty(je,"__esModule",{value:!0});je.ProviderType=je.RegExpString=je.IntNumber=je.BigIntString=je.AddressString=je.HexString=je.OpaqueType=void 0;function Cr(){return t=>t}je.OpaqueType=Cr;je.HexString=Cr();je.AddressString=Cr();je.BigIntString=Cr();function Ml(t){return Math.floor(t)}je.IntNumber=Ml;je.RegExpString=Cr();var Ki;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(Ki||(je.ProviderType=Ki={}));var Cl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(L,"__esModule",{value:!0});L.isMobileWeb=L.getLocation=L.isInIFrame=L.createQrUrl=L.getFavicon=L.range=L.isBigNumber=L.ensureParsedJSONObject=L.ensureBN=L.ensureRegExpString=L.ensureIntNumber=L.ensureBuffer=L.ensureAddressString=L.ensureEvenLengthHexString=L.ensureHexString=L.isHexString=L.prepend0x=L.strip0x=L.has0xPrefix=L.hexStringFromIntNumber=L.intNumberFromHexString=L.bigIntStringFromBN=L.hexStringFromBuffer=L.hexStringToUint8Array=L.uint8ArrayToHex=L.randomBytesHex=void 0;const kt=Cl(fn),Ht=Mr,ot=je,ma=/^[0-9]*$/,va=/^[a-f0-9]*$/;function kl(t){return wa(crypto.getRandomValues(new Uint8Array(t)))}L.randomBytesHex=kl;function wa(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}L.uint8ArrayToHex=wa;function Rl(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}L.hexStringToUint8Array=Rl;function Il(t,e=!1){const r=t.toString("hex");return(0,ot.HexString)(e?`0x${r}`:r)}L.hexStringFromBuffer=Il;function Al(t){return(0,ot.BigIntString)(t.toString(10))}L.bigIntStringFromBN=Al;function Nl(t){return(0,ot.IntNumber)(new kt.default(Rr(t,!1),16).toNumber())}L.intNumberFromHexString=Nl;function Ll(t){return(0,ot.HexString)(`0x${new kt.default(t).toString(16)}`)}L.hexStringFromIntNumber=Ll;function Qs(t){return t.startsWith("0x")||t.startsWith("0X")}L.has0xPrefix=Qs;function vn(t){return Qs(t)?t.slice(2):t}L.strip0x=vn;function ya(t){return Qs(t)?`0x${t.slice(2)}`:`0x${t}`}L.prepend0x=ya;function kr(t){if(typeof t!="string")return!1;const e=vn(t).toLowerCase();return va.test(e)}L.isHexString=kr;function ba(t,e=!1){if(typeof t=="string"){const r=vn(t).toLowerCase();if(va.test(r))return(0,ot.HexString)(e?`0x${r}`:r)}throw Ht.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}L.ensureHexString=ba;function Rr(t,e=!1){let r=ba(t,!1);return r.length%2===1&&(r=(0,ot.HexString)(`0${r}`)),e?(0,ot.HexString)(`0x${r}`):r}L.ensureEvenLengthHexString=Rr;function Tl(t){if(typeof t=="string"){const e=vn(t).toLowerCase();if(kr(e)&&e.length===40)return(0,ot.AddressString)(ya(e))}throw Ht.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}L.ensureAddressString=Tl;function xl(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(kr(t)){const e=Rr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Ht.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}L.ensureBuffer=xl;function _a(t){if(typeof t=="number"&&Number.isInteger(t))return(0,ot.IntNumber)(t);if(typeof t=="string"){if(ma.test(t))return(0,ot.IntNumber)(Number(t));if(kr(t))return(0,ot.IntNumber)(new kt.default(Rr(t,!1),16).toNumber())}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureIntNumber=_a;function Pl(t){if(t instanceof RegExp)return(0,ot.RegExpString)(t.toString());throw Ht.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}L.ensureRegExpString=Pl;function Ol(t){if(t!==null&&(kt.default.isBN(t)||Ea(t)))return new kt.default(t.toString(10),10);if(typeof t=="number")return new kt.default(_a(t));if(typeof t=="string"){if(ma.test(t))return new kt.default(t,10);if(kr(t))return new kt.default(Rr(t,!1),16)}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureBN=Ol;function $l(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Ht.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}L.ensureParsedJSONObject=$l;function Ea(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}L.isBigNumber=Ea;function Bl(t,e){return Array.from({length:e-t},(r,n)=>t+n)}L.range=Bl;function Fl(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}L.getFavicon=Fl;function jl(t,e,r,n,i,s){const a=n?"parent-id":"id",u=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${u}`}L.createQrUrl=jl;function Sa(){try{return window.frameElement!==null}catch{return!1}}L.isInIFrame=Sa;function Dl(){try{return Sa()&&window.top?window.top.location:window.location}catch{return window.location}}L.getLocation=Dl;function Hl(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}L.isMobileWeb=Hl;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.ScopedLocalStorage=void 0;class Ul{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}wn.ScopedLocalStorage=Ul;var rr={},Ir={},Ar={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.EVENTS=void 0;dr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var it={};Object.defineProperty(it,"__esModule",{value:!0});it.RelayAbstract=it.APP_VERSION_KEY=it.LOCAL_STORAGE_ADDRESSES_KEY=it.WALLET_USER_NAME_KEY=void 0;const Xi=Mr;it.WALLET_USER_NAME_KEY="walletUsername";it.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";it.APP_VERSION_KEY="AppVersion";class Vl{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Xi.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Xi.serializeError)(s,e.method);return i})}}it.RelayAbstract=Vl;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.Session=void 0;const Yi=dl,eo=L,to="session:id",ro="session:secret",no="session:linked";class Ks{constructor(e,r,n,i){this._storage=e,this._id=r||(0,eo.randomBytesHex)(16),this._secret=n||(0,eo.randomBytesHex)(32),this._key=new Yi.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(to),n=e.getItem(no),i=e.getItem(ro);return r&&i?new Ks(e,r,i,n==="1"):null}static hash(e){return new Yi.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(to,this._id),this._storage.setItem(ro,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(no,this._linked?"1":"0")}}hr.Session=Ks;var yn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.Cipher=void 0;const zr=L;class Wl{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),u=16,h=a.slice(a.byteLength-u),d=a.slice(0,a.byteLength-u),g=new Uint8Array(h),y=new Uint8Array(d),_=new Uint8Array([...n,...g,...y]);return(0,zr.uint8ArrayToHex)(_)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,zr.hexStringToUint8Array)(e),u=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),g=new Uint8Array([...d,...h]),y={name:"AES-GCM",iv:new Uint8Array(u)};try{const _=await window.crypto.subtle.decrypt(y,s,g),M=new TextDecoder;n(M.decode(_))}catch(_){i(_)}})()})}}bn.Cipher=Wl;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.WalletLinkHTTP=void 0;class zl{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}_n.WalletLinkHTTP=zl;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WalletLinkWebSocket=nr.ConnectionState=void 0;var Kt;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Kt||(nr.ConnectionState=Kt={}));class ql{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Kt.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,u;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(u=this.incomingDataListener)===null||u===void 0||u.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Kt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}nr.WalletLinkWebSocket=ql;Object.defineProperty(yn,"__esModule",{value:!0});yn.WalletLinkConnection=void 0;const zt=je,Jl=bn,ht=dr,so=it,qt=hr,Gl=_n,qr=nr,io=1e4,Zl=6e4;class Ql{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>u.JsonRpcUrl&&this.handleChainUpdated(d,u.JsonRpcUrl)]]).forEach((d,g)=>{const y=u[g];y!==void 0&&d(y)})},this.handleDestroyed=u=>{var h,d;u==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:qt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var h,d;try{const g=await this.cipher.decrypt(u);(h=this.listener)===null||h===void 0||h.accountUpdated(g)}catch{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(u,y)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(so.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(so.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(u),_=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(y,_)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new Jl.Cipher(e.secret),this.diagnostic=i,this.listener=n;const a=new qr.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async u=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:qt.Session.hash(e.id)});let d=!1;switch(u){case qr.ConnectionState.DISCONNECTED:if(!this.destroyed){const g=async()=>{await new Promise(y=>setTimeout(y,5e3)),this.destroyed||a.connect().catch(()=>{g()})};g()}break;case qr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},io),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case qr.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(u=>{var h,d,g;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const y=u.type==="IsLinkedOK"?u.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.LINKED,{sessionIdHash:qt.Session.hash(e.id),linked:y,type:u.type,onlineGuests:u.onlineGuests}),this.linked=y||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:qt.Session.hash(e.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((g=this.requestResolutions.get(u.id))===null||g===void 0||g(u))}),this.ws=a,this.http=new Gl.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.STARTED_CONNECTING,{sessionIdHash:qt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.DISCONNECTED,{sessionIdHash:qt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>io*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=Zl){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}yn.WalletLinkConnection=Ql;var Nr={},Lr={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Kl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.injectCssReset=void 0;const Xl=Kl(Xs);function Yl(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Xl.default)),document.documentElement.appendChild(t)}Lr.injectCssReset=Yl;var En={},Sn={};function Ma(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Ca.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=wt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=K.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var u=0;u<2;u++)if(this.modules[n][a-u]==null){var h=!1;s>>i&1)==1);var d=K.getMask(e,n,a-u);d&&(h=!h),this.modules[n][a-u]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};wt.PAD0=236;wt.PAD1=17;wt.createData=function(t,e,r){for(var n=vt.getRSBlocks(t,e),i=new ka,s=0;su*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+u*8+")");for(i.getLengthInBits()+4<=u*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=u*8||(i.put(wt.PAD0,8),i.getLengthInBits()>=u*8));)i.put(wt.PAD1,8);return wt.createBytes(i,n)};wt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),a=new Array(e.length),u=0;u=0?M.get(C):0}}for(var R=0,g=0;g=0;)e^=K.G15<=0;)e^=K.G18<>>=1;return e},getPatternPosition:function(t){return K.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mt.PATTERN000:return(e+r)%2==0;case Mt.PATTERN001:return e%2==0;case Mt.PATTERN010:return r%3==0;case Mt.PATTERN011:return(e+r)%3==0;case Mt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mt.PATTERN101:return e*r%2+e*r%3==0;case Mt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Xt([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return He.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ve=0;Ve<8;Ve++)He.EXP_TABLE[Ve]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var _s=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Ra(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Rt.L;case"M":return Rt.M;case"Q":return Rt.Q;case"H":return Rt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var g=i(h),y=1,_=0,M=0,C=_s.length;M<=C;M++){var R=_s[M];if(!R)throw new Error("Content too long: expected "+_+" but got "+g);switch(d){case"L":_=R[0];break;case"M":_=R[1];break;case"Q":_=R[2];break;case"H":_=R[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(g<=_)break;y++}if(y>_s.length)throw new Error("Content too long");return y}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),u=r(this.options.ecl);this.qrcode=new wt(a,u),this.qrcode.addData(s),this.qrcode.make()}Ra.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r +import{cy as ll,o as $,cx as Gs,cz as ua,q as ul}from"./index-Dk-UNE0C.js";import{s as dl,r as Ke,a as un,j as hl,b as fl}from"./hooks.module-B4ln6dBc.js";var da={},_r={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.walletLogo=void 0;const gl=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};dn.walletLogo=gl;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.LINK_API_URL=void 0;hn.LINK_API_URL="https://www.walletlink.org";var L={},Zs={exports:{}};Zs.exports;(function(t){(function(e,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function i(E,o){E.super_=o;var l=function(){};l.prototype=o.prototype,E.prototype=new l,E.prototype.constructor=E}function s(E,o,l){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(E||0,o||10,l||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=ll.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,l){return o.cmp(l)>0?o:l},s.min=function(o,l){return o.cmp(l)<0?o:l},s.prototype._init=function(o,l,f){if(typeof o=="number")return this._initNumber(o,l,f);if(typeof o=="object")return this._initArray(o,l,f);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p=0;p-=3)b=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=b<>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);else if(f==="le")for(p=0,v=0;p>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);return this._strip()};function u(E,o){var l=E.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+E)}function h(E,o,l){var f=u(E,l);return l-1>=o&&(f|=u(E,l-1)<<4),f}s.prototype._parseHex=function(o,l,f){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var p=0;p=l;p-=2)S=h(o,l,p)<=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8;else{var m=o.length-l;for(p=m%2===0?l+1:l;p=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8}this._strip()};function d(E,o,l,f){for(var p=0,v=0,b=Math.min(E.length,l),S=o;S=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v1&&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")]=y}catch{s.prototype.inspect=y}else s.prototype.inspect=y;function y(){return(this.red?""}var _=["","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"],M=[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],C=[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(o,l){o=o||10,l=l|0||1;var f;if(o===16||o==="hex"){f="";for(var p=0,v=0,b=0;b>>24-p&16777215,p+=2,p>=26&&(p-=26,b--),v!==0||b!==this.length-1?f=_[6-m.length]+m+f:f=m+f}for(v!==0&&(f=v.toString(16)+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var c=M[o],w=C[o];f="";var x=this.clone();for(x.negative=0;!x.isZero();){var A=x.modrn(w).toString(o);x=x.idivn(w),x.isZero()?f=A+f:f=_[c-A.length]+A+f}for(this.isZero()&&(f="0"+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,l){return this.toArrayLike(a,o,l)}),s.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var R=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};s.prototype.toArrayLike=function(o,l,f){this._strip();var p=this.byteLength(),v=f||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var b=R(o,v),S=l==="le"?"LE":"BE";return this["_toArrayLike"+S](b,p),b},s.prototype._toArrayLikeLE=function(o,l){for(var f=0,p=0,v=0,b=0;v>8&255),f>16&255),b===6?(f>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f=0&&(o[f--]=S>>8&255),f>=0&&(o[f--]=S>>16&255),b===6?(f>=0&&(o[f--]=S>>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f>=0)for(o[f--]=p;f>=0;)o[f--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var l=o,f=0;return l>=4096&&(f+=13,l>>>=13),l>=64&&(f+=7,l>>>=7),l>=8&&(f+=4,l>>>=4),l>=2&&(f+=2,l>>>=2),f+l},s.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,f=0;return l&8191||(f+=13,l>>>=13),l&127||(f+=7,l>>>=7),l&15||(f+=4,l>>>=4),l&3||(f+=2,l>>>=2),l&1||f++,f},s.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function I(E){for(var o=new Array(E.bitLength()),l=0;l>>p&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var l;this.length>o.length?l=o:l=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var l,f;this.length>o.length?(l=this,f=o):(l=o,f=this);for(var p=0;po.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var l=Math.ceil(o/26)|0,f=o%26;this._expand(l),f>0&&l--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-f),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var f=o/26|0,p=o%26;return this._expand(f+1),l?this.words[f]=this.words[f]|1<o.length?(f=this,p=o):(f=o,p=this);for(var v=0,b=0;b>>26;for(;v!==0&&b>>26;if(this.length=f.length,v!==0)this.words[this.length]=v,this.length++;else if(f!==this)for(;bo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;f>0?(p=this,v=o):(p=o,v=this);for(var b=0,S=0;S>26,this.words[S]=l&67108863;for(;b!==0&&S>26,this.words[S]=l&67108863;if(b===0&&S>>26,x=m&67108863,A=Math.min(c,o.length-1),B=Math.max(0,c-E.length+1);B<=A;B++){var qe=c-B|0;p=E.words[qe]|0,v=o.words[B]|0,b=p*v+x,w+=b/67108864|0,x=b&67108863}l.words[c]=x|0,m=w|0}return m!==0?l.words[c]=m|0:l.length--,l._strip()}var P=function(o,l,f){var p=o.words,v=l.words,b=f.words,S=0,m,c,w,x=p[0]|0,A=x&8191,B=x>>>13,qe=p[1]|0,G=qe&8191,Z=qe>>>13,xi=p[2]|0,te=xi&8191,re=xi>>>13,Pi=p[3]|0,ne=Pi&8191,se=Pi>>>13,Oi=p[4]|0,ie=Oi&8191,oe=Oi>>>13,$i=p[5]|0,ae=$i&8191,ce=$i>>>13,Bi=p[6]|0,le=Bi&8191,ue=Bi>>>13,Fi=p[7]|0,de=Fi&8191,he=Fi>>>13,ji=p[8]|0,fe=ji&8191,ge=ji>>>13,Di=p[9]|0,pe=Di&8191,me=Di>>>13,Hi=v[0]|0,ve=Hi&8191,we=Hi>>>13,Ui=v[1]|0,ye=Ui&8191,be=Ui>>>13,Vi=v[2]|0,_e=Vi&8191,Ee=Vi>>>13,Wi=v[3]|0,Se=Wi&8191,Me=Wi>>>13,zi=v[4]|0,Ce=zi&8191,ke=zi>>>13,qi=v[5]|0,Re=qi&8191,Ie=qi>>>13,Ji=v[6]|0,Ae=Ji&8191,Ne=Ji>>>13,Gi=v[7]|0,Le=Gi&8191,Te=Gi>>>13,Zi=v[8]|0,xe=Zi&8191,Pe=Zi>>>13,Qi=v[9]|0,Oe=Qi&8191,$e=Qi>>>13;f.negative=o.negative^l.negative,f.length=19,m=Math.imul(A,ve),c=Math.imul(A,we),c=c+Math.imul(B,ve)|0,w=Math.imul(B,we);var rs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(rs>>>26)|0,rs&=67108863,m=Math.imul(G,ve),c=Math.imul(G,we),c=c+Math.imul(Z,ve)|0,w=Math.imul(Z,we),m=m+Math.imul(A,ye)|0,c=c+Math.imul(A,be)|0,c=c+Math.imul(B,ye)|0,w=w+Math.imul(B,be)|0;var ns=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ns>>>26)|0,ns&=67108863,m=Math.imul(te,ve),c=Math.imul(te,we),c=c+Math.imul(re,ve)|0,w=Math.imul(re,we),m=m+Math.imul(G,ye)|0,c=c+Math.imul(G,be)|0,c=c+Math.imul(Z,ye)|0,w=w+Math.imul(Z,be)|0,m=m+Math.imul(A,_e)|0,c=c+Math.imul(A,Ee)|0,c=c+Math.imul(B,_e)|0,w=w+Math.imul(B,Ee)|0;var ss=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ss>>>26)|0,ss&=67108863,m=Math.imul(ne,ve),c=Math.imul(ne,we),c=c+Math.imul(se,ve)|0,w=Math.imul(se,we),m=m+Math.imul(te,ye)|0,c=c+Math.imul(te,be)|0,c=c+Math.imul(re,ye)|0,w=w+Math.imul(re,be)|0,m=m+Math.imul(G,_e)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(Z,_e)|0,w=w+Math.imul(Z,Ee)|0,m=m+Math.imul(A,Se)|0,c=c+Math.imul(A,Me)|0,c=c+Math.imul(B,Se)|0,w=w+Math.imul(B,Me)|0;var is=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(is>>>26)|0,is&=67108863,m=Math.imul(ie,ve),c=Math.imul(ie,we),c=c+Math.imul(oe,ve)|0,w=Math.imul(oe,we),m=m+Math.imul(ne,ye)|0,c=c+Math.imul(ne,be)|0,c=c+Math.imul(se,ye)|0,w=w+Math.imul(se,be)|0,m=m+Math.imul(te,_e)|0,c=c+Math.imul(te,Ee)|0,c=c+Math.imul(re,_e)|0,w=w+Math.imul(re,Ee)|0,m=m+Math.imul(G,Se)|0,c=c+Math.imul(G,Me)|0,c=c+Math.imul(Z,Se)|0,w=w+Math.imul(Z,Me)|0,m=m+Math.imul(A,Ce)|0,c=c+Math.imul(A,ke)|0,c=c+Math.imul(B,Ce)|0,w=w+Math.imul(B,ke)|0;var os=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(os>>>26)|0,os&=67108863,m=Math.imul(ae,ve),c=Math.imul(ae,we),c=c+Math.imul(ce,ve)|0,w=Math.imul(ce,we),m=m+Math.imul(ie,ye)|0,c=c+Math.imul(ie,be)|0,c=c+Math.imul(oe,ye)|0,w=w+Math.imul(oe,be)|0,m=m+Math.imul(ne,_e)|0,c=c+Math.imul(ne,Ee)|0,c=c+Math.imul(se,_e)|0,w=w+Math.imul(se,Ee)|0,m=m+Math.imul(te,Se)|0,c=c+Math.imul(te,Me)|0,c=c+Math.imul(re,Se)|0,w=w+Math.imul(re,Me)|0,m=m+Math.imul(G,Ce)|0,c=c+Math.imul(G,ke)|0,c=c+Math.imul(Z,Ce)|0,w=w+Math.imul(Z,ke)|0,m=m+Math.imul(A,Re)|0,c=c+Math.imul(A,Ie)|0,c=c+Math.imul(B,Re)|0,w=w+Math.imul(B,Ie)|0;var as=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(as>>>26)|0,as&=67108863,m=Math.imul(le,ve),c=Math.imul(le,we),c=c+Math.imul(ue,ve)|0,w=Math.imul(ue,we),m=m+Math.imul(ae,ye)|0,c=c+Math.imul(ae,be)|0,c=c+Math.imul(ce,ye)|0,w=w+Math.imul(ce,be)|0,m=m+Math.imul(ie,_e)|0,c=c+Math.imul(ie,Ee)|0,c=c+Math.imul(oe,_e)|0,w=w+Math.imul(oe,Ee)|0,m=m+Math.imul(ne,Se)|0,c=c+Math.imul(ne,Me)|0,c=c+Math.imul(se,Se)|0,w=w+Math.imul(se,Me)|0,m=m+Math.imul(te,Ce)|0,c=c+Math.imul(te,ke)|0,c=c+Math.imul(re,Ce)|0,w=w+Math.imul(re,ke)|0,m=m+Math.imul(G,Re)|0,c=c+Math.imul(G,Ie)|0,c=c+Math.imul(Z,Re)|0,w=w+Math.imul(Z,Ie)|0,m=m+Math.imul(A,Ae)|0,c=c+Math.imul(A,Ne)|0,c=c+Math.imul(B,Ae)|0,w=w+Math.imul(B,Ne)|0;var cs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(cs>>>26)|0,cs&=67108863,m=Math.imul(de,ve),c=Math.imul(de,we),c=c+Math.imul(he,ve)|0,w=Math.imul(he,we),m=m+Math.imul(le,ye)|0,c=c+Math.imul(le,be)|0,c=c+Math.imul(ue,ye)|0,w=w+Math.imul(ue,be)|0,m=m+Math.imul(ae,_e)|0,c=c+Math.imul(ae,Ee)|0,c=c+Math.imul(ce,_e)|0,w=w+Math.imul(ce,Ee)|0,m=m+Math.imul(ie,Se)|0,c=c+Math.imul(ie,Me)|0,c=c+Math.imul(oe,Se)|0,w=w+Math.imul(oe,Me)|0,m=m+Math.imul(ne,Ce)|0,c=c+Math.imul(ne,ke)|0,c=c+Math.imul(se,Ce)|0,w=w+Math.imul(se,ke)|0,m=m+Math.imul(te,Re)|0,c=c+Math.imul(te,Ie)|0,c=c+Math.imul(re,Re)|0,w=w+Math.imul(re,Ie)|0,m=m+Math.imul(G,Ae)|0,c=c+Math.imul(G,Ne)|0,c=c+Math.imul(Z,Ae)|0,w=w+Math.imul(Z,Ne)|0,m=m+Math.imul(A,Le)|0,c=c+Math.imul(A,Te)|0,c=c+Math.imul(B,Le)|0,w=w+Math.imul(B,Te)|0;var ls=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ls>>>26)|0,ls&=67108863,m=Math.imul(fe,ve),c=Math.imul(fe,we),c=c+Math.imul(ge,ve)|0,w=Math.imul(ge,we),m=m+Math.imul(de,ye)|0,c=c+Math.imul(de,be)|0,c=c+Math.imul(he,ye)|0,w=w+Math.imul(he,be)|0,m=m+Math.imul(le,_e)|0,c=c+Math.imul(le,Ee)|0,c=c+Math.imul(ue,_e)|0,w=w+Math.imul(ue,Ee)|0,m=m+Math.imul(ae,Se)|0,c=c+Math.imul(ae,Me)|0,c=c+Math.imul(ce,Se)|0,w=w+Math.imul(ce,Me)|0,m=m+Math.imul(ie,Ce)|0,c=c+Math.imul(ie,ke)|0,c=c+Math.imul(oe,Ce)|0,w=w+Math.imul(oe,ke)|0,m=m+Math.imul(ne,Re)|0,c=c+Math.imul(ne,Ie)|0,c=c+Math.imul(se,Re)|0,w=w+Math.imul(se,Ie)|0,m=m+Math.imul(te,Ae)|0,c=c+Math.imul(te,Ne)|0,c=c+Math.imul(re,Ae)|0,w=w+Math.imul(re,Ne)|0,m=m+Math.imul(G,Le)|0,c=c+Math.imul(G,Te)|0,c=c+Math.imul(Z,Le)|0,w=w+Math.imul(Z,Te)|0,m=m+Math.imul(A,xe)|0,c=c+Math.imul(A,Pe)|0,c=c+Math.imul(B,xe)|0,w=w+Math.imul(B,Pe)|0;var us=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(us>>>26)|0,us&=67108863,m=Math.imul(pe,ve),c=Math.imul(pe,we),c=c+Math.imul(me,ve)|0,w=Math.imul(me,we),m=m+Math.imul(fe,ye)|0,c=c+Math.imul(fe,be)|0,c=c+Math.imul(ge,ye)|0,w=w+Math.imul(ge,be)|0,m=m+Math.imul(de,_e)|0,c=c+Math.imul(de,Ee)|0,c=c+Math.imul(he,_e)|0,w=w+Math.imul(he,Ee)|0,m=m+Math.imul(le,Se)|0,c=c+Math.imul(le,Me)|0,c=c+Math.imul(ue,Se)|0,w=w+Math.imul(ue,Me)|0,m=m+Math.imul(ae,Ce)|0,c=c+Math.imul(ae,ke)|0,c=c+Math.imul(ce,Ce)|0,w=w+Math.imul(ce,ke)|0,m=m+Math.imul(ie,Re)|0,c=c+Math.imul(ie,Ie)|0,c=c+Math.imul(oe,Re)|0,w=w+Math.imul(oe,Ie)|0,m=m+Math.imul(ne,Ae)|0,c=c+Math.imul(ne,Ne)|0,c=c+Math.imul(se,Ae)|0,w=w+Math.imul(se,Ne)|0,m=m+Math.imul(te,Le)|0,c=c+Math.imul(te,Te)|0,c=c+Math.imul(re,Le)|0,w=w+Math.imul(re,Te)|0,m=m+Math.imul(G,xe)|0,c=c+Math.imul(G,Pe)|0,c=c+Math.imul(Z,xe)|0,w=w+Math.imul(Z,Pe)|0,m=m+Math.imul(A,Oe)|0,c=c+Math.imul(A,$e)|0,c=c+Math.imul(B,Oe)|0,w=w+Math.imul(B,$e)|0;var ds=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ds>>>26)|0,ds&=67108863,m=Math.imul(pe,ye),c=Math.imul(pe,be),c=c+Math.imul(me,ye)|0,w=Math.imul(me,be),m=m+Math.imul(fe,_e)|0,c=c+Math.imul(fe,Ee)|0,c=c+Math.imul(ge,_e)|0,w=w+Math.imul(ge,Ee)|0,m=m+Math.imul(de,Se)|0,c=c+Math.imul(de,Me)|0,c=c+Math.imul(he,Se)|0,w=w+Math.imul(he,Me)|0,m=m+Math.imul(le,Ce)|0,c=c+Math.imul(le,ke)|0,c=c+Math.imul(ue,Ce)|0,w=w+Math.imul(ue,ke)|0,m=m+Math.imul(ae,Re)|0,c=c+Math.imul(ae,Ie)|0,c=c+Math.imul(ce,Re)|0,w=w+Math.imul(ce,Ie)|0,m=m+Math.imul(ie,Ae)|0,c=c+Math.imul(ie,Ne)|0,c=c+Math.imul(oe,Ae)|0,w=w+Math.imul(oe,Ne)|0,m=m+Math.imul(ne,Le)|0,c=c+Math.imul(ne,Te)|0,c=c+Math.imul(se,Le)|0,w=w+Math.imul(se,Te)|0,m=m+Math.imul(te,xe)|0,c=c+Math.imul(te,Pe)|0,c=c+Math.imul(re,xe)|0,w=w+Math.imul(re,Pe)|0,m=m+Math.imul(G,Oe)|0,c=c+Math.imul(G,$e)|0,c=c+Math.imul(Z,Oe)|0,w=w+Math.imul(Z,$e)|0;var hs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(hs>>>26)|0,hs&=67108863,m=Math.imul(pe,_e),c=Math.imul(pe,Ee),c=c+Math.imul(me,_e)|0,w=Math.imul(me,Ee),m=m+Math.imul(fe,Se)|0,c=c+Math.imul(fe,Me)|0,c=c+Math.imul(ge,Se)|0,w=w+Math.imul(ge,Me)|0,m=m+Math.imul(de,Ce)|0,c=c+Math.imul(de,ke)|0,c=c+Math.imul(he,Ce)|0,w=w+Math.imul(he,ke)|0,m=m+Math.imul(le,Re)|0,c=c+Math.imul(le,Ie)|0,c=c+Math.imul(ue,Re)|0,w=w+Math.imul(ue,Ie)|0,m=m+Math.imul(ae,Ae)|0,c=c+Math.imul(ae,Ne)|0,c=c+Math.imul(ce,Ae)|0,w=w+Math.imul(ce,Ne)|0,m=m+Math.imul(ie,Le)|0,c=c+Math.imul(ie,Te)|0,c=c+Math.imul(oe,Le)|0,w=w+Math.imul(oe,Te)|0,m=m+Math.imul(ne,xe)|0,c=c+Math.imul(ne,Pe)|0,c=c+Math.imul(se,xe)|0,w=w+Math.imul(se,Pe)|0,m=m+Math.imul(te,Oe)|0,c=c+Math.imul(te,$e)|0,c=c+Math.imul(re,Oe)|0,w=w+Math.imul(re,$e)|0;var fs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(fs>>>26)|0,fs&=67108863,m=Math.imul(pe,Se),c=Math.imul(pe,Me),c=c+Math.imul(me,Se)|0,w=Math.imul(me,Me),m=m+Math.imul(fe,Ce)|0,c=c+Math.imul(fe,ke)|0,c=c+Math.imul(ge,Ce)|0,w=w+Math.imul(ge,ke)|0,m=m+Math.imul(de,Re)|0,c=c+Math.imul(de,Ie)|0,c=c+Math.imul(he,Re)|0,w=w+Math.imul(he,Ie)|0,m=m+Math.imul(le,Ae)|0,c=c+Math.imul(le,Ne)|0,c=c+Math.imul(ue,Ae)|0,w=w+Math.imul(ue,Ne)|0,m=m+Math.imul(ae,Le)|0,c=c+Math.imul(ae,Te)|0,c=c+Math.imul(ce,Le)|0,w=w+Math.imul(ce,Te)|0,m=m+Math.imul(ie,xe)|0,c=c+Math.imul(ie,Pe)|0,c=c+Math.imul(oe,xe)|0,w=w+Math.imul(oe,Pe)|0,m=m+Math.imul(ne,Oe)|0,c=c+Math.imul(ne,$e)|0,c=c+Math.imul(se,Oe)|0,w=w+Math.imul(se,$e)|0;var gs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(gs>>>26)|0,gs&=67108863,m=Math.imul(pe,Ce),c=Math.imul(pe,ke),c=c+Math.imul(me,Ce)|0,w=Math.imul(me,ke),m=m+Math.imul(fe,Re)|0,c=c+Math.imul(fe,Ie)|0,c=c+Math.imul(ge,Re)|0,w=w+Math.imul(ge,Ie)|0,m=m+Math.imul(de,Ae)|0,c=c+Math.imul(de,Ne)|0,c=c+Math.imul(he,Ae)|0,w=w+Math.imul(he,Ne)|0,m=m+Math.imul(le,Le)|0,c=c+Math.imul(le,Te)|0,c=c+Math.imul(ue,Le)|0,w=w+Math.imul(ue,Te)|0,m=m+Math.imul(ae,xe)|0,c=c+Math.imul(ae,Pe)|0,c=c+Math.imul(ce,xe)|0,w=w+Math.imul(ce,Pe)|0,m=m+Math.imul(ie,Oe)|0,c=c+Math.imul(ie,$e)|0,c=c+Math.imul(oe,Oe)|0,w=w+Math.imul(oe,$e)|0;var ps=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ps>>>26)|0,ps&=67108863,m=Math.imul(pe,Re),c=Math.imul(pe,Ie),c=c+Math.imul(me,Re)|0,w=Math.imul(me,Ie),m=m+Math.imul(fe,Ae)|0,c=c+Math.imul(fe,Ne)|0,c=c+Math.imul(ge,Ae)|0,w=w+Math.imul(ge,Ne)|0,m=m+Math.imul(de,Le)|0,c=c+Math.imul(de,Te)|0,c=c+Math.imul(he,Le)|0,w=w+Math.imul(he,Te)|0,m=m+Math.imul(le,xe)|0,c=c+Math.imul(le,Pe)|0,c=c+Math.imul(ue,xe)|0,w=w+Math.imul(ue,Pe)|0,m=m+Math.imul(ae,Oe)|0,c=c+Math.imul(ae,$e)|0,c=c+Math.imul(ce,Oe)|0,w=w+Math.imul(ce,$e)|0;var ms=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ms>>>26)|0,ms&=67108863,m=Math.imul(pe,Ae),c=Math.imul(pe,Ne),c=c+Math.imul(me,Ae)|0,w=Math.imul(me,Ne),m=m+Math.imul(fe,Le)|0,c=c+Math.imul(fe,Te)|0,c=c+Math.imul(ge,Le)|0,w=w+Math.imul(ge,Te)|0,m=m+Math.imul(de,xe)|0,c=c+Math.imul(de,Pe)|0,c=c+Math.imul(he,xe)|0,w=w+Math.imul(he,Pe)|0,m=m+Math.imul(le,Oe)|0,c=c+Math.imul(le,$e)|0,c=c+Math.imul(ue,Oe)|0,w=w+Math.imul(ue,$e)|0;var vs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(vs>>>26)|0,vs&=67108863,m=Math.imul(pe,Le),c=Math.imul(pe,Te),c=c+Math.imul(me,Le)|0,w=Math.imul(me,Te),m=m+Math.imul(fe,xe)|0,c=c+Math.imul(fe,Pe)|0,c=c+Math.imul(ge,xe)|0,w=w+Math.imul(ge,Pe)|0,m=m+Math.imul(de,Oe)|0,c=c+Math.imul(de,$e)|0,c=c+Math.imul(he,Oe)|0,w=w+Math.imul(he,$e)|0;var ws=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ws>>>26)|0,ws&=67108863,m=Math.imul(pe,xe),c=Math.imul(pe,Pe),c=c+Math.imul(me,xe)|0,w=Math.imul(me,Pe),m=m+Math.imul(fe,Oe)|0,c=c+Math.imul(fe,$e)|0,c=c+Math.imul(ge,Oe)|0,w=w+Math.imul(ge,$e)|0;var ys=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ys>>>26)|0,ys&=67108863,m=Math.imul(pe,Oe),c=Math.imul(pe,$e),c=c+Math.imul(me,Oe)|0,w=Math.imul(me,$e);var bs=(S+m|0)+((c&8191)<<13)|0;return S=(w+(c>>>13)|0)+(bs>>>26)|0,bs&=67108863,b[0]=rs,b[1]=ns,b[2]=ss,b[3]=is,b[4]=os,b[5]=as,b[6]=cs,b[7]=ls,b[8]=us,b[9]=ds,b[10]=hs,b[11]=fs,b[12]=gs,b[13]=ps,b[14]=ms,b[15]=vs,b[16]=ws,b[17]=ys,b[18]=bs,S!==0&&(b[19]=S,f.length++),f};Math.imul||(P=T);function k(E,o,l){l.negative=o.negative^E.negative,l.length=E.length+o.length;for(var f=0,p=0,v=0;v>>26)|0,p+=b>>>26,b&=67108863}l.words[v]=S,f=b,b=p}return f!==0?l.words[v]=f:l.length--,l._strip()}function H(E,o,l){return k(E,o,l)}s.prototype.mulTo=function(o,l){var f,p=this.length+o.length;return this.length===10&&o.length===10?f=P(this,o,l):p<63?f=T(this,o,l):p<1024?f=k(this,o,l):f=H(this,o,l),f},s.prototype.mul=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},s.prototype.mulf=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),H(this,o,l)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var f=0,p=0;p>=26,f+=v/67108864|0,f+=b>>>26,this.words[p]=b&67108863}return f!==0&&(this.words[p]=f,this.length++),l?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var l=I(o);if(l.length===0)return new s(1);for(var f=this,p=0;p=0);var l=o%26,f=(o-l)/26,p=67108863>>>26-l<<26-l,v;if(l!==0){var b=0;for(v=0;v>>26-l}b&&(this.words[v]=b,this.length++)}if(f!==0){for(v=this.length-1;v>=0;v--)this.words[v+f]=this.words[v];for(v=0;v=0);var p;l?p=(l-l%26)/26:p=0;var v=o%26,b=Math.min((o-v)/26,this.length),S=67108863^67108863>>>v<b)for(this.length-=b,c=0;c=0&&(w!==0||c>=p);c--){var x=this.words[c]|0;this.words[c]=w<<26-v|x>>>v,w=x&S}return m&&w!==0&&(m.words[m.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,l,f){return n(this.negative===0),this.iushrn(o,l,f)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,f=(o-l)/26,p=1<=0);var l=o%26,f=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(l!==0&&f++,this.length=Math.min(f,this.length),l!==0){var p=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(m/67108864|0),this.words[v+f]=b&67108863}for(;v>26,this.words[v+f]=b&67108863;if(S===0)return this._strip();for(n(S===-1),S=0,v=0;v>26,this.words[v]=b&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,l){var f=this.length-o.length,p=this.clone(),v=o,b=v.words[v.length-1]|0,S=this._countBits(b);f=26-S,f!==0&&(v=v.ushln(f),p.iushln(f),b=v.words[v.length-1]|0);var m=p.length-v.length,c;if(l!=="mod"){c=new s(null),c.length=m+1,c.words=new Array(c.length);for(var w=0;w=0;A--){var B=(p.words[v.length+A]|0)*67108864+(p.words[v.length+A-1]|0);for(B=Math.min(B/b|0,67108863),p._ishlnsubmul(v,B,A);p.negative!==0;)B--,p.negative=0,p._ishlnsubmul(v,1,A),p.isZero()||(p.negative^=1);c&&(c.words[A]=B)}return c&&c._strip(),p._strip(),l!=="div"&&f!==0&&p.iushrn(f),{div:c||null,mod:p}},s.prototype.divmod=function(o,l,f){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var p,v,b;return this.negative!==0&&o.negative===0?(b=this.neg().divmod(o,l),l!=="mod"&&(p=b.div.neg()),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(b=this.divmod(o.neg(),l),l!=="mod"&&(p=b.div.neg()),{div:p,mod:b.mod}):this.negative&o.negative?(b=this.neg().divmod(o.neg(),l),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.isub(o)),{div:b.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,l)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var f=l.div.negative!==0?l.mod.isub(o):l.mod,p=o.ushrn(1),v=o.andln(1),b=f.cmp(p);return b<0||v===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(f*p+(this.words[v]|0))%o;return l?-p:p},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+f*67108864;this.words[p]=v/o|0,f=v%o}return this._strip(),l?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=new s(0),S=new s(1),m=0;l.isEven()&&f.isEven();)l.iushrn(1),f.iushrn(1),++m;for(var c=f.clone(),w=l.clone();!l.isZero();){for(var x=0,A=1;!(l.words[0]&A)&&x<26;++x,A<<=1);if(x>0)for(l.iushrn(x);x-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(w)),p.iushrn(1),v.iushrn(1);for(var B=0,qe=1;!(f.words[0]&qe)&&B<26;++B,qe<<=1);if(B>0)for(f.iushrn(B);B-- >0;)(b.isOdd()||S.isOdd())&&(b.iadd(c),S.isub(w)),b.iushrn(1),S.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(b),v.isub(S)):(f.isub(l),b.isub(p),S.isub(v))}return{a:b,b:S,gcd:f.iushln(m)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=f.clone();l.cmpn(1)>0&&f.cmpn(1)>0;){for(var S=0,m=1;!(l.words[0]&m)&&S<26;++S,m<<=1);if(S>0)for(l.iushrn(S);S-- >0;)p.isOdd()&&p.iadd(b),p.iushrn(1);for(var c=0,w=1;!(f.words[0]&w)&&c<26;++c,w<<=1);if(c>0)for(f.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(b),v.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(v)):(f.isub(l),v.isub(p))}var x;return l.cmpn(1)===0?x=p:x=v,x.cmpn(0)<0&&x.iadd(o),x},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),f=o.clone();l.negative=0,f.negative=0;for(var p=0;l.isEven()&&f.isEven();p++)l.iushrn(1),f.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;f.isEven();)f.iushrn(1);var v=l.cmp(f);if(v<0){var b=l;l=f,f=b}else if(v===0||f.cmpn(1)===0)break;l.isub(f)}while(!0);return f.iushln(p)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var l=o%26,f=(o-l)/26,p=1<>>26,S&=67108863,this.words[b]=S}return v!==0&&(this.words[b]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var f;if(this.length>1)f=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;f=p===o?0:po.length)return 1;if(this.length=0;f--){var p=this.words[f]|0,v=o.words[f]|0;if(p!==v){pv&&(l=1);break}}return l},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new U(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},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(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function O(E,o){this.name=E,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},O.prototype.ireduce=function(o){var l=o,f;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),f=l.bitLength();while(f>this.n);var p=f0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},O.prototype.split=function(o,l){o.iushrn(this.n,0,l)},O.prototype.imulK=function(o){return o.imul(this.k)};function q(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,O),q.prototype.split=function(o,l){for(var f=4194303,p=Math.min(o.length,9),v=0;v>>22,b=S}b>>>=22,o.words[v-10]=b,b===0&&o.length>10?o.length-=10:o.length-=9},q.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,f=0;f>>=26,o.words[f]=v,l=p}return l!==0&&(o.words[o.length++]=l),o},s._prime=function(o){if(N[o])return N[o];var l;if(o==="k256")l=new q;else if(o==="p224")l=new Fe;else if(o==="p192")l=new ze;else if(o==="p25519")l=new Y;else throw new Error("Unknown prime "+o);return N[o]=l,l};function U(E){if(typeof E=="string"){var o=s._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}U.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},U.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},U.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(g(o,o.umod(this.m)._forceRed(this)),o)},U.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},U.prototype.add=function(o,l){this._verify2(o,l);var f=o.add(l);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},U.prototype.iadd=function(o,l){this._verify2(o,l);var f=o.iadd(l);return f.cmp(this.m)>=0&&f.isub(this.m),f},U.prototype.sub=function(o,l){this._verify2(o,l);var f=o.sub(l);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},U.prototype.isub=function(o,l){this._verify2(o,l);var f=o.isub(l);return f.cmpn(0)<0&&f.iadd(this.m),f},U.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},U.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},U.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},U.prototype.isqr=function(o){return this.imul(o,o.clone())},U.prototype.sqr=function(o){return this.mul(o,o)},U.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(o,f)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var b=new s(1).toRed(this),S=b.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,m).cmp(S)!==0;)c.redIAdd(S);for(var w=this.pow(c,p),x=this.pow(o,p.addn(1).iushrn(1)),A=this.pow(o,p),B=v;A.cmp(b)!==0;){for(var qe=A,G=0;qe.cmp(b)!==0;G++)qe=qe.redSqr();n(G=0;v--){for(var w=l.words[v],x=c-1;x>=0;x--){var A=w>>x&1;if(b!==p[0]&&(b=this.sqr(b)),A===0&&S===0){m=0;continue}S<<=1,S|=A,m++,!(m!==f&&(v!==0||x!==0))&&(b=this.mul(b,p[S]),m=0,S=0)}c=26}return b},U.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},U.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},s.mont=function(o){return new J(o)};function J(E){U.call(this,E),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(J,U),J.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},J.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new s(0)._forceRed(this);var f=o.mul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(t,$)})(Zs);var fn=Zs.exports,Mr={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.errorValues=St.standardErrorCodes=void 0;St.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};St.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var gn={},pn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=St,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,M=r){if(_&&Number.isInteger(_)){const C=_.toString();if(g(e.errorValues,C))return e.errorValues[C].message;if(h(_))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const M=_.toString();return!!(e.errorValues[M]||h(_))}t.isValidCode=i;function s(_){var M;if(typeof _=="number")return _;if(a(_))return(M=_.code)!==null&&M!==void 0?M:_.errorCode}t.getErrorCode=s;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function u(_,{shouldIncludeStack:M=!1}={}){const C={};if(_&&typeof _=="object"&&!Array.isArray(_)&&g(_,"code")&&i(_.code)){const R=_;C.code=R.code,R.message&&typeof R.message=="string"?(C.message=R.message,g(R,"data")&&(C.data=R.data)):(C.message=n(C.code),C.data={originalError:d(_)})}else C.code=e.standardErrorCodes.rpc.internal,C.message=y(_,"message")?_.message:r,C.data={originalError:d(_)};return M&&(C.stack=y(_,"stack")?_.stack:void 0),C}t.serialize=u;function h(_){return _>=-32099&&_<=-32e3}function d(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function g(_,M){return Object.prototype.hasOwnProperty.call(_,M)}function y(_,M){return typeof _=="object"&&_!==null&&M in _&&typeof _[M]=="string"}})(pn);Object.defineProperty(gn,"__esModule",{value:!0});gn.standardErrors=void 0;const Ue=St,ha=pn;gn.standardErrors={rpc:{parse:t=>rt(Ue.standardErrorCodes.rpc.parse,t),invalidRequest:t=>rt(Ue.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>rt(Ue.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>rt(Ue.standardErrorCodes.rpc.methodNotFound,t),internal:t=>rt(Ue.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return rt(e,t)},invalidInput:t=>rt(Ue.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>rt(Ue.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>rt(Ue.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>rt(Ue.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>rt(Ue.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>rt(Ue.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Wt(Ue.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Wt(Ue.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Wt(Ue.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Wt(Ue.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Wt(Ue.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Wt(Ue.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pa(e,r,n)}}};function rt(t,e){const[r,n]=fa(e);return new ga(t,r||(0,ha.getMessageFromCode)(t),n)}function Wt(t,e){const[r,n]=fa(e);return new pa(t,r||(0,ha.getMessageFromCode)(t),n)}function fa(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let ga=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},pa=class extends ga{constructor(e,r,n){if(!pl(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function pl(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var mn={},lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.isErrorResponse=void 0;function ml(t){return t.errorMessage!==void 0}lr.isErrorResponse=ml;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.LIB_VERSION=void 0;ur.LIB_VERSION="3.9.3";Object.defineProperty(mn,"__esModule",{value:!0});mn.serializeError=void 0;const vl=lr,wl=ur,yl=St,bl=pn;function _l(t,e){const r=(0,bl.serialize)(El(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",wl.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Sl(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}mn.serializeError=_l;function El(t){return typeof t=="string"?{message:t,code:yl.standardErrorCodes.rpc.internal}:(0,vl.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Sl(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=St;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=gn;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=mn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=pn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Mr);var je={};Object.defineProperty(je,"__esModule",{value:!0});je.ProviderType=je.RegExpString=je.IntNumber=je.BigIntString=je.AddressString=je.HexString=je.OpaqueType=void 0;function Cr(){return t=>t}je.OpaqueType=Cr;je.HexString=Cr();je.AddressString=Cr();je.BigIntString=Cr();function Ml(t){return Math.floor(t)}je.IntNumber=Ml;je.RegExpString=Cr();var Ki;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(Ki||(je.ProviderType=Ki={}));var Cl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(L,"__esModule",{value:!0});L.isMobileWeb=L.getLocation=L.isInIFrame=L.createQrUrl=L.getFavicon=L.range=L.isBigNumber=L.ensureParsedJSONObject=L.ensureBN=L.ensureRegExpString=L.ensureIntNumber=L.ensureBuffer=L.ensureAddressString=L.ensureEvenLengthHexString=L.ensureHexString=L.isHexString=L.prepend0x=L.strip0x=L.has0xPrefix=L.hexStringFromIntNumber=L.intNumberFromHexString=L.bigIntStringFromBN=L.hexStringFromBuffer=L.hexStringToUint8Array=L.uint8ArrayToHex=L.randomBytesHex=void 0;const kt=Cl(fn),Ht=Mr,ot=je,ma=/^[0-9]*$/,va=/^[a-f0-9]*$/;function kl(t){return wa(crypto.getRandomValues(new Uint8Array(t)))}L.randomBytesHex=kl;function wa(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}L.uint8ArrayToHex=wa;function Rl(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}L.hexStringToUint8Array=Rl;function Il(t,e=!1){const r=t.toString("hex");return(0,ot.HexString)(e?`0x${r}`:r)}L.hexStringFromBuffer=Il;function Al(t){return(0,ot.BigIntString)(t.toString(10))}L.bigIntStringFromBN=Al;function Nl(t){return(0,ot.IntNumber)(new kt.default(Rr(t,!1),16).toNumber())}L.intNumberFromHexString=Nl;function Ll(t){return(0,ot.HexString)(`0x${new kt.default(t).toString(16)}`)}L.hexStringFromIntNumber=Ll;function Qs(t){return t.startsWith("0x")||t.startsWith("0X")}L.has0xPrefix=Qs;function vn(t){return Qs(t)?t.slice(2):t}L.strip0x=vn;function ya(t){return Qs(t)?`0x${t.slice(2)}`:`0x${t}`}L.prepend0x=ya;function kr(t){if(typeof t!="string")return!1;const e=vn(t).toLowerCase();return va.test(e)}L.isHexString=kr;function ba(t,e=!1){if(typeof t=="string"){const r=vn(t).toLowerCase();if(va.test(r))return(0,ot.HexString)(e?`0x${r}`:r)}throw Ht.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}L.ensureHexString=ba;function Rr(t,e=!1){let r=ba(t,!1);return r.length%2===1&&(r=(0,ot.HexString)(`0${r}`)),e?(0,ot.HexString)(`0x${r}`):r}L.ensureEvenLengthHexString=Rr;function Tl(t){if(typeof t=="string"){const e=vn(t).toLowerCase();if(kr(e)&&e.length===40)return(0,ot.AddressString)(ya(e))}throw Ht.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}L.ensureAddressString=Tl;function xl(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(kr(t)){const e=Rr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Ht.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}L.ensureBuffer=xl;function _a(t){if(typeof t=="number"&&Number.isInteger(t))return(0,ot.IntNumber)(t);if(typeof t=="string"){if(ma.test(t))return(0,ot.IntNumber)(Number(t));if(kr(t))return(0,ot.IntNumber)(new kt.default(Rr(t,!1),16).toNumber())}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureIntNumber=_a;function Pl(t){if(t instanceof RegExp)return(0,ot.RegExpString)(t.toString());throw Ht.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}L.ensureRegExpString=Pl;function Ol(t){if(t!==null&&(kt.default.isBN(t)||Ea(t)))return new kt.default(t.toString(10),10);if(typeof t=="number")return new kt.default(_a(t));if(typeof t=="string"){if(ma.test(t))return new kt.default(t,10);if(kr(t))return new kt.default(Rr(t,!1),16)}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureBN=Ol;function $l(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Ht.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}L.ensureParsedJSONObject=$l;function Ea(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}L.isBigNumber=Ea;function Bl(t,e){return Array.from({length:e-t},(r,n)=>t+n)}L.range=Bl;function Fl(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}L.getFavicon=Fl;function jl(t,e,r,n,i,s){const a=n?"parent-id":"id",u=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${u}`}L.createQrUrl=jl;function Sa(){try{return window.frameElement!==null}catch{return!1}}L.isInIFrame=Sa;function Dl(){try{return Sa()&&window.top?window.top.location:window.location}catch{return window.location}}L.getLocation=Dl;function Hl(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}L.isMobileWeb=Hl;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.ScopedLocalStorage=void 0;class Ul{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}wn.ScopedLocalStorage=Ul;var rr={},Ir={},Ar={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.EVENTS=void 0;dr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var it={};Object.defineProperty(it,"__esModule",{value:!0});it.RelayAbstract=it.APP_VERSION_KEY=it.LOCAL_STORAGE_ADDRESSES_KEY=it.WALLET_USER_NAME_KEY=void 0;const Xi=Mr;it.WALLET_USER_NAME_KEY="walletUsername";it.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";it.APP_VERSION_KEY="AppVersion";class Vl{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Xi.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Xi.serializeError)(s,e.method);return i})}}it.RelayAbstract=Vl;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.Session=void 0;const Yi=dl,eo=L,to="session:id",ro="session:secret",no="session:linked";class Ks{constructor(e,r,n,i){this._storage=e,this._id=r||(0,eo.randomBytesHex)(16),this._secret=n||(0,eo.randomBytesHex)(32),this._key=new Yi.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(to),n=e.getItem(no),i=e.getItem(ro);return r&&i?new Ks(e,r,i,n==="1"):null}static hash(e){return new Yi.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(to,this._id),this._storage.setItem(ro,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(no,this._linked?"1":"0")}}hr.Session=Ks;var yn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.Cipher=void 0;const zr=L;class Wl{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),u=16,h=a.slice(a.byteLength-u),d=a.slice(0,a.byteLength-u),g=new Uint8Array(h),y=new Uint8Array(d),_=new Uint8Array([...n,...g,...y]);return(0,zr.uint8ArrayToHex)(_)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,zr.hexStringToUint8Array)(e),u=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),g=new Uint8Array([...d,...h]),y={name:"AES-GCM",iv:new Uint8Array(u)};try{const _=await window.crypto.subtle.decrypt(y,s,g),M=new TextDecoder;n(M.decode(_))}catch(_){i(_)}})()})}}bn.Cipher=Wl;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.WalletLinkHTTP=void 0;class zl{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}_n.WalletLinkHTTP=zl;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WalletLinkWebSocket=nr.ConnectionState=void 0;var Kt;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Kt||(nr.ConnectionState=Kt={}));class ql{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Kt.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,u;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(u=this.incomingDataListener)===null||u===void 0||u.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Kt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}nr.WalletLinkWebSocket=ql;Object.defineProperty(yn,"__esModule",{value:!0});yn.WalletLinkConnection=void 0;const zt=je,Jl=bn,ht=dr,so=it,qt=hr,Gl=_n,qr=nr,io=1e4,Zl=6e4;class Ql{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>u.JsonRpcUrl&&this.handleChainUpdated(d,u.JsonRpcUrl)]]).forEach((d,g)=>{const y=u[g];y!==void 0&&d(y)})},this.handleDestroyed=u=>{var h,d;u==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:qt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var h,d;try{const g=await this.cipher.decrypt(u);(h=this.listener)===null||h===void 0||h.accountUpdated(g)}catch{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(u,y)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(so.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(so.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(u),_=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(y,_)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new Jl.Cipher(e.secret),this.diagnostic=i,this.listener=n;const a=new qr.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async u=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:qt.Session.hash(e.id)});let d=!1;switch(u){case qr.ConnectionState.DISCONNECTED:if(!this.destroyed){const g=async()=>{await new Promise(y=>setTimeout(y,5e3)),this.destroyed||a.connect().catch(()=>{g()})};g()}break;case qr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},io),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case qr.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(u=>{var h,d,g;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const y=u.type==="IsLinkedOK"?u.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.LINKED,{sessionIdHash:qt.Session.hash(e.id),linked:y,type:u.type,onlineGuests:u.onlineGuests}),this.linked=y||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:qt.Session.hash(e.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((g=this.requestResolutions.get(u.id))===null||g===void 0||g(u))}),this.ws=a,this.http=new Gl.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.STARTED_CONNECTING,{sessionIdHash:qt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.DISCONNECTED,{sessionIdHash:qt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>io*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=Zl){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}yn.WalletLinkConnection=Ql;var Nr={},Lr={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Kl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.injectCssReset=void 0;const Xl=Kl(Xs);function Yl(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Xl.default)),document.documentElement.appendChild(t)}Lr.injectCssReset=Yl;var En={},Sn={};function Ma(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Ca.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=wt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=K.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var u=0;u<2;u++)if(this.modules[n][a-u]==null){var h=!1;s>>i&1)==1);var d=K.getMask(e,n,a-u);d&&(h=!h),this.modules[n][a-u]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};wt.PAD0=236;wt.PAD1=17;wt.createData=function(t,e,r){for(var n=vt.getRSBlocks(t,e),i=new ka,s=0;su*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+u*8+")");for(i.getLengthInBits()+4<=u*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=u*8||(i.put(wt.PAD0,8),i.getLengthInBits()>=u*8));)i.put(wt.PAD1,8);return wt.createBytes(i,n)};wt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),a=new Array(e.length),u=0;u=0?M.get(C):0}}for(var R=0,g=0;g=0;)e^=K.G15<=0;)e^=K.G18<>>=1;return e},getPatternPosition:function(t){return K.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mt.PATTERN000:return(e+r)%2==0;case Mt.PATTERN001:return e%2==0;case Mt.PATTERN010:return r%3==0;case Mt.PATTERN011:return(e+r)%3==0;case Mt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mt.PATTERN101:return e*r%2+e*r%3==0;case Mt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Xt([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return He.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ve=0;Ve<8;Ve++)He.EXP_TABLE[Ve]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var _s=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Ra(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Rt.L;case"M":return Rt.M;case"Q":return Rt.Q;case"H":return Rt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var g=i(h),y=1,_=0,M=0,C=_s.length;M<=C;M++){var R=_s[M];if(!R)throw new Error("Content too long: expected "+_+" but got "+g);switch(d){case"L":_=R[0];break;case"M":_=R[1];break;case"Q":_=R[2];break;case"H":_=R[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(g<=_)break;y++}if(y>_s.length)throw new Error("Content too long");return y}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),u=r(this.options.ecl);this.qrcode=new wt(a,u),this.qrcode.addData(s),this.qrcode.make()}Ra.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r `:"",a=e.width,u=e.height,h=r.length,d=a/(h+2*e.padding),g=u/(h+2*e.padding),y=typeof e.join<"u"?!!e.join:!1,_=typeof e.swap<"u"?!!e.swap:!1,M=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,C=typeof e.predefined<"u"?!!e.predefined:!1,R=C?i+''+s:"",I=i+''+s,T="",P="",k=0;k'+s:T+=i+''+s}}y&&(T=i+'');let U="";if(this.options.image!==void 0&&this.options.image.svg){const E=a*this.options.image.width/100,o=u*this.options.image.height/100,l=a/2-E/2,f=u/2-o/2;U+=``,U+=this.options.image.svg+s,U+=""}var J="";switch(t.container){case"svg":M&&(J+=''+s),J+=''+s,J+=R+I+T,J+=U,J+="";break;case"svg-viewbox":M&&(J+=''+s),J+=''+s,J+=R+I+T,J+=U,J+="";break;case"g":J+=''+s,J+=R+I+T,J+=U,J+="";break;default:J+=(R+I+T+U).replace(/^\s+/,"");break}return J};var su=Ra,iu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.QRCode=void 0;const ou=Ke,co=un,au=iu(su),cu=t=>{const[e,r]=(0,co.useState)("");return(0,co.useEffect)(()=>{var n,i;const s=new au.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,ou.h)("img",{src:e,alt:"QR Code"}):null};Rn.QRCode=cu;var In={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var lu=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});In.Spinner=void 0;const Gr=Ke,uu=lu(Ys),du=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Gr.h)("div",{class:"-cbwsdk-spinner"},(0,Gr.h)("style",null,uu.default),(0,Gr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Gr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};In.Spinner=du;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Ia=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sr,"__esModule",{value:!0});sr.CoinbaseWalletSteps=sr.ConnectContent=void 0;const Ft=Ia(Tr),W=Ke,hu=L,fu=ur,gu=Mn,pu=Cn,mu=kn,vu=Rn,wu=In,yu=Ia(ei),Es={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Aa},bu=t=>t==="light"?"#FFFFFF":"#0A0B0D";function _u(t){const{theme:e}=t,r=(0,hu.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=Es.steps;return(0,W.h)("div",{"data-testid":"connect-content",className:(0,Ft.default)("-cbwsdk-connect-content",e)},(0,W.h)("style",null,yu.default),(0,W.h)("div",{className:"-cbwsdk-connect-content-header"},(0,W.h)("h2",{className:(0,Ft.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,W.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,W.h)(gu.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,W.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,W.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,W.h)(Eu,{title:Es.title,description:Es.description,theme:e})),(0,W.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,W.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,W.h)(vu.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,W.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:fu.LIB_VERSION}),(0,W.h)("input",{type:"hidden",value:r})),(0,W.h)(n,{theme:e}),!t.isConnected&&(0,W.h)("div",{"data-testid":"connecting-spinner",className:(0,Ft.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,W.h)(wu.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,W.h)("p",null,"Connecting...")))))}sr.ConnectContent=_u;function Eu({title:t,description:e,theme:r}){return(0,W.h)("div",{className:(0,Ft.default)("-cbwsdk-connect-item",r)},(0,W.h)("div",null,(0,W.h)(pu.CoinbaseWalletRound,null)),(0,W.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,W.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,W.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function Aa({theme:t}){return(0,W.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,W.h)("li",{className:(0,Ft.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,W.h)("li",{className:(0,Ft.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,W.h)("span",null,"Tap ",(0,W.h)("strong",null,"Scan")," "),(0,W.h)("span",{className:(0,Ft.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,W.h)(mu.QRCodeIcon,{fill:bu(t)})))))}sr.CoinbaseWalletSteps=Aa;var An={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ArrowLeftIcon=void 0;const lo=Ke;function Su(t){return(0,lo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,lo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Nn.ArrowLeftIcon=Su;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LaptopIcon=void 0;const Ss=Ke;function Mu(t){return(0,Ss.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ss.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ss.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Ln.LaptopIcon=Mu;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SafeIcon=void 0;const uo=Ke;function Cu(t){return(0,uo.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,uo.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Tn.SafeIcon=Cu;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Na=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(An,"__esModule",{value:!0});An.TryExtensionContent=void 0;const Nt=Na(Tr),Be=Ke,Ms=un,ku=Nn,Ru=Ln,Iu=Tn,Au=Na(ti);function Nu({theme:t}){const[e,r]=(0,Ms.useState)(!1),n=(0,Ms.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ms.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension",t)},(0,Be.h)("style",null,Au.default),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("h3",{class:(0,Nt.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Be.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Be.h)("button",{class:(0,Nt.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Be.h)("div",null,!e&&(0,Be.h)(ku.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Ru.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Iu.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}An.TryExtensionContent=Nu;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var La=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ConnectDialog=void 0;const Cs=La(Tr),Lt=Ke,ks=un,Lu=sr,Tu=An,xu=La(ri),Pu=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,ks.useState)(!e),[s,a]=(0,ks.useState)(!e);(0,ks.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!e)},10)];return e?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[e]);const u=r?"dark":"light";return(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Lt.h)("style",null,xu.default),(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-backdrop",u,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Lt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Lt.h)(Lu.ConnectContent,{theme:u,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Lt.h)(Tu.TryExtensionContent,{theme:u}))))};Sn.ConnectDialog=Pu;Object.defineProperty(En,"__esModule",{value:!0});En.LinkFlow=void 0;const Rs=Ke,Ou=Sn;class $u{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,Rs.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Rs.render)((0,Rs.h)(Ou.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}En.LinkFlow=$u;var ni={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=$&&$.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Tr),n=Ke,i=un,s=e(si),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",u="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const M=this.nextItemKey++;return this.items.set(M,_),this.render(),()=>{this.items.delete(M),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([_,M])=>(0,n.h)(t.SnackbarInstance,Object.assign({},M,{key:_}))))),this.root)}}t.Snackbar=h;const d=y=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},y.children));t.SnackbarContainer=d;const g=({autoExpand:y,message:_,menuItems:M})=>{const[C,R]=(0,i.useState)(!0),[I,T]=(0,i.useState)(y??!1);(0,i.useEffect)(()=>{const k=[window.setTimeout(()=>{R(!1)},1),window.setTimeout(()=>{T(!0)},1e4)];return()=>{k.forEach(window.clearTimeout)}});const P=()=>{T(!I)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",I&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:P},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!I&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:u,class:"-gear-icon",title:"Expand"}))),M&&M.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},M.map((k,H)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:k.onClick,key:H},(0,n.h)("svg",{width:k.svgWidth,height:k.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":k.defaultFillRule,"clip-rule":k.defaultClipRule,d:k.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},k.info)))))};t.SnackbarInstance=g})(ni);Object.defineProperty(Nr,"__esModule",{value:!0});Nr.WalletLinkRelayUI=void 0;const Bu=Lr,Fu=En,ju=ni;class Du{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new ju.Snackbar({darkMode:e.darkMode}),this.linkFlow=new Fu.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Bu.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Nr.WalletLinkRelayUI=Du;Object.defineProperty(Ar,"__esModule",{value:!0});Ar.WalletLinkRelay=void 0;const Jt=Mr,Hu=je,Q=L,Tt=dr,ho=it,Ct=hr,Uu=yn,xt=lr,Vu=Nr;class Et extends ho.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var u;this.isLinked=a;const h=this.storage.getItem(ho.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const d=h.split(" "),g=this.storage.getItem("IsStandaloneSigning")==="true";if(d[0]!==""&&!a&&this.session.linked&&!g){this.isUnlinkedErrorState=!0;const y=this.getSessionIdHash();(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:y})}}},this.metadataUpdated=(a,u)=>{this.storage.setItem(a,u)},this.chainUpdated=(a,u)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===u||(this.chainCallbackParams={chainId:a,jsonRpcUrl:u},this.chainCallback&&this.chainCallback(a,u))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Et.accountRequestCallbackIds.size>0&&(Array.from(Et.accountRequestCallbackIds.values()).forEach(u=>{const h={type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:u}))}),Et.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=Ct.Session.load(this.storage)||new Ct.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new Uu.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,u=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:e});return i.connect(),{session:e,ui:u,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Tt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Ct.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ct.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:u}=this.subscribe();this._session=s,this.connection=u,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Q.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return{promise:new Promise((a,u)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,xt.isErrorResponse)(h))return u(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof Vu.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=Ct.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Tt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Et.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Et.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jt.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),(0,xt.isErrorResponse)(u))return a(new Error(u.errorMessage));s(u)}),this.ui.inlineAccountsResponse()){const u=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Jt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}Et.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,u)=>{this.relayEventManager.callbacks.set(n,g=>{if((0,xt.isErrorResponse)(g))return u(new Error(g.errorMessage));a(g)});const h=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Hu.ProviderType.Unselected}})},d=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:g}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:d,onCancel:h,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,a){const u={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const d=(0,Q.randomBytesHex)(8),g=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,u.method,_),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload}));const y=new Promise((_,M)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,xt.isErrorResponse)(I))return M(new Error(I.errorMessage));_(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:C,type:e,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,u)});return{cancel:g,promise:y}}addEthereumChain(e,r,n,i,s,a){const u={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const d=(0,Q.randomBytesHex)(8),g=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,u.method,_),h==null||h()};return this.ui.inlineAddEthereumChain(e)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload})),{promise:new Promise((_,M)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,xt.isErrorResponse)(I))return M(new Error(I.errorMessage));_(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:I}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:C,onApprove:R,chainId:u.params.chainId,rpcUrls:u.params.rpcUrls,blockExplorerUrls:u.params.blockExplorerUrls,chainName:u.params.chainName,iconUrls:u.params.iconUrls,nativeCurrency:u.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,u)}),cancel:g}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,Q.randomBytesHex)(8),s=u=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,u)};return{promise:new Promise((u,h)=>{this.relayEventManager.callbacks.set(i,y=>{if((0,xt.isErrorResponse)(y)&&y.errorCode)return h(Jt.standardErrors.provider.custom({code:y.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,xt.isErrorResponse)(y))return h(new Error(y.errorMessage));u(y)});const d=y=>{var _;if(y){const M=(_=(0,Jt.getErrorCode)(y))!==null&&_!==void 0?_:Jt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",y instanceof Error?y:Jt.standardErrors.provider.unsupportedChain(e),M)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},g=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:y}}})};this.ui.switchEthereumChain({onCancel:d,onApprove:g,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ct.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Ar.WalletLinkRelay=Et;Et.accountRequestCallbackIds=new Set;var xr={},xn={},Ta={};(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,u)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ni,t)})(Ta);var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var xa=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.RedirectDialog=void 0;const Wu=xa(Tr),mt=Ke,zu=Lr,qu=Ta,Ju=xa(ii);class Gu{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,zu.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,mt.render)(null,this.root),e&&(0,mt.render)((0,mt.h)(Zu,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}xn.RedirectDialog=Gu;const Zu=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,mt.h)(qu.SnackbarContainer,{darkMode:r},(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,mt.h)("style",null,Ju.default),(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,mt.h)("div",{class:(0,Wu.default)("-cbwsdk-redirect-dialog-box",s)},(0,mt.h)("p",null,t),(0,mt.h)("button",{onClick:n},e))))};Object.defineProperty(xr,"__esModule",{value:!0});xr.MobileRelayUI=void 0;const Qu=xn;class Ku{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Qu.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}xr.MobileRelayUI=Ku;Object.defineProperty(Ir,"__esModule",{value:!0});Ir.MobileRelay=void 0;const Xu=L,Yu=Ar,ed=xr;class td extends Yu.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,Xu.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof ed.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Ir.MobileRelay=td;const rd=hl,nd=fn;function Pa(t){return Buffer.allocUnsafe(t).fill(0)}function Oa(t,e,r){const n=Pa(e);return t=Pn(t),r?t.length"u")throw new Error("Not an array?");if(r=Da(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(pt(t,e[s]));if(r==="dynamic"){var a=pt("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([pt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,jt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Yt(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return jt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=fo(t),n=Pt(e),n<0)throw new Error("Supplied ufixed is negative");return pt("uint256",n.mul(new $t(2).pow(new $t(r[1]))))}else if(t.startsWith("fixed"))return r=fo(t),pt("int256",Pt(e).mul(new $t(2).pow(new $t(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function cd(t){return t==="string"||t==="bytes"||Da(t)==="dynamic"}function ld(t){return t.lastIndexOf("]")===t.length-1}function ud(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var a=ja(t[s]),u=e[s],h=pt(a,u);cd(a)?(r.push(pt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function Ha(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(jt.setLengthRight(u,r))}else if(a.startsWith("uint")){if(r=Yt(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=Yt(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function dd(t,e){return jt.keccak(Ha(t,e))}var hd={rawEncode:ud,solidityPack:Ha,soliditySHA3:dd};const lt=Fa,br=hd,Ua={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Is={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const a=(u,h,d)=>{if(r[h]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":lt.keccak(this.encodeData(h,d,r,n))];if(d===void 0)throw new Error(`missing value for field ${u} of type ${h}`);if(h==="bytes")return["bytes32",lt.keccak(d)];if(h==="string")return typeof d=="string"&&(d=Buffer.from(d,"utf8")),["bytes32",lt.keccak(d)];if(h.lastIndexOf("]")===h.length-1){const g=h.slice(0,h.lastIndexOf("[")),y=d.map(_=>a(u,g,_));return["bytes32",lt.keccak(br.rawEncode(y.map(([_])=>_),y.map(([,_])=>_)))]}return[h,d]};for(const u of r[t]){const[h,d]=a(u.name,u.type,e[u.name]);i.push(h),s.push(d)}}else for(const a of r[t]){let u=e[a.name];if(u!==void 0)if(a.type==="bytes")i.push("bytes32"),u=lt.keccak(u),s.push(u);else if(a.type==="string")i.push("bytes32"),typeof u=="string"&&(u=Buffer.from(u,"utf8")),u=lt.keccak(u),s.push(u);else if(r[a.type]!==void 0)i.push("bytes32"),u=lt.keccak(this.encodeData(a.type,u,r,n)),s.push(u);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(u)}}return br.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:a,type:u})=>u+" "+a).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return lt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return lt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Ua.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),lt.keccak(Buffer.concat(n))}};var fd={TYPED_MESSAGE_SCHEMA:Ua,TypedDataUtils:Is,hashForSignTypedDataLegacy:function(t){return gd(t.data)},hashForSignTypedData_v3:function(t){return Is.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Is.hash(t.data)}};function gd(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?lt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return br.soliditySHA3(["bytes32","bytes32"],[br.soliditySHA3(new Array(t.length).fill("string"),i),br.soliditySHA3(n,r)])}var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.filterFromParam=ir.FilterPolyfill=void 0;const Qt=je,Ge=L,pd=5*60*1e3,Ot={jsonrpc:"2.0",id:0};class md{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Qt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Va(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ge.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Ge.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Ge.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Ge.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Ge.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Zr())}async getFilterLogs(e){const r=(0,Ge.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getLogs",params:[go(n)]})):Zr()}makeFilterId(){return(0,Qt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Zr();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return Qr();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getLogs",params:[go(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const u=a.result.map(d=>(0,Ge.intNumberFromHexString)(d.blockNumber||"0x0")),h=Math.max(...u);if(h&&h>n){const d=(0,Qt.IntNumber)(h+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${d}`),this.cursors.set(e,d)}}return a}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Zr();const n=await this.getCurrentBlockHeight();if(r>n)return Qr();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Ge.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Qt.IntNumber)(a))))).filter(a=>!!a),s=(0,Qt.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Ot),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Qr())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},pd);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_blockNumber",params:[]}));return(0,Ge.intNumberFromHexString)((0,Ge.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getBlockByNumber",params:[(0,Ge.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ge.ensureHexString)(r.result.hash):null}}ir.FilterPolyfill=md;function Va(t){return{fromBlock:po(t.fromBlock),toBlock:po(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ir.filterFromParam=Va;function go(t){const e={fromBlock:mo(t.fromBlock),toBlock:mo(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function po(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Qt.IntNumber)(0);if((0,Ge.isHexString)(t))return(0,Ge.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function mo(t){return t==="latest"?t:(0,Ge.hexStringFromIntNumber)(t)}function Zr(){return Object.assign(Object.assign({},Ot),{error:{code:-32e3,message:"filter not found"}})}function Qr(){return Object.assign(Object.assign({},Ot),{result:[]})}var On={},Wa={},$n={},oi=vd;function vd(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const vo=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(a,u){if(e.multiArgs){const h=new Array(arguments.length-1);for(let d=1;d{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):vo(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?vo(s,e):s}return n},Pr={},Or={};Object.defineProperty(Or,"__esModule",{value:!0});const yd=ua;function wo(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function bd(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")wo(s,this,r);else{const a=s.length,u=bd(s);for(let h=0;ht+e,yo=["sync","latest"];class kd extends Sd.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Md,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){yo.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return yo.map(e=>this.listenerCount(e)).reduce(Cd)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=bo(e),i=bo(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Pr.BaseBlockTracker=kd;function bo(t){return Number.parseInt(t,16)}var za={},qa={},We={};class Ja extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...a}=e,{path:u}=e,h=u.length===0?i:`At path: ${u.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Rd(t){return at(t)&&typeof t[Symbol.iterator]=="function"}function at(t){return typeof t=="object"&&t!=null}function _o(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function De(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Id(t){const{done:e,value:r}=t.next();return e?void 0:r}function Ad(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:a}=r,{refinement:u,message:h=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${De(n)}\``}=t;return{value:n,type:a,refinement:u,key:i[i.length-1],path:i,branch:s,...t,message:h}}function*Hs(t,e,r,n){Rd(t)||(t=[t]);for(const i of t){const s=Ad(i,e,r,n);s&&(yield s)}}function*ai(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:a=!1}=r,u={path:n,branch:i};if(s&&(t=e.coercer(t,u),a&&e.type!=="type"&&at(e.schema)&&at(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let h="valid";for(const d of e.validator(t,u))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,g,y]of e.entries(t,u)){const _=ai(g,y,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,g],coerce:s,mask:a,message:r.message});for(const M of _)M[0]?(h=M[0].refinement!=null?"not_refined":"not_valid",yield[M[0],void 0]):s&&(g=M[1],d===void 0?t=g:t instanceof Map?t.set(d,g):t instanceof Set?t.add(g):at(t)&&(g!==void 0||d in t)&&(t[d]=g))}if(h!=="not_valid")for(const d of e.refiner(t,u))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,t])}class ee{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:u=function*(){}}=e;this.type=r,this.schema=n,this.entries=u,this.coercer=a,i?this.validator=(h,d)=>{const g=i(h,d);return Hs(g,d,this,h)}:this.validator=()=>[],s?this.refiner=(h,d)=>{const g=s(h,d);return Hs(g,d,this,h)}:this.refiner=()=>[]}assert(e,r){return Ga(e,this,r)}create(e,r){return Za(e,this,r)}is(e){return ci(e,this)}mask(e,r){return Qa(e,this,r)}validate(e,r={}){return fr(e,this,r)}}function Ga(t,e,r){const n=fr(t,e,{message:r});if(n[0])throw n[0]}function Za(t,e,r){const n=fr(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Qa(t,e,r){const n=fr(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ci(t,e){return!fr(t,e)[0]}function fr(t,e,r={}){const n=ai(t,e,r),i=Id(n);return i[0]?[new Ja(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function Nd(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Br(n):$r(n)}function Xe(t,e){return new ee({type:t,schema:null,validator:e})}function Ld(t,e){return new ee({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Td(t){return new ee({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function xd(t){let e;return new ee({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Pd(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Br(n);default:return $r(n)}}function Od(t){const e=t instanceof ee,r=e?{...t.schema}:{...t};for(const n in r)r[n]=Ka(r[n]);return e&&t.type==="type"?Br(r):$r(r)}function $d(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];switch(t.type){case"type":return Br(n);default:return $r(n)}}function Bd(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Xe(t,e)}function Fd(){return Xe("any",()=>!0)}function jd(t){return new ee({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${De(e)}`}})}function Dd(){return Xe("bigint",t=>typeof t=="bigint")}function Hd(){return Xe("boolean",t=>typeof t=="boolean")}function Ud(){return Xe("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${De(t)}`)}function Vd(t){const e={},r=t.map(n=>De(n)).join();for(const n of t)e[n]=n;return new ee({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${De(n)}`}})}function Wd(){return Xe("func",t=>typeof t=="function"||`Expected a function, but received: ${De(t)}`)}function zd(t){return Xe("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${De(e)}`)}function qd(){return Xe("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${De(t)}`)}function Jd(t){return new ee({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function Gd(t){const e=De(t),r=typeof t;return new ee({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${De(n)}`}})}function Zd(t,e){return new ee({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${De(r)}`}})}function li(){return Xe("never",()=>!1)}function Qd(t){return new ee({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Kd(){return Xe("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${De(t)}`)}function $r(t){const e=t?Object.keys(t):[],r=li();return new ee({type:"object",schema:t||null,*entries(n){if(t&&at(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return at(n)||`Expected an object, but received: ${De(n)}`},coercer(n){return at(n)?{...n}:n}})}function Ka(t){return new ee({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Xd(t,e){return new ee({type:"record",schema:null,*entries(r){if(at(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return at(r)||`Expected an object, but received: ${De(r)}`}})}function Yd(){return Xe("regexp",t=>t instanceof RegExp)}function eh(t){return new ee({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${De(e)}`}})}function Xa(){return Xe("string",t=>typeof t=="string"||`Expected a string, but received: ${De(t)}`)}function th(t){const e=li();return new ee({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new ee({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...a]=ai(r,s,n),[u]=a;if(u[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${De(r)}`,...i]}})}function Ya(){return Xe("unknown",()=>!0)}function ui(t,e,r){return new ee({...t,coercer:(n,i)=>ci(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function nh(t,e,r={}){return ui(t,Ya(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&_o(n)&&_o(i)){const s={...n};let a=!1;for(const u in i)s[u]===void 0&&(s[u]=i[u],a=!0);if(a)return s}return n})}function sh(t){return ui(t,Xa(),e=>e.trim())}function ih(t){return Ut(t,"empty",e=>{const r=ec(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function ec(t){return t instanceof Map||t instanceof Set?t.size:t.length}function oh(t,e,r={}){const{exclusive:n}=r;return Ut(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function ch(t){return Ut(t,"nonempty",e=>ec(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function lh(t,e){return Ut(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function uh(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Ut(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return e<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return e<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Ut(t,e,r){return new ee({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),a=Hs(s,i,t,n);for(const u of a)yield{...u,refinement:e}}})}const dh=Object.freeze(Object.defineProperty({__proto__:null,Struct:ee,StructError:Ja,any:Fd,array:jd,assert:Ga,assign:Nd,bigint:Dd,boolean:Hd,coerce:ui,create:Za,date:Ud,defaulted:nh,define:Xe,deprecated:Ld,dynamic:Td,empty:ih,enums:Vd,func:Wd,instance:zd,integer:qd,intersection:Jd,is:ci,lazy:xd,literal:Gd,map:Zd,mask:Qa,max:oh,min:ah,never:li,nonempty:ch,nullable:Qd,number:Kd,object:$r,omit:Pd,optional:Ka,partial:Od,pattern:lh,pick:$d,record:Xd,refine:Ut,regexp:Yd,set:eh,size:uh,string:Xa,struct:Bd,trimmed:sh,tuple:th,type:Br,union:rh,unknown:Ya,validate:fr},Symbol.toStringTag,{value:"Module"})),Vt=Gs(dh);Object.defineProperty(We,"__esModule",{value:!0});We.assertExhaustive=We.assertStruct=We.assert=We.AssertionError=void 0;const hh=Vt;function fh(t){return typeof t=="object"&&t!==null&&"message"in t}function gh(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function ph(t){const e=fh(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function tc(t,e){return gh(t)?new t({message:e}):t({message:e})}class di extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}We.AssertionError=di;function mh(t,e="Assertion failed.",r=di){if(!t)throw e instanceof Error?e:tc(r,e)}We.assert=mh;function vh(t,e,r="Assertion failed",n=di){try{(0,hh.assert)(t,e)}catch(i){throw tc(n,`${r}: ${ph(i)}.`)}}We.assertStruct=vh;function wh(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}We.assertExhaustive=wh;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.base64=void 0;const yh=Vt,bh=We,_h=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,bh.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let u;return i?u=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):u=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,yh.pattern)(t,u)};Fr.base64=_h;var z={},jr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Vt,r=We;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(d){return(0,e.is)(d,t.HexStruct)}t.isHexString=n;function i(d){return(0,e.is)(d,t.StrictHexStruct)}t.isStrictHexString=i;function s(d){(0,r.assert)(n(d),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function a(d){(0,r.assert)(i(d),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=a;function u(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}t.add0x=u;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}t.remove0x=h})(jr);Object.defineProperty(z,"__esModule",{value:!0});z.createDataView=z.concatBytes=z.valueToBytes=z.stringToBytes=z.numberToBytes=z.signedBigIntToBytes=z.bigIntToBytes=z.hexToBytes=z.bytesToString=z.bytesToNumber=z.bytesToSignedBigInt=z.bytesToBigInt=z.bytesToHex=z.assertIsBytes=z.isBytes=void 0;const tt=We,Us=jr,Eo=48,So=58,Mo=87;function Eh(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const Sh=Eh();function hi(t){return t instanceof Uint8Array}z.isBytes=hi;function gr(t){(0,tt.assert)(hi(t),"Value must be a Uint8Array.")}z.assertIsBytes=gr;function rc(t){if(gr(t),t.length===0)return"0x";const e=Sh(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Bn(e)}z.bigIntToBytes=sc;function Rh(t,e){(0,tt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Ih(t,e){(0,tt.assert)(typeof t=="bigint","Value must be a bigint."),(0,tt.assert)(typeof e=="number","Byte length must be a number."),(0,tt.assert)(e>0,"Byte length must be greater than 0."),(0,tt.assert)(Rh(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}z.signedBigIntToBytes=Ih;function ic(t){(0,tt.assert)(typeof t=="number","Value must be a number."),(0,tt.assert)(t>=0,"Value must be a non-negative number."),(0,tt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Bn(e)}z.numberToBytes=ic;function oc(t){return(0,tt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}z.stringToBytes=oc;function ac(t){if(typeof t=="bigint")return sc(t);if(typeof t=="number")return ic(t);if(typeof t=="string")return t.startsWith("0x")?Bn(t):oc(t);if(hi(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}z.valueToBytes=ac;function Ah(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Ze(this,ct,"f").get(e)}has(e){return Ze(this,ct,"f").has(e)}keys(){return Ze(this,ct,"f").keys()}values(){return Ze(this,ct,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}or.FrozenMap=fi;class gi{constructor(e){ft.set(this,void 0),uc(this,ft,new Set(e),"f"),Object.freeze(this)}get size(){return Ze(this,ft,"f").size}[(ft=new WeakMap,Symbol.iterator)](){return Ze(this,ft,"f")[Symbol.iterator]()}entries(){return Ze(this,ft,"f").entries()}forEach(e,r){return Ze(this,ft,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ze(this,ft,"f").has(e)}keys(){return Ze(this,ft,"f").keys()}values(){return Ze(this,ft,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}or.FrozenSet=gi;Object.freeze(fi);Object.freeze(fi.prototype);Object.freeze(gi);Object.freeze(gi.prototype);var dc={};Object.defineProperty(dc,"__esModule",{value:!0});var hc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=Vt,r=We,n=()=>(0,e.define)("finite number",N=>(0,e.is)(N,(0,e.number)())&&Number.isFinite(N));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(N,O)=>{function q(Fe,ze){const U=[...ze.validator(Fe,O)];return U.length>0?U:!0}try{const Fe=q(N,t.UnsafeJsonStruct);return Fe!==!0?Fe:q(JSON.parse(JSON.stringify(N)),t.UnsafeJsonStruct)}catch(Fe){return Fe instanceof RangeError?"Circular reference detected":!1}});function i(N){return(0,e.is)(N,t.JsonStruct)}t.isValidJson=i;function s(N){(0,r.assertStruct)(N,t.JsonStruct,"Invalid JSON value");const O=JSON.stringify(N);return new TextEncoder().encode(O).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function a(N){return(0,e.is)(N,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=a;function u(N,O){(0,r.assertStruct)(N,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",O)}t.assertIsJsonRpcNotification=u;function h(N){return(0,e.is)(N,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=h;function d(N,O){(0,r.assertStruct)(N,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",O)}t.assertIsJsonRpcRequest=d,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function g(N){return(0,e.is)(N,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=g;function y(N,O){(0,r.assertStruct)(N,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",O)}t.assertIsPendingJsonRpcResponse=y;function _(N){return(0,e.is)(N,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=_;function M(N,O){(0,r.assertStruct)(N,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",O)}t.assertIsJsonRpcResponse=M;function C(N){return(0,e.is)(N,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function R(N,O){(0,r.assertStruct)(N,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",O)}t.assertIsJsonRpcSuccess=R;function I(N){return(0,e.is)(N,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=I;function T(N,O){(0,r.assertStruct)(N,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",O)}t.assertIsJsonRpcFailure=T;function P(N){return(0,e.is)(N,t.JsonRpcErrorStruct)}t.isJsonRpcError=P;function k(N,O){(0,r.assertStruct)(N,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",O)}t.assertIsJsonRpcError=k;function H(N){const{permitEmptyString:O,permitFractions:q,permitNull:Fe}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},N);return Y=>!!(typeof Y=="number"&&(q||Number.isInteger(Y))||typeof Y=="string"&&(O||Y.length>0)||Fe&&Y===null)}t.getJsonRpcIdValidator=H})(hc);var fc={};Object.defineProperty(fc,"__esModule",{value:!0});var ar={},Vs={exports:{}},As,ko;function Hh(){if(ko)return As;ko=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;As=function(g,y){y=y||{};var _=typeof g;if(_==="string"&&g.length>0)return a(g);if(_==="number"&&isFinite(g))return y.long?h(g):u(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function a(g){if(g=String(g),!(g.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(y){var _=parseFloat(y[1]),M=(y[2]||"ms").toLowerCase();switch(M){case"years":case"year":case"yrs":case"yr":case"y":return _*s;case"weeks":case"week":case"w":return _*i;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*r;case"minutes":case"minute":case"mins":case"min":case"m":return _*e;case"seconds":case"second":case"secs":case"sec":case"s":return _*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function u(g){var y=Math.abs(g);return y>=n?Math.round(g/n)+"d":y>=r?Math.round(g/r)+"h":y>=e?Math.round(g/e)+"m":y>=t?Math.round(g/t)+"s":g+"ms"}function h(g){var y=Math.abs(g);return y>=n?d(g,y,n,"day"):y>=r?d(g,y,r,"hour"):y>=e?d(g,y,e,"minute"):y>=t?d(g,y,t,"second"):g+" ms"}function d(g,y,_,M){var C=y>=_*1.5;return Math.round(g/_)+" "+M+(C?"s":"")}return As}function Uh(t){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=i,r.enabled=a,r.humanize=Hh(),r.destroy=d,Object.keys(t).forEach(g=>{r[g]=t[g]}),r.names=[],r.skips=[],r.formatters={};function e(g){let y=0;for(let _=0;_{if(O==="%%")return"%";H++;const Fe=r.formatters[q];if(typeof Fe=="function"){const ze=I[H];O=Fe.call(T,ze),I.splice(H,1),H--}return O}),r.formatArgs.call(T,I),(T.log||r.log).apply(T,I)}return R.namespace=g,R.useColors=r.useColors(),R.color=r.selectColor(g),R.extend=n,R.destroy=r.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(M!==r.namespaces&&(M=r.namespaces,C=r.enabled(g)),C),set:I=>{_=I}}),typeof r.init=="function"&&r.init(R),R}function n(g,y){const _=r(this.namespace+(typeof y>"u"?":":y)+g);return _.log=this.log,_}function i(g){r.save(g),r.namespaces=g,r.names=[],r.skips=[];let y;const _=(typeof g=="string"?g:"").split(/[\s,]+/),M=_.length;for(y=0;y"-"+y)].join(",");return r.enable(""),g}function a(g){if(g[g.length-1]==="*")return!0;let y,_;for(y=0,_=r.skips.length;y<_;y++)if(r.skips[y].test(g))return!1;for(y=0,_=r.names.length;y<_;y++)if(r.names[y].test(g))return!0;return!1}function u(g){return g.toString().substring(2,g.toString().length-2).replace(/\.\*\?$/,"*")}function h(g){return g instanceof Error?g.stack||g.message:g}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Vh=Uh;(function(t,e){var r={};e.formatArgs=i,e.save=s,e.load=a,e.useColors=n,e.storage=u(),e.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;d.splice(1,0,g,"color: inherit");let y=0,_=0;d[0].replace(/%[a-zA-Z%]/g,M=>{M!=="%%"&&(y++,M==="%c"&&(_=y))}),d.splice(_,0,g)}e.log=console.debug||console.log||(()=>{});function s(d){try{d?e.storage.setItem("debug",d):e.storage.removeItem("debug")}catch{}}function a(){let d;try{d=e.storage.getItem("debug")}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=r.DEBUG),d}function u(){try{return localStorage}catch{}}t.exports=Vh(e);const{formatters:h}=t.exports;h.j=function(d){try{return JSON.stringify(d)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}})(Vs,Vs.exports);var Wh=Vs.exports,zh=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.createModuleLogger=ar.createProjectLogger=void 0;const qh=zh(Wh),Jh=(0,qh.default)("metamask");function Gh(t){return Jh.extend(t)}ar.createProjectLogger=Gh;function Zh(t,e){return t.extend(e)}ar.createModuleLogger=Zh;var gc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(d){return Array.isArray(d)&&d.length>0}t.isNonEmptyArray=e;function r(d){return d==null}t.isNullOrUndefined=r;function n(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}t.isObject=n;const i=(d,g)=>Object.hasOwnProperty.call(d,g);t.hasProperty=i,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(d){if(typeof d!="object"||d===null)return!1;try{let g=d;for(;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(d)===g}catch{return!1}}t.isPlainObject=s;function a(d){return d.charCodeAt(0)<=127}t.isASCII=a;function u(d){var g;return d.split("").reduce((_,M)=>a(M)?_+1:_+2,0)+((g=d.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&g!==void 0?g:[]).length}t.calculateStringSize=u;function h(d){return d.toString().length}t.calculateNumberSize=h})(gc);var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.hexToBigInt=bt.hexToNumber=bt.bigIntToHex=bt.numberToHex=void 0;const er=We,Er=jr,Qh=t=>((0,er.assert)(typeof t=="number","Value must be a number."),(0,er.assert)(t>=0,"Value must be a non-negative number."),(0,er.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Er.add0x)(t.toString(16)));bt.numberToHex=Qh;const Kh=t=>((0,er.assert)(typeof t=="bigint","Value must be a bigint."),(0,er.assert)(t>=0,"Value must be a non-negative bigint."),(0,Er.add0x)(t.toString(16)));bt.bigIntToHex=Kh;const Xh=t=>{(0,Er.assertIsHexString)(t);const e=parseInt(t,16);return(0,er.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};bt.hexToNumber=Xh;const Yh=t=>((0,Er.assertIsHexString)(t),BigInt((0,Er.add0x)(t)));bt.hexToBigInt=Yh;var pc={};Object.defineProperty(pc,"__esModule",{value:!0});var mc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!e(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(mc);var vc={};Object.defineProperty(vc,"__esModule",{value:!0});var wc={},Ws={exports:{}};const ef="2.0.0",yc=256,tf=Number.MAX_SAFE_INTEGER||9007199254740991,rf=16,nf=yc-6,sf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Dn={MAX_LENGTH:yc,MAX_SAFE_COMPONENT_LENGTH:rf,MAX_SAFE_BUILD_LENGTH:nf,MAX_SAFE_INTEGER:tf,RELEASE_TYPES:sf,SEMVER_SPEC_VERSION:ef,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ns={};const of=typeof process=="object"&&Ns&&Ns.NODE_DEBUG&&/\bsemver\b/i.test(Ns.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Hn=of;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Dn,s=Hn;e=t.exports={};const a=e.re=[],u=e.safeRe=[],h=e.src=[],d=e.t={};let g=0;const y="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[y,n]],M=R=>{for(const[I,T]of _)R=R.split(`${I}*`).join(`${I}{0,${T}}`).split(`${I}+`).join(`${I}{1,${T}}`);return R},C=(R,I,T)=>{const P=M(I),k=g++;s(R,k,I),d[R]=k,h[k]=I,a[k]=new RegExp(I,T?"g":void 0),u[k]=new RegExp(P,T?"g":void 0)};C("NUMERICIDENTIFIER","0|[1-9]\\d*"),C("NUMERICIDENTIFIERLOOSE","\\d+"),C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),C("MAINVERSION",`(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})`),C("MAINVERSIONLOOSE",`(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})`),C("PRERELEASEIDENTIFIER",`(?:${h[d.NUMERICIDENTIFIER]}|${h[d.NONNUMERICIDENTIFIER]})`),C("PRERELEASEIDENTIFIERLOOSE",`(?:${h[d.NUMERICIDENTIFIERLOOSE]}|${h[d.NONNUMERICIDENTIFIER]})`),C("PRERELEASE",`(?:-(${h[d.PRERELEASEIDENTIFIER]}(?:\\.${h[d.PRERELEASEIDENTIFIER]})*))`),C("PRERELEASELOOSE",`(?:-?(${h[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[d.PRERELEASEIDENTIFIERLOOSE]})*))`),C("BUILDIDENTIFIER",`${y}+`),C("BUILD",`(?:\\+(${h[d.BUILDIDENTIFIER]}(?:\\.${h[d.BUILDIDENTIFIER]})*))`),C("FULLPLAIN",`v?${h[d.MAINVERSION]}${h[d.PRERELEASE]}?${h[d.BUILD]}?`),C("FULL",`^${h[d.FULLPLAIN]}$`),C("LOOSEPLAIN",`[v=\\s]*${h[d.MAINVERSIONLOOSE]}${h[d.PRERELEASELOOSE]}?${h[d.BUILD]}?`),C("LOOSE",`^${h[d.LOOSEPLAIN]}$`),C("GTLT","((?:<|>)?=?)"),C("XRANGEIDENTIFIERLOOSE",`${h[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),C("XRANGEIDENTIFIER",`${h[d.NUMERICIDENTIFIER]}|x|X|\\*`),C("XRANGEPLAIN",`[v=\\s]*(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:${h[d.PRERELEASE]})?${h[d.BUILD]}?)?)?`),C("XRANGEPLAINLOOSE",`[v=\\s]*(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:${h[d.PRERELEASELOOSE]})?${h[d.BUILD]}?)?)?`),C("XRANGE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAIN]}$`),C("XRANGELOOSE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAINLOOSE]}$`),C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),C("COERCE",`${h[d.COERCEPLAIN]}(?:$|[^\\d])`),C("COERCEFULL",h[d.COERCEPLAIN]+`(?:${h[d.PRERELEASE]})?(?:${h[d.BUILD]})?(?:$|[^\\d])`),C("COERCERTL",h[d.COERCE],!0),C("COERCERTLFULL",h[d.COERCEFULL],!0),C("LONETILDE","(?:~>?)"),C("TILDETRIM",`(\\s*)${h[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",C("TILDE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAIN]}$`),C("TILDELOOSE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAINLOOSE]}$`),C("LONECARET","(?:\\^)"),C("CARETTRIM",`(\\s*)${h[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",C("CARET",`^${h[d.LONECARET]}${h[d.XRANGEPLAIN]}$`),C("CARETLOOSE",`^${h[d.LONECARET]}${h[d.XRANGEPLAINLOOSE]}$`),C("COMPARATORLOOSE",`^${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]})$|^$`),C("COMPARATOR",`^${h[d.GTLT]}\\s*(${h[d.FULLPLAIN]})$|^$`),C("COMPARATORTRIM",`(\\s*)${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]}|${h[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",C("HYPHENRANGE",`^\\s*(${h[d.XRANGEPLAIN]})\\s+-\\s+(${h[d.XRANGEPLAIN]})\\s*$`),C("HYPHENRANGELOOSE",`^\\s*(${h[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[d.XRANGEPLAINLOOSE]})\\s*$`),C("STAR","(<|>)?=?\\s*\\*"),C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ws,Ws.exports);var Dr=Ws.exports;const af=Object.freeze({loose:!0}),cf=Object.freeze({}),lf=t=>t?typeof t!="object"?af:t:cf;var pi=lf;const Ro=/^[0-9]+$/,bc=(t,e)=>{const r=Ro.test(t),n=Ro.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tbc(e,t);var _c={compareIdentifiers:bc,rcompareIdentifiers:uf};const Kr=Hn,{MAX_LENGTH:Io,MAX_SAFE_INTEGER:Xr}=Dn,{safeRe:Ao,t:No}=Dr,df=pi,{compareIdentifiers:Gt}=_c;let hf=class gt{constructor(e,r){if(r=df(r),e instanceof gt){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Io)throw new TypeError(`version is longer than ${Io} characters`);Kr("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?Ao[No.LOOSE]:Ao[No.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Xr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Gt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Qe=hf;const Lo=Qe,ff=(t,e,r=!1)=>{if(t instanceof Lo)return t;try{return new Lo(t,e)}catch(n){if(!r)return null;throw n}};var pr=ff;const gf=pr,pf=(t,e)=>{const r=gf(t,e);return r?r.version:null};var mf=pf;const vf=pr,wf=(t,e)=>{const r=vf(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var yf=wf;const To=Qe,bf=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new To(t instanceof To?t.version:t,r).inc(e,n,i).version}catch{return null}};var _f=bf;const xo=pr,Ef=(t,e)=>{const r=xo(t,null,!0),n=xo(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,u=s?n:r,h=!!a.prerelease.length;if(!!u.prerelease.length&&!h)return!u.patch&&!u.minor?"major":a.patch?"patch":a.minor?"minor":"major";const g=h?"pre":"";return r.major!==n.major?g+"major":r.minor!==n.minor?g+"minor":r.patch!==n.patch?g+"patch":"prerelease"};var Sf=Ef;const Mf=Qe,Cf=(t,e)=>new Mf(t,e).major;var kf=Cf;const Rf=Qe,If=(t,e)=>new Rf(t,e).minor;var Af=If;const Nf=Qe,Lf=(t,e)=>new Nf(t,e).patch;var Tf=Lf;const xf=pr,Pf=(t,e)=>{const r=xf(t,e);return r&&r.prerelease.length?r.prerelease:null};var Of=Pf;const Po=Qe,$f=(t,e,r)=>new Po(t,r).compare(new Po(e,r));var ut=$f;const Bf=ut,Ff=(t,e,r)=>Bf(e,t,r);var jf=Ff;const Df=ut,Hf=(t,e)=>Df(t,e,!0);var Uf=Hf;const Oo=Qe,Vf=(t,e,r)=>{const n=new Oo(t,r),i=new Oo(e,r);return n.compare(i)||n.compareBuild(i)};var mi=Vf;const Wf=mi,zf=(t,e)=>t.sort((r,n)=>Wf(r,n,e));var qf=zf;const Jf=mi,Gf=(t,e)=>t.sort((r,n)=>Jf(n,r,e));var Zf=Gf;const Qf=ut,Kf=(t,e,r)=>Qf(t,e,r)>0;var Un=Kf;const Xf=ut,Yf=(t,e,r)=>Xf(t,e,r)<0;var vi=Yf;const e0=ut,t0=(t,e,r)=>e0(t,e,r)===0;var Ec=t0;const r0=ut,n0=(t,e,r)=>r0(t,e,r)!==0;var Sc=n0;const s0=ut,i0=(t,e,r)=>s0(t,e,r)>=0;var wi=i0;const o0=ut,a0=(t,e,r)=>o0(t,e,r)<=0;var yi=a0;const c0=Ec,l0=Sc,u0=Un,d0=wi,h0=vi,f0=yi,g0=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return c0(t,r,n);case"!=":return l0(t,r,n);case">":return u0(t,r,n);case">=":return d0(t,r,n);case"<":return h0(t,r,n);case"<=":return f0(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Mc=g0;const p0=Qe,m0=pr,{safeRe:Yr,t:en}=Dr,v0=(t,e)=>{if(t instanceof p0)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Yr[en.COERCEFULL]:Yr[en.COERCE]);else{const h=e.includePrerelease?Yr[en.COERCERTLFULL]:Yr[en.COERCERTL];let d;for(;(d=h.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),h.lastIndex=d.index+d[1].length+d[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",u=e.includePrerelease&&r[6]?`+${r[6]}`:"";return m0(`${n}.${i}.${s}${a}${u}`,e)};var w0=v0;class y0{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}}var b0=y0,Ls,$o;function dt(){if($o)return Ls;$o=1;const t=/\s+/g;class e{constructor(l,f){if(f=i(f),l instanceof e)return l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease?l:new e(l.raw,f);if(l instanceof s)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease,this.raw=l.trim().replace(t," "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(v=>!R(v[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&I(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l0&&(this.formatted+="||");const f=this.set[l];for(let p=0;p0&&(this.formatted+=" "),this.formatted+=f[p].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){const p=((this.options.includePrerelease&&M)|(this.options.loose&&C))+":"+l,v=n.get(p);if(v)return v;const b=this.options.loose,S=b?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];l=l.replace(S,J(this.options.includePrerelease)),a("hyphen replace",l),l=l.replace(h[d.COMPARATORTRIM],g),a("comparator trim",l),l=l.replace(h[d.TILDETRIM],y),a("tilde trim",l),l=l.replace(h[d.CARETTRIM],_),a("caret trim",l);let m=l.split(" ").map(A=>P(A,this.options)).join(" ").split(/\s+/).map(A=>U(A,this.options));b&&(m=m.filter(A=>(a("loose invalid filter",A,this.options),!!A.match(h[d.COMPARATORLOOSE])))),a("range list",m);const c=new Map,w=m.map(A=>new s(A,this.options));for(const A of w){if(R(A))return[A];c.set(A.value,A)}c.size>1&&c.has("")&&c.delete("");const x=[...c.values()];return n.set(p,x),x}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Range is required");return this.set.some(p=>T(p,f)&&l.set.some(v=>T(v,f)&&p.every(b=>v.every(S=>b.intersects(S,f)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new u(l,this.options)}catch{return!1}for(let f=0;fo.value==="<0.0.0-0",I=o=>o.value==="",T=(o,l)=>{let f=!0;const p=o.slice();let v=p.pop();for(;f&&p.length;)f=p.every(b=>v.intersects(b,l)),v=p.pop();return f},P=(o,l)=>(a("comp",o,l),o=O(o,l),a("caret",o),o=H(o,l),a("tildes",o),o=Fe(o,l),a("xrange",o),o=Y(o,l),a("stars",o),o),k=o=>!o||o.toLowerCase()==="x"||o==="*",H=(o,l)=>o.trim().split(/\s+/).map(f=>N(f,l)).join(" "),N=(o,l)=>{const f=l.loose?h[d.TILDELOOSE]:h[d.TILDE];return o.replace(f,(p,v,b,S,m)=>{a("tilde",o,p,v,b,S,m);let c;return k(v)?c="":k(b)?c=`>=${v}.0.0 <${+v+1}.0.0-0`:k(S)?c=`>=${v}.${b}.0 <${v}.${+b+1}.0-0`:m?(a("replaceTilde pr",m),c=`>=${v}.${b}.${S}-${m} <${v}.${+b+1}.0-0`):c=`>=${v}.${b}.${S} <${v}.${+b+1}.0-0`,a("tilde return",c),c})},O=(o,l)=>o.trim().split(/\s+/).map(f=>q(f,l)).join(" "),q=(o,l)=>{a("caret",o,l);const f=l.loose?h[d.CARETLOOSE]:h[d.CARET],p=l.includePrerelease?"-0":"";return o.replace(f,(v,b,S,m,c)=>{a("caret",o,v,b,S,m,c);let w;return k(b)?w="":k(S)?w=`>=${b}.0.0${p} <${+b+1}.0.0-0`:k(m)?b==="0"?w=`>=${b}.${S}.0${p} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.0${p} <${+b+1}.0.0-0`:c?(a("replaceCaret pr",c),b==="0"?S==="0"?w=`>=${b}.${S}.${m}-${c} <${b}.${S}.${+m+1}-0`:w=`>=${b}.${S}.${m}-${c} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.${m}-${c} <${+b+1}.0.0-0`):(a("no pr"),b==="0"?S==="0"?w=`>=${b}.${S}.${m}${p} <${b}.${S}.${+m+1}-0`:w=`>=${b}.${S}.${m}${p} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.${m} <${+b+1}.0.0-0`),a("caret return",w),w})},Fe=(o,l)=>(a("replaceXRanges",o,l),o.split(/\s+/).map(f=>ze(f,l)).join(" ")),ze=(o,l)=>{o=o.trim();const f=l.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return o.replace(f,(p,v,b,S,m,c)=>{a("xRange",o,p,v,b,S,m,c);const w=k(b),x=w||k(S),A=x||k(m),B=A;return v==="="&&B&&(v=""),c=l.includePrerelease?"-0":"",w?v===">"||v==="<"?p="<0.0.0-0":p="*":v&&B?(x&&(S=0),m=0,v===">"?(v=">=",x?(b=+b+1,S=0,m=0):(S=+S+1,m=0)):v==="<="&&(v="<",x?b=+b+1:S=+S+1),v==="<"&&(c="-0"),p=`${v+b}.${S}.${m}${c}`):x?p=`>=${b}.0.0${c} <${+b+1}.0.0-0`:A&&(p=`>=${b}.${S}.0${c} <${b}.${+S+1}.0-0`),a("xRange return",p),p})},Y=(o,l)=>(a("replaceStars",o,l),o.trim().replace(h[d.STAR],"")),U=(o,l)=>(a("replaceGTE0",o,l),o.trim().replace(h[l.includePrerelease?d.GTE0PRE:d.GTE0],"")),J=o=>(l,f,p,v,b,S,m,c,w,x,A,B)=>(k(p)?f="":k(v)?f=`>=${p}.0.0${o?"-0":""}`:k(b)?f=`>=${p}.${v}.0${o?"-0":""}`:S?f=`>=${f}`:f=`>=${f}${o?"-0":""}`,k(w)?c="":k(x)?c=`<${+w+1}.0.0-0`:k(A)?c=`<${w}.${+x+1}.0-0`:B?c=`<=${w}.${x}.${A}-${B}`:o?c=`<${w}.${x}.${+A+1}-0`:c=`<=${c}`,`${f} ${c}`.trim()),E=(o,l,f)=>{for(let p=0;p0){const v=o[p].semver;if(v.major===l.major&&v.minor===l.minor&&v.patch===l.patch)return!0}return!1}return!0};return Ls}var Ts,Bo;function Vn(){if(Bo)return Ts;Bo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(g,y){if(y=r(y),g instanceof e){if(g.loose===!!y.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),a("comparator",g,y),this.options=y,this.loose=!!y.loose,this.parse(g),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(g){const y=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=g.match(y);if(!_)throw new TypeError(`Invalid comparator: ${g}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new u(_[2],this.options.loose):this.semver=t}toString(){return this.value}test(g){if(a("Comparator.test",g,this.options.loose),this.semver===t||g===t)return!0;if(typeof g=="string")try{g=new u(g,this.options)}catch{return!1}return s(g,this.operator,this.semver,this.options)}intersects(g,y){if(!(g instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(g.value,y).test(this.value):g.operator===""?g.value===""?!0:new h(this.value,y).test(g.semver):(y=r(y),y.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||s(this.semver,"<",g.semver,y)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||s(this.semver,">",g.semver,y)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}Ts=e;const r=pi,{safeRe:n,t:i}=Dr,s=Mc,a=Hn,u=Qe,h=dt();return Ts}const _0=dt(),E0=(t,e,r)=>{try{e=new _0(e,r)}catch{return!1}return e.test(t)};var Wn=E0;const S0=dt(),M0=(t,e)=>new S0(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var C0=M0;const k0=Qe,R0=dt(),I0=(t,e,r)=>{let n=null,i=null,s=null;try{s=new R0(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new k0(n,r))}),n};var A0=I0;const N0=Qe,L0=dt(),T0=(t,e,r)=>{let n=null,i=null,s=null;try{s=new L0(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new N0(n,r))}),n};var x0=T0;const xs=Qe,P0=dt(),Fo=Un,O0=(t,e)=>{t=new P0(t,e);let r=new xs("0.0.0");if(t.test(r)||(r=new xs("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const u=new xs(a.semver.version);switch(a.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!s||Fo(u,s))&&(s=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Fo(r,s))&&(r=s)}return r&&t.test(r)?r:null};var $0=O0;const B0=dt(),F0=(t,e)=>{try{return new B0(t,e).range||"*"}catch{return null}};var j0=F0;const D0=Qe,Cc=Vn(),{ANY:H0}=Cc,U0=dt(),V0=Wn,jo=Un,Do=vi,W0=yi,z0=wi,q0=(t,e,r,n)=>{t=new D0(t,n),e=new U0(e,n);let i,s,a,u,h;switch(r){case">":i=jo,s=W0,a=Do,u=">",h=">=";break;case"<":i=Do,s=z0,a=jo,u="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(V0(t,e,n))return!1;for(let d=0;d{M.semver===H0&&(M=new Cc(">=0.0.0")),y=y||M,_=_||M,i(M.semver,y.semver,n)?y=M:a(M.semver,_.semver,n)&&(_=M)}),y.operator===u||y.operator===h||(!_.operator||_.operator===u)&&s(t,_.semver))return!1;if(_.operator===h&&a(t,_.semver))return!1}return!0};var bi=q0;const J0=bi,G0=(t,e,r)=>J0(t,e,">",r);var Z0=G0;const Q0=bi,K0=(t,e,r)=>Q0(t,e,"<",r);var X0=K0;const Ho=dt(),Y0=(t,e,r)=>(t=new Ho(t,r),e=new Ho(e,r),t.intersects(e,r));var e1=Y0;const t1=Wn,r1=ut;var n1=(t,e,r)=>{const n=[];let i=null,s=null;const a=t.sort((g,y)=>r1(g,y,r));for(const g of a)t1(g,e,r)?(s=g,i||(i=g)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const u=[];for(const[g,y]of n)g===y?u.push(g):!y&&g===a[0]?u.push("*"):y?g===a[0]?u.push(`<=${y}`):u.push(`${g} - ${y}`):u.push(`>=${g}`);const h=u.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return h.length{if(t===e)return!0;t=new Uo(t,r),e=new Uo(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const a=o1(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},i1=[new _i(">=0.0.0-0")],Vo=[new _i(">=0.0.0")],o1=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ps){if(e.length===1&&e[0].semver===Ps)return!0;r.includePrerelease?t=i1:t=Vo}if(e.length===1&&e[0].semver===Ps){if(r.includePrerelease)return!0;e=Vo}const n=new Set;let i,s;for(const M of t)M.operator===">"||M.operator===">="?i=Wo(i,M,r):M.operator==="<"||M.operator==="<="?s=zo(s,M,r):n.add(M.semver);if(n.size>1)return null;let a;if(i&&s){if(a=Ei(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const M of n){if(i&&!vr(M,String(i),r)||s&&!vr(M,String(s),r))return null;for(const C of e)if(!vr(M,String(C),r))return!1;return!0}let u,h,d,g,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&s.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const M of e){if(g=g||M.operator===">"||M.operator===">=",d=d||M.operator==="<"||M.operator==="<=",i){if(_&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===_.major&&M.semver.minor===_.minor&&M.semver.patch===_.patch&&(_=!1),M.operator===">"||M.operator===">="){if(u=Wo(i,M,r),u===M&&u!==i)return!1}else if(i.operator===">="&&!vr(i.semver,String(M),r))return!1}if(s){if(y&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===y.major&&M.semver.minor===y.minor&&M.semver.patch===y.patch&&(y=!1),M.operator==="<"||M.operator==="<="){if(h=zo(s,M,r),h===M&&h!==s)return!1}else if(s.operator==="<="&&!vr(s.semver,String(M),r))return!1}if(!M.operator&&(s||i)&&a!==0)return!1}return!(i&&d&&!s&&a!==0||s&&g&&!i&&a!==0||_||y)},Wo=(t,e,r)=>{if(!t)return e;const n=Ei(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},zo=(t,e,r)=>{if(!t)return e;const n=Ei(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var a1=s1;const Os=Dr,qo=Dn,c1=Qe,Jo=_c,l1=pr,u1=mf,d1=yf,h1=_f,f1=Sf,g1=kf,p1=Af,m1=Tf,v1=Of,w1=ut,y1=jf,b1=Uf,_1=mi,E1=qf,S1=Zf,M1=Un,C1=vi,k1=Ec,R1=Sc,I1=wi,A1=yi,N1=Mc,L1=w0,T1=Vn(),x1=dt(),P1=Wn,O1=C0,$1=A0,B1=x0,F1=$0,j1=j0,D1=bi,H1=Z0,U1=X0,V1=e1,W1=n1,z1=a1;var q1={parse:l1,valid:u1,clean:d1,inc:h1,diff:f1,major:g1,minor:p1,patch:m1,prerelease:v1,compare:w1,rcompare:y1,compareLoose:b1,compareBuild:_1,sort:E1,rsort:S1,gt:M1,lt:C1,eq:k1,neq:R1,gte:I1,lte:A1,cmp:N1,coerce:L1,Comparator:T1,Range:x1,satisfies:P1,toComparators:O1,maxSatisfying:$1,minSatisfying:B1,minVersion:F1,validRange:j1,outside:D1,gtr:H1,ltr:U1,intersects:V1,simplifyRange:W1,subset:z1,SemVer:c1,re:Os.re,src:Os.src,tokens:Os.t,SEMVER_SPEC_VERSION:qo.SEMVER_SPEC_VERSION,RELEASE_TYPES:qo.RELEASE_TYPES,compareIdentifiers:Jo.compareIdentifiers,rcompareIdentifiers:Jo.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=q1,r=Vt,n=We;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",y=>(0,e.valid)(y)===null?`Expected SemVer version, got "${y}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",y=>(0,e.validRange)(y)===null?`Expected SemVer range, got "${y}"`:!0);function i(y){return(0,r.is)(y,t.VersionStruct)}t.isValidSemVerVersion=i;function s(y){return(0,r.is)(y,t.VersionRangeStruct)}t.isValidSemVerRange=s;function a(y){(0,n.assertStruct)(y,t.VersionStruct)}t.assertIsSemVerVersion=a;function u(y){(0,n.assertStruct)(y,t.VersionRangeStruct)}t.assertIsSemVerRange=u;function h(y,_){return(0,e.gt)(y,_)}t.gtVersion=h;function d(y,_){return(0,e.gtr)(y,_)}t.gtRange=d;function g(y,_){return(0,e.satisfies)(y,_,{includePrerelease:!0})}t.satisfiesVersionRange=g})(wc);(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,u)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(We,t),r(Fr,t),r(z,t),r(Fn,t),r(yt,t),r(or,t),r(dc,t),r(jr,t),r(hc,t),r(fc,t),r(ar,t),r(gc,t),r(bt,t),r(pc,t),r(mc,t),r(vc,t),r(wc,t)})(qa);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=qa;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(za);var kc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.PollingBlockTracker=void 0;const J1=kc(oi),G1=kc(wd),Z1=Pr,Go=za,Zo=(0,Go.createModuleLogger)(Go.projectLogger,"polling-block-tracker"),Q1=(0,J1.default)(),K1=1e3;class X1 extends Z1.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*K1,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Qo(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: ${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Qo(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:Q1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Zo("Making request",e);const r=await(0,G1.default)(n=>this._provider.sendAsync(e,n))();if(Zo("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: ${r.error.message}`);return r.result}}$n.PollingBlockTracker=X1;function Qo(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var zn={},Y1=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zn,"__esModule",{value:!0});zn.SubscribeBlockTracker=void 0;const eg=Y1(oi),tg=Pr,rg=(0,eg.default)();class ng extends tg.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:rg(),method:e,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}zn.SubscribeBlockTracker=ng;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r($n,t),r(zn,t)})(Wa);var Si={},qn={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getUniqueId=void 0;const Rc=4294967295;let $s=Math.floor(Math.random()*Rc);function sg(){return $s=($s+1)%Rc,$s}Hr.getUniqueId=sg;Object.defineProperty(qn,"__esModule",{value:!0});qn.createIdRemapMiddleware=void 0;const ig=Hr;function og(){return(t,e,r,n)=>{const i=t.id,s=ig.getUniqueId();t.id=s,e.id=s,r(a=>{t.id=i,e.id=i,a()})}}qn.createIdRemapMiddleware=og;var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.createAsyncMiddleware=void 0;function ag(t){return async(e,r,n,i)=>{let s;const a=new Promise(g=>{s=g});let u=null,h=!1;const d=async()=>{h=!0,n(g=>{u=g,s()}),await a};try{await t(e,r,d),h?(await a,u(null)):i(null)}catch(g){u?u(g):i(g)}}}Jn.createAsyncMiddleware=ag;var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createScaffoldMiddleware=void 0;function cg(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}Gn.createScaffoldMiddleware=cg;var Ur={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});const lg=ua;function Ko(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function ug(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Ko(s,this,r);else{const a=s.length,u=ug(s);for(let h=0;h"u"&&(n=Nc()),zs(t,"",0,[],void 0,0,n);var i;try{Bt.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Tc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var s=Dt.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function tr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),Dt.push([n,r,e,i])):Bt.push([e,r,t]):(n[r]=t,Dt.push([n,r,e]))}function zs(t,e,r,n,i,s,a){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;ua.depthLimit){tr(on,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){tr(on,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;ue?1:0}function Lc(t,e,r,n){typeof n>"u"&&(n=Nc());var i=qs(t,"",0,[],void 0,0,n)||t,s;try{Bt.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Tc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var a=Dt.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function qs(t,e,r,n,i,s,a){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;ua.depthLimit){tr(on,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){tr(on,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;u0)for(var n=0;n=1e3&&t<=4999}function vg(t,e){if(e!=="[Circular]")return e}var Ci={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.errorCodes=void 0;At.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=At,r=It,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(_,M=i){if(Number.isInteger(_)){const C=_.toString();if(y(e.errorValues,C))return e.errorValues[C].message;if(d(_))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=a;function u(_){if(!Number.isInteger(_))return!1;const M=_.toString();return!!(e.errorValues[M]||d(_))}t.isValidCode=u;function h(_,{fallbackError:M=s,shouldIncludeStack:C=!1}={}){var R,I;if(!M||!Number.isInteger(M.code)||typeof M.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const T={};if(_&&typeof _=="object"&&!Array.isArray(_)&&y(_,"code")&&u(_.code)){const k=_;T.code=k.code,k.message&&typeof k.message=="string"?(T.message=k.message,y(k,"data")&&(T.data=k.data)):(T.message=a(T.code),T.data={originalError:g(_)})}else{T.code=M.code;const k=(R=_)===null||R===void 0?void 0:R.message;T.message=k&&typeof k=="string"?k:M.message,T.data={originalError:g(_)}}const P=(I=_)===null||I===void 0?void 0:I.stack;return C&&_&&P&&typeof P=="string"&&(T.stack=P),T}t.serializeError=h;function d(_){return _>=-32099&&_<=-32e3}function g(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function y(_,M){return Object.prototype.hasOwnProperty.call(_,M)}})(Ci);var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ethErrors=void 0;const ki=It,Pc=Ci,Je=At;Zn.ethErrors={rpc:{parse:t=>nt(Je.errorCodes.rpc.parse,t),invalidRequest:t=>nt(Je.errorCodes.rpc.invalidRequest,t),invalidParams:t=>nt(Je.errorCodes.rpc.invalidParams,t),methodNotFound:t=>nt(Je.errorCodes.rpc.methodNotFound,t),internal:t=>nt(Je.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return nt(e,t)},invalidInput:t=>nt(Je.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>nt(Je.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>nt(Je.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>nt(Je.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>nt(Je.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>nt(Je.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>wr(Je.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>wr(Je.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>wr(Je.errorCodes.provider.unsupportedMethod,t),disconnected:t=>wr(Je.errorCodes.provider.disconnected,t),chainDisconnected:t=>wr(Je.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ki.EthereumProviderError(e,r,n)}}};function nt(t,e){const[r,n]=Oc(e);return new ki.EthereumRpcError(t,r||Pc.getMessageFromCode(t),n)}function wr(t,e){const[r,n]=Oc(e);return new ki.EthereumProviderError(t,r||Pc.getMessageFromCode(t),n)}function Oc(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=It;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=Ci;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Zn;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=At;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ic);var wg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.JsonRpcEngine=void 0;const yg=wg(Mi),st=Ic;class _t extends yg.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,a,u]=await _t._runAllMiddleware(e,r,this._middleware);return a?(await _t._runReturnHandlers(u),i(s)):n(async h=>{try{await _t._runReturnHandlers(u)}catch(d){return h(d)}return h()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const a=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof e.method!="string"){const a=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(a,{id:e.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=st.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await _t._runAllMiddleware(e,r,this._middleware);if(_t._checkForCompletion(e,r,i),await _t._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,a=!1;for(const u of n)if([s,a]=await _t._runMiddleware(e,r,u,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const a=h=>{const d=h||r.error;d&&(r.error=st.serializeError(d)),s([d,!0])},u=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request: diff --git a/assets/index-Bn7sbfQV.js b/assets/index-DSHVXTMI.js similarity index 92% rename from assets/index-Bn7sbfQV.js rename to assets/index-DSHVXTMI.js index 8b37cf1..e1888c3 100644 --- a/assets/index-Bn7sbfQV.js +++ b/assets/index-DSHVXTMI.js @@ -1,4 +1,4 @@ -import{bb as a}from"./index-Dje23Sct.js";import{bc as e,bh as n,bg as o,br as L,bs as W,bt as c,c9 as l,ce as b,cf as r,bu as M,bi as Z,bw as V,bv as d,bx as p,cc as H,cd as m,by as k,bz as _,bA as h,bB as g,bC as I,bD as B,bE as T,cp as v,cq as w,bj as S,bF as f,cl as x,bG as A,bk as N,ci as D,bH as E,bI as P,bJ as U,bK as G,c4 as O,ck as j,cm as q,c5 as z,ch as F,bL as Q,c6 as y,cn as J,cg as K,bO as R,c7 as X,bl as Y,bm as $,bn as a1,bQ as i1,bP as s1,bR as C1,bS as u1,c3 as t1,bT as e1,cj as n1,ca as o1,cb as L1,c8 as W1,bU as c1,bV as l1,co as b1,cr as r1,bo as M1,bW as Z1,bX as V1,bZ as d1,bp as p1,bY as H1,b$ as m1,b_ as k1,bM as _1,bN as h1,c0 as g1,bq as I1,c1 as B1,c2 as T1,c as v1,bd as w1,be as S1,bf as f1}from"./index-Dje23Sct.js";const s=a` +import{bc as a}from"./index-Dk-UNE0C.js";import{bd as e,bi as n,bh as o,bs as L,bt as W,bu as c,ca as l,cf as r,cg as b,bv as M,bj as Z,bx as V,bw as d,by as p,cd as H,ce as m,bz as k,bA as _,bB as h,bC as g,bD as I,bE as B,bF as T,cq as v,cr as w,bk as S,bG as f,cm as x,bH as A,bl as N,cj as D,bI as E,bJ as P,bK as U,bL as G,c5 as O,cl as j,cn as q,c6 as z,ci as F,bM as Q,c7 as y,co as J,ch as K,bP as R,c8 as X,bm as Y,bn as $,bo as a1,bR as i1,bQ as s1,bS as C1,bT as u1,c4 as t1,bU as e1,ck as n1,cb as o1,cc as L1,c9 as W1,bV as c1,bW as l1,cp as r1,cs as b1,bp as M1,bX as Z1,bY as V1,b_ as d1,bq as p1,bZ as H1,c0 as m1,b$ as k1,bN as _1,bO as h1,c1 as g1,br as I1,c2 as B1,c3 as T1,c as v1,be as w1,bf as S1,bg as f1}from"./index-Dk-UNE0C.js";const s=a` -`;export{e as MathUtil,n as TransactionUtil,o as UiHelperUtil,L as WuiAccountButton,W as WuiAllWalletsImage,c as WuiAvatar,l as WuiBalance,b as WuiBanner,r as WuiBannerImg,M as WuiButton,Z as WuiCard,V as WuiCardSelect,d as WuiCardSelectLoader,p as WuiChip,H as WuiChipButton,m as WuiCompatibleNetwork,k as WuiConnectButton,_ as WuiCtaButton,h as WuiDetailsGroup,g as WuiDetailsGroupItem,I as WuiDropdownMenu,B as WuiEmailInput,T as WuiEnsInput,v as WuiFlex,w as WuiGrid,S as WuiIcon,f as WuiIconBox,x as WuiIconButton,A as WuiIconLink,N as WuiImage,D as WuiInputAmount,E as WuiInputElement,P as WuiInputNumeric,U as WuiInputText,G as WuiLink,O as WuiListAccordion,j as WuiListAccount,q as WuiListButton,z as WuiListContent,F as WuiListDescription,Q as WuiListItem,y as WuiListNetwork,J as WuiListSocial,K as WuiListToken,R as WuiListWallet,X as WuiListWalletTransaction,Y as WuiLoadingHexagon,$ as WuiLoadingSpinner,a1 as WuiLoadingThumbnail,i1 as WuiLogo,s1 as WuiLogoSelect,C1 as WuiNetworkButton,u1 as WuiNetworkImage,t1 as WuiNoticeCard,e1 as WuiOtp,n1 as WuiPreviewItem,o1 as WuiProfileButton,L1 as WuiProfileButtonV2,W1 as WuiPromo,c1 as WuiQrCode,l1 as WuiSearchBar,b1 as WuiSelect,r1 as WuiSeparator,M1 as WuiShimmer,Z1 as WuiSnackbar,V1 as WuiTabs,d1 as WuiTag,p1 as WuiText,H1 as WuiTokenButton,m1 as WuiTokenListItem,k1 as WuiTooltip,_1 as WuiTransactionListItem,h1 as WuiTransactionListItemLoader,g1 as WuiTransactionVisual,I1 as WuiVisual,B1 as WuiVisualThumbnail,T1 as WuiWalletImage,v1 as customElement,w1 as initializeTheming,S1 as setColorTheme,f1 as setThemeVariables,s as swapInputMaskBottomSvg,C as swapInputMaskTopSvg}; +`;export{e as MathUtil,n as TransactionUtil,o as UiHelperUtil,L as WuiAccountButton,W as WuiAllWalletsImage,c as WuiAvatar,l as WuiBalance,r as WuiBanner,b as WuiBannerImg,M as WuiButton,Z as WuiCard,V as WuiCardSelect,d as WuiCardSelectLoader,p as WuiChip,H as WuiChipButton,m as WuiCompatibleNetwork,k as WuiConnectButton,_ as WuiCtaButton,h as WuiDetailsGroup,g as WuiDetailsGroupItem,I as WuiDropdownMenu,B as WuiEmailInput,T as WuiEnsInput,v as WuiFlex,w as WuiGrid,S as WuiIcon,f as WuiIconBox,x as WuiIconButton,A as WuiIconLink,N as WuiImage,D as WuiInputAmount,E as WuiInputElement,P as WuiInputNumeric,U as WuiInputText,G as WuiLink,O as WuiListAccordion,j as WuiListAccount,q as WuiListButton,z as WuiListContent,F as WuiListDescription,Q as WuiListItem,y as WuiListNetwork,J as WuiListSocial,K as WuiListToken,R as WuiListWallet,X as WuiListWalletTransaction,Y as WuiLoadingHexagon,$ as WuiLoadingSpinner,a1 as WuiLoadingThumbnail,i1 as WuiLogo,s1 as WuiLogoSelect,C1 as WuiNetworkButton,u1 as WuiNetworkImage,t1 as WuiNoticeCard,e1 as WuiOtp,n1 as WuiPreviewItem,o1 as WuiProfileButton,L1 as WuiProfileButtonV2,W1 as WuiPromo,c1 as WuiQrCode,l1 as WuiSearchBar,r1 as WuiSelect,b1 as WuiSeparator,M1 as WuiShimmer,Z1 as WuiSnackbar,V1 as WuiTabs,d1 as WuiTag,p1 as WuiText,H1 as WuiTokenButton,m1 as WuiTokenListItem,k1 as WuiTooltip,_1 as WuiTransactionListItem,h1 as WuiTransactionListItemLoader,g1 as WuiTransactionVisual,I1 as WuiVisual,B1 as WuiVisualThumbnail,T1 as WuiWalletImage,v1 as customElement,w1 as initializeTheming,S1 as setColorTheme,f1 as setThemeVariables,s as swapInputMaskBottomSvg,C as swapInputMaskTopSvg}; diff --git a/assets/index-DaPtt4Xr.js b/assets/index-DaPtt4Xr.js new file mode 100644 index 0000000..4e83eef --- /dev/null +++ b/assets/index-DaPtt4Xr.js @@ -0,0 +1 @@ +import{s as r,t as O,b as e,L as s,i as X,c as $,h as l,j as Y,f as S,k as o,a as t}from"./MarkdownEditor-i8hTFDFw.js";import"./index-Dk-UNE0C.js";import"./index.lazy-CMTI4f6x.js";import"./utils-CaYZp6PS.js";import"./useAccount-C9KkC4ZK.js";import"./createPublicClient-Cfohbp00.js";import"./isAddressEqual-Dn7cKeu3.js";import"./secp256k1-DDh0VLbn.js";const Z=r({null:O.null,instanceof:O.operatorKeyword,this:O.self,"new super assert open to with void":O.keyword,"class interface extends implements enum var":O.definitionKeyword,"module package import":O.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":O.controlKeyword,"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":O.modifier,IntegerLiteral:O.integer,FloatingPointLiteral:O.float,"StringLiteral TextBlock":O.string,CharacterLiteral:O.character,LineComment:O.lineComment,BlockComment:O.blockComment,BooleanLiteral:O.bool,PrimitiveType:O.standard(O.typeName),TypeName:O.typeName,Identifier:O.variableName,"MethodName/Identifier":O.function(O.variableName),Definition:O.definition(O.variableName),ArithOp:O.arithmeticOperator,LogicOp:O.logicOperator,BitOp:O.bitwiseOperator,CompareOp:O.compareOperator,AssignOp:O.definitionOperator,UpdateOp:O.updateOperator,Asterisk:O.punctuation,Label:O.labelName,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace,".":O.derefOperator,", ;":O.separator}),n={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:238,open:267,module:269,requires:274,transitive:276,exports:278,to:280,opens:282,uses:284,provides:286,with:288,package:292,import:296,if:308,else:310,while:314,for:318,var:325,assert:332,switch:336,case:342,do:346,break:350,continue:354,return:358,throw:364,try:368,catch:372,finally:380},d=e.deserialize({version:14,states:"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'#DUO2PQPO'#GnO4wQPO'#D_O5OQPO'#DzO*pQPO'#E[O5qQPO'#E[OOQO'#DV'#DVO7SQQO'#HaO9^QQO'#EeO9eQPO'#EdO9jQPO'#EfOOQO'#Hb'#HbO7jQQO'#HbO:pQQO'#FhO:wQPO'#ExO:|QPO'#E}O:|QPO'#FPOOQO'#Ha'#HaOOQO'#HY'#HYOOQO'#Gh'#GhOOQO'#HX'#HXO<^QPO'#FiOOQO'#HW'#HWOOQO'#Gg'#GgQ]QPOOOOQO'#Hs'#HsOQQPO'#GSO>]QPO'#GUO=kQPO'#GWO:|QPO'#GXO>dQPO'#GZO?QQQO'#HiO?mQQO'#CuO?tQPO'#HxO@SQPO'#D_O@rQPO'#DpO?wQPO'#DqO@|QPO'#HxOA_QPO'#DpOAgQPO'#IROAlQPO'#E`OOQO'#Hr'#HrOOQO'#Gm'#GmQ$wQPOOOAtQPO'#HsOOQO'#H^'#H^OCsQQO,58{OOQO'#H['#H[OOOO'#Gi'#GiOEfOSO,59[OOQO,59[,59[OOQO'#Hi'#HiOFVQPO,59eOGXQPO,59yOOQO-E:f-E:fO*pQPO,58zOG{QPO,58zO*pQPO,5;}OHQQPO'#DQOHVQPO'#DQOOQO'#Gk'#GkOIVQQO,59jOOQO'#Dm'#DmOJqQPO'#HuOJ{QPO'#DlOKZQPO'#HtOKcQPO,5<_OKhQPO,59^OLRQPO'#CxOOQO,59c,59cOLYQPO,59bOLeQQO'#H^ONgQQO'#CbO!!iQPO'#D_O!#nQQO'#HmO!$OQQO,59pO!$VQPO'#DvO!$eQPO'#H|O!$mQPO,5:`O!$rQPO,5:`O!%YQPO,5;nO!%eQPO'#ITO!%pQPO,5;eO!%uQPO,5=YOOQO-E:l-E:lOOQO,5:f,5:fO!']QPO,5:fO!'dQPO,5:vO?tQPO,5<_O*pQPO,5:vO_,5>_O!*sQPO,5:gO!+RQPO,5:qO!+ZQPO,5:lO!+fQPO,5>[O!$VQPO,5>[O!'iQPO,59UO!+qQQO,58zO!+yQQO,5;}O!,RQQO,5gQPO,5gQPO,5<}O!2mQPO,59jO!2zQPO'#HuO!3RQPO,59xO!3WQPO,5>dO?tQPO,59xO!3cQPO,5:[OAlQPO,5:zO!3kQPO'#DrO?wQPO'#DrO!3vQPO'#HyO!4OQPO,5:]O?tQPO,5>dO!(hQPO,5>dOAgQPO,5>mOOQO,5:[,5:[O!$rQPO'#DtOOQO,5>m,5>mO!4TQPO'#EaOOQO,5:z,5:zO!7UQPO,5:zO!(hQPO'#DxOOQO-E:k-E:kOOQO,5:y,5:yO*pQPO,58}O!7ZQPO'#ChOOQO1G.k1G.kOOOO-E:g-E:gOOQO1G.v1G.vO!+qQQO1G.fO*pQPO1G.fO!7eQQO1G1iOOQO,59l,59lO!7mQPO,59lOOQO-E:i-E:iO!7rQPO,5>aO!8ZQPO,5:WO`OOQO1G1y1G1yOOQO1G.x1G.xO!8{QPO'#CyO!9kQPO'#HmO!9uQPO'#CzO!:TQPO'#HlO!:]QPO,59dOOQO1G.|1G.|OLYQPO1G.|O!:sQPO,59eO!;QQQO'#H^O!;cQQO'#CbOOQO,5:b,5:bOhOOQO1G/z1G/zO!oOOQO1G1P1G1POOQO1G0Q1G0QO!=oQPO'#E]OOQO1G0b1G0bO!>`QPO1G1yO!'dQPO1G0bO!*sQPO1G0RO!+RQPO1G0]O!+ZQPO1G0WOOQO1G/]1G/]O!>eQQO1G.pO9eQPO1G0jO*pQPO1G0jOgQPO'#GaOOQO1G2a1G2aO#2zQPO1G2iO#6xQPO,5>gOOQO1G/d1G/dOOQO1G4O1G4OO#7ZQPO1G/dOOQO1G/v1G/vOOQO1G0f1G0fO!7UQPO1G0fOOQO,5:^,5:^O!(hQPO'#DsO#7`QPO,5:^O?wQPO'#GrO#7kQPO,5>eOOQO1G/w1G/wOAgQPO'#H{O#7sQPO1G4OO?tQPO1G4OOOQO1G4X1G4XO!#YQPO'#DvO!!iQPO'#D_OOQO,5:{,5:{O#8OQPO,5:{O#8OQPO,5:{O#8VQQO'#HaO#9hQQO'#HbO#9rQQO'#EbO#9}QPO'#EbO#:VQPO'#IOOOQO,5:d,5:dOOQO1G.i1G.iO#:bQQO'#EeO#:rQQO'#H`O#;SQPO'#FTOOQO'#H`'#H`O#;^QPO'#H`O#;{QPO'#IWO#WOOQO1G/O1G/OOOQO7+$h7+$hOOQO1G/{1G/{O#=cQQO1G/{OOQO1G/}1G/}O#=hQPO1G/{OOQO1G/|1G/|OdQPO,5:wOOQO,5:w,5:wOOQO7+'e7+'eOOQO7+%|7+%|OOQO7+%m7+%mO!KqQPO7+%mO!KvQPO7+%mO!LOQPO7+%mOOQO7+%w7+%wO!LnQPO7+%wOOQO7+%r7+%rO!MmQPO7+%rO!MrQPO7+%rOOQO7+&U7+&UOOQO'#Ee'#EeO9eQPO7+&UO9eQPO,5>[O#?TQPO7+$[OOQO7+&T7+&TOOQO7+&W7+&WO:|QPO'#GlO#?cQPO,5>]OOQO1G/_1G/_O:|QPO7+&lO#?nQQO,59eO#@tQPO,59vOOQO,59v,59vOOQO,5:h,5:hOOQO'#EP'#EPOOQO,5:i,5:iO#@{QPO'#EYOgQPO,5jO#M{QPO,59TO#NSQPO'#IVO#N[QPO,5;oO*pQPO'#G{O#NaQPO,5>rOOQO1G.n1G.nOOQO<Z,5>ZOOQO,5=U,5=UOOQO-E:h-E:hO#NvQPO7+%gOOQO7+%g7+%gOOQO7+%i7+%iOOQO<kO$%tQPO'#EZOOQO1G0_1G0_O$%{QPO1G0_O?tQPO,5:pOOQO-E:s-E:sOOQO1G0Z1G0ZOOQO1G0n1G0nO$&QQQO1G0nOOQO<qOOQO1G1Z1G1ZO$+dQPO'#FUOOQO,5=g,5=gOOQO-E:y-E:yO$+iQPO'#GoO$+vQPO,5>cOOQO1G/u1G/uOOQO<sAN>sO!KqQPOAN>sOOQOAN>xAN>xOOQOAN?[AN?[O9eQPOAN?[OOQO1G0`1G0`O$,_QPO1G0`OOQO,5=b,5=bOOQO-E:t-E:tO$,mQPO,5:uOOQO7+%y7+%yOOQO7+&Y7+&YOOQO1G1`1G1`O$,tQQO1G1`OOQO-E:{-E:{O$,|QQO'#IYO$,wQPO1G1`O$&gQPO1G1`O*pQPO1G1`OOQOAN@]AN@]O$-XQQO<tO$.qQPO7+&zO$.vQQO'#IZOOQOAN@nAN@nO$/RQQOAN@nOOQOAN@jAN@jO$/YQPOAN@jO$/_QQO<uOOQOG26YG26YOOQOG26UG26UOOQO<lOWiXuiX%}iX&PiX&RiX&_iX~OZ!aX~P?XOu#OO%}TO&P#SO&R#SO~O%}TO~P3gOg^Oh^Ov#pO!u#rO!z#qO&_!hO&t#oO~O&P!cO&R!dO~P@ZOg^Oh^O%}TO&P!cO&R!dO~O}cO!P%aO~OZ%bO~O}%dO!m%gO~O}cOg&gXh&gXv&gX!S&gX!T&gX!U&gX!V&gX!W&gX!X&gX!Y&gX!Z&gX!]&gX!^&gX!_&gX!u&gX!z&gX%}&gX&P&gX&R&gX&_&gX&t&gX~OW%jOZ%kOgTahTa%}Ta&PTa&RTa~OvTa!STa!TTa!UTa!VTa!WTa!XTa!YTa!ZTa!]Ta!^Ta!_Ta!uTa!zTa#yTa#zTa$WTa$hTa&tTa&_TauTaYTaqTa|Ta!PTa~PC[O&W%nO&Y!tO~Ou#OO%}TOqma&^maYma&nma!Pma~O&vma}ma!rma~PEnO!SyO!TyO!UyO!VyO!WyO!XyO!YyO!ZzO!]yO!^yO!_yO~Og!Rah!Rav!Ra!u!Ra!z!Ra$h!Ra&P!Ra&R!Ra&t!Ra&_!Ra~PFdO#z%pO~Os%rO~Ou%sO%}TO~Ou#OO%}ra&Pra&Rra&vraYrawra&nra&qra!Pra&^raqra~OWra#_ra#ara#bra#dra#era#fra#gra#hra#ira#kra#ora#rra&_ra#prasra|ra~PH_Ou#OO%}TOq&iX!P&iX!b&iX~OY&iX#p&iX~PJ`O!b%vOq!`X!P!`XY!`X~Oq%wO!P&hX~O!P%yO~Ov%zO~Og^Oh^O%}0oO&P!wO&RWO&b%}O~O&^&`P~PKmO%}TO&P!wO&RWO~OW&QXYiXY!aXY&QXZ&QXq!aXu&QXwiX!b&QX#]&QX#_&QX#a&QX#b&QX#d&QX#e&QX#f&QX#g&QX#h&QX#i&QX#k&QX#o&QX#r&QX&^&QX&_&QX&niX&n&QX&qiX&viX&v&QX&x!aX~P?XOWUXYUXY!aXY&]XZUXq!aXuUXw&]X!bUX#]UX#_UX#aUX#bUX#dUX#eUX#fUX#gUX#hUX#iUX#kUX#oUX#rUX&^UX&_UX&nUX&n&]X&q&]X&vUX&v&]X&x!aX~P>lOg^Oh^O%}TO&P!wO&RWOg!RXh!RX&P!RX&R!RX~PFdOu#OOw&XO%}TO&P&UO&R&TO&q&WO~OW#XOY&aX&n&aX&v&aX~P!#YOY&ZO~P9oOg^Oh^O&P!wO&RWO~Oq&]OY&pX~OY&_O~Og^Oh^O%}TO&P!wO&RWOY&pP~PFdOY&dO&n&bO&v#vO~Oq&eO&x$ZOY&wX~OY&gO~O%}TOg%bah%bav%ba!S%ba!T%ba!U%ba!V%ba!W%ba!X%ba!Y%ba!Z%ba!]%ba!^%ba!_%ba!u%ba!z%ba$h%ba&P%ba&R%ba&t%ba&_%ba~O|&hO~P]O}&iO~Op&uOw&vO&PSO&R!qO&_#YO~Oz&tO~P!'iOz&xO&PSO&R!qO&_#YO~OY&eP~P:|Og^Oh^O%}TO&P!wO&RWO~O}cO~P:|OW#XOu#OO%}TO&v&aX~O#r$WO!P#sa#_#sa#a#sa#b#sa#d#sa#e#sa#f#sa#g#sa#h#sa#i#sa#k#sa#o#sa&^#sa&_#sa&n#saY#sa#p#sas#saq#sa|#sa~Oo'_O}'^O!r'`O&_!hO~O}'eO!r'`O~Oo'iO}'hO&_!hO~OZ#xOu'mO%}TO~OW%jO}'sO~OW%jO!P'uO~OW'vO!P'wO~O$h!WO&P0qO&R0pO!P&eP~P/uO!P(SO#p(TO~P9oO}(UO~O$c(WO~O!P(XO~O!P(YO~O!P(ZO~P9oO!P(]O~P9oOZ$lO_VO`VOaVObVOcVOeVOg^Oh^Op!POwkOz!OO%}TO&P(_O&R(^O&XUO~PFdO%Q(hO%U(iOZ$}a_$}a`$}aa$}ab$}ac$}ae$}ag$}ah$}ap$}av$}aw$}az$}a}$}a!P$}a!S$}a!T$}a!U$}a!V$}a!W$}a!X$}a!Y$}a!Z$}a![$}a!]$}a!^$}a!_$}a!u$}a!z$}a#f$}a#r$}a#t$}a#u$}a#y$}a#z$}a$W$}a$Y$}a$`$}a$c$}a$e$}a$h$}a$l$}a$n$}a$s$}a$u$}a$w$}a$y$}a$|$}a%O$}a%w$}a%}$}a&P$}a&R$}a&X$}a&t$}a|$}a$a$}a$q$}a~O}ra!rra'Ora~PH_OZ%bO~PJ`O!P(mO~O!m%gO}&la!P&la~O}cO!P(pO~Oo(tOq!fX&^!fX~Oq(vO&^&mX~O&^(xO~OZ`O_VO`VOaVObVOcVOeVOg^Oh^Op)UOv{Ow)TOz!OO|)PO}cO!PvO![!`O!u}O!z|O#fpO#roO#tpO#upO#y!RO#z!QO$W!SO$Y!TO$`!UO$c!VO$e!XO$h!WO$l!YO$n!ZO$s![O$u!]O$w!^O$y!_O$|!aO%O!bO%}TO&PRO&RQO&XUO&_#YO&tdO~PFdO}%dO~O})]OY&zP~P:|OW%jO!P)dO~Os)eO~Ou#OO%}TOq&ia!P&ia!b&iaY&ia#p&ia~O})fO~P:|Oq%wO!P&ha~Og^Oh^O%}0oO&P!wO&RWO~O&b)mO~P!8jOu#OO%}TOq&aX&^&aXY&aX&n&aX!P&aX~O}&aX!r&aX~P!9SOo)oOp)oOqnX&^nX~Oq)pO&^&`X~O&^)rO~Ou#OOw)tO%}TO&PSO&R!qO~OYma&nma&vma~P!:bOW&QXY!aXq!aXu!aX%}!aX~OWUXY!aXq!aXu!aX%}!aX~OW)wO~Ou#OO%}TO&P#SO&R#SO&q)yO~Og^Oh^O%}TO&P!wO&RWO~PFdOq&]OY&pa~Ou#OO%}TO&P#SO&R#SO&q&WO~OY)|O~OY*PO&n&bO~Oq&eOY&wa~Og^Oh^Ov{O|*XO!u}O%}TO&P!wO&RWO&tdO~PFdO!P*YO~OW^iZ#XXu^i!P^i!b^i#]^i#_^i#a^i#b^i#d^i#e^i#f^i#g^i#h^i#i^i#k^i#o^i#r^i&^^i&_^i&n^i&v^iY^i#p^is^iq^i|^i~OW*iO~Os*jO~P9oOz*kO&PSO&R!qO~O!P]iY]i#p]is]iq]i|]i~P9oOq*lOY&eX!P&eX~P9oOY*nO~O#f$SO#g$TO#k$YO#r$WO!P#^i#_#^i#a#^i#b#^i#d#^i#e#^i#o#^i&^#^i&_#^i&n#^iY#^i#p#^is#^iq#^i|#^i~O#h$UO#i$UO~P!AmO#_#|O#d$QO#e$RO#f$SO#g$TO#h$UO#i$UO#k$YO#r$WO&^#zO&_#zO&n#{O!P#^i#b#^i#o#^iY#^i#p#^is#^iq#^i|#^i~O#a#^i~P!CUO#a#}O~P!CUO#_#|O#f$SO#g$TO#h$UO#i$UO#k$YO#r$WO&^#zO&_#zO!P#^i#a#^i#b#^i#d#^i#e#^i#o#^iY#^i#p#^is#^iq#^i|#^i~O&n#^i~P!DtO&n#{O~P!DtO#f$SO#g$TO#k$YO#r$WO!P#^i#a#^i#b#^i#e#^i#o#^iY#^i#p#^is#^iq#^i|#^i~O#_#|O#d$QO#h$UO#i$UO&^#zO&_#zO&n#{O~P!FdO#k$YO#r$WO!P#^i#_#^i#a#^i#b#^i#d#^i#e#^i#f#^i#h#^i#i#^i#o#^i&^#^i&_#^i&n#^iY#^i#p#^is#^iq#^i|#^i~O#g$TO~P!G{O#g#^i~P!G{O#h#^i#i#^i~P!AmO#p*oO~P9oO#_&aX#a&aX#b&aX#d&aX#e&aX#f&aX#g&aX#h&aX#i&aX#k&aX#o&aX#r&aX&_&aX#p&aXs&aX|&aX~P!9SO!P#liY#li#p#lis#liq#li|#li~P9oO|*rO~P$wO}'^O~O}'^O!r'`O~Oo'_O}'^O!r'`O~O%}TO&P#SO&R#SO|&sP!P&sP~PFdO}'eO~Og^Oh^Ov{O|+PO!P*}O!u}O!z|O%}TO&P!wO&RWO&_!hO&tdO~PFdO}'hO~Oo'iO}'hO~Os+RO~P:|Ou+TO%}TO~Ou'mO})fO%}TOW#Zi!P#Zi#_#Zi#a#Zi#b#Zi#d#Zi#e#Zi#f#Zi#g#Zi#h#Zi#i#Zi#k#Zi#o#Zi#r#Zi&^#Zi&_#Zi&n#Zi&v#ZiY#Zi#p#Zis#Ziq#Zi|#Zi~O}'^OW&diu&di!P&di#_&di#a&di#b&di#d&di#e&di#f&di#g&di#h&di#i&di#k&di#o&di#r&di&^&di&_&di&n&di&v&diY&di#p&dis&diq&di|&di~O#}+]O$P+^O$R+^O$S+_O$T+`O~O|+[O~P##nO$Z+aO&PSO&R!qO~OW+bO!P+cO~O$a+dOZ$_i_$_i`$_ia$_ib$_ic$_ie$_ig$_ih$_ip$_iv$_iw$_iz$_i}$_i!P$_i!S$_i!T$_i!U$_i!V$_i!W$_i!X$_i!Y$_i!Z$_i![$_i!]$_i!^$_i!_$_i!u$_i!z$_i#f$_i#r$_i#t$_i#u$_i#y$_i#z$_i$W$_i$Y$_i$`$_i$c$_i$e$_i$h$_i$l$_i$n$_i$s$_i$u$_i$w$_i$y$_i$|$_i%O$_i%w$_i%}$_i&P$_i&R$_i&X$_i&t$_i|$_i$q$_i~Og^Oh^O$h#sO&P!wO&RWO~O!P+hO~P:|O!P+iO~OZ`O_VO`VOaVObVOcVOeVOg^Oh^Op!POv{OwkOz!OO}cO!PvO!SyO!TyO!UyO!VyO!WyO!XyO!YyO!Z+nO![!`O!]yO!^yO!_yO!u}O!z|O#fpO#roO#tpO#upO#y!RO#z!QO$W!SO$Y!TO$`!UO$c!VO$e!XO$h!WO$l!YO$n!ZO$q+oO$s![O$u!]O$w!^O$y!_O$|!aO%O!bO%}TO&PRO&RQO&XUO&tdO~O|+mO~P#)QOW&QXY&QXZ&QXu&QX!P&QX&viX&v&QX~P?XOWUXYUXZUXuUX!PUX&vUX&v&]X~P>lOW#tOu#uO&v#vO~OW&UXY%XXu&UX!P%XX&v&UX~OZ#XX~P#.VOY+uO!P+sO~O%Q(hO%U(iOZ$}i_$}i`$}ia$}ib$}ic$}ie$}ig$}ih$}ip$}iv$}iw$}iz$}i}$}i!P$}i!S$}i!T$}i!U$}i!V$}i!W$}i!X$}i!Y$}i!Z$}i![$}i!]$}i!^$}i!_$}i!u$}i!z$}i#f$}i#r$}i#t$}i#u$}i#y$}i#z$}i$W$}i$Y$}i$`$}i$c$}i$e$}i$h$}i$l$}i$n$}i$s$}i$u$}i$w$}i$y$}i$|$}i%O$}i%w$}i%}$}i&P$}i&R$}i&X$}i&t$}i|$}i$a$}i$q$}i~OZ+xO~O%Q(hO%U(iOZ%Vi_%Vi`%Via%Vib%Vic%Vie%Vig%Vih%Vip%Viv%Viw%Viz%Vi}%Vi!P%Vi!S%Vi!T%Vi!U%Vi!V%Vi!W%Vi!X%Vi!Y%Vi!Z%Vi![%Vi!]%Vi!^%Vi!_%Vi!u%Vi!z%Vi#f%Vi#r%Vi#t%Vi#u%Vi#y%Vi#z%Vi$W%Vi$Y%Vi$`%Vi$c%Vi$e%Vi$h%Vi$l%Vi$n%Vi$s%Vi$u%Vi$w%Vi$y%Vi$|%Vi%O%Vi%w%Vi%}%Vi&P%Vi&R%Vi&X%Vi&t%Vi|%Vi$a%Vi$q%Vi~Ou#OO%}TO}&oa!P&oa!m&oa~O!P,OO~Oo(tOq!fa&^!fa~Oq(vO&^&ma~O!m%gO}&li!P&li~O|,XO~P]OW,ZO~P5xOW&UXu&UX#_&UX#a&UX#b&UX#d&UX#e&UX#f&UX#g&UX#h&UX#i&UX#k&UX#o&UX#r&UX&^&UX&_&UX&n&UX&v&UX~OZ#xO!P&UX~P#8^OW$gOZ#xO&v#vO~Op,]Ow,]O~Oq,^O}&rX!P&rX~O!b,`O#]#wOY&UXZ#XX~P#8^OY&SXq&SX|&SX!P&SX~P9oO})]O|&yP~P:|OY&SXg%[Xh%[X%}%[X&P%[X&R%[Xq&SX|&SX!P&SX~Oq,cOY&zX~OY,eO~O})fO|&kP~P:|Oq&jX!P&jX|&jXY&jX~P9oO&bTa~PC[Oo)oOp)oOqna&^na~Oq)pO&^&`a~OW,mO~Ow,nO~Ou#OO%}TO&P,rO&R,qO~Og^Oh^Ov#pO!u#rO&P!wO&RWO&t#oO~Og^Oh^Ov{O|,wO!u}O%}TO&P!wO&RWO&tdO~PFdOw-SO&PSO&R!qO&_#YO~Oq*lOY&ea!P&ea~O#_ma#ama#bma#dma#ema#fma#gma#hma#ima#kma#oma#rma&_ma#pmasma|ma~PEnO|-WO~P$wOZ#xO}'^Oq!|X|!|X!P!|X~Oq-[O|&sX!P&sX~O|-_O!P-^O~O&_!hO~P5VOg^Oh^Ov{O|-cO!P*}O!u}O!z|O%}TO&P!wO&RWO&_!hO&tdO~PFdOs-dO~P9oOs-dO~P:|O}'^OW&dqu&dq!P&dq#_&dq#a&dq#b&dq#d&dq#e&dq#f&dq#g&dq#h&dq#i&dq#k&dq#o&dq#r&dq&^&dq&_&dq&n&dq&v&dqY&dq#p&dqs&dqq&dq|&dq~O|-hO~P##nO!W-lO$O-lO&PSO&R!qO~O!P-oO~O$Z-pO&PSO&R!qO~O!b%vO#p-rOq!`X!P!`X~O!P-tO~P9oO!P-tO~P:|O!P-wO~P9oO|-yO~P#)QO![$aO#p-zO~O!P-|O~O!b-}O~OY.QOZ$lO_VO`VOaVObVOcVOeVOg^Oh^Op!POwkOz!OO%}TO&P(_O&R(^O&XUO~PFdOY.QO!P.RO~O%Q(hO%U(iOZ%Vq_%Vq`%Vqa%Vqb%Vqc%Vqe%Vqg%Vqh%Vqp%Vqv%Vqw%Vqz%Vq}%Vq!P%Vq!S%Vq!T%Vq!U%Vq!V%Vq!W%Vq!X%Vq!Y%Vq!Z%Vq![%Vq!]%Vq!^%Vq!_%Vq!u%Vq!z%Vq#f%Vq#r%Vq#t%Vq#u%Vq#y%Vq#z%Vq$W%Vq$Y%Vq$`%Vq$c%Vq$e%Vq$h%Vq$l%Vq$n%Vq$s%Vq$u%Vq$w%Vq$y%Vq$|%Vq%O%Vq%w%Vq%}%Vq&P%Vq&R%Vq&X%Vq&t%Vq|%Vq$a%Vq$q%Vq~Ou#OO%}TO}&oi!P&oi!m&oi~O&n&bOq!ga&^!ga~O!m%gO}&lq!P&lq~O|.^O~P]Op.`Ow&vOz&tO&PSO&R!qO&_#YO~O!P.aO~Oq,^O}&ra!P&ra~O})]O~P:|Oq.gO|&yX~O|.iO~Oq,cOY&za~Oq.mO|&kX~O|.oO~Ow.pO~Oq!aXu!aX!P!aX!b!aX%}!aX~OZ&QX~P#N{OZUX~P#N{O!P.qO~OZ.rO~OW^yZ#XXu^y!P^y!b^y#]^y#_^y#a^y#b^y#d^y#e^y#f^y#g^y#h^y#i^y#k^y#o^y#r^y&^^y&_^y&n^y&v^yY^y#p^ys^yq^y|^y~OY%`aq%`a!P%`a~P9oO!P#nyY#ny#p#nys#nyq#ny|#ny~P9oO}'^Oq!|a|!|a!P!|a~OZ#xO}'^Oq!|a|!|a!P!|a~O%}TO&P#SO&R#SOq%jX|%jX!P%jX~PFdOq-[O|&sa!P&sa~O|!}X~P$wO|/PO~Os/QO~P9oOW%jO!P/RO~OW%jO$Q/WO&PSO&R!qO!P&|P~OW%jO$U/XO~O!P/YO~O!b%vO#p/[Oq!`X!P!`X~OY/^O~O!P/_O~P9oO#p/`O~P9oO!b/bO~OY/cOZ$lO_VO`VOaVObVOcVOeVOg^Oh^Op!POwkOz!OO%}TO&P(_O&R(^O&XUO~PFdOW#[Ou&[X%}&[X&P&[X&R&[X'O&[X~O&_#YO~P$)QOu#OO%}TO'O/eO&P%SX&R%SX~O&n&bOq!gi&^!gi~Op/iO&PSO&R!qO~OW*iOZ#xO~O!P/kO~OY&SXq&SX~P9oO})]Oq%nX|%nX~P:|Oq.gO|&ya~O!b/nO~O})fOq%cX|%cX~P:|Oq.mO|&ka~OY/qO~O!P/rO~OZ/sO~O}'^Oq!|i|!|i!P!|i~O|!}a~P$wOW%jO!P/wO~OW%jOq/xO!P&|X~OY/|O~P9oOY0OO~OY%Xq!P%Xq~P9oO'O/eO&P%Sa&R%Sa~OY0TO~O!P0WO~Ou#OO!P0YO!Z0ZO%}TO~OY0[O~Oq/xO!P&|a~O!P0_O~OW%jOq/xO!P&}X~OY0aO~P9oOY0bO~OY%Xy!P%Xy~P9oOu#OO%}TO&P%ua&R%ua'O%ua~OY0cO~O!P0dO~Ou#OO!P0eO!Z0fO%}TO~OW%jOq%ra!P%ra~Oq/xO!P&}a~O!P0jO~Ou#OO!P0jO!Z0kO%}TO~O!P0lO~O!P0nO~O#p&QXY&QXs&QXq&QX|&QX~P&bO#pUXYUXsUXqUX|UX~P(iO`Q_P#g%y&P&Xc&X~",goto:"#+S'OPPPP'P'd*x.OP'dPP.d.h0PPPPPP1nP3ZPP4v7l:[WP!?[P!Ap!BW!E]3ZPPP!F|!Jm!MaPP#!P#!SP#$`#$f#&V#&f#&n#'p#(Y#)T#)^#)a#)oP#)r#*OP#*V#*^P#*aP#*lP#*o#*r#*u#*y#+PstOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y'urOPXY`acopx!Y![!_!a!e!f!h!i!o!x#P#T#Y#[#_#`#e#i#l#n#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$]$_$e$l$m$n$o$p$q%O%S%V%Z%^%_%b%d%g%k%u%v%{%|&R&S&[&]&`&b&d&i'X'^'_'`'e'h'i'm'n'p'{'|(O(T(U(`(l(t(v({(})O)Q)R)])f)o)p*P*T*W*l*o*p*q*z*{+O+T+d+f+h+i+l+o+r+s+x+},W,Y,^,`,u-[-^-a-r-t-}.R.V.g.m/O/[/_/b/d/n/q0R0X0Z0[0f0h0k0r#xhO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0kt!sT!Q!S!T!{!}$k%p+]+^+_+`-k-m/W/X/x0oQ#mdS&Y#`(}Q&l#oU&q#t$g,ZQ&x#vW(b%O+s.R/dU)Y%j'v+bQ)Z%kS)u&S,WU*f&s-R._Q*k&yQ,t*TQ-P*iQ.j,cR.t,uu!sT!Q!S!T!{!}$k%p+]+^+_+`-k-m/W/X/x0oT%l!r)l#{qO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0k#zlO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0kX(c%O+s.R/d$TVO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0k$TkO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0k&O[OPX`ceopx!O!Y![!_!a!g!i!o#Y#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$f$l$m$n$o$p$q%O%_%b%d%g%k%v%{&]&b&d&i&t'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s,Y,^,`-^-r-t-}.R.g.m/O/[/_/b/d/n0Z0f0k0rQ&Q#[Q)s&RV.T+x.X/e&O[OPX`ceopx!O!Y![!_!a!g!i!o#Y#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$f$l$m$n$o$p$q%O%_%b%d%g%k%v%{&]&b&d&i&t'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s,Y,^,`-^-r-t-}.R.g.m/O/[/_/b/d/n0Z0f0k0rV.T+x.X/e&O]OPX`ceopx!O!Y![!_!a!g!i!o#Y#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$f$l$m$n$o$p$q%O%_%b%d%g%k%v%{&]&b&d&i&t'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s,Y,^,`-^-r-t-}.R.g.m/O/[/_/b/d/n0Z0f0k0rV.U+x.X/eS#Z[.TS$f!O&tS&s#t$gQ&y#vQ)V%dQ-R*iR._,Z$kZO`copx!Y![!_!a#Y#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$_$l$m$n$o$p$q%O%d%g%k%v&b&d'_'`'i'm(O(T(U(t)Q)R)])f)o)p*P*l*o+T+d+h+i+l+o+s,Y,^,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kQ&O#YR,k)p&P_OPX`ceopx!Y![!_!a!g!i!o#Y#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$l$m$n$o$p$q%O%_%b%d%g%k%v%{&]&b&d&i'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s+x,Y,^,`-^-r-t-}.R.X.g.m/O/[/_/b/d/e/n0Z0f0k0r!o#QY!e!x#R#T#`#n$]%R%S%V%^%u%|&S&[&`'X'|(`(l({(}*T*p*z+f+r+},W,u-a.V/q0R0X0[0h$SkO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kQ$m!UQ$n!VQ$s!ZQ$|!`R+p(WQ#yiS'q$e*hQ*e&rQ+X'rS,[)T)UQ-O*gQ-Y*vQ.b,]Q.x-QQ.{-ZQ/j.`Q/u.yR0V/iQ'a$bW*[&m'b'c'dQ+W'qU,x*]*^*_Q-X*vQ-f+XS.u,y,zS.z-Y-ZQ/t.vR/v.{]!mP!o'^*q-^/OreOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y[!gP!o'^*q-^/OW#b`#e%b&]Q'}$oW(d%O+s.R/dS*U&i*WS*w'e-[S*|'h+OR.X+xh#VY!W!e#n#s%V'|*T*z+f,u-aQ)j%wQ)v&WR,o)y#xnOcopx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0k^!kP!g!o'^*q-^/Ov#TY!W#`#n#s%w&W&[&`'|(`(})y*T+f+r,u.W/hQ#g`Q$b{Q$c|Q$d}W%S!e%V*z-aS%Y!h(vQ%`!iQ&m#pQ&n#qQ&o#rQ(u%ZS(y%^({Q*R&eS*v'e-[R-Z*wU)h%v)f.mR+V'p[!mP!o'^*q-^/OT*}'h+O^!iP!g!o'^*q-^/OQ'd$bQ'l$dQ*_&mQ*d&oV*{'h*|+OQ%[!hR,S(vQ(s%YR,R(u#znO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0kQ%c!kS(l%S(yR(|%`T#e`%bU#c`#e%bR)z&]Q%f!lQ(n%UQ(r%XQ,U(zR.],VrvOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y[!mP!o'^*q-^/OQ%P!bQ%a!jQ%i!pQ'[$ZQ([$|Q(k%QQ(p%WQ+z(iR.Y+yrtOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y[!mP!o'^*q-^/OS*V&i*WT*}'h+OQ'c$bS*^&m'dR,z*_Q'b$bQ'g$cU*]&m'c'dQ*a&nS,y*^*_R.v,zQ*u'`R+Q'iQ'k$dS*c&o'lR,}*dQ'j$dU*b&o'k'lS,|*c*dR.w,}rtOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y[!mP!o'^*q-^/OT*}'h+OQ'f$cS*`&n'gR,{*aQ*x'eR.|-[R-`*yQ&j#mR*Z&lT*V&i*WQ%e!lS(q%X%fR,P(rR)R%dWk%O+s.R/d#{lO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0k$SiO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kU&r#t$g,ZS*g&s._Q-Q*iR.y-RT'o$e'p!_#|m#a$r$z$}&w&z&{'O'P'Q'R'S'W'Z)[)g+S+g+j-T-V-e-v-{.e/Z/a/}0Q!]$Pm#a$r$z$}&w&z&{'O'P'R'S'W'Z)[)g+S+g+j-T-V-e-v-{.e/Z/a/}0Q#{nO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0ka)^%k)],`.g/n0Z0f0kQ)`%kR.k,cQ't$hQ)b%oR,f)cT+Y's+ZsvOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,YruOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,YQ$w!]R$y!^R$p!XrvOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,YR(O$oR$q!XR(V$sT+k(U+lX(f%P(g(k+{R+y(hQ.W+xR/h.XQ(j%PQ+w(gQ+|(kR.Z+{R%Q!bQ(e%OV.P+s.R/dQxOQ#lcW$`x#l)Q,YQ)Q%dR,Y)RrXOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Yn!fP!o#e&]&i'^'e'h*W*q+O+x-[-^/Ol!zX!f#P#_#i$[%Z%_%{&R'n'{)O0r!j#PY!e!x#T#`#n$]%S%V%^%u%|&S&[&`'X'|(`(l({(}*T*p*z+f+r+},W,u-a.V/q0R0X0[0hQ#_`Q#ia#d$[op!Y!_!a#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$l%g%k%v&b&d'_'`'i'm(O(T(t)])f)o*P*l*o+T+h+i+o,^,`-r-t-}.g.m/[/_/b/n0Z0f0kS%Z!h(vS%_!i*{S%{#Y)pQ&R#[S'n$e'pY'{$o%O+s.R/dQ)O%bR0r$YQ!uUR%m!uQ)q&OR,l)q^#RY#`$]'X'|(`*px%R!e!x#n%V%^%|&S&[&`({(}*T*z+f+r,W,u-a.V0R[%t#R%R%u+}0X0hS%u#T%SQ+}(lQ0X/qR0h0[Q*m&{R-U*mQ!oPU%h!o*q/OQ*q'^R/O-^!pbOP`cx![!o#e#l$_$m$n$o$p$q%O%b%d&]&i'^'e'h(U)Q)R*W*q+O+d+l+s+x,Y-[-^.R/O/dY!yX!f#_'{)OT#jb!yQ.n,gR/p.nQ%x#VR)k%xQ&c#fS*O&c.[R.[,QQ(w%[R,T(wQ&^#cR){&^Q,_)WR.d,_Q+O'hR-b+OQ-]*xR.}-]Q*W&iR,v*WQ'p$eR+U'pQ&f#gR*S&fQ.h,aR/m.hQ,d)`R.l,dQ+Z'sR-g+ZQ-k+]R/T-kQ/y/US0^/y0`R0`/{Q+l(UR-x+lQ(g%PS+v(g+{R+{(kQ/f.VR0S/fQ+t(eR.S+t`wOcx#l%d)Q)R,YQ$t![Q']$_Q'y$mQ'z$nQ(Q$pQ(R$qS+k(U+lR-q+d'dsOPXY`acopx!Y![!_!a!e!f!h!i!o!x#P#T#Y#[#_#`#e#i#l#n#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$]$_$e$l$m$n$o$p$q%O%S%V%Z%^%_%b%d%g%u%v%{%|&R&S&[&]&`&b&d&i'X'^'_'`'e'h'i'm'n'p'{'|(O(T(U(`(l(t(v({(})O)Q)R)f)o)p*P*T*W*l*o*p*q*z*{+O+T+d+f+h+i+l+o+r+s+x+},W,Y,^,u-[-^-a-r-t-}.R.V.m/O/[/_/b/d/q0R0X0[0h0ra)_%k)],`.g/n0Z0f0kQ!rTQ$h!QQ$i!SQ$j!TQ%o!{Q%q!}Q'x$kQ)c%pQ)l0oS-i+]+_Q-m+^Q-n+`Q/S-kS/U-m/WQ/{/XR0]/x%uSOT`cdopx!Q!S!T!Y![!_!a!{!}#`#l#o#t#u#v#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$g$k$l$m$n$o$p$q%O%d%j%k%p%v&S&d&s&y'm'v(O(T(U(})Q)R)])f*P*T*i*l*o+T+]+^+_+`+b+d+h+i+l+o+s,W,Y,Z,`,c,u-R-k-m-r-t-}.R._.g.m/W/X/[/_/b/d/n/x0Z0f0k0oQ)a%kQ,a)]S.f,`/nQ/l.gQ0g0ZQ0i0fR0m0krmOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,YS#a`$lQ$WoQ$^pQ$r!YQ$z!_Q$}!aQ&w#uQ&z#wY&{#x$o+h-t/_Q&}#|Q'O#}Q'P$OQ'Q$PQ'R$QQ'S$RQ'T$SQ'U$TQ'V$UQ'W$VQ'Z$Z^)[%k)].g/n0Z0f0kU)g%v)f.mQ*Q&dQ+S'mQ+g(OQ+j(TQ,p*PQ-T*lQ-V*oQ-e+TQ-v+iQ-{+oQ.e,`Q/Z-rQ/a-}Q/}/[R0Q/b#xgO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o,Y,`-r-t-}.g.m/[/_/b/n0Z0f0kW(a%O+s.R/dR)S%drYOcx![#l$_$m$n$p$q%d(U)Q)R+d+l,Y[!eP!o'^*q-^/OW!xX$[%{'{Q#``Q#ne#S$]op!Y!_!a#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$l%k%v&d'm(O(T)])f*P*l*o+T+h+i+o,`-r-t-}.g.m/[/_/b/n0Z0f0kQ%V!gS%^!i*{d%|#Y%g&b'_'`'i(t)o)p,^Q&S#_Q&[#bS&`#e&]Q'X$YQ'|$oW(`%O+s.R/dQ({%_Q(}%bS*T&i*WQ*p0rS*z'h+OQ+f'}Q+r(dQ,W)OQ,u*UQ-a*|S.V+x.XR0R/e&O_OPX`ceopx!Y![!_!a!g!i!o#Y#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$l$m$n$o$p$q%O%_%b%d%g%k%v%{&]&b&d&i'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s+x,Y,^,`-^-r-t-}.R.X.g.m/O/[/_/b/d/e/n0Z0f0k0rQ$e!OQ'r$fR*h&t&ZWOPX`ceopx!O!Y![!_!a!g!i!o#Y#[#_#b#e#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Y$Z$[$_$f$l$m$n$o$p$q%O%_%b%d%g%k%v%{&R&]&b&d&i&t'^'_'`'h'i'm'{'}(O(T(U(d(t)O)Q)R)])f)o)p*P*U*W*l*o*q*{*|+O+T+d+h+i+l+o+s+x,Y,^,`-^-r-t-}.R.X.g.m/O/[/_/b/d/e/n0Z0f0k0rR&P#Y$QjOcopx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kQ#f`Q&O#YQ'Y$YU)W%g'`'iQ)}&bQ*s'_Q,Q(tQ,j)oQ,k)pR.c,^Q)n%}R,i)m$SfO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kT&p#t,ZQ&|#xQ(P$oQ-u+hQ/]-tR0P/_]!nP!o'^*q-^/O#PaOPX`bcx![!f!o!y#_#e#l$_$m$n$o$p$q%O%b%d&]&i'^'e'h'{(U)O)Q)R*W*q+O+d+l+s+x,Y-[-^.R/O/dU#WY!W'|Q%T!eU&k#n#s+fQ(o%VS,s*T*zT.s,u-aj#UY!W!e#n#s%V%w&W)y*T*z,u-aU&V#`&`(}Q)x&[Q+e'|Q+q(`Q-s+fQ.O+rQ/g.WR0U/hQ)i%vQ,g)fR/o.mR,h)f`!jP!o'^'h*q+O-^/OT%W!g*|R%]!hW%U!e%V*z-aQ(z%^R,V({S#d`%bR&a#eQ)X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X",nodeNames:"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent",maxTerm:276,nodeProps:[["isolate",-4,1,2,18,19,""],["group",-26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,"Statement",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,"Expression",-7,23,24,25,26,27,29,34,"Type"],["openedBy",10,"(",44,"{"],["closedBy",11,")",45,"}"]],propSources:[Z],skippedNodes:[0,1,2],repeatNodeCount:28,tokenData:"#'f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5zvw7[wx8rxyAZyzAwz{Be{|CZ|}Dq}!OE_!O!PFx!P!Q! r!Q!R!,h!R![!0`![!]!>p!]!^!@Q!^!_!@n!_!`!BX!`!a!B{!a!b!Di!b!c!EX!c!}!LT!}#O!Mj#O#P%Q#P#Q!NW#Q#R!Nt#R#S4e#S#T%Q#T#o4e#o#p# h#p#q#!U#q#r##n#r#s#$[#s#y%Q#y#z'f#z$f%Q$f$g'f$g#BY4e#BY#BZ#$x#BZ$IS4e$IS$I_#$x$I_$I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4eS%VV&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS%qO&YSS%tVOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZS&^VOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS&vP;=`<%l%QS&|UOY&ZYZ%lZr&Zs;'S&Z;'S;=`'`<%lO&ZS'cP;=`<%l&Z_'mk&YS%yZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qs#y%Q#y#z'f#z$f%Q$f$g'f$g#BY%Q#BY#BZ'f#BZ$IS%Q$IS$I_'f$I_$I|%Q$I|$JO'f$JO$JT%Q$JT$JU'f$JU$KV%Q$KV$KW'f$KW&FU%Q&FU&FV'f&FV;'S%Q;'S;=`&s<%lO%Q_)iY&YS%yZX^*Xpq*X#y#z*X$f$g*X#BY#BZ*X$IS$I_*X$I|$JO*X$JT$JU*X$KV$KW*X&FU&FV*XZ*^Y%yZX^*Xpq*X#y#z*X$f$g*X#BY#BZ*X$IS$I_*X$I|$JO*X$JT$JU*X$KV$KW*X&FU&FV*XV+TX#tP&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`;'S%Q;'S;=`&s<%lO%QU+wV#_Q&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT,aXOY,|YZ%lZr,|rs3Ys#O,|#O#P2d#P;'S,|;'S;=`3S<%lO,|T-PXOY-lYZ%lZr-lrs.^s#O-l#O#P.x#P;'S-l;'S;=`2|<%lO-lT-qX&YSOY-lYZ%lZr-lrs.^s#O-l#O#P.x#P;'S-l;'S;=`2|<%lO-lT.cVcPOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZT.}V&YSOY-lYZ/dZr-lrs1]s;'S-l;'S;=`2|<%lO-lT/iW&YSOY0RZr0Rrs0ns#O0R#O#P0s#P;'S0R;'S;=`1V<%lO0RP0UWOY0RZr0Rrs0ns#O0R#O#P0s#P;'S0R;'S;=`1V<%lO0RP0sOcPP0vTOY0RYZ0RZ;'S0R;'S;=`1V<%lO0RP1YP;=`<%l0RT1`XOY,|YZ%lZr,|rs1{s#O,|#O#P2d#P;'S,|;'S;=`3S<%lO,|T2QUcPOY&ZYZ%lZr&Zs;'S&Z;'S;=`'`<%lO&ZT2gVOY-lYZ/dZr-lrs1]s;'S-l;'S;=`2|<%lO-lT3PP;=`<%l-lT3VP;=`<%l,|T3_VcPOY&ZYZ%lZr&Zrs3ts;'S&Z;'S;=`'`<%lO&ZT3yR&WSXY4SYZ4`pq4SP4VRXY4SYZ4`pq4SP4eO&XP_4lb&YS&PZOY%QYZ%lZr%Qrs%qst%Qtu4eu!Q%Q!Q![4e![!c%Q!c!}4e!}#R%Q#R#S4e#S#T%Q#T#o4e#o$g%Q$g;'S4e;'S;=`5t<%lO4e_5wP;=`<%l4eU6RX#hQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QU6uV#]Q&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV7cZ&nR&YSOY%QYZ%lZr%Qrs%qsv%Qvw8Uw!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QU8]V#aQ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT8wZ&YSOY9jYZ%lZr9jrs:xsw9jwx%Qx#O9j#O#PhYZ%lZr>hrs?dsw>hwx;hx#O>h#O#P&Z#P;'S>h;'S;=`@}<%lO>hT>kZOYhYZ%lZr>hrs@Ysw>hwx;hx#O>h#O#P&Z#P;'S>h;'S;=`@}<%lO>hP@]VOY@YZw@Ywx@rx#O@Y#P;'S@Y;'S;=`@w<%lO@YP@wObPP@zP;=`<%l@YTAQP;=`<%l>hTAWP;=`<%l9j_AbVZZ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVBOVYR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVBnX$ZP&YS#gQOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QVCbZ#fR&YSOY%QYZ%lZr%Qrs%qs{%Q{|DT|!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QVD[V#rR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVDxVqR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVEf[#fR&YSOY%QYZ%lZr%Qrs%qs}%Q}!ODT!O!_%Q!_!`6n!`!aF[!a;'S%Q;'S;=`&s<%lO%QVFcV&xR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_GPZWY&YSOY%QYZ%lZr%Qrs%qs!O%Q!O!PGr!P!Q%Q!Q![IQ![;'S%Q;'S;=`&s<%lO%QVGwX&YSOY%QYZ%lZr%Qrs%qs!O%Q!O!PHd!P;'S%Q;'S;=`&s<%lO%QVHkV&qR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QTIXc&YS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![IQ![!f%Q!f!gJd!g!hKQ!h!iJd!i#R%Q#R#SNz#S#W%Q#W#XJd#X#YKQ#Y#ZJd#Z;'S%Q;'S;=`&s<%lO%QTJkV&YS`POY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QTKV]&YSOY%QYZ%lZr%Qrs%qs{%Q{|LO|}%Q}!OLO!O!Q%Q!Q![Lp![;'S%Q;'S;=`&s<%lO%QTLTX&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![Lp![;'S%Q;'S;=`&s<%lO%QTLwc&YS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![Lp![!f%Q!f!gJd!g!h%Q!h!iJd!i#R%Q#R#SNS#S#W%Q#W#XJd#X#Y%Q#Y#ZJd#Z;'S%Q;'S;=`&s<%lO%QTNXZ&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![Lp![#R%Q#R#SNS#S;'S%Q;'S;=`&s<%lO%QT! PZ&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![IQ![#R%Q#R#SNz#S;'S%Q;'S;=`&s<%lO%Q_! y]&YS#gQOY%QYZ%lZr%Qrs%qsz%Qz{!!r{!P%Q!P!Q!)e!Q!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%Q_!!wX&YSOY!!rYZ!#dZr!!rrs!%Psz!!rz{!&_{;'S!!r;'S;=`!'s<%lO!!r_!#iT&YSOz!#xz{!$[{;'S!#x;'S;=`!$y<%lO!#xZ!#{TOz!#xz{!$[{;'S!#x;'S;=`!$y<%lO!#xZ!$_VOz!#xz{!$[{!P!#x!P!Q!$t!Q;'S!#x;'S;=`!$y<%lO!#xZ!$yOQZZ!$|P;=`<%l!#x_!%SXOY!%oYZ!#dZr!%ors!'ysz!%oz{!(i{;'S!%o;'S;=`!)_<%lO!%o_!%rXOY!!rYZ!#dZr!!rrs!%Psz!!rz{!&_{;'S!!r;'S;=`!'s<%lO!!r_!&dZ&YSOY!!rYZ!#dZr!!rrs!%Psz!!rz{!&_{!P!!r!P!Q!'V!Q;'S!!r;'S;=`!'s<%lO!!r_!'^V&YSQZOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!'vP;=`<%l!!r_!'|XOY!%oYZ!#dZr!%ors!#xsz!%oz{!(i{;'S!%o;'S;=`!)_<%lO!%o_!(lZOY!!rYZ!#dZr!!rrs!%Psz!!rz{!&_{!P!!r!P!Q!'V!Q;'S!!r;'S;=`!'s<%lO!!r_!)bP;=`<%l!%o_!)lV&YSPZOY!)eYZ%lZr!)ers!*Rs;'S!)e;'S;=`!+X<%lO!)e_!*WVPZOY!*mYZ%lZr!*mrs!+_s;'S!*m;'S;=`!,b<%lO!*m_!*rVPZOY!)eYZ%lZr!)ers!*Rs;'S!)e;'S;=`!+X<%lO!)e_!+[P;=`<%l!)e_!+dVPZOY!*mYZ%lZr!*mrs!+ys;'S!*m;'S;=`!,b<%lO!*mZ!,OSPZOY!+yZ;'S!+y;'S;=`!,[<%lO!+yZ!,_P;=`<%l!+y_!,eP;=`<%l!*mT!,ou&YS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!/S!P!Q%Q!Q![!0`![!d%Q!d!e!3j!e!f%Q!f!gJd!g!hKQ!h!iJd!i!n%Q!n!o!2U!o!q%Q!q!r!5h!r!z%Q!z!{!7`!{#R%Q#R#S!2r#S#U%Q#U#V!3j#V#W%Q#W#XJd#X#YKQ#Y#ZJd#Z#`%Q#`#a!2U#a#c%Q#c#d!5h#d#l%Q#l#m!7`#m;'S%Q;'S;=`&s<%lO%QT!/Za&YS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![IQ![!f%Q!f!gJd!g!hKQ!h!iJd!i#W%Q#W#XJd#X#YKQ#Y#ZJd#Z;'S%Q;'S;=`&s<%lO%QT!0gi&YS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!/S!P!Q%Q!Q![!0`![!f%Q!f!gJd!g!hKQ!h!iJd!i!n%Q!n!o!2U!o#R%Q#R#S!2r#S#W%Q#W#XJd#X#YKQ#Y#ZJd#Z#`%Q#`#a!2U#a;'S%Q;'S;=`&s<%lO%QT!2]V&YS_POY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT!2wZ&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!0`![#R%Q#R#S!2r#S;'S%Q;'S;=`&s<%lO%QT!3oY&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q!R!4_!R!S!4_!S;'S%Q;'S;=`&s<%lO%QT!4f`&YS_POY%QYZ%lZr%Qrs%qs!Q%Q!Q!R!4_!R!S!4_!S!n%Q!n!o!2U!o#R%Q#R#S!3j#S#`%Q#`#a!2U#a;'S%Q;'S;=`&s<%lO%QT!5mX&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q!Y!6Y!Y;'S%Q;'S;=`&s<%lO%QT!6a_&YS_POY%QYZ%lZr%Qrs%qs!Q%Q!Q!Y!6Y!Y!n%Q!n!o!2U!o#R%Q#R#S!5h#S#`%Q#`#a!2U#a;'S%Q;'S;=`&s<%lO%QT!7e_&YSOY%QYZ%lZr%Qrs%qs!O%Q!O!P!8d!P!Q%Q!Q![!:r![!c%Q!c!i!:r!i#T%Q#T#Z!:r#Z;'S%Q;'S;=`&s<%lO%QT!8i]&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!9b![!c%Q!c!i!9b!i#T%Q#T#Z!9b#Z;'S%Q;'S;=`&s<%lO%QT!9gc&YSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!9b![!c%Q!c!i!9b!i!r%Q!r!sKQ!s#R%Q#R#S!8d#S#T%Q#T#Z!9b#Z#d%Q#d#eKQ#e;'S%Q;'S;=`&s<%lO%QT!:yi&YS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!wX#pR&YSOY%QYZ%lZr%Qrs%qs![%Q![!]!?d!];'S%Q;'S;=`&s<%lO%QV!?kV&vR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV!@XV!PR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!@uY&_Z&YSOY%QYZ%lZr%Qrs%qs!^%Q!^!_!Ae!_!`+p!`;'S%Q;'S;=`&s<%lO%QU!AlX#iQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QV!B`X!bR&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`;'S%Q;'S;=`&s<%lO%QV!CSY&^R&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`!a!Cr!a;'S%Q;'S;=`&s<%lO%QU!CyY#iQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`!a!Ae!a;'S%Q;'S;=`&s<%lO%Q_!DrV&bX#oQ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!E`X%}Z&YSOY%QYZ%lZr%Qrs%qs#]%Q#]#^!E{#^;'S%Q;'S;=`&s<%lO%QV!FQX&YSOY%QYZ%lZr%Qrs%qs#b%Q#b#c!Fm#c;'S%Q;'S;=`&s<%lO%QV!FrX&YSOY%QYZ%lZr%Qrs%qs#h%Q#h#i!G_#i;'S%Q;'S;=`&s<%lO%QV!GdX&YSOY%QYZ%lZr%Qrs%qs#X%Q#X#Y!HP#Y;'S%Q;'S;=`&s<%lO%QV!HUX&YSOY%QYZ%lZr%Qrs%qs#f%Q#f#g!Hq#g;'S%Q;'S;=`&s<%lO%QV!HvX&YSOY%QYZ%lZr%Qrs%qs#Y%Q#Y#Z!Ic#Z;'S%Q;'S;=`&s<%lO%QV!IhX&YSOY%QYZ%lZr%Qrs%qs#T%Q#T#U!JT#U;'S%Q;'S;=`&s<%lO%QV!JYX&YSOY%QYZ%lZr%Qrs%qs#V%Q#V#W!Ju#W;'S%Q;'S;=`&s<%lO%QV!JzX&YSOY%QYZ%lZr%Qrs%qs#X%Q#X#Y!Kg#Y;'S%Q;'S;=`&s<%lO%QV!KnV&tR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!L[b&RZ&YSOY%QYZ%lZr%Qrs%qst%Qtu!LTu!Q%Q!Q![!LT![!c%Q!c!}!LT!}#R%Q#R#S!LT#S#T%Q#T#o!LT#o$g%Q$g;'S!LT;'S;=`!Md<%lO!LT_!MgP;=`<%l!LT_!MqVuZ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV!N_VsR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QU!N{X#eQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`;'S%Q;'S;=`&s<%lO%QV# oV}R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_#!_Z'OX#dQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6n!`#p%Q#p#q##Q#q;'S%Q;'S;=`&s<%lO%QU##XV#bQ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV##uV|R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT#$cV#uP&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_#%Ru&YS%yZ&PZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qst%Qtu4eu!Q%Q!Q![4e![!c%Q!c!}4e!}#R%Q#R#S4e#S#T%Q#T#o4e#o#y%Q#y#z'f#z$f%Q$f$g'f$g#BY4e#BY#BZ#$x#BZ$IS4e$IS$I_#$x$I_$I|4e$I|$JO#$x$JO$JT4e$JT$JU#$x$JU$KV4e$KV$KW#$x$KW&FU4e&FU&FV#$x&FV;'S4e;'S;=`5t<%lO4e",tokenizers:[0,1,2,3],topRules:{Program:[0,3],ClassContent:[1,194]},dynamicPrecedences:{27:1,232:-1,243:-1},specialized:[{term:231,get:Q=>n[Q]||-1}],tokenPrec:7144}),_=s.define({name:"java",parser:d.configure({props:[X.add({IfStatement:$({except:/^\s*({|else\b)/}),TryStatement:$({except:/^\s*({|catch|finally)\b/}),LabeledStatement:l,SwitchBlock:Q=>{let P=Q.textAfter,i=/^\s*\}/.test(P),a=/^\s*(case|default)\b/.test(P);return Q.baseIndent+(i?0:a?1:2)*Q.unit},Block:Y({closing:"}"}),BlockComment:()=>null,Statement:$({except:/^{/})}),S.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":o,BlockComment(Q){return{from:Q.from+2,to:Q.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function c(){return new t(_)}export{c as java,_ as javaLanguage}; diff --git a/assets/index-Dje23Sct.js b/assets/index-Dk-UNE0C.js similarity index 56% rename from assets/index-Dje23Sct.js rename to assets/index-Dk-UNE0C.js index 8199e7b..672311c 100644 --- a/assets/index-Dje23Sct.js +++ b/assets/index-Dk-UNE0C.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DXiuzO4m.js","assets/isAddressEqual-CzhKTe3O.js","assets/index-BK4Ob9ME.js","assets/hooks.module-CVqc1jrB.js","assets/index-Bcq5aE4i.js","assets/index.lazy-Cf4BJ7np.js","assets/index-C0HCKJ4u.css","assets/index.lazy-D7Gh5HMF.js","assets/secp256k1-B-W0FJZ_.js","assets/index-lHEOM186.css"])))=>i.map(i=>d[i]); -var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe=(t,e,r)=>(ax(t,e,"read from private field"),r?r.call(t):e.get(t)),Fr=(t,e,r)=>e.has(t)?BT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pr=(t,e,r,n)=>(ax(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),zi=(t,e,r)=>(ax(t,e,"access private method"),r);var V3=(t,e,r,n)=>({set _(i){pr(t,e,i,r)},get _(){return Oe(t,e,n)}});function IQ(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 Yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ec(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Z$(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:{}},g6={},Y$={exports:{}},Cr={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DY8iYutS.js","assets/isAddressEqual-Dn7cKeu3.js","assets/index-BvckYYJA.js","assets/hooks.module-B4ln6dBc.js","assets/index-DRDR3tf1.js","assets/index.lazy-C71-UQbD.js","assets/useAccount-C9KkC4ZK.js","assets/_user.lazy-C2rT8sI3.js","assets/index-D6TI4Nno.js","assets/index-C0HCKJ4u.css","assets/utils-CaYZp6PS.js","assets/carousel.config-B-IV_rf8.js","assets/createPublicClient-Cfohbp00.js","assets/secp256k1-DDh0VLbn.js","assets/_user.lazy-8M_haES4.js","assets/index.lazy-Bi0RnwqO.js","assets/index.lazy-CMTI4f6x.js","assets/index-lHEOM186.css"])))=>i.map(i=>d[i]); +var ET=t=>{throw TypeError(t)};var ex=(t,e,r)=>e.has(t)||ET("Cannot "+r);var Oe=(t,e,r)=>(ex(t,e,"read from private field"),r?r.call(t):e.get(t)),Fr=(t,e,r)=>e.has(t)?ET("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pr=(t,e,r,n)=>(ex(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ji=(t,e,r)=>(ex(t,e,"access private method"),r);var W3=(t,e,r,n)=>({set _(i){pr(t,e,i,r)},get _(){return Oe(t,e,n)}});function sQ(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 Gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function MO(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 OO={exports:{}},c6={},$O={exports:{}},_r={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zv=Symbol.for("react.element"),TQ=Symbol.for("react.portal"),kQ=Symbol.for("react.fragment"),RQ=Symbol.for("react.strict_mode"),PQ=Symbol.for("react.profiler"),NQ=Symbol.for("react.provider"),MQ=Symbol.for("react.context"),$Q=Symbol.for("react.forward_ref"),OQ=Symbol.for("react.suspense"),DQ=Symbol.for("react.memo"),LQ=Symbol.for("react.lazy"),UT=Symbol.iterator;function BQ(t){return t===null||typeof t!="object"?null:(t=UT&&t[UT]||t["@@iterator"],typeof t=="function"?t:null)}var J$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X$=Object.assign,eO={};function ig(t,e,r){this.props=t,this.context=e,this.refs=eO,this.updater=r||J$}ig.prototype.isReactComponent={};ig.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")};ig.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function tO(){}tO.prototype=ig.prototype;function G_(t,e,r){this.props=t,this.context=e,this.refs=eO,this.updater=r||J$}var Z_=G_.prototype=new tO;Z_.constructor=G_;X$(Z_,ig.prototype);Z_.isPureReactComponent=!0;var jT=Array.isArray,rO=Object.prototype.hasOwnProperty,Q_={current:null},nO={key:!0,ref:!0,__self:!0,__source:!0};function iO(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)rO.call(e,n)&&!nO.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var WQ=Ye,HQ=Symbol.for("react.element"),qQ=Symbol.for("react.fragment"),VQ=Object.prototype.hasOwnProperty,KQ=WQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,GQ={key:!0,ref:!0,__self:!0,__source:!0};function oO(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)VQ.call(e,n)&&!GQ.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:HQ,type:t,key:s,ref:o,props:i,_owner:KQ.current}}g6.Fragment=qQ;g6.jsx=oO;g6.jsxs=oO;Q$.exports=g6;var Q=Q$.exports,aO={exports:{}},ko={},cO={exports:{}},lO={};/** + */var _Q=it,CQ=Symbol.for("react.element"),AQ=Symbol.for("react.fragment"),EQ=Object.prototype.hasOwnProperty,SQ=_Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IQ={key:!0,ref:!0,__self:!0,__source:!0};function HO(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)EQ.call(e,n)&&!IQ.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:CQ,type:t,key:s,ref:o,props:i,_owner:SQ.current}}c6.Fragment=AQ;c6.jsx=HO;c6.jsxs=HO;OO.exports=c6;var ze=OO.exports,qO={exports:{}},So={},VO={exports:{}},KO={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe= * * 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(S,k){var y=S.length;S.push(k);e:for(;0>>1,V=S[b];if(0>>1;bi(W,y))uei(J,W)?(S[b]=J,S[ue]=y,b=ue):(S[b]=W,S[fe]=y,b=fe);else if(uei(J,y))S[b]=J,S[ue]=y,b=ue;else break e}}return k}function i(S,k){var y=S.sortIndex-k.sortIndex;return y!==0?y:S.id-k.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=[],d=1,f=null,g=3,v=!1,x=!1,P=!1,M=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(S){for(var k=r(l);k!==null;){if(k.callback===null)n(l);else if(k.startTime<=S)n(l),k.sortIndex=k.expirationTime,e(c,k);else break;k=r(l)}}function L(S){if(P=!1,$(S),!x)if(r(c)!==null)x=!0,_(j);else{var k=r(l);k!==null&&R(L,k.startTime-S)}}function j(S,k){x=!1,P&&(P=!1,N(T),T=-1),v=!0;var y=g;try{for($(k),f=r(c);f!==null&&(!(f.expirationTime>k)||S&&!U());){var b=f.callback;if(typeof b=="function"){f.callback=null,g=f.priorityLevel;var V=b(f.expirationTime<=k);k=t.unstable_now(),typeof V=="function"?f.callback=V:f===r(c)&&n(c),$(k)}else n(c);f=r(c)}if(f!==null)var ce=!0;else{var fe=r(l);fe!==null&&R(L,fe.startTime-k),ce=!1}return ce}finally{f=null,g=y,v=!1}}var H=!1,I=null,T=-1,B=5,K=-1;function U(){return!(t.unstable_now()-KS||125b?(S.sortIndex=y,e(l,S),r(c)===null&&S===r(l)&&(P?(N(T),T=-1):P=!0,R(L,y-b))):(S.sortIndex=V,e(c,S),x||v||(x=!0,_(j))),S},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(S){var k=g;return function(){var y=g;g=k;try{return S.apply(this,arguments)}finally{g=y}}}})(lO);cO.exports=lO;var ZQ=cO.exports;/** + */(function(t){function e(S,k){var y=S.length;S.push(k);e:for(;0>>1,V=S[b];if(0>>1;bi(W,y))lei(Y,W)?(S[b]=Y,S[le]=y,b=le):(S[b]=W,S[de]=y,b=de);else if(lei(Y,y))S[b]=Y,S[le]=y,b=le;else break e}}return k}function i(S,k){var y=S.sortIndex-k.sortIndex;return y!==0?y:S.id-k.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=[],d=1,h=null,g=3,v=!1,x=!1,R=!1,M=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=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(S){for(var k=r(l);k!==null;){if(k.callback===null)n(l);else if(k.startTime<=S)n(l),k.sortIndex=k.expirationTime,e(c,k);else break;k=r(l)}}function L(S){if(R=!1,O(S),!x)if(r(c)!==null)x=!0,A(U);else{var k=r(l);k!==null&&P(L,k.startTime-S)}}function U(S,k){x=!1,R&&(R=!1,N(T),T=-1),v=!0;var y=g;try{for(O(k),h=r(c);h!==null&&(!(h.expirationTime>k)||S&&!B());){var b=h.callback;if(typeof b=="function"){h.callback=null,g=h.priorityLevel;var V=b(h.expirationTime<=k);k=t.unstable_now(),typeof V=="function"?h.callback=V:h===r(c)&&n(c),O(k)}else n(c);h=r(c)}if(h!==null)var ce=!0;else{var de=r(l);de!==null&&P(L,de.startTime-k),ce=!1}return ce}finally{h=null,g=y,v=!1}}var H=!1,I=null,T=-1,F=5,K=-1;function B(){return!(t.unstable_now()-KS||125b?(S.sortIndex=y,e(l,S),r(c)===null&&S===r(l)&&(R?(N(T),T=-1):R=!0,P(L,y-b))):(S.sortIndex=V,e(c,S),x||v||(x=!0,A(U))),S},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(S){var k=g;return function(){var y=g;g=k;try{return S.apply(this,arguments)}finally{g=y}}}})(KO);VO.exports=KO;var TQ=VO.exports;/** * @license React * react-dom.production.min.js * @@ -31,37 +31,37 @@ var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var QQ=Ye,Co=ZQ;function We(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"),d7=Object.prototype.hasOwnProperty,YQ=/^[: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]*$/,zT={},WT={};function JQ(t){return d7.call(WT,t)?!0:d7.call(zT,t)?!1:YQ.test(t)?WT[t]=!0:(zT[t]=!0,!1)}function XQ(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 eY(t,e,r,n){if(e===null||typeof e>"u"||XQ(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 Is(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 ki={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ki[t]=new Is(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ki[e]=new Is(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ki[t]=new Is(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ki[t]=new Is(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){ki[t]=new Is(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ki[t]=new Is(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ki[t]=new Is(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ki[t]=new Is(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ki[t]=new Is(t,5,!1,t.toLowerCase(),null,!1,!1)});var J_=/[\-:]([a-z])/g;function X_(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(J_,X_);ki[e]=new Is(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(J_,X_);ki[e]=new Is(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(J_,X_);ki[e]=new Is(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ki[t]=new Is(t,1,!1,t.toLowerCase(),null,!1,!1)});ki.xlinkHref=new Is("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ki[t]=new Is(t,1,!1,t.toLowerCase(),null,!0,!0)});function eA(t,e,r,n){var i=ki.hasOwnProperty(e)?ki[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),n7=Object.prototype.hasOwnProperty,PQ=/^[: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]*$/,kT={},PT={};function RQ(t){return n7.call(PT,t)?!0:n7.call(kT,t)?!1:PQ.test(t)?PT[t]=!0:(kT[t]=!0,!1)}function NQ(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 MQ(t,e,r,n){if(e===null||typeof e>"u"||NQ(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 _s(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 Ii={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ii[t]=new _s(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ii[e]=new _s(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ii[t]=new _s(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ii[t]=new _s(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){Ii[t]=new _s(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ii[t]=new _s(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ii[t]=new _s(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ii[t]=new _s(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ii[t]=new _s(t,5,!1,t.toLowerCase(),null,!1,!1)});var FC=/[\-:]([a-z])/g;function zC(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(FC,zC);Ii[e]=new _s(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(FC,zC);Ii[e]=new _s(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(FC,zC);Ii[e]=new _s(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ii[t]=new _s(t,1,!1,t.toLowerCase(),null,!1,!1)});Ii.xlinkHref=new _s("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ii[t]=new _s(t,1,!1,t.toLowerCase(),null,!0,!0)});function WC(t,e,r,n){var i=Ii.hasOwnProperty(e)?Ii[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{ux=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Tm(t):""}function tY(t){switch(t.tag){case 5:return Tm(t.type);case 16:return Tm("Lazy");case 13:return Tm("Suspense");case 19:return Tm("SuspenseList");case 0:case 2:case 15:return t=dx(t.type,!1),t;case 11:return t=dx(t.type.render,!1),t;case 1:return t=dx(t.type,!0),t;default:return""}}function g7(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 Cp:return"Fragment";case xp:return"Portal";case f7:return"Profiler";case tA:return"StrictMode";case h7:return"Suspense";case p7:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case fO:return(t.displayName||"Context")+".Consumer";case dO:return(t._context.displayName||"Context")+".Provider";case rA:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case nA:return e=t.displayName||null,e!==null?e:g7(t.type)||"Memo";case wd:e=t._payload,t=t._init;try{return g7(t(e))}catch{}}return null}function rY(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 g7(e);case 8:return e===tA?"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 tf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nY(t){var e=pO(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 Z3(t){t._valueTracker||(t._valueTracker=nY(t))}function gO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=pO(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ab(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 m7(t,e){var r=e.checked;return kn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function qT(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=tf(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 mO(t,e){e=e.checked,e!=null&&eA(t,"checked",e,!1)}function w7(t,e){mO(t,e);var r=tf(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")?v7(t,e.type,r):e.hasOwnProperty("defaultValue")&&v7(t,e.type,tf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function VT(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 v7(t,e,r){(e!=="number"||Ab(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var km=Array.isArray;function Up(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Q3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function fw(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Um={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},iY=["Webkit","ms","Moz","O"];Object.keys(Um).forEach(function(t){iY.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Um[e]=Um[t]})});function bO(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Um.hasOwnProperty(t)&&Um[t]?(""+e).trim():e+"px"}function xO(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=bO(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var sY=kn({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 x7(t,e){if(e){if(sY[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(We(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(We(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(We(61))}if(e.style!=null&&typeof e.style!="object")throw Error(We(62))}}function C7(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 _7=null;function iA(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var A7=null,jp=null,Fp=null;function ZT(t){if(t=Jv(t)){if(typeof A7!="function")throw Error(We(280));var e=t.stateNode;e&&(e=b6(e),A7(t.stateNode,t.type,e))}}function CO(t){jp?Fp?Fp.push(t):Fp=[t]:jp=t}function _O(){if(jp){var t=jp,e=Fp;if(Fp=jp=null,ZT(t),e)for(t=0;t>>=0,t===0?32:31-(mY(t)/wY|0)|0}var Y3=64,J3=4194304;function Rm(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 Tb(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=Rm(a):(s&=o,s!==0&&(n=Rm(s)))}else o=r&~i,o!==0?n=Rm(o):s!==0&&(n=Rm(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 Qv(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-lc(e),t[e]=r}function xY(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=Fm),ik=" ",sk=!1;function WO(t,e){switch(t){case"keyup":return ZY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HO(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _p=!1;function YY(t,e){switch(t){case"compositionend":return HO(e);case"keypress":return e.which!==32?null:(sk=!0,ik);case"textInput":return t=e.data,t===ik&&sk?null:t;default:return null}}function JY(t,e){if(_p)return t==="compositionend"||!fA&&WO(t,e)?(t=FO(),Ky=lA=Dd=null,_p=!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=lk(r)}}function GO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?GO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ZO(){for(var t=window,e=Ab();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ab(t.document)}return e}function hA(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 aJ(t){var e=ZO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&GO(r.ownerDocument.documentElement,r)){if(n!==null&&hA(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=uk(r,s);var o=uk(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,Ap=null,R7=null,Wm=null,P7=!1;function dk(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;P7||Ap==null||Ap!==Ab(n)||(n=Ap,"selectionStart"in n&&hA(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}),Wm&&vw(Wm,n)||(Wm=n,n=Pb(R7,"onSelect"),0Ip||(t.current=L7[Ip],L7[Ip]=null,Ip--)}function on(t,e){Ip++,L7[Ip]=t.current,t.current=e}var rf={},rs=Cf(rf),Ks=Cf(!1),Nh=rf;function d1(t,e){var r=t.type.contextTypes;if(!r)return rf;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 Gs(t){return t=t.childContextTypes,t!=null}function Mb(){mn(Ks),mn(rs)}function vk(t,e,r){if(rs.current!==rf)throw Error(We(168));on(rs,e),on(Ks,r)}function iD(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(We(108,rY(t)||"Unknown",i));return kn({},r,n)}function $b(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rf,Nh=rs.current,on(rs,t),on(Ks,Ks.current),!0}function yk(t,e,r){var n=t.stateNode;if(!n)throw Error(We(169));r?(t=iD(t,e,Nh),n.__reactInternalMemoizedMergedChildContext=t,mn(Ks),mn(rs),on(rs,t)):mn(Ks),on(Ks,r)}var du=null,x6=!1,Ex=!1;function sD(t){du===null?du=[t]:du.push(t)}function yJ(t){x6=!0,sD(t)}function _f(){if(!Ex&&du!==null){Ex=!0;var t=0,e=Hr;try{var r=du;for(Hr=1;t>=o,i-=o,gu=1<<32-lc(e)+i|r<T?(B=I,I=null):B=I.sibling;var K=g(N,I,$[T],L);if(K===null){I===null&&(I=B);break}t&&I&&K.alternate===null&&e(N,I),E=s(K,E,T),H===null?j=K:H.sibling=K,H=K,I=B}if(T===$.length)return r(N,I),yn&&oh(N,T),j;if(I===null){for(;T<$.length;T++)I=f(N,$[T],L),I!==null&&(E=s(I,E,T),H===null?j=I:H.sibling=I,H=I);return yn&&oh(N,T),j}for(I=n(N,I);T<$.length;T++)B=v(I,N,T,$[T],L),B!==null&&(t&&B.alternate!==null&&I.delete(B.key===null?T:B.key),E=s(B,E,T),H===null?j=B:H.sibling=B,H=B);return t&&I.forEach(function(U){return e(N,U)}),yn&&oh(N,T),j}function P(N,E,$,L){var j=Xg($);if(typeof j!="function")throw Error(We(150));if($=j.call($),$==null)throw Error(We(151));for(var H=j=null,I=E,T=E=0,B=null,K=$.next();I!==null&&!K.done;T++,K=$.next()){I.index>T?(B=I,I=null):B=I.sibling;var U=g(N,I,K.value,L);if(U===null){I===null&&(I=B);break}t&&I&&U.alternate===null&&e(N,I),E=s(U,E,T),H===null?j=U:H.sibling=U,H=U,I=B}if(K.done)return r(N,I),yn&&oh(N,T),j;if(I===null){for(;!K.done;T++,K=$.next())K=f(N,K.value,L),K!==null&&(E=s(K,E,T),H===null?j=K:H.sibling=K,H=K);return yn&&oh(N,T),j}for(I=n(N,I);!K.done;T++,K=$.next())K=v(I,N,T,K.value,L),K!==null&&(t&&K.alternate!==null&&I.delete(K.key===null?T:K.key),E=s(K,E,T),H===null?j=K:H.sibling=K,H=K);return t&&I.forEach(function(C){return e(N,C)}),yn&&oh(N,T),j}function M(N,E,$,L){if(typeof $=="object"&&$!==null&&$.type===Cp&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case G3:e:{for(var j=$.key,H=E;H!==null;){if(H.key===j){if(j=$.type,j===Cp){if(H.tag===7){r(N,H.sibling),E=i(H,$.props.children),E.return=N,N=E;break e}}else if(H.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===wd&&Ck(j)===H.type){r(N,H.sibling),E=i(H,$.props),E.ref=im(N,H,$),E.return=N,N=E;break e}r(N,H);break}else e(N,H);H=H.sibling}$.type===Cp?(E=Sh($.props.children,N.mode,L,$.key),E.return=N,N=E):(L=tb($.type,$.key,$.props,null,N.mode,L),L.ref=im(N,E,$),L.return=N,N=L)}return o(N);case xp:e:{for(H=$.key;E!==null;){if(E.key===H)if(E.tag===4&&E.stateNode.containerInfo===$.containerInfo&&E.stateNode.implementation===$.implementation){r(N,E.sibling),E=i(E,$.children||[]),E.return=N,N=E;break e}else{r(N,E);break}else e(N,E);E=E.sibling}E=Mx($,N.mode,L),E.return=N,N=E}return o(N);case wd:return H=$._init,M(N,E,H($._payload),L)}if(km($))return x(N,E,$,L);if(Xg($))return P(N,E,$,L);sy(N,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,E!==null&&E.tag===6?(r(N,E.sibling),E=i(E,$),E.return=N,N=E):(r(N,E),E=Nx($,N.mode,L),E.return=N,N=E),o(N)):r(N,E)}return M}var h1=lD(!0),uD=lD(!1),Lb=Cf(null),Bb=null,Rp=null,wA=null;function vA(){wA=Rp=Bb=null}function yA(t){var e=Lb.current;mn(Lb),t._currentValue=e}function j7(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 Wp(t,e){Bb=t,wA=Rp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(qs=!0),t.firstContext=null)}function ma(t){var e=t._currentValue;if(wA!==t)if(t={context:t,memoizedValue:e,next:null},Rp===null){if(Bb===null)throw Error(We(308));Rp=t,Bb.dependencies={lanes:0,firstContext:t}}else Rp=Rp.next=t;return e}var fh=null;function bA(t){fh===null?fh=[t]:fh.push(t)}function dD(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,bA(e)):(r.next=i.next,i.next=r),e.interleaved=r,Iu(t,n)}function Iu(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 vd=!1;function xA(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fD(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 xu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function qd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Nr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Iu(t,r)}return i=n.interleaved,i===null?(e.next=e,bA(n)):(e.next=i.next,i.next=e),n.interleaved=e,Iu(t,r)}function Zy(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,oA(t,r)}}function _k(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 Ub(t,e,r,n){var i=t.updateQueue;vd=!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 d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,d=l=c=null,a=s;do{var g=a.lane,v=a.eventTime;if((n&g)===g){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,P=a;switch(g=e,v=r,P.tag){case 1:if(x=P.payload,typeof x=="function"){f=x.call(v,f,g);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=P.payload,g=typeof x=="function"?x.call(v,f,g):x,g==null)break e;f=kn({},f,g);break e;case 2:vd=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[a]:g.push(a))}else v={eventTime:v,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(l=d=v,c=f):d=d.next=v,o|=g;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;g=a,a=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=d,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);Oh|=o,t.lanes=o,t.memoizedState=f}}function Ak(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=Ix.transition;Ix.transition={};try{t(!1),e()}finally{Hr=r,Ix.transition=n}}function kD(){return wa().memoizedState}function _J(t,e,r){var n=Kd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},RD(t))PD(e,r);else if(r=dD(t,e,r,n),r!==null){var i=ws();uc(r,t,n,i),ND(r,e,n)}}function AJ(t,e,r){var n=Kd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(RD(t))PD(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,pc(a,o)){var c=e.interleaved;c===null?(i.next=i,bA(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=dD(t,e,i,n),r!==null&&(i=ws(),uc(r,t,n,i),ND(r,e,n))}}function RD(t){var e=t.alternate;return t===In||e!==null&&e===In}function PD(t,e){Hm=Fb=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function ND(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,oA(t,r)}}var zb={readContext:ma,useCallback:Wi,useContext:Wi,useEffect:Wi,useImperativeHandle:Wi,useInsertionEffect:Wi,useLayoutEffect:Wi,useMemo:Wi,useReducer:Wi,useRef:Wi,useState:Wi,useDebugValue:Wi,useDeferredValue:Wi,useTransition:Wi,useMutableSource:Wi,useSyncExternalStore:Wi,useId:Wi,unstable_isNewReconciler:!1},EJ={readContext:ma,useCallback:function(t,e){return Vc().memoizedState=[t,e===void 0?null:e],t},useContext:ma,useEffect:Sk,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Yy(4194308,4,AD.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Yy(4194308,4,t,e)},useInsertionEffect:function(t,e){return Yy(4,2,t,e)},useMemo:function(t,e){var r=Vc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Vc();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=_J.bind(null,In,t),[n.memoizedState,t]},useRef:function(t){var e=Vc();return t={current:t},e.memoizedState=t},useState:Ek,useDebugValue:kA,useDeferredValue:function(t){return Vc().memoizedState=t},useTransition:function(){var t=Ek(!1),e=t[0];return t=CJ.bind(null,t[1]),Vc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=In,i=Vc();if(yn){if(r===void 0)throw Error(We(407));r=r()}else{if(r=e(),wi===null)throw Error(We(349));$h&30||mD(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,Sk(vD.bind(null,n,s,t),[t]),n.flags|=2048,Sw(9,wD.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Vc(),e=wi.identifierPrefix;if(yn){var r=mu,n=gu;r=(n&~(1<<32-lc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Aw++,0")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{nx=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Sm(t):""}function OQ(t){switch(t.tag){case 5:return Sm(t.type);case 16:return Sm("Lazy");case 13:return Sm("Suspense");case 19:return Sm("SuspenseList");case 0:case 2:case 15:return t=ix(t.type,!1),t;case 11:return t=ix(t.type.render,!1),t;case 1:return t=ix(t.type,!0),t;default:return""}}function a7(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 xp:return"Fragment";case bp:return"Portal";case i7:return"Profiler";case HC:return"StrictMode";case s7:return"Suspense";case o7:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case QO:return(t.displayName||"Context")+".Consumer";case ZO:return(t._context.displayName||"Context")+".Provider";case qC:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case VC:return e=t.displayName||null,e!==null?e:a7(t.type)||"Memo";case pd:e=t._payload,t=t._init;try{return a7(t(e))}catch{}}return null}function $Q(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 a7(e);case 8:return e===HC?"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 Jd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function JO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function DQ(t){var e=JO(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 V3(t){t._valueTracker||(t._valueTracker=DQ(t))}function XO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=JO(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function vb(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 c7(t,e){var r=e.checked;return In({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function NT(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Jd(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 e$(t,e){e=e.checked,e!=null&&WC(t,"checked",e,!1)}function l7(t,e){e$(t,e);var r=Jd(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")?u7(t,e.type,r):e.hasOwnProperty("defaultValue")&&u7(t,e.type,Jd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function MT(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 u7(t,e,r){(e!=="number"||vb(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Im=Array.isArray;function Lp(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=K3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function uw(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Lm={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},LQ=["Webkit","ms","Moz","O"];Object.keys(Lm).forEach(function(t){LQ.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lm[e]=Lm[t]})});function i$(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Lm.hasOwnProperty(t)&&Lm[t]?(""+e).trim():e+"px"}function s$(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=i$(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var BQ=In({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 h7(t,e){if(e){if(BQ[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(We(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(We(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(We(61))}if(e.style!=null&&typeof e.style!="object")throw Error(We(62))}}function p7(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 g7=null;function KC(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var m7=null,Bp=null,Up=null;function DT(t){if(t=Qv(t)){if(typeof m7!="function")throw Error(We(280));var e=t.stateNode;e&&(e=h6(e),m7(t.stateNode,t.type,e))}}function o$(t){Bp?Up?Up.push(t):Up=[t]:Bp=t}function a$(){if(Bp){var t=Bp,e=Up;if(Up=Bp=null,DT(t),e)for(t=0;t>>=0,t===0?32:31-(ZQ(t)/QQ|0)|0}var G3=64,Z3=4194304;function Tm(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 _b(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=Tm(a):(s&=o,s!==0&&(n=Tm(s)))}else o=r&~i,o!==0?n=Tm(o):s!==0&&(n=Tm(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 Gv(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-oc(e),t[e]=r}function eY(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=Um),qT=" ",VT=!1;function I$(t,e){switch(t){case"keyup":return TY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T$(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _p=!1;function PY(t,e){switch(t){case"compositionend":return T$(e);case"keypress":return e.which!==32?null:(VT=!0,qT);case"textInput":return t=e.data,t===qT&&VT?null:t;default:return null}}function RY(t,e){if(_p)return t==="compositionend"||!tA&&I$(t,e)?(t=E$(),zy=JC=Md=null,_p=!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=QT(r)}}function N$(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?N$(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function M$(){for(var t=window,e=vb();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=vb(t.document)}return e}function rA(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 jY(t){var e=M$(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&N$(r.ownerDocument.documentElement,r)){if(n!==null&&rA(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=YT(r,s);var o=YT(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,Cp=null,_7=null,Fm=null,C7=!1;function JT(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;C7||Cp==null||Cp!==vb(n)||(n=Cp,"selectionStart"in n&&rA(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}),Fm&&mw(Fm,n)||(Fm=n,n=Eb(_7,"onSelect"),0Sp||(t.current=k7[Sp],k7[Sp]=null,Sp--)}function sn(t,e){Sp++,k7[Sp]=t.current,t.current=e}var Xd={},Xi=vf(Xd),Ws=vf(!1),Ph=Xd;function l1(t,e){var r=t.type.contextTypes;if(!r)return Xd;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 Hs(t){return t=t.childContextTypes,t!=null}function Ib(){pn(Ws),pn(Xi)}function sk(t,e,r){if(Xi.current!==Xd)throw Error(We(168));sn(Xi,e),sn(Ws,r)}function z$(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(We(108,$Q(t)||"Unknown",i));return In({},r,n)}function Tb(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Xd,Ph=Xi.current,sn(Xi,t),sn(Ws,Ws.current),!0}function ok(t,e,r){var n=t.stateNode;if(!n)throw Error(We(169));r?(t=z$(t,e,Ph),n.__reactInternalMemoizedMergedChildContext=t,pn(Ws),pn(Xi),sn(Xi,t)):pn(Ws),sn(Ws,r)}var cu=null,p6=!1,vx=!1;function W$(t){cu===null?cu=[t]:cu.push(t)}function JY(t){p6=!0,W$(t)}function yf(){if(!vx&&cu!==null){vx=!0;var t=0,e=Hr;try{var r=cu;for(Hr=1;t>=o,i-=o,fu=1<<32-oc(e)+i|r<T?(F=I,I=null):F=I.sibling;var K=g(N,I,O[T],L);if(K===null){I===null&&(I=F);break}t&&I&&K.alternate===null&&e(N,I),E=s(K,E,T),H===null?U=K:H.sibling=K,H=K,I=F}if(T===O.length)return r(N,I),wn&&ih(N,T),U;if(I===null){for(;TT?(F=I,I=null):F=I.sibling;var B=g(N,I,K.value,L);if(B===null){I===null&&(I=F);break}t&&I&&B.alternate===null&&e(N,I),E=s(B,E,T),H===null?U=B:H.sibling=B,H=B,I=F}if(K.done)return r(N,I),wn&&ih(N,T),U;if(I===null){for(;!K.done;T++,K=O.next())K=h(N,K.value,L),K!==null&&(E=s(K,E,T),H===null?U=K:H.sibling=K,H=K);return wn&&ih(N,T),U}for(I=n(N,I);!K.done;T++,K=O.next())K=v(I,N,T,K.value,L),K!==null&&(t&&K.alternate!==null&&I.delete(K.key===null?T:K.key),E=s(K,E,T),H===null?U=K:H.sibling=K,H=K);return t&&I.forEach(function(_){return e(N,_)}),wn&&ih(N,T),U}function M(N,E,O,L){if(typeof O=="object"&&O!==null&&O.type===xp&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case q3:e:{for(var U=O.key,H=E;H!==null;){if(H.key===U){if(U=O.type,U===xp){if(H.tag===7){r(N,H.sibling),E=i(H,O.props.children),E.return=N,N=E;break e}}else if(H.elementType===U||typeof U=="object"&&U!==null&&U.$$typeof===pd&&lk(U)===H.type){r(N,H.sibling),E=i(H,O.props),E.ref=rm(N,H,O),E.return=N,N=E;break e}r(N,H);break}else e(N,H);H=H.sibling}O.type===xp?(E=Ah(O.props.children,N.mode,L,O.key),E.return=N,N=E):(L=Qy(O.type,O.key,O.props,null,N.mode,L),L.ref=rm(N,E,O),L.return=N,N=L)}return o(N);case bp:e:{for(H=O.key;E!==null;){if(E.key===H)if(E.tag===4&&E.stateNode.containerInfo===O.containerInfo&&E.stateNode.implementation===O.implementation){r(N,E.sibling),E=i(E,O.children||[]),E.return=N,N=E;break e}else{r(N,E);break}else e(N,E);E=E.sibling}E=Sx(O,N.mode,L),E.return=N,N=E}return o(N);case pd:return H=O._init,M(N,E,H(O._payload),L)}if(Im(O))return x(N,E,O,L);if(Yg(O))return R(N,E,O,L);ry(N,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,E!==null&&E.tag===6?(r(N,E.sibling),E=i(E,O),E.return=N,N=E):(r(N,E),E=Ex(O,N.mode,L),E.return=N,N=E),o(N)):r(N,E)}return M}var d1=K$(!0),G$=K$(!1),Rb=vf(null),Nb=null,kp=null,oA=null;function aA(){oA=kp=Nb=null}function cA(t){var e=Rb.current;pn(Rb),t._currentValue=e}function N7(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 Fp(t,e){Nb=t,oA=kp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Fs=!0),t.firstContext=null)}function ha(t){var e=t._currentValue;if(oA!==t)if(t={context:t,memoizedValue:e,next:null},kp===null){if(Nb===null)throw Error(We(308));kp=t,Nb.dependencies={lanes:0,firstContext:t}}else kp=kp.next=t;return e}var uh=null;function lA(t){uh===null?uh=[t]:uh.push(t)}function Z$(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,lA(e)):(r.next=i.next,i.next=r),e.interleaved=r,Au(t,n)}function Au(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 gd=!1;function uA(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Q$(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 vu(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,Nr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Au(t,r)}return i=n.interleaved,i===null?(e.next=e,lA(n)):(e.next=i.next,i.next=e),n.interleaved=e,Au(t,r)}function Hy(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,ZC(t,r)}}function uk(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 Mb(t,e,r,n){var i=t.updateQueue;gd=!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 d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=c))}if(s!==null){var h=i.baseState;o=0,d=l=c=null,a=s;do{var g=a.lane,v=a.eventTime;if((n&g)===g){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,R=a;switch(g=e,v=r,R.tag){case 1:if(x=R.payload,typeof x=="function"){h=x.call(v,h,g);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=R.payload,g=typeof x=="function"?x.call(v,h,g):x,g==null)break e;h=In({},h,g);break e;case 2:gd=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[a]:g.push(a))}else v={eventTime:v,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(l=d=v,c=h):d=d.next=v,o|=g;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;g=a,a=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=d,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);Mh|=o,t.lanes=o,t.memoizedState=h}}function dk(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=bx.transition;bx.transition={};try{t(!1),e()}finally{Hr=r,bx.transition=n}}function hD(){return pa().memoizedState}function rJ(t,e,r){var n=Hd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},pD(t))gD(e,r);else if(r=Z$(t,e,r,n),r!==null){var i=hs();ac(r,t,n,i),mD(r,e,n)}}function nJ(t,e,r){var n=Hd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(pD(t))gD(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,dc(a,o)){var c=e.interleaved;c===null?(i.next=i,lA(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=Z$(t,e,i,n),r!==null&&(i=hs(),ac(r,t,n,i),mD(r,e,n))}}function pD(t){var e=t.alternate;return t===En||e!==null&&e===En}function gD(t,e){zm=$b=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function mD(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,ZC(t,r)}}var Db={readContext:ha,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},iJ={readContext:ha,useCallback:function(t,e){return Wc().memoizedState=[t,e===void 0?null:e],t},useContext:ha,useEffect:hk,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Vy(4194308,4,cD.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Vy(4194308,4,t,e)},useInsertionEffect:function(t,e){return Vy(4,2,t,e)},useMemo:function(t,e){var r=Wc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Wc();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=rJ.bind(null,En,t),[n.memoizedState,t]},useRef:function(t){var e=Wc();return t={current:t},e.memoizedState=t},useState:fk,useDebugValue:vA,useDeferredValue:function(t){return Wc().memoizedState=t},useTransition:function(){var t=fk(!1),e=t[0];return t=tJ.bind(null,t[1]),Wc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=En,i=Wc();if(wn){if(r===void 0)throw Error(We(407));r=r()}else{if(r=e(),mi===null)throw Error(We(349));Nh&30||eD(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,hk(rD.bind(null,n,s,t),[t]),n.flags|=2048,Aw(9,tD.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Wc(),e=mi.identifierPrefix;if(wn){var r=hu,n=fu;r=(n&~(1<<32-oc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=_w++,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[nl]=e,t[xw]=n,zD(t,e,!1,!1),e.stateNode=t;e:{switch(o=C7(r,n),r){case"dialog":fn("cancel",t),fn("close",t),i=n;break;case"iframe":case"object":case"embed":fn("load",t),i=n;break;case"video":case"audio":for(i=0;im1&&(e.flags|=128,n=!0,sm(s,!1),e.lanes=4194304)}else{if(!n)if(t=jb(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),sm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!yn)return Hi(e),null}else 2*Hn()-s.renderingStartTime>m1&&r!==1073741824&&(e.flags|=128,n=!0,sm(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=Hn(),e.sibling=null,r=En.current,on(En,n?r&1|2:r&1),e):(Hi(e),null);case 22:case 23:return OA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?go&1073741824&&(Hi(e),e.subtreeFlags&6&&(e.flags|=8192)):Hi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function MJ(t,e){switch(gA(e),e.tag){case 1:return Gs(e.type)&&Mb(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return p1(),mn(Ks),mn(rs),AA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _A(e),null;case 13:if(mn(En),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));f1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mn(En),null;case 4:return p1(),null;case 10:return yA(e.type._context),null;case 22:case 23:return OA(),null;case 24:return null;default:return null}}var ay=!1,Ji=!1,$J=typeof WeakSet=="function"?WeakSet:Set,_t=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){On(t,e,n)}else r.current=null}function Z7(t,e,r){try{r()}catch(n){On(t,e,n)}}var Lk=!1;function OJ(t,e){if(N7=kb,t=ZO(),hA(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,d=0,f=t,g=null;t:for(;;){for(var v;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(v=f.firstChild)!==null;)g=f,f=v;for(;;){if(f===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(M7={focusedElem:t,selectionRange:r},kb=!1,_t=e;_t!==null;)if(e=_t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,_t=t;else for(;_t!==null;){e=_t;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?P:Qa(e.type,P),M);N.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var $=e.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(L){On(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,_t=t;break}_t=e.return}return x=Lk,Lk=!1,x}function qm(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&&Z7(e,r,s)}i=i.next}while(i!==n)}}function A6(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 Q7(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 qD(t){var e=t.alternate;e!==null&&(t.alternate=null,qD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nl],delete e[xw],delete e[D7],delete e[wJ],delete e[vJ])),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 VD(t){return t.tag===5||t.tag===3||t.tag===4}function Bk(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||VD(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 Y7(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=Nb));else if(n!==4&&(t=t.child,t!==null))for(Y7(t,e,r),t=t.sibling;t!==null;)Y7(t,e,r),t=t.sibling}function J7(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(J7(t,e,r),t=t.sibling;t!==null;)J7(t,e,r),t=t.sibling}var Ai=null,tc=!1;function ud(t,e,r){for(r=r.child;r!==null;)KD(t,e,r),r=r.sibling}function KD(t,e,r){if(sl&&typeof sl.onCommitFiberUnmount=="function")try{sl.onCommitFiberUnmount(m6,r)}catch{}switch(r.tag){case 5:Ji||Pp(r,e);case 6:var n=Ai,i=tc;Ai=null,ud(t,e,r),Ai=n,tc=i,Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ai.removeChild(r.stateNode));break;case 18:Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?Ax(t.parentNode,r):t.nodeType===1&&Ax(t,r),mw(t)):Ax(Ai,r.stateNode));break;case 4:n=Ai,i=tc,Ai=r.stateNode.containerInfo,tc=!0,ud(t,e,r),Ai=n,tc=i;break;case 0:case 11:case 14:case 15:if(!Ji&&(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)&&Z7(r,e,o),i=i.next}while(i!==n)}ud(t,e,r);break;case 1:if(!Ji&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){On(r,e,a)}ud(t,e,r);break;case 21:ud(t,e,r);break;case 22:r.mode&1?(Ji=(n=Ji)||r.memoizedState!==null,ud(t,e,r),Ji=n):ud(t,e,r);break;default:ud(t,e,r)}}function Uk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new $J),e.forEach(function(n){var i=HJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ja(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Hn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*LJ(n/1960))-n,10t?16:t,Ld===null)var n=!1;else{if(t=Ld,Ld=null,qb=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,_t=t.current;_t!==null;){var s=_t,o=s.child;if(_t.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cHn()-MA?Eh(t,0):NA|=r),Zs(t,e)}function tL(t,e){e===0&&(t.mode&1?(e=J3,J3<<=1,!(J3&130023424)&&(J3=4194304)):e=1);var r=ws();t=Iu(t,e),t!==null&&(Qv(t,e,r),Zs(t,r))}function WJ(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),tL(t,r)}function HJ(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(We(314))}n!==null&&n.delete(e),tL(t,r)}var rL;rL=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ks.current)qs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return qs=!1,PJ(t,e,r);qs=!!(t.flags&131072)}else qs=!1,yn&&e.flags&1048576&&oD(e,Db,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Jy(t,e),t=e.pendingProps;var i=d1(e,rs.current);Wp(e,r),i=SA(null,e,n,t,i,r);var s=IA();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,Gs(n)?(s=!0,$b(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xA(e),i.updater=_6,e.stateNode=i,i._reactInternals=e,z7(e,n,t,r),e=q7(null,e,n,!0,s,r)):(e.tag=0,yn&&s&&pA(e),fs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Jy(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=VJ(n),t=Qa(n,t),i){case 0:e=H7(null,e,n,t,r);break e;case 1:e=$k(null,e,n,t,r);break e;case 11:e=Nk(null,e,n,t,r);break e;case 14:e=Mk(null,e,n,Qa(n.type,t),r);break e}throw Error(We(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),H7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),$k(t,e,n,i,r);case 3:e:{if(UD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,fD(t,e),Ub(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=g1(Error(We(423)),e),e=Ok(t,e,n,r,i);break e}else if(n!==i){i=g1(Error(We(424)),e),e=Ok(t,e,n,r,i);break e}else for(wo=Hd(e.stateNode.containerInfo.firstChild),bo=e,yn=!0,ic=null,r=uD(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(f1(),n===i){e=Tu(t,e,r);break e}fs(t,e,n,r)}e=e.child}return e;case 5:return hD(e),t===null&&U7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,$7(n,i)?o=null:s!==null&&$7(n,s)&&(e.flags|=32),BD(t,e),fs(t,e,o,r),e.child;case 6:return t===null&&U7(e),null;case 13:return jD(t,e,r);case 4:return CA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=h1(e,null,n,r):fs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Nk(t,e,n,i,r);case 7:return fs(t,e,e.pendingProps,r),e.child;case 8:return fs(t,e,e.pendingProps.children,r),e.child;case 12:return fs(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,on(Lb,n._currentValue),n._currentValue=o,s!==null)if(pc(s.value,o)){if(s.children===i.children&&!Ks.current){e=Tu(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=xu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),j7(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(We(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),j7(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}fs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Wp(e,r),i=ma(i),n=n(i),e.flags|=1,fs(t,e,n,r),e.child;case 14:return n=e.type,i=Qa(n,e.pendingProps),i=Qa(n.type,i),Mk(t,e,n,i,r);case 15:return DD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Jy(t,e),e.tag=1,Gs(n)?(t=!0,$b(e)):t=!1,Wp(e,r),MD(e,n,i),z7(e,n,i,r),q7(null,e,n,!0,t,r);case 19:return FD(t,e,r);case 22:return LD(t,e,r)}throw Error(We(156,e.tag))};function nL(t,e){return RO(t,e)}function qJ(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 pa(t,e,r,n){return new qJ(t,e,r,n)}function LA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function VJ(t){if(typeof t=="function")return LA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===rA)return 11;if(t===nA)return 14}return 2}function Gd(t,e){var r=t.alternate;return r===null?(r=pa(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 tb(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")LA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Cp:return Sh(r.children,i,s,e);case tA:o=8,i|=8;break;case f7:return t=pa(12,r,e,i|2),t.elementType=f7,t.lanes=s,t;case h7:return t=pa(13,r,e,i),t.elementType=h7,t.lanes=s,t;case p7:return t=pa(19,r,e,i),t.elementType=p7,t.lanes=s,t;case hO:return S6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case dO:o=10;break e;case fO:o=9;break e;case rA:o=11;break e;case nA:o=14;break e;case wd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=pa(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Sh(t,e,r,n){return t=pa(7,t,n,e),t.lanes=r,t}function S6(t,e,r,n){return t=pa(22,t,n,e),t.elementType=hO,t.lanes=r,t.stateNode={isHidden:!1},t}function Nx(t,e,r){return t=pa(6,t,null,e),t.lanes=r,t}function Mx(t,e,r){return e=pa(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function KJ(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=hx(0),this.expirationTimes=hx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hx(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BA(t,e,r,n,i,s,o,a,c){return t=new KJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=pa(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},xA(s),t}function GJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aL)}catch(t){console.error(t)}}aL(),aO.exports=ko;var zA=aO.exports;const nAe=Ec(zA);var cL,Kk=zA;cL=Kk.createRoot,Kk.hydrateRoot;const XJ="modulepreload",eX=function(t){return"/"+t},Gk={},Qs=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=eX(c),c in Gk)return;Gk[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":XJ,l||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),l)return new Promise((g,v)=>{f.addEventListener("load",g),f.addEventListener("error",()=>v(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)})},tX=Symbol(),Zk=Object.getPrototypeOf,nC=new WeakMap,rX=t=>t&&(nC.has(t)?nC.get(t):Zk(t)===Object.prototype||Zk(t)===Array.prototype),nX=t=>rX(t)&&t[tX]||null,Qk=(t,e=!0)=>{nC.set(t,e)},Gb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://ucan.dacade.my/ucan"},$x=t=>typeof t=="object"&&t!==null,yd=new WeakMap,Nm=new WeakSet,iX=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>$x(l)&&!Nm.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,d,f=n)=>{const g=i.get(l);if((g==null?void 0:g[0])===d)return g[1];const v=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Qk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const P=Reflect.get(l,x),M={value:P,enumerable:!0,configurable:!0};if(Nm.has(P))Qk(P,!1);else if(P instanceof Promise)delete M.value,M.get=()=>f(P);else if(yd.has(P)){const[N,E]=yd.get(P);M.value=s(N,E(),f)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!$x(l))throw new Error("object required");const d=o.get(l);if(d)return d;let f=a[0];const g=new Set,v=(B,K=++a[0])=>{f!==K&&(f=K,g.forEach(U=>U(B,K)))};let x=a[1];const P=(B=++a[1])=>(x!==B&&!g.size&&(x=B,N.forEach(([K])=>{const U=K[1](B);U>f&&(f=U)})),f),M=B=>(K,U)=>{const C=[...K];C[1]=[B,...C[1]],v(C,U)},N=new Map,E=(B,K)=>{if((Gb?"production":void 0)!=="production"&&N.has(B))throw new Error("prop listener already exists");if(g.size){const U=K[3](M(B));N.set(B,[K,U])}else N.set(B,[K])},$=B=>{var K;const U=N.get(B);U&&(N.delete(B),(K=U[1])==null||K.call(U))},L=B=>(g.add(B),g.size===1&&N.forEach(([U,C],p)=>{if((Gb?"production":void 0)!=="production"&&C)throw new Error("remove already exists");const m=U[3](M(p));N.set(p,[U,m])}),()=>{g.delete(B),g.size===0&&N.forEach(([U,C],p)=>{C&&(C(),N.set(p,[U]))})}),j=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(j,{deleteProperty(B,K){const U=Reflect.get(B,K);$(K);const C=Reflect.deleteProperty(B,K);return C&&v(["delete",[K],U]),C},set(B,K,U,C){const p=Reflect.has(B,K),m=Reflect.get(B,K,C);if(p&&(t(m,U)||o.has(U)&&t(m,o.get(U))))return!0;$(K),$x(U)&&(U=nX(U)||U);let w=U;if(U instanceof Promise)U.then(_=>{U.status="fulfilled",U.value=_,v(["resolve",[K],_])}).catch(_=>{U.status="rejected",U.reason=_,v(["reject",[K],_])});else{!yd.has(U)&&r(U)&&(w=c(U));const _=!Nm.has(w)&&yd.get(w);_&&E(K,_)}return Reflect.set(B,K,w,C),v(["set",[K],U,m]),!0}});o.set(l,I);const T=[j,P,s,L];return yd.set(I,T),Reflect.ownKeys(l).forEach(B=>{const K=Object.getOwnPropertyDescriptor(l,B);"value"in K&&(I[B]=l[B],delete K.value,delete K.writable),Object.defineProperty(j,B,K)}),I})=>[c,yd,Nm,t,e,r,n,i,s,o,a],[sX]=iX();function Rn(t={}){return sX(t)}function bs(t,e,r){const n=yd.get(t);(Gb?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(d=>{s.push(d),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function iC(t,e){const r=yd.get(t);(Gb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function sc(t){return Nm.add(t),t}function Ts(t,e,r,n){let i=t[e];return bs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function oX(t){const e=Rn({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var lL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",f="month",g="quarter",v="year",x="date",P="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var w=["th","st","nd","rd"],_=m%100;return"["+m+(w[(_-20)%10]||w[_]||w[0])+"]"}},$=function(m,w,_){var R=String(m);return!R||R.length>=w?m:""+Array(w+1-R.length).join(_)+m},L={s:$,z:function(m){var w=-m.utcOffset(),_=Math.abs(w),R=Math.floor(_/60),S=_%60;return(w<=0?"+":"-")+$(R,2,"0")+":"+$(S,2,"0")},m:function m(w,_){if(w.date()<_.date())return-m(_,w);var R=12*(_.year()-w.year())+(_.month()-w.month()),S=w.clone().add(R,f),k=_-S<0,y=w.clone().add(R+(k?-1:1),f);return+(-(R+(_-S)/(k?S-y:y-S))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:f,y:v,w:d,d:l,D:x,h:c,m:a,s:o,ms:s,Q:g}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},j="en",H={};H[j]=E;var I="$isDayjsObject",T=function(m){return m instanceof C||!(!m||!m[I])},B=function m(w,_,R){var S;if(!w)return j;if(typeof w=="string"){var k=w.toLowerCase();H[k]&&(S=k),_&&(H[k]=_,S=k);var y=w.split("-");if(!S&&y.length>1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!R&&S&&(j=S),S||!R&&j},K=function(m,w){if(T(m))return m.clone();var _=typeof w=="object"?w:{};return _.date=m,_.args=arguments,new C(_)},U=L;U.l=B,U.i=T,U.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var C=function(){function m(_){this.$L=B(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(_){this.$d=function(R){var S=R.date,k=R.utc;if(S===null)return new Date(NaN);if(U.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var y=S.match(M);if(y){var b=y[2]-1||0,V=(y[7]||"0").substring(0,3);return k?new Date(Date.UTC(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)):new Date(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)}}return new Date(S)}(_),this.init()},w.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},w.$utils=function(){return U},w.isValid=function(){return this.$d.toString()!==P},w.isSame=function(_,R){var S=K(_);return this.startOf(R)<=S&&S<=this.endOf(R)},w.isAfter=function(_,R){return K(_)0,H<=j.r||!j.r){H<=1&&L>0&&(j=E[L-1]);var I=N[j.l];v&&(H=v(""+H)),P=typeof I=="string"?I.replace("%d",H):I(H,d,j.l,M);break}}if(d)return P;var T=M?N.future:N.past;return typeof T=="function"?T(P):T.replace("%s",P)},s.to=function(l,d){return a(l,d,this,!0)},s.from=function(l,d){return a(l,d,this)};var c=function(l){return l.$u?i.utc():i()};s.toNow=function(l){return this.to(c(this),l)},s.fromNow=function(l){return this.from(c(this),l)}}})})(dL);var uX=dL.exports;const dX=Ec(uX);var fL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){return function(r,n,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})})(fL);var fX=fL.exports;const hX=Ec(fX);qp.extend(dX);qp.extend(hX);const pX={...lX,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};qp.locale("en-web3-modal",pX);const WA={getYear(t=new Date().toISOString()){return qp(t).year()},getRelativeDateFromNow(t){return qp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return qp(t).format(e)}},Ya={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var gX=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ox=Math.ceil,ra=Math.floor,Us="[BigNumber Error] ",Yk=Us+"Number primitive has more than 15 significant digits: ",Fa=1e14,sr=14,Dx=9007199254740991,Lx=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],dd=1e7,li=1e9;function hL(t){var e,r,n,i=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),o=20,a=4,c=-7,l=21,d=-1e7,f=1e7,g=!1,v=1,x=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,B){var K,U,C,p,m,w,_,R,S=this;if(!(S instanceof E))return new E(T,B);if(B==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>f?S.c=S.e=null:T.e=10;m/=10,p++);p>f?S.c=S.e=null:(S.e=p,S.c=[T]);return}R=String(T)}else{if(!gX.test(R=String(T)))return n(S,R,w);S.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(p=R.indexOf("."))>-1&&(R=R.replace(".","")),(m=R.search(/e/i))>0?(p<0&&(p=m),p+=+R.slice(m+1),R=R.substring(0,m)):p<0&&(p=R.length)}else{if(_n(B,2,M.length,"Base"),B==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(R=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,R,w,B);if(S.s=1/T<0?(R=R.slice(1),-1):1,E.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(Yk+T)}else S.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(K=M.slice(0,B),p=m=0,_=R.length;m<_;m++)if(K.indexOf(U=R.charAt(m))<0){if(U=="."){if(m>p){p=_;continue}}else if(!C&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){C=!0,m=-1,p=0;continue}return n(S,String(T),w,B)}w=!1,R=r(R,B,10,S.s),(p=R.indexOf("."))>-1?R=R.replace(".",""):p=R.length}for(m=0;R.charCodeAt(m)===48;m++);for(_=R.length;R.charCodeAt(--_)===48;);if(R=R.slice(m,++_)){if(_-=m,w&&E.DEBUG&&_>15&&(T>Dx||T!==ra(T)))throw Error(Yk+S.s*T);if((p=p-m-1)>f)S.c=S.e=null;else if(p=-li&&C<=li&&C===ra(C)){if(U[0]===0){if(C===0&&U.length===1)return!0;break e}if(B=(C+1)%sr,B<1&&(B+=sr),String(U[0]).length==B){for(B=0;B=Fa||K!==ra(K))break e;if(K!==0)return!0}}}else if(U===null&&C===null&&(p===null||p===1||p===-1))return!0;throw Error(Us+"Invalid BigNumber: "+T)},E.maximum=E.max=function(){return L(arguments,-1)},E.minimum=E.min=function(){return L(arguments,1)},E.random=function(){var T=9007199254740992,B=Math.random()*T&2097151?function(){return ra(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var U,C,p,m,w,_=0,R=[],S=new E(s);if(K==null?K=o:_n(K,0,li),m=Ox(K/sr),g)if(crypto.getRandomValues){for(U=crypto.getRandomValues(new Uint32Array(m*=2));_>>11),w>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),U[_]=C[0],U[_+1]=C[1]):(R.push(w%1e14),_+=2);_=m/2}else if(crypto.randomBytes){for(U=crypto.randomBytes(m*=7);_=9e15?crypto.randomBytes(7).copy(U,_):(R.push(w%1e14),_+=7);_=m/7}else throw g=!1,Error(Us+"crypto unavailable");if(!g)for(;_=10;w/=10,_++);_C-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/C|0,w[m]%=C)}return w.reverse()}return function(K,U,C,p,m){var w,_,R,S,k,y,b,V,ce=K.indexOf("."),fe=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(U),y=V.pow(K.length-ce),x=S,V.c=B(Jl(Go(y.c),y.e,"0"),10,C,T),V.e=V.c.length),b=B(K,U,C,m?(w=M,T):(w=T,M)),R=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--R:(y.c=b,y.e=R,y.s=p,y=e(y,V,fe,W,C),b=y.c,k=y.r,R=y.e),_=R+fe+1,ce=b[_],S=C/2,k=k||_<0||b[_+1]!=null,k=W<4?(ce!=null||k)&&(W==0||W==(y.s<0?3:2)):ce>S||ce==S&&(W==4||k||W==6&&b[_-1]&1||W==(y.s<0?8:7)),_<1||!b[0])K=k?Jl(w.charAt(1),-fe,w.charAt(0)):w.charAt(0);else{if(b.length=_,k)for(--C;++b[--_]>C;)b[_]=0,_||(++R,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Jl(K,R,w.charAt(0))}return K}}(),e=function(){function T(U,C,p){var m,w,_,R,S=0,k=U.length,y=C%dd,b=C/dd|0;for(U=U.slice();k--;)_=U[k]%dd,R=U[k]/dd|0,m=b*_+R*y,w=y*_+m%dd*dd+S,S=(w/p|0)+(m/dd|0)+b*R,U[k]=w%p;return S&&(U=[S].concat(U)),U}function B(U,C,p,m){var w,_;if(p!=m)_=p>m?1:-1;else for(w=_=0;wC[w]?1:-1;break}return _}function K(U,C,p,m){for(var w=0;p--;)U[p]-=w,w=U[p]1;U.splice(0,1));}return function(U,C,p,m,w){var _,R,S,k,y,b,V,ce,fe,W,ue,J,ne,ie,D,te,me,Ce=U.s==C.s?1:-1,Ee=U.c,Re=C.c;if(!Ee||!Ee[0]||!Re||!Re[0])return new E(!U.s||!C.s||(Ee?Re&&Ee[0]==Re[0]:!Re)?NaN:Ee&&Ee[0]==0||!Re?Ce*0:Ce/0);for(ce=new E(Ce),fe=ce.c=[],R=U.e-C.e,Ce=p+R+1,w||(w=Fa,R=na(U.e/sr)-na(C.e/sr),Ce=Ce/sr|0),S=0;Re[S]==(Ee[S]||0);S++);if(Re[S]>(Ee[S]||0)&&R--,Ce<0)fe.push(1),k=!0;else{for(ie=Ee.length,te=Re.length,S=0,Ce+=2,y=ra(w/(Re[0]+1)),y>1&&(Re=T(Re,y,w),Ee=T(Ee,y,w),te=Re.length,ie=Ee.length),ne=te,W=Ee.slice(0,te),ue=W.length;ue=w/2&&D++;do{if(y=0,_=B(Re,W,te,ue),_<0){if(J=W[0],te!=ue&&(J=J*w+(W[1]||0)),y=ra(J/D),y>1)for(y>=w&&(y=w-1),b=T(Re,y,w),V=b.length,ue=W.length;B(b,W,V,ue)==1;)y--,K(b,te=10;Ce/=10,S++);H(ce,p+(ce.e=S+R*sr-1)+1,m,k)}else ce.e=R,ce.r=+k;return ce}}();function $(T,B,K,U){var C,p,m,w,_;if(K==null?K=a:_n(K,0,8),!T.c)return T.toString();if(C=T.c[0],m=T.e,B==null)_=Go(T.c),_=U==1||U==2&&(m<=c||m>=l)?dy(_,m):Jl(_,m,"0");else if(T=H(new E(T),B,K),p=T.e,_=Go(T.c),w=_.length,U==1||U==2&&(B<=p||p<=c)){for(;ww){if(--B>0)for(_+=".";B--;_+="0");}else if(B+=p-w,B>0)for(p+1==w&&(_+=".");B--;_+="0");return T.s<0&&C?"-"+_:_}function L(T,B){for(var K,U,C=1,p=new E(T[0]);C=10;C/=10,U++);return(K=U+K*sr-1)>f?T.c=T.e=null:K=10;w/=10,C++);if(p=B-C,p<0)p+=sr,m=B,_=k[R=0],S=ra(_/y[C-m-1]%10);else if(R=Ox((p+1)/sr),R>=k.length)if(U){for(;k.length<=R;k.push(0));_=S=0,C=1,p%=sr,m=p-sr+1}else break e;else{for(_=w=k[R],C=1;w>=10;w/=10,C++);p%=sr,m=p-sr+C,S=m<0?0:ra(_/y[C-m-1]%10)}if(U=U||B<0||k[R+1]!=null||(m<0?_:_%y[C-m-1]),U=K<4?(S||U)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||U||K==6&&(p>0?m>0?_/y[C-m]:0:k[R-1])%10&1||K==(T.s<0?8:7)),B<1||!k[0])return k.length=0,U?(B-=T.e+1,k[0]=y[(sr-B%sr)%sr],T.e=-B||0):k[0]=T.e=0,T;if(p==0?(k.length=R,w=1,R--):(k.length=R+1,w=y[sr-p],k[R]=m>0?ra(_/y[C-m]%y[m])*w:0),U)for(;;)if(R==0){for(p=1,m=k[0];m>=10;m/=10,p++);for(m=k[0]+=w,w=1;m>=10;m/=10,w++);p!=w&&(T.e++,k[0]==Fa&&(k[0]=1));break}else{if(k[R]+=w,k[R]!=Fa)break;k[R--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>f?T.c=T.e=null:T.e=l?dy(B,K):Jl(B,K,"0"),T.s<0?"-"+B:B)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,B){return Xf(this,new E(T,B))},i.decimalPlaces=i.dp=function(T,B){var K,U,C,p=this;if(T!=null)return _n(T,0,li),B==null?B=a:_n(B,0,8),H(new E(p),T+p.e+1,B);if(!(K=p.c))return null;if(U=((C=K.length-1)-na(this.e/sr))*sr,C=K[C])for(;C%10==0;C/=10,U--);return U<0&&(U=0),U},i.dividedBy=i.div=function(T,B){return e(this,new E(T,B),o,a)},i.dividedToIntegerBy=i.idiv=function(T,B){return e(this,new E(T,B),0,1)},i.exponentiatedBy=i.pow=function(T,B){var K,U,C,p,m,w,_,R,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Us+"Exponent not an integer: "+I(T));if(B!=null&&(B=new E(B)),w=T.e>14,!k.c||!k.c[0]||k.c[0]==1&&!k.e&&k.c.length==1||!T.c||!T.c[0])return S=new E(Math.pow(+I(k),w?T.s*(2-uy(T)):+I(T))),B?S.mod(B):S;if(_=T.s<0,B){if(B.c?!B.c[0]:!B.s)return new E(NaN);U=!_&&k.isInteger()&&B.isInteger(),U&&(k=k.mod(B))}else{if(T.e>9&&(k.e>0||k.e<-1||(k.e==0?k.c[0]>1||w&&k.c[1]>=24e7:k.c[0]<8e13||w&&k.c[0]<=9999975e7)))return p=k.s<0&&uy(T)?-0:0,k.e>-1&&(p=1/p),new E(_?1/p:p);x&&(p=Ox(x/sr+2))}for(w?(K=new E(.5),_&&(T.s=1),R=uy(T)):(C=Math.abs(+I(T)),R=C%2),S=new E(s);;){if(R){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):U&&(S=S.mod(B))}if(C){if(C=ra(C/2),C===0)break;R=C%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)R=uy(T);else{if(C=+I(T),C===0)break;R=C%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):U&&(k=k.mod(B))}return U?S:(_&&(S=s.div(S)),B?S.mod(B):p?H(S,x,a,m):S)},i.integerValue=function(T){var B=new E(this);return T==null?T=a:_n(T,0,8),H(B,B.e+1,T)},i.isEqualTo=i.eq=function(T,B){return Xf(this,new E(T,B))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,B){return Xf(this,new E(T,B))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,B){return(B=Xf(this,new E(T,B)))===1||B===0},i.isInteger=function(){return!!this.c&&na(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,B){return Xf(this,new E(T,B))<0},i.isLessThanOrEqualTo=i.lte=function(T,B){return(B=Xf(this,new E(T,B)))===-1||B===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(T,B){var K,U,C,p,m=this,w=m.s;if(T=new E(T,B),B=T.s,!w||!B)return new E(NaN);if(w!=B)return T.s=-B,m.plus(T);var _=m.e/sr,R=T.e/sr,S=m.c,k=T.c;if(!_||!R){if(!S||!k)return S?(T.s=-B,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-B,T):new E(S[0]?m:a==3?-0:0)}if(_=na(_),R=na(R),S=S.slice(),w=_-R){for((p=w<0)?(w=-w,C=S):(R=_,C=k),C.reverse(),B=w;B--;C.push(0));C.reverse()}else for(U=(p=(w=S.length)<(B=k.length))?w:B,w=B=0;B0)for(;B--;S[K++]=0);for(B=Fa-1;U>w;){if(S[--U]=0;){for(K=0,y=J[C]%fe,b=J[C]/fe|0,m=_,p=C+m;p>C;)R=ue[--m]%fe,S=ue[m]/fe|0,w=b*R+S*y,R=y*R+w%fe*fe+V[p]+K,K=(R/ce|0)+(w/fe|0)+b*S,V[p--]=R%ce;V[p]=K}return K?++U:V.splice(0,1),j(T,V,U)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,B){var K,U=this,C=U.s;if(T=new E(T,B),B=T.s,!C||!B)return new E(NaN);if(C!=B)return T.s=-B,U.minus(T);var p=U.e/sr,m=T.e/sr,w=U.c,_=T.c;if(!p||!m){if(!w||!_)return new E(C/0);if(!w[0]||!_[0])return _[0]?T:new E(w[0]?U:C*0)}if(p=na(p),m=na(m),w=w.slice(),C=p-m){for(C>0?(m=p,K=_):(C=-C,K=w),K.reverse();C--;K.push(0));K.reverse()}for(C=w.length,B=_.length,C-B<0&&(K=_,_=w,w=K,B=C),C=0;B;)C=(w[--B]=w[B]+_[B]+C)/Fa|0,w[B]=Fa===w[B]?0:w[B]%Fa;return C&&(w=[C].concat(w),++m),j(T,w,m)},i.precision=i.sd=function(T,B){var K,U,C,p=this;if(T!=null&&T!==!!T)return _n(T,1,li),B==null?B=a:_n(B,0,8),H(new E(p),T,B);if(!(K=p.c))return null;if(C=K.length-1,U=C*sr+1,C=K[C]){for(;C%10==0;C/=10,U--);for(C=K[0];C>=10;C/=10,U++);}return T&&p.e+1>U&&(U=p.e+1),U},i.shiftedBy=function(T){return _n(T,-Dx,Dx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,B,K,U,C,p=this,m=p.c,w=p.s,_=p.e,R=o+4,S=new E("0.5");if(w!==1||!m||!m[0])return new E(!w||w<0&&(!m||m[0])?NaN:m?p:1/0);if(w=Math.sqrt(+I(p)),w==0||w==1/0?(B=Go(m),(B.length+_)%2==0&&(B+="0"),w=Math.sqrt(+B),_=na((_+1)/2)-(_<0||_%2),w==1/0?B="5e"+_:(B=w.toExponential(),B=B.slice(0,B.indexOf("e")+1)+_),K=new E(B)):K=new E(w+""),K.c[0]){for(_=K.e,w=_+R,w<3&&(w=0);;)if(C=K,K=S.times(C.plus(e(p,C,R,1))),Go(C.c).slice(0,w)===(B=Go(K.c)).slice(0,w))if(K.e<_&&--w,B=B.slice(w-3,w+1),B=="9999"||!U&&B=="4999"){if(!U&&(H(C,C.e+o+2,0),C.times(C).eq(p))){K=C;break}R+=4,w+=4,U=1}else{(!+B||!+B.slice(1)&&B.charAt(0)=="5")&&(H(K,K.e+o+2,1),T=!K.times(K).eq(p));break}}return H(K,K.e+o+1,a,T)},i.toExponential=function(T,B){return T!=null&&(_n(T,0,li),T++),$(this,T,B,1)},i.toFixed=function(T,B){return T!=null&&(_n(T,0,li),T=T+this.e+1),$(this,T,B)},i.toFormat=function(T,B,K){var U,C=this;if(K==null)T!=null&&B&&typeof B=="object"?(K=B,B=null):T&&typeof T=="object"?(K=T,T=B=null):K=P;else if(typeof K!="object")throw Error(Us+"Argument not an object: "+K);if(U=C.toFixed(T,B),C.c){var p,m=U.split("."),w=+K.groupSize,_=+K.secondaryGroupSize,R=K.groupSeparator||"",S=m[0],k=m[1],y=C.s<0,b=y?S.slice(1):S,V=b.length;if(_&&(p=w,w=_,_=p,V-=p),w>0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=R+b.slice(p)),y&&(S="-"+S)}U=k?S+(K.decimalSeparator||"")+((_=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+_+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+U+(K.suffix||"")},i.toFraction=function(T){var B,K,U,C,p,m,w,_,R,S,k,y,b=this,V=b.c;if(T!=null&&(w=new E(T),!w.isInteger()&&(w.c||w.s!==1)||w.lt(s)))throw Error(Us+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(B=new E(s),R=K=new E(s),U=_=new E(s),y=Go(V),p=B.e=y.length-b.e-1,B.c[0]=Lx[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(B)>0?p>0?B:R:w,m=f,f=1/0,w=new E(y),_.c[0]=0;S=e(w,B,0,1),C=K.plus(S.times(U)),C.comparedTo(T)!=1;)K=U,U=C,R=_.plus(S.times(C=R)),_=C,B=w.minus(S.times(C=B)),w=C;return C=e(T.minus(K),U,0,1),_=_.plus(C.times(R)),K=K.plus(C.times(U)),_.s=R.s=b.s,p=p*2,k=e(R,U,p,a).minus(b).abs().comparedTo(e(_,K,p,a).minus(b).abs())<1?[R,U]:[_,K],f=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,B){return T!=null&&_n(T,1,li),$(this,T,B,2)},i.toString=function(T){var B,K=this,U=K.s,C=K.e;return C===null?U?(B="Infinity",U<0&&(B="-"+B)):B="NaN":(T==null?B=C<=c||C>=l?dy(Go(K.c),C):Jl(Go(K.c),C,"0"):T===10&&N?(K=H(new E(K),o+C+1,a),B=Jl(Go(K.c),K.e,"0")):(_n(T,2,M.length,"Base"),B=r(Jl(Go(K.c),C,"0"),10,T,U,!0)),U<0&&K.c[0]&&(B="-"+B)),B},i.valueOf=i.toJSON=function(){return I(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&E.set(t),E}function na(t){var e=t|0;return t>0||t===e?e:e-1}function Go(t){for(var e,r,n=1,i=t.length,s=t[0]+"";nl^r?1:-1;for(a=(c=i.length)<(l=s.length)?c:l,o=0;os[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function _n(t,e,r,n){if(tr||t!==ra(t))throw Error(Us+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function uy(t){var e=t.c.length-1;return na(t.e/sr)==e&&t.c[e]%2!=0}function dy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Jl(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(n=t.length,++e>n){for(i=r,e-=n;--e;i+=r);t+=i}else e="0"&&s<="9";!i&&(a||c||l||d)&&t.preventDefault(),e==="0"&&!f&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(f||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!f&&t.preventDefault()}},wX=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],HA={URLS:{FAQ:"https://walletconnect.com/faq"}},xn={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"}},nn={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},sn={setItem(t,e){hy()&&localStorage.setItem(t,e)},getItem(t){if(hy())return localStorage.getItem(t)||void 0},removeItem(t){hy()&&localStorage.removeItem(t)},clear(){hy()&&localStorage.clear()}};function hy(){return typeof window<"u"&&typeof localStorage<"u"}function wu(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function vX(t){return(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX))}const yX="rpc.walletconnect.org",Tw={extendRpcUrlWithProjectId(t,e){if(t.includes(yX)){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},extendCaipNetwork(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return{...t,imageId:e[t.chainId],imageUrl:r==null?void 0:r[t.chainId],rpcUrl:Tw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Tw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Bx="https://secure.walletconnect.org",pL=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],bX="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Tn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Bx,SECURE_SITE_DASHBOARD:`${Bx}/dashboard`,SECURE_SITE_FAVICON:`${Bx}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0}},Ue={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Tn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Tn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Tn.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e);let r=t;r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},formatUniversalUrl(t,e){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},openHref(t,e,r){window.open(t,e,r||"noreferrer noopener")},returnOpenHref(t,e,r){return window.open(t,e,r||"noreferrer noopener")},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ue.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return xn.W3M_API_URL},getBlockchainApiUrl(){return xn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return xn.PULSE_API_URL},getUUID(){return 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)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?"universal":t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`}};async function am(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class P6{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await am(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const dn=Rn({features:Tn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:dn,subscribeKey(t,e){return Ts(dn,t,e)},setOptions(t){Object.assign(dn,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{dn.features||(dn.features=Tn.DEFAULT_FEATURES),e in dn.features&&(dn.features[e]=r)})},setProjectId(t){dn.projectId=t},setAllWallets(t){dn.allWallets=t},setIncludeWalletIds(t){dn.includeWalletIds=t},setExcludeWalletIds(t){dn.excludeWalletIds=t},setFeaturedWalletIds(t){dn.featuredWalletIds=t},setTokens(t){dn.tokens=t},setTermsConditionsUrl(t){dn.termsConditionsUrl=t},setPrivacyPolicyUrl(t){dn.privacyPolicyUrl=t},setCustomWallets(t){dn.customWallets=t},setIsSiweEnabled(t){dn.isSiweEnabled=t},setIsUniversalProvider(t){dn.isUniversalProvider=t},setSdkVersion(t){dn.sdkVersion=t},setMetadata(t){dn.metadata=t},setDisableAppend(t){dn.disableAppend=t},setEIP6963Enabled(t){dn.enableEIP6963=t},setEnableWalletConnect(t){dn.enableWalletConnect=t},setEnableWallets(t){dn.enableWallets=t},setHasMultipleAddresses(t){dn.hasMultipleAddresses=t}},xX=Ue.getAnalyticsUrl(),CX=new P6({baseUrl:xX,clientId:null}),_X=["MODAL_CREATED"],ap=Rn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:ap,subscribe(t){return bs(ap,()=>t(ap))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{if(_X.includes(t.data.event)||typeof window>"u")return;await CX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Ue.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;ap.timestamp=Date.now(),ap.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(ap)}},Jk=Rn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Jk,replaceState(t){t&&Object.assign(Jk,sc(t))},subscribeKey(t,e){let r;return ge.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return ge.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;ge.setActiveCaipNetwork(t),this.checkIfSupportedNetwork()||this.showUnsupportedChainUI()},setCaipNetwork(t){if(t){if(!(t!=null&&t.chainNamespace))throw new Error("chain is required to set active network");ge.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){ge.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){ge.setChainNetworkData(e||ge.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){ge.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!ge.state.activeChain)throw new Error("activeChain is required to get requested networks");if(t){const s=t;if(!s)throw new Error("chain is required to get requested networks");e=[s]}else e=[...ge.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,f,g,v;(a=(o=ge.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=ge.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(f=(d=ge.state.chains.get(s))==null?void 0:d.networkState)!=null&&f.requestedCaipNetworks&&n.push(...((v=(g=ge.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Ue.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=ge.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),ge.setActiveCaipNetwork(t),t&&ot.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},getApprovedCaipNetworkIds(t){var r,n;if(t){const i=t;if(!i)throw new Error("chain is required to get approved network IDs");return(n=(r=ge.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(ge.state.chains).forEach(i=>{var s;i.networkState.approvedCaipNetworkIds&&e.push(...((s=i.networkState)==null?void 0:s.approvedCaipNetworkIds)||[])}),e},async setApprovedCaipNetworksData(t){const e=ge.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");ge.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=ge.state.activeChain;if(!t)return!1;const e=ge.state.activeCaipNetwork,r=this.getRequestedCaipNetworks(t);return r.length?r==null?void 0:r.some(n=>n.id===(e==null?void 0:e.id)):!0},checkIfSmartAccountEnabled(){var n;const t=Ya.caipNetworkIdToNumber((n=ge.state.activeCaipNetwork)==null?void 0:n.id);if(!ge.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=ge.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=ge.state.activeChain;if(!t)throw new Error("chain is required to reset network");ge.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=ge.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=ge.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.supportsAllNetworks},showUnsupportedChainUI(){setTimeout(()=>{jt.open({view:"UnsupportedChain"})},300)},getActiveNetworkTokenAddress(){var e,r;const t=Tn.NATIVE_TOKEN_ADDRESS[((e=ge.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=ge.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},AX={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},gL=Ue.getBlockchainApiUrl(),Zn=Rn({clientId:null,api:new P6({baseUrl:gL,clientId:null})}),bn={state:Zn,fetchIdentity({address:t}){return Zn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:ge.state.activeCaipAddress?Ue.getPlainAddress(ge.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Zn.api.get({path:`/v1/account/${t}/history`,params:{projectId:e,cursor:r,onramp:n,chainId:o},signal:i,cache:s})},fetchSwapQuote({projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}){return Zn.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}})},fetchSwapTokens({projectId:t,chainId:e}){return Zn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Zn.api.post({path:"/v1/fungible/price",body:{projectId:t,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:t,tokenAddress:e,userAddress:r}){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:"/v1/convert/allowance",params:{projectId:t,tokenAddress:e,userAddress:r},headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:t,chainId:e}){const{sdkType:r,sdkVersion:n}=qe.state;return Zn.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{projectId:t,chainId:e}})},generateSwapCalldata({amount:t,from:e,projectId:r,to:n,userAddress:i}){return Zn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Tn.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:r,to:n,userAddress:i}})},generateApproveCalldata({from:t,projectId:e,to:r,userAddress:n}){const{sdkType:i,sdkVersion:s}=qe.state;return Zn.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":s||"html-wagmi-4.2.2"},params:{projectId:e,userAddress:n,from:t,to:r}})},async getBalance(t,e,r){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:`/v1/account/${t}/balance`,headers:{"x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:qe.state.projectId,chainId:e,forceUpdate:r}})},async lookupEnsName(t){return Zn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Zn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Se.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Zn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Zn.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){return(await Zn.api.post({path:"/v1/generators/onrampurl",params:{projectId:qe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await Zn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return AX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Zn.api.post({path:"/v1/onramp/quote",params:{projectId:qe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}})}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},setClientId(t){Zn.clientId=t,Zn.api=new P6({baseUrl:gL,clientId:t})}},Zo=Rn({message:"",variant:"success",open:!1}),St={state:Zo,subscribeKey(t,e){return Ts(Zo,t,e)},showLoading(t){Zo.message=t,Zo.variant="loading",Zo.open=!0},showSuccess(t){Zo.message=t,Zo.variant="success",Zo.open=!0},showError(t){const e=Ue.parseError(t);Zo.message=e,Zo.variant="error",Zo.open=!0},hide(){Zo.open=!1}};var mL={},N6={};N6.byteLength=IX;N6.toByteArray=kX;N6.fromByteArray=NX;var il=[],oa=[],EX=typeof Uint8Array<"u"?Uint8Array:Array,Ux="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var cp=0,SX=Ux.length;cp0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function IX(t){var e=wL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function TX(t,e,r){return(e+r)*3/4-r}function kX(t){var e,r=wL(t),n=r[0],i=r[1],s=new EX(TX(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=oa[t.charCodeAt(c)]<<2|oa[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=oa[t.charCodeAt(c)]<<10|oa[t.charCodeAt(c+1)]<<4|oa[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function RX(t){return il[t>>18&63]+il[t>>12&63]+il[t>>6&63]+il[t&63]}function PX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(il[e>>2]+il[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(il[e>>10]+il[e>>4&63]+il[e<<2&63]+"=")),i.join("")}var qA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */qA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,f=r?i-1:0,g=r?-1:1,v=t[e+f];for(f+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=g,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(v?-1:1)*o*Math.pow(2,s-n)};qA.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,d=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,x=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=g/c:e+=g*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+v]=a&255,v+=x,a/=256,i-=8);for(o=o<0;t[r+v]=o&255,v+=x,o/=256,l-=8);t[r+v-x]|=P*128};/*! +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Cx(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function $7(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var aJ=typeof WeakMap=="function"?WeakMap:Map;function vD(t,e,r){r=vu(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Bb||(Bb=!0,q7=n),$7(t,e)},r}function yD(t,e,r){r=vu(-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(){$7(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){$7(t,e),typeof n!="function"&&(Wd===null?Wd=new Set([this]):Wd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function mk(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new aJ;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=xJ.bind(null,t,e,r),e.then(t,t))}function wk(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 vk(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=vu(-1,1),e.tag=2,zd(r,e,1))),r.lanes|=1),t)}var cJ=Wu.ReactCurrentOwner,Fs=!1;function ls(t,e,r,n){e.child=t===null?G$(e,null,r,n):d1(e,t.child,r,n)}function yk(t,e,r,n,i){r=r.render;var s=e.ref;return Fp(e,i),n=gA(t,e,r,n,s,i),r=mA(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Eu(t,e,i)):(wn&&r&&nA(e),e.flags|=1,ls(t,e,n,i),e.child)}function bk(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!SA(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,bD(t,e,s,n,i)):(t=Qy(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:mw,r(o,n)&&t.ref===e.ref)return Eu(t,e,i)}return e.flags|=1,t=qd(s,n),t.ref=e.ref,t.return=e,e.child=t}function bD(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(mw(s,n)&&t.ref===e.ref)if(Fs=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Fs=!0);else return e.lanes=t.lanes,Eu(t,e,i)}return D7(t,e,r,n,i)}function xD(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},sn(Rp,lo),lo|=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,sn(Rp,lo),lo|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,sn(Rp,lo),lo|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,sn(Rp,lo),lo|=n;return ls(t,e,i,r),e.child}function _D(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function D7(t,e,r,n,i){var s=Hs(r)?Ph:Xi.current;return s=l1(e,s),Fp(e,i),r=gA(t,e,r,n,s,i),n=mA(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Eu(t,e,i)):(wn&&n&&nA(e),e.flags|=1,ls(t,e,r,i),e.child)}function xk(t,e,r,n,i){if(Hs(r)){var s=!0;Tb(e)}else s=!1;if(Fp(e,i),e.stateNode===null)Ky(t,e),wD(e,r,n),O7(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=ha(l):(l=Hs(r)?Ph:Xi.current,l=l1(e,l));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&gk(e,o,n,l),gd=!1;var g=e.memoizedState;o.state=g,Mb(e,n,o,i),c=e.memoizedState,a!==n||g!==c||Ws.current||gd?(typeof d=="function"&&(M7(e,r,d,n),c=e.memoizedState),(a=gd||pk(e,r,a,n,g,c,l))?(h||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,Q$(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:Ka(e.type,a),o.props=l,h=e.pendingProps,g=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ha(c):(c=Hs(r)?Ph:Xi.current,c=l1(e,c));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||g!==c)&&gk(e,o,n,c),gd=!1,g=e.memoizedState,o.state=g,Mb(e,n,o,i);var x=e.memoizedState;a!==h||g!==x||Ws.current||gd?(typeof v=="function"&&(M7(e,r,v,n),x=e.memoizedState),(l=gd||pk(e,r,l,n,g,x,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,x,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,x,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=x),o.props=n,o.state=x,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),n=!1)}return L7(t,e,r,n,s,i)}function L7(t,e,r,n,i,s){_D(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&ok(e,r,!1),Eu(t,e,s);n=e.stateNode,cJ.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=d1(e,t.child,null,s),e.child=d1(e,null,a,s)):ls(t,e,a,s),e.memoizedState=n.state,i&&ok(e,r,!0),e.child}function CD(t){var e=t.stateNode;e.pendingContext?sk(t,e.pendingContext,e.pendingContext!==e.context):e.context&&sk(t,e.context,!1),dA(t,e.containerInfo)}function _k(t,e,r,n,i){return u1(),sA(i),e.flags|=256,ls(t,e,r,n),e.child}var B7={dehydrated:null,treeContext:null,retryLane:0};function U7(t){return{baseLanes:t,cachePool:null,transitions:null}}function AD(t,e,r){var n=e.pendingProps,i=Cn.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),sn(Cn,i&1),t===null)return R7(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=y6(o,n,0,null),t=Ah(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=U7(r),e.memoizedState=B7,t):yA(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return lJ(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=qd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=qd(a,s):(s=Ah(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?U7(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=B7,n}return s=t.child,t=s.sibling,n=qd(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 yA(t,e){return e=y6({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function ny(t,e,r,n){return n!==null&&sA(n),d1(e,t.child,null,r),t=yA(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function lJ(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Cx(Error(We(422))),ny(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=y6({mode:"visible",children:n.children},i,0,null),s=Ah(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&d1(e,t.child,null,o),e.child.memoizedState=U7(o),e.memoizedState=B7,s);if(!(e.mode&1))return ny(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(We(419)),n=Cx(s,n,void 0),ny(t,e,o,n)}if(a=(o&t.childLanes)!==0,Fs||a){if(n=mi,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,Au(t,i),ac(n,t,i,-1))}return EA(),n=Cx(Error(We(421))),ny(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=_J.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ho=Fd(i.nextSibling),mo=e,wn=!0,tc=null,t!==null&&(ca[la++]=fu,ca[la++]=hu,ca[la++]=Rh,fu=t.id,hu=t.overflow,Rh=e),e=yA(e,n.children),e.flags|=4096,e)}function Ck(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),N7(t.return,e,r)}function Ax(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 ED(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(ls(t,e,n.children,r),n=Cn.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&&Ck(t,r,e);else if(t.tag===19)Ck(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(sn(Cn,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&&Ob(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Ax(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&&Ob(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Ax(e,!0,r,null,s);break;case"together":Ax(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Ky(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Eu(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Mh|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(We(153));if(e.child!==null){for(t=e.child,r=qd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=qd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function uJ(t,e,r){switch(e.tag){case 3:CD(e),u1();break;case 5:Y$(e);break;case 1:Hs(e.type)&&Tb(e);break;case 4:dA(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;sn(Rb,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(sn(Cn,Cn.current&1),e.flags|=128,null):r&e.child.childLanes?AD(t,e,r):(sn(Cn,Cn.current&1),t=Eu(t,e,r),t!==null?t.sibling:null);sn(Cn,Cn.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return ED(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),sn(Cn,Cn.current),n)break;return null;case 22:case 23:return e.lanes=0,xD(t,e,r)}return Eu(t,e,r)}var SD,j7,ID,TD;SD=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}};j7=function(){};ID=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,dh(nl.current);var s=null;switch(r){case"input":i=c7(t,i),n=c7(t,n),s=[];break;case"select":i=In({},i,{value:void 0}),n=In({},n,{value:void 0}),s=[];break;case"textarea":i=d7(t,i),n=d7(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Sb)}h7(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"&&(lw.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"&&(lw.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&dn("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)}};TD=function(t,e,r,n){r!==n&&(e.flags|=4)};function nm(t,e){if(!wn)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 zi(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 dJ(t,e,r){var n=e.pendingProps;switch(iA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zi(e),null;case 1:return Hs(e.type)&&Ib(),zi(e),null;case 3:return n=e.stateNode,f1(),pn(Ws),pn(Xi),hA(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ty(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,tc!==null&&(G7(tc),tc=null))),j7(t,e),zi(e),null;case 5:fA(e);var i=dh(xw.current);if(r=e.type,t!==null&&e.stateNode!=null)ID(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(We(166));return zi(e),null}if(t=dh(nl.current),ty(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[el]=e,n[yw]=s,t=(e.mode&1)!==0,r){case"dialog":dn("cancel",n),dn("close",n);break;case"iframe":case"object":case"embed":dn("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[el]=e,t[yw]=n,SD(t,e,!1,!1),e.stateNode=t;e:{switch(o=p7(r,n),r){case"dialog":dn("cancel",t),dn("close",t),i=n;break;case"iframe":case"object":case"embed":dn("load",t),i=n;break;case"video":case"audio":for(i=0;ip1&&(e.flags|=128,n=!0,nm(s,!1),e.lanes=4194304)}else{if(!n)if(t=Ob(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),nm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wn)return zi(e),null}else 2*zn()-s.renderingStartTime>p1&&r!==1073741824&&(e.flags|=128,n=!0,nm(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=zn(),e.sibling=null,r=Cn.current,sn(Cn,n?r&1|2:r&1),e):(zi(e),null);case 22:case 23:return AA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?lo&1073741824&&(zi(e),e.subtreeFlags&6&&(e.flags|=8192)):zi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function fJ(t,e){switch(iA(e),e.tag){case 1:return Hs(e.type)&&Ib(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return f1(),pn(Ws),pn(Xi),hA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return fA(e),null;case 13:if(pn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));u1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return pn(Cn),null;case 4:return f1(),null;case 10:return cA(e.type._context),null;case 22:case 23:return AA(),null;case 24:return null;default:return null}}var iy=!1,Zi=!1,hJ=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mn(t,e,n)}else r.current=null}function F7(t,e,r){try{r()}catch(n){Mn(t,e,n)}}var Ak=!1;function pJ(t,e){if(A7=Cb,t=M$(),rA(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,d=0,h=t,g=null;t:for(;;){for(var v;h!==r||i!==0&&h.nodeType!==3||(a=o+i),h!==s||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(v=h.firstChild)!==null;)g=h,h=v;for(;;){if(h===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=h.nextSibling)!==null)break;h=g,g=h.parentNode}h=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(E7={focusedElem:t,selectionRange:r},Cb=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){e=Ct;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var R=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?R:Ka(e.type,R),M);N.__reactInternalSnapshotBeforeUpdate=E}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(We(163))}}catch(L){Mn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,Ct=t;break}Ct=e.return}return x=Ak,Ak=!1,x}function Wm(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&&F7(e,r,s)}i=i.next}while(i!==n)}}function w6(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 z7(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 kD(t){var e=t.alternate;e!==null&&(t.alternate=null,kD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[el],delete e[yw],delete e[T7],delete e[QY],delete e[YY])),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 PD(t){return t.tag===5||t.tag===3||t.tag===4}function Ek(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||PD(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 W7(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=Sb));else if(n!==4&&(t=t.child,t!==null))for(W7(t,e,r),t=t.sibling;t!==null;)W7(t,e,r),t=t.sibling}function H7(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(H7(t,e,r),t=t.sibling;t!==null;)H7(t,e,r),t=t.sibling}var Ci=null,Ja=!1;function ad(t,e,r){for(r=r.child;r!==null;)RD(t,e,r),r=r.sibling}function RD(t,e,r){if(rl&&typeof rl.onCommitFiberUnmount=="function")try{rl.onCommitFiberUnmount(l6,r)}catch{}switch(r.tag){case 5:Zi||Pp(r,e);case 6:var n=Ci,i=Ja;Ci=null,ad(t,e,r),Ci=n,Ja=i,Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ci.removeChild(r.stateNode));break;case 18:Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?wx(t.parentNode,r):t.nodeType===1&&wx(t,r),pw(t)):wx(Ci,r.stateNode));break;case 4:n=Ci,i=Ja,Ci=r.stateNode.containerInfo,Ja=!0,ad(t,e,r),Ci=n,Ja=i;break;case 0:case 11:case 14:case 15:if(!Zi&&(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)&&F7(r,e,o),i=i.next}while(i!==n)}ad(t,e,r);break;case 1:if(!Zi&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Mn(r,e,a)}ad(t,e,r);break;case 21:ad(t,e,r);break;case 22:r.mode&1?(Zi=(n=Zi)||r.memoizedState!==null,ad(t,e,r),Zi=n):ad(t,e,r);break;default:ad(t,e,r)}}function Sk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new hJ),e.forEach(function(n){var i=CJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function La(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=zn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*mJ(n/1960))-n,10t?16:t,Od===null)var n=!1;else{if(t=Od,Od=null,Ub=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,Ct=t.current;Ct!==null;){var s=Ct,o=s.child;if(Ct.flags&16){var a=s.deletions;if(a!==null){for(var c=0;czn()-_A?Ch(t,0):xA|=r),qs(t,e)}function UD(t,e){e===0&&(t.mode&1?(e=Z3,Z3<<=1,!(Z3&130023424)&&(Z3=4194304)):e=1);var r=hs();t=Au(t,e),t!==null&&(Gv(t,e,r),qs(t,r))}function _J(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),UD(t,r)}function CJ(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(We(314))}n!==null&&n.delete(e),UD(t,r)}var jD;jD=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ws.current)Fs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Fs=!1,uJ(t,e,r);Fs=!!(t.flags&131072)}else Fs=!1,wn&&e.flags&1048576&&H$(e,Pb,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Ky(t,e),t=e.pendingProps;var i=l1(e,Xi.current);Fp(e,r),i=gA(null,e,n,t,i,r);var s=mA();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,Hs(n)?(s=!0,Tb(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,uA(e),i.updater=m6,e.stateNode=i,i._reactInternals=e,O7(e,n,t,r),e=L7(null,e,n,!0,s,r)):(e.tag=0,wn&&s&&nA(e),ls(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Ky(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=EJ(n),t=Ka(n,t),i){case 0:e=D7(null,e,n,t,r);break e;case 1:e=xk(null,e,n,t,r);break e;case 11:e=yk(null,e,n,t,r);break e;case 14:e=bk(null,e,n,Ka(n.type,t),r);break e}throw Error(We(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),D7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),xk(t,e,n,i,r);case 3:e:{if(CD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Q$(t,e),Mb(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=h1(Error(We(423)),e),e=_k(t,e,n,r,i);break e}else if(n!==i){i=h1(Error(We(424)),e),e=_k(t,e,n,r,i);break e}else for(ho=Fd(e.stateNode.containerInfo.firstChild),mo=e,wn=!0,tc=null,r=G$(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(u1(),n===i){e=Eu(t,e,r);break e}ls(t,e,n,r)}e=e.child}return e;case 5:return Y$(e),t===null&&R7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,S7(n,i)?o=null:s!==null&&S7(n,s)&&(e.flags|=32),_D(t,e),ls(t,e,o,r),e.child;case 6:return t===null&&R7(e),null;case 13:return AD(t,e,r);case 4:return dA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=d1(e,null,n,r):ls(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),yk(t,e,n,i,r);case 7:return ls(t,e,e.pendingProps,r),e.child;case 8:return ls(t,e,e.pendingProps.children,r),e.child;case 12:return ls(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,sn(Rb,n._currentValue),n._currentValue=o,s!==null)if(dc(s.value,o)){if(s.children===i.children&&!Ws.current){e=Eu(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=vu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),N7(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(We(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),N7(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}ls(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Fp(e,r),i=ha(i),n=n(i),e.flags|=1,ls(t,e,n,r),e.child;case 14:return n=e.type,i=Ka(n,e.pendingProps),i=Ka(n.type,i),bk(t,e,n,i,r);case 15:return bD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),Ky(t,e),e.tag=1,Hs(n)?(t=!0,Tb(e)):t=!1,Fp(e,r),wD(e,n,i),O7(e,n,i,r),L7(null,e,n,!0,t,r);case 19:return ED(t,e,r);case 22:return xD(t,e,r)}throw Error(We(156,e.tag))};function FD(t,e){return p$(t,e)}function AJ(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 da(t,e,r,n){return new AJ(t,e,r,n)}function SA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function EJ(t){if(typeof t=="function")return SA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===qC)return 11;if(t===VC)return 14}return 2}function qd(t,e){var r=t.alternate;return r===null?(r=da(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 Qy(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")SA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case xp:return Ah(r.children,i,s,e);case HC:o=8,i|=8;break;case i7:return t=da(12,r,e,i|2),t.elementType=i7,t.lanes=s,t;case s7:return t=da(13,r,e,i),t.elementType=s7,t.lanes=s,t;case o7:return t=da(19,r,e,i),t.elementType=o7,t.lanes=s,t;case YO:return y6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZO:o=10;break e;case QO:o=9;break e;case qC:o=11;break e;case VC:o=14;break e;case pd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=da(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Ah(t,e,r,n){return t=da(7,t,n,e),t.lanes=r,t}function y6(t,e,r,n){return t=da(22,t,n,e),t.elementType=YO,t.lanes=r,t.stateNode={isHidden:!1},t}function Ex(t,e,r){return t=da(6,t,null,e),t.lanes=r,t}function Sx(t,e,r){return e=da(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function SJ(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=ox(0),this.expirationTimes=ox(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ox(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IA(t,e,r,n,i,s,o,a,c){return t=new SJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=da(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},uA(s),t}function IJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qD)}catch(t){console.error(t)}}qD(),qO.exports=So;var RA=qO.exports;const OCe=_c(RA);var VD,Ok=RA;VD=Ok.createRoot,Ok.hydrateRoot;const NJ="modulepreload",MJ=function(t){return"/"+t},$k={},Zn=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=MJ(c),c in $k)return;$k[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":NJ,l||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),l)return new Promise((g,v)=>{h.addEventListener("load",g),h.addEventListener("error",()=>v(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)})},OJ=Symbol(),Dk=Object.getPrototypeOf,Z7=new WeakMap,$J=t=>t&&(Z7.has(t)?Z7.get(t):Dk(t)===Object.prototype||Dk(t)===Array.prototype),DJ=t=>$J(t)&&t[OJ]||null,Lk=(t,e=!0)=>{Z7.set(t,e)},zb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://ucan.dacade.my/ucan"},Ix=t=>typeof t=="object"&&t!==null,md=new WeakMap,Pm=new WeakSet,LJ=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>Ix(l)&&!Pm.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,d,h=n)=>{const g=i.get(l);if((g==null?void 0:g[0])===d)return g[1];const v=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Lk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const R=Reflect.get(l,x),M={value:R,enumerable:!0,configurable:!0};if(Pm.has(R))Lk(R,!1);else if(R instanceof Promise)delete M.value,M.get=()=>h(R);else if(md.has(R)){const[N,E]=md.get(R);M.value=s(N,E(),h)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!Ix(l))throw new Error("object required");const d=o.get(l);if(d)return d;let h=a[0];const g=new Set,v=(F,K=++a[0])=>{h!==K&&(h=K,g.forEach(B=>B(F,K)))};let x=a[1];const R=(F=++a[1])=>(x!==F&&!g.size&&(x=F,N.forEach(([K])=>{const B=K[1](F);B>h&&(h=B)})),h),M=F=>(K,B)=>{const _=[...K];_[1]=[F,..._[1]],v(_,B)},N=new Map,E=(F,K)=>{if((zb?"production":void 0)!=="production"&&N.has(F))throw new Error("prop listener already exists");if(g.size){const B=K[3](M(F));N.set(F,[K,B])}else N.set(F,[K])},O=F=>{var K;const B=N.get(F);B&&(N.delete(F),(K=B[1])==null||K.call(B))},L=F=>(g.add(F),g.size===1&&N.forEach(([B,_],p)=>{if((zb?"production":void 0)!=="production"&&_)throw new Error("remove already exists");const m=B[3](M(p));N.set(p,[B,m])}),()=>{g.delete(F),g.size===0&&N.forEach(([B,_],p)=>{_&&(_(),N.set(p,[B]))})}),U=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(U,{deleteProperty(F,K){const B=Reflect.get(F,K);O(K);const _=Reflect.deleteProperty(F,K);return _&&v(["delete",[K],B]),_},set(F,K,B,_){const p=Reflect.has(F,K),m=Reflect.get(F,K,_);if(p&&(t(m,B)||o.has(B)&&t(m,o.get(B))))return!0;O(K),Ix(B)&&(B=DJ(B)||B);let w=B;if(B instanceof Promise)B.then(A=>{B.status="fulfilled",B.value=A,v(["resolve",[K],A])}).catch(A=>{B.status="rejected",B.reason=A,v(["reject",[K],A])});else{!md.has(B)&&r(B)&&(w=c(B));const A=!Pm.has(w)&&md.get(w);A&&E(K,A)}return Reflect.set(F,K,w,_),v(["set",[K],B,m]),!0}});o.set(l,I);const T=[U,R,s,L];return md.set(I,T),Reflect.ownKeys(l).forEach(F=>{const K=Object.getOwnPropertyDescriptor(l,F);"value"in K&&(I[F]=l[F],delete K.value,delete K.writable),Object.defineProperty(U,F,K)}),I})=>[c,md,Pm,t,e,r,n,i,s,o,a],[BJ]=LJ();function Tn(t={}){return BJ(t)}function gs(t,e,r){const n=md.get(t);(zb?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(d=>{s.push(d),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function Q7(t,e){const r=md.get(t);(zb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function rc(t){return Pm.add(t),t}function Cs(t,e,r,n){let i=t[e];return gs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function UJ(t){const e=Tn({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var KD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",h="month",g="quarter",v="year",x="date",R="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var w=["th","st","nd","rd"],A=m%100;return"["+m+(w[(A-20)%10]||w[A]||w[0])+"]"}},O=function(m,w,A){var P=String(m);return!P||P.length>=w?m:""+Array(w+1-P.length).join(A)+m},L={s:O,z:function(m){var w=-m.utcOffset(),A=Math.abs(w),P=Math.floor(A/60),S=A%60;return(w<=0?"+":"-")+O(P,2,"0")+":"+O(S,2,"0")},m:function m(w,A){if(w.date()1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!P&&S&&(U=S),S||!P&&U},K=function(m,w){if(T(m))return m.clone();var A=typeof w=="object"?w:{};return A.date=m,A.args=arguments,new _(A)},B=L;B.l=F,B.i=T,B.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var _=function(){function m(A){this.$L=F(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(A){this.$d=function(P){var S=P.date,k=P.utc;if(S===null)return new Date(NaN);if(B.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var y=S.match(M);if(y){var b=y[2]-1||0,V=(y[7]||"0").substring(0,3);return k?new Date(Date.UTC(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)):new Date(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)}}return new Date(S)}(A),this.init()},w.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},w.$utils=function(){return B},w.isValid=function(){return this.$d.toString()!==R},w.isSame=function(A,P){var S=K(A);return this.startOf(P)<=S&&S<=this.endOf(P)},w.isAfter=function(A,P){return K(A)0,H<=U.r||!U.r){H<=1&&L>0&&(U=E[L-1]);var I=N[U.l];v&&(H=v(""+H)),R=typeof I=="string"?I.replace("%d",H):I(H,d,U.l,M);break}}if(d)return R;var T=M?N.future:N.past;return typeof T=="function"?T(R):T.replace("%s",R)},s.to=function(l,d){return a(l,d,this,!0)},s.from=function(l,d){return a(l,d,this)};var c=function(l){return l.$u?i.utc():i()};s.toNow=function(l){return this.to(c(this),l)},s.fromNow=function(l){return this.from(c(this),l)}}})})(ZD);var WJ=ZD.exports;const HJ=_c(WJ);var QD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,function(){return function(r,n,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})})(QD);var qJ=QD.exports;const VJ=_c(qJ);Wp.extend(HJ);Wp.extend(VJ);const KJ={...zJ,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};Wp.locale("en-web3-modal",KJ);const NA={getYear(t=new Date().toISOString()){return Wp(t).year()},getRelativeDateFromNow(t){return Wp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return Wp(t).format(e)}},Ga={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var GJ=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Tx=Math.ceil,Xo=Math.floor,Os="[BigNumber Error] ",Bk=Os+"Number primitive has more than 15 significant digits: ",Ba=1e14,sr=14,kx=9007199254740991,Px=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],cd=1e7,ci=1e9;function YD(t){var e,r,n,i=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),o=20,a=4,c=-7,l=21,d=-1e7,h=1e7,g=!1,v=1,x=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,F){var K,B,_,p,m,w,A,P,S=this;if(!(S instanceof E))return new E(T,F);if(F==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>h?S.c=S.e=null:T.e=10;m/=10,p++);p>h?S.c=S.e=null:(S.e=p,S.c=[T]);return}P=String(T)}else{if(!GJ.test(P=String(T)))return n(S,P,w);S.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(p=P.indexOf("."))>-1&&(P=P.replace(".","")),(m=P.search(/e/i))>0?(p<0&&(p=m),p+=+P.slice(m+1),P=P.substring(0,m)):p<0&&(p=P.length)}else{if(xn(F,2,M.length,"Base"),F==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(P=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,P,w,F);if(S.s=1/T<0?(P=P.slice(1),-1):1,E.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Bk+T)}else S.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(K=M.slice(0,F),p=m=0,A=P.length;mp){p=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,m=-1,p=0;continue}return n(S,String(T),w,F)}w=!1,P=r(P,F,10,S.s),(p=P.indexOf("."))>-1?P=P.replace(".",""):p=P.length}for(m=0;P.charCodeAt(m)===48;m++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(m,++A)){if(A-=m,w&&E.DEBUG&&A>15&&(T>kx||T!==Xo(T)))throw Error(Bk+S.s*T);if((p=p-m-1)>h)S.c=S.e=null;else if(p=-ci&&_<=ci&&_===Xo(_)){if(B[0]===0){if(_===0&&B.length===1)return!0;break e}if(F=(_+1)%sr,F<1&&(F+=sr),String(B[0]).length==F){for(F=0;F=Ba||K!==Xo(K))break e;if(K!==0)return!0}}}else if(B===null&&_===null&&(p===null||p===1||p===-1))return!0;throw Error(Os+"Invalid BigNumber: "+T)},E.maximum=E.max=function(){return L(arguments,-1)},E.minimum=E.min=function(){return L(arguments,1)},E.random=function(){var T=9007199254740992,F=Math.random()*T&2097151?function(){return Xo(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var B,_,p,m,w,A=0,P=[],S=new E(s);if(K==null?K=o:xn(K,0,ci),m=Tx(K/sr),g)if(crypto.getRandomValues){for(B=crypto.getRandomValues(new Uint32Array(m*=2));A>>11),w>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),B[A]=_[0],B[A+1]=_[1]):(P.push(w%1e14),A+=2);A=m/2}else if(crypto.randomBytes){for(B=crypto.randomBytes(m*=7);A=9e15?crypto.randomBytes(7).copy(B,A):(P.push(w%1e14),A+=7);A=m/7}else throw g=!1,Error(Os+"crypto unavailable");if(!g)for(;A=10;w/=10,A++);A_-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/_|0,w[m]%=_)}return w.reverse()}return function(K,B,_,p,m){var w,A,P,S,k,y,b,V,ce=K.indexOf("."),de=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(B),y=V.pow(K.length-ce),x=S,V.c=F(Zl(qo(y.c),y.e,"0"),10,_,T),V.e=V.c.length),b=F(K,B,_,m?(w=M,T):(w=T,M)),P=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--P:(y.c=b,y.e=P,y.s=p,y=e(y,V,de,W,_),b=y.c,k=y.r,P=y.e),A=P+de+1,ce=b[A],S=_/2,k=k||A<0||b[A+1]!=null,k=W<4?(ce!=null||k)&&(W==0||W==(y.s<0?3:2)):ce>S||ce==S&&(W==4||k||W==6&&b[A-1]&1||W==(y.s<0?8:7)),A<1||!b[0])K=k?Zl(w.charAt(1),-de,w.charAt(0)):w.charAt(0);else{if(b.length=A,k)for(--_;++b[--A]>_;)b[A]=0,A||(++P,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Zl(K,P,w.charAt(0))}return K}}(),e=function(){function T(B,_,p){var m,w,A,P,S=0,k=B.length,y=_%cd,b=_/cd|0;for(B=B.slice();k--;)A=B[k]%cd,P=B[k]/cd|0,m=b*A+P*y,w=y*A+m%cd*cd+S,S=(w/p|0)+(m/cd|0)+b*P,B[k]=w%p;return S&&(B=[S].concat(B)),B}function F(B,_,p,m){var w,A;if(p!=m)A=p>m?1:-1;else for(w=A=0;w_[w]?1:-1;break}return A}function K(B,_,p,m){for(var w=0;p--;)B[p]-=w,w=B[p]<_[p]?1:0,B[p]=w*m+B[p]-_[p];for(;!B[0]&&B.length>1;B.splice(0,1));}return function(B,_,p,m,w){var A,P,S,k,y,b,V,ce,de,W,le,Y,re,ne,D,ee,ge,xe=B.s==_.s?1:-1,Ae=B.c,ke=_.c;if(!Ae||!Ae[0]||!ke||!ke[0])return new E(!B.s||!_.s||(Ae?ke&&Ae[0]==ke[0]:!ke)?NaN:Ae&&Ae[0]==0||!ke?xe*0:xe/0);for(ce=new E(xe),de=ce.c=[],P=B.e-_.e,xe=p+P+1,w||(w=Ba,P=ea(B.e/sr)-ea(_.e/sr),xe=xe/sr|0),S=0;ke[S]==(Ae[S]||0);S++);if(ke[S]>(Ae[S]||0)&&P--,xe<0)de.push(1),k=!0;else{for(ne=Ae.length,ee=ke.length,S=0,xe+=2,y=Xo(w/(ke[0]+1)),y>1&&(ke=T(ke,y,w),Ae=T(Ae,y,w),ee=ke.length,ne=Ae.length),re=ee,W=Ae.slice(0,ee),le=W.length;le=w/2&&D++;do{if(y=0,A=F(ke,W,ee,le),A<0){if(Y=W[0],ee!=le&&(Y=Y*w+(W[1]||0)),y=Xo(Y/D),y>1)for(y>=w&&(y=w-1),b=T(ke,y,w),V=b.length,le=W.length;F(b,W,V,le)==1;)y--,K(b,ee=10;xe/=10,S++);H(ce,p+(ce.e=S+P*sr-1)+1,m,k)}else ce.e=P,ce.r=+k;return ce}}();function O(T,F,K,B){var _,p,m,w,A;if(K==null?K=a:xn(K,0,8),!T.c)return T.toString();if(_=T.c[0],m=T.e,F==null)A=qo(T.c),A=B==1||B==2&&(m<=c||m>=l)?cy(A,m):Zl(A,m,"0");else if(T=H(new E(T),F,K),p=T.e,A=qo(T.c),w=A.length,B==1||B==2&&(F<=p||p<=c)){for(;ww){if(--F>0)for(A+=".";F--;A+="0");}else if(F+=p-w,F>0)for(p+1==w&&(A+=".");F--;A+="0");return T.s<0&&_?"-"+A:A}function L(T,F){for(var K,B,_=1,p=new E(T[0]);_=10;_/=10,B++);return(K=B+K*sr-1)>h?T.c=T.e=null:K=10;w/=10,_++);if(p=F-_,p<0)p+=sr,m=F,A=k[P=0],S=Xo(A/y[_-m-1]%10);else if(P=Tx((p+1)/sr),P>=k.length)if(B){for(;k.length<=P;k.push(0));A=S=0,_=1,p%=sr,m=p-sr+1}else break e;else{for(A=w=k[P],_=1;w>=10;w/=10,_++);p%=sr,m=p-sr+_,S=m<0?0:Xo(A/y[_-m-1]%10)}if(B=B||F<0||k[P+1]!=null||(m<0?A:A%y[_-m-1]),B=K<4?(S||B)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||B||K==6&&(p>0?m>0?A/y[_-m]:0:k[P-1])%10&1||K==(T.s<0?8:7)),F<1||!k[0])return k.length=0,B?(F-=T.e+1,k[0]=y[(sr-F%sr)%sr],T.e=-F||0):k[0]=T.e=0,T;if(p==0?(k.length=P,w=1,P--):(k.length=P+1,w=y[sr-p],k[P]=m>0?Xo(A/y[_-m]%y[m])*w:0),B)for(;;)if(P==0){for(p=1,m=k[0];m>=10;m/=10,p++);for(m=k[0]+=w,w=1;m>=10;m/=10,w++);p!=w&&(T.e++,k[0]==Ba&&(k[0]=1));break}else{if(k[P]+=w,k[P]!=Ba)break;k[P--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>h?T.c=T.e=null:T.e=l?cy(F,K):Zl(F,K,"0"),T.s<0?"-"+F:F)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,F){return Yf(this,new E(T,F))},i.decimalPlaces=i.dp=function(T,F){var K,B,_,p=this;if(T!=null)return xn(T,0,ci),F==null?F=a:xn(F,0,8),H(new E(p),T+p.e+1,F);if(!(K=p.c))return null;if(B=((_=K.length-1)-ea(this.e/sr))*sr,_=K[_])for(;_%10==0;_/=10,B--);return B<0&&(B=0),B},i.dividedBy=i.div=function(T,F){return e(this,new E(T,F),o,a)},i.dividedToIntegerBy=i.idiv=function(T,F){return e(this,new E(T,F),0,1)},i.exponentiatedBy=i.pow=function(T,F){var K,B,_,p,m,w,A,P,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Os+"Exponent not an integer: "+I(T));if(F!=null&&(F=new E(F)),w=T.e>14,!k.c||!k.c[0]||k.c[0]==1&&!k.e&&k.c.length==1||!T.c||!T.c[0])return S=new E(Math.pow(+I(k),w?T.s*(2-ay(T)):+I(T))),F?S.mod(F):S;if(A=T.s<0,F){if(F.c?!F.c[0]:!F.s)return new E(NaN);B=!A&&k.isInteger()&&F.isInteger(),B&&(k=k.mod(F))}else{if(T.e>9&&(k.e>0||k.e<-1||(k.e==0?k.c[0]>1||w&&k.c[1]>=24e7:k.c[0]<8e13||w&&k.c[0]<=9999975e7)))return p=k.s<0&&ay(T)?-0:0,k.e>-1&&(p=1/p),new E(A?1/p:p);x&&(p=Tx(x/sr+2))}for(w?(K=new E(.5),A&&(T.s=1),P=ay(T)):(_=Math.abs(+I(T)),P=_%2),S=new E(s);;){if(P){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):B&&(S=S.mod(F))}if(_){if(_=Xo(_/2),_===0)break;P=_%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)P=ay(T);else{if(_=+I(T),_===0)break;P=_%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):B&&(k=k.mod(F))}return B?S:(A&&(S=s.div(S)),F?S.mod(F):p?H(S,x,a,m):S)},i.integerValue=function(T){var F=new E(this);return T==null?T=a:xn(T,0,8),H(F,F.e+1,T)},i.isEqualTo=i.eq=function(T,F){return Yf(this,new E(T,F))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,F){return Yf(this,new E(T,F))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,F){return(F=Yf(this,new E(T,F)))===1||F===0},i.isInteger=function(){return!!this.c&&ea(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,F){return Yf(this,new E(T,F))<0},i.isLessThanOrEqualTo=i.lte=function(T,F){return(F=Yf(this,new E(T,F)))===-1||F===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(T,F){var K,B,_,p,m=this,w=m.s;if(T=new E(T,F),F=T.s,!w||!F)return new E(NaN);if(w!=F)return T.s=-F,m.plus(T);var A=m.e/sr,P=T.e/sr,S=m.c,k=T.c;if(!A||!P){if(!S||!k)return S?(T.s=-F,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-F,T):new E(S[0]?m:a==3?-0:0)}if(A=ea(A),P=ea(P),S=S.slice(),w=A-P){for((p=w<0)?(w=-w,_=S):(P=A,_=k),_.reverse(),F=w;F--;_.push(0));_.reverse()}else for(B=(p=(w=S.length)<(F=k.length))?w:F,w=F=0;F0)for(;F--;S[K++]=0);for(F=Ba-1;B>w;){if(S[--B]=0;){for(K=0,y=Y[_]%de,b=Y[_]/de|0,m=A,p=_+m;p>_;)P=le[--m]%de,S=le[m]/de|0,w=b*P+S*y,P=y*P+w%de*de+V[p]+K,K=(P/ce|0)+(w/de|0)+b*S,V[p--]=P%ce;V[p]=K}return K?++B:V.splice(0,1),U(T,V,B)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,F){var K,B=this,_=B.s;if(T=new E(T,F),F=T.s,!_||!F)return new E(NaN);if(_!=F)return T.s=-F,B.minus(T);var p=B.e/sr,m=T.e/sr,w=B.c,A=T.c;if(!p||!m){if(!w||!A)return new E(_/0);if(!w[0]||!A[0])return A[0]?T:new E(w[0]?B:_*0)}if(p=ea(p),m=ea(m),w=w.slice(),_=p-m){for(_>0?(m=p,K=A):(_=-_,K=w),K.reverse();_--;K.push(0));K.reverse()}for(_=w.length,F=A.length,_-F<0&&(K=A,A=w,w=K,F=_),_=0;F;)_=(w[--F]=w[F]+A[F]+_)/Ba|0,w[F]=Ba===w[F]?0:w[F]%Ba;return _&&(w=[_].concat(w),++m),U(T,w,m)},i.precision=i.sd=function(T,F){var K,B,_,p=this;if(T!=null&&T!==!!T)return xn(T,1,ci),F==null?F=a:xn(F,0,8),H(new E(p),T,F);if(!(K=p.c))return null;if(_=K.length-1,B=_*sr+1,_=K[_]){for(;_%10==0;_/=10,B--);for(_=K[0];_>=10;_/=10,B++);}return T&&p.e+1>B&&(B=p.e+1),B},i.shiftedBy=function(T){return xn(T,-kx,kx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,F,K,B,_,p=this,m=p.c,w=p.s,A=p.e,P=o+4,S=new E("0.5");if(w!==1||!m||!m[0])return new E(!w||w<0&&(!m||m[0])?NaN:m?p:1/0);if(w=Math.sqrt(+I(p)),w==0||w==1/0?(F=qo(m),(F.length+A)%2==0&&(F+="0"),w=Math.sqrt(+F),A=ea((A+1)/2)-(A<0||A%2),w==1/0?F="5e"+A:(F=w.toExponential(),F=F.slice(0,F.indexOf("e")+1)+A),K=new E(F)):K=new E(w+""),K.c[0]){for(A=K.e,w=A+P,w<3&&(w=0);;)if(_=K,K=S.times(_.plus(e(p,_,P,1))),qo(_.c).slice(0,w)===(F=qo(K.c)).slice(0,w))if(K.e0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=P+b.slice(p)),y&&(S="-"+S)}B=k?S+(K.decimalSeparator||"")+((A=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+B+(K.suffix||"")},i.toFraction=function(T){var F,K,B,_,p,m,w,A,P,S,k,y,b=this,V=b.c;if(T!=null&&(w=new E(T),!w.isInteger()&&(w.c||w.s!==1)||w.lt(s)))throw Error(Os+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(F=new E(s),P=K=new E(s),B=A=new E(s),y=qo(V),p=F.e=y.length-b.e-1,F.c[0]=Px[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(F)>0?p>0?F:P:w,m=h,h=1/0,w=new E(y),A.c[0]=0;S=e(w,F,0,1),_=K.plus(S.times(B)),_.comparedTo(T)!=1;)K=B,B=_,P=A.plus(S.times(_=P)),A=_,F=w.minus(S.times(_=F)),w=_;return _=e(T.minus(K),B,0,1),A=A.plus(_.times(P)),K=K.plus(_.times(B)),A.s=P.s=b.s,p=p*2,k=e(P,B,p,a).minus(b).abs().comparedTo(e(A,K,p,a).minus(b).abs())<1?[P,B]:[A,K],h=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,F){return T!=null&&xn(T,1,ci),O(this,T,F,2)},i.toString=function(T){var F,K=this,B=K.s,_=K.e;return _===null?B?(F="Infinity",B<0&&(F="-"+F)):F="NaN":(T==null?F=_<=c||_>=l?cy(qo(K.c),_):Zl(qo(K.c),_,"0"):T===10&&N?(K=H(new E(K),o+_+1,a),F=Zl(qo(K.c),K.e,"0")):(xn(T,2,M.length,"Base"),F=r(Zl(qo(K.c),_,"0"),10,T,B,!0)),B<0&&K.c[0]&&(F="-"+F)),F},i.valueOf=i.toJSON=function(){return I(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&E.set(t),E}function ea(t){var e=t|0;return t>0||t===e?e:e-1}function qo(t){for(var e,r,n=1,i=t.length,s=t[0]+"";nl^r?1:-1;for(a=(c=i.length)<(l=s.length)?c:l,o=0;os[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function xn(t,e,r,n){if(tr||t!==Xo(t))throw Error(Os+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function ay(t){var e=t.c.length-1;return ea(t.e/sr)==e&&t.c[e]%2!=0}function cy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Zl(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(n=t.length,++e>n){for(i=r,e-=n;--e;i+=r);t+=i}else e="0"&&s<="9";!i&&(a||c||l||d)&&t.preventDefault(),e==="0"&&!h&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(h||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!h&&t.preventDefault()}},QJ=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],MA={URLS:{FAQ:"https://walletconnect.com/faq"}},yn={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"}},rn={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},nn={setItem(t,e){uy()&&localStorage.setItem(t,e)},getItem(t){if(uy())return localStorage.getItem(t)||void 0},removeItem(t){uy()&&localStorage.removeItem(t)},clear(){uy()&&localStorage.clear()}};function uy(){return typeof window<"u"&&typeof localStorage<"u"}function pu(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function YJ(t){return(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX))}const JJ="rpc.walletconnect.org",Sw={extendRpcUrlWithProjectId(t,e){if(t.includes(JJ)){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},extendCaipNetwork(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return{...t,imageId:e[t.chainId],imageUrl:r==null?void 0:r[t.chainId],rpcUrl:Sw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Sw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Rx="https://secure.walletconnect.org",JD=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],XJ="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Sn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Rx,SECURE_SITE_DASHBOARD:`${Rx}/dashboard`,SECURE_SITE_FAVICON:`${Rx}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0}},Be={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return Be.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Be.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Sn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Sn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Sn.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(Be.isHttpUrl(t))return this.formatUniversalUrl(t,e);let r=t;r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},formatUniversalUrl(t,e){if(!Be.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},openHref(t,e,r){window.open(t,e,r||"noreferrer noopener")},returnOpenHref(t,e,r){return window.open(t,e,r||"noreferrer noopener")},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Be.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return yn.W3M_API_URL},getBlockchainApiUrl(){return yn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return yn.PULSE_API_URL},getUUID(){return 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)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?"universal":t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`}};async function sm(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class A6{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await sm(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await sm(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await sm(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await sm(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await sm(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const un=Tn({features:Sn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:un,subscribeKey(t,e){return Cs(un,t,e)},setOptions(t){Object.assign(un,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{un.features||(un.features=Sn.DEFAULT_FEATURES),e in un.features&&(un.features[e]=r)})},setProjectId(t){un.projectId=t},setAllWallets(t){un.allWallets=t},setIncludeWalletIds(t){un.includeWalletIds=t},setExcludeWalletIds(t){un.excludeWalletIds=t},setFeaturedWalletIds(t){un.featuredWalletIds=t},setTokens(t){un.tokens=t},setTermsConditionsUrl(t){un.termsConditionsUrl=t},setPrivacyPolicyUrl(t){un.privacyPolicyUrl=t},setCustomWallets(t){un.customWallets=t},setIsSiweEnabled(t){un.isSiweEnabled=t},setIsUniversalProvider(t){un.isUniversalProvider=t},setSdkVersion(t){un.sdkVersion=t},setMetadata(t){un.metadata=t},setDisableAppend(t){un.disableAppend=t},setEIP6963Enabled(t){un.enableEIP6963=t},setEnableWalletConnect(t){un.enableWalletConnect=t},setEnableWallets(t){un.enableWallets=t},setHasMultipleAddresses(t){un.hasMultipleAddresses=t}},eX=Be.getAnalyticsUrl(),tX=new A6({baseUrl:eX,clientId:null}),rX=["MODAL_CREATED"],sp=Tn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:sp,subscribe(t){return gs(sp,()=>t(sp))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{if(rX.includes(t.data.event)||typeof window>"u")return;await tX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Be.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;sp.timestamp=Date.now(),sp.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(sp)}},Uk=Tn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Uk,replaceState(t){t&&Object.assign(Uk,rc(t))},subscribeKey(t,e){let r;return pe.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return pe.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;pe.setActiveCaipNetwork(t),this.checkIfSupportedNetwork()||this.showUnsupportedChainUI()},setCaipNetwork(t){if(t){if(!(t!=null&&t.chainNamespace))throw new Error("chain is required to set active network");pe.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){pe.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){pe.setChainNetworkData(e||pe.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){pe.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!pe.state.activeChain)throw new Error("activeChain is required to get requested networks");if(t){const s=t;if(!s)throw new Error("chain is required to get requested networks");e=[s]}else e=[...pe.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,h,g,v;(a=(o=pe.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=pe.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(h=(d=pe.state.chains.get(s))==null?void 0:d.networkState)!=null&&h.requestedCaipNetworks&&n.push(...((v=(g=pe.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Be.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=pe.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),pe.setActiveCaipNetwork(t),t&&ot.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},getApprovedCaipNetworkIds(t){var r,n;if(t){const i=t;if(!i)throw new Error("chain is required to get approved network IDs");return(n=(r=pe.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(pe.state.chains).forEach(i=>{var s;i.networkState.approvedCaipNetworkIds&&e.push(...((s=i.networkState)==null?void 0:s.approvedCaipNetworkIds)||[])}),e},async setApprovedCaipNetworksData(t){const e=pe.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");pe.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=pe.state.activeChain;if(!t)return!1;const e=pe.state.activeCaipNetwork,r=this.getRequestedCaipNetworks(t);return r.length?r==null?void 0:r.some(n=>n.id===(e==null?void 0:e.id)):!0},checkIfSmartAccountEnabled(){var n;const t=Ga.caipNetworkIdToNumber((n=pe.state.activeCaipNetwork)==null?void 0:n.id);if(!pe.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=pe.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=pe.state.activeChain;if(!t)throw new Error("chain is required to reset network");pe.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=pe.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=pe.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.supportsAllNetworks},showUnsupportedChainUI(){setTimeout(()=>{jt.open({view:"UnsupportedChain"})},300)},getActiveNetworkTokenAddress(){var e,r;const t=Sn.NATIVE_TOKEN_ADDRESS[((e=pe.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=pe.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},nX={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},XD=Be.getBlockchainApiUrl(),Kn=Tn({clientId:null,api:new A6({baseUrl:XD,clientId:null})}),vn={state:Kn,fetchIdentity({address:t}){return Kn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:pe.state.activeCaipAddress?Be.getPlainAddress(pe.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Kn.api.get({path:`/v1/account/${t}/history`,params:{projectId:e,cursor:r,onramp:n,chainId:o},signal:i,cache:s})},fetchSwapQuote({projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}){return Kn.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}})},fetchSwapTokens({projectId:t,chainId:e}){return Kn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Kn.api.post({path:"/v1/fungible/price",body:{projectId:t,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:t,tokenAddress:e,userAddress:r}){const{sdkType:n,sdkVersion:i}=qe.state;return Kn.api.get({path:"/v1/convert/allowance",params:{projectId:t,tokenAddress:e,userAddress:r},headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:t,chainId:e}){const{sdkType:r,sdkVersion:n}=qe.state;return Kn.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{projectId:t,chainId:e}})},generateSwapCalldata({amount:t,from:e,projectId:r,to:n,userAddress:i}){return Kn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Sn.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:r,to:n,userAddress:i}})},generateApproveCalldata({from:t,projectId:e,to:r,userAddress:n}){const{sdkType:i,sdkVersion:s}=qe.state;return Kn.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":s||"html-wagmi-4.2.2"},params:{projectId:e,userAddress:n,from:t,to:r}})},async getBalance(t,e,r){const{sdkType:n,sdkVersion:i}=qe.state;return Kn.api.get({path:`/v1/account/${t}/balance`,headers:{"x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:qe.state.projectId,chainId:e,forceUpdate:r}})},async lookupEnsName(t){return Kn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Kn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Ee.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Kn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Kn.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){return(await Kn.api.post({path:"/v1/generators/onrampurl",params:{projectId:qe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await Kn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return nX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Kn.api.post({path:"/v1/onramp/quote",params:{projectId:qe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}})}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},setClientId(t){Kn.clientId=t,Kn.api=new A6({baseUrl:XD,clientId:t})}},Vo=Tn({message:"",variant:"success",open:!1}),St={state:Vo,subscribeKey(t,e){return Cs(Vo,t,e)},showLoading(t){Vo.message=t,Vo.variant="loading",Vo.open=!0},showSuccess(t){Vo.message=t,Vo.variant="success",Vo.open=!0},showError(t){const e=Be.parseError(t);Vo.message=e,Vo.variant="error",Vo.open=!0},hide(){Vo.open=!1}};var eL={},E6={};E6.byteLength=oX;E6.toByteArray=cX;E6.fromByteArray=dX;var tl=[],na=[],iX=typeof Uint8Array<"u"?Uint8Array:Array,Nx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var op=0,sX=Nx.length;op0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function oX(t){var e=tL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function aX(t,e,r){return(e+r)*3/4-r}function cX(t){var e,r=tL(t),n=r[0],i=r[1],s=new iX(aX(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=na[t.charCodeAt(c)]<<2|na[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=na[t.charCodeAt(c)]<<10|na[t.charCodeAt(c+1)]<<4|na[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function lX(t){return tl[t>>18&63]+tl[t>>12&63]+tl[t>>6&63]+tl[t&63]}function uX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(tl[e>>2]+tl[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(tl[e>>10]+tl[e>>4&63]+tl[e<<2&63]+"=")),i.join("")}var OA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */OA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,h=r?i-1:0,g=r?-1:1,v=t[e+h];for(h+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+h],h+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=g,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(v?-1:1)*o*Math.pow(2,s-n)};OA.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,d=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,x=n?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=g/c:e+=g*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+v]=a&255,v+=x,a/=256,i-=8);for(o=o<0;t[r+v]=o&255,v+=x,o/=256,l-=8);t[r+v-x]|=R*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(t){const e=N6,r=qA,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=E,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const G=new Uint8Array(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,Uint8Array.prototype),Object.setPrototypeOf(G,O),G.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(G){if(G>i)throw new RangeError('The value "'+G+'" is invalid for option "size"');const O=new Uint8Array(G);return Object.setPrototypeOf(O,a.prototype),O}function a(G,O,z){if(typeof G=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(G)}return c(G,O,z)}a.poolSize=8192;function c(G,O,z){if(typeof G=="string")return g(G,O);if(ArrayBuffer.isView(G))return x(G);if(G==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof G);if(Be(G,ArrayBuffer)||G&&Be(G.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(G,SharedArrayBuffer)||G&&Be(G.buffer,SharedArrayBuffer)))return P(G,O,z);if(typeof G=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=G.valueOf&&G.valueOf();if(X!=null&&X!==G)return a.from(X,O,z);const ae=M(G);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof G[Symbol.toPrimitive]=="function")return a.from(G[Symbol.toPrimitive]("string"),O,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof G)}a.from=function(G,O,z){return c(G,O,z)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(G){if(typeof G!="number")throw new TypeError('"size" argument must be of type number');if(G<0)throw new RangeError('The value "'+G+'" is invalid for option "size"')}function d(G,O,z){return l(G),G<=0?o(G):O!==void 0?typeof z=="string"?o(G).fill(O,z):o(G).fill(O):o(G)}a.alloc=function(G,O,z){return d(G,O,z)};function f(G){return l(G),o(G<0?0:N(G)|0)}a.allocUnsafe=function(G){return f(G)},a.allocUnsafeSlow=function(G){return f(G)};function g(G,O){if((typeof O!="string"||O==="")&&(O="utf8"),!a.isEncoding(O))throw new TypeError("Unknown encoding: "+O);const z=$(G,O)|0;let X=o(z);const ae=X.write(G,O);return ae!==z&&(X=X.slice(0,ae)),X}function v(G){const O=G.length<0?0:N(G.length)|0,z=o(O);for(let X=0;X=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return G|0}function E(G){return+G!=G&&(G=0),a.alloc(+G)}a.isBuffer=function(O){return O!=null&&O._isBuffer===!0&&O!==a.prototype},a.compare=function(O,z){if(Be(O,Uint8Array)&&(O=a.from(O,O.offset,O.byteLength)),Be(z,Uint8Array)&&(z=a.from(z,z.offset,z.byteLength)),!a.isBuffer(O)||!a.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(O===z)return 0;let X=O.length,ae=z.length;for(let he=0,be=Math.min(X,ae);heae.length?(a.isBuffer(be)||(be=a.from(be)),be.copy(ae,he)):Uint8Array.prototype.set.call(ae,be,he);else if(a.isBuffer(be))be.copy(ae,he);else throw new TypeError('"list" argument must be an Array of Buffers');he+=be.length}return ae};function $(G,O){if(a.isBuffer(G))return G.length;if(ArrayBuffer.isView(G)||Be(G,ArrayBuffer))return G.byteLength;if(typeof G!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof G);const z=G.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&z===0)return 0;let ae=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Xe(G).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return st(G).length;default:if(ae)return X?-1:Xe(G).length;O=(""+O).toLowerCase(),ae=!0}}a.byteLength=$;function L(G,O,z){let X=!1;if((O===void 0||O<0)&&(O=0),O>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,O>>>=0,z<=O))return"";for(G||(G="utf8");;)switch(G){case"hex":return k(this,O,z);case"utf8":case"utf-8":return m(this,O,z);case"ascii":return R(this,O,z);case"latin1":case"binary":return S(this,O,z);case"base64":return p(this,O,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,O,z);default:if(X)throw new TypeError("Unknown encoding: "+G);G=(G+"").toLowerCase(),X=!0}}a.prototype._isBuffer=!0;function j(G,O,z){const X=G[O];G[O]=G[z],G[z]=X}a.prototype.swap16=function(){const O=this.length;if(O%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;zz&&(O+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(O,z,X,ae,he){if(Be(O,Uint8Array)&&(O=a.from(O,O.offset,O.byteLength)),!a.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(z===void 0&&(z=0),X===void 0&&(X=O?O.length:0),ae===void 0&&(ae=0),he===void 0&&(he=this.length),z<0||X>O.length||ae<0||he>this.length)throw new RangeError("out of range index");if(ae>=he&&z>=X)return 0;if(ae>=he)return-1;if(z>=X)return 1;if(z>>>=0,X>>>=0,ae>>>=0,he>>>=0,this===O)return 0;let be=he-ae,Ne=X-z;const Ve=Math.min(be,Ne),dt=this.slice(ae,he),Ge=O.slice(z,X);for(let wt=0;wt2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,nt(z)&&(z=ae?0:G.length-1),z<0&&(z=G.length+z),z>=G.length){if(ae)return-1;z=G.length-1}else if(z<0)if(ae)z=0;else return-1;if(typeof O=="string"&&(O=a.from(O,X)),a.isBuffer(O))return O.length===0?-1:I(G,O,z,X,ae);if(typeof O=="number")return O=O&255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(G,O,z):Uint8Array.prototype.lastIndexOf.call(G,O,z):I(G,[O],z,X,ae);throw new TypeError("val must be string, number or Buffer")}function I(G,O,z,X,ae){let he=1,be=G.length,Ne=O.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(G.length<2||O.length<2)return-1;he=2,be/=2,Ne/=2,z/=2}function Ve(Ge,wt){return he===1?Ge[wt]:Ge.readUInt16BE(wt*he)}let dt;if(ae){let Ge=-1;for(dt=z;dtbe&&(z=be-Ne),dt=z;dt>=0;dt--){let Ge=!0;for(let wt=0;wtae&&(X=ae)):X=ae;const he=O.length;X>he/2&&(X=he/2);let be;for(be=0;be>>0,isFinite(X)?(X=X>>>0,ae===void 0&&(ae="utf8")):(ae=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const he=this.length-z;if((X===void 0||X>he)&&(X=he),O.length>0&&(X<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let be=!1;for(;;)switch(ae){case"hex":return T(this,O,z,X);case"utf8":case"utf-8":return B(this,O,z,X);case"ascii":case"latin1":case"binary":return K(this,O,z,X);case"base64":return U(this,O,z,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,O,z,X);default:if(be)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),be=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function p(G,O,z){return O===0&&z===G.length?e.fromByteArray(G):e.fromByteArray(G.slice(O,z))}function m(G,O,z){z=Math.min(G.length,z);const X=[];let ae=O;for(;ae239?4:he>223?3:he>191?2:1;if(ae+Ne<=z){let Ve,dt,Ge,wt;switch(Ne){case 1:he<128&&(be=he);break;case 2:Ve=G[ae+1],(Ve&192)===128&&(wt=(he&31)<<6|Ve&63,wt>127&&(be=wt));break;case 3:Ve=G[ae+1],dt=G[ae+2],(Ve&192)===128&&(dt&192)===128&&(wt=(he&15)<<12|(Ve&63)<<6|dt&63,wt>2047&&(wt<55296||wt>57343)&&(be=wt));break;case 4:Ve=G[ae+1],dt=G[ae+2],Ge=G[ae+3],(Ve&192)===128&&(dt&192)===128&&(Ge&192)===128&&(wt=(he&15)<<18|(Ve&63)<<12|(dt&63)<<6|Ge&63,wt>65535&&wt<1114112&&(be=wt))}}be===null?(be=65533,Ne=1):be>65535&&(be-=65536,X.push(be>>>10&1023|55296),be=56320|be&1023),X.push(be),ae+=Ne}return _(X)}const w=4096;function _(G){const O=G.length;if(O<=w)return String.fromCharCode.apply(String,G);let z="",X=0;for(;XX)&&(z=X);let ae="";for(let he=O;heX&&(O=X),z<0?(z+=X,z<0&&(z=0)):z>X&&(z=X),zz)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(O,z,X){O=O>>>0,z=z>>>0,X||b(O,z,this.length);let ae=this[O],he=1,be=0;for(;++be>>0,z=z>>>0,X||b(O,z,this.length);let ae=this[O+--z],he=1;for(;z>0&&(he*=256);)ae+=this[O+--z]*he;return ae},a.prototype.readUint8=a.prototype.readUInt8=function(O,z){return O=O>>>0,z||b(O,1,this.length),this[O]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(O,z){return O=O>>>0,z||b(O,2,this.length),this[O]|this[O+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(O,z){return O=O>>>0,z||b(O,2,this.length),this[O]<<8|this[O+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(O,z){return O=O>>>0,z||b(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+this[O+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(O,z){return O=O>>>0,z||b(O,4,this.length),this[O]*16777216+(this[O+1]<<16|this[O+2]<<8|this[O+3])},a.prototype.readBigUInt64LE=je(function(O){O=O>>>0,Ce(O,"offset");const z=this[O],X=this[O+7];(z===void 0||X===void 0)&&Ee(O,this.length-8);const ae=z+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24,he=this[++O]+this[++O]*2**8+this[++O]*2**16+X*2**24;return BigInt(ae)+(BigInt(he)<>>0,Ce(O,"offset");const z=this[O],X=this[O+7];(z===void 0||X===void 0)&&Ee(O,this.length-8);const ae=z*2**24+this[++O]*2**16+this[++O]*2**8+this[++O],he=this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+X;return(BigInt(ae)<>>0,z=z>>>0,X||b(O,z,this.length);let ae=this[O],he=1,be=0;for(;++be=he&&(ae-=Math.pow(2,8*z)),ae},a.prototype.readIntBE=function(O,z,X){O=O>>>0,z=z>>>0,X||b(O,z,this.length);let ae=z,he=1,be=this[O+--ae];for(;ae>0&&(he*=256);)be+=this[O+--ae]*he;return he*=128,be>=he&&(be-=Math.pow(2,8*z)),be},a.prototype.readInt8=function(O,z){return O=O>>>0,z||b(O,1,this.length),this[O]&128?(255-this[O]+1)*-1:this[O]},a.prototype.readInt16LE=function(O,z){O=O>>>0,z||b(O,2,this.length);const X=this[O]|this[O+1]<<8;return X&32768?X|4294901760:X},a.prototype.readInt16BE=function(O,z){O=O>>>0,z||b(O,2,this.length);const X=this[O+1]|this[O]<<8;return X&32768?X|4294901760:X},a.prototype.readInt32LE=function(O,z){return O=O>>>0,z||b(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},a.prototype.readInt32BE=function(O,z){return O=O>>>0,z||b(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},a.prototype.readBigInt64LE=je(function(O){O=O>>>0,Ce(O,"offset");const z=this[O],X=this[O+7];(z===void 0||X===void 0)&&Ee(O,this.length-8);const ae=this[O+4]+this[O+5]*2**8+this[O+6]*2**16+(X<<24);return(BigInt(ae)<>>0,Ce(O,"offset");const z=this[O],X=this[O+7];(z===void 0||X===void 0)&&Ee(O,this.length-8);const ae=(z<<24)+this[++O]*2**16+this[++O]*2**8+this[++O];return(BigInt(ae)<>>0,z||b(O,4,this.length),r.read(this,O,!0,23,4)},a.prototype.readFloatBE=function(O,z){return O=O>>>0,z||b(O,4,this.length),r.read(this,O,!1,23,4)},a.prototype.readDoubleLE=function(O,z){return O=O>>>0,z||b(O,8,this.length),r.read(this,O,!0,52,8)},a.prototype.readDoubleBE=function(O,z){return O=O>>>0,z||b(O,8,this.length),r.read(this,O,!1,52,8)};function V(G,O,z,X,ae,he){if(!a.isBuffer(G))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>ae||OG.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(O,z,X,ae){if(O=+O,z=z>>>0,X=X>>>0,!ae){const Ne=Math.pow(2,8*X)-1;V(this,O,z,X,Ne,0)}let he=1,be=0;for(this[z]=O&255;++be>>0,X=X>>>0,!ae){const Ne=Math.pow(2,8*X)-1;V(this,O,z,X,Ne,0)}let he=X-1,be=1;for(this[z+he]=O&255;--he>=0&&(be*=256);)this[z+he]=O/be&255;return z+X},a.prototype.writeUint8=a.prototype.writeUInt8=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,1,255,0),this[z]=O&255,z+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,2,65535,0),this[z]=O&255,this[z+1]=O>>>8,z+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,2,65535,0),this[z]=O>>>8,this[z+1]=O&255,z+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,4,4294967295,0),this[z+3]=O>>>24,this[z+2]=O>>>16,this[z+1]=O>>>8,this[z]=O&255,z+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,4,4294967295,0),this[z]=O>>>24,this[z+1]=O>>>16,this[z+2]=O>>>8,this[z+3]=O&255,z+4};function ce(G,O,z,X,ae){me(O,X,ae,G,z,7);let he=Number(O&BigInt(4294967295));G[z++]=he,he=he>>8,G[z++]=he,he=he>>8,G[z++]=he,he=he>>8,G[z++]=he;let be=Number(O>>BigInt(32)&BigInt(4294967295));return G[z++]=be,be=be>>8,G[z++]=be,be=be>>8,G[z++]=be,be=be>>8,G[z++]=be,z}function fe(G,O,z,X,ae){me(O,X,ae,G,z,7);let he=Number(O&BigInt(4294967295));G[z+7]=he,he=he>>8,G[z+6]=he,he=he>>8,G[z+5]=he,he=he>>8,G[z+4]=he;let be=Number(O>>BigInt(32)&BigInt(4294967295));return G[z+3]=be,be=be>>8,G[z+2]=be,be=be>>8,G[z+1]=be,be=be>>8,G[z]=be,z+8}a.prototype.writeBigUInt64LE=je(function(O,z=0){return ce(this,O,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=je(function(O,z=0){return fe(this,O,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(O,z,X,ae){if(O=+O,z=z>>>0,!ae){const Ve=Math.pow(2,8*X-1);V(this,O,z,X,Ve-1,-Ve)}let he=0,be=1,Ne=0;for(this[z]=O&255;++he>0)-Ne&255;return z+X},a.prototype.writeIntBE=function(O,z,X,ae){if(O=+O,z=z>>>0,!ae){const Ve=Math.pow(2,8*X-1);V(this,O,z,X,Ve-1,-Ve)}let he=X-1,be=1,Ne=0;for(this[z+he]=O&255;--he>=0&&(be*=256);)O<0&&Ne===0&&this[z+he+1]!==0&&(Ne=1),this[z+he]=(O/be>>0)-Ne&255;return z+X},a.prototype.writeInt8=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,1,127,-128),O<0&&(O=255+O+1),this[z]=O&255,z+1},a.prototype.writeInt16LE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,2,32767,-32768),this[z]=O&255,this[z+1]=O>>>8,z+2},a.prototype.writeInt16BE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,2,32767,-32768),this[z]=O>>>8,this[z+1]=O&255,z+2},a.prototype.writeInt32LE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,4,2147483647,-2147483648),this[z]=O&255,this[z+1]=O>>>8,this[z+2]=O>>>16,this[z+3]=O>>>24,z+4},a.prototype.writeInt32BE=function(O,z,X){return O=+O,z=z>>>0,X||V(this,O,z,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[z]=O>>>24,this[z+1]=O>>>16,this[z+2]=O>>>8,this[z+3]=O&255,z+4},a.prototype.writeBigInt64LE=je(function(O,z=0){return ce(this,O,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=je(function(O,z=0){return fe(this,O,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(G,O,z,X,ae,he){if(z+X>G.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function ue(G,O,z,X,ae){return O=+O,z=z>>>0,ae||W(G,O,z,4),r.write(G,O,z,X,23,4),z+4}a.prototype.writeFloatLE=function(O,z,X){return ue(this,O,z,!0,X)},a.prototype.writeFloatBE=function(O,z,X){return ue(this,O,z,!1,X)};function J(G,O,z,X,ae){return O=+O,z=z>>>0,ae||W(G,O,z,8),r.write(G,O,z,X,52,8),z+8}a.prototype.writeDoubleLE=function(O,z,X){return J(this,O,z,!0,X)},a.prototype.writeDoubleBE=function(O,z,X){return J(this,O,z,!1,X)},a.prototype.copy=function(O,z,X,ae){if(!a.isBuffer(O))throw new TypeError("argument should be a Buffer");if(X||(X=0),!ae&&ae!==0&&(ae=this.length),z>=O.length&&(z=O.length),z||(z=0),ae>0&&ae=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),O.length-z>>0,X=X===void 0?this.length:X>>>0,O||(O=0);let he;if(typeof O=="number")for(he=z;he2**32?ae=D(String(z)):typeof z=="bigint"&&(ae=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(ae=D(ae)),ae+="n"),X+=` It must be ${O}. Received ${ae}`,X},RangeError);function D(G){let O="",z=G.length;const X=G[0]==="-"?1:0;for(;z>=X+4;z-=3)O=`_${G.slice(z-3,z)}${O}`;return`${G.slice(0,z)}${O}`}function te(G,O,z){Ce(O,"offset"),(G[O]===void 0||G[O+z]===void 0)&&Ee(O,G.length-(z+1))}function me(G,O,z,X,ae,he){if(G>z||G= 0${be} and < 2${be} ** ${(he+1)*8}${be}`:Ne=`>= -(2${be} ** ${(he+1)*8-1}${be}) and < 2 ** ${(he+1)*8-1}${be}`,new ne.ERR_OUT_OF_RANGE("value",Ne,G)}te(X,ae,he)}function Ce(G,O){if(typeof G!="number")throw new ne.ERR_INVALID_ARG_TYPE(O,"number",G)}function Ee(G,O,z){throw Math.floor(G)!==G?(Ce(G,z),new ne.ERR_OUT_OF_RANGE("offset","an integer",G)):O<0?new ne.ERR_BUFFER_OUT_OF_BOUNDS:new ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${O}`,G)}const Re=/[^+/0-9A-Za-z-_]/g;function He(G){if(G=G.split("=")[0],G=G.trim().replace(Re,""),G.length<2)return"";for(;G.length%4!==0;)G=G+"=";return G}function Xe(G,O){O=O||1/0;let z;const X=G.length;let ae=null;const he=[];for(let be=0;be55295&&z<57344){if(!ae){if(z>56319){(O-=3)>-1&&he.push(239,191,189);continue}else if(be+1===X){(O-=3)>-1&&he.push(239,191,189);continue}ae=z;continue}if(z<56320){(O-=3)>-1&&he.push(239,191,189),ae=z;continue}z=(ae-55296<<10|z-56320)+65536}else ae&&(O-=3)>-1&&he.push(239,191,189);if(ae=null,z<128){if((O-=1)<0)break;he.push(z)}else if(z<2048){if((O-=2)<0)break;he.push(z>>6|192,z&63|128)}else if(z<65536){if((O-=3)<0)break;he.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((O-=4)<0)break;he.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return he}function kt(G){const O=[];for(let z=0;z>8,ae=z%256,he.push(ae),he.push(X);return he}function st(G){return e.toByteArray(He(G))}function Ze(G,O,z,X){let ae;for(ae=0;ae=O.length||ae>=G.length);++ae)O[ae+z]=G[ae];return ae}function Be(G,O){return G instanceof O||G!=null&&G.constructor!=null&&G.constructor.name!=null&&G.constructor.name===O.name}function nt(G){return G!==G}const lt=function(){const G="0123456789abcdef",O=new Array(256);for(let z=0;z<16;++z){const X=z*16;for(let ae=0;ae<16;++ae)O[X+ae]=G[z]+G[ae]}return O}();function je(G){return typeof BigInt>"u"?at:G}function at(){throw new Error("BigInt not supported")}})(mL);var U$;typeof window<"u"&&(window.Buffer||(window.Buffer=mL.Buffer),window.global||(window.global=window),window.process||(window.process={}),(U$=window.process)!=null&&U$.env||(window.process={env:{}}));var vL={};const MX=vL.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.org/sdk",$X=vL.NEXT_PUBLIC_DEFAULT_LOG_LEVEL||"error",Mt={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},lr={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var Dr;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Dr||(Dr={}));var sC;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(sC||(sC={}));const gt=Dr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sd=t=>{switch(typeof t){case"undefined":return gt.undefined;case"string":return gt.string;case"number":return isNaN(t)?gt.nan:gt.number;case"boolean":return gt.boolean;case"function":return gt.function;case"bigint":return gt.bigint;case"symbol":return gt.symbol;case"object":return Array.isArray(t)?gt.array:t===null?gt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?gt.promise:typeof Map<"u"&&t instanceof Map?gt.map:typeof Set<"u"&&t instanceof Set?gt.set:typeof Date<"u"&&t instanceof Date?gt.date:gt.object;default:return gt.unknown}},Ke=Dr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),OX=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class dc extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;cr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}dc.create=t=>new dc(t);const kw=(t,e)=>{let r;switch(t.code){case Ke.invalid_type:t.received===gt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Dr.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${Dr.joinValues(t.keys,", ")}`;break;case Ke.invalid_union:r="Invalid input";break;case Ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Dr.joinValues(t.options)}`;break;case Ke.invalid_enum_value:r=`Invalid enum value. Expected ${Dr.joinValues(t.options)}, received '${t.received}'`;break;case Ke.invalid_arguments:r="Invalid function arguments";break;case Ke.invalid_return_type:r="Invalid function return type";break;case Ke.invalid_date:r="Invalid date";break;case Ke.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Dr.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ke.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ke.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ke.custom:r="Invalid input";break;case Ke.invalid_intersection_types:r="Intersection results could not be merged";break;case Ke.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ke.not_finite:r="Number must be finite";break;default:r=e.defaultError,Dr.assertNever(t)}return{message:r}};let yL=kw;function DX(t){yL=t}function Zb(){return yL}const Qb=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s};let a="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},LX=[];function Ct(t,e){const r=Qb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zb(),kw].filter(n=>!!n)});t.common.issues.push(r)}class ns{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return rr;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return ns.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return rr;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const rr=Object.freeze({status:"aborted"}),bL=t=>({status:"dirty",value:t}),xs=t=>({status:"valid",value:t}),oC=t=>t.status==="aborted",aC=t=>t.status==="dirty",Rw=t=>t.status==="valid",Yb=t=>typeof Promise<"u"&&t instanceof Promise;var Dt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Dt||(Dt={}));class gl{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xk=(t,e)=>{if(Rw(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new dc(t.common.issues);return this._error=r,this._error}}};function ur(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:i}}class mr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Sd(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Sd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ns,ctx:{common:e.parent.common,data:e.data,parsedType:Sd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Yb(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sd(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Xk(i,s)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sd(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Yb(i)?i:Promise.resolve(i));return Xk(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Ke.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new gc({schema:this,typeName:Jt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Cu.create(this,this._def)}nullable(){return Uh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fc.create(this,this._def)}promise(){return v1.create(this,this._def)}or(e){return $w.create([this,e],this._def)}and(e){return Ow.create(this,e,this._def)}transform(e){return new gc({...ur(this._def),schema:this,typeName:Jt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new jw({...ur(this._def),innerType:this,defaultValue:r,typeName:Jt.ZodDefault})}brand(){return new CL({typeName:Jt.ZodBranded,type:this,...ur(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new t5({...ur(this._def),innerType:this,catchValue:r,typeName:Jt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return e2.create(this,e)}readonly(){return n5.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BX=/^c[^\s-]{8,}$/i,UX=/^[a-z][a-z0-9]*$/,jX=/^[0-9A-HJKMNP-TV-Z]{26}$/,FX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zX=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jx;const HX=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,qX=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,VX=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function KX(t,e){return!!((e==="v4"||!e)&&HX.test(t)||(e==="v6"||!e)&&qX.test(t))}class ac extends mr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==gt.string){const s=this._getOrReturnCtx(e);return Ct(s,{code:Ke.invalid_type,expected:gt.string,received:s.parsedType}),rr}const n=new ns;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),Ct(i,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(i),{validation:r,code:Ke.invalid_string,...Dt.errToObj(n)})}_addCheck(e){return new ac({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Dt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Dt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Dt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Dt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Dt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Dt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Dt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Dt.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...Dt.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Dt.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...Dt.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Dt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Dt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Dt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Dt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Dt.errToObj(r)})}nonempty(e){return this.min(1,Dt.errToObj(e))}trim(){return new ac({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ac({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ac({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new ac({checks:[],typeName:Jt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ur(t)})};function GX(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class nf extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==gt.number){const s=this._getOrReturnCtx(e);return Ct(s,{code:Ke.invalid_type,expected:gt.number,received:s.parsedType}),rr}let n;const i=new ns;for(const s of this._def.checks)s.kind==="int"?Dr.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?GX(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.not_finite,message:s.message}),i.dirty()):Dr.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Dt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Dt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Dt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Dt.toString(r))}setLimit(e,r,n,i){return new nf({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Dt.toString(i)}]})}_addCheck(e){return new nf({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Dt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Dt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Dt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Dt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Dt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Dt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Dt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Dt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Dt.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&Dr.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew nf({checks:[],typeName:Jt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ur(t)});class sf extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==gt.bigint){const s=this._getOrReturnCtx(e);return Ct(s,{code:Ke.invalid_type,expected:gt.bigint,received:s.parsedType}),rr}let n;const i=new ns;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ct(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Dr.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Dt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Dt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Dt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Dt.toString(r))}setLimit(e,r,n,i){return new sf({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Dt.toString(i)}]})}_addCheck(e){return new sf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Dt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Dt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Dt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Dt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Dt.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new sf({checks:[],typeName:Jt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ur(t)})};class Pw extends mr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==gt.boolean){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.boolean,received:n.parsedType}),rr}return xs(e.data)}}Pw.create=t=>new Pw({typeName:Jt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ur(t)});class Lh extends mr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==gt.date){const s=this._getOrReturnCtx(e);return Ct(s,{code:Ke.invalid_type,expected:gt.date,received:s.parsedType}),rr}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ct(s,{code:Ke.invalid_date}),rr}const n=new ns;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),Ct(i,{code:Ke.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Dr.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lh({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Dt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Dt.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Lh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Jt.ZodDate,...ur(t)});class Jb extends mr{_parse(e){if(this._getType(e)!==gt.symbol){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.symbol,received:n.parsedType}),rr}return xs(e.data)}}Jb.create=t=>new Jb({typeName:Jt.ZodSymbol,...ur(t)});class Nw extends mr{_parse(e){if(this._getType(e)!==gt.undefined){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.undefined,received:n.parsedType}),rr}return xs(e.data)}}Nw.create=t=>new Nw({typeName:Jt.ZodUndefined,...ur(t)});class Mw extends mr{_parse(e){if(this._getType(e)!==gt.null){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.null,received:n.parsedType}),rr}return xs(e.data)}}Mw.create=t=>new Mw({typeName:Jt.ZodNull,...ur(t)});class w1 extends mr{constructor(){super(...arguments),this._any=!0}_parse(e){return xs(e.data)}}w1.create=t=>new w1({typeName:Jt.ZodAny,...ur(t)});class Ih extends mr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xs(e.data)}}Ih.create=t=>new Ih({typeName:Jt.ZodUnknown,...ur(t)});class ku extends mr{_parse(e){const r=this._getOrReturnCtx(e);return Ct(r,{code:Ke.invalid_type,expected:gt.never,received:r.parsedType}),rr}}ku.create=t=>new ku({typeName:Jt.ZodNever,...ur(t)});class Xb extends mr{_parse(e){if(this._getType(e)!==gt.undefined){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.void,received:n.parsedType}),rr}return xs(e.data)}}Xb.create=t=>new Xb({typeName:Jt.ZodVoid,...ur(t)});class fc extends mr{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==gt.array)return Ct(r,{code:Ke.invalid_type,expected:gt.array,received:r.parsedType}),rr;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.lengthi.maxLength.value&&(Ct(r,{code:Ke.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new gl(r,o,r.path,a)))).then(o=>ns.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new gl(r,o,r.path,a)));return ns.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new fc({...this._def,minLength:{value:e,message:Dt.toString(r)}})}max(e,r){return new fc({...this._def,maxLength:{value:e,message:Dt.toString(r)}})}length(e,r){return new fc({...this._def,exactLength:{value:e,message:Dt.toString(r)}})}nonempty(e){return this.min(1,e)}}fc.create=(t,e)=>new fc({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Jt.ZodArray,...ur(e)});function hp(t){if(t instanceof An){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Cu.create(hp(n))}return new An({...t._def,shape:()=>e})}else return t instanceof fc?new fc({...t._def,type:hp(t.element)}):t instanceof Cu?Cu.create(hp(t.unwrap())):t instanceof Uh?Uh.create(hp(t.unwrap())):t instanceof ml?ml.create(t.items.map(e=>hp(e))):t}class An extends mr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Dr.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==gt.object){const l=this._getOrReturnCtx(e);return Ct(l,{code:Ke.invalid_type,expected:gt.object,received:l.parsedType}),rr}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ku&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const d=s[l],f=i.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new gl(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ku){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(l==="strict")a.length>0&&(Ct(i,{code:Ke.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of a){const f=i.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new gl(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of c){const f=await d.key;l.push({key:f,value:await d.value,alwaysSet:d.alwaysSet})}return l}).then(l=>ns.mergeObjectSync(n,l)):ns.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Dt.errToObj,new An({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Dt.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new An({...this._def,unknownKeys:"strip"})}passthrough(){return new An({...this._def,unknownKeys:"passthrough"})}extend(e){return new An({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new An({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Jt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new An({...this._def,catchall:e})}pick(e){const r={};return Dr.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new An({...this._def,shape:()=>r})}omit(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new An({...this._def,shape:()=>r})}deepPartial(){return hp(this)}partial(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new An({...this._def,shape:()=>r})}required(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Cu;)s=s._def.innerType;r[n]=s}}),new An({...this._def,shape:()=>r})}keyof(){return xL(Dr.objectKeys(this.shape))}}An.create=(t,e)=>new An({shape:()=>t,unknownKeys:"strip",catchall:ku.create(),typeName:Jt.ZodObject,...ur(e)});An.strictCreate=(t,e)=>new An({shape:()=>t,unknownKeys:"strict",catchall:ku.create(),typeName:Jt.ZodObject,...ur(e)});An.lazycreate=(t,e)=>new An({shape:t,unknownKeys:"strip",catchall:ku.create(),typeName:Jt.ZodObject,...ur(e)});class $w extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new dc(a.ctx.common.issues));return Ct(r,{code:Ke.invalid_union,unionErrors:o}),rr}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new dc(c));return Ct(r,{code:Ke.invalid_union,unionErrors:a}),rr}}get options(){return this._def.options}}$w.create=(t,e)=>new $w({options:t,typeName:Jt.ZodUnion,...ur(e)});const rb=t=>t instanceof Lw?rb(t.schema):t instanceof gc?rb(t.innerType()):t instanceof Bw?[t.value]:t instanceof of?t.options:t instanceof Uw?Object.keys(t.enum):t instanceof jw?rb(t._def.innerType):t instanceof Nw?[void 0]:t instanceof Mw?[null]:null;class M6 extends mr{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.object)return Ct(r,{code:Ke.invalid_type,expected:gt.object,received:r.parsedType}),rr;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ct(r,{code:Ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),rr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const s of r){const o=rb(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new M6({typeName:Jt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ur(n)})}}function cC(t,e){const r=Sd(t),n=Sd(e);if(t===e)return{valid:!0,data:t};if(r===gt.object&&n===gt.object){const i=Dr.objectKeys(e),s=Dr.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=cC(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===gt.array&&n===gt.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(oC(s)||oC(o))return rr;const a=cC(s.value,o.value);return a.valid?((aC(s)||aC(o))&&r.dirty(),{status:r.value,value:a.data}):(Ct(n,{code:Ke.invalid_intersection_types}),rr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ow.create=(t,e,r)=>new Ow({left:t,right:e,typeName:Jt.ZodIntersection,...ur(r)});class ml extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.array)return Ct(n,{code:Ke.invalid_type,expected:gt.array,received:n.parsedType}),rr;if(n.data.lengththis._def.items.length&&(Ct(n,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new gl(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>ns.mergeArray(r,o)):ns.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new ml({...this._def,rest:e})}}ml.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ml({items:t,typeName:Jt.ZodTuple,rest:null,...ur(e)})};class Dw extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.object)return Ct(n,{code:Ke.invalid_type,expected:gt.object,received:n.parsedType}),rr;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new gl(n,a,n.path,a)),value:o._parse(new gl(n,n.data[a],n.path,a))});return n.common.async?ns.mergeObjectAsync(r,i):ns.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof mr?new Dw({keyType:e,valueType:r,typeName:Jt.ZodRecord,...ur(n)}):new Dw({keyType:ac.create(),valueType:e,typeName:Jt.ZodRecord,...ur(r)})}}class e5 extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.map)return Ct(n,{code:Ke.invalid_type,expected:gt.map,received:n.parsedType}),rr;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:i._parse(new gl(n,a,n.path,[l,"key"])),value:s._parse(new gl(n,c,n.path,[l,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return rr;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(l.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return rr;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(l.value,d.value)}return{status:r.value,value:a}}}}e5.create=(t,e,r)=>new e5({valueType:e,keyType:t,typeName:Jt.ZodMap,...ur(r)});class Bh extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.set)return Ct(n,{code:Ke.invalid_type,expected:gt.set,received:n.parsedType}),rr;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(Ct(n,{code:Ke.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const d of c){if(d.status==="aborted")return rr;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}const a=[...n.data.values()].map((c,l)=>s._parse(new gl(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new Bh({...this._def,minSize:{value:e,message:Dt.toString(r)}})}max(e,r){return new Bh({...this._def,maxSize:{value:e,message:Dt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Bh.create=(t,e)=>new Bh({valueType:t,minSize:null,maxSize:null,typeName:Jt.ZodSet,...ur(e)});class Vp extends mr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.function)return Ct(r,{code:Ke.invalid_type,expected:gt.function,received:r.parsedType}),rr;function n(a,c){return Qb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zb(),kw].filter(l=>!!l),issueData:{code:Ke.invalid_arguments,argumentsError:c}})}function i(a,c){return Qb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zb(),kw].filter(l=>!!l),issueData:{code:Ke.invalid_return_type,returnTypeError:c}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof v1){const a=this;return xs(async function(...c){const l=new dc([]),d=await a._def.args.parseAsync(c,s).catch(v=>{throw l.addIssue(n(c,v)),l}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,s).catch(v=>{throw l.addIssue(i(f,v)),l})})}else{const a=this;return xs(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new dc([n(c,l.error)]);const d=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(d,s);if(!f.success)throw new dc([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Vp({...this._def,args:ml.create(e).rest(Ih.create())})}returns(e){return new Vp({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Vp({args:e||ml.create([]).rest(Ih.create()),returns:r||Ih.create(),typeName:Jt.ZodFunction,...ur(n)})}}class Lw extends mr{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Lw.create=(t,e)=>new Lw({getter:t,typeName:Jt.ZodLazy,...ur(e)});class Bw extends mr{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Ct(r,{received:r.data,code:Ke.invalid_literal,expected:this._def.value}),rr}return{status:"valid",value:e.data}}get value(){return this._def.value}}Bw.create=(t,e)=>new Bw({value:t,typeName:Jt.ZodLiteral,...ur(e)});function xL(t,e){return new of({values:t,typeName:Jt.ZodEnum,...ur(e)})}class of extends mr{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Ct(r,{expected:Dr.joinValues(n),received:r.parsedType,code:Ke.invalid_type}),rr}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return Ct(r,{received:r.data,code:Ke.invalid_enum_value,options:n}),rr}return xs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return of.create(e)}exclude(e){return of.create(this.options.filter(r=>!e.includes(r)))}}of.create=xL;class Uw extends mr{_parse(e){const r=Dr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==gt.string&&n.parsedType!==gt.number){const i=Dr.objectValues(r);return Ct(n,{expected:Dr.joinValues(i),received:n.parsedType,code:Ke.invalid_type}),rr}if(r.indexOf(e.data)===-1){const i=Dr.objectValues(r);return Ct(n,{received:n.data,code:Ke.invalid_enum_value,options:i}),rr}return xs(e.data)}get enum(){return this._def.values}}Uw.create=(t,e)=>new Uw({values:t,typeName:Jt.ZodNativeEnum,...ur(e)});class v1 extends mr{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.promise&&r.common.async===!1)return Ct(r,{code:Ke.invalid_type,expected:gt.promise,received:r.parsedType}),rr;const n=r.parsedType===gt.promise?r.data:Promise.resolve(r.data);return xs(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}v1.create=(t,e)=>new v1({type:t,typeName:Jt.ZodPromise,...ur(e)});class gc extends mr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Jt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ct(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?rr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?rr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Rw(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Rw(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Dr.assertNever(i)}}gc.create=(t,e,r)=>new gc({schema:t,typeName:Jt.ZodEffects,effect:e,...ur(r)});gc.createWithPreprocess=(t,e,r)=>new gc({schema:e,effect:{type:"preprocess",transform:t},typeName:Jt.ZodEffects,...ur(r)});class Cu extends mr{_parse(e){return this._getType(e)===gt.undefined?xs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cu.create=(t,e)=>new Cu({innerType:t,typeName:Jt.ZodOptional,...ur(e)});class Uh extends mr{_parse(e){return this._getType(e)===gt.null?xs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Uh.create=(t,e)=>new Uh({innerType:t,typeName:Jt.ZodNullable,...ur(e)});class jw extends mr{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===gt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}jw.create=(t,e)=>new jw({innerType:t,typeName:Jt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ur(e)});class t5 extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Yb(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new dc(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new dc(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}t5.create=(t,e)=>new t5({innerType:t,typeName:Jt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ur(e)});class r5 extends mr{_parse(e){if(this._getType(e)!==gt.nan){const n=this._getOrReturnCtx(e);return Ct(n,{code:Ke.invalid_type,expected:gt.nan,received:n.parsedType}),rr}return{status:"valid",value:e.data}}}r5.create=t=>new r5({typeName:Jt.ZodNaN,...ur(t)});const ZX=Symbol("zod_brand");class CL extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class e2 extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?rr:s.status==="dirty"?(r.dirty(),bL(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?rr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new e2({in:e,out:r,typeName:Jt.ZodPipeline})}}class n5 extends mr{_parse(e){const r=this._def.innerType._parse(e);return Rw(r)&&(r.value=Object.freeze(r.value)),r}}n5.create=(t,e)=>new n5({innerType:t,typeName:Jt.ZodReadonly,...ur(e)});const _L=(t,e={},r)=>t?w1.create().superRefine((n,i)=>{var s,o;if(!t(n)){const a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):w1.create(),QX={object:An.lazycreate};var Jt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Jt||(Jt={}));const YX=(t,e={message:`Input not instance of ${t.name}`})=>_L(r=>r instanceof t,e),AL=ac.create,EL=nf.create,JX=r5.create,XX=sf.create,SL=Pw.create,eee=Lh.create,tee=Jb.create,ree=Nw.create,nee=Mw.create,iee=w1.create,see=Ih.create,oee=ku.create,aee=Xb.create,cee=fc.create,lee=An.create,uee=An.strictCreate,dee=$w.create,fee=M6.create,hee=Ow.create,pee=ml.create,gee=Dw.create,mee=e5.create,wee=Bh.create,vee=Vp.create,yee=Lw.create,bee=Bw.create,xee=of.create,Cee=Uw.create,_ee=v1.create,eR=gc.create,Aee=Cu.create,Eee=Uh.create,See=gc.createWithPreprocess,Iee=e2.create,Tee=()=>AL().optional(),kee=()=>EL().optional(),Ree=()=>SL().optional(),Pee={string:t=>ac.create({...t,coerce:!0}),number:t=>nf.create({...t,coerce:!0}),boolean:t=>Pw.create({...t,coerce:!0}),bigint:t=>sf.create({...t,coerce:!0}),date:t=>Lh.create({...t,coerce:!0})},Nee=rr;var se=Object.freeze({__proto__:null,defaultErrorMap:kw,setErrorMap:DX,getErrorMap:Zb,makeIssue:Qb,EMPTY_PATH:LX,addIssueToContext:Ct,ParseStatus:ns,INVALID:rr,DIRTY:bL,OK:xs,isAborted:oC,isDirty:aC,isValid:Rw,isAsync:Yb,get util(){return Dr},get objectUtil(){return sC},ZodParsedType:gt,getParsedType:Sd,ZodType:mr,ZodString:ac,ZodNumber:nf,ZodBigInt:sf,ZodBoolean:Pw,ZodDate:Lh,ZodSymbol:Jb,ZodUndefined:Nw,ZodNull:Mw,ZodAny:w1,ZodUnknown:Ih,ZodNever:ku,ZodVoid:Xb,ZodArray:fc,ZodObject:An,ZodUnion:$w,ZodDiscriminatedUnion:M6,ZodIntersection:Ow,ZodTuple:ml,ZodRecord:Dw,ZodMap:e5,ZodSet:Bh,ZodFunction:Vp,ZodLazy:Lw,ZodLiteral:Bw,ZodEnum:of,ZodNativeEnum:Uw,ZodPromise:v1,ZodEffects:gc,ZodTransformer:gc,ZodOptional:Cu,ZodNullable:Uh,ZodDefault:jw,ZodCatch:t5,ZodNaN:r5,BRAND:ZX,ZodBranded:CL,ZodPipeline:e2,ZodReadonly:n5,custom:_L,Schema:mr,ZodSchema:mr,late:QX,get ZodFirstPartyTypeKind(){return Jt},coerce:Pee,any:iee,array:cee,bigint:XX,boolean:SL,date:eee,discriminatedUnion:fee,effect:eR,enum:xee,function:vee,instanceof:YX,intersection:hee,lazy:yee,literal:bee,map:mee,nan:JX,nativeEnum:Cee,never:oee,null:nee,nullable:Eee,number:EL,object:lee,oboolean:Ree,onumber:kee,optional:Aee,ostring:Tee,pipeline:Iee,preprocess:See,promise:_ee,record:gee,set:wee,strictObject:uee,string:AL,symbol:tee,transformer:eR,tuple:pee,undefined:ree,union:dee,unknown:see,void:aee,NEVER:Nee,ZodIssueCode:Ke,quotelessJson:OX,ZodError:dc});const Fn=se.object({message:se.string()});function At(t){return se.literal(Mt[t])}se.object({accessList:se.array(se.string()),blockHash:se.string().nullable(),blockNumber:se.string().nullable(),chainId:se.string().or(se.number()),from:se.string(),gas:se.string(),hash:se.string(),input:se.string().nullable(),maxFeePerGas:se.string(),maxPriorityFeePerGas:se.string(),nonce:se.string(),r:se.string(),s:se.string(),to:se.string(),transactionIndex:se.string().nullable(),type:se.string(),v:se.string(),value:se.string()});const Mee=se.object({chainId:se.string().or(se.number())}),$ee=se.object({email:se.string().email()}),Oee=se.object({otp:se.string()}),Dee=se.object({uri:se.string()}),Lee=se.object({chainId:se.optional(se.string().or(se.number())),preferredAccountType:se.optional(se.string())}),Bee=se.object({provider:se.enum(["google","github","apple","facebook","x","discord"])}),Uee=se.object({email:se.string().email()}),jee=se.object({otp:se.string()}),Fee=se.object({otp:se.string()}),zee=se.object({themeMode:se.optional(se.enum(["light","dark"])),themeVariables:se.optional(se.record(se.string(),se.string().or(se.number()))),w3mThemeVariables:se.optional(se.record(se.string(),se.string()))}),Wee=se.object({metadata:se.object({name:se.string(),description:se.string(),url:se.string(),icons:se.array(se.string())}).optional(),sdkVersion:se.string().optional(),sdkType:se.string().optional(),projectId:se.string()}),Hee=se.object({type:se.string()}),qee=se.object({action:se.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),Vee=se.object({url:se.string()}),Kee=se.object({userName:se.string()}),Gee=se.object({email:se.string(),address:se.string(),chainId:se.string().or(se.number()),accounts:se.array(se.object({address:se.string(),type:se.enum([lr.ACCOUNT_TYPES.EOA,lr.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:se.string().optional()}),Zee=se.object({action:se.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),Qee=se.object({email:se.string().email().optional().nullable(),address:se.string(),chainId:se.string().or(se.number()),smartAccountDeployed:se.optional(se.boolean()),accounts:se.array(se.object({address:se.string(),type:se.enum([lr.ACCOUNT_TYPES.EOA,lr.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:se.optional(se.string())}),Yee=se.object({uri:se.string()}),Jee=se.object({isConnected:se.boolean()}),Xee=se.object({chainId:se.string().or(se.number())}),ete=se.object({chainId:se.string().or(se.number())}),tte=se.object({newEmail:se.string().email()}),rte=se.object({smartAccountEnabledNetworks:se.array(se.number())});se.object({address:se.string(),isDeployed:se.boolean()});const nte=se.object({type:se.string(),address:se.string()}),ite=se.any(),ste=se.object({method:se.literal("eth_accounts")}),ote=se.object({method:se.literal("eth_blockNumber")}),ate=se.object({method:se.literal("eth_call"),params:se.array(se.any())}),cte=se.object({method:se.literal("eth_chainId")}),lte=se.object({method:se.literal("eth_estimateGas"),params:se.array(se.any())}),ute=se.object({method:se.literal("eth_feeHistory"),params:se.array(se.any())}),dte=se.object({method:se.literal("eth_gasPrice")}),fte=se.object({method:se.literal("eth_getAccount"),params:se.array(se.any())}),hte=se.object({method:se.literal("eth_getBalance"),params:se.array(se.any())}),pte=se.object({method:se.literal("eth_getBlockByHash"),params:se.array(se.any())}),gte=se.object({method:se.literal("eth_getBlockByNumber"),params:se.array(se.any())}),mte=se.object({method:se.literal("eth_getBlockReceipts"),params:se.array(se.any())}),wte=se.object({method:se.literal("eth_getBlockTransactionCountByHash"),params:se.array(se.any())}),vte=se.object({method:se.literal("eth_getBlockTransactionCountByNumber"),params:se.array(se.any())}),yte=se.object({method:se.literal("eth_getCode"),params:se.array(se.any())}),bte=se.object({method:se.literal("eth_getFilterChanges"),params:se.array(se.any())}),xte=se.object({method:se.literal("eth_getFilterLogs"),params:se.array(se.any())}),Cte=se.object({method:se.literal("eth_getLogs"),params:se.array(se.any())}),_te=se.object({method:se.literal("eth_getProof"),params:se.array(se.any())}),Ate=se.object({method:se.literal("eth_getStorageAt"),params:se.array(se.any())}),Ete=se.object({method:se.literal("eth_getTransactionByBlockHashAndIndex"),params:se.array(se.any())}),Ste=se.object({method:se.literal("eth_getTransactionByBlockNumberAndIndex"),params:se.array(se.any())}),Ite=se.object({method:se.literal("eth_getTransactionByHash"),params:se.array(se.any())}),Tte=se.object({method:se.literal("eth_getTransactionCount"),params:se.array(se.any())}),kte=se.object({method:se.literal("eth_getTransactionReceipt"),params:se.array(se.any())}),Rte=se.object({method:se.literal("eth_getUncleCountByBlockHash"),params:se.array(se.any())}),Pte=se.object({method:se.literal("eth_getUncleCountByBlockNumber"),params:se.array(se.any())}),Nte=se.object({method:se.literal("eth_maxPriorityFeePerGas")}),Mte=se.object({method:se.literal("eth_newBlockFilter")}),$te=se.object({method:se.literal("eth_newFilter"),params:se.array(se.any())}),Ote=se.object({method:se.literal("eth_newPendingTransactionFilter")}),Dte=se.object({method:se.literal("eth_sendRawTransaction"),params:se.array(se.any())}),Lte=se.object({method:se.literal("eth_syncing"),params:se.array(se.any())}),Bte=se.object({method:se.literal("eth_uninstallFilter"),params:se.array(se.any())}),tR=se.object({method:se.literal("personal_sign"),params:se.array(se.any())}),Ute=se.object({method:se.literal("eth_signTypedData_v4"),params:se.array(se.any())}),rR=se.object({method:se.literal("eth_sendTransaction"),params:se.array(se.any())}),jte=se.object({method:se.literal("solana_signMessage"),params:se.object({message:se.string(),pubkey:se.string()})}),Fte=se.object({method:se.literal("solana_signTransaction"),params:se.object({transaction:se.string()})}),zte=se.object({method:se.literal("solana_signAllTransactions"),params:se.object({transactions:se.array(se.string())})}),Wte=se.object({method:se.literal("solana_signAndSendTransaction"),params:se.object({transaction:se.string(),options:se.object({skipPreflight:se.boolean().optional(),preflightCommitment:se.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:se.number().optional(),minContextSlot:se.number().optional()}).optional()})}),Hte=se.object({method:se.literal("wallet_sendCalls"),params:se.array(se.object({chainId:se.string().or(se.number()).optional(),from:se.string().optional(),version:se.string().optional(),capabilities:se.any().optional(),calls:se.array(se.object({to:se.string().startsWith("0x"),data:se.string().startsWith("0x").optional(),value:se.string().optional()}))}))}),qte=se.object({method:se.literal("wallet_getCallsStatus"),params:se.array(se.string())}),Vte=se.object({method:se.literal("wallet_getCapabilities")}),Kte=se.object({method:se.literal("wallet_grantPermissions"),params:se.array(se.any())}),nR=se.object({token:se.string()}),Et=se.object({id:se.string().optional()}),cm={appEvent:Et.extend({type:At("APP_SWITCH_NETWORK"),payload:Mee}).or(Et.extend({type:At("APP_CONNECT_EMAIL"),payload:$ee})).or(Et.extend({type:At("APP_CONNECT_DEVICE")})).or(Et.extend({type:At("APP_CONNECT_OTP"),payload:Oee})).or(Et.extend({type:At("APP_CONNECT_SOCIAL"),payload:Dee})).or(Et.extend({type:At("APP_GET_FARCASTER_URI")})).or(Et.extend({type:At("APP_CONNECT_FARCASTER")})).or(Et.extend({type:At("APP_GET_USER"),payload:se.optional(Lee)})).or(Et.extend({type:At("APP_GET_SOCIAL_REDIRECT_URI"),payload:Bee})).or(Et.extend({type:At("APP_SIGN_OUT")})).or(Et.extend({type:At("APP_IS_CONNECTED"),payload:se.optional(nR)})).or(Et.extend({type:At("APP_GET_CHAIN_ID")})).or(Et.extend({type:At("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(Et.extend({type:At("APP_INIT_SMART_ACCOUNT")})).or(Et.extend({type:At("APP_SET_PREFERRED_ACCOUNT"),payload:Hee})).or(Et.extend({type:At("APP_RPC_REQUEST"),payload:tR.or(rR).or(ste).or(ote).or(ate).or(cte).or(lte).or(ute).or(dte).or(fte).or(hte).or(pte).or(gte).or(mte).or(wte).or(vte).or(yte).or(bte).or(xte).or(Cte).or(_te).or(Ate).or(Ete).or(Ste).or(Ite).or(Tte).or(kte).or(Rte).or(Pte).or(Nte).or(Mte).or($te).or(Ote).or(Dte).or(Lte).or(Bte).or(tR).or(Ute).or(rR).or(jte).or(Fte).or(zte).or(Wte).or(qte).or(Hte).or(Vte).or(Kte)})).or(Et.extend({type:At("APP_UPDATE_EMAIL"),payload:Uee})).or(Et.extend({type:At("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:jee})).or(Et.extend({type:At("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:Fee})).or(Et.extend({type:At("APP_SYNC_THEME"),payload:zee})).or(Et.extend({type:At("APP_SYNC_DAPP_DATA"),payload:Wee})),frameEvent:Et.extend({type:At("FRAME_SWITCH_NETWORK_ERROR"),payload:Fn}).or(Et.extend({type:At("FRAME_SWITCH_NETWORK_SUCCESS"),payload:ete})).or(Et.extend({type:At("FRAME_CONNECT_EMAIL_SUCCESS"),payload:qee})).or(Et.extend({type:At("FRAME_CONNECT_EMAIL_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:Vee})).or(Et.extend({type:At("FRAME_GET_FARCASTER_URI_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:Kee})).or(Et.extend({type:At("FRAME_CONNECT_FARCASTER_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_CONNECT_OTP_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_CONNECT_OTP_SUCCESS")})).or(Et.extend({type:At("FRAME_CONNECT_DEVICE_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_CONNECT_DEVICE_SUCCESS")})).or(Et.extend({type:At("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:Gee})).or(Et.extend({type:At("FRAME_CONNECT_SOCIAL_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_GET_USER_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_GET_USER_SUCCESS"),payload:Qee})).or(Et.extend({type:At("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:Yee})).or(Et.extend({type:At("FRAME_SIGN_OUT_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_SIGN_OUT_SUCCESS")})).or(Et.extend({type:At("FRAME_IS_CONNECTED_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_IS_CONNECTED_SUCCESS"),payload:Jee})).or(Et.extend({type:At("FRAME_GET_CHAIN_ID_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_GET_CHAIN_ID_SUCCESS"),payload:Xee})).or(Et.extend({type:At("FRAME_RPC_REQUEST_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_RPC_REQUEST_SUCCESS"),payload:ite})).or(Et.extend({type:At("FRAME_SESSION_UPDATE"),payload:nR})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SUCCESS"),payload:Zee})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:tte})).or(Et.extend({type:At("FRAME_SYNC_THEME_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_SYNC_THEME_SUCCESS")})).or(Et.extend({type:At("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(Et.extend({type:At("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:rte})).or(Et.extend({type:At("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Fn})).or(Et.extend({type:At("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:nte})).or(Et.extend({type:At("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Fn}))},Gi={set(t,e){Xi.isClient&&localStorage.setItem(`${Mt.STORAGE_KEY}${t}`,e)},get(t){return Xi.isClient?localStorage.getItem(`${Mt.STORAGE_KEY}${t}`):null},delete(t,e){Xi.isClient&&(e?localStorage.removeItem(t):localStorage.removeItem(`${Mt.STORAGE_KEY}${t}`))}},iR={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},py=30*1e3,Xi={checkIfAllowedToTriggerEmail(){const t=Gi.get(Mt.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e{function a({data:c}){var d;if(!((d=c.type)!=null&&d.includes(Mt.FRAME_EVENT_KEY)))return;const l=cm.frameEvent.parse(c);l.id===i&&(s(l),window.removeEventListener("message",a))}Xi.isClient&&(window.addEventListener("message",a),o.addEventListener("abort",()=>{window.removeEventListener("message",a)}))},onFrameEvent:i=>{Xi.isClient&&window.addEventListener("message",({data:s})=>{var a;if(!((a=s.type)!=null&&a.includes(Mt.FRAME_EVENT_KEY)))return;const o=cm.frameEvent.parse(s);i(o)})},onAppEvent:i=>{Xi.isClient&&window.addEventListener("message",({data:s})=>{var a;if(!((a=s.type)!=null&&a.includes(Mt.APP_EVENT_KEY)))return;const o=cm.appEvent.parse(s);i(o)})},postAppEvent:i=>{var s;if(Xi.isClient){if(!((s=this.iframe)!=null&&s.contentWindow))throw new Error("W3mFrame: iframe is not set");cm.appEvent.parse(i),this.iframe.contentWindow.postMessage(i,"*")}},postFrameEvent:i=>{if(Xi.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");cm.frameEvent.parse(i),parent.postMessage(i,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((i,s)=>{this.frameLoadPromiseResolver={resolve:i,reject:s}}),r&&(this.frameLoadPromise=new Promise((i,s)=>{this.frameLoadPromiseResolver={resolve:i,reject:s}}),Xi.isClient)){const i=document.createElement("iframe");i.id="w3m-iframe",i.src=`${MX}?projectId=${e}&chainId=${n}`,i.name="w3m-secure-iframe",i.style.position="fixed",i.style.zIndex="999999",i.style.display="none",i.style.animationDelay="0s, 50ms",i.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",i.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(i),this.iframe=i,this.iframe.onload=()=>{var s;(s=this.frameLoadPromiseResolver)==null||s.resolve(void 0)},this.iframe.onerror=()=>{var s;(s=this.frameLoadPromiseResolver)==null||s.reject("Unable to load email login dependency")}}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r=>({[r]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,chainId:r}}));return Object.assign({},...e)}}function Zte(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var Qte=Yte;function Yte(t,e,r){var n=r&&r.stringify||Zte,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?f:0,t.charCodeAt(v+1)){case 100:case 102:if(d>=c||e[d]==null)break;f=c||e[d]==null)break;f=c||e[d]===void 0)break;f",f=v+2,v++;break}l+=n(e[d]),f=v+2,v++;break;case 115:if(d>=c)break;f-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=zw),Object.defineProperty(c,"levelVal",{get:d}),Object.defineProperty(c,"level",{get:f,set:g});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:ire(t)};c.levels=al.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=zw,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=v,e&&(c._logEvent=lC());function d(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function g(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,lp(l,c,"error","log"),lp(l,c,"fatal","error"),lp(l,c,"warn","error"),lp(l,c,"info","log"),lp(l,c,"debug","log"),lp(l,c,"trace","log")}function v(x,P){if(!x)throw new Error("missing bindings for child Pino");P=P||{},i&&x.serializers&&(P.serializers=x.serializers);const M=P.serializers;if(i&&M){var N=Object.assign({},n,M),E=t.browser.serialize===!0?Object.keys(N):i;delete x.serializers,$6([x],E,N,this._stdErrSerialize)}function $(L){this._childLevel=(L._childLevel|0)+1,this.error=up(L,x,"error"),this.fatal=up(L,x,"fatal"),this.warn=up(L,x,"warn"),this.info=up(L,x,"info"),this.debug=up(L,x,"debug"),this.trace=up(L,x,"trace"),N&&(this.serializers=N,this._serialize=E),e&&(this._logEvent=lC([].concat(L._logEvent.bindings,x)))}return $.prototype=this,new $(this)}return c}al.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"}};al.stdSerializers=Jte;al.stdTimeFunctions=Object.assign({},{nullTime:IL,epochTime:TL,unixTime:sre,isoTime:ore});function lp(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?zw:i[r]?i[r]:Fw[r]||Fw[n]||zw,ere(t,e,r)}function ere(t,e,r){!t.transmit&&e[r]===zw||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Fw?Fw:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function up(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;iJSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),lre=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 jh(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return lre(t)}catch{return t}}function Ru(t){return typeof t=="string"?t:cre(t)||""}const ure={level:"info"},r2="custom_context",VA=1e3*1024;let dre=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},oR=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new dre(e);if(r.size>this.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}}}}},kL=class{constructor(e,r=VA){this.level=e??"error",this.levelValue=pp.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new oR(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===pp.levels.values.error?console.error(e):r===pp.levels.values.warn?console.warn(e):r===pp.levels.values.debug?console.debug(e):r===pp.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Ru({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 oR(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Ru({extraMetadata:e})),new Blob(r,{type:"application/json"})}},fre=class{constructor(e,r=VA){this.baseChunkLogger=new kL(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)}},hre=class{constructor(e,r=VA){this.baseChunkLogger=new kL(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 pre=Object.defineProperty,gre=Object.defineProperties,mre=Object.getOwnPropertyDescriptors,aR=Object.getOwnPropertySymbols,wre=Object.prototype.hasOwnProperty,vre=Object.prototype.propertyIsEnumerable,cR=(t,e,r)=>e in t?pre(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i5=(t,e)=>{for(var r in e||(e={}))wre.call(e,r)&&cR(t,r,e[r]);if(aR)for(var r of aR(e))vre.call(e,r)&&cR(t,r,e[r]);return t},s5=(t,e)=>gre(t,mre(e));function n2(t){return s5(i5({},t),{level:(t==null?void 0:t.level)||ure.level})}function yre(t,e=r2){return t[e]||""}function bre(t,e,r=r2){return t[r]=e,t}function io(t,e=r2){let r="";return typeof t.bindings>"u"?r=yre(t,e):r=t.bindings().context||"",r}function xre(t,e,r=r2){const n=io(t,r);return n.trim()?`${n}/${e}`:e}function is(t,e,r=r2){const n=xre(t,e,r),i=t.child({context:n});return bre(i,n,r)}function Cre(t){var e,r;const n=new fre((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:t2(s5(i5({},t.opts),{level:"trace",browser:s5(i5({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function _re(t){var e;const r=new hre((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:t2(s5(i5({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function RL(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Cre(t):_re(t)}class Are{constructor(e){var s;const r=n2({level:$X}),{logger:n,chunkLoggerController:i}=RL({opts:r});this.logger=is(n,this.constructor.name),this.chunkLoggerController=i,typeof window<"u"&&((s=this.chunkLoggerController)!=null&&s.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class Ere{constructor(e,r){this.openRpcRequests=[],this.w3mLogger=new Are(e),this.w3mFrame=new Gte(e,!0,r)}getLoginEmailUsed(){return!!Gi.get(Mt.EMAIL_LOGIN_USED_KEY)}getEmail(){return Gi.get(Mt.EMAIL)}async connectEmail(e){try{Xi.checkIfAllowedToTriggerEmail();const r=await this.appEvent({type:Mt.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting email"),r}}async connectDevice(){try{return this.appEvent({type:Mt.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:Mt.APP_CONNECT_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting otp"),r}}async isConnected(){try{const e=await this.appEvent({type:Mt.APP_IS_CONNECTED});return e.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{const e=await this.appEvent({type:Mt.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return this.appEvent({type:Mt.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error getting social redirect uri"),r}}async updateEmail(e){try{const r=await this.appEvent({type:Mt.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email"),r}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:Mt.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email primary otp"),r}}async updateEmailSecondaryOtp(e){try{const r=await this.appEvent({type:Mt.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(r.newEmail),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email secondary otp"),r}}async syncTheme(e){try{return this.appEvent({type:Mt.APP_SYNC_THEME,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing theme"),r}}async syncDappData(e){try{return this.appEvent({type:Mt.APP_SYNC_DAPP_DATA,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing dapp data"),r}}async getSmartAccountEnabledNetworks(){try{const e=await this.appEvent({type:Mt.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:Mt.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error setting preferred account"),r}}async connect(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,n=await this.appEvent({type:Mt.APP_GET_USER,payload:{...e,chainId:r}});return this.setLoginSuccess(n.email),this.setLastUsedChainId(n.chainId),n}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async getUser(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1;return await this.appEvent({type:Mt.APP_GET_USER,payload:{...e,chainId:r}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async connectSocial(e){try{const r=await this.appEvent({type:Mt.APP_CONNECT_SOCIAL,payload:{uri:e}});return r.userName&&this.setSocialLoginSuccess(r.userName),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting social"),r}}async getFarcasterUri(){try{return await this.appEvent({type:Mt.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{const e=await this.appEvent({type:Mt.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork(e){try{const r=await this.appEvent({type:Mt.APP_SWITCH_NETWORK,payload:{chainId:e}});return this.setLastUsedChainId(r.chainId),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error switching network"),r}}async disconnect(){try{const e=await this.appEvent({type:Mt.APP_SIGN_OUT});return this.deleteAuthLoginCache(),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error disconnecting"),e}}async request(e){var r,n,i;try{if(lr.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();(r=this.rpcRequestHandler)==null||r.call(this,e);const s=await this.appEvent({type:Mt.APP_RPC_REQUEST,payload:e});return(n=this.rpcSuccessHandler)==null||n.call(this,s,e),s}catch(s){throw(i=this.rpcErrorHandler)==null||i.call(this,s,e),this.w3mLogger.logger.error({error:s},"Error requesting"),s}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_IS_CONNECTED_SUCCESS&&r.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_IS_CONNECTED_ERROR&&e(),r.type===Mt.FRAME_IS_CONNECTED_SUCCESS&&!r.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_GET_USER_SUCCESS&&e(r.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(r.payload):r.type===Mt.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:lr.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(r.payload.smartAccountEnabledNetworks):r.type===Mt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){try{this.openRpcRequests.forEach(({abortController:e,method:r})=>{lr.SAFE_RPC_METHODS.includes(r)||e.abort()}),this.openRpcRequests=[]}catch(e){this.w3mLogger.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){await this.w3mFrame.frameLoadPromise;const r=e.type.replace("@w3m-app/","");return new Promise((n,i)=>{var c,l;const s=Math.random().toString(36).substring(7);(l=(c=this.w3mLogger.logger).info)==null||l.call(c,{event:e,id:s},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:s});const o=new AbortController;if(r==="RPC_REQUEST"){const d=e;this.openRpcRequests=[...this.openRpcRequests,{...d.payload,abortController:o}]}o.signal.addEventListener("abort",()=>{r==="RPC_REQUEST"&&i(new Error("Request was aborted"))});function a(d,f){var g,v,x;d.id===s&&((v=(g=f.logger).info)==null||v.call(g,{framEvent:d,id:s},"Received frame response"),d.type===`@w3m-frame/${r}_SUCCESS`?("payload"in d&&n(d.payload),n(void 0)):d.type===`@w3m-frame/${r}_ERROR`&&("payload"in d&&i(new Error(((x=d.payload)==null?void 0:x.message)||"An error occurred")),i(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(s,d=>a(d,this.w3mLogger),o.signal)})}setNewLastEmailLoginTime(){Gi.set(Mt.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Gi.set(Mt.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Gi.set(Mt.EMAIL,e),Gi.set(Mt.EMAIL_LOGIN_USED_KEY,"true"),Gi.delete(Mt.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Gi.delete(Mt.EMAIL_LOGIN_USED_KEY),Gi.delete(Mt.EMAIL),Gi.delete(Mt.LAST_USED_CHAIN_KEY),Gi.delete(Mt.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Gi.set(Mt.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Gi.get(Mt.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){Gi.set(Mt.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}const Xr=Rn({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),ri={state:Xr,subscribe(t){return bs(Xr,()=>t(Xr))},setLastNetworkInView(t){Xr.lastNetworkInView=t},async fetchTransactions(t,e){var n;const{projectId:r}=qe.state;if(!r||!t)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");Xr.loading=!0;try{const i=await bn.fetchTransactions({account:t,projectId:r,cursor:Xr.next,onramp:e,cache:e==="coinbase"?"no-cache":void 0,chainId:(n=ge.state.activeCaipNetwork)==null?void 0:n.id}),s=this.filterSpamTransactions(i.data),o=this.filterByConnectedChain(s),a=[...Xr.transactions,...o];Xr.loading=!1,e==="coinbase"?Xr.coinbaseTransactions=this.groupTransactionsByYearAndMonth(Xr.coinbaseTransactions,i.data):(Xr.transactions=a,Xr.transactionsByYear=this.groupTransactionsByYearAndMonth(Xr.transactionsByYear,o)),Xr.empty=a.length===0,Xr.next=i.next?i.next:void 0}catch{ot.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:r,cursor:Xr.next,isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),St.showError("Failed to fetch transactions"),Xr.loading=!1,Xr.empty=!0,Xr.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const r=t;return e.forEach(n=>{const i=new Date(n.metadata.minedAt).getFullYear(),s=new Date(n.metadata.minedAt).getMonth(),o=r[i]??{},c=(o[s]??[]).filter(l=>l.id!==n.id);r[i]={...o,[s]:[...c,n].sort((l,d)=>new Date(d.metadata.minedAt).getTime()-new Date(l.metadata.minedAt).getTime())}}),r},filterSpamTransactions(t){return t.filter(e=>!e.transfers.every(n=>{var i;return((i=n.nft_info)==null?void 0:i.flags.is_spam)===!0}))},filterByConnectedChain(t){var n;const e=(n=ge.state.activeCaipNetwork)==null?void 0:n.id;return t.filter(i=>i.metadata.chain===e)},clearCursor(){Xr.next=void 0},resetTransactions(){Xr.transactions=[],Xr.transactionsByYear={},Xr.lastNetworkInView=void 0,Xr.loading=!1,Xr.empty=!1,Xr.next=void 0}},Xl=Rn({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),vn={state:Xl,subscribe(t){return bs(Xl,()=>t(Xl))},setThemeMode(t){Xl.themeMode=t;try{const e=ut.getAuthConnector();if(e){const r=vn.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:t,themeVariables:r,w3mThemeVariables:wu(r,t)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(t){Xl.themeVariables={...Xl.themeVariables,...t};try{const e=ut.getAuthConnector();if(e){const r=vn.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:r,w3mThemeVariables:wu(Xl.themeVariables,Xl.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return iC(Xl)}},za=Rn({allConnectors:[],connectors:[]}),ut={state:za,subscribeKey(t,e){return Ts(za,t,e)},setConnectors(t){const e=t.filter(r=>!za.allConnectors.some(n=>n.id===r.id&&this.getConnectorName(n.name)===this.getConnectorName(r.name)&&n.chain===r.chain));za.allConnectors=[...za.connectors,...e],za.connectors=this.mergeMultiChainConnectors(za.allConnectors)},mergeMultiChainConnectors(t){const e=this.generateConnectorMapByName(t),r=[];return e.forEach(n=>{const i=n[0],s=(i==null?void 0:i.id)==="w3mAuth";n.length>1?r.push({name:i==null?void 0:i.name,imageUrl:i==null?void 0:i.imageUrl,imageId:i==null?void 0:i.imageId,connectors:[...n],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&r.push(i)}),r},generateConnectorMapByName(t){const e=new Map;return t.forEach(r=>{const{name:n}=r,i=this.getConnectorName(n);if(!i)return;const s=e.get(i)||[];s.find(a=>a.chain===r.chain)||s.push(r),e.set(i,s)}),e},getConnectorName(t){return t&&({"Trust Wallet":"Trust"}[t]||t)},getUniqueConnectorsByName(t){const e=[];return t.forEach(r=>{e.find(n=>n.chain===r.chain)||e.push(r)}),e},addConnector(t){var e,r;if(t.id==="w3mAuth"){const n=t,i=iC(qe.state),s=vn.getSnapshot().themeMode,o=vn.getSnapshot().themeVariables;(r=(e=n==null?void 0:n.provider)==null?void 0:e.syncDappData)==null||r.call(e,{metadata:i.metadata,sdkVersion:i.sdkVersion,projectId:i.projectId,sdkType:i.sdkType}),n.provider.syncTheme({themeMode:s,themeVariables:o,w3mThemeVariables:wu(o,s)}),this.setConnectors([t])}else this.setConnectors([t])},getAuthConnector(){var r;const t=ge.state.activeChain,e=za.connectors.find(n=>n.id==="w3mAuth");if(e)return(r=e==null?void 0:e.connectors)!=null&&r.length?e.connectors.find(i=>i.chain===t):e},getAnnouncedConnectorRdns(){return za.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectors(){return za.connectors},getConnector(t,e){return za.connectors.find(r=>{var n;return r.explorerId===t||((n=r.info)==null?void 0:n.rdns)===e})},syncIfAuthConnector(t){var s,o;if(t.id!=="w3mAuth")return;const e=t,r=iC(qe.state),n=vn.getSnapshot().themeMode,i=vn.getSnapshot().themeVariables;(o=(s=e==null?void 0:e.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),e.provider.syncTheme({themeMode:n,themeVariables:i,w3mThemeVariables:wu(i,n)})}},ls=Rn({wcError:!1,buffering:!1,status:"disconnected"}),Lt={state:ls,subscribeKey(t,e){return Ts(ls,t,e)},_getClient(t){return ge.getConnectionControllerClient(t)},setClient(t){ls._client=sc(t)},async connectWalletConnect(){var t,e,r,n;vr.setConnectedConnector("WALLET_CONNECT"),await((n=(r=(e=(t=ge.state)==null?void 0:t.universalAdapter)==null?void 0:e.connectionControllerClient)==null?void 0:r.connectWalletConnect)==null?void 0:n.call(r,i=>{ls.wcUri=i,ls.wcPairingExpiry=Ue.getPairingExpiry()}))},async connectExternal(t,e,r=!0){var n,i;await((i=(n=this._getClient(e)).connectExternal)==null?void 0:i.call(n,t)),r&&(ge.setActiveNamespace(e),vr.setConnectedConnector(t.type))},async reconnectExternal(t){var e,r;await((r=(e=this._getClient()).reconnectExternal)==null?void 0:r.call(e,t)),vr.setConnectedConnector(t.type)},async setPreferredAccountType(t){var r;jt.setLoading(!0);const e=ut.getAuthConnector();e&&(await(e==null?void 0:e.provider.setPreferredAccount(t)),await this.reconnectExternal(e),jt.setLoading(!1),ot.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:t,network:((r=ge.state.activeCaipNetwork)==null?void 0:r.id)||""}}))},async signMessage(t){return this._getClient().signMessage(t)},parseUnits(t,e){return this._getClient().parseUnits(t,e)},formatUnits(t,e){return this._getClient().formatUnits(t,e)},async sendTransaction(t){return this._getClient().sendTransaction(t)},async estimateGas(t){return this._getClient().estimateGas(t)},async writeContract(t){return this._getClient().writeContract(t)},async getEnsAddress(t){return this._getClient().getEnsAddress(t)},async getEnsAvatar(t){return this._getClient().getEnsAvatar(t)},checkInstalled(t,e){var r,n;return((n=(r=this._getClient(e)).checkInstalled)==null?void 0:n.call(r,t))||!1},resetWcConnection(){ls.wcUri=void 0,ls.wcPairingExpiry=void 0,ls.wcLinking=void 0,ls.recentWallet=void 0,ri.resetTransactions(),vr.deleteWalletConnectDeepLink()},setWcLinking(t){ls.wcLinking=t},setWcError(t){ls.wcError=t,ls.buffering=!1},setRecentWallet(t){ls.recentWallet=t},setBuffering(t){ls.buffering=t},setStatus(t){ls.status=t},async disconnect(){const t=this._getClient();try{await(t==null?void 0:t.disconnect()),this.resetWcConnection()}catch{throw new Error("Failed to disconnect")}}},Mm={async getTokenList(){var n;const t=ge.state.activeCaipNetwork,e=await bn.fetchSwapTokens({chainId:t==null?void 0:t.id,projectId:qe.state.projectId});return((n=e==null?void 0:e.tokens)==null?void 0:n.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){const t=qe.state.projectId,e=ge.state.activeCaipNetwork;if(!e)return null;try{switch(e.chainNamespace){case"solana":const r=(await Lt.estimateGas({chainNamespace:"solana"})).toString();return{standard:r,fast:r,instant:r};case"eip155":default:return await bn.fetchGasPrice({projectId:t,chainId:e.id})}}catch{return null}},async fetchSwapAllowance({tokenAddress:t,userAddress:e,sourceTokenAmount:r,sourceTokenDecimals:n}){const i=qe.state.projectId,s=await bn.fetchSwapAllowance({projectId:i,tokenAddress:t,userAddress:e});if(s!=null&&s.allowance&&r&&n){const o=Lt.parseUnits(r,n)||0;return BigInt(s.allowance)>=o}return!1},async getMyTokensWithBalance(t){const e=Se.state.address,r=ge.state.activeCaipNetwork;if(!e||!r)return[];const i=(await bn.getBalance(e,r.id,t)).balances.filter(s=>s.quantity.decimals!=="0");return Se.setTokenBalance(i,ge.state.activeChain),this.mapBalancesToSwapTokens(i)},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:Zt.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},en=Rn({view:"Connect",history:["Connect"],transactionStack:[]}),Ae={state:en,subscribeKey(t,e){return Ts(en,t,e)},pushTransactionStack(t){en.transactionStack.push(t)},popTransactionStack(t){var r,n;const e=en.transactionStack.pop();if(e)if(t)this.goBack(),(r=e==null?void 0:e.onCancel)==null||r.call(e);else{if(e.goBack)this.goBack();else if(e.replace){const s=en.history.indexOf("ConnectingSiwe");s>0?this.goBackToIndex(s-1):(jt.close(),en.history=[])}else e.view&&this.reset(e.view);(n=e==null?void 0:e.onSuccess)==null||n.call(e)}},push(t,e){t!==en.view&&(en.view=t,en.history.push(t),en.data=e)},reset(t){en.view=t,en.history=[t]},replace(t,e){en.history.at(-1)===t||(en.view=t,en.history[en.history.length-1]=t,en.data=e)},goBack(){if(en.history.length>1){en.history.pop();const[t]=en.history.slice(-1);t&&(en.view=t)}else jt.close()},goBackToIndex(t){if(en.history.length>1){en.history=en.history.slice(0,t+1);const[e]=en.history.slice(-1);e&&(en.view=e)}}},ou={getGasPriceInEther(t,e){const r=e*t;return Number(r)/1e18},getGasPriceInUSD(t,e,r){const n=ou.getGasPriceInEther(e,r);return Pr.bigNumber(t).multipliedBy(n).toNumber()},getPriceImpact({sourceTokenAmount:t,sourceTokenPriceInUSD:e,toTokenPriceInUSD:r,toTokenAmount:n}){const i=Pr.bigNumber(t).multipliedBy(e),s=Pr.bigNumber(n).multipliedBy(r);return i.minus(s).dividedBy(i).multipliedBy(100).toNumber()},getMaxSlippage(t,e){const r=Pr.bigNumber(t).dividedBy(100);return Pr.multiply(e,r).toNumber()},getProviderFee(t,e=.0085){return Pr.bigNumber(t).multipliedBy(e).toString()},isInsufficientNetworkTokenForGas(t,e){const r=e||"0";return Pr.bigNumber(t).isZero()?!0:Pr.bigNumber(Pr.bigNumber(r)).isGreaterThan(t)},isInsufficientSourceTokenForSwap(t,e,r){var s,o;const n=(o=(s=r==null?void 0:r.find(a=>a.address===e))==null?void 0:s.quantity)==null?void 0:o.numeric;return Pr.bigNumber(n||"0").isLessThan(t)},getToTokenAmount({sourceToken:t,toToken:e,sourceTokenPrice:r,toTokenPrice:n,sourceTokenAmount:i}){if(i==="0"||!t||!e)return"0";const s=t.decimals,o=r,a=e.decimals,c=n;if(c<=0)return"0";const l=Pr.bigNumber(i).multipliedBy(.0085),f=Pr.bigNumber(i).minus(l).multipliedBy(Pr.bigNumber(10).pow(s)),g=Pr.bigNumber(o).dividedBy(c),v=s-a;return f.multipliedBy(g).dividedBy(Pr.bigNumber(10).pow(v)).dividedBy(Pr.bigNumber(10).pow(a)).toFixed(a).toString()}},lR=15e4,Sre=6,Bs={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:Tn.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},Ie=Rn(Bs),et={state:Ie,subscribe(t){return bs(Ie,()=>t(Ie))},subscribeKey(t,e){return Ts(Ie,t,e)},getParams(){var a,c,l,d,f,g,v,x;const t=ge.state.activeCaipAddress,e=Ue.getPlainAddress(t),r=Zt.getActiveNetworkTokenAddress(),n=vr.getConnectedConnector();if(!e)throw new Error("No address found to swap the tokens from.");const i=!((a=Ie.toToken)!=null&&a.address)||!((c=Ie.toToken)!=null&&c.decimals),s=!((l=Ie.sourceToken)!=null&&l.address)||!((d=Ie.sourceToken)!=null&&d.decimals)||!Pr.bigNumber(Ie.sourceTokenAmount).isGreaterThan(0),o=!Ie.sourceTokenAmount;return{networkAddress:r,fromAddress:e,fromCaipAddress:t,sourceTokenAddress:(f=Ie.sourceToken)==null?void 0:f.address,toTokenAddress:(g=Ie.toToken)==null?void 0:g.address,toTokenAmount:Ie.toTokenAmount,toTokenDecimals:(v=Ie.toToken)==null?void 0:v.decimals,sourceTokenAmount:Ie.sourceTokenAmount,sourceTokenDecimals:(x=Ie.sourceToken)==null?void 0:x.decimals,invalidToToken:i,invalidSourceToken:s,invalidSourceTokenAmount:o,availableToSwap:t&&!i&&!s&&!o,isAuthConnector:n==="AUTH"}},setSourceToken(t){if(!t){Ie.sourceToken=t,Ie.sourceTokenAmount="",Ie.sourceTokenPriceInUSD=0;return}Ie.sourceToken=t,this.setTokenPrice(t.address,"sourceToken")},setSourceTokenAmount(t){Ie.sourceTokenAmount=t},setToToken(t){if(!t){Ie.toToken=t,Ie.toTokenAmount="",Ie.toTokenPriceInUSD=0;return}Ie.toToken=t,this.setTokenPrice(t.address,"toToken")},setToTokenAmount(t){Ie.toTokenAmount=t?Pr.formatNumberToLocalString(t,Sre):""},async setTokenPrice(t,e){const{availableToSwap:r}=this.getParams();let n=Ie.tokensPriceMap[t]||0;n||(Ie.loadingPrices=!0,n=await this.getAddressPrice(t)),e==="sourceToken"?Ie.sourceTokenPriceInUSD=n:e==="toToken"&&(Ie.toTokenPriceInUSD=n),Ie.loadingPrices&&(Ie.loadingPrices=!1,r&&this.swapTokens())},switchTokens(){if(Ie.initializing||!Ie.initialized)return;const t=Ie.toToken?{...Ie.toToken}:void 0,e=Ie.sourceToken?{...Ie.sourceToken}:void 0,r=t&&Ie.toTokenAmount===""?"1":Ie.toTokenAmount;this.setSourceToken(t),this.setToToken(e),this.setSourceTokenAmount(r),this.setToTokenAmount(""),this.swapTokens()},resetState(){Ie.myTokensWithBalance=Bs.myTokensWithBalance,Ie.tokensPriceMap=Bs.tokensPriceMap,Ie.initialized=Bs.initialized,Ie.sourceToken=Bs.sourceToken,Ie.sourceTokenAmount=Bs.sourceTokenAmount,Ie.sourceTokenPriceInUSD=Bs.sourceTokenPriceInUSD,Ie.toToken=Bs.toToken,Ie.toTokenAmount=Bs.toTokenAmount,Ie.toTokenPriceInUSD=Bs.toTokenPriceInUSD,Ie.networkPrice=Bs.networkPrice,Ie.networkTokenSymbol=Bs.networkTokenSymbol,Ie.networkBalanceInUSD=Bs.networkBalanceInUSD,Ie.inputError=Bs.inputError},resetValues(){var r;const{networkAddress:t}=this.getParams(),e=(r=Ie.tokens)==null?void 0:r.find(n=>n.address===t);this.setSourceToken(e),this.setToToken(void 0)},getApprovalLoadingState(){return Ie.loadingApprovalTransaction},clearError(){Ie.transactionError=void 0},async initializeState(){if(!Ie.initializing){if(Ie.initializing=!0,!Ie.initialized)try{await this.fetchTokens(),Ie.initialized=!0}catch{Ie.initialized=!1,St.showError("Failed to initialize swap"),Ae.goBack()}Ie.initializing=!1}},async fetchTokens(){var r;const{networkAddress:t}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const e=(r=Ie.tokens)==null?void 0:r.find(n=>n.address===t);e&&(Ie.networkTokenSymbol=e.symbol,this.setSourceToken(e),this.setSourceTokenAmount("1"))},async getTokenList(){const t=await Mm.getTokenList();Ie.tokens=t,Ie.popularTokens=t.sort((e,r)=>e.symbolr.symbol?1:0),Ie.suggestedTokens=t.filter(e=>!!Tn.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(t){var c,l;const e=Ie.tokensPriceMap[t];if(e)return e;const n=(await bn.fetchTokenPrice({projectId:qe.state.projectId,addresses:[t]})).fungibles||[],i=[...Ie.tokens||[],...Ie.myTokensWithBalance||[]],s=(c=i==null?void 0:i.find(d=>d.address===t))==null?void 0:c.symbol,o=((l=n.find(d=>d.symbol.toLowerCase()===(s==null?void 0:s.toLowerCase())))==null?void 0:l.price)||0,a=parseFloat(o.toString());return Ie.tokensPriceMap[t]=a,a},async getNetworkTokenPrice(){var i;const{networkAddress:t}=this.getParams(),r=(i=(await bn.fetchTokenPrice({projectId:qe.state.projectId,addresses:[t]}).catch(()=>(St.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:i[0],n=(r==null?void 0:r.price.toString())||"0";Ie.tokensPriceMap[t]=parseFloat(n),Ie.networkTokenSymbol=(r==null?void 0:r.symbol)||"",Ie.networkPrice=n},async getMyTokensWithBalance(t){const e=await Mm.getMyTokensWithBalance(t);e&&(await this.getInitialGasPrice(),this.setBalances(e))},setBalances(t){const{networkAddress:e}=this.getParams(),r=ge.state.activeCaipNetwork;if(!r)return;const n=t.find(i=>i.address===e);t.forEach(i=>{Ie.tokensPriceMap[i.address]=i.price||0}),Ie.myTokensWithBalance=t.filter(i=>i.address.startsWith(r.id)),Ie.networkBalanceInUSD=n?Pr.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var e,r;const t=await Mm.fetchGasPrice();if(!t)return{gasPrice:null,gasPriceInUSD:null};switch((r=(e=ge.state)==null?void 0:e.activeCaipNetwork)==null?void 0:r.chainNamespace){case"solana":return Ie.gasFee=t.standard,Ie.gasPriceInUSD=Pr.multiply(t.standard,Ie.networkPrice).dividedBy(1e9).toNumber(),{gasPrice:BigInt(Ie.gasFee),gasPriceInUSD:Number(Ie.gasPriceInUSD)};case"eip155":default:const n=t.standard,i=BigInt(n),s=BigInt(lR),o=ou.getGasPriceInUSD(Ie.networkPrice,s,i);return Ie.gasFee=n,Ie.gasPriceInUSD=o,{gasPrice:i,gasPriceInUSD:o}}},async swapTokens(){var l,d;const t=Se.state.address,e=Ie.sourceToken,r=Ie.toToken,n=Pr.bigNumber(Ie.sourceTokenAmount).isGreaterThan(0);if(!r||!e||Ie.loadingPrices||!n)return;Ie.loadingQuote=!0;const i=Pr.bigNumber(Ie.sourceTokenAmount).multipliedBy(10**e.decimals),s=await bn.fetchSwapQuote({userAddress:t,projectId:qe.state.projectId,from:e.address,to:r.address,gasPrice:Ie.gasFee,amount:i.toString()});Ie.loadingQuote=!1;const o=(d=(l=s==null?void 0:s.quotes)==null?void 0:l[0])==null?void 0:d.toAmount;if(!o)return;const a=Pr.bigNumber(o).dividedBy(10**r.decimals).toString();this.setToTokenAmount(a),this.hasInsufficientToken(Ie.sourceTokenAmount,e.address)?Ie.inputError="Insufficient balance":(Ie.inputError=void 0,this.setTransactionDetails())},async getTransaction(){const{fromCaipAddress:t,availableToSwap:e}=this.getParams(),r=Ie.sourceToken,n=Ie.toToken;if(!(!t||!e||!r||!n||Ie.loadingQuote))try{Ie.loadingBuildTransaction=!0;const i=await Mm.fetchSwapAllowance({userAddress:t,tokenAddress:r.address,sourceTokenAmount:Ie.sourceTokenAmount,sourceTokenDecimals:r.decimals});let s;return i?s=await this.createSwapTransaction():s=await this.createAllowanceTransaction(),Ie.loadingBuildTransaction=!1,Ie.fetchError=!1,s}catch{Ae.goBack(),St.showError("Failed to check allowance"),Ie.loadingBuildTransaction=!1,Ie.approvalTransaction=void 0,Ie.swapTransaction=void 0,Ie.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:t,fromAddress:e,sourceTokenAddress:r,toTokenAddress:n}=this.getParams();if(!(!t||!n)){if(!r)throw new Error("createAllowanceTransaction - No source token address found.");try{const i=await bn.generateApproveCalldata({projectId:qe.state.projectId,from:r,to:n,userAddress:t}),s=await Lt.estimateGas({address:e,to:Ue.getPlainAddress(i.tx.to),data:i.tx.data}),o={data:i.tx.data,to:Ue.getPlainAddress(i.tx.from),gas:s,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:Ie.toTokenAmount};return Ie.swapTransaction=void 0,Ie.approvalTransaction=o,o}catch{Ae.goBack(),St.showError("Failed to create approval transaction"),Ie.approvalTransaction=void 0,Ie.swapTransaction=void 0,Ie.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:t,fromCaipAddress:e,sourceTokenAmount:r}=this.getParams(),n=Ie.sourceToken,i=Ie.toToken;if(!e||!r||!n||!i)return;const s=Lt.parseUnits(r,n.decimals).toString();try{const o=await bn.generateSwapCalldata({projectId:qe.state.projectId,userAddress:e,from:n.address,to:i.address,amount:s}),a=n.address===t,c=BigInt(o.tx.eip155.gas),l=BigInt(o.tx.eip155.gasPrice),d={data:o.tx.data,to:Ue.getPlainAddress(o.tx.to),gas:c,gasPrice:l,value:BigInt(a?s:"0"),toAmount:Ie.toTokenAmount};return Ie.gasPriceInUSD=ou.getGasPriceInUSD(Ie.networkPrice,c,l),Ie.approvalTransaction=void 0,Ie.swapTransaction=d,d}catch{Ae.goBack(),St.showError("Failed to create transaction"),Ie.approvalTransaction=void 0,Ie.swapTransaction=void 0,Ie.fetchError=!0;return}},async sendTransactionForApproval(t){const{fromAddress:e,isAuthConnector:r}=this.getParams();Ie.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";r?Ae.pushTransactionStack({view:null,goBack:!0,onSuccess(){St.showLoading(n)}}):St.showLoading(n);try{await Lt.sendTransaction({address:e,to:t.to,data:t.data,value:BigInt(t.value),gasPrice:BigInt(t.gasPrice)}),await this.swapTokens(),await this.getTransaction(),Ie.approvalTransaction=void 0,Ie.loadingApprovalTransaction=!1}catch(i){const s=i;Ie.transactionError=s==null?void 0:s.shortMessage,Ie.loadingApprovalTransaction=!1,St.showError((s==null?void 0:s.shortMessage)||"Transaction error")}},async sendTransactionForSwap(t){var o,a,c,l,d,f,g,v,x,P,M,N;if(!t)return;const{fromAddress:e,toTokenAmount:r,isAuthConnector:n}=this.getParams();Ie.loadingTransaction=!0;const i=`Swapping ${(o=Ie.sourceToken)==null?void 0:o.symbol} to ${Pr.formatNumberToLocalString(r,3)} ${(a=Ie.toToken)==null?void 0:a.symbol}`,s=`Swapped ${(c=Ie.sourceToken)==null?void 0:c.symbol} to ${Pr.formatNumberToLocalString(r,3)} ${(l=Ie.toToken)==null?void 0:l.symbol}`;n?Ae.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){St.showLoading(i),et.resetState()}}):St.showLoading("Confirm transaction in your wallet");try{const E=[(d=Ie.sourceToken)==null?void 0:d.address,(f=Ie.toToken)==null?void 0:f.address].join(","),$=await Lt.sendTransaction({address:e,to:t.to,data:t.data,gas:t.gas,gasPrice:BigInt(t.gasPrice),value:t.value});return Ie.loadingTransaction=!1,St.showSuccess(s),ot.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((g=ge.state.activeCaipNetwork)==null?void 0:g.id)||"",swapFromToken:((v=this.state.sourceToken)==null?void 0:v.symbol)||"",swapToToken:((x=this.state.toToken)==null?void 0:x.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),et.resetState(),n||Ae.replace("Account"),et.getMyTokensWithBalance(E),$}catch(E){const $=E;Ie.transactionError=$==null?void 0:$.shortMessage,Ie.loadingTransaction=!1,St.showError(($==null?void 0:$.shortMessage)||"Transaction error"),ot.sendEvent({type:"track",event:"SWAP_ERROR",properties:{network:((P=ge.state.activeCaipNetwork)==null?void 0:P.id)||"",swapFromToken:((M=this.state.sourceToken)==null?void 0:M.symbol)||"",swapToToken:((N=this.state.toToken)==null?void 0:N.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(t,e){const r=ou.isInsufficientSourceTokenForSwap(t,e,Ie.myTokensWithBalance);return ou.isInsufficientNetworkTokenForGas(Ie.networkBalanceInUSD,Ie.gasPriceInUSD)||r},setTransactionDetails(){const{toTokenAddress:t,toTokenDecimals:e}=this.getParams();!t||!e||(Ie.gasPriceInUSD=ou.getGasPriceInUSD(Ie.networkPrice,BigInt(Ie.gasFee),BigInt(lR)),Ie.priceImpact=ou.getPriceImpact({sourceTokenAmount:Ie.sourceTokenAmount,sourceTokenPriceInUSD:Ie.sourceTokenPriceInUSD,toTokenPriceInUSD:Ie.toTokenPriceInUSD,toTokenAmount:Ie.toTokenAmount}),Ie.maxSlippage=ou.getMaxSlippage(Ie.slippage,Ie.toTokenAmount),Ie.providerFee=ou.getProviderFee(Ie.sourceTokenAmount))}},uR=Rn({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),Se={state:uR,replaceState(t){t&&Object.assign(uR,sc(t))},subscribe(t){return ge.subscribeChainProp("accountState",e=>{if(e)return t(e)})},subscribeKey(t,e,r){let n;return ge.subscribeChainProp("accountState",i=>{if(i){const s=i[t];n!==s&&(n=s,e(s))}},r)},setStatus(t,e){ge.setAccountProp("status",t,e)},getCaipAddress(t){return ge.getAccountProp("caipAddress",t)},setProvider(t,e){t&&ge.setAccountProp("provider",t,e)},setCaipAddress(t,e){const r=t?Ue.getPlainAddress(t):void 0;ge.state.activeCaipAddress=t,ge.setAccountProp("caipAddress",t,e),ge.setAccountProp("address",r,e)},setBalance(t,e,r){ge.setAccountProp("balance",t,r),ge.setAccountProp("balanceSymbol",e,r)},setProfileName(t,e){ge.setAccountProp("profileName",t,e)},setProfileImage(t,e){ge.setAccountProp("profileImage",t,e)},setAddressExplorerUrl(t,e){ge.setAccountProp("addressExplorerUrl",t,e)},setSmartAccountDeployed(t,e){ge.setAccountProp("smartAccountDeployed",t,e)},setCurrentTab(t){ge.setAccountProp("currentTab",t,ge.state.activeChain)},setTokenBalance(t,e){t&&ge.setAccountProp("tokenBalance",t,e)},setShouldUpdateToAddress(t,e){ge.setAccountProp("shouldUpdateToAddress",t,e)},setAllAccounts(t,e){ge.setAccountProp("allAccounts",t,e)},addAddressLabel(t,e,r){const n=ge.getAccountProp("addressLabels",r)||new Map;n.set(t,e),ge.setAccountProp("addressLabels",n,r)},removeAddressLabel(t,e){const r=ge.getAccountProp("addressLabels",e)||new Map;r.delete(t),ge.setAccountProp("addressLabels",r,e)},setConnectedWalletInfo(t,e){ge.setAccountProp("connectedWalletInfo",t,e,!1)},setPreferredAccountType(t,e){ge.setAccountProp("preferredAccountType",t,e)},setSocialProvider(t,e){t&&ge.setAccountProp("socialProvider",t,e)},setSocialWindow(t,e){t&&ge.setAccountProp("socialWindow",sc(t),e)},setFarcasterUrl(t,e){t&&ge.setAccountProp("farcasterUrl",t,e)},async fetchTokenBalance(){var i,s;const t=(i=ge.state.activeCaipNetwork)==null?void 0:i.id,e=(s=ge.state.activeCaipNetwork)==null?void 0:s.chainNamespace,r=ge.state.activeCaipAddress,n=r?Ue.getPlainAddress(r):void 0;try{if(n&&t&&e){const o=await bn.getBalance(n,t),a=o.balances.filter(c=>c.quantity.decimals!=="0");this.setTokenBalance(a,e),et.setBalances(Mm.mapBalancesToSwapTokens(o.balances))}}catch{St.showError("Failed to fetch token balance")}},resetAccount(t){ge.resetAccount(t)},setSiweStatus(t){ge.setAccountProp("siweStatus",t,ge.state.activeChain)}},lm=Rn({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0}),vu={state:lm,subscribe(t){return bs(lm,()=>t(lm))},set(t){Object.assign(lm,{...lm,...t})}},dR={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},fR={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},Ut=Rn({chains:oX(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0}}),ge={state:Ut,subscribeKey(t,e){return Ts(Ut,t,e)},subscribeChainProp(t,e,r){let n;return bs(Ut.chains,()=>{var s;const i=r||Ut.activeChain;if(i){const o=(s=Ut.chains.get(i))==null?void 0:s[t];n!==o&&(n=o,e(o))}})},initialize(t){const e=t==null?void 0:t[0];(t==null?void 0:t.length)===0&&(Ut.noAdapters=!0),Ut.noAdapters||(Ut.activeChain=e==null?void 0:e.chainNamespace,vu.set({activeChain:e==null?void 0:e.chainNamespace}),t.forEach(r=>{Ut.chains.set(r.chainNamespace,{chainNamespace:r.chainNamespace,connectionControllerClient:r.connectionControllerClient,networkControllerClient:r.networkControllerClient,adapterType:r.adapterType,accountState:dR,networkState:fR,caipNetworks:r.caipNetworks})}))},initializeUniversalAdapter(t,e){var n,i;if(Ut.universalAdapter=t,e.length===0){const s=vr.getStoredActiveCaipNetwork();try{s?Ut.activeChain=s.chainNamespace:Ut.activeChain=((n=t==null?void 0:t.defaultNetwork)==null?void 0:n.chainNamespace)??((i=t.caipNetworks[0])==null?void 0:i.chainNamespace)}catch(o){console.warn(">>> Error setting active caip network",o)}}[...new Set(t.caipNetworks.map(s=>s.chainNamespace))].forEach(s=>{Ut.chains.set(s,{chainNamespace:s,connectionControllerClient:void 0,networkControllerClient:void 0,adapterType:t.adapterType,accountState:dR,networkState:fR,caipNetworks:t.caipNetworks})})},setChainNetworkData(t,e,r=!1){if(!t)throw new Error("Chain is required to update chain network data");const n=Ut.chains.get(t);n&&(n.networkState=sc({...n.networkState,...e}),Ut.chains.set(t,sc(n)),(r||Ut.chains.size===1||Ut.activeChain===t)&&Zt.replaceState(n.networkState))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const n=Ut.chains.get(t);n&&(n.accountState=sc({...n.accountState,...e}),Ut.chains.set(t,n),(r||Ut.chains.size===1||Ut.activeChain===t)&&(e.caipAddress&&(Ut.activeCaipAddress=e.caipAddress),Se.replaceState(n.accountState)))},setAccountProp(t,e,r,n=!0){this.setChainAccountData(r,{[t]:e},n)},setActiveNamespace(t){var n,i;Ut.activeChain=t;const e=t?Ut.chains.get(t):void 0,r=(n=e==null?void 0:e.networkState)==null?void 0:n.caipNetwork;r!=null&&r.id&&(Ut.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,Ut.activeCaipNetwork=r,sn.setItem(nn.ACTIVE_CAIP_NETWORK_ID,r==null?void 0:r.id),vu.set({activeChain:t,selectedNetworkId:r==null?void 0:r.id}))},setActiveCaipNetwork(t){var r,n;if(!t)return;const e=Ut.chains.get(t.chainNamespace);Ut.activeChain=t.chainNamespace,Ut.activeCaipNetwork=t,Ut.activeCaipAddress=(r=e==null?void 0:e.accountState)==null?void 0:r.caipAddress,e&&(Zt.replaceState(e.networkState),Se.replaceState(e.accountState)),vu.set({activeChain:Ut.activeChain,selectedNetworkId:(n=Ut.activeCaipNetwork)==null?void 0:n.id}),sn.setItem(nn.ACTIVE_CAIP_NETWORK_ID,t.id)},setCaipNetwork(t,e,r=!1){var n;Ut.activeChain=e==null?void 0:e.chainNamespace,Ut.activeCaipNetwork=e,vu.set({activeChain:Ut.activeChain,selectedNetworkId:(n=Ut.activeCaipNetwork)==null?void 0:n.id}),this.setChainNetworkData(t,{caipNetwork:e},r)},setActiveConnector(t){t&&(Ut.activeConnector=sc(t))},getNetworkControllerClient(t){const e=sn.getItem(nn.WALLET_ID),r=t||Ut.activeChain,n=e==="walletConnect",i=Ut.universalAdapter.networkControllerClient;if(n||Ut.noAdapters){if(!i)throw new Error("Universal Adapter's networkControllerClient is not set");return i}if(!r)throw new Error("Chain is required to get network controller client");const o=Ut.chains.get(r);if(!o)throw new Error("Chain adapter not found");if(!o.networkControllerClient)throw new Error("NetworkController client not set");return o.networkControllerClient},getConnectionControllerClient(t){var a;const e=t||Ut.activeChain,r=sn.getItem(nn.CONNECTED_CONNECTOR)==="WALLET_CONNECT",n=Ut.universalAdapter.connectionControllerClient,i=((a=Ut.chains.get("eip155"))==null?void 0:a.adapterType)==="wagmi";if(r&&!i||Ut.noAdapters){if(!n)throw new Error("Universal Adapter's ConnectionControllerClient is not set");return n}if(!e)throw new Error("Chain is required to get connection controller client");const o=Ut.chains.get(e);if(!o)throw new Error("Chain adapter not found");if(!o.connectionControllerClient)throw new Error("ConnectionController client not set");return o.connectionControllerClient},getAccountProp(t,e){var i;let r=Ut.activeChain;if(e&&(r=e),!r)return;const n=(i=Ut.chains.get(r))==null?void 0:i.accountState;if(n)return n[t]},getNetworkProp(t,e){var i;const r=e||Ut.activeChain;if(!r)return;const n=(i=Ut.chains.get(r))==null?void 0:i.networkState;if(n)return n[t]},getAllRequestedCaipNetworks(){const t=[];return Ut.chains.forEach(e=>{const r=e.networkState;r!=null&&r.requestedCaipNetworks&&t.push(...r.requestedCaipNetworks)}),t},getAllApprovedCaipNetworks(){const t=[];return Ut.chains.forEach(e=>{const r=e.networkState;r!=null&&r.approvedCaipNetworkIds&&t.push(...r.approvedCaipNetworkIds)}),t},resetAccount(t){const e=t;if(!e)throw new Error("Chain is required to set account prop");ge.state.activeCaipAddress=void 0,this.setChainAccountData(e,sc({smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,provider:void 0}))}},vr={setWalletConnectDeepLink({name:t,href:e}){try{sn.setItem(nn.DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=sn.getItem(nn.DEEPLINK_CHOICE);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{sn.removeItem(nn.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setAppKitRecent(t){try{const e=vr.getRecentWallets();e.find(n=>n.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),sn.setItem(nn.RECENT_WALLETS,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const t=sn.getItem(nn.RECENT_WALLETS);return t?JSON.parse(t):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnector(t){try{sn.setItem(nn.CONNECTED_CONNECTOR,t)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return sn.getItem(nn.CONNECTED_CONNECTOR)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(t){try{sn.setItem(nn.CONNECTED_SOCIAL,t)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return sn.getItem(nn.CONNECTED_SOCIAL)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return sn.getItem(nn.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get Connected Social Username")}},getStoredActiveCaipNetwork(){const t=sn.getItem(nn.ACTIVE_CAIP_NETWORK_ID),e=ge.getAllRequestedCaipNetworks();return e==null?void 0:e.find(n=>n.id===t)}},Qo=Rn({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),Sn={state:Qo,subscribeNetworkImages(t){return bs(Qo.networkImages,()=>t(Qo.networkImages))},subscribeKey(t,e){return Ts(Qo,t,e)},subscribe(t){return bs(Qo,()=>t(Qo))},setWalletImage(t,e){Qo.walletImages[t]=e},setNetworkImage(t,e){Qo.networkImages[t]=e},setChainImage(t,e){Qo.chainImages[t]=e},setConnectorImage(t,e){Qo.connectorImages[t]=e},setTokenImage(t,e){Qo.tokenImages[t]=e},setCurrencyImage(t,e){Qo.currencyImages[t]=e}},Ire=Ue.getApiUrl(),qi=new P6({baseUrl:Ire,clientId:null}),Tre="40",hR="4",kre=20,ui=Rn({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1,excludedRDNS:[]}),Tt={state:ui,subscribeKey(t,e){return Ts(ui,t,e)},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e||"appkit","x-sdk-version":r||"html-wagmi-4.2.2"}},_filterOutExtensions(t){return qe.state.isUniversalProvider?t.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):t},async _fetchWalletImage(t){const e=`${qi.baseUrl}/getWalletImage/${t}`,r=await qi.getBlob({path:e,headers:Tt._getApiHeaders()});Sn.setWalletImage(t,URL.createObjectURL(r))},async _fetchNetworkImage(t){const e=`${qi.baseUrl}/public/getAssetImage/${t}`,r=await qi.getBlob({path:e,headers:Tt._getApiHeaders()});Sn.setNetworkImage(t,URL.createObjectURL(r))},async _fetchConnectorImage(t){const e=`${qi.baseUrl}/public/getAssetImage/${t}`,r=await qi.getBlob({path:e,headers:Tt._getApiHeaders()});Sn.setConnectorImage(t,URL.createObjectURL(r))},async _fetchCurrencyImage(t){const e=`${qi.baseUrl}/public/getCurrencyImage/${t}`,r=await qi.getBlob({path:e,headers:Tt._getApiHeaders()});Sn.setCurrencyImage(t,URL.createObjectURL(r))},async _fetchTokenImage(t){const e=`${qi.baseUrl}/public/getTokenImage/${t}`,r=await qi.getBlob({path:e,headers:Tt._getApiHeaders()});Sn.setTokenImage(t,URL.createObjectURL(r))},async fetchNetworkImages(){const t=Zt.getRequestedCaipNetworks(),e=t==null?void 0:t.map(({imageId:r})=>r).filter(Boolean);e&&await Promise.allSettled(e.map(r=>Tt._fetchNetworkImage(r)))},async fetchConnectorImages(){const{connectors:t}=ut.state,e=t.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(e.map(r=>Tt._fetchConnectorImage(r)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>Tt._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>Tt._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:t}=qe.state;if(t!=null&&t.length){const{data:e}=await qi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:t!=null&&t.length?String(t.length):hR,include:t==null?void 0:t.join(",")}});e.sort((n,i)=>t.indexOf(n.id)-t.indexOf(i.id));const r=e.map(n=>n.image_id).filter(Boolean);await Promise.allSettled(r.map(n=>Tt._fetchWalletImage(n))),ui.featured=e}},async fetchRecommendedWallets(){var t;try{const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=qe.state,i=[...r??[],...n??[]].filter(Boolean),{data:s,count:o}=await qi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",chains:(t=ge.state.activeCaipNetwork)==null?void 0:t.id,entries:hR,include:e==null?void 0:e.join(","),exclude:i==null?void 0:i.join(",")}}),a=vr.getRecentWallets(),c=s.map(d=>d.image_id).filter(Boolean),l=a.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...c,...l].map(d=>Tt._fetchWalletImage(d))),ui.recommended=s,ui.count=o??0}catch{}},async fetchWallets({page:t}){var c;const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=qe.state,i=[...ui.recommended.map(({id:l})=>l),...r??[],...n??[]].filter(Boolean),{data:s,count:o}=await qi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:String(t),entries:Tre,chains:(c=ge.state.activeCaipNetwork)==null?void 0:c.id,include:e==null?void 0:e.join(","),exclude:i.join(",")}}),a=s.slice(0,kre).map(l=>l.image_id).filter(Boolean);await Promise.allSettled(a.map(l=>Tt._fetchWalletImage(l))),ui.wallets=Ue.uniqueBy([...ui.wallets,...Tt._filterOutExtensions(s)],"id"),ui.count=o>ui.count?o:ui.count,ui.page=t},async searchWalletByIds({ids:t}){var r;const{data:e}=await qi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:String(t.length),chains:(r=ge.state.activeCaipNetwork)==null?void 0:r.id,include:t==null?void 0:t.join(",")}});e&&e.forEach(n=>{n!=null&&n.rdns&&ui.excludedRDNS.push(n.rdns)})},async searchWallet({search:t}){var s;const{includeWalletIds:e,excludeWalletIds:r}=qe.state;ui.search=[];const{data:n}=await qi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:"100",search:t==null?void 0:t.trim(),chains:(s=ge.state.activeCaipNetwork)==null?void 0:s.id,include:e==null?void 0:e.join(","),exclude:r==null?void 0:r.join(",")}}),i=n.map(o=>o.image_id).filter(Boolean);await Promise.allSettled([...i.map(o=>Tt._fetchWalletImage(o)),Ue.wait(300)]),ui.search=Tt._filterOutExtensions(n)},async reFetchWallets(){ui.page=1,ui.wallets=[],await Tt.fetchFeaturedWallets(),await Tt.fetchRecommendedWallets()},prefetch(){var e;const t=[Tt.fetchFeaturedWallets(),Tt.fetchRecommendedWallets(),Tt.fetchNetworkImages(),Tt.fetchConnectorImages()];(e=qe.state.features)!=null&&e.analytics&&t.push(Tt.fetchAnalyticsConfig()),ui.prefetchPromise=Promise.race([Promise.allSettled(t)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:t}=await qi.get({path:"/getAnalyticsConfig",headers:Tt._getApiHeaders()});qe.setFeatures({analytics:t})}},Fc=Rn({loading:!1,open:!1,shake:!1}),jt={state:Fc,subscribe(t){return bs(Fc,()=>t(Fc))},subscribeKey(t,e){return Ts(Fc,t,e)},async open(t){await Tt.state.prefetchPromise;const e=ge.state.activeCaipAddress,r=ge.state.noAdapters;t!=null&&t.view?Ae.reset(t.view):e?Ae.reset("Account"):r&&!Ue.isMobile()?Ae.reset("ConnectingWalletConnect"):Ae.reset("Connect"),Fc.open=!0,vu.set({open:!0}),ot.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!e}})},close(){const t=!!ge.state.activeCaipAddress;Fc.open=!1,vu.set({open:!1}),ot.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}})},setLoading(t){Fc.loading=t,vu.set({loading:t})},shake(){Fc.shake||(Fc.shake=!0,setTimeout(()=>{Fc.shake=!1},500))}},Gm={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},uC={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},Rre={providers:pL,selectedProvider:null,error:null,purchaseCurrency:Gm,paymentCurrency:uC,purchaseCurrencies:[Gm],paymentCurrencies:[],quotesLoading:!1},Br=Rn(Rre),Ur={state:Br,subscribe(t){return bs(Br,()=>t(Br))},subscribeKey(t,e){return Ts(Br,t,e)},setSelectedProvider(t){if(t&&t.name==="meld"){const e=bX,r=ge.state.activeChain===xn.CHAIN.SOLANA?"SOL":"USDC",n=Se.state.address??"",i=new URL(t.url);i.searchParams.append("publicKey",e),i.searchParams.append("destinationCurrencyCode",r),i.searchParams.append("walletAddress",n),t.url=i.toString()}Br.selectedProvider=t},setPurchaseCurrency(t){Br.purchaseCurrency=t},setPaymentCurrency(t){Br.paymentCurrency=t},setPurchaseAmount(t){this.state.purchaseAmount=t},setPaymentAmount(t){this.state.paymentAmount=t},async getAvailableCurrencies(){const t=await bn.getOnrampOptions();Br.purchaseCurrencies=t.purchaseCurrencies,Br.paymentCurrencies=t.paymentCurrencies,Br.paymentCurrency=t.paymentCurrencies[0]||uC,Br.purchaseCurrency=t.purchaseCurrencies[0]||Gm,await Tt.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await Tt.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;Br.quotesLoading=!0;try{const r=await bn.getOnrampQuote({purchaseCurrency:Br.purchaseCurrency,paymentCurrency:Br.paymentCurrency,amount:((t=Br.paymentAmount)==null?void 0:t.toString())||"0",network:(e=Br.purchaseCurrency)==null?void 0:e.symbol});return Br.quotesLoading=!1,Br.purchaseAmount=Number(r.purchaseAmount.amount),r}catch(r){return Br.error=r.message,Br.quotesLoading=!1,null}finally{Br.quotesLoading=!1}},resetState(){Br.providers=pL,Br.selectedProvider=null,Br.error=null,Br.purchaseCurrency=Gm,Br.paymentCurrency=uC,Br.purchaseCurrencies=[Gm],Br.paymentCurrencies=[],Br.paymentAmount=void 0,Br.purchaseAmount=void 0,Br.quotesLoading=!1}},di=Rn({loading:!1}),Or={state:di,subscribe(t){return bs(di,()=>t(di))},subscribeKey(t,e){return Ts(di,t,e)},setToken(t){t&&(di.token=sc(t))},setTokenAmount(t){di.sendTokenAmount=t},setReceiverAddress(t){di.receiverAddress=t},setReceiverProfileImageUrl(t){di.receiverProfileImageUrl=t},setReceiverProfileName(t){di.receiverProfileName=t},setGasPrice(t){di.gasPrice=t},setGasPriceInUsd(t){di.gasPriceInUSD=t},setLoading(t){di.loading=t},sendToken(){var t;switch((t=ge.state.activeCaipNetwork)==null?void 0:t.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw new Error("Unsupported chain")}},sendEvmToken(){var t,e,r,n,i;(t=this.state.token)!=null&&t.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(ot.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:((e=ge.state.activeCaipNetwork)==null?void 0:e.id)||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&((r=this.state.token)!=null&&r.quantity.decimals)&&(ot.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:(n=this.state.token)==null?void 0:n.symbol,amount:this.state.sendTokenAmount,network:((i=ge.state.activeCaipNetwork)==null?void 0:i.id)||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async sendNativeToken(t){var s,o,a,c;Ae.pushTransactionStack({view:"Account",goBack:!1});const e=t.receiverAddress,r=Se.state.address,n=Lt.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),i="0x";try{await Lt.sendTransaction({to:e,address:r,data:i,value:n,gasPrice:t.gasPrice}),St.showSuccess("Transaction started"),ot.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:((s=this.state.token)==null?void 0:s.symbol)||"",amount:t.sendTokenAmount,network:((o=ge.state.activeCaipNetwork)==null?void 0:o.id)||""}}),this.resetSend()}catch{ot.sendEvent({type:"track",event:"SEND_ERROR",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:((a=this.state.token)==null?void 0:a.symbol)||"",amount:t.sendTokenAmount,network:((c=ge.state.activeCaipNetwork)==null?void 0:c.id)||""}}),St.showError("Something went wrong")}},async sendERC20Token(t){Ae.pushTransactionStack({view:"Account",goBack:!1});const e=Lt.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));try{Se.state.address&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress&&(await Lt.writeContract({fromAddress:Se.state.address,tokenAddress:Ue.getPlainAddress(t.tokenAddress),receiverAddress:t.receiverAddress,tokenAmount:e,method:"transfer",abi:wX}),St.showSuccess("Transaction started"),this.resetSend())}catch{St.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){St.showError("Please enter a valid amount and receiver address");return}Ae.pushTransactionStack({view:"Account",goBack:!1}),Lt.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),Se.fetchTokenBalance()}).catch(t=>{St.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",t)})},resetSend(){di.token=void 0,di.sendTokenAmount=void 0,di.receiverAddress=void 0,di.receiverProfileImageUrl=void 0,di.receiverProfileName=void 0,di.loading=!1}},Wa=Rn({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),mo={state:Wa,subscribe(t){return bs(Wa,()=>t(Wa))},subscribeKey(t,e){return Ts(Wa,t,e)},showTooltip({message:t,triggerRect:e,variant:r}){Wa.open=!0,Wa.message=t,Wa.triggerRect=e,Wa.variant=r},hide(){Wa.open=!1,Wa.message="",Wa.triggerRect={width:0,height:0,top:0,left:0}}},pR=2147483648,Pre={convertEVMChainIdToCoinType(t){if(t>=pR)throw new Error("Invalid chainId");return(pR|t)>>>0}},Yo=Rn({suggestions:[],loading:!1}),Kc={state:Yo,subscribe(t){return bs(Yo,()=>t(Yo))},subscribeKey(t,e){return Ts(Yo,t,e)},async resolveName(t){var e,r;try{return await bn.lookupEnsName(t)}catch(n){const i=n;throw new Error(((r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description)||"Error resolving name")}},async isNameRegistered(t){try{return await bn.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{Yo.loading=!0,Yo.suggestions=[];const e=await bn.getEnsNameSuggestions(t);return Yo.suggestions=e.suggestions.map(r=>({...r,name:r.name}))||[],Yo.suggestions}catch(e){const r=this.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{Yo.loading=!1}},async getNamesForAddress(t){try{return ge.state.activeCaipNetwork?await bn.reverseLookupEnsName({address:t}):[]}catch(e){const r=this.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){const e=ge.state.activeCaipNetwork;if(!e)throw new Error("Network not found");const r=Se.state.address,n=ut.getAuthConnector();if(!r||!n)throw new Error("Address or auth connector not found");Yo.loading=!0;try{const i=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now())});Ae.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){Yo.loading=!1}});const s=await Lt.signMessage(i),o=Ya.caipNetworkIdToNumber(e.id);if(!o)throw new Error("Network not found");const a=Pre.convertEVMChainIdToCoinType(Number(o));await bn.registerEnsName({coinType:a,address:r,signature:s,message:i}),Se.setProfileName(t,e.chainNamespace),Ae.replace("RegisterAccountNameSuccess")}catch(i){const s=this.parseEnsApiError(i,`Error registering name ${t}`);throw Ae.replace("RegisterAccountName"),new Error(s)}finally{Yo.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){var n,i;const r=t;return((i=(n=r==null?void 0:r.reasons)==null?void 0:n[0])==null?void 0:i.description)||e}},Nre={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:""},Sr={async fetchWalletImage(t){if(t)return await Tt._fetchWalletImage(t),this.getWalletImageById(t)},getWalletImageById(t){if(t)return Sn.state.walletImages[t]},getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return Sn.state.walletImages[t.image_id]},getNetworkImage(t){if(t!=null&&t.imageUrl)return t==null?void 0:t.imageUrl;if(t!=null&&t.imageId)return Sn.state.networkImages[t.imageId]},getNetworkImageById(t){if(t)return Sn.state.networkImages[t]},getConnectorImage(t){if(t!=null&&t.imageUrl)return t.imageUrl;if(t!=null&&t.imageId)return Sn.state.connectorImages[t.imageId]},getChainImage(t){return Sn.state.networkImages[Nre[t]]}};/** + */(function(t){const e=E6,r=OA,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=E,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const G=new Uint8Array(1),$={foo:function(){return 42}};return Object.setPrototypeOf($,Uint8Array.prototype),Object.setPrototypeOf(G,$),G.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(G){if(G>i)throw new RangeError('The value "'+G+'" is invalid for option "size"');const $=new Uint8Array(G);return Object.setPrototypeOf($,a.prototype),$}function a(G,$,z){if(typeof G=="number"){if(typeof $=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(G)}return c(G,$,z)}a.poolSize=8192;function c(G,$,z){if(typeof G=="string")return g(G,$);if(ArrayBuffer.isView(G))return x(G);if(G==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof G);if(Le(G,ArrayBuffer)||G&&Le(G.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Le(G,SharedArrayBuffer)||G&&Le(G.buffer,SharedArrayBuffer)))return R(G,$,z);if(typeof G=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=G.valueOf&&G.valueOf();if(J!=null&&J!==G)return a.from(J,$,z);const oe=M(G);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof G[Symbol.toPrimitive]=="function")return a.from(G[Symbol.toPrimitive]("string"),$,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof G)}a.from=function(G,$,z){return c(G,$,z)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(G){if(typeof G!="number")throw new TypeError('"size" argument must be of type number');if(G<0)throw new RangeError('The value "'+G+'" is invalid for option "size"')}function d(G,$,z){return l(G),G<=0?o(G):$!==void 0?typeof z=="string"?o(G).fill($,z):o(G).fill($):o(G)}a.alloc=function(G,$,z){return d(G,$,z)};function h(G){return l(G),o(G<0?0:N(G)|0)}a.allocUnsafe=function(G){return h(G)},a.allocUnsafeSlow=function(G){return h(G)};function g(G,$){if((typeof $!="string"||$==="")&&($="utf8"),!a.isEncoding($))throw new TypeError("Unknown encoding: "+$);const z=O(G,$)|0;let J=o(z);const oe=J.write(G,$);return oe!==z&&(J=J.slice(0,oe)),J}function v(G){const $=G.length<0?0:N(G.length)|0,z=o($);for(let J=0;J<$;J+=1)z[J]=G[J]&255;return z}function x(G){if(Le(G,Uint8Array)){const $=new Uint8Array(G);return R($.buffer,$.byteOffset,$.byteLength)}return v(G)}function R(G,$,z){if($<0||G.byteLength<$)throw new RangeError('"offset" is outside of buffer bounds');if(G.byteLength<$+(z||0))throw new RangeError('"length" is outside of buffer bounds');let J;return $===void 0&&z===void 0?J=new Uint8Array(G):z===void 0?J=new Uint8Array(G,$):J=new Uint8Array(G,$,z),Object.setPrototypeOf(J,a.prototype),J}function M(G){if(a.isBuffer(G)){const $=N(G.length)|0,z=o($);return z.length===0||G.copy(z,0,0,$),z}if(G.length!==void 0)return typeof G.length!="number"||rt(G.length)?o(0):v(G);if(G.type==="Buffer"&&Array.isArray(G.data))return v(G.data)}function N(G){if(G>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return G|0}function E(G){return+G!=G&&(G=0),a.alloc(+G)}a.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==a.prototype},a.compare=function($,z){if(Le($,Uint8Array)&&($=a.from($,$.offset,$.byteLength)),Le(z,Uint8Array)&&(z=a.from(z,z.offset,z.byteLength)),!a.isBuffer($)||!a.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===z)return 0;let J=$.length,oe=z.length;for(let fe=0,ye=Math.min(J,oe);feoe.length?(a.isBuffer(ye)||(ye=a.from(ye)),ye.copy(oe,fe)):Uint8Array.prototype.set.call(oe,ye,fe);else if(a.isBuffer(ye))ye.copy(oe,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=ye.length}return oe};function O(G,$){if(a.isBuffer(G))return G.length;if(ArrayBuffer.isView(G)||Le(G,ArrayBuffer))return G.byteLength;if(typeof G!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof G);const z=G.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&z===0)return 0;let oe=!1;for(;;)switch($){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Je(G).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return st(G).length;default:if(oe)return J?-1:Je(G).length;$=(""+$).toLowerCase(),oe=!0}}a.byteLength=O;function L(G,$,z){let J=!1;if(($===void 0||$<0)&&($=0),$>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,$>>>=0,z<=$))return"";for(G||(G="utf8");;)switch(G){case"hex":return k(this,$,z);case"utf8":case"utf-8":return m(this,$,z);case"ascii":return P(this,$,z);case"latin1":case"binary":return S(this,$,z);case"base64":return p(this,$,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,$,z);default:if(J)throw new TypeError("Unknown encoding: "+G);G=(G+"").toLowerCase(),J=!0}}a.prototype._isBuffer=!0;function U(G,$,z){const J=G[$];G[$]=G[z],G[z]=J}a.prototype.swap16=function(){const $=this.length;if($%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<$;z+=2)U(this,z,z+1);return this},a.prototype.swap32=function(){const $=this.length;if($%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<$;z+=4)U(this,z,z+3),U(this,z+1,z+2);return this},a.prototype.swap64=function(){const $=this.length;if($%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<$;z+=8)U(this,z,z+7),U(this,z+1,z+6),U(this,z+2,z+5),U(this,z+3,z+4);return this},a.prototype.toString=function(){const $=this.length;return $===0?"":arguments.length===0?m(this,0,$):L.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function($){if(!a.isBuffer($))throw new TypeError("Argument must be a Buffer");return this===$?!0:a.compare(this,$)===0},a.prototype.inspect=function(){let $="";const z=t.INSPECT_MAX_BYTES;return $=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&($+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function($,z,J,oe,fe){if(Le($,Uint8Array)&&($=a.from($,$.offset,$.byteLength)),!a.isBuffer($))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(z===void 0&&(z=0),J===void 0&&(J=$?$.length:0),oe===void 0&&(oe=0),fe===void 0&&(fe=this.length),z<0||J>$.length||oe<0||fe>this.length)throw new RangeError("out of range index");if(oe>=fe&&z>=J)return 0;if(oe>=fe)return-1;if(z>=J)return 1;if(z>>>=0,J>>>=0,oe>>>=0,fe>>>=0,this===$)return 0;let ye=fe-oe,Re=J-z;const Ve=Math.min(ye,Re),dt=this.slice(oe,fe),Ge=$.slice(z,J);for(let wt=0;wt2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,rt(z)&&(z=oe?0:G.length-1),z<0&&(z=G.length+z),z>=G.length){if(oe)return-1;z=G.length-1}else if(z<0)if(oe)z=0;else return-1;if(typeof $=="string"&&($=a.from($,J)),a.isBuffer($))return $.length===0?-1:I(G,$,z,J,oe);if(typeof $=="number")return $=$&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(G,$,z):Uint8Array.prototype.lastIndexOf.call(G,$,z):I(G,[$],z,J,oe);throw new TypeError("val must be string, number or Buffer")}function I(G,$,z,J,oe){let fe=1,ye=G.length,Re=$.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(G.length<2||$.length<2)return-1;fe=2,ye/=2,Re/=2,z/=2}function Ve(Ge,wt){return fe===1?Ge[wt]:Ge.readUInt16BE(wt*fe)}let dt;if(oe){let Ge=-1;for(dt=z;dtye&&(z=ye-Re),dt=z;dt>=0;dt--){let Ge=!0;for(let wt=0;wtoe&&(J=oe)):J=oe;const fe=$.length;J>fe/2&&(J=fe/2);let ye;for(ye=0;ye>>0,isFinite(J)?(J=J>>>0,oe===void 0&&(oe="utf8")):(oe=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-z;if((J===void 0||J>fe)&&(J=fe),$.length>0&&(J<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");oe||(oe="utf8");let ye=!1;for(;;)switch(oe){case"hex":return T(this,$,z,J);case"utf8":case"utf-8":return F(this,$,z,J);case"ascii":case"latin1":case"binary":return K(this,$,z,J);case"base64":return B(this,$,z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,$,z,J);default:if(ye)throw new TypeError("Unknown encoding: "+oe);oe=(""+oe).toLowerCase(),ye=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function p(G,$,z){return $===0&&z===G.length?e.fromByteArray(G):e.fromByteArray(G.slice($,z))}function m(G,$,z){z=Math.min(G.length,z);const J=[];let oe=$;for(;oe239?4:fe>223?3:fe>191?2:1;if(oe+Re<=z){let Ve,dt,Ge,wt;switch(Re){case 1:fe<128&&(ye=fe);break;case 2:Ve=G[oe+1],(Ve&192)===128&&(wt=(fe&31)<<6|Ve&63,wt>127&&(ye=wt));break;case 3:Ve=G[oe+1],dt=G[oe+2],(Ve&192)===128&&(dt&192)===128&&(wt=(fe&15)<<12|(Ve&63)<<6|dt&63,wt>2047&&(wt<55296||wt>57343)&&(ye=wt));break;case 4:Ve=G[oe+1],dt=G[oe+2],Ge=G[oe+3],(Ve&192)===128&&(dt&192)===128&&(Ge&192)===128&&(wt=(fe&15)<<18|(Ve&63)<<12|(dt&63)<<6|Ge&63,wt>65535&&wt<1114112&&(ye=wt))}}ye===null?(ye=65533,Re=1):ye>65535&&(ye-=65536,J.push(ye>>>10&1023|55296),ye=56320|ye&1023),J.push(ye),oe+=Re}return A(J)}const w=4096;function A(G){const $=G.length;if($<=w)return String.fromCharCode.apply(String,G);let z="",J=0;for(;J<$;)z+=String.fromCharCode.apply(String,G.slice(J,J+=w));return z}function P(G,$,z){let J="";z=Math.min(G.length,z);for(let oe=$;oeJ)&&(z=J);let oe="";for(let fe=$;feJ&&($=J),z<0?(z+=J,z<0&&(z=0)):z>J&&(z=J),z<$&&(z=$);const oe=this.subarray($,z);return Object.setPrototypeOf(oe,a.prototype),oe};function b(G,$,z){if(G%1!==0||G<0)throw new RangeError("offset is not uint");if(G+$>z)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function($,z,J){$=$>>>0,z=z>>>0,J||b($,z,this.length);let oe=this[$],fe=1,ye=0;for(;++ye>>0,z=z>>>0,J||b($,z,this.length);let oe=this[$+--z],fe=1;for(;z>0&&(fe*=256);)oe+=this[$+--z]*fe;return oe},a.prototype.readUint8=a.prototype.readUInt8=function($,z){return $=$>>>0,z||b($,1,this.length),this[$]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function($,z){return $=$>>>0,z||b($,2,this.length),this[$]|this[$+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function($,z){return $=$>>>0,z||b($,2,this.length),this[$]<<8|this[$+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function($,z){return $=$>>>0,z||b($,4,this.length),(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function($,z){return $=$>>>0,z||b($,4,this.length),this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])},a.prototype.readBigUInt64LE=Ue(function($){$=$>>>0,xe($,"offset");const z=this[$],J=this[$+7];(z===void 0||J===void 0)&&Ae($,this.length-8);const oe=z+this[++$]*2**8+this[++$]*2**16+this[++$]*2**24,fe=this[++$]+this[++$]*2**8+this[++$]*2**16+J*2**24;return BigInt(oe)+(BigInt(fe)<>>0,xe($,"offset");const z=this[$],J=this[$+7];(z===void 0||J===void 0)&&Ae($,this.length-8);const oe=z*2**24+this[++$]*2**16+this[++$]*2**8+this[++$],fe=this[++$]*2**24+this[++$]*2**16+this[++$]*2**8+J;return(BigInt(oe)<>>0,z=z>>>0,J||b($,z,this.length);let oe=this[$],fe=1,ye=0;for(;++ye=fe&&(oe-=Math.pow(2,8*z)),oe},a.prototype.readIntBE=function($,z,J){$=$>>>0,z=z>>>0,J||b($,z,this.length);let oe=z,fe=1,ye=this[$+--oe];for(;oe>0&&(fe*=256);)ye+=this[$+--oe]*fe;return fe*=128,ye>=fe&&(ye-=Math.pow(2,8*z)),ye},a.prototype.readInt8=function($,z){return $=$>>>0,z||b($,1,this.length),this[$]&128?(255-this[$]+1)*-1:this[$]},a.prototype.readInt16LE=function($,z){$=$>>>0,z||b($,2,this.length);const J=this[$]|this[$+1]<<8;return J&32768?J|4294901760:J},a.prototype.readInt16BE=function($,z){$=$>>>0,z||b($,2,this.length);const J=this[$+1]|this[$]<<8;return J&32768?J|4294901760:J},a.prototype.readInt32LE=function($,z){return $=$>>>0,z||b($,4,this.length),this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24},a.prototype.readInt32BE=function($,z){return $=$>>>0,z||b($,4,this.length),this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]},a.prototype.readBigInt64LE=Ue(function($){$=$>>>0,xe($,"offset");const z=this[$],J=this[$+7];(z===void 0||J===void 0)&&Ae($,this.length-8);const oe=this[$+4]+this[$+5]*2**8+this[$+6]*2**16+(J<<24);return(BigInt(oe)<>>0,xe($,"offset");const z=this[$],J=this[$+7];(z===void 0||J===void 0)&&Ae($,this.length-8);const oe=(z<<24)+this[++$]*2**16+this[++$]*2**8+this[++$];return(BigInt(oe)<>>0,z||b($,4,this.length),r.read(this,$,!0,23,4)},a.prototype.readFloatBE=function($,z){return $=$>>>0,z||b($,4,this.length),r.read(this,$,!1,23,4)},a.prototype.readDoubleLE=function($,z){return $=$>>>0,z||b($,8,this.length),r.read(this,$,!0,52,8)},a.prototype.readDoubleBE=function($,z){return $=$>>>0,z||b($,8,this.length),r.read(this,$,!1,52,8)};function V(G,$,z,J,oe,fe){if(!a.isBuffer(G))throw new TypeError('"buffer" argument must be a Buffer instance');if($>oe||$G.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function($,z,J,oe){if($=+$,z=z>>>0,J=J>>>0,!oe){const Re=Math.pow(2,8*J)-1;V(this,$,z,J,Re,0)}let fe=1,ye=0;for(this[z]=$&255;++ye>>0,J=J>>>0,!oe){const Re=Math.pow(2,8*J)-1;V(this,$,z,J,Re,0)}let fe=J-1,ye=1;for(this[z+fe]=$&255;--fe>=0&&(ye*=256);)this[z+fe]=$/ye&255;return z+J},a.prototype.writeUint8=a.prototype.writeUInt8=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,1,255,0),this[z]=$&255,z+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,2,65535,0),this[z]=$&255,this[z+1]=$>>>8,z+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,2,65535,0),this[z]=$>>>8,this[z+1]=$&255,z+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,4,4294967295,0),this[z+3]=$>>>24,this[z+2]=$>>>16,this[z+1]=$>>>8,this[z]=$&255,z+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,4,4294967295,0),this[z]=$>>>24,this[z+1]=$>>>16,this[z+2]=$>>>8,this[z+3]=$&255,z+4};function ce(G,$,z,J,oe){ge($,J,oe,G,z,7);let fe=Number($&BigInt(4294967295));G[z++]=fe,fe=fe>>8,G[z++]=fe,fe=fe>>8,G[z++]=fe,fe=fe>>8,G[z++]=fe;let ye=Number($>>BigInt(32)&BigInt(4294967295));return G[z++]=ye,ye=ye>>8,G[z++]=ye,ye=ye>>8,G[z++]=ye,ye=ye>>8,G[z++]=ye,z}function de(G,$,z,J,oe){ge($,J,oe,G,z,7);let fe=Number($&BigInt(4294967295));G[z+7]=fe,fe=fe>>8,G[z+6]=fe,fe=fe>>8,G[z+5]=fe,fe=fe>>8,G[z+4]=fe;let ye=Number($>>BigInt(32)&BigInt(4294967295));return G[z+3]=ye,ye=ye>>8,G[z+2]=ye,ye=ye>>8,G[z+1]=ye,ye=ye>>8,G[z]=ye,z+8}a.prototype.writeBigUInt64LE=Ue(function($,z=0){return ce(this,$,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ue(function($,z=0){return de(this,$,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function($,z,J,oe){if($=+$,z=z>>>0,!oe){const Ve=Math.pow(2,8*J-1);V(this,$,z,J,Ve-1,-Ve)}let fe=0,ye=1,Re=0;for(this[z]=$&255;++fe>0)-Re&255;return z+J},a.prototype.writeIntBE=function($,z,J,oe){if($=+$,z=z>>>0,!oe){const Ve=Math.pow(2,8*J-1);V(this,$,z,J,Ve-1,-Ve)}let fe=J-1,ye=1,Re=0;for(this[z+fe]=$&255;--fe>=0&&(ye*=256);)$<0&&Re===0&&this[z+fe+1]!==0&&(Re=1),this[z+fe]=($/ye>>0)-Re&255;return z+J},a.prototype.writeInt8=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,1,127,-128),$<0&&($=255+$+1),this[z]=$&255,z+1},a.prototype.writeInt16LE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,2,32767,-32768),this[z]=$&255,this[z+1]=$>>>8,z+2},a.prototype.writeInt16BE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,2,32767,-32768),this[z]=$>>>8,this[z+1]=$&255,z+2},a.prototype.writeInt32LE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,4,2147483647,-2147483648),this[z]=$&255,this[z+1]=$>>>8,this[z+2]=$>>>16,this[z+3]=$>>>24,z+4},a.prototype.writeInt32BE=function($,z,J){return $=+$,z=z>>>0,J||V(this,$,z,4,2147483647,-2147483648),$<0&&($=4294967295+$+1),this[z]=$>>>24,this[z+1]=$>>>16,this[z+2]=$>>>8,this[z+3]=$&255,z+4},a.prototype.writeBigInt64LE=Ue(function($,z=0){return ce(this,$,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ue(function($,z=0){return de(this,$,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(G,$,z,J,oe,fe){if(z+J>G.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function le(G,$,z,J,oe){return $=+$,z=z>>>0,oe||W(G,$,z,4),r.write(G,$,z,J,23,4),z+4}a.prototype.writeFloatLE=function($,z,J){return le(this,$,z,!0,J)},a.prototype.writeFloatBE=function($,z,J){return le(this,$,z,!1,J)};function Y(G,$,z,J,oe){return $=+$,z=z>>>0,oe||W(G,$,z,8),r.write(G,$,z,J,52,8),z+8}a.prototype.writeDoubleLE=function($,z,J){return Y(this,$,z,!0,J)},a.prototype.writeDoubleBE=function($,z,J){return Y(this,$,z,!1,J)},a.prototype.copy=function($,z,J,oe){if(!a.isBuffer($))throw new TypeError("argument should be a Buffer");if(J||(J=0),!oe&&oe!==0&&(oe=this.length),z>=$.length&&(z=$.length),z||(z=0),oe>0&&oe=this.length)throw new RangeError("Index out of range");if(oe<0)throw new RangeError("sourceEnd out of bounds");oe>this.length&&(oe=this.length),$.length-z>>0,J=J===void 0?this.length:J>>>0,$||($=0);let fe;if(typeof $=="number")for(fe=z;fe2**32?oe=D(String(z)):typeof z=="bigint"&&(oe=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(oe=D(oe)),oe+="n"),J+=` It must be ${$}. Received ${oe}`,J},RangeError);function D(G){let $="",z=G.length;const J=G[0]==="-"?1:0;for(;z>=J+4;z-=3)$=`_${G.slice(z-3,z)}${$}`;return`${G.slice(0,z)}${$}`}function ee(G,$,z){xe($,"offset"),(G[$]===void 0||G[$+z]===void 0)&&Ae($,G.length-(z+1))}function ge(G,$,z,J,oe,fe){if(G>z||G<$){const ye=typeof $=="bigint"?"n":"";let Re;throw $===0||$===BigInt(0)?Re=`>= 0${ye} and < 2${ye} ** ${(fe+1)*8}${ye}`:Re=`>= -(2${ye} ** ${(fe+1)*8-1}${ye}) and < 2 ** ${(fe+1)*8-1}${ye}`,new re.ERR_OUT_OF_RANGE("value",Re,G)}ee(J,oe,fe)}function xe(G,$){if(typeof G!="number")throw new re.ERR_INVALID_ARG_TYPE($,"number",G)}function Ae(G,$,z){throw Math.floor(G)!==G?(xe(G,z),new re.ERR_OUT_OF_RANGE("offset","an integer",G)):$<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${$}`,G)}const ke=/[^+/0-9A-Za-z-_]/g;function He(G){if(G=G.split("=")[0],G=G.trim().replace(ke,""),G.length<2)return"";for(;G.length%4!==0;)G=G+"=";return G}function Je(G,$){$=$||1/0;let z;const J=G.length;let oe=null;const fe=[];for(let ye=0;ye55295&&z<57344){if(!oe){if(z>56319){($-=3)>-1&&fe.push(239,191,189);continue}else if(ye+1===J){($-=3)>-1&&fe.push(239,191,189);continue}oe=z;continue}if(z<56320){($-=3)>-1&&fe.push(239,191,189),oe=z;continue}z=(oe-55296<<10|z-56320)+65536}else oe&&($-=3)>-1&&fe.push(239,191,189);if(oe=null,z<128){if(($-=1)<0)break;fe.push(z)}else if(z<2048){if(($-=2)<0)break;fe.push(z>>6|192,z&63|128)}else if(z<65536){if(($-=3)<0)break;fe.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if(($-=4)<0)break;fe.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return fe}function kt(G){const $=[];for(let z=0;z>8,oe=z%256,fe.push(oe),fe.push(J);return fe}function st(G){return e.toByteArray(He(G))}function Ze(G,$,z,J){let oe;for(oe=0;oe=$.length||oe>=G.length);++oe)$[oe+z]=G[oe];return oe}function Le(G,$){return G instanceof $||G!=null&&G.constructor!=null&&G.constructor.name!=null&&G.constructor.name===$.name}function rt(G){return G!==G}const lt=function(){const G="0123456789abcdef",$=new Array(256);for(let z=0;z<16;++z){const J=z*16;for(let oe=0;oe<16;++oe)$[J+oe]=G[z]+G[oe]}return $}();function Ue(G){return typeof BigInt>"u"?at:G}function at(){throw new Error("BigInt not supported")}})(eL);var CO;typeof window<"u"&&(window.Buffer||(window.Buffer=eL.Buffer),window.global||(window.global=window),window.process||(window.process={}),(CO=window.process)!=null&&CO.env||(window.process={env:{}}));var rL={};const fX=rL.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.org/sdk",hX=rL.NEXT_PUBLIC_DEFAULT_LOG_LEVEL||"error",Mt={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},lr={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var Dr;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Dr||(Dr={}));var Y7;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Y7||(Y7={}));const gt=Dr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cd=t=>{switch(typeof t){case"undefined":return gt.undefined;case"string":return gt.string;case"number":return isNaN(t)?gt.nan:gt.number;case"boolean":return gt.boolean;case"function":return gt.function;case"bigint":return gt.bigint;case"symbol":return gt.symbol;case"object":return Array.isArray(t)?gt.array:t===null?gt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?gt.promise:typeof Map<"u"&&t instanceof Map?gt.map:typeof Set<"u"&&t instanceof Set?gt.set:typeof Date<"u"&&t instanceof Date?gt.date:gt.object;default:return gt.unknown}},Ke=Dr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pX=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class cc extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;cr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}cc.create=t=>new cc(t);const Iw=(t,e)=>{let r;switch(t.code){case Ke.invalid_type:t.received===gt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Dr.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${Dr.joinValues(t.keys,", ")}`;break;case Ke.invalid_union:r="Invalid input";break;case Ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Dr.joinValues(t.options)}`;break;case Ke.invalid_enum_value:r=`Invalid enum value. Expected ${Dr.joinValues(t.options)}, received '${t.received}'`;break;case Ke.invalid_arguments:r="Invalid function arguments";break;case Ke.invalid_return_type:r="Invalid function return type";break;case Ke.invalid_date:r="Invalid date";break;case Ke.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Dr.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ke.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ke.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ke.custom:r="Invalid input";break;case Ke.invalid_intersection_types:r="Intersection results could not be merged";break;case Ke.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ke.not_finite:r="Number must be finite";break;default:r=e.defaultError,Dr.assertNever(t)}return{message:r}};let nL=Iw;function gX(t){nL=t}function Wb(){return nL}const Hb=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s};let a="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},mX=[];function _t(t,e){const r=Hb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Wb(),Iw].filter(n=>!!n)});t.common.issues.push(r)}class es{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return rr;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return es.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return rr;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const rr=Object.freeze({status:"aborted"}),iL=t=>({status:"dirty",value:t}),ms=t=>({status:"valid",value:t}),J7=t=>t.status==="aborted",X7=t=>t.status==="dirty",Tw=t=>t.status==="valid",qb=t=>typeof Promise<"u"&&t instanceof Promise;var Dt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Dt||(Dt={}));class fl{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const jk=(t,e)=>{if(Tw(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new cc(t.common.issues);return this._error=r,this._error}}};function ur(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:i}}class mr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Cd(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Cd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new es,ctx:{common:e.parent.common,data:e.data,parsedType:Cd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(qb(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cd(e)},s=this._parseSync({data:e,path:i.path,parent:i});return jk(i,s)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cd(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(qb(i)?i:Promise.resolve(i));return jk(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Ke.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new fc({schema:this,typeName:Jt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yu.create(this,this._def)}nullable(){return Lh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lc.create(this,this._def)}promise(){return m1.create(this,this._def)}or(e){return Nw.create([this,e],this._def)}and(e){return Mw.create(this,e,this._def)}transform(e){return new fc({...ur(this._def),schema:this,typeName:Jt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Bw({...ur(this._def),innerType:this,defaultValue:r,typeName:Jt.ZodDefault})}brand(){return new oL({typeName:Jt.ZodBranded,type:this,...ur(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Zb({...ur(this._def),innerType:this,catchValue:r,typeName:Jt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Jv.create(this,e)}readonly(){return Yb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wX=/^c[^\s-]{8,}$/i,vX=/^[a-z][a-z0-9]*$/,yX=/^[0-9A-HJKMNP-TV-Z]{26}$/,bX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xX=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_X="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mx;const CX=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,AX=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,EX=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function SX(t,e){return!!((e==="v4"||!e)&&CX.test(t)||(e==="v6"||!e)&&AX.test(t))}class ic extends mr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==gt.string){const s=this._getOrReturnCtx(e);return _t(s,{code:Ke.invalid_type,expected:gt.string,received:s.parsedType}),rr}const n=new es;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),_t(i,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(i),{validation:r,code:Ke.invalid_string,...Dt.errToObj(n)})}_addCheck(e){return new ic({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Dt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Dt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Dt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Dt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Dt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Dt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Dt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Dt.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...Dt.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Dt.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...Dt.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Dt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Dt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Dt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Dt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Dt.errToObj(r)})}nonempty(e){return this.min(1,Dt.errToObj(e))}trim(){return new ic({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ic({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ic({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new ic({checks:[],typeName:Jt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ur(t)})};function IX(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class ef extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==gt.number){const s=this._getOrReturnCtx(e);return _t(s,{code:Ke.invalid_type,expected:gt.number,received:s.parsedType}),rr}let n;const i=new es;for(const s of this._def.checks)s.kind==="int"?Dr.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?IX(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.not_finite,message:s.message}),i.dirty()):Dr.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Dt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Dt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Dt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Dt.toString(r))}setLimit(e,r,n,i){return new ef({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Dt.toString(i)}]})}_addCheck(e){return new ef({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Dt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Dt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Dt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Dt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Dt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Dt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Dt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Dt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Dt.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&Dr.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew ef({checks:[],typeName:Jt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ur(t)});class tf extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==gt.bigint){const s=this._getOrReturnCtx(e);return _t(s,{code:Ke.invalid_type,expected:gt.bigint,received:s.parsedType}),rr}let n;const i=new es;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),_t(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Dr.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Dt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Dt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Dt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Dt.toString(r))}setLimit(e,r,n,i){return new tf({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Dt.toString(i)}]})}_addCheck(e){return new tf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Dt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Dt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Dt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Dt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Dt.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new tf({checks:[],typeName:Jt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ur(t)})};class kw extends mr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==gt.boolean){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.boolean,received:n.parsedType}),rr}return ms(e.data)}}kw.create=t=>new kw({typeName:Jt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ur(t)});class $h extends mr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==gt.date){const s=this._getOrReturnCtx(e);return _t(s,{code:Ke.invalid_type,expected:gt.date,received:s.parsedType}),rr}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return _t(s,{code:Ke.invalid_date}),rr}const n=new es;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),_t(i,{code:Ke.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Dr.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new $h({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Dt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Dt.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew $h({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Jt.ZodDate,...ur(t)});class Vb extends mr{_parse(e){if(this._getType(e)!==gt.symbol){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.symbol,received:n.parsedType}),rr}return ms(e.data)}}Vb.create=t=>new Vb({typeName:Jt.ZodSymbol,...ur(t)});class Pw extends mr{_parse(e){if(this._getType(e)!==gt.undefined){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.undefined,received:n.parsedType}),rr}return ms(e.data)}}Pw.create=t=>new Pw({typeName:Jt.ZodUndefined,...ur(t)});class Rw extends mr{_parse(e){if(this._getType(e)!==gt.null){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.null,received:n.parsedType}),rr}return ms(e.data)}}Rw.create=t=>new Rw({typeName:Jt.ZodNull,...ur(t)});class g1 extends mr{constructor(){super(...arguments),this._any=!0}_parse(e){return ms(e.data)}}g1.create=t=>new g1({typeName:Jt.ZodAny,...ur(t)});class Eh extends mr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ms(e.data)}}Eh.create=t=>new Eh({typeName:Jt.ZodUnknown,...ur(t)});class Su extends mr{_parse(e){const r=this._getOrReturnCtx(e);return _t(r,{code:Ke.invalid_type,expected:gt.never,received:r.parsedType}),rr}}Su.create=t=>new Su({typeName:Jt.ZodNever,...ur(t)});class Kb extends mr{_parse(e){if(this._getType(e)!==gt.undefined){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.void,received:n.parsedType}),rr}return ms(e.data)}}Kb.create=t=>new Kb({typeName:Jt.ZodVoid,...ur(t)});class lc extends mr{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==gt.array)return _t(r,{code:Ke.invalid_type,expected:gt.array,received:r.parsedType}),rr;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.lengthi.maxLength.value&&(_t(r,{code:Ke.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new fl(r,o,r.path,a)))).then(o=>es.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new fl(r,o,r.path,a)));return es.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new lc({...this._def,minLength:{value:e,message:Dt.toString(r)}})}max(e,r){return new lc({...this._def,maxLength:{value:e,message:Dt.toString(r)}})}length(e,r){return new lc({...this._def,exactLength:{value:e,message:Dt.toString(r)}})}nonempty(e){return this.min(1,e)}}lc.create=(t,e)=>new lc({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Jt.ZodArray,...ur(e)});function dp(t){if(t instanceof _n){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=yu.create(dp(n))}return new _n({...t._def,shape:()=>e})}else return t instanceof lc?new lc({...t._def,type:dp(t.element)}):t instanceof yu?yu.create(dp(t.unwrap())):t instanceof Lh?Lh.create(dp(t.unwrap())):t instanceof hl?hl.create(t.items.map(e=>dp(e))):t}class _n extends mr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Dr.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==gt.object){const l=this._getOrReturnCtx(e);return _t(l,{code:Ke.invalid_type,expected:gt.object,received:l.parsedType}),rr}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Su&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const d=s[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new fl(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Su){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(l==="strict")a.length>0&&(_t(i,{code:Ke.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of a){const h=i.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new fl(i,h,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of c){const h=await d.key;l.push({key:h,value:await d.value,alwaysSet:d.alwaysSet})}return l}).then(l=>es.mergeObjectSync(n,l)):es.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Dt.errToObj,new _n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Dt.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new _n({...this._def,unknownKeys:"strip"})}passthrough(){return new _n({...this._def,unknownKeys:"passthrough"})}extend(e){return new _n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Jt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new _n({...this._def,catchall:e})}pick(e){const r={};return Dr.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new _n({...this._def,shape:()=>r})}omit(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new _n({...this._def,shape:()=>r})}deepPartial(){return dp(this)}partial(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new _n({...this._def,shape:()=>r})}required(e){const r={};return Dr.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yu;)s=s._def.innerType;r[n]=s}}),new _n({...this._def,shape:()=>r})}keyof(){return sL(Dr.objectKeys(this.shape))}}_n.create=(t,e)=>new _n({shape:()=>t,unknownKeys:"strip",catchall:Su.create(),typeName:Jt.ZodObject,...ur(e)});_n.strictCreate=(t,e)=>new _n({shape:()=>t,unknownKeys:"strict",catchall:Su.create(),typeName:Jt.ZodObject,...ur(e)});_n.lazycreate=(t,e)=>new _n({shape:t,unknownKeys:"strip",catchall:Su.create(),typeName:Jt.ZodObject,...ur(e)});class Nw extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new cc(a.ctx.common.issues));return _t(r,{code:Ke.invalid_union,unionErrors:o}),rr}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new cc(c));return _t(r,{code:Ke.invalid_union,unionErrors:a}),rr}}get options(){return this._def.options}}Nw.create=(t,e)=>new Nw({options:t,typeName:Jt.ZodUnion,...ur(e)});const Yy=t=>t instanceof $w?Yy(t.schema):t instanceof fc?Yy(t.innerType()):t instanceof Dw?[t.value]:t instanceof rf?t.options:t instanceof Lw?Object.keys(t.enum):t instanceof Bw?Yy(t._def.innerType):t instanceof Pw?[void 0]:t instanceof Rw?[null]:null;class S6 extends mr{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.object)return _t(r,{code:Ke.invalid_type,expected:gt.object,received:r.parsedType}),rr;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(_t(r,{code:Ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),rr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const s of r){const o=Yy(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new S6({typeName:Jt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ur(n)})}}function e_(t,e){const r=Cd(t),n=Cd(e);if(t===e)return{valid:!0,data:t};if(r===gt.object&&n===gt.object){const i=Dr.objectKeys(e),s=Dr.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=e_(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===gt.array&&n===gt.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(J7(s)||J7(o))return rr;const a=e_(s.value,o.value);return a.valid?((X7(s)||X7(o))&&r.dirty(),{status:r.value,value:a.data}):(_t(n,{code:Ke.invalid_intersection_types}),rr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Mw.create=(t,e,r)=>new Mw({left:t,right:e,typeName:Jt.ZodIntersection,...ur(r)});class hl extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.array)return _t(n,{code:Ke.invalid_type,expected:gt.array,received:n.parsedType}),rr;if(n.data.lengththis._def.items.length&&(_t(n,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new fl(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>es.mergeArray(r,o)):es.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new hl({...this._def,rest:e})}}hl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hl({items:t,typeName:Jt.ZodTuple,rest:null,...ur(e)})};class Ow extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.object)return _t(n,{code:Ke.invalid_type,expected:gt.object,received:n.parsedType}),rr;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new fl(n,a,n.path,a)),value:o._parse(new fl(n,n.data[a],n.path,a))});return n.common.async?es.mergeObjectAsync(r,i):es.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof mr?new Ow({keyType:e,valueType:r,typeName:Jt.ZodRecord,...ur(n)}):new Ow({keyType:ic.create(),valueType:e,typeName:Jt.ZodRecord,...ur(r)})}}class Gb extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.map)return _t(n,{code:Ke.invalid_type,expected:gt.map,received:n.parsedType}),rr;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:i._parse(new fl(n,a,n.path,[l,"key"])),value:s._parse(new fl(n,c,n.path,[l,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return rr;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(l.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return rr;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(l.value,d.value)}return{status:r.value,value:a}}}}Gb.create=(t,e,r)=>new Gb({valueType:e,keyType:t,typeName:Jt.ZodMap,...ur(r)});class Dh extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.set)return _t(n,{code:Ke.invalid_type,expected:gt.set,received:n.parsedType}),rr;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(_t(n,{code:Ke.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const d of c){if(d.status==="aborted")return rr;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}const a=[...n.data.values()].map((c,l)=>s._parse(new fl(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new Dh({...this._def,minSize:{value:e,message:Dt.toString(r)}})}max(e,r){return new Dh({...this._def,maxSize:{value:e,message:Dt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Dh.create=(t,e)=>new Dh({valueType:t,minSize:null,maxSize:null,typeName:Jt.ZodSet,...ur(e)});class Hp extends mr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.function)return _t(r,{code:Ke.invalid_type,expected:gt.function,received:r.parsedType}),rr;function n(a,c){return Hb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wb(),Iw].filter(l=>!!l),issueData:{code:Ke.invalid_arguments,argumentsError:c}})}function i(a,c){return Hb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wb(),Iw].filter(l=>!!l),issueData:{code:Ke.invalid_return_type,returnTypeError:c}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof m1){const a=this;return ms(async function(...c){const l=new cc([]),d=await a._def.args.parseAsync(c,s).catch(v=>{throw l.addIssue(n(c,v)),l}),h=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(h,s).catch(v=>{throw l.addIssue(i(h,v)),l})})}else{const a=this;return ms(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new cc([n(c,l.error)]);const d=Reflect.apply(o,this,l.data),h=a._def.returns.safeParse(d,s);if(!h.success)throw new cc([i(d,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Hp({...this._def,args:hl.create(e).rest(Eh.create())})}returns(e){return new Hp({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Hp({args:e||hl.create([]).rest(Eh.create()),returns:r||Eh.create(),typeName:Jt.ZodFunction,...ur(n)})}}class $w extends mr{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}$w.create=(t,e)=>new $w({getter:t,typeName:Jt.ZodLazy,...ur(e)});class Dw extends mr{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return _t(r,{received:r.data,code:Ke.invalid_literal,expected:this._def.value}),rr}return{status:"valid",value:e.data}}get value(){return this._def.value}}Dw.create=(t,e)=>new Dw({value:t,typeName:Jt.ZodLiteral,...ur(e)});function sL(t,e){return new rf({values:t,typeName:Jt.ZodEnum,...ur(e)})}class rf extends mr{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return _t(r,{expected:Dr.joinValues(n),received:r.parsedType,code:Ke.invalid_type}),rr}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return _t(r,{received:r.data,code:Ke.invalid_enum_value,options:n}),rr}return ms(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return rf.create(e)}exclude(e){return rf.create(this.options.filter(r=>!e.includes(r)))}}rf.create=sL;class Lw extends mr{_parse(e){const r=Dr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==gt.string&&n.parsedType!==gt.number){const i=Dr.objectValues(r);return _t(n,{expected:Dr.joinValues(i),received:n.parsedType,code:Ke.invalid_type}),rr}if(r.indexOf(e.data)===-1){const i=Dr.objectValues(r);return _t(n,{received:n.data,code:Ke.invalid_enum_value,options:i}),rr}return ms(e.data)}get enum(){return this._def.values}}Lw.create=(t,e)=>new Lw({values:t,typeName:Jt.ZodNativeEnum,...ur(e)});class m1 extends mr{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gt.promise&&r.common.async===!1)return _t(r,{code:Ke.invalid_type,expected:gt.promise,received:r.parsedType}),rr;const n=r.parsedType===gt.promise?r.data:Promise.resolve(r.data);return ms(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}m1.create=(t,e)=>new m1({type:t,typeName:Jt.ZodPromise,...ur(e)});class fc extends mr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Jt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{_t(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?rr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?rr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Tw(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Tw(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Dr.assertNever(i)}}fc.create=(t,e,r)=>new fc({schema:t,typeName:Jt.ZodEffects,effect:e,...ur(r)});fc.createWithPreprocess=(t,e,r)=>new fc({schema:e,effect:{type:"preprocess",transform:t},typeName:Jt.ZodEffects,...ur(r)});class yu extends mr{_parse(e){return this._getType(e)===gt.undefined?ms(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yu.create=(t,e)=>new yu({innerType:t,typeName:Jt.ZodOptional,...ur(e)});class Lh extends mr{_parse(e){return this._getType(e)===gt.null?ms(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lh.create=(t,e)=>new Lh({innerType:t,typeName:Jt.ZodNullable,...ur(e)});class Bw extends mr{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===gt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Bw.create=(t,e)=>new Bw({innerType:t,typeName:Jt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ur(e)});class Zb extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qb(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new cc(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new cc(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Zb.create=(t,e)=>new Zb({innerType:t,typeName:Jt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ur(e)});class Qb extends mr{_parse(e){if(this._getType(e)!==gt.nan){const n=this._getOrReturnCtx(e);return _t(n,{code:Ke.invalid_type,expected:gt.nan,received:n.parsedType}),rr}return{status:"valid",value:e.data}}}Qb.create=t=>new Qb({typeName:Jt.ZodNaN,...ur(t)});const TX=Symbol("zod_brand");class oL extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Jv extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?rr:s.status==="dirty"?(r.dirty(),iL(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?rr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Jv({in:e,out:r,typeName:Jt.ZodPipeline})}}class Yb extends mr{_parse(e){const r=this._def.innerType._parse(e);return Tw(r)&&(r.value=Object.freeze(r.value)),r}}Yb.create=(t,e)=>new Yb({innerType:t,typeName:Jt.ZodReadonly,...ur(e)});const aL=(t,e={},r)=>t?g1.create().superRefine((n,i)=>{var s,o;if(!t(n)){const a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):g1.create(),kX={object:_n.lazycreate};var Jt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Jt||(Jt={}));const PX=(t,e={message:`Input not instance of ${t.name}`})=>aL(r=>r instanceof t,e),cL=ic.create,lL=ef.create,RX=Qb.create,NX=tf.create,uL=kw.create,MX=$h.create,OX=Vb.create,$X=Pw.create,DX=Rw.create,LX=g1.create,BX=Eh.create,UX=Su.create,jX=Kb.create,FX=lc.create,zX=_n.create,WX=_n.strictCreate,HX=Nw.create,qX=S6.create,VX=Mw.create,KX=hl.create,GX=Ow.create,ZX=Gb.create,QX=Dh.create,YX=Hp.create,JX=$w.create,XX=Dw.create,eee=rf.create,tee=Lw.create,ree=m1.create,Fk=fc.create,nee=yu.create,iee=Lh.create,see=fc.createWithPreprocess,oee=Jv.create,aee=()=>cL().optional(),cee=()=>lL().optional(),lee=()=>uL().optional(),uee={string:t=>ic.create({...t,coerce:!0}),number:t=>ef.create({...t,coerce:!0}),boolean:t=>kw.create({...t,coerce:!0}),bigint:t=>tf.create({...t,coerce:!0}),date:t=>$h.create({...t,coerce:!0})},dee=rr;var ie=Object.freeze({__proto__:null,defaultErrorMap:Iw,setErrorMap:gX,getErrorMap:Wb,makeIssue:Hb,EMPTY_PATH:mX,addIssueToContext:_t,ParseStatus:es,INVALID:rr,DIRTY:iL,OK:ms,isAborted:J7,isDirty:X7,isValid:Tw,isAsync:qb,get util(){return Dr},get objectUtil(){return Y7},ZodParsedType:gt,getParsedType:Cd,ZodType:mr,ZodString:ic,ZodNumber:ef,ZodBigInt:tf,ZodBoolean:kw,ZodDate:$h,ZodSymbol:Vb,ZodUndefined:Pw,ZodNull:Rw,ZodAny:g1,ZodUnknown:Eh,ZodNever:Su,ZodVoid:Kb,ZodArray:lc,ZodObject:_n,ZodUnion:Nw,ZodDiscriminatedUnion:S6,ZodIntersection:Mw,ZodTuple:hl,ZodRecord:Ow,ZodMap:Gb,ZodSet:Dh,ZodFunction:Hp,ZodLazy:$w,ZodLiteral:Dw,ZodEnum:rf,ZodNativeEnum:Lw,ZodPromise:m1,ZodEffects:fc,ZodTransformer:fc,ZodOptional:yu,ZodNullable:Lh,ZodDefault:Bw,ZodCatch:Zb,ZodNaN:Qb,BRAND:TX,ZodBranded:oL,ZodPipeline:Jv,ZodReadonly:Yb,custom:aL,Schema:mr,ZodSchema:mr,late:kX,get ZodFirstPartyTypeKind(){return Jt},coerce:uee,any:LX,array:FX,bigint:NX,boolean:uL,date:MX,discriminatedUnion:qX,effect:Fk,enum:eee,function:YX,instanceof:PX,intersection:VX,lazy:JX,literal:XX,map:ZX,nan:RX,nativeEnum:tee,never:UX,null:DX,nullable:iee,number:lL,object:zX,oboolean:lee,onumber:cee,optional:nee,ostring:aee,pipeline:oee,preprocess:see,promise:ree,record:GX,set:QX,strictObject:WX,string:cL,symbol:OX,transformer:Fk,tuple:KX,undefined:$X,union:HX,unknown:BX,void:jX,NEVER:dee,ZodIssueCode:Ke,quotelessJson:pX,ZodError:cc});const Un=ie.object({message:ie.string()});function At(t){return ie.literal(Mt[t])}ie.object({accessList:ie.array(ie.string()),blockHash:ie.string().nullable(),blockNumber:ie.string().nullable(),chainId:ie.string().or(ie.number()),from:ie.string(),gas:ie.string(),hash:ie.string(),input:ie.string().nullable(),maxFeePerGas:ie.string(),maxPriorityFeePerGas:ie.string(),nonce:ie.string(),r:ie.string(),s:ie.string(),to:ie.string(),transactionIndex:ie.string().nullable(),type:ie.string(),v:ie.string(),value:ie.string()});const fee=ie.object({chainId:ie.string().or(ie.number())}),hee=ie.object({email:ie.string().email()}),pee=ie.object({otp:ie.string()}),gee=ie.object({uri:ie.string()}),mee=ie.object({chainId:ie.optional(ie.string().or(ie.number())),preferredAccountType:ie.optional(ie.string())}),wee=ie.object({provider:ie.enum(["google","github","apple","facebook","x","discord"])}),vee=ie.object({email:ie.string().email()}),yee=ie.object({otp:ie.string()}),bee=ie.object({otp:ie.string()}),xee=ie.object({themeMode:ie.optional(ie.enum(["light","dark"])),themeVariables:ie.optional(ie.record(ie.string(),ie.string().or(ie.number()))),w3mThemeVariables:ie.optional(ie.record(ie.string(),ie.string()))}),_ee=ie.object({metadata:ie.object({name:ie.string(),description:ie.string(),url:ie.string(),icons:ie.array(ie.string())}).optional(),sdkVersion:ie.string().optional(),sdkType:ie.string().optional(),projectId:ie.string()}),Cee=ie.object({type:ie.string()}),Aee=ie.object({action:ie.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),Eee=ie.object({url:ie.string()}),See=ie.object({userName:ie.string()}),Iee=ie.object({email:ie.string(),address:ie.string(),chainId:ie.string().or(ie.number()),accounts:ie.array(ie.object({address:ie.string(),type:ie.enum([lr.ACCOUNT_TYPES.EOA,lr.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:ie.string().optional()}),Tee=ie.object({action:ie.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),kee=ie.object({email:ie.string().email().optional().nullable(),address:ie.string(),chainId:ie.string().or(ie.number()),smartAccountDeployed:ie.optional(ie.boolean()),accounts:ie.array(ie.object({address:ie.string(),type:ie.enum([lr.ACCOUNT_TYPES.EOA,lr.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:ie.optional(ie.string())}),Pee=ie.object({uri:ie.string()}),Ree=ie.object({isConnected:ie.boolean()}),Nee=ie.object({chainId:ie.string().or(ie.number())}),Mee=ie.object({chainId:ie.string().or(ie.number())}),Oee=ie.object({newEmail:ie.string().email()}),$ee=ie.object({smartAccountEnabledNetworks:ie.array(ie.number())});ie.object({address:ie.string(),isDeployed:ie.boolean()});const Dee=ie.object({type:ie.string(),address:ie.string()}),Lee=ie.any(),Bee=ie.object({method:ie.literal("eth_accounts")}),Uee=ie.object({method:ie.literal("eth_blockNumber")}),jee=ie.object({method:ie.literal("eth_call"),params:ie.array(ie.any())}),Fee=ie.object({method:ie.literal("eth_chainId")}),zee=ie.object({method:ie.literal("eth_estimateGas"),params:ie.array(ie.any())}),Wee=ie.object({method:ie.literal("eth_feeHistory"),params:ie.array(ie.any())}),Hee=ie.object({method:ie.literal("eth_gasPrice")}),qee=ie.object({method:ie.literal("eth_getAccount"),params:ie.array(ie.any())}),Vee=ie.object({method:ie.literal("eth_getBalance"),params:ie.array(ie.any())}),Kee=ie.object({method:ie.literal("eth_getBlockByHash"),params:ie.array(ie.any())}),Gee=ie.object({method:ie.literal("eth_getBlockByNumber"),params:ie.array(ie.any())}),Zee=ie.object({method:ie.literal("eth_getBlockReceipts"),params:ie.array(ie.any())}),Qee=ie.object({method:ie.literal("eth_getBlockTransactionCountByHash"),params:ie.array(ie.any())}),Yee=ie.object({method:ie.literal("eth_getBlockTransactionCountByNumber"),params:ie.array(ie.any())}),Jee=ie.object({method:ie.literal("eth_getCode"),params:ie.array(ie.any())}),Xee=ie.object({method:ie.literal("eth_getFilterChanges"),params:ie.array(ie.any())}),ete=ie.object({method:ie.literal("eth_getFilterLogs"),params:ie.array(ie.any())}),tte=ie.object({method:ie.literal("eth_getLogs"),params:ie.array(ie.any())}),rte=ie.object({method:ie.literal("eth_getProof"),params:ie.array(ie.any())}),nte=ie.object({method:ie.literal("eth_getStorageAt"),params:ie.array(ie.any())}),ite=ie.object({method:ie.literal("eth_getTransactionByBlockHashAndIndex"),params:ie.array(ie.any())}),ste=ie.object({method:ie.literal("eth_getTransactionByBlockNumberAndIndex"),params:ie.array(ie.any())}),ote=ie.object({method:ie.literal("eth_getTransactionByHash"),params:ie.array(ie.any())}),ate=ie.object({method:ie.literal("eth_getTransactionCount"),params:ie.array(ie.any())}),cte=ie.object({method:ie.literal("eth_getTransactionReceipt"),params:ie.array(ie.any())}),lte=ie.object({method:ie.literal("eth_getUncleCountByBlockHash"),params:ie.array(ie.any())}),ute=ie.object({method:ie.literal("eth_getUncleCountByBlockNumber"),params:ie.array(ie.any())}),dte=ie.object({method:ie.literal("eth_maxPriorityFeePerGas")}),fte=ie.object({method:ie.literal("eth_newBlockFilter")}),hte=ie.object({method:ie.literal("eth_newFilter"),params:ie.array(ie.any())}),pte=ie.object({method:ie.literal("eth_newPendingTransactionFilter")}),gte=ie.object({method:ie.literal("eth_sendRawTransaction"),params:ie.array(ie.any())}),mte=ie.object({method:ie.literal("eth_syncing"),params:ie.array(ie.any())}),wte=ie.object({method:ie.literal("eth_uninstallFilter"),params:ie.array(ie.any())}),zk=ie.object({method:ie.literal("personal_sign"),params:ie.array(ie.any())}),vte=ie.object({method:ie.literal("eth_signTypedData_v4"),params:ie.array(ie.any())}),Wk=ie.object({method:ie.literal("eth_sendTransaction"),params:ie.array(ie.any())}),yte=ie.object({method:ie.literal("solana_signMessage"),params:ie.object({message:ie.string(),pubkey:ie.string()})}),bte=ie.object({method:ie.literal("solana_signTransaction"),params:ie.object({transaction:ie.string()})}),xte=ie.object({method:ie.literal("solana_signAllTransactions"),params:ie.object({transactions:ie.array(ie.string())})}),_te=ie.object({method:ie.literal("solana_signAndSendTransaction"),params:ie.object({transaction:ie.string(),options:ie.object({skipPreflight:ie.boolean().optional(),preflightCommitment:ie.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:ie.number().optional(),minContextSlot:ie.number().optional()}).optional()})}),Cte=ie.object({method:ie.literal("wallet_sendCalls"),params:ie.array(ie.object({chainId:ie.string().or(ie.number()).optional(),from:ie.string().optional(),version:ie.string().optional(),capabilities:ie.any().optional(),calls:ie.array(ie.object({to:ie.string().startsWith("0x"),data:ie.string().startsWith("0x").optional(),value:ie.string().optional()}))}))}),Ate=ie.object({method:ie.literal("wallet_getCallsStatus"),params:ie.array(ie.string())}),Ete=ie.object({method:ie.literal("wallet_getCapabilities")}),Ste=ie.object({method:ie.literal("wallet_grantPermissions"),params:ie.array(ie.any())}),Hk=ie.object({token:ie.string()}),Et=ie.object({id:ie.string().optional()}),om={appEvent:Et.extend({type:At("APP_SWITCH_NETWORK"),payload:fee}).or(Et.extend({type:At("APP_CONNECT_EMAIL"),payload:hee})).or(Et.extend({type:At("APP_CONNECT_DEVICE")})).or(Et.extend({type:At("APP_CONNECT_OTP"),payload:pee})).or(Et.extend({type:At("APP_CONNECT_SOCIAL"),payload:gee})).or(Et.extend({type:At("APP_GET_FARCASTER_URI")})).or(Et.extend({type:At("APP_CONNECT_FARCASTER")})).or(Et.extend({type:At("APP_GET_USER"),payload:ie.optional(mee)})).or(Et.extend({type:At("APP_GET_SOCIAL_REDIRECT_URI"),payload:wee})).or(Et.extend({type:At("APP_SIGN_OUT")})).or(Et.extend({type:At("APP_IS_CONNECTED"),payload:ie.optional(Hk)})).or(Et.extend({type:At("APP_GET_CHAIN_ID")})).or(Et.extend({type:At("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(Et.extend({type:At("APP_INIT_SMART_ACCOUNT")})).or(Et.extend({type:At("APP_SET_PREFERRED_ACCOUNT"),payload:Cee})).or(Et.extend({type:At("APP_RPC_REQUEST"),payload:zk.or(Wk).or(Bee).or(Uee).or(jee).or(Fee).or(zee).or(Wee).or(Hee).or(qee).or(Vee).or(Kee).or(Gee).or(Zee).or(Qee).or(Yee).or(Jee).or(Xee).or(ete).or(tte).or(rte).or(nte).or(ite).or(ste).or(ote).or(ate).or(cte).or(lte).or(ute).or(dte).or(fte).or(hte).or(pte).or(gte).or(mte).or(wte).or(zk).or(vte).or(Wk).or(yte).or(bte).or(xte).or(_te).or(Ate).or(Cte).or(Ete).or(Ste)})).or(Et.extend({type:At("APP_UPDATE_EMAIL"),payload:vee})).or(Et.extend({type:At("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:yee})).or(Et.extend({type:At("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:bee})).or(Et.extend({type:At("APP_SYNC_THEME"),payload:xee})).or(Et.extend({type:At("APP_SYNC_DAPP_DATA"),payload:_ee})),frameEvent:Et.extend({type:At("FRAME_SWITCH_NETWORK_ERROR"),payload:Un}).or(Et.extend({type:At("FRAME_SWITCH_NETWORK_SUCCESS"),payload:Mee})).or(Et.extend({type:At("FRAME_CONNECT_EMAIL_SUCCESS"),payload:Aee})).or(Et.extend({type:At("FRAME_CONNECT_EMAIL_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:Eee})).or(Et.extend({type:At("FRAME_GET_FARCASTER_URI_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:See})).or(Et.extend({type:At("FRAME_CONNECT_FARCASTER_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_CONNECT_OTP_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_CONNECT_OTP_SUCCESS")})).or(Et.extend({type:At("FRAME_CONNECT_DEVICE_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_CONNECT_DEVICE_SUCCESS")})).or(Et.extend({type:At("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:Iee})).or(Et.extend({type:At("FRAME_CONNECT_SOCIAL_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_GET_USER_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_GET_USER_SUCCESS"),payload:kee})).or(Et.extend({type:At("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:Pee})).or(Et.extend({type:At("FRAME_SIGN_OUT_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_SIGN_OUT_SUCCESS")})).or(Et.extend({type:At("FRAME_IS_CONNECTED_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_IS_CONNECTED_SUCCESS"),payload:Ree})).or(Et.extend({type:At("FRAME_GET_CHAIN_ID_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_GET_CHAIN_ID_SUCCESS"),payload:Nee})).or(Et.extend({type:At("FRAME_RPC_REQUEST_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_RPC_REQUEST_SUCCESS"),payload:Lee})).or(Et.extend({type:At("FRAME_SESSION_UPDATE"),payload:Hk})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SUCCESS"),payload:Tee})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:Oee})).or(Et.extend({type:At("FRAME_SYNC_THEME_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_SYNC_THEME_SUCCESS")})).or(Et.extend({type:At("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(Et.extend({type:At("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:$ee})).or(Et.extend({type:At("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Un})).or(Et.extend({type:At("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:Dee})).or(Et.extend({type:At("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Un}))},Vi={set(t,e){Qi.isClient&&localStorage.setItem(`${Mt.STORAGE_KEY}${t}`,e)},get(t){return Qi.isClient?localStorage.getItem(`${Mt.STORAGE_KEY}${t}`):null},delete(t,e){Qi.isClient&&(e?localStorage.removeItem(t):localStorage.removeItem(`${Mt.STORAGE_KEY}${t}`))}},qk={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},dy=30*1e3,Qi={checkIfAllowedToTriggerEmail(){const t=Vi.get(Mt.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e{function a({data:c}){var d;if(!((d=c.type)!=null&&d.includes(Mt.FRAME_EVENT_KEY)))return;const l=om.frameEvent.parse(c);l.id===i&&(s(l),window.removeEventListener("message",a))}Qi.isClient&&(window.addEventListener("message",a),o.addEventListener("abort",()=>{window.removeEventListener("message",a)}))},onFrameEvent:i=>{Qi.isClient&&window.addEventListener("message",({data:s})=>{var a;if(!((a=s.type)!=null&&a.includes(Mt.FRAME_EVENT_KEY)))return;const o=om.frameEvent.parse(s);i(o)})},onAppEvent:i=>{Qi.isClient&&window.addEventListener("message",({data:s})=>{var a;if(!((a=s.type)!=null&&a.includes(Mt.APP_EVENT_KEY)))return;const o=om.appEvent.parse(s);i(o)})},postAppEvent:i=>{var s;if(Qi.isClient){if(!((s=this.iframe)!=null&&s.contentWindow))throw new Error("W3mFrame: iframe is not set");om.appEvent.parse(i),this.iframe.contentWindow.postMessage(i,"*")}},postFrameEvent:i=>{if(Qi.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");om.frameEvent.parse(i),parent.postMessage(i,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((i,s)=>{this.frameLoadPromiseResolver={resolve:i,reject:s}}),r&&(this.frameLoadPromise=new Promise((i,s)=>{this.frameLoadPromiseResolver={resolve:i,reject:s}}),Qi.isClient)){const i=document.createElement("iframe");i.id="w3m-iframe",i.src=`${fX}?projectId=${e}&chainId=${n}`,i.name="w3m-secure-iframe",i.style.position="fixed",i.style.zIndex="999999",i.style.display="none",i.style.animationDelay="0s, 50ms",i.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",i.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(i),this.iframe=i,this.iframe.onload=()=>{var s;(s=this.frameLoadPromiseResolver)==null||s.resolve(void 0)},this.iframe.onerror=()=>{var s;(s=this.frameLoadPromiseResolver)==null||s.reject("Unable to load email login dependency")}}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r=>({[r]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,chainId:r}}));return Object.assign({},...e)}}function Tte(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var kte=Pte;function Pte(t,e,r){var n=r&&r.stringify||Tte,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?h:0,t.charCodeAt(v+1)){case 100:case 102:if(d>=c||e[d]==null)break;h=c||e[d]==null)break;h=c||e[d]===void 0)break;h",h=v+2,v++;break}l+=n(e[d]),h=v+2,v++;break;case 115:if(d>=c)break;h-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=jw),Object.defineProperty(c,"levelVal",{get:d}),Object.defineProperty(c,"level",{get:h,set:g});const l={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:Lte(t)};c.levels=il.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=jw,c.serializers=n,c._serialize=i,c._stdErrSerialize=s,c.child=v,e&&(c._logEvent=t_());function d(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function g(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,ap(l,c,"error","log"),ap(l,c,"fatal","error"),ap(l,c,"warn","error"),ap(l,c,"info","log"),ap(l,c,"debug","log"),ap(l,c,"trace","log")}function v(x,R){if(!x)throw new Error("missing bindings for child Pino");R=R||{},i&&x.serializers&&(R.serializers=x.serializers);const M=R.serializers;if(i&&M){var N=Object.assign({},n,M),E=t.browser.serialize===!0?Object.keys(N):i;delete x.serializers,I6([x],E,N,this._stdErrSerialize)}function O(L){this._childLevel=(L._childLevel|0)+1,this.error=cp(L,x,"error"),this.fatal=cp(L,x,"fatal"),this.warn=cp(L,x,"warn"),this.info=cp(L,x,"info"),this.debug=cp(L,x,"debug"),this.trace=cp(L,x,"trace"),N&&(this.serializers=N,this._serialize=E),e&&(this._logEvent=t_([].concat(L._logEvent.bindings,x)))}return O.prototype=this,new O(this)}return c}il.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"}};il.stdSerializers=Rte;il.stdTimeFunctions=Object.assign({},{nullTime:dL,epochTime:fL,unixTime:Bte,isoTime:Ute});function ap(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?jw:i[r]?i[r]:Uw[r]||Uw[n]||jw,Mte(t,e,r)}function Mte(t,e,r){!t.transmit&&e[r]===jw||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Uw?Uw:this;for(var c=0;c-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function cp(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;iJSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),zte=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 Bh(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return zte(t)}catch{return t}}function Iu(t){return typeof t=="string"?t:Fte(t)||""}const Wte={level:"info"},e2="custom_context",$A=1e3*1024;let Hte=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Kk=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new Hte(e);if(r.size>this.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}}}}},hL=class{constructor(e,r=$A){this.level=e??"error",this.levelValue=fp.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new Kk(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===fp.levels.values.error?console.error(e):r===fp.levels.values.warn?console.warn(e):r===fp.levels.values.debug?console.debug(e):r===fp.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Iu({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 Kk(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Iu({extraMetadata:e})),new Blob(r,{type:"application/json"})}},qte=class{constructor(e,r=$A){this.baseChunkLogger=new hL(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)}},Vte=class{constructor(e,r=$A){this.baseChunkLogger=new hL(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 Kte=Object.defineProperty,Gte=Object.defineProperties,Zte=Object.getOwnPropertyDescriptors,Gk=Object.getOwnPropertySymbols,Qte=Object.prototype.hasOwnProperty,Yte=Object.prototype.propertyIsEnumerable,Zk=(t,e,r)=>e in t?Kte(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jb=(t,e)=>{for(var r in e||(e={}))Qte.call(e,r)&&Zk(t,r,e[r]);if(Gk)for(var r of Gk(e))Yte.call(e,r)&&Zk(t,r,e[r]);return t},Xb=(t,e)=>Gte(t,Zte(e));function t2(t){return Xb(Jb({},t),{level:(t==null?void 0:t.level)||Wte.level})}function Jte(t,e=e2){return t[e]||""}function Xte(t,e,r=e2){return t[r]=e,t}function Xs(t,e=e2){let r="";return typeof t.bindings>"u"?r=Jte(t,e):r=t.bindings().context||"",r}function ere(t,e,r=e2){const n=Xs(t,r);return n.trim()?`${n}/${e}`:e}function ts(t,e,r=e2){const n=ere(t,e,r),i=t.child({context:n});return Xte(i,n,r)}function tre(t){var e,r;const n=new qte((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Xv(Xb(Jb({},t.opts),{level:"trace",browser:Xb(Jb({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function rre(t){var e;const r=new Vte((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Xv(Xb(Jb({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function pL(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?tre(t):rre(t)}class nre{constructor(e){var s;const r=t2({level:hX}),{logger:n,chunkLoggerController:i}=pL({opts:r});this.logger=ts(n,this.constructor.name),this.chunkLoggerController=i,typeof window<"u"&&((s=this.chunkLoggerController)!=null&&s.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class ire{constructor(e,r){this.openRpcRequests=[],this.w3mLogger=new nre(e),this.w3mFrame=new Ite(e,!0,r)}getLoginEmailUsed(){return!!Vi.get(Mt.EMAIL_LOGIN_USED_KEY)}getEmail(){return Vi.get(Mt.EMAIL)}async connectEmail(e){try{Qi.checkIfAllowedToTriggerEmail();const r=await this.appEvent({type:Mt.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting email"),r}}async connectDevice(){try{return this.appEvent({type:Mt.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:Mt.APP_CONNECT_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting otp"),r}}async isConnected(){try{const e=await this.appEvent({type:Mt.APP_IS_CONNECTED});return e.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{const e=await this.appEvent({type:Mt.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return this.appEvent({type:Mt.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error getting social redirect uri"),r}}async updateEmail(e){try{const r=await this.appEvent({type:Mt.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email"),r}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:Mt.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email primary otp"),r}}async updateEmailSecondaryOtp(e){try{const r=await this.appEvent({type:Mt.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(r.newEmail),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email secondary otp"),r}}async syncTheme(e){try{return this.appEvent({type:Mt.APP_SYNC_THEME,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing theme"),r}}async syncDappData(e){try{return this.appEvent({type:Mt.APP_SYNC_DAPP_DATA,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing dapp data"),r}}async getSmartAccountEnabledNetworks(){try{const e=await this.appEvent({type:Mt.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:Mt.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error setting preferred account"),r}}async connect(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,n=await this.appEvent({type:Mt.APP_GET_USER,payload:{...e,chainId:r}});return this.setLoginSuccess(n.email),this.setLastUsedChainId(n.chainId),n}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async getUser(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1;return await this.appEvent({type:Mt.APP_GET_USER,payload:{...e,chainId:r}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async connectSocial(e){try{const r=await this.appEvent({type:Mt.APP_CONNECT_SOCIAL,payload:{uri:e}});return r.userName&&this.setSocialLoginSuccess(r.userName),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting social"),r}}async getFarcasterUri(){try{return await this.appEvent({type:Mt.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{const e=await this.appEvent({type:Mt.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork(e){try{const r=await this.appEvent({type:Mt.APP_SWITCH_NETWORK,payload:{chainId:e}});return this.setLastUsedChainId(r.chainId),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error switching network"),r}}async disconnect(){try{const e=await this.appEvent({type:Mt.APP_SIGN_OUT});return this.deleteAuthLoginCache(),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error disconnecting"),e}}async request(e){var r,n,i;try{if(lr.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();(r=this.rpcRequestHandler)==null||r.call(this,e);const s=await this.appEvent({type:Mt.APP_RPC_REQUEST,payload:e});return(n=this.rpcSuccessHandler)==null||n.call(this,s,e),s}catch(s){throw(i=this.rpcErrorHandler)==null||i.call(this,s,e),this.w3mLogger.logger.error({error:s},"Error requesting"),s}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_IS_CONNECTED_SUCCESS&&r.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_IS_CONNECTED_ERROR&&e(),r.type===Mt.FRAME_IS_CONNECTED_SUCCESS&&!r.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_GET_USER_SUCCESS&&e(r.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(r.payload):r.type===Mt.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:lr.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Mt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(r.payload.smartAccountEnabledNetworks):r.type===Mt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){try{this.openRpcRequests.forEach(({abortController:e,method:r})=>{lr.SAFE_RPC_METHODS.includes(r)||e.abort()}),this.openRpcRequests=[]}catch(e){this.w3mLogger.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){await this.w3mFrame.frameLoadPromise;const r=e.type.replace("@w3m-app/","");return new Promise((n,i)=>{var c,l;const s=Math.random().toString(36).substring(7);(l=(c=this.w3mLogger.logger).info)==null||l.call(c,{event:e,id:s},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:s});const o=new AbortController;if(r==="RPC_REQUEST"){const d=e;this.openRpcRequests=[...this.openRpcRequests,{...d.payload,abortController:o}]}o.signal.addEventListener("abort",()=>{r==="RPC_REQUEST"&&i(new Error("Request was aborted"))});function a(d,h){var g,v,x;d.id===s&&((v=(g=h.logger).info)==null||v.call(g,{framEvent:d,id:s},"Received frame response"),d.type===`@w3m-frame/${r}_SUCCESS`?("payload"in d&&n(d.payload),n(void 0)):d.type===`@w3m-frame/${r}_ERROR`&&("payload"in d&&i(new Error(((x=d.payload)==null?void 0:x.message)||"An error occurred")),i(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(s,d=>a(d,this.w3mLogger),o.signal)})}setNewLastEmailLoginTime(){Vi.set(Mt.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Vi.set(Mt.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Vi.set(Mt.EMAIL,e),Vi.set(Mt.EMAIL_LOGIN_USED_KEY,"true"),Vi.delete(Mt.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Vi.delete(Mt.EMAIL_LOGIN_USED_KEY),Vi.delete(Mt.EMAIL),Vi.delete(Mt.LAST_USED_CHAIN_KEY),Vi.delete(Mt.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Vi.set(Mt.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Vi.get(Mt.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){Vi.set(Mt.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}const Xr=Tn({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),ti={state:Xr,subscribe(t){return gs(Xr,()=>t(Xr))},setLastNetworkInView(t){Xr.lastNetworkInView=t},async fetchTransactions(t,e){var n;const{projectId:r}=qe.state;if(!r||!t)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");Xr.loading=!0;try{const i=await vn.fetchTransactions({account:t,projectId:r,cursor:Xr.next,onramp:e,cache:e==="coinbase"?"no-cache":void 0,chainId:(n=pe.state.activeCaipNetwork)==null?void 0:n.id}),s=this.filterSpamTransactions(i.data),o=this.filterByConnectedChain(s),a=[...Xr.transactions,...o];Xr.loading=!1,e==="coinbase"?Xr.coinbaseTransactions=this.groupTransactionsByYearAndMonth(Xr.coinbaseTransactions,i.data):(Xr.transactions=a,Xr.transactionsByYear=this.groupTransactionsByYearAndMonth(Xr.transactionsByYear,o)),Xr.empty=a.length===0,Xr.next=i.next?i.next:void 0}catch{ot.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:r,cursor:Xr.next,isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),St.showError("Failed to fetch transactions"),Xr.loading=!1,Xr.empty=!0,Xr.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const r=t;return e.forEach(n=>{const i=new Date(n.metadata.minedAt).getFullYear(),s=new Date(n.metadata.minedAt).getMonth(),o=r[i]??{},c=(o[s]??[]).filter(l=>l.id!==n.id);r[i]={...o,[s]:[...c,n].sort((l,d)=>new Date(d.metadata.minedAt).getTime()-new Date(l.metadata.minedAt).getTime())}}),r},filterSpamTransactions(t){return t.filter(e=>!e.transfers.every(n=>{var i;return((i=n.nft_info)==null?void 0:i.flags.is_spam)===!0}))},filterByConnectedChain(t){var n;const e=(n=pe.state.activeCaipNetwork)==null?void 0:n.id;return t.filter(i=>i.metadata.chain===e)},clearCursor(){Xr.next=void 0},resetTransactions(){Xr.transactions=[],Xr.transactionsByYear={},Xr.lastNetworkInView=void 0,Xr.loading=!1,Xr.empty=!1,Xr.next=void 0}},Ql=Tn({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),mn={state:Ql,subscribe(t){return gs(Ql,()=>t(Ql))},setThemeMode(t){Ql.themeMode=t;try{const e=ut.getAuthConnector();if(e){const r=mn.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:t,themeVariables:r,w3mThemeVariables:pu(r,t)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(t){Ql.themeVariables={...Ql.themeVariables,...t};try{const e=ut.getAuthConnector();if(e){const r=mn.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:r,w3mThemeVariables:pu(Ql.themeVariables,Ql.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return Q7(Ql)}},Ua=Tn({allConnectors:[],connectors:[]}),ut={state:Ua,subscribeKey(t,e){return Cs(Ua,t,e)},setConnectors(t){const e=t.filter(r=>!Ua.allConnectors.some(n=>n.id===r.id&&this.getConnectorName(n.name)===this.getConnectorName(r.name)&&n.chain===r.chain));Ua.allConnectors=[...Ua.connectors,...e],Ua.connectors=this.mergeMultiChainConnectors(Ua.allConnectors)},mergeMultiChainConnectors(t){const e=this.generateConnectorMapByName(t),r=[];return e.forEach(n=>{const i=n[0],s=(i==null?void 0:i.id)==="w3mAuth";n.length>1?r.push({name:i==null?void 0:i.name,imageUrl:i==null?void 0:i.imageUrl,imageId:i==null?void 0:i.imageId,connectors:[...n],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&r.push(i)}),r},generateConnectorMapByName(t){const e=new Map;return t.forEach(r=>{const{name:n}=r,i=this.getConnectorName(n);if(!i)return;const s=e.get(i)||[];s.find(a=>a.chain===r.chain)||s.push(r),e.set(i,s)}),e},getConnectorName(t){return t&&({"Trust Wallet":"Trust"}[t]||t)},getUniqueConnectorsByName(t){const e=[];return t.forEach(r=>{e.find(n=>n.chain===r.chain)||e.push(r)}),e},addConnector(t){var e,r;if(t.id==="w3mAuth"){const n=t,i=Q7(qe.state),s=mn.getSnapshot().themeMode,o=mn.getSnapshot().themeVariables;(r=(e=n==null?void 0:n.provider)==null?void 0:e.syncDappData)==null||r.call(e,{metadata:i.metadata,sdkVersion:i.sdkVersion,projectId:i.projectId,sdkType:i.sdkType}),n.provider.syncTheme({themeMode:s,themeVariables:o,w3mThemeVariables:pu(o,s)}),this.setConnectors([t])}else this.setConnectors([t])},getAuthConnector(){var r;const t=pe.state.activeChain,e=Ua.connectors.find(n=>n.id==="w3mAuth");if(e)return(r=e==null?void 0:e.connectors)!=null&&r.length?e.connectors.find(i=>i.chain===t):e},getAnnouncedConnectorRdns(){return Ua.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectors(){return Ua.connectors},getConnector(t,e){return Ua.connectors.find(r=>{var n;return r.explorerId===t||((n=r.info)==null?void 0:n.rdns)===e})},syncIfAuthConnector(t){var s,o;if(t.id!=="w3mAuth")return;const e=t,r=Q7(qe.state),n=mn.getSnapshot().themeMode,i=mn.getSnapshot().themeVariables;(o=(s=e==null?void 0:e.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),e.provider.syncTheme({themeMode:n,themeVariables:i,w3mThemeVariables:pu(i,n)})}},os=Tn({wcError:!1,buffering:!1,status:"disconnected"}),Lt={state:os,subscribeKey(t,e){return Cs(os,t,e)},_getClient(t){return pe.getConnectionControllerClient(t)},setClient(t){os._client=rc(t)},async connectWalletConnect(){var t,e,r,n;vr.setConnectedConnector("WALLET_CONNECT"),await((n=(r=(e=(t=pe.state)==null?void 0:t.universalAdapter)==null?void 0:e.connectionControllerClient)==null?void 0:r.connectWalletConnect)==null?void 0:n.call(r,i=>{os.wcUri=i,os.wcPairingExpiry=Be.getPairingExpiry()}))},async connectExternal(t,e,r=!0){var n,i;await((i=(n=this._getClient(e)).connectExternal)==null?void 0:i.call(n,t)),r&&(pe.setActiveNamespace(e),vr.setConnectedConnector(t.type))},async reconnectExternal(t){var e,r;await((r=(e=this._getClient()).reconnectExternal)==null?void 0:r.call(e,t)),vr.setConnectedConnector(t.type)},async setPreferredAccountType(t){var r;jt.setLoading(!0);const e=ut.getAuthConnector();e&&(await(e==null?void 0:e.provider.setPreferredAccount(t)),await this.reconnectExternal(e),jt.setLoading(!1),ot.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:t,network:((r=pe.state.activeCaipNetwork)==null?void 0:r.id)||""}}))},async signMessage(t){return this._getClient().signMessage(t)},parseUnits(t,e){return this._getClient().parseUnits(t,e)},formatUnits(t,e){return this._getClient().formatUnits(t,e)},async sendTransaction(t){return this._getClient().sendTransaction(t)},async estimateGas(t){return this._getClient().estimateGas(t)},async writeContract(t){return this._getClient().writeContract(t)},async getEnsAddress(t){return this._getClient().getEnsAddress(t)},async getEnsAvatar(t){return this._getClient().getEnsAvatar(t)},checkInstalled(t,e){var r,n;return((n=(r=this._getClient(e)).checkInstalled)==null?void 0:n.call(r,t))||!1},resetWcConnection(){os.wcUri=void 0,os.wcPairingExpiry=void 0,os.wcLinking=void 0,os.recentWallet=void 0,ti.resetTransactions(),vr.deleteWalletConnectDeepLink()},setWcLinking(t){os.wcLinking=t},setWcError(t){os.wcError=t,os.buffering=!1},setRecentWallet(t){os.recentWallet=t},setBuffering(t){os.buffering=t},setStatus(t){os.status=t},async disconnect(){const t=this._getClient();try{await(t==null?void 0:t.disconnect()),this.resetWcConnection()}catch{throw new Error("Failed to disconnect")}}},Rm={async getTokenList(){var n;const t=pe.state.activeCaipNetwork,e=await vn.fetchSwapTokens({chainId:t==null?void 0:t.id,projectId:qe.state.projectId});return((n=e==null?void 0:e.tokens)==null?void 0:n.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){const t=qe.state.projectId,e=pe.state.activeCaipNetwork;if(!e)return null;try{switch(e.chainNamespace){case"solana":const r=(await Lt.estimateGas({chainNamespace:"solana"})).toString();return{standard:r,fast:r,instant:r};case"eip155":default:return await vn.fetchGasPrice({projectId:t,chainId:e.id})}}catch{return null}},async fetchSwapAllowance({tokenAddress:t,userAddress:e,sourceTokenAmount:r,sourceTokenDecimals:n}){const i=qe.state.projectId,s=await vn.fetchSwapAllowance({projectId:i,tokenAddress:t,userAddress:e});if(s!=null&&s.allowance&&r&&n){const o=Lt.parseUnits(r,n)||0;return BigInt(s.allowance)>=o}return!1},async getMyTokensWithBalance(t){const e=Ee.state.address,r=pe.state.activeCaipNetwork;if(!e||!r)return[];const i=(await vn.getBalance(e,r.id,t)).balances.filter(s=>s.quantity.decimals!=="0");return Ee.setTokenBalance(i,pe.state.activeChain),this.mapBalancesToSwapTokens(i)},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:Zt.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},en=Tn({view:"Connect",history:["Connect"],transactionStack:[]}),Ce={state:en,subscribeKey(t,e){return Cs(en,t,e)},pushTransactionStack(t){en.transactionStack.push(t)},popTransactionStack(t){var r,n;const e=en.transactionStack.pop();if(e)if(t)this.goBack(),(r=e==null?void 0:e.onCancel)==null||r.call(e);else{if(e.goBack)this.goBack();else if(e.replace){const s=en.history.indexOf("ConnectingSiwe");s>0?this.goBackToIndex(s-1):(jt.close(),en.history=[])}else e.view&&this.reset(e.view);(n=e==null?void 0:e.onSuccess)==null||n.call(e)}},push(t,e){t!==en.view&&(en.view=t,en.history.push(t),en.data=e)},reset(t){en.view=t,en.history=[t]},replace(t,e){en.history.at(-1)===t||(en.view=t,en.history[en.history.length-1]=t,en.data=e)},goBack(){if(en.history.length>1){en.history.pop();const[t]=en.history.slice(-1);t&&(en.view=t)}else jt.close()},goBackToIndex(t){if(en.history.length>1){en.history=en.history.slice(0,t+1);const[e]=en.history.slice(-1);e&&(en.view=e)}}},nu={getGasPriceInEther(t,e){const r=e*t;return Number(r)/1e18},getGasPriceInUSD(t,e,r){const n=nu.getGasPriceInEther(e,r);return Rr.bigNumber(t).multipliedBy(n).toNumber()},getPriceImpact({sourceTokenAmount:t,sourceTokenPriceInUSD:e,toTokenPriceInUSD:r,toTokenAmount:n}){const i=Rr.bigNumber(t).multipliedBy(e),s=Rr.bigNumber(n).multipliedBy(r);return i.minus(s).dividedBy(i).multipliedBy(100).toNumber()},getMaxSlippage(t,e){const r=Rr.bigNumber(t).dividedBy(100);return Rr.multiply(e,r).toNumber()},getProviderFee(t,e=.0085){return Rr.bigNumber(t).multipliedBy(e).toString()},isInsufficientNetworkTokenForGas(t,e){const r=e||"0";return Rr.bigNumber(t).isZero()?!0:Rr.bigNumber(Rr.bigNumber(r)).isGreaterThan(t)},isInsufficientSourceTokenForSwap(t,e,r){var s,o;const n=(o=(s=r==null?void 0:r.find(a=>a.address===e))==null?void 0:s.quantity)==null?void 0:o.numeric;return Rr.bigNumber(n||"0").isLessThan(t)},getToTokenAmount({sourceToken:t,toToken:e,sourceTokenPrice:r,toTokenPrice:n,sourceTokenAmount:i}){if(i==="0"||!t||!e)return"0";const s=t.decimals,o=r,a=e.decimals,c=n;if(c<=0)return"0";const l=Rr.bigNumber(i).multipliedBy(.0085),h=Rr.bigNumber(i).minus(l).multipliedBy(Rr.bigNumber(10).pow(s)),g=Rr.bigNumber(o).dividedBy(c),v=s-a;return h.multipliedBy(g).dividedBy(Rr.bigNumber(10).pow(v)).dividedBy(Rr.bigNumber(10).pow(a)).toFixed(a).toString()}},Qk=15e4,sre=6,Ms={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:Sn.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},Se=Tn(Ms),Xe={state:Se,subscribe(t){return gs(Se,()=>t(Se))},subscribeKey(t,e){return Cs(Se,t,e)},getParams(){var a,c,l,d,h,g,v,x;const t=pe.state.activeCaipAddress,e=Be.getPlainAddress(t),r=Zt.getActiveNetworkTokenAddress(),n=vr.getConnectedConnector();if(!e)throw new Error("No address found to swap the tokens from.");const i=!((a=Se.toToken)!=null&&a.address)||!((c=Se.toToken)!=null&&c.decimals),s=!((l=Se.sourceToken)!=null&&l.address)||!((d=Se.sourceToken)!=null&&d.decimals)||!Rr.bigNumber(Se.sourceTokenAmount).isGreaterThan(0),o=!Se.sourceTokenAmount;return{networkAddress:r,fromAddress:e,fromCaipAddress:t,sourceTokenAddress:(h=Se.sourceToken)==null?void 0:h.address,toTokenAddress:(g=Se.toToken)==null?void 0:g.address,toTokenAmount:Se.toTokenAmount,toTokenDecimals:(v=Se.toToken)==null?void 0:v.decimals,sourceTokenAmount:Se.sourceTokenAmount,sourceTokenDecimals:(x=Se.sourceToken)==null?void 0:x.decimals,invalidToToken:i,invalidSourceToken:s,invalidSourceTokenAmount:o,availableToSwap:t&&!i&&!s&&!o,isAuthConnector:n==="AUTH"}},setSourceToken(t){if(!t){Se.sourceToken=t,Se.sourceTokenAmount="",Se.sourceTokenPriceInUSD=0;return}Se.sourceToken=t,this.setTokenPrice(t.address,"sourceToken")},setSourceTokenAmount(t){Se.sourceTokenAmount=t},setToToken(t){if(!t){Se.toToken=t,Se.toTokenAmount="",Se.toTokenPriceInUSD=0;return}Se.toToken=t,this.setTokenPrice(t.address,"toToken")},setToTokenAmount(t){Se.toTokenAmount=t?Rr.formatNumberToLocalString(t,sre):""},async setTokenPrice(t,e){const{availableToSwap:r}=this.getParams();let n=Se.tokensPriceMap[t]||0;n||(Se.loadingPrices=!0,n=await this.getAddressPrice(t)),e==="sourceToken"?Se.sourceTokenPriceInUSD=n:e==="toToken"&&(Se.toTokenPriceInUSD=n),Se.loadingPrices&&(Se.loadingPrices=!1,r&&this.swapTokens())},switchTokens(){if(Se.initializing||!Se.initialized)return;const t=Se.toToken?{...Se.toToken}:void 0,e=Se.sourceToken?{...Se.sourceToken}:void 0,r=t&&Se.toTokenAmount===""?"1":Se.toTokenAmount;this.setSourceToken(t),this.setToToken(e),this.setSourceTokenAmount(r),this.setToTokenAmount(""),this.swapTokens()},resetState(){Se.myTokensWithBalance=Ms.myTokensWithBalance,Se.tokensPriceMap=Ms.tokensPriceMap,Se.initialized=Ms.initialized,Se.sourceToken=Ms.sourceToken,Se.sourceTokenAmount=Ms.sourceTokenAmount,Se.sourceTokenPriceInUSD=Ms.sourceTokenPriceInUSD,Se.toToken=Ms.toToken,Se.toTokenAmount=Ms.toTokenAmount,Se.toTokenPriceInUSD=Ms.toTokenPriceInUSD,Se.networkPrice=Ms.networkPrice,Se.networkTokenSymbol=Ms.networkTokenSymbol,Se.networkBalanceInUSD=Ms.networkBalanceInUSD,Se.inputError=Ms.inputError},resetValues(){var r;const{networkAddress:t}=this.getParams(),e=(r=Se.tokens)==null?void 0:r.find(n=>n.address===t);this.setSourceToken(e),this.setToToken(void 0)},getApprovalLoadingState(){return Se.loadingApprovalTransaction},clearError(){Se.transactionError=void 0},async initializeState(){if(!Se.initializing){if(Se.initializing=!0,!Se.initialized)try{await this.fetchTokens(),Se.initialized=!0}catch{Se.initialized=!1,St.showError("Failed to initialize swap"),Ce.goBack()}Se.initializing=!1}},async fetchTokens(){var r;const{networkAddress:t}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const e=(r=Se.tokens)==null?void 0:r.find(n=>n.address===t);e&&(Se.networkTokenSymbol=e.symbol,this.setSourceToken(e),this.setSourceTokenAmount("1"))},async getTokenList(){const t=await Rm.getTokenList();Se.tokens=t,Se.popularTokens=t.sort((e,r)=>e.symbolr.symbol?1:0),Se.suggestedTokens=t.filter(e=>!!Sn.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(t){var c,l;const e=Se.tokensPriceMap[t];if(e)return e;const n=(await vn.fetchTokenPrice({projectId:qe.state.projectId,addresses:[t]})).fungibles||[],i=[...Se.tokens||[],...Se.myTokensWithBalance||[]],s=(c=i==null?void 0:i.find(d=>d.address===t))==null?void 0:c.symbol,o=((l=n.find(d=>d.symbol.toLowerCase()===(s==null?void 0:s.toLowerCase())))==null?void 0:l.price)||0,a=parseFloat(o.toString());return Se.tokensPriceMap[t]=a,a},async getNetworkTokenPrice(){var i;const{networkAddress:t}=this.getParams(),r=(i=(await vn.fetchTokenPrice({projectId:qe.state.projectId,addresses:[t]}).catch(()=>(St.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:i[0],n=(r==null?void 0:r.price.toString())||"0";Se.tokensPriceMap[t]=parseFloat(n),Se.networkTokenSymbol=(r==null?void 0:r.symbol)||"",Se.networkPrice=n},async getMyTokensWithBalance(t){const e=await Rm.getMyTokensWithBalance(t);e&&(await this.getInitialGasPrice(),this.setBalances(e))},setBalances(t){const{networkAddress:e}=this.getParams(),r=pe.state.activeCaipNetwork;if(!r)return;const n=t.find(i=>i.address===e);t.forEach(i=>{Se.tokensPriceMap[i.address]=i.price||0}),Se.myTokensWithBalance=t.filter(i=>i.address.startsWith(r.id)),Se.networkBalanceInUSD=n?Rr.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var e,r;const t=await Rm.fetchGasPrice();if(!t)return{gasPrice:null,gasPriceInUSD:null};switch((r=(e=pe.state)==null?void 0:e.activeCaipNetwork)==null?void 0:r.chainNamespace){case"solana":return Se.gasFee=t.standard,Se.gasPriceInUSD=Rr.multiply(t.standard,Se.networkPrice).dividedBy(1e9).toNumber(),{gasPrice:BigInt(Se.gasFee),gasPriceInUSD:Number(Se.gasPriceInUSD)};case"eip155":default:const n=t.standard,i=BigInt(n),s=BigInt(Qk),o=nu.getGasPriceInUSD(Se.networkPrice,s,i);return Se.gasFee=n,Se.gasPriceInUSD=o,{gasPrice:i,gasPriceInUSD:o}}},async swapTokens(){var l,d;const t=Ee.state.address,e=Se.sourceToken,r=Se.toToken,n=Rr.bigNumber(Se.sourceTokenAmount).isGreaterThan(0);if(!r||!e||Se.loadingPrices||!n)return;Se.loadingQuote=!0;const i=Rr.bigNumber(Se.sourceTokenAmount).multipliedBy(10**e.decimals),s=await vn.fetchSwapQuote({userAddress:t,projectId:qe.state.projectId,from:e.address,to:r.address,gasPrice:Se.gasFee,amount:i.toString()});Se.loadingQuote=!1;const o=(d=(l=s==null?void 0:s.quotes)==null?void 0:l[0])==null?void 0:d.toAmount;if(!o)return;const a=Rr.bigNumber(o).dividedBy(10**r.decimals).toString();this.setToTokenAmount(a),this.hasInsufficientToken(Se.sourceTokenAmount,e.address)?Se.inputError="Insufficient balance":(Se.inputError=void 0,this.setTransactionDetails())},async getTransaction(){const{fromCaipAddress:t,availableToSwap:e}=this.getParams(),r=Se.sourceToken,n=Se.toToken;if(!(!t||!e||!r||!n||Se.loadingQuote))try{Se.loadingBuildTransaction=!0;const i=await Rm.fetchSwapAllowance({userAddress:t,tokenAddress:r.address,sourceTokenAmount:Se.sourceTokenAmount,sourceTokenDecimals:r.decimals});let s;return i?s=await this.createSwapTransaction():s=await this.createAllowanceTransaction(),Se.loadingBuildTransaction=!1,Se.fetchError=!1,s}catch{Ce.goBack(),St.showError("Failed to check allowance"),Se.loadingBuildTransaction=!1,Se.approvalTransaction=void 0,Se.swapTransaction=void 0,Se.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:t,fromAddress:e,sourceTokenAddress:r,toTokenAddress:n}=this.getParams();if(!(!t||!n)){if(!r)throw new Error("createAllowanceTransaction - No source token address found.");try{const i=await vn.generateApproveCalldata({projectId:qe.state.projectId,from:r,to:n,userAddress:t}),s=await Lt.estimateGas({address:e,to:Be.getPlainAddress(i.tx.to),data:i.tx.data}),o={data:i.tx.data,to:Be.getPlainAddress(i.tx.from),gas:s,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:Se.toTokenAmount};return Se.swapTransaction=void 0,Se.approvalTransaction=o,o}catch{Ce.goBack(),St.showError("Failed to create approval transaction"),Se.approvalTransaction=void 0,Se.swapTransaction=void 0,Se.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:t,fromCaipAddress:e,sourceTokenAmount:r}=this.getParams(),n=Se.sourceToken,i=Se.toToken;if(!e||!r||!n||!i)return;const s=Lt.parseUnits(r,n.decimals).toString();try{const o=await vn.generateSwapCalldata({projectId:qe.state.projectId,userAddress:e,from:n.address,to:i.address,amount:s}),a=n.address===t,c=BigInt(o.tx.eip155.gas),l=BigInt(o.tx.eip155.gasPrice),d={data:o.tx.data,to:Be.getPlainAddress(o.tx.to),gas:c,gasPrice:l,value:BigInt(a?s:"0"),toAmount:Se.toTokenAmount};return Se.gasPriceInUSD=nu.getGasPriceInUSD(Se.networkPrice,c,l),Se.approvalTransaction=void 0,Se.swapTransaction=d,d}catch{Ce.goBack(),St.showError("Failed to create transaction"),Se.approvalTransaction=void 0,Se.swapTransaction=void 0,Se.fetchError=!0;return}},async sendTransactionForApproval(t){const{fromAddress:e,isAuthConnector:r}=this.getParams();Se.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";r?Ce.pushTransactionStack({view:null,goBack:!0,onSuccess(){St.showLoading(n)}}):St.showLoading(n);try{await Lt.sendTransaction({address:e,to:t.to,data:t.data,value:BigInt(t.value),gasPrice:BigInt(t.gasPrice)}),await this.swapTokens(),await this.getTransaction(),Se.approvalTransaction=void 0,Se.loadingApprovalTransaction=!1}catch(i){const s=i;Se.transactionError=s==null?void 0:s.shortMessage,Se.loadingApprovalTransaction=!1,St.showError((s==null?void 0:s.shortMessage)||"Transaction error")}},async sendTransactionForSwap(t){var o,a,c,l,d,h,g,v,x,R,M,N;if(!t)return;const{fromAddress:e,toTokenAmount:r,isAuthConnector:n}=this.getParams();Se.loadingTransaction=!0;const i=`Swapping ${(o=Se.sourceToken)==null?void 0:o.symbol} to ${Rr.formatNumberToLocalString(r,3)} ${(a=Se.toToken)==null?void 0:a.symbol}`,s=`Swapped ${(c=Se.sourceToken)==null?void 0:c.symbol} to ${Rr.formatNumberToLocalString(r,3)} ${(l=Se.toToken)==null?void 0:l.symbol}`;n?Ce.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){St.showLoading(i),Xe.resetState()}}):St.showLoading("Confirm transaction in your wallet");try{const E=[(d=Se.sourceToken)==null?void 0:d.address,(h=Se.toToken)==null?void 0:h.address].join(","),O=await Lt.sendTransaction({address:e,to:t.to,data:t.data,gas:t.gas,gasPrice:BigInt(t.gasPrice),value:t.value});return Se.loadingTransaction=!1,St.showSuccess(s),ot.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((g=pe.state.activeCaipNetwork)==null?void 0:g.id)||"",swapFromToken:((v=this.state.sourceToken)==null?void 0:v.symbol)||"",swapToToken:((x=this.state.toToken)==null?void 0:x.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),Xe.resetState(),n||Ce.replace("Account"),Xe.getMyTokensWithBalance(E),O}catch(E){const O=E;Se.transactionError=O==null?void 0:O.shortMessage,Se.loadingTransaction=!1,St.showError((O==null?void 0:O.shortMessage)||"Transaction error"),ot.sendEvent({type:"track",event:"SWAP_ERROR",properties:{network:((R=pe.state.activeCaipNetwork)==null?void 0:R.id)||"",swapFromToken:((M=this.state.sourceToken)==null?void 0:M.symbol)||"",swapToToken:((N=this.state.toToken)==null?void 0:N.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(t,e){const r=nu.isInsufficientSourceTokenForSwap(t,e,Se.myTokensWithBalance);return nu.isInsufficientNetworkTokenForGas(Se.networkBalanceInUSD,Se.gasPriceInUSD)||r},setTransactionDetails(){const{toTokenAddress:t,toTokenDecimals:e}=this.getParams();!t||!e||(Se.gasPriceInUSD=nu.getGasPriceInUSD(Se.networkPrice,BigInt(Se.gasFee),BigInt(Qk)),Se.priceImpact=nu.getPriceImpact({sourceTokenAmount:Se.sourceTokenAmount,sourceTokenPriceInUSD:Se.sourceTokenPriceInUSD,toTokenPriceInUSD:Se.toTokenPriceInUSD,toTokenAmount:Se.toTokenAmount}),Se.maxSlippage=nu.getMaxSlippage(Se.slippage,Se.toTokenAmount),Se.providerFee=nu.getProviderFee(Se.sourceTokenAmount))}},Yk=Tn({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),Ee={state:Yk,replaceState(t){t&&Object.assign(Yk,rc(t))},subscribe(t){return pe.subscribeChainProp("accountState",e=>{if(e)return t(e)})},subscribeKey(t,e,r){let n;return pe.subscribeChainProp("accountState",i=>{if(i){const s=i[t];n!==s&&(n=s,e(s))}},r)},setStatus(t,e){pe.setAccountProp("status",t,e)},getCaipAddress(t){return pe.getAccountProp("caipAddress",t)},setProvider(t,e){t&&pe.setAccountProp("provider",t,e)},setCaipAddress(t,e){const r=t?Be.getPlainAddress(t):void 0;pe.state.activeCaipAddress=t,pe.setAccountProp("caipAddress",t,e),pe.setAccountProp("address",r,e)},setBalance(t,e,r){pe.setAccountProp("balance",t,r),pe.setAccountProp("balanceSymbol",e,r)},setProfileName(t,e){pe.setAccountProp("profileName",t,e)},setProfileImage(t,e){pe.setAccountProp("profileImage",t,e)},setAddressExplorerUrl(t,e){pe.setAccountProp("addressExplorerUrl",t,e)},setSmartAccountDeployed(t,e){pe.setAccountProp("smartAccountDeployed",t,e)},setCurrentTab(t){pe.setAccountProp("currentTab",t,pe.state.activeChain)},setTokenBalance(t,e){t&&pe.setAccountProp("tokenBalance",t,e)},setShouldUpdateToAddress(t,e){pe.setAccountProp("shouldUpdateToAddress",t,e)},setAllAccounts(t,e){pe.setAccountProp("allAccounts",t,e)},addAddressLabel(t,e,r){const n=pe.getAccountProp("addressLabels",r)||new Map;n.set(t,e),pe.setAccountProp("addressLabels",n,r)},removeAddressLabel(t,e){const r=pe.getAccountProp("addressLabels",e)||new Map;r.delete(t),pe.setAccountProp("addressLabels",r,e)},setConnectedWalletInfo(t,e){pe.setAccountProp("connectedWalletInfo",t,e,!1)},setPreferredAccountType(t,e){pe.setAccountProp("preferredAccountType",t,e)},setSocialProvider(t,e){t&&pe.setAccountProp("socialProvider",t,e)},setSocialWindow(t,e){t&&pe.setAccountProp("socialWindow",rc(t),e)},setFarcasterUrl(t,e){t&&pe.setAccountProp("farcasterUrl",t,e)},async fetchTokenBalance(){var i,s;const t=(i=pe.state.activeCaipNetwork)==null?void 0:i.id,e=(s=pe.state.activeCaipNetwork)==null?void 0:s.chainNamespace,r=pe.state.activeCaipAddress,n=r?Be.getPlainAddress(r):void 0;try{if(n&&t&&e){const o=await vn.getBalance(n,t),a=o.balances.filter(c=>c.quantity.decimals!=="0");this.setTokenBalance(a,e),Xe.setBalances(Rm.mapBalancesToSwapTokens(o.balances))}}catch{St.showError("Failed to fetch token balance")}},resetAccount(t){pe.resetAccount(t)},setSiweStatus(t){pe.setAccountProp("siweStatus",t,pe.state.activeChain)}},am=Tn({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0}),gu={state:am,subscribe(t){return gs(am,()=>t(am))},set(t){Object.assign(am,{...am,...t})}},Jk={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},Xk={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},Ut=Tn({chains:UJ(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0}}),pe={state:Ut,subscribeKey(t,e){return Cs(Ut,t,e)},subscribeChainProp(t,e,r){let n;return gs(Ut.chains,()=>{var s;const i=r||Ut.activeChain;if(i){const o=(s=Ut.chains.get(i))==null?void 0:s[t];n!==o&&(n=o,e(o))}})},initialize(t){const e=t==null?void 0:t[0];(t==null?void 0:t.length)===0&&(Ut.noAdapters=!0),Ut.noAdapters||(Ut.activeChain=e==null?void 0:e.chainNamespace,gu.set({activeChain:e==null?void 0:e.chainNamespace}),t.forEach(r=>{Ut.chains.set(r.chainNamespace,{chainNamespace:r.chainNamespace,connectionControllerClient:r.connectionControllerClient,networkControllerClient:r.networkControllerClient,adapterType:r.adapterType,accountState:Jk,networkState:Xk,caipNetworks:r.caipNetworks})}))},initializeUniversalAdapter(t,e){var n,i;if(Ut.universalAdapter=t,e.length===0){const s=vr.getStoredActiveCaipNetwork();try{s?Ut.activeChain=s.chainNamespace:Ut.activeChain=((n=t==null?void 0:t.defaultNetwork)==null?void 0:n.chainNamespace)??((i=t.caipNetworks[0])==null?void 0:i.chainNamespace)}catch(o){console.warn(">>> Error setting active caip network",o)}}[...new Set(t.caipNetworks.map(s=>s.chainNamespace))].forEach(s=>{Ut.chains.set(s,{chainNamespace:s,connectionControllerClient:void 0,networkControllerClient:void 0,adapterType:t.adapterType,accountState:Jk,networkState:Xk,caipNetworks:t.caipNetworks})})},setChainNetworkData(t,e,r=!1){if(!t)throw new Error("Chain is required to update chain network data");const n=Ut.chains.get(t);n&&(n.networkState=rc({...n.networkState,...e}),Ut.chains.set(t,rc(n)),(r||Ut.chains.size===1||Ut.activeChain===t)&&Zt.replaceState(n.networkState))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const n=Ut.chains.get(t);n&&(n.accountState=rc({...n.accountState,...e}),Ut.chains.set(t,n),(r||Ut.chains.size===1||Ut.activeChain===t)&&(e.caipAddress&&(Ut.activeCaipAddress=e.caipAddress),Ee.replaceState(n.accountState)))},setAccountProp(t,e,r,n=!0){this.setChainAccountData(r,{[t]:e},n)},setActiveNamespace(t){var n,i;Ut.activeChain=t;const e=t?Ut.chains.get(t):void 0,r=(n=e==null?void 0:e.networkState)==null?void 0:n.caipNetwork;r!=null&&r.id&&(Ut.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,Ut.activeCaipNetwork=r,nn.setItem(rn.ACTIVE_CAIP_NETWORK_ID,r==null?void 0:r.id),gu.set({activeChain:t,selectedNetworkId:r==null?void 0:r.id}))},setActiveCaipNetwork(t){var r,n;if(!t)return;const e=Ut.chains.get(t.chainNamespace);Ut.activeChain=t.chainNamespace,Ut.activeCaipNetwork=t,Ut.activeCaipAddress=(r=e==null?void 0:e.accountState)==null?void 0:r.caipAddress,e&&(Zt.replaceState(e.networkState),Ee.replaceState(e.accountState)),gu.set({activeChain:Ut.activeChain,selectedNetworkId:(n=Ut.activeCaipNetwork)==null?void 0:n.id}),nn.setItem(rn.ACTIVE_CAIP_NETWORK_ID,t.id)},setCaipNetwork(t,e,r=!1){var n;Ut.activeChain=e==null?void 0:e.chainNamespace,Ut.activeCaipNetwork=e,gu.set({activeChain:Ut.activeChain,selectedNetworkId:(n=Ut.activeCaipNetwork)==null?void 0:n.id}),this.setChainNetworkData(t,{caipNetwork:e},r)},setActiveConnector(t){t&&(Ut.activeConnector=rc(t))},getNetworkControllerClient(t){const e=nn.getItem(rn.WALLET_ID),r=t||Ut.activeChain,n=e==="walletConnect",i=Ut.universalAdapter.networkControllerClient;if(n||Ut.noAdapters){if(!i)throw new Error("Universal Adapter's networkControllerClient is not set");return i}if(!r)throw new Error("Chain is required to get network controller client");const o=Ut.chains.get(r);if(!o)throw new Error("Chain adapter not found");if(!o.networkControllerClient)throw new Error("NetworkController client not set");return o.networkControllerClient},getConnectionControllerClient(t){var a;const e=t||Ut.activeChain,r=nn.getItem(rn.CONNECTED_CONNECTOR)==="WALLET_CONNECT",n=Ut.universalAdapter.connectionControllerClient,i=((a=Ut.chains.get("eip155"))==null?void 0:a.adapterType)==="wagmi";if(r&&!i||Ut.noAdapters){if(!n)throw new Error("Universal Adapter's ConnectionControllerClient is not set");return n}if(!e)throw new Error("Chain is required to get connection controller client");const o=Ut.chains.get(e);if(!o)throw new Error("Chain adapter not found");if(!o.connectionControllerClient)throw new Error("ConnectionController client not set");return o.connectionControllerClient},getAccountProp(t,e){var i;let r=Ut.activeChain;if(e&&(r=e),!r)return;const n=(i=Ut.chains.get(r))==null?void 0:i.accountState;if(n)return n[t]},getNetworkProp(t,e){var i;const r=e||Ut.activeChain;if(!r)return;const n=(i=Ut.chains.get(r))==null?void 0:i.networkState;if(n)return n[t]},getAllRequestedCaipNetworks(){const t=[];return Ut.chains.forEach(e=>{const r=e.networkState;r!=null&&r.requestedCaipNetworks&&t.push(...r.requestedCaipNetworks)}),t},getAllApprovedCaipNetworks(){const t=[];return Ut.chains.forEach(e=>{const r=e.networkState;r!=null&&r.approvedCaipNetworkIds&&t.push(...r.approvedCaipNetworkIds)}),t},resetAccount(t){const e=t;if(!e)throw new Error("Chain is required to set account prop");pe.state.activeCaipAddress=void 0,this.setChainAccountData(e,rc({smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,provider:void 0}))}},vr={setWalletConnectDeepLink({name:t,href:e}){try{nn.setItem(rn.DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=nn.getItem(rn.DEEPLINK_CHOICE);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{nn.removeItem(rn.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setAppKitRecent(t){try{const e=vr.getRecentWallets();e.find(n=>n.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),nn.setItem(rn.RECENT_WALLETS,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const t=nn.getItem(rn.RECENT_WALLETS);return t?JSON.parse(t):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnector(t){try{nn.setItem(rn.CONNECTED_CONNECTOR,t)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return nn.getItem(rn.CONNECTED_CONNECTOR)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(t){try{nn.setItem(rn.CONNECTED_SOCIAL,t)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return nn.getItem(rn.CONNECTED_SOCIAL)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return nn.getItem(rn.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get Connected Social Username")}},getStoredActiveCaipNetwork(){const t=nn.getItem(rn.ACTIVE_CAIP_NETWORK_ID),e=pe.getAllRequestedCaipNetworks();return e==null?void 0:e.find(n=>n.id===t)}},Ko=Tn({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),An={state:Ko,subscribeNetworkImages(t){return gs(Ko.networkImages,()=>t(Ko.networkImages))},subscribeKey(t,e){return Cs(Ko,t,e)},subscribe(t){return gs(Ko,()=>t(Ko))},setWalletImage(t,e){Ko.walletImages[t]=e},setNetworkImage(t,e){Ko.networkImages[t]=e},setChainImage(t,e){Ko.chainImages[t]=e},setConnectorImage(t,e){Ko.connectorImages[t]=e},setTokenImage(t,e){Ko.tokenImages[t]=e},setCurrencyImage(t,e){Ko.currencyImages[t]=e}},ore=Be.getApiUrl(),Wi=new A6({baseUrl:ore,clientId:null}),are="40",eP="4",cre=20,li=Tn({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1,excludedRDNS:[]}),Tt={state:li,subscribeKey(t,e){return Cs(li,t,e)},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e||"appkit","x-sdk-version":r||"html-wagmi-4.2.2"}},_filterOutExtensions(t){return qe.state.isUniversalProvider?t.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):t},async _fetchWalletImage(t){const e=`${Wi.baseUrl}/getWalletImage/${t}`,r=await Wi.getBlob({path:e,headers:Tt._getApiHeaders()});An.setWalletImage(t,URL.createObjectURL(r))},async _fetchNetworkImage(t){const e=`${Wi.baseUrl}/public/getAssetImage/${t}`,r=await Wi.getBlob({path:e,headers:Tt._getApiHeaders()});An.setNetworkImage(t,URL.createObjectURL(r))},async _fetchConnectorImage(t){const e=`${Wi.baseUrl}/public/getAssetImage/${t}`,r=await Wi.getBlob({path:e,headers:Tt._getApiHeaders()});An.setConnectorImage(t,URL.createObjectURL(r))},async _fetchCurrencyImage(t){const e=`${Wi.baseUrl}/public/getCurrencyImage/${t}`,r=await Wi.getBlob({path:e,headers:Tt._getApiHeaders()});An.setCurrencyImage(t,URL.createObjectURL(r))},async _fetchTokenImage(t){const e=`${Wi.baseUrl}/public/getTokenImage/${t}`,r=await Wi.getBlob({path:e,headers:Tt._getApiHeaders()});An.setTokenImage(t,URL.createObjectURL(r))},async fetchNetworkImages(){const t=Zt.getRequestedCaipNetworks(),e=t==null?void 0:t.map(({imageId:r})=>r).filter(Boolean);e&&await Promise.allSettled(e.map(r=>Tt._fetchNetworkImage(r)))},async fetchConnectorImages(){const{connectors:t}=ut.state,e=t.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(e.map(r=>Tt._fetchConnectorImage(r)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>Tt._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>Tt._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:t}=qe.state;if(t!=null&&t.length){const{data:e}=await Wi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:t!=null&&t.length?String(t.length):eP,include:t==null?void 0:t.join(",")}});e.sort((n,i)=>t.indexOf(n.id)-t.indexOf(i.id));const r=e.map(n=>n.image_id).filter(Boolean);await Promise.allSettled(r.map(n=>Tt._fetchWalletImage(n))),li.featured=e}},async fetchRecommendedWallets(){var t;try{const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=qe.state,i=[...r??[],...n??[]].filter(Boolean),{data:s,count:o}=await Wi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",chains:(t=pe.state.activeCaipNetwork)==null?void 0:t.id,entries:eP,include:e==null?void 0:e.join(","),exclude:i==null?void 0:i.join(",")}}),a=vr.getRecentWallets(),c=s.map(d=>d.image_id).filter(Boolean),l=a.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...c,...l].map(d=>Tt._fetchWalletImage(d))),li.recommended=s,li.count=o??0}catch{}},async fetchWallets({page:t}){var c;const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=qe.state,i=[...li.recommended.map(({id:l})=>l),...r??[],...n??[]].filter(Boolean),{data:s,count:o}=await Wi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:String(t),entries:are,chains:(c=pe.state.activeCaipNetwork)==null?void 0:c.id,include:e==null?void 0:e.join(","),exclude:i.join(",")}}),a=s.slice(0,cre).map(l=>l.image_id).filter(Boolean);await Promise.allSettled(a.map(l=>Tt._fetchWalletImage(l))),li.wallets=Be.uniqueBy([...li.wallets,...Tt._filterOutExtensions(s)],"id"),li.count=o>li.count?o:li.count,li.page=t},async searchWalletByIds({ids:t}){var r;const{data:e}=await Wi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:String(t.length),chains:(r=pe.state.activeCaipNetwork)==null?void 0:r.id,include:t==null?void 0:t.join(",")}});e&&e.forEach(n=>{n!=null&&n.rdns&&li.excludedRDNS.push(n.rdns)})},async searchWallet({search:t}){var s;const{includeWalletIds:e,excludeWalletIds:r}=qe.state;li.search=[];const{data:n}=await Wi.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:"100",search:t==null?void 0:t.trim(),chains:(s=pe.state.activeCaipNetwork)==null?void 0:s.id,include:e==null?void 0:e.join(","),exclude:r==null?void 0:r.join(",")}}),i=n.map(o=>o.image_id).filter(Boolean);await Promise.allSettled([...i.map(o=>Tt._fetchWalletImage(o)),Be.wait(300)]),li.search=Tt._filterOutExtensions(n)},async reFetchWallets(){li.page=1,li.wallets=[],await Tt.fetchFeaturedWallets(),await Tt.fetchRecommendedWallets()},prefetch(){var e;const t=[Tt.fetchFeaturedWallets(),Tt.fetchRecommendedWallets(),Tt.fetchNetworkImages(),Tt.fetchConnectorImages()];(e=qe.state.features)!=null&&e.analytics&&t.push(Tt.fetchAnalyticsConfig()),li.prefetchPromise=Promise.race([Promise.allSettled(t)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:t}=await Wi.get({path:"/getAnalyticsConfig",headers:Tt._getApiHeaders()});qe.setFeatures({analytics:t})}},Bc=Tn({loading:!1,open:!1,shake:!1}),jt={state:Bc,subscribe(t){return gs(Bc,()=>t(Bc))},subscribeKey(t,e){return Cs(Bc,t,e)},async open(t){await Tt.state.prefetchPromise;const e=pe.state.activeCaipAddress,r=pe.state.noAdapters;t!=null&&t.view?Ce.reset(t.view):e?Ce.reset("Account"):r&&!Be.isMobile()?Ce.reset("ConnectingWalletConnect"):Ce.reset("Connect"),Bc.open=!0,gu.set({open:!0}),ot.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!e}})},close(){const t=!!pe.state.activeCaipAddress;Bc.open=!1,gu.set({open:!1}),ot.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}})},setLoading(t){Bc.loading=t,gu.set({loading:t})},shake(){Bc.shake||(Bc.shake=!0,setTimeout(()=>{Bc.shake=!1},500))}},Vm={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},r_={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},lre={providers:JD,selectedProvider:null,error:null,purchaseCurrency:Vm,paymentCurrency:r_,purchaseCurrencies:[Vm],paymentCurrencies:[],quotesLoading:!1},Br=Tn(lre),Ur={state:Br,subscribe(t){return gs(Br,()=>t(Br))},subscribeKey(t,e){return Cs(Br,t,e)},setSelectedProvider(t){if(t&&t.name==="meld"){const e=XJ,r=pe.state.activeChain===yn.CHAIN.SOLANA?"SOL":"USDC",n=Ee.state.address??"",i=new URL(t.url);i.searchParams.append("publicKey",e),i.searchParams.append("destinationCurrencyCode",r),i.searchParams.append("walletAddress",n),t.url=i.toString()}Br.selectedProvider=t},setPurchaseCurrency(t){Br.purchaseCurrency=t},setPaymentCurrency(t){Br.paymentCurrency=t},setPurchaseAmount(t){this.state.purchaseAmount=t},setPaymentAmount(t){this.state.paymentAmount=t},async getAvailableCurrencies(){const t=await vn.getOnrampOptions();Br.purchaseCurrencies=t.purchaseCurrencies,Br.paymentCurrencies=t.paymentCurrencies,Br.paymentCurrency=t.paymentCurrencies[0]||r_,Br.purchaseCurrency=t.purchaseCurrencies[0]||Vm,await Tt.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await Tt.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;Br.quotesLoading=!0;try{const r=await vn.getOnrampQuote({purchaseCurrency:Br.purchaseCurrency,paymentCurrency:Br.paymentCurrency,amount:((t=Br.paymentAmount)==null?void 0:t.toString())||"0",network:(e=Br.purchaseCurrency)==null?void 0:e.symbol});return Br.quotesLoading=!1,Br.purchaseAmount=Number(r.purchaseAmount.amount),r}catch(r){return Br.error=r.message,Br.quotesLoading=!1,null}finally{Br.quotesLoading=!1}},resetState(){Br.providers=JD,Br.selectedProvider=null,Br.error=null,Br.purchaseCurrency=Vm,Br.paymentCurrency=r_,Br.purchaseCurrencies=[Vm],Br.paymentCurrencies=[],Br.paymentAmount=void 0,Br.purchaseAmount=void 0,Br.quotesLoading=!1}},ui=Tn({loading:!1}),$r={state:ui,subscribe(t){return gs(ui,()=>t(ui))},subscribeKey(t,e){return Cs(ui,t,e)},setToken(t){t&&(ui.token=rc(t))},setTokenAmount(t){ui.sendTokenAmount=t},setReceiverAddress(t){ui.receiverAddress=t},setReceiverProfileImageUrl(t){ui.receiverProfileImageUrl=t},setReceiverProfileName(t){ui.receiverProfileName=t},setGasPrice(t){ui.gasPrice=t},setGasPriceInUsd(t){ui.gasPriceInUSD=t},setLoading(t){ui.loading=t},sendToken(){var t;switch((t=pe.state.activeCaipNetwork)==null?void 0:t.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw new Error("Unsupported chain")}},sendEvmToken(){var t,e,r,n,i;(t=this.state.token)!=null&&t.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(ot.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:((e=pe.state.activeCaipNetwork)==null?void 0:e.id)||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&((r=this.state.token)!=null&&r.quantity.decimals)&&(ot.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:(n=this.state.token)==null?void 0:n.symbol,amount:this.state.sendTokenAmount,network:((i=pe.state.activeCaipNetwork)==null?void 0:i.id)||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async sendNativeToken(t){var s,o,a,c;Ce.pushTransactionStack({view:"Account",goBack:!1});const e=t.receiverAddress,r=Ee.state.address,n=Lt.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),i="0x";try{await Lt.sendTransaction({to:e,address:r,data:i,value:n,gasPrice:t.gasPrice}),St.showSuccess("Transaction started"),ot.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:((s=this.state.token)==null?void 0:s.symbol)||"",amount:t.sendTokenAmount,network:((o=pe.state.activeCaipNetwork)==null?void 0:o.id)||""}}),this.resetSend()}catch{ot.sendEvent({type:"track",event:"SEND_ERROR",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,token:((a=this.state.token)==null?void 0:a.symbol)||"",amount:t.sendTokenAmount,network:((c=pe.state.activeCaipNetwork)==null?void 0:c.id)||""}}),St.showError("Something went wrong")}},async sendERC20Token(t){Ce.pushTransactionStack({view:"Account",goBack:!1});const e=Lt.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));try{Ee.state.address&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress&&(await Lt.writeContract({fromAddress:Ee.state.address,tokenAddress:Be.getPlainAddress(t.tokenAddress),receiverAddress:t.receiverAddress,tokenAmount:e,method:"transfer",abi:QJ}),St.showSuccess("Transaction started"),this.resetSend())}catch{St.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){St.showError("Please enter a valid amount and receiver address");return}Ce.pushTransactionStack({view:"Account",goBack:!1}),Lt.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),Ee.fetchTokenBalance()}).catch(t=>{St.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",t)})},resetSend(){ui.token=void 0,ui.sendTokenAmount=void 0,ui.receiverAddress=void 0,ui.receiverProfileImageUrl=void 0,ui.receiverProfileName=void 0,ui.loading=!1}},ja=Tn({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),uo={state:ja,subscribe(t){return gs(ja,()=>t(ja))},subscribeKey(t,e){return Cs(ja,t,e)},showTooltip({message:t,triggerRect:e,variant:r}){ja.open=!0,ja.message=t,ja.triggerRect=e,ja.variant=r},hide(){ja.open=!1,ja.message="",ja.triggerRect={width:0,height:0,top:0,left:0}}},tP=2147483648,ure={convertEVMChainIdToCoinType(t){if(t>=tP)throw new Error("Invalid chainId");return(tP|t)>>>0}},Go=Tn({suggestions:[],loading:!1}),Hc={state:Go,subscribe(t){return gs(Go,()=>t(Go))},subscribeKey(t,e){return Cs(Go,t,e)},async resolveName(t){var e,r;try{return await vn.lookupEnsName(t)}catch(n){const i=n;throw new Error(((r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description)||"Error resolving name")}},async isNameRegistered(t){try{return await vn.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{Go.loading=!0,Go.suggestions=[];const e=await vn.getEnsNameSuggestions(t);return Go.suggestions=e.suggestions.map(r=>({...r,name:r.name}))||[],Go.suggestions}catch(e){const r=this.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{Go.loading=!1}},async getNamesForAddress(t){try{return pe.state.activeCaipNetwork?await vn.reverseLookupEnsName({address:t}):[]}catch(e){const r=this.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){const e=pe.state.activeCaipNetwork;if(!e)throw new Error("Network not found");const r=Ee.state.address,n=ut.getAuthConnector();if(!r||!n)throw new Error("Address or auth connector not found");Go.loading=!0;try{const i=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now())});Ce.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){Go.loading=!1}});const s=await Lt.signMessage(i),o=Ga.caipNetworkIdToNumber(e.id);if(!o)throw new Error("Network not found");const a=ure.convertEVMChainIdToCoinType(Number(o));await vn.registerEnsName({coinType:a,address:r,signature:s,message:i}),Ee.setProfileName(t,e.chainNamespace),Ce.replace("RegisterAccountNameSuccess")}catch(i){const s=this.parseEnsApiError(i,`Error registering name ${t}`);throw Ce.replace("RegisterAccountName"),new Error(s)}finally{Go.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){var n,i;const r=t;return((i=(n=r==null?void 0:r.reasons)==null?void 0:n[0])==null?void 0:i.description)||e}},dre={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:""},Sr={async fetchWalletImage(t){if(t)return await Tt._fetchWalletImage(t),this.getWalletImageById(t)},getWalletImageById(t){if(t)return An.state.walletImages[t]},getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return An.state.walletImages[t.image_id]},getNetworkImage(t){if(t!=null&&t.imageUrl)return t==null?void 0:t.imageUrl;if(t!=null&&t.imageId)return An.state.networkImages[t.imageId]},getNetworkImageById(t){if(t)return An.state.networkImages[t]},getConnectorImage(t){if(t!=null&&t.imageUrl)return t.imageUrl;if(t!=null&&t.imageId)return An.state.connectorImages[t.imageId]},getChainImage(t){return An.state.networkImages[dre[t]]}};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const nb=globalThis,KA=nb.ShadowRoot&&(nb.ShadyCSS===void 0||nb.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,GA=Symbol(),gR=new WeakMap;let PL=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==GA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(KA&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=gR.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&gR.set(r,e))}return e}toString(){return this.cssText}};const ia=t=>new PL(typeof t=="string"?t:t+"",void 0,GA),Te=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new PL(r,t,GA)},Mre=(t,e)=>{if(KA)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),i=nb.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},mR=KA?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return ia(r)})(t):t;/** + */const Jy=globalThis,DA=Jy.ShadowRoot&&(Jy.ShadyCSS===void 0||Jy.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,LA=Symbol(),rP=new WeakMap;let gL=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==LA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(DA&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=rP.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&rP.set(r,e))}return e}toString(){return this.cssText}};const ta=t=>new gL(typeof t=="string"?t:t+"",void 0,LA),Ie=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new gL(r,t,LA)},fre=(t,e)=>{if(DA)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),i=Jy.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},nP=DA?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return ta(r)})(t):t;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:$re,defineProperty:Ore,getOwnPropertyDescriptor:Dre,getOwnPropertyNames:Lre,getOwnPropertySymbols:Bre,getPrototypeOf:Ure}=Object,Zd=globalThis,wR=Zd.trustedTypes,jre=wR?wR.emptyScript:"",zx=Zd.reactiveElementPolyfillSupport,Zm=(t,e)=>t,o5={toAttribute(t,e){switch(e){case Boolean:t=t?jre:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},ZA=(t,e)=>!$re(t,e),vR={attribute:!0,type:String,converter:o5,reflect:!1,hasChanged:ZA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Zd.litPropertyMetadata??(Zd.litPropertyMetadata=new WeakMap);let gp=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=vR){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Ore(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){const{get:i,set:s}=Dre(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);s.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vR}static _$Ei(){if(this.hasOwnProperty(Zm("elementProperties")))return;const e=Ure(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Zm("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Zm("properties"))){const r=this.properties,n=[...Lre(r),...Bre(r)];for(const i of n)this.createProperty(i,r[i])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(mR(i))}else e!==void 0&&r.push(mR(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Mre(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EC(e,r){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:o5).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,r){var s;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:o5;this._$Em=i,this[i]=a.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){if(n??(n=this.constructor.getPropertyOptions(e)),!(n.hasChanged??ZA)(this[e],r))return;this.P(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,n){this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(r)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}};gp.elementStyles=[],gp.shadowRootOptions={mode:"open"},gp[Zm("elementProperties")]=new Map,gp[Zm("finalized")]=new Map,zx==null||zx({ReactiveElement:gp}),(Zd.reactiveElementVersions??(Zd.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:hre,defineProperty:pre,getOwnPropertyDescriptor:gre,getOwnPropertyNames:mre,getOwnPropertySymbols:wre,getPrototypeOf:vre}=Object,Vd=globalThis,iP=Vd.trustedTypes,yre=iP?iP.emptyScript:"",$x=Vd.reactiveElementPolyfillSupport,Km=(t,e)=>t,e5={toAttribute(t,e){switch(e){case Boolean:t=t?yre:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},BA=(t,e)=>!hre(t,e),sP={attribute:!0,type:String,converter:e5,reflect:!1,hasChanged:BA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Vd.litPropertyMetadata??(Vd.litPropertyMetadata=new WeakMap);let hp=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=sP){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&pre(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){const{get:i,set:s}=gre(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);s.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??sP}static _$Ei(){if(this.hasOwnProperty(Km("elementProperties")))return;const e=vre(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Km("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Km("properties"))){const r=this.properties,n=[...mre(r),...wre(r)];for(const i of n)this.createProperty(i,r[i])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(nP(i))}else e!==void 0&&r.push(nP(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fre(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EC(e,r){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:e5).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,r){var s;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:e5;this._$Em=i,this[i]=a.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){if(n??(n=this.constructor.getPropertyOptions(e)),!(n.hasChanged??BA)(this[e],r))return;this.P(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,n){this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(r)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}};hp.elementStyles=[],hp.shadowRootOptions={mode:"open"},hp[Km("elementProperties")]=new Map,hp[Km("finalized")]=new Map,$x==null||$x({ReactiveElement:hp}),(Vd.reactiveElementVersions??(Vd.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Qm=globalThis,a5=Qm.trustedTypes,yR=a5?a5.createPolicy("lit-html",{createHTML:t=>t}):void 0,NL="$lit$",Id=`lit$${Math.random().toFixed(9).slice(2)}$`,ML="?"+Id,Fre=`<${ML}>`,Fh=document,Ww=()=>Fh.createComment(""),Hw=t=>t===null||typeof t!="object"&&typeof t!="function",QA=Array.isArray,zre=t=>QA(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Wx=`[ -\f\r]`,um=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bR=/-->/g,xR=/>/g,eh=RegExp(`>|${Wx}(?:([^\\s"'>=/]+)(${Wx}*=${Wx}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),CR=/'/g,_R=/"/g,$L=/^(?:script|style|textarea|title)$/i,OL=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),q=OL(1),Fe=OL(2),zh=Symbol.for("lit-noChange"),qn=Symbol.for("lit-nothing"),AR=new WeakMap,ph=Fh.createTreeWalker(Fh,129);function DL(t,e){if(!QA(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return yR!==void 0?yR.createHTML(e):e}const Wre=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"":e===3?"":"",o=um;for(let a=0;a"?(o=i??um,f=-1):d[1]===void 0?f=-2:(f=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?eh:d[3]==='"'?_R:CR):o===_R||o===CR?o=eh:o===bR||o===xR?o=um:(o=eh,i=void 0);const v=o===eh&&t[a+1].startsWith("/>")?" ":"";s+=o===um?c+Fre:f>=0?(n.push(l),c.slice(0,f)+NL+c.slice(f)+Id+v):c+Id+(f===-2?a:v)}return[DL(t,s+(t[r]||"")+(e===2?"":e===3?"":"")),n]};class qw{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,d]=Wre(e,r);if(this.el=qw.createElement(l,n),ph.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=ph.nextNode())!==null&&c.length0){i.textContent=a5?a5.emptyScript:"";for(let v=0;v2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=qn}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=y1(this,e,r,0),o=!Hw(e)||e!==this._$AH&&e!==zh,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c{const n=(r==null?void 0:r.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new YA(e.insertBefore(Ww(),s),s,void 0,r??{})}return i._$AI(t),i};/** + */const Gm=globalThis,t5=Gm.trustedTypes,oP=t5?t5.createPolicy("lit-html",{createHTML:t=>t}):void 0,mL="$lit$",Ad=`lit$${Math.random().toFixed(9).slice(2)}$`,wL="?"+Ad,bre=`<${wL}>`,Uh=document,Fw=()=>Uh.createComment(""),zw=t=>t===null||typeof t!="object"&&typeof t!="function",UA=Array.isArray,xre=t=>UA(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Dx=`[ +\f\r]`,cm=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aP=/-->/g,cP=/>/g,Jf=RegExp(`>|${Dx}(?:([^\\s"'>=/]+)(${Dx}*=${Dx}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),lP=/'/g,uP=/"/g,vL=/^(?:script|style|textarea|title)$/i,yL=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),q=yL(1),je=yL(2),jh=Symbol.for("lit-noChange"),Wn=Symbol.for("lit-nothing"),dP=new WeakMap,fh=Uh.createTreeWalker(Uh,129);function bL(t,e){if(!UA(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return oP!==void 0?oP.createHTML(e):e}const _re=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"":e===3?"":"",o=cm;for(let a=0;a"?(o=i??cm,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?Jf:d[3]==='"'?uP:lP):o===uP||o===lP?o=Jf:o===aP||o===cP?o=cm:(o=Jf,i=void 0);const v=o===Jf&&t[a+1].startsWith("/>")?" ":"";s+=o===cm?c+bre:h>=0?(n.push(l),c.slice(0,h)+mL+c.slice(h)+Ad+v):c+Ad+(h===-2?a:v)}return[bL(t,s+(t[r]||"")+(e===2?"":e===3?"":"")),n]};class Ww{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,d]=_re(e,r);if(this.el=Ww.createElement(l,n),fh.currentNode=this.el.content,r===2||r===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=fh.nextNode())!==null&&c.length0){i.textContent=t5?t5.emptyScript:"";for(let v=0;v2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Wn}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=w1(this,e,r,0),o=!zw(e)||e!==this._$AH&&e!==jh,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c{const n=(r==null?void 0:r.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new jA(e.insertBefore(Fw(),s),s,void 0,r??{})}return i._$AI(t),i};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let _e=class extends gp{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=Zre(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return zh}};var j$;_e._$litElement$=!0,_e.finalized=!0,(j$=globalThis.litElementHydrateSupport)==null||j$.call(globalThis,{LitElement:_e});const qx=globalThis.litElementPolyfillSupport;qx==null||qx({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let Ym,Qd,Yd;function yAe(t,e){Ym=document.createElement("style"),Qd=document.createElement("style"),Yd=document.createElement("style"),Ym.textContent=Kp(t).core.cssText,Qd.textContent=Kp(t).dark.cssText,Yd.textContent=Kp(t).light.cssText,document.head.appendChild(Ym),document.head.appendChild(Qd),document.head.appendChild(Yd),BL(e)}function BL(t){Qd&&Yd&&(t==="light"?(Qd.removeAttribute("media"),Yd.media="enabled"):(Yd.removeAttribute("media"),Qd.media="enabled"))}function Qre(t){Ym&&Qd&&Yd&&(Ym.textContent=Kp(t).core.cssText,Qd.textContent=Kp(t).dark.cssText,Yd.textContent=Kp(t).light.cssText)}function Kp(t){return{core:Te` + */let _e=class extends hp{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=Tre(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return jh}};var AO;_e._$litElement$=!0,_e.finalized=!0,(AO=globalThis.litElementHydrateSupport)==null||AO.call(globalThis,{LitElement:_e});const Bx=globalThis.litElementPolyfillSupport;Bx==null||Bx({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let Zm,Kd,Gd;function QCe(t,e){Zm=document.createElement("style"),Kd=document.createElement("style"),Gd=document.createElement("style"),Zm.textContent=qp(t).core.cssText,Kd.textContent=qp(t).dark.cssText,Gd.textContent=qp(t).light.cssText,document.head.appendChild(Zm),document.head.appendChild(Kd),document.head.appendChild(Gd),_L(e)}function _L(t){Kd&&Gd&&(t==="light"?(Kd.removeAttribute("media"),Gd.media="enabled"):(Gd.removeAttribute("media"),Kd.media="enabled"))}function kre(t){Zm&&Kd&&Gd&&(Zm.textContent=qp(t).core.cssText,Kd.textContent=qp(t).dark.cssText,Gd.textContent=qp(t).light.cssText)}function qp(t){return{core:Ie` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); @keyframes w3m-shake { 0% { @@ -113,11 +113,11 @@ Error generating stack: `+s.message+` } :root { --w3m-modal-width: 360px; - --w3m-color-mix-strength: ${ia(t!=null&&t["--w3m-color-mix-strength"]?`${t["--w3m-color-mix-strength"]}%`:"0%")}; - --w3m-font-family: ${ia((t==null?void 0:t["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; - --w3m-font-size-master: ${ia((t==null?void 0:t["--w3m-font-size-master"])||"10px")}; - --w3m-border-radius-master: ${ia((t==null?void 0:t["--w3m-border-radius-master"])||"4px")}; - --w3m-z-index: ${ia((t==null?void 0:t["--w3m-z-index"])||999)}; + --w3m-color-mix-strength: ${ta(t!=null&&t["--w3m-color-mix-strength"]?`${t["--w3m-color-mix-strength"]}%`:"0%")}; + --w3m-font-family: ${ta((t==null?void 0:t["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; + --w3m-font-size-master: ${ta((t==null?void 0:t["--w3m-font-size-master"])||"10px")}; + --w3m-border-radius-master: ${ta((t==null?void 0:t["--w3m-border-radius-master"])||"4px")}; + --w3m-z-index: ${ta((t==null?void 0:t["--w3m-z-index"])||999)}; --wui-font-family: var(--w3m-font-family); @@ -480,13 +480,13 @@ Error generating stack: `+s.message+` ); } } - `,light:Te` + `,light:Ie` :root { - --w3m-color-mix: ${ia((t==null?void 0:t["--w3m-color-mix"])||"#fff")}; - --w3m-accent: ${ia(wu(t,"dark")["--w3m-accent"])}; + --w3m-color-mix: ${ta((t==null?void 0:t["--w3m-color-mix"])||"#fff")}; + --w3m-accent: ${ta(pu(t,"dark")["--w3m-accent"])}; --w3m-default: #fff; - --wui-color-modal-bg-base: ${ia(wu(t,"dark")["--w3m-background"])}; + --wui-color-modal-bg-base: ${ta(pu(t,"dark")["--w3m-background"])}; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-blueberry-100: hsla(230, 100%, 67%, 1); @@ -562,13 +562,13 @@ Error generating stack: `+s.message+` --wui-thumbnail-border-base: #252525; } - `,dark:Te` + `,dark:Ie` :root { - --w3m-color-mix: ${ia((t==null?void 0:t["--w3m-color-mix"])||"#000")}; - --w3m-accent: ${ia(wu(t,"light")["--w3m-accent"])}; + --w3m-color-mix: ${ta((t==null?void 0:t["--w3m-color-mix"])||"#000")}; + --w3m-accent: ${ta(pu(t,"light")["--w3m-accent"])}; --w3m-default: #000; - --wui-color-modal-bg-base: ${ia(wu(t,"light")["--w3m-background"])}; + --wui-color-modal-bg-base: ${ta(pu(t,"light")["--w3m-background"])}; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-blueberry-100: hsla(231, 100%, 70%, 1); @@ -643,7 +643,7 @@ Error generating stack: `+s.message+` --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8); --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9); } - `}}const ct=Te` + `}}const ct=Ie` *, *::after, *::before, @@ -659,7 +659,7 @@ Error generating stack: `+s.message+` font-family: var(--wui-font-family); backface-visibility: hidden; } -`,Xt=Te` +`,Xt=Ie` button, a { cursor: pointer; @@ -708,7 +708,7 @@ Error generating stack: `+s.message+` outline: none; appearance: none; } -`,D6=Te` +`,k6=Ie` .wui-color-inherit { color: var(--wui-color-inherit); } @@ -780,7 +780,7 @@ Error generating stack: `+s.message+` .wui-bg-color-fg-300 { background-color: var(--wui-color-fg-300); } -`;function Yre(t,e){const{kind:r,elements:n}=e;return{kind:r,elements:n,finisher(i){customElements.get(t)||customElements.define(t,i)}}}function Jre(t,e){return customElements.get(t)||customElements.define(t,e),e}function ye(t){return function(r){return typeof r=="function"?Jre(t,r):Yre(t,r)}}const Xre=Te` +`;function Pre(t,e){const{kind:r,elements:n}=e;return{kind:r,elements:n,finisher(i){customElements.get(t)||customElements.define(t,i)}}}function Rre(t,e){return customElements.get(t)||customElements.define(t,e),e}function ve(t){return function(r){return typeof r=="function"?Rre(t,r):Pre(t,r)}}const Nre=Ie` :host { display: block; border-radius: clamp(0px, var(--wui-border-radius-l), 44px); @@ -788,15 +788,15 @@ Error generating stack: `+s.message+` background-color: var(--wui-color-modal-bg); overflow: hidden; } -`;var ene=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let dC=class extends _e{render(){return q``}};dC.styles=[ct,Xre];dC=ene([ye("wui-card")],dC);/** +`;var Mre=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let n_=class extends _e{render(){return q``}};n_.styles=[ct,Nre];n_=Mre([ve("wui-card")],n_);/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const tne={attribute:!0,type:String,converter:o5,reflect:!1,hasChanged:ZA},rne=(t=tne,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),n==="accessor"){const{name:o}=r;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,t)},init(a){return a!==void 0&&this.P(o,void 0,t),a}}}if(n==="setter"){const{name:o}=r;return function(a){const c=this[o];e.call(this,a),this.requestUpdate(o,c,t)}}throw Error("Unsupported decorator location: "+n)};function Y(t){return(e,r)=>typeof r=="object"?rne(t,e,r):((n,i,s)=>{const o=i.hasOwnProperty(s);return i.constructor.createProperty(s,o?{...n,wrapped:!0}:n),o?Object.getOwnPropertyDescriptor(i,s):void 0})(t,e,r)}/** + */const Ore={attribute:!0,type:String,converter:e5,reflect:!1,hasChanged:BA},$re=(t=Ore,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),n==="accessor"){const{name:o}=r;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,t)},init(a){return a!==void 0&&this.P(o,void 0,t),a}}}if(n==="setter"){const{name:o}=r;return function(a){const c=this[o];e.call(this,a),this.requestUpdate(o,c,t)}}throw Error("Unsupported decorator location: "+n)};function Q(t){return(e,r)=>typeof r=="object"?$re(t,e,r):((n,i,s)=>{const o=i.hasOwnProperty(s);return i.constructor.createProperty(s,o?{...n,wrapped:!0}:n),o?Object.getOwnPropertyDescriptor(i,s):void 0})(t,e,r)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function le(t){return Y({...t,state:!0,attribute:!1})}const nne=Te` + */function ae(t){return Q({...t,state:!0,attribute:!1})}const Dre=Ie` :host { display: flex; aspect-ratio: 1 / 1; @@ -810,7 +810,7 @@ Error generating stack: `+s.message+` object-fit: contain; object-position: center; } -`,ine=Fe``,sne=Fe` +>`,Bre=je` -`,one=Fe``,Ure=je` @@ -839,7 +839,7 @@ Error generating stack: `+s.message+` d="M10.5 2.42908C6.31875 2.42908 2.92859 5.81989 2.92859 10.0034C2.92859 14.1869 6.31875 17.5777 10.5 17.5777C14.6813 17.5777 18.0714 14.1869 18.0714 10.0034C18.0714 5.81989 14.6813 2.42908 10.5 2.42908ZM0.928589 10.0034C0.928589 4.71596 5.21355 0.429077 10.5 0.429077C15.7865 0.429077 20.0714 4.71596 20.0714 10.0034C20.0714 15.2908 15.7865 19.5777 10.5 19.5777C5.21355 19.5777 0.928589 15.2908 0.928589 10.0034ZM10.5 5.75003C11.0523 5.75003 11.5 6.19774 11.5 6.75003L11.5 10.8343L12.7929 9.54137C13.1834 9.15085 13.8166 9.15085 14.2071 9.54137C14.5976 9.9319 14.5976 10.5651 14.2071 10.9556L11.2071 13.9556C10.8166 14.3461 10.1834 14.3461 9.79291 13.9556L6.79291 10.9556C6.40239 10.5651 6.40239 9.9319 6.79291 9.54137C7.18343 9.15085 7.8166 9.15085 8.20712 9.54137L9.50002 10.8343L9.50002 6.75003C9.50002 6.19774 9.94773 5.75003 10.5 5.75003Z" clip-rule="evenodd" />`,ane=Fe` +>`,jre=je` -`,cne=Fe` +`,Fre=je` @@ -872,35 +872,35 @@ Error generating stack: `+s.message+` -`,lne=Fe` +`,zre=je` -`,une=Fe` +`,Wre=je` -`,dne=Fe` +`,Hre=je` -`,fne=Fe` +`,qre=je` -`,hne=Fe``,Vre=je``,pne=Fe` +>`,Kre=je` -`,gne=Fe``,Gre=je``,mne=Fe` +>`,Zre=je` -`,wne=Fe``,Qre=je` @@ -956,35 +956,35 @@ Error generating stack: `+s.message+` d="M25.5297 4.92733C26.1221 5.4242 26.1996 6.30724 25.7027 6.89966L12.2836 22.8997C12.0316 23.2001 11.6652 23.3811 11.2735 23.3986C10.8817 23.4161 10.5006 23.2686 10.2228 22.9919L2.38218 15.1815C1.83439 14.6358 1.83268 13.7494 2.37835 13.2016C2.92403 12.6538 3.81046 12.6521 4.35825 13.1978L11.1183 19.9317L23.5573 5.10036C24.0542 4.50794 24.9372 4.43047 25.5297 4.92733Z" fill="#26D962"/> -`,vne=Fe` +`,Yre=je` -`,yne=Fe` +`,Jre=je` -`,bne=Fe` +`,Xre=je` -`,xne=Fe` +`,ene=je` -`,Cne=Fe` +`,tne=je` -`,_ne=Fe` +`,rne=je` -`,Ane=Fe` +`,nne=je` -`,Ene=Fe` +`,ine=je` -`,Sne=Fe` +`,sne=je` -`,Ine=Fe``,one=je``,Tne=Fe` +>`,ane=je` -`,kne=Fe` +`,cne=je` - `,Rne=Fe` + `,lne=je` -`,Pne=Fe` +`,une=je` -`,Nne=Fe` +`,dne=je` @@ -1130,26 +1130,26 @@ Error generating stack: `+s.message+` -`,Mne=Fe` +`,fne=je` -`,$ne=Fe` +`,hne=je` -`,One=Fe` +`,pne=je` -`,Dne=Fe` +`,gne=je` @@ -1174,7 +1174,7 @@ Error generating stack: `+s.message+` -`,Lne=Fe` +`,mne=je` -`,Bne=Fe` +`,wne=je` -`,Une=Fe` +`,vne=je` @@ -1209,7 +1209,7 @@ Error generating stack: `+s.message+` -`,jne=Fe` +`,yne=je` -`,Fne=Fe` +`,bne=je` -`,zne=Fe` +`,xne=je` -`,Wne=Fe` +`,_ne=je` -`,Hne=Fe` +`,Cne=je` -`,qne=Fe` +`,Ane=je` -`,Vne=Fe` +`,Ene=je` -`,Kne=Fe` +`,Sne=je` -`,Gne=Fe` +`,Ine=je` -`,Zne=Fe` +`,Tne=je` -`,Qne=Fe` `,kne=je` -`,Yne=Fe``,Pne=je``,Jne=Fe` +>`,Rne=je` -`,Xne=Fe``,Nne=je` @@ -1359,21 +1359,21 @@ Error generating stack: `+s.message+` fill="currentColor" d="M8.8071 0.292893C9.19763 0.683417 9.19763 1.31658 8.8071 1.70711L6.91421 3.6H11.8404C14.3368 3.6 16.5533 5.1975 17.3427 7.56588L17.4487 7.88377C17.6233 8.40772 17.3402 8.97404 16.8162 9.14868C16.2923 9.32333 15.726 9.04017 15.5513 8.51623L15.4453 8.19834C14.9281 6.64664 13.476 5.6 11.8404 5.6H6.91421L8.8071 7.49289C9.19763 7.88342 9.19763 8.51658 8.8071 8.90711C8.41658 9.29763 7.78341 9.29763 7.39289 8.90711L3.79289 5.30711C3.40236 4.91658 3.40236 4.28342 3.79289 3.89289L7.39289 0.292893C7.78341 -0.0976311 8.41658 -0.0976311 8.8071 0.292893ZM4.18377 10.8513C4.70771 10.6767 5.27403 10.9598 5.44868 11.4838L5.55464 11.8017C6.07188 13.3534 7.52401 14.4 9.15964 14.4L14.0858 14.4L12.1929 12.5071C11.8024 12.1166 11.8024 11.4834 12.1929 11.0929C12.5834 10.7024 13.2166 10.7024 13.6071 11.0929L17.2071 14.6929C17.5976 15.0834 17.5976 15.7166 17.2071 16.1071L13.6071 19.7071C13.2166 20.0976 12.5834 20.0976 12.1929 19.7071C11.8024 19.3166 11.8024 18.6834 12.1929 18.2929L14.0858 16.4L9.15964 16.4C6.66314 16.4 4.44674 14.8025 3.65728 12.4341L3.55131 12.1162C3.37667 11.5923 3.65983 11.026 4.18377 10.8513Z" />`,eie=Fe` +>`,Mne=je` -`,tie=Fe` +`,One=je` -`,rie=Fe` +`,$ne=je` `,nie=Fe` +>`,Dne=je` -`,iie=Fe` +`,Lne=je` -`,sie=Fe``,Bne=je` -`,oie=Fe` +`,Une=je` -`,aie=Fe` +`,jne=je` -`,cie=Fe` +`,Fne=je` @@ -1445,11 +1445,11 @@ Error generating stack: `+s.message+` -`,lie=Fe` +`,zne=je` -`,uie=Fe` +`,Wne=je` @@ -1466,26 +1466,26 @@ Error generating stack: `+s.message+` -`,die=Fe` +`,Hne=je` -`,fie=Fe` +`,qne=je` -`,hie=Fe` +`,Vne=je` -`,pie=Fe` +`,Kne=je` -`,gie=Fe` +`,Gne=je` -`,mie=Fe` +`,Zne=je` -`,wie=Fe` +`,Qne=je` -`,vie=Fe` +`,Yne=je` -`,yie=Fe``,Jne=je` -`,ER=Fe` +`,fP=je` -`;var L6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const bie={add:ine,allWallets:sne,arrowBottomCircle:one,appStore:ane,apple:cne,arrowBottom:lne,arrowLeft:une,arrowRight:dne,arrowTop:fne,bank:hne,browser:pne,card:gne,checkmark:wne,checkmarkBold:mne,chevronBottom:vne,chevronLeft:yne,chevronRight:bne,chevronTop:xne,chromeStore:Cne,clock:_ne,close:Ane,compass:Sne,coinPlaceholder:Ene,copy:Ine,cursor:Tne,cursorTransparent:kne,desktop:Rne,disconnect:Pne,discord:Nne,etherscan:Mne,extension:$ne,externalLink:One,facebook:Dne,farcaster:Lne,filters:Bne,github:Une,google:jne,helpCircle:Fne,image:zne,id:yie,infoCircle:Wne,lightbulb:vie,mail:Hne,mobile:qne,more:Vne,networkPlaceholder:Kne,nftPlaceholder:Gne,off:Zne,playStore:Qne,plus:Yne,qrCode:Jne,recycleHorizontal:Xne,refresh:eie,search:tie,send:rie,swapHorizontal:nie,swapHorizontalMedium:sie,swapHorizontalBold:iie,swapHorizontalRoundedBold:oie,swapVertical:aie,telegram:cie,threeDots:lie,twitch:uie,twitter:ER,twitterIcon:die,verify:fie,verifyFilled:hie,wallet:gie,walletConnect:mie,walletPlaceholder:pie,warningCircle:wie,x:ER};let b1=class extends _e{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` +`;var P6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Xne={add:Lre,allWallets:Bre,arrowBottomCircle:Ure,appStore:jre,apple:Fre,arrowBottom:zre,arrowLeft:Wre,arrowRight:Hre,arrowTop:qre,bank:Vre,browser:Kre,card:Gre,checkmark:Qre,checkmarkBold:Zre,chevronBottom:Yre,chevronLeft:Jre,chevronRight:Xre,chevronTop:ene,chromeStore:tne,clock:rne,close:nne,compass:sne,coinPlaceholder:ine,copy:one,cursor:ane,cursorTransparent:cne,desktop:lne,disconnect:une,discord:dne,etherscan:fne,extension:hne,externalLink:pne,facebook:gne,farcaster:mne,filters:wne,github:vne,google:yne,helpCircle:bne,image:xne,id:Jne,infoCircle:_ne,lightbulb:Yne,mail:Cne,mobile:Ane,more:Ene,networkPlaceholder:Sne,nftPlaceholder:Ine,off:Tne,playStore:kne,plus:Pne,qrCode:Rne,recycleHorizontal:Nne,refresh:Mne,search:One,send:$ne,swapHorizontal:Dne,swapHorizontalMedium:Bne,swapHorizontalBold:Lne,swapHorizontalRoundedBold:Une,swapVertical:jne,telegram:Fne,threeDots:zne,twitch:Wne,twitter:fP,twitterIcon:Hne,verify:qne,verifyFilled:Vne,wallet:Gne,walletConnect:Zne,walletPlaceholder:Kne,warningCircle:Qne,x:fP};let v1=class extends _e{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` --local-color: ${`var(--wui-color-${this.color});`} --local-width: ${`var(--wui-icon-size-${this.size});`} - `,q`${bie[this.name]}`}};b1.styles=[ct,D6,nne];L6([Y()],b1.prototype,"size",void 0);L6([Y()],b1.prototype,"name",void 0);L6([Y()],b1.prototype,"color",void 0);b1=L6([ye("wui-icon")],b1);const xie=Te` + `,q`${Xne[this.name]}`}};v1.styles=[ct,k6,Dre];P6([Q()],v1.prototype,"size",void 0);P6([Q()],v1.prototype,"name",void 0);P6([Q()],v1.prototype,"color",void 0);v1=P6([ve("wui-icon")],v1);const eie=Ie` :host { display: block; width: var(--local-width); @@ -1568,10 +1568,10 @@ Error generating stack: `+s.message+` object-position: center center; border-radius: inherit; } -`;var B6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let x1=class extends _e{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` +`;var R6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let y1=class extends _e{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; - `,q`${this.alt}`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};x1.styles=[ct,D6,xie];B6([Y()],x1.prototype,"src",void 0);B6([Y()],x1.prototype,"alt",void 0);B6([Y()],x1.prototype,"size",void 0);x1=B6([ye("wui-image")],x1);const Cie=Te` + `,q`${this.alt}`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};y1.styles=[ct,k6,eie];R6([Q()],y1.prototype,"src",void 0);R6([Q()],y1.prototype,"alt",void 0);R6([Q()],y1.prototype,"size",void 0);y1=R6([ve("wui-image")],y1);const tie=Ie` :host { display: block; width: var(--wui-box-size-lg); @@ -1599,7 +1599,7 @@ Error generating stack: `+s.message+` stroke-dashoffset: 0px; } } -`;var _ie=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let fC=class extends _e{render(){return q` +`;var rie=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let i_=class extends _e{render(){return q` - `}};fC.styles=[ct,Cie];fC=_ie([ye("wui-loading-hexagon")],fC);const Aie=Te` + `}};i_.styles=[ct,tie];i_=rie([ve("wui-loading-hexagon")],i_);const nie=Ie` :host { display: flex; } @@ -1675,9 +1675,9 @@ Error generating stack: `+s.message+` stroke-dashoffset: -125; } } -`;var JA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Vw=class extends _e{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,q` +`;var FA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Hw=class extends _e{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,q` - `}};Vw.styles=[ct,Aie];JA([Y()],Vw.prototype,"color",void 0);JA([Y()],Vw.prototype,"size",void 0);Vw=JA([ye("wui-loading-spinner")],Vw);const Eie=Te` + `}};Hw.styles=[ct,nie];FA([Q()],Hw.prototype,"color",void 0);FA([Q()],Hw.prototype,"size",void 0);Hw=FA([ve("wui-loading-spinner")],Hw);const iie=Ie` :host { display: block; width: var(--wui-box-size-md); @@ -1702,7 +1702,7 @@ Error generating stack: `+s.message+` stroke-dashoffset: 0px; } } -`;var UL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let c5=class extends _e{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,n=36-e,i=116+n,s=245+n,o=360+n*1.75;return q` +`;var CL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let r5=class extends _e{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,n=36-e,i=116+n,s=245+n,o=360+n*1.75;return q` - `}};c5.styles=[ct,Eie];UL([Y({type:Number})],c5.prototype,"radius",void 0);c5=UL([ye("wui-loading-thumbnail")],c5);const Sie=Te` + `}};r5.styles=[ct,iie];CL([Q({type:Number})],r5.prototype,"radius",void 0);r5=CL([ve("wui-loading-thumbnail")],r5);const sie=Ie` :host { display: block; box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); @@ -1754,19 +1754,19 @@ Error generating stack: `+s.message+` background-position: 250% 0; } } -`;var i2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Wh=class extends _e{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` +`;var r2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Fh=class extends _e{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` width: ${this.width}; height: ${this.height}; border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; - `,q``}};Wh.styles=[Sie];i2([Y()],Wh.prototype,"width",void 0);i2([Y()],Wh.prototype,"height",void 0);i2([Y()],Wh.prototype,"borderRadius",void 0);i2([Y()],Wh.prototype,"variant",void 0);Wh=i2([ye("wui-shimmer")],Wh);/** + `,q``}};Fh.styles=[sie];r2([Q()],Fh.prototype,"width",void 0);r2([Q()],Fh.prototype,"height",void 0);r2([Q()],Fh.prototype,"borderRadius",void 0);r2([Q()],Fh.prototype,"variant",void 0);Fh=r2([ve("wui-shimmer")],Fh);/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const jL={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},FL=t=>(...e)=>({_$litDirective$:t,values:e});let zL=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this.t=e,this._$AM=r,this.i=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** + */const AL={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},EL=t=>(...e)=>({_$litDirective$:t,values:e});let SL=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this.t=e,this._$AM=r,this.i=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const WL=FL(class extends zL{constructor(t){var e;if(super(t),t.type!==jL.ATTRIBUTE||t.name!=="class"||((e=t.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var n,i;if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((n=this.nt)!=null&&n.has(s))&&this.st.add(s);return this.render(e)}const r=t.element.classList;for(const s of this.st)s in e||(r.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(i=this.nt)!=null&&i.has(s)||(o?(r.add(s),this.st.add(s)):(r.remove(s),this.st.delete(s)))}return zh}}),Iie=Te` + */const IL=EL(class extends SL{constructor(t){var e;if(super(t),t.type!==AL.ATTRIBUTE||t.name!=="class"||((e=t.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var n,i;if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((n=this.nt)!=null&&n.has(s))&&this.st.add(s);return this.render(e)}const r=t.element.classList;for(const s of this.st)s in e||(r.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(i=this.nt)!=null&&i.has(s)||(o?(r.add(s),this.st.add(s)):(r.remove(s),this.st.delete(s)))}return jh}}),oie=Ie` :host { display: inline-flex !important; } @@ -1900,10 +1900,10 @@ Error generating stack: `+s.message+` :host([disabled]) { opacity: 0.4; } -`;var s2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Hh=class extends _e{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=` +`;var n2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let zh=class extends _e{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=` --local-align: ${this.align}; --local-color: var(--wui-color-${this.color}); - `,q``}};Hh.styles=[ct,Iie];s2([Y()],Hh.prototype,"variant",void 0);s2([Y()],Hh.prototype,"color",void 0);s2([Y()],Hh.prototype,"align",void 0);s2([Y()],Hh.prototype,"lineClamp",void 0);Hh=s2([ye("wui-text")],Hh);const Tie=Fe` + `,q``}};zh.styles=[ct,oie];n2([Q()],zh.prototype,"variant",void 0);n2([Q()],zh.prototype,"color",void 0);n2([Q()],zh.prototype,"align",void 0);n2([Q()],zh.prototype,"lineClamp",void 0);zh=n2([ve("wui-text")],zh);const aie=je` - `,kie=Fe` + `,cie=je` - `,Rie=Fe` + `,lie=je` -`,Pie=Fe` +`,uie=je` - `,Nie=Fe` + `,die=je` - `,Mie=Fe` + `,fie=je` -`,$ie=Fe` +`,hie=je` -`,Oie=Fe` +`,pie=je` - `,Die=Fe` + `,gie=je` @@ -2134,7 +2134,7 @@ Error generating stack: `+s.message+` -`,Lie=Fe` +`,mie=je` - `,Bie=Fe` + `,wie=je` -`,Uie=Fe``,vie=je` @@ -2202,7 +2202,7 @@ Error generating stack: `+s.message+` - `,jie=Fe` + `,yie=je` - `,Fie=Fe` + `,bie=je` @@ -2243,7 +2243,7 @@ Error generating stack: `+s.message+` -`,zie=Fe` +`,xie=je` -`,Wie=Fe` +`,_ie=je` -`,Hie=Fe` +`,Cie=je` -`,qie=Fe` +`,Aie=je` @@ -2329,7 +2329,7 @@ Error generating stack: `+s.message+` -`,Vie=Fe` +`,Eie=je` @@ -2339,7 +2339,7 @@ Error generating stack: `+s.message+` -`,Kie=Fe` +`,Sie=je` @@ -2358,7 +2358,7 @@ Error generating stack: `+s.message+` -`,Gie=Fe` +`,Iie=je` @@ -2375,7 +2375,7 @@ Error generating stack: `+s.message+` -`,Zie=Fe` +`,Tie=je` @@ -2404,7 +2404,7 @@ Error generating stack: `+s.message+` -`,Qie=Te` +`,kie=Ie` :host { display: block; width: var(--local-size); @@ -2415,7 +2415,7 @@ Error generating stack: `+s.message+` width: 100%; height: 100%; } -`,Yie=Fe` +`,Pie=je` - `;var XA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Jie={browser:Tie,dao:kie,defi:Rie,defiAlt:Pie,eth:Nie,layers:Mie,lock:$ie,login:Oie,network:Die,nft:Lie,noun:Bie,profile:Uie,system:jie,coinbase:Fie,meld:Zie,onrampCard:qie,moonpay:zie,stripe:Wie,paypal:Hie,google:Vie,pencil:Kie,lightbulb:Gie,solana:Yie};let Kw=class extends _e{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` + `;var zA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Rie={browser:aie,dao:cie,defi:lie,defiAlt:uie,eth:die,layers:fie,lock:hie,login:pie,network:gie,nft:mie,noun:wie,profile:vie,system:yie,coinbase:bie,meld:Tie,onrampCard:Aie,moonpay:xie,stripe:_ie,paypal:Cie,google:Eie,pencil:Sie,lightbulb:Iie,solana:Pie};let qw=class extends _e{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` --local-size: var(--wui-visual-size-${this.size}); - `,q`${Jie[this.name]}`}};Kw.styles=[ct,Qie];XA([Y()],Kw.prototype,"name",void 0);XA([Y()],Kw.prototype,"size",void 0);Kw=XA([ye("wui-visual")],Kw);/** + `,q`${Rie[this.name]}`}};qw.styles=[ct,kie];zA([Q()],qw.prototype,"name",void 0);zA([Q()],qw.prototype,"size",void 0);qw=zA([ve("wui-visual")],qw);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const tt=t=>t??qn,Rt={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:n}){return t.length<=e+r?t:n==="end"?`${t.substring(0,e)}...`:n==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),n=this.hexToRgb(r),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),o=100-3*Number(i==null?void 0:i.replace("px","")),a=`${o}% ${o}% at 65% 40%`,c=[];for(let l=0;l<5;l+=1){const d=this.tintColor(n,.15*l);c.push(`rgb(${d[0]}, ${d[1]}, ${d[2]})`)}return` + */const et=t=>t??Wn,Pt={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:n}){return t.length<=e+r?t:n==="end"?`${t.substring(0,e)}...`:n==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),n=this.hexToRgb(r),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),o=100-3*Number(i==null?void 0:i.replace("px","")),a=`${o}% ${o}% at 65% 40%`,c=[];for(let l=0;l<5;l+=1){const d=this.tintColor(n,.15*l);c.push(`rgb(${d[0]}, ${d[1]}, ${d[2]})`)}return` --local-color-1: ${c[0]}; --local-color-2: ${c[1]}; --local-color-3: ${c[2]}; --local-color-4: ${c[3]}; --local-color-5: ${c[4]}; --local-radial-circle: ${a} - `},hexToRgb(t){const e=parseInt(t,16),r=e>>16&255,n=e>>8&255,i=e&255;return[r,n,i]},tintColor(t,e){const[r,n,i]=t,s=Math.round(r+(255-r)*e),o=Math.round(n+(255-n)*e),a=Math.round(i+(255-i)*e);return[s,o,a]},isNumber(t){return{number:/^[0-9]+$/u}.number.test(t)},getColorTheme(t){return t||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(t){const e=t.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(t,e,r){return t.toString().length>=e?Number(t).toFixed(r):t},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},Xie=Te` + `},hexToRgb(t){const e=parseInt(t,16),r=e>>16&255,n=e>>8&255,i=e&255;return[r,n,i]},tintColor(t,e){const[r,n,i]=t,s=Math.round(r+(255-r)*e),o=Math.round(n+(255-n)*e),a=Math.round(i+(255-i)*e);return[s,o,a]},isNumber(t){return{number:/^[0-9]+$/u}.number.test(t)},getColorTheme(t){return t||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(t){const e=t.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(t,e,r){return t.toString().length>=e?Number(t).toFixed(r):t},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},Nie=Ie` :host { display: flex; width: inherit; height: inherit; } -`;var Po=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Cs=class extends _e{render(){return this.style.cssText=` +`;var To=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ws=class extends _e{render(){return this.style.cssText=` flex-direction: ${this.flexDirection}; flex-wrap: ${this.flexWrap}; flex-basis: ${this.flexBasis}; @@ -2469,15 +2469,15 @@ Error generating stack: `+s.message+` column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; - padding-top: ${this.padding&&Rt.getSpacingStyles(this.padding,0)}; - padding-right: ${this.padding&&Rt.getSpacingStyles(this.padding,1)}; - padding-bottom: ${this.padding&&Rt.getSpacingStyles(this.padding,2)}; - padding-left: ${this.padding&&Rt.getSpacingStyles(this.padding,3)}; - margin-top: ${this.margin&&Rt.getSpacingStyles(this.margin,0)}; - margin-right: ${this.margin&&Rt.getSpacingStyles(this.margin,1)}; - margin-bottom: ${this.margin&&Rt.getSpacingStyles(this.margin,2)}; - margin-left: ${this.margin&&Rt.getSpacingStyles(this.margin,3)}; - `,q``}};Cs.styles=[ct,Xie];Po([Y()],Cs.prototype,"flexDirection",void 0);Po([Y()],Cs.prototype,"flexWrap",void 0);Po([Y()],Cs.prototype,"flexBasis",void 0);Po([Y()],Cs.prototype,"flexGrow",void 0);Po([Y()],Cs.prototype,"flexShrink",void 0);Po([Y()],Cs.prototype,"alignItems",void 0);Po([Y()],Cs.prototype,"justifyContent",void 0);Po([Y()],Cs.prototype,"columnGap",void 0);Po([Y()],Cs.prototype,"rowGap",void 0);Po([Y()],Cs.prototype,"gap",void 0);Po([Y()],Cs.prototype,"padding",void 0);Po([Y()],Cs.prototype,"margin",void 0);Cs=Po([ye("wui-flex")],Cs);const ese=Te` + padding-top: ${this.padding&&Pt.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&Pt.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&Pt.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&Pt.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&Pt.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&Pt.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&Pt.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&Pt.getSpacingStyles(this.margin,3)}; + `,q``}};ws.styles=[ct,Nie];To([Q()],ws.prototype,"flexDirection",void 0);To([Q()],ws.prototype,"flexWrap",void 0);To([Q()],ws.prototype,"flexBasis",void 0);To([Q()],ws.prototype,"flexGrow",void 0);To([Q()],ws.prototype,"flexShrink",void 0);To([Q()],ws.prototype,"alignItems",void 0);To([Q()],ws.prototype,"justifyContent",void 0);To([Q()],ws.prototype,"columnGap",void 0);To([Q()],ws.prototype,"rowGap",void 0);To([Q()],ws.prototype,"gap",void 0);To([Q()],ws.prototype,"padding",void 0);To([Q()],ws.prototype,"margin",void 0);ws=To([ve("wui-flex")],ws);const Mie=Ie` :host { display: block; width: var(--local-width); @@ -2551,11 +2551,11 @@ Error generating stack: `+s.message+` #6ebdea 100% ); } -`;var o2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let qh=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` +`;var i2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Wh=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` --local-width: var(--wui-icon-box-size-${this.size}); --local-height: var(--wui-icon-box-size-${this.size}); - `,q`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",q``;if(this.address){this.dataset.variant="generated";const e=Rt.generateAvatarColors(this.address);return this.style.cssText+=` - ${e}`,null}return this.dataset.variant="default",null}};qh.styles=[ct,ese];o2([Y()],qh.prototype,"imageSrc",void 0);o2([Y()],qh.prototype,"alt",void 0);o2([Y()],qh.prototype,"address",void 0);o2([Y()],qh.prototype,"size",void 0);qh=o2([ye("wui-avatar")],qh);const tse=Te` + `,q`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",q``;if(this.address){this.dataset.variant="generated";const e=Pt.generateAvatarColors(this.address);return this.style.cssText+=` + ${e}`,null}return this.dataset.variant="default",null}};Wh.styles=[ct,Mie];i2([Q()],Wh.prototype,"imageSrc",void 0);i2([Q()],Wh.prototype,"alt",void 0);i2([Q()],Wh.prototype,"address",void 0);i2([Q()],Wh.prototype,"size",void 0);Wh=i2([ve("wui-avatar")],Wh);const Oie=Ie` :host { display: inline-flex; justify-content: center; @@ -2577,13 +2577,13 @@ Error generating stack: `+s.message+` background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); } } -`;var Ku=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let mc=class extends _e{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,r=this.size==="lg",n=this.size==="xl",i=r?"12%":"16%",s=r?"xxs":n?"s":"3xl",o=this.background==="gray",a=this.background==="opaque",c=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let l=`var(--wui-color-${this.backgroundColor})`;return c?l=`var(--wui-icon-box-bg-${this.backgroundColor})`:o&&(l=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=` +`;var Hu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let hc=class extends _e{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,r=this.size==="lg",n=this.size==="xl",i=r?"12%":"16%",s=r?"xxs":n?"s":"3xl",o=this.background==="gray",a=this.background==="opaque",c=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let l=`var(--wui-color-${this.backgroundColor})`;return c?l=`var(--wui-icon-box-bg-${this.backgroundColor})`:o&&(l=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=` --local-bg-value: ${l}; --local-bg-mix: ${c||o?"100%":i}; --local-border-radius: var(--wui-border-radius-${s}); --local-size: var(--wui-icon-box-size-${this.size}); --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} - `,q` `}};mc.styles=[ct,Xt,tse];Ku([Y()],mc.prototype,"size",void 0);Ku([Y()],mc.prototype,"backgroundColor",void 0);Ku([Y()],mc.prototype,"iconColor",void 0);Ku([Y()],mc.prototype,"iconSize",void 0);Ku([Y()],mc.prototype,"background",void 0);Ku([Y({type:Boolean})],mc.prototype,"border",void 0);Ku([Y()],mc.prototype,"borderColor",void 0);Ku([Y()],mc.prototype,"icon",void 0);mc=Ku([ye("wui-icon-box")],mc);const rse=Te` + `,q` `}};hc.styles=[ct,Xt,Oie];Hu([Q()],hc.prototype,"size",void 0);Hu([Q()],hc.prototype,"backgroundColor",void 0);Hu([Q()],hc.prototype,"iconColor",void 0);Hu([Q()],hc.prototype,"iconSize",void 0);Hu([Q()],hc.prototype,"background",void 0);Hu([Q({type:Boolean})],hc.prototype,"border",void 0);Hu([Q()],hc.prototype,"borderColor",void 0);Hu([Q()],hc.prototype,"icon",void 0);hc=Hu([ve("wui-icon-box")],hc);const $ie=Ie` :host { display: block; } @@ -2685,10 +2685,10 @@ Error generating stack: `+s.message+` color: var(--wui-color-fg-175); } } -`;var Pl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let va=class extends _e{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return q` +`;var Tl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ga=class extends _e{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return q` @@ -2718,7 +2718,7 @@ Error generating stack: `+s.message+` `;return q` ${e} ${this.balance} - `}return null}};va.styles=[ct,Xt,rse];Pl([Y()],va.prototype,"networkSrc",void 0);Pl([Y()],va.prototype,"avatarSrc",void 0);Pl([Y()],va.prototype,"balance",void 0);Pl([Y({type:Boolean})],va.prototype,"isUnsupportedChain",void 0);Pl([Y({type:Boolean})],va.prototype,"disabled",void 0);Pl([Y()],va.prototype,"address",void 0);Pl([Y()],va.prototype,"profileName",void 0);Pl([Y()],va.prototype,"charsStart",void 0);Pl([Y()],va.prototype,"charsEnd",void 0);va=Pl([ye("wui-account-button")],va);const nse=Te` + `}return null}};ga.styles=[ct,Xt,$ie];Tl([Q()],ga.prototype,"networkSrc",void 0);Tl([Q()],ga.prototype,"avatarSrc",void 0);Tl([Q()],ga.prototype,"balance",void 0);Tl([Q({type:Boolean})],ga.prototype,"isUnsupportedChain",void 0);Tl([Q({type:Boolean})],ga.prototype,"disabled",void 0);Tl([Q()],ga.prototype,"address",void 0);Tl([Q()],ga.prototype,"profileName",void 0);Tl([Q()],ga.prototype,"charsStart",void 0);Tl([Q()],ga.prototype,"charsEnd",void 0);ga=Tl([ve("wui-account-button")],ga);const Die=Ie` :host { position: relative; background-color: var(--wui-color-gray-glass-002); @@ -2796,7 +2796,7 @@ Error generating stack: `+s.message+` border: 2px solid var(--wui-color-bg-150, #1e1f1f); padding: 1px; } -`;var x0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Pu=class extends _e{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` +`;var y0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Tu=class extends _e{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` --local-border-radius: var(--wui-border-radius-${e}); --local-size: var(--wui-wallet-image-size-${this.size}); `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),q` @@ -2811,7 +2811,7 @@ Error generating stack: `+s.message+` size="inherit" color="inherit" name="walletPlaceholder" - >`}};Pu.styles=[ct,nse];x0([Y()],Pu.prototype,"size",void 0);x0([Y()],Pu.prototype,"name",void 0);x0([Y()],Pu.prototype,"imageSrc",void 0);x0([Y()],Pu.prototype,"walletIcon",void 0);x0([Y({type:Boolean})],Pu.prototype,"installed",void 0);x0([Y()],Pu.prototype,"badgeSize",void 0);Pu=x0([ye("wui-wallet-image")],Pu);const ise=Te` + >`}};Tu.styles=[ct,Die];y0([Q()],Tu.prototype,"size",void 0);y0([Q()],Tu.prototype,"name",void 0);y0([Q()],Tu.prototype,"imageSrc",void 0);y0([Q()],Tu.prototype,"walletIcon",void 0);y0([Q({type:Boolean})],Tu.prototype,"installed",void 0);y0([Q()],Tu.prototype,"badgeSize",void 0);Tu=y0([ve("wui-wallet-image")],Tu);const Lie=Ie` :host { position: relative; border-radius: var(--wui-border-radius-xxs); @@ -2856,14 +2856,14 @@ Error generating stack: `+s.message+` z-index: 2; display: flex; } -`;var HL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Vx=4;let l5=class extends _e{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthq` +`;var TL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Ux=4;let n5=class extends _e{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthq` `)} - ${e?[...Array(Vx-this.walletImages.length)].map(()=>q` `):null} + ${e?[...Array(Ux-this.walletImages.length)].map(()=>q` `):null} - `}};l5.styles=[ct,ise];HL([Y({type:Array})],l5.prototype,"walletImages",void 0);l5=HL([ye("wui-all-wallets-image")],l5);const sse=Te` + `}};n5.styles=[ct,Lie];TL([Q({type:Array})],n5.prototype,"walletImages",void 0);n5=TL([ve("wui-all-wallets-image")],n5);const Bie=Ie` :host { width: var(--local-width); position: relative; @@ -3068,12 +3068,12 @@ Error generating stack: `+s.message+` transform: translate(-50%, -50%); opacity: var(--local-opacity-000); } -`;var Nl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const SR={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},ose={lg:"paragraph-600",md:"small-600"},ase={lg:"md",md:"md"};let ya=class extends _e{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` +`;var kl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const hP={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},Uie={lg:"paragraph-600",md:"small-600"},jie={lg:"md",md:"md"};let ma=class extends _e{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` --local-width: ${this.fullWidth?"100%":"auto"}; --local-opacity-100: ${this.loading?0:1}; --local-opacity-000: ${this.loading?1:0}; --local-border-radius: var(--wui-border-radius-${this.borderRadius}); - `;const e=this.textVariant??ose[this.size];return q` + `;const e=this.textVariant??Uie[this.size];return q` - `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=ase[this.size],r=this.disabled?SR.disabled:SR[this.variant];return q``}return q``}};ya.styles=[ct,Xt,sse];Nl([Y()],ya.prototype,"size",void 0);Nl([Y({type:Boolean})],ya.prototype,"disabled",void 0);Nl([Y({type:Boolean})],ya.prototype,"fullWidth",void 0);Nl([Y({type:Boolean})],ya.prototype,"loading",void 0);Nl([Y()],ya.prototype,"variant",void 0);Nl([Y({type:Boolean})],ya.prototype,"hasIconLeft",void 0);Nl([Y({type:Boolean})],ya.prototype,"hasIconRight",void 0);Nl([Y()],ya.prototype,"borderRadius",void 0);Nl([Y()],ya.prototype,"textVariant",void 0);ya=Nl([ye("wui-button")],ya);const qL=Fe` + `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=jie[this.size],r=this.disabled?hP.disabled:hP[this.variant];return q``}return q``}};ma.styles=[ct,Xt,Bie];kl([Q()],ma.prototype,"size",void 0);kl([Q({type:Boolean})],ma.prototype,"disabled",void 0);kl([Q({type:Boolean})],ma.prototype,"fullWidth",void 0);kl([Q({type:Boolean})],ma.prototype,"loading",void 0);kl([Q()],ma.prototype,"variant",void 0);kl([Q({type:Boolean})],ma.prototype,"hasIconLeft",void 0);kl([Q({type:Boolean})],ma.prototype,"hasIconRight",void 0);kl([Q()],ma.prototype,"borderRadius",void 0);kl([Q()],ma.prototype,"textVariant",void 0);ma=kl([ve("wui-button")],ma);const kL=je` -`,cse=Te` +`,Fie=Ie` :host { display: flex; flex-direction: column; @@ -3123,7 +3123,7 @@ Error generating stack: `+s.message+` stroke: var(--wui-color-gray-glass-010); stroke-width: 1px; } -`;var VL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let u5=class extends _e{constructor(){super(...arguments),this.type="wallet"}render(){return q` +`;var PL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let i5=class extends _e{constructor(){super(...arguments),this.type="wallet"}render(){return q` ${this.shimmerTemplate()} `}shimmerTemplate(){return this.type==="network"?q` - ${qL}`:q``}};u5.styles=[ct,Xt,cse];VL([Y()],u5.prototype,"type",void 0);u5=VL([ye("wui-card-select-loader")],u5);const lse=Fe` + ${kL}`:q``}};i5.styles=[ct,Xt,Fie];PL([Q()],i5.prototype,"type",void 0);i5=PL([ve("wui-card-select-loader")],i5);const zie=je` -`,use=Fe` +`,Wie=je` -`,dse=Te` +`,Hie=Ie` :host { position: relative; border-radius: inherit; @@ -3186,7 +3186,7 @@ Error generating stack: `+s.message+` width: var(--local-icon-size); height: var(--local-icon-size); } -`;var C0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Nu=class extends _e{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:lse,md:qL,lg:use},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` +`;var b0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ku=class extends _e{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:zie,md:kL,lg:Wie},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` --local-width: var(--wui-spacing-3xl); --local-height: var(--wui-spacing-3xl); --local-icon-size: var(--wui-spacing-l); @@ -3196,7 +3196,7 @@ Error generating stack: `+s.message+` --local-width: var(--wui-width-network-${this.size}); --local-height: var(--wui-height-network-${this.size}); --local-icon-size: var(--wui-icon-size-network-${this.size}); - `,q`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?q``:q``}};Nu.styles=[ct,dse];C0([Y()],Nu.prototype,"size",void 0);C0([Y()],Nu.prototype,"name",void 0);C0([Y({type:Object})],Nu.prototype,"networkImagesBySize",void 0);C0([Y()],Nu.prototype,"imageSrc",void 0);C0([Y({type:Boolean})],Nu.prototype,"selected",void 0);C0([Y({type:Boolean})],Nu.prototype,"round",void 0);Nu=C0([ye("wui-network-image")],Nu);const fse=Te` + `,q`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?q``:q``}};ku.styles=[ct,Hie];b0([Q()],ku.prototype,"size",void 0);b0([Q()],ku.prototype,"name",void 0);b0([Q({type:Object})],ku.prototype,"networkImagesBySize",void 0);b0([Q()],ku.prototype,"imageSrc",void 0);b0([Q({type:Boolean})],ku.prototype,"selected",void 0);b0([Q({type:Boolean})],ku.prototype,"round",void 0);ku=b0([ve("wui-network-image")],ku);const qie=Ie` button { flex-direction: column; width: 76px; @@ -3232,8 +3232,8 @@ Error generating stack: `+s.message+` [data-selected='true']:active:enabled { background-color: var(--wui-color-accent-glass-010); } -`;var _0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Mu=class extends _e{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return q` -
@@ -4224,7 +4224,7 @@ Error generating stack: `+s.message+` ?border=${!0} borderColor="wui-color-bg-125" > - `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Ou.styles=[$se];E0([Y()],Ou.prototype,"type",void 0);E0([Y()],Ou.prototype,"status",void 0);E0([Y()],Ou.prototype,"direction",void 0);E0([Y({type:Boolean})],Ou.prototype,"onlyDirectionIcon",void 0);E0([Y({type:Array})],Ou.prototype,"images",void 0);E0([Y({type:Object})],Ou.prototype,"secondImage",void 0);Ou=E0([ye("wui-transaction-visual")],Ou);const Ose=Te` + `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Nu.styles=[hse];C0([Q()],Nu.prototype,"type",void 0);C0([Q()],Nu.prototype,"status",void 0);C0([Q()],Nu.prototype,"direction",void 0);C0([Q({type:Boolean})],Nu.prototype,"onlyDirectionIcon",void 0);C0([Q({type:Array})],Nu.prototype,"images",void 0);C0([Q({type:Object})],Nu.prototype,"secondImage",void 0);Nu=C0([ve("wui-transaction-visual")],Nu);const pse=Ie` :host > wui-flex:first-child { align-items: center; column-gap: var(--wui-spacing-s); @@ -4267,18 +4267,18 @@ Error generating stack: `+s.message+` -webkit-box-orient: vertical; -webkit-line-clamp: 1; } -`;var Sc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let _o=class extends _e{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return q` +`;var Cc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let bo=class extends _e{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return q` - ${pC[this.type]||this.type} + ${o_[this.type]||this.type} ${this.templateDescription()} ${this.templateSecondDescription()} @@ -4295,7 +4295,7 @@ Error generating stack: `+s.message+` ${e} - `:null}};_o.styles=[ct,Ose];Sc([Y()],_o.prototype,"type",void 0);Sc([Y({type:Array})],_o.prototype,"descriptions",void 0);Sc([Y()],_o.prototype,"date",void 0);Sc([Y({type:Boolean})],_o.prototype,"onlyDirectionIcon",void 0);Sc([Y()],_o.prototype,"status",void 0);Sc([Y()],_o.prototype,"direction",void 0);Sc([Y({type:Array})],_o.prototype,"images",void 0);Sc([Y({type:Array})],_o.prototype,"price",void 0);Sc([Y({type:Array})],_o.prototype,"amount",void 0);Sc([Y({type:Array})],_o.prototype,"symbol",void 0);_o=Sc([ye("wui-transaction-list-item")],_o);const Dse=Te` + `:null}};bo.styles=[ct,pse];Cc([Q()],bo.prototype,"type",void 0);Cc([Q({type:Array})],bo.prototype,"descriptions",void 0);Cc([Q()],bo.prototype,"date",void 0);Cc([Q({type:Boolean})],bo.prototype,"onlyDirectionIcon",void 0);Cc([Q()],bo.prototype,"status",void 0);Cc([Q()],bo.prototype,"direction",void 0);Cc([Q({type:Array})],bo.prototype,"images",void 0);Cc([Q({type:Array})],bo.prototype,"price",void 0);Cc([Q({type:Array})],bo.prototype,"amount",void 0);Cc([Q({type:Array})],bo.prototype,"symbol",void 0);bo=Cc([ve("wui-transaction-list-item")],bo);const gse=Ie` :host > wui-flex:first-child { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); @@ -4306,7 +4306,7 @@ Error generating stack: `+s.message+` display: flex; flex: 1; } -`;var Lse=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let gC=class extends _e{render(){return q` +`;var mse=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let a_=class extends _e{render(){return q` @@ -4315,7 +4315,7 @@ Error generating stack: `+s.message+` - `}};gC.styles=[ct,Dse];gC=Lse([ye("wui-transaction-list-item-loader")],gC);const Bse=Te` + `}};a_.styles=[ct,gse];a_=mse([ve("wui-transaction-list-item-loader")],a_);const wse=Ie` :host { display: flex; justify-content: center; @@ -4356,11 +4356,11 @@ Error generating stack: `+s.message+` :host([data-size='lg']) > wui-text { transform: translateY(2%); } -`;var iE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Jw=class extends _e{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return q` +`;var KA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Qw=class extends _e{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return q` - `}};Jw.styles=[ct,Bse];iE([Y()],Jw.prototype,"variant",void 0);iE([Y()],Jw.prototype,"size",void 0);Jw=iE([ye("wui-tag")],Jw);const Use=Te` + `}};Qw.styles=[ct,wse];KA([Q()],Qw.prototype,"variant",void 0);KA([Q()],Qw.prototype,"size",void 0);Qw=KA([ve("wui-tag")],Qw);const vse=Ie` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); @@ -4388,7 +4388,7 @@ Error generating stack: `+s.message+` wui-icon { color: var(--wui-color-fg-200) !important; } -`;var Ic=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Ao=class extends _e{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return q` +`;var Ac=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let xo=class extends _e{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return q` - `}};Xw.styles=[ct,Xt,Fse];sE([Y()],Xw.prototype,"logo",void 0);sE([Y({type:Boolean})],Xw.prototype,"disabled",void 0);Xw=sE([ye("wui-logo-select")],Xw);const zse=Te` + `}};Yw.styles=[ct,Xt,bse];GA([Q()],Yw.prototype,"logo",void 0);GA([Q({type:Boolean})],Yw.prototype,"disabled",void 0);Yw=GA([ve("wui-logo-select")],Yw);const xse=Ie` :host { display: block; } @@ -4470,7 +4470,7 @@ Error generating stack: `+s.message+` height: 24px; box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); } -`;var F6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let A1=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return q` +`;var O6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let _1=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return q` - `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?q``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,r){const n=this.buttons[this.activeTab],i=this.buttons[e],s=n==null?void 0:n.querySelector("wui-text"),o=i==null?void 0:i.querySelector("wui-text"),a=i==null?void 0:i.getBoundingClientRect(),c=o==null?void 0:o.getBoundingClientRect();n&&s&&!r&&e!==this.activeTab&&(s.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),n.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&a&&c&&o&&(e!==this.activeTab||r)&&(this.localTabWidth=`${Math.round(a.width+c.width)+6}px`,i.animate([{width:`${a.width+c.width}px`}],{duration:r?0:500,fill:"forwards",easing:"ease"}),o.animate([{opacity:1}],{duration:r?0:125,delay:r?0:200,fill:"forwards",easing:"ease"}))}};vl.styles=[ct,Xt,joe];Sf([Y({type:Array})],vl.prototype,"tabs",void 0);Sf([Y()],vl.prototype,"onTabChange",void 0);Sf([Y({type:Array})],vl.prototype,"buttons",void 0);Sf([Y({type:Boolean})],vl.prototype,"disabled",void 0);Sf([Y()],vl.prototype,"localTabWidth",void 0);Sf([le()],vl.prototype,"activeTab",void 0);Sf([le()],vl.prototype,"isDense",void 0);vl=Sf([ye("wui-tabs")],vl);const Foe=Te` + `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?q``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,r){const n=this.buttons[this.activeTab],i=this.buttons[e],s=n==null?void 0:n.querySelector("wui-text"),o=i==null?void 0:i.querySelector("wui-text"),a=i==null?void 0:i.getBoundingClientRect(),c=o==null?void 0:o.getBoundingClientRect();n&&s&&!r&&e!==this.activeTab&&(s.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),n.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&a&&c&&o&&(e!==this.activeTab||r)&&(this.localTabWidth=`${Math.round(a.width+c.width)+6}px`,i.animate([{width:`${a.width+c.width}px`}],{duration:r?0:500,fill:"forwards",easing:"ease"}),o.animate([{opacity:1}],{duration:r?0:125,delay:r?0:200,fill:"forwards",easing:"ease"}))}};gl.styles=[ct,Xt,yoe];_f([Q({type:Array})],gl.prototype,"tabs",void 0);_f([Q()],gl.prototype,"onTabChange",void 0);_f([Q({type:Array})],gl.prototype,"buttons",void 0);_f([Q({type:Boolean})],gl.prototype,"disabled",void 0);_f([Q()],gl.prototype,"localTabWidth",void 0);_f([ae()],gl.prototype,"activeTab",void 0);_f([ae()],gl.prototype,"isDense",void 0);gl=_f([ve("wui-tabs")],gl);const boe=Ie` :host { display: block; } @@ -4785,7 +4785,7 @@ Minimum version required to store current data is: `+s+`. border-radius: var(--wui-border-radius-s); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } -`;var dE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let tv=class extends _e{constructor(){super(...arguments),this.text=""}render(){return q` +`;var eE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Xw=class extends _e{constructor(){super(...arguments),this.text=""}render(){return q` - `}};N1.styles=[ct,Xt,qoe];Z6([Y()],N1.prototype,"label",void 0);Z6([Y()],N1.prototype,"description",void 0);Z6([Y()],N1.prototype,"icon",void 0);N1=Z6([ye("wui-notice-card")],N1);const Voe=Te` + `}};P1.styles=[ct,Xt,Aoe];z6([Q()],P1.prototype,"label",void 0);z6([Q()],P1.prototype,"description",void 0);z6([Q()],P1.prototype,"icon",void 0);P1=z6([ve("wui-notice-card")],P1);const Eoe=Ie` button { height: auto; position: relative; @@ -5063,7 +5063,7 @@ Minimum version required to store current data is: `+s+`. overflow-x: auto; overflow-wrap: anywhere; } -`;var fE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const e9=100;let rv=class extends _e{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var n,i;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".heightContent"),r=(i=this.shadowRoot)==null?void 0:i.querySelector(".textContent");if(e&&r){this.scrollElement=e;const s=r==null?void 0:r.scrollHeight;s&&s>e9&&(this.enableAccordion=!0,this.scrollHeightElement=s,this.requestUpdate())}})}render(){return q` +`;var tE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Kx=100;let ev=class extends _e{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var n,i;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".heightContent"),r=(i=this.shadowRoot)==null?void 0:i.querySelector(".textContent");if(e&&r){this.scrollElement=e;const s=r==null?void 0:r.scrollHeight;s&&s>Kx&&(this.enableAccordion=!0,this.scrollHeightElement=s,this.requestUpdate())}})}render(){return q`
- `}onClick(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${e9}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${e9}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?q` `:null}};rv.styles=[ct,Xt,Voe];fE([Y()],rv.prototype,"textTitle",void 0);fE([Y()],rv.prototype,"overflowedContent",void 0);rv=fE([ye("wui-list-accordion")],rv);const Koe=Te` + `}onClick(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${Kx}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${Kx}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?q` `:null}};ev.styles=[ct,Xt,Eoe];tE([Q()],ev.prototype,"textTitle",void 0);tE([Q()],ev.prototype,"overflowedContent",void 0);ev=tE([ve("wui-list-accordion")],ev);const Soe=Ie` :host { display: flex; column-gap: var(--wui-spacing-s); @@ -5101,14 +5101,14 @@ Minimum version required to store current data is: `+s+`. width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); } -`;var Q6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let M1=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return q` +`;var W6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let R1=class extends _e{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return q` ${this.textTitle} ${this.templateContent()} - `}templateContent(){return this.imageSrc?q``:this.textValue?q` ${this.textValue} `:q``}};M1.styles=[ct,Xt,Koe];Q6([Y()],M1.prototype,"imageSrc",void 0);Q6([Y()],M1.prototype,"textTitle",void 0);Q6([Y()],M1.prototype,"textValue",void 0);M1=Q6([ye("wui-list-content")],M1);const Goe=Te` + `}templateContent(){return this.imageSrc?q``:this.textValue?q` ${this.textValue} `:q``}};R1.styles=[ct,Xt,Soe];W6([Q()],R1.prototype,"imageSrc",void 0);W6([Q()],R1.prototype,"textTitle",void 0);W6([Q()],R1.prototype,"textValue",void 0);R1=W6([ve("wui-list-content")],R1);const Ioe=Ie` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); @@ -5152,7 +5152,7 @@ Minimum version required to store current data is: `+s+`. background-color: var(--wui-color-gray-glass-010); color: var(--wui-color-fg-300); } -`;var cg=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let uf=class extends _e{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return q` +`;var og=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let af=class extends _e{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return q` `}};w5.styles=[ct,Xt,Qoe];hB([Y()],w5.prototype,"text",void 0);w5=hB([ye("wui-promo")],w5);const Yoe=Te` + `}};d5.styles=[ct,Xt,koe];YL([Q()],d5.prototype,"text",void 0);d5=YL([ve("wui-promo")],d5);const Poe=Ie` span { font-weight: 500; font-size: 40px; @@ -5243,7 +5243,7 @@ Minimum version required to store current data is: `+s+`. .pennies { color: var(--wui-color-fg-200); } -`;var hE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let nv=class extends _e{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return q`$${this.dollars}.${this.pennies}`}};nv.styles=[ct,Yoe];hE([Y()],nv.prototype,"dollars",void 0);hE([Y()],nv.prototype,"pennies",void 0);nv=hE([ye("wui-balance")],nv);const Joe=Te` +`;var rE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let tv=class extends _e{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return q`$${this.dollars}.${this.pennies}`}};tv.styles=[ct,Poe];rE([Q()],tv.prototype,"dollars",void 0);rE([Q()],tv.prototype,"pennies",void 0);tv=rE([ve("wui-balance")],tv);const Roe=Ie` button { background-color: var(--wui-color-gray-glass-002); border-radius: var(--wui-border-radius-3xl); @@ -5277,7 +5277,7 @@ Minimum version required to store current data is: `+s+`. outline: 2px solid var(--wui-color-bg-200); background-color: var(--wui-color-bg-250); } -`;var ug=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ff=class extends _e{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return q` - `}};Lu.styles=[ct,Xt,eae];I0([Y()],Lu.prototype,"variant",void 0);I0([Y()],Lu.prototype,"imageSrc",void 0);I0([Y({type:Boolean})],Lu.prototype,"disabled",void 0);I0([Y()],Lu.prototype,"icon",void 0);I0([Y()],Lu.prototype,"size",void 0);I0([Y()],Lu.prototype,"text",void 0);Lu=I0([ye("wui-chip-button")],Lu);const tae=Te` + `}};Ou.styles=[ct,Xt,Moe];E0([Q()],Ou.prototype,"variant",void 0);E0([Q()],Ou.prototype,"imageSrc",void 0);E0([Q({type:Boolean})],Ou.prototype,"disabled",void 0);E0([Q()],Ou.prototype,"icon",void 0);E0([Q()],Ou.prototype,"size",void 0);E0([Q()],Ou.prototype,"text",void 0);Ou=E0([ve("wui-chip-button")],Ou);const Ooe=Ie` button { display: flex; gap: var(--wui-spacing-xl); @@ -5511,7 +5511,7 @@ Minimum version required to store current data is: `+s+`. 0 0 0 3px var(--wui-color-gray-glass-002), 0 0 0 3px var(--wui-color-modal-bg); } -`;var pE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let iv=class extends _e{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return q` +`;var nE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let rv=class extends _e{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return q` `}networksTemplate(){const e=this.networkImages.slice(0,5);return q` ${e==null?void 0:e.map(r=>q` `)} - `}};iv.styles=[ct,Xt,tae];pE([Y({type:Array})],iv.prototype,"networkImages",void 0);pE([Y()],iv.prototype,"text",void 0);iv=pE([ye("wui-compatible-network")],iv);const rae=Te` + `}};rv.styles=[ct,Xt,Ooe];nE([Q({type:Array})],rv.prototype,"networkImages",void 0);nE([Q()],rv.prototype,"text",void 0);rv=nE([ve("wui-compatible-network")],rv);const $oe=Ie` wui-flex { width: 100%; background-color: var(--wui-color-gray-glass-005); @@ -5529,7 +5529,7 @@ Minimum version required to store current data is: `+s+`. padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs); } -`;var gE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let sv=class extends _e{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return q` +`;var iE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let nv=class extends _e{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return q` ${this.text} - `}};sv.styles=[ct,Xt,rae];gE([Y()],sv.prototype,"icon",void 0);gE([Y()],sv.prototype,"text",void 0);sv=gE([ye("wui-banner")],sv);const nae=Te` + `}};nv.styles=[ct,Xt,$oe];iE([Q()],nv.prototype,"icon",void 0);iE([Q()],nv.prototype,"text",void 0);nv=iE([ve("wui-banner")],nv);const Doe=Ie` wui-flex { width: 100%; background-color: var(--wui-color-gray-glass-005); @@ -5548,12 +5548,12 @@ Minimum version required to store current data is: `+s+`. padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs); } -`;var Y6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let $1=class extends _e{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return q` +`;var H6=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let N1=class extends _e{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return q` ${this.text} - `}};$1.styles=[ct,Xt,nae];Y6([Y()],$1.prototype,"imageSrc",void 0);Y6([Y()],$1.prototype,"text",void 0);Y6([Y()],$1.prototype,"size",void 0);$1=Y6([ye("wui-banner-img")],$1);const iae=Te` + `}};N1.styles=[ct,Xt,Doe];H6([Q()],N1.prototype,"imageSrc",void 0);H6([Q()],N1.prototype,"text",void 0);H6([Q()],N1.prototype,"size",void 0);N1=H6([ve("wui-banner-img")],N1);const Loe=Ie` button { padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); display: flex; @@ -5577,20 +5577,20 @@ Minimum version required to store current data is: `+s+`. wui-image { border-radius: var(--wui-border-radius-3xl); } -`;var T0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Bu=class extends _e{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return q` +`;var S0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let $u=class extends _e{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return q` - `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?q``:q``}};Bu.styles=[ct,Xt,iae];T0([Y()],Bu.prototype,"tokenName",void 0);T0([Y()],Bu.prototype,"tokenImageUrl",void 0);T0([Y({type:Number})],Bu.prototype,"tokenValue",void 0);T0([Y()],Bu.prototype,"tokenAmount",void 0);T0([Y()],Bu.prototype,"tokenCurrency",void 0);T0([Y({type:Boolean})],Bu.prototype,"clickable",void 0);Bu=T0([ye("wui-list-token")],Bu);const sae=Te` + `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?q``:q``}};$u.styles=[ct,Xt,Loe];S0([Q()],$u.prototype,"tokenName",void 0);S0([Q()],$u.prototype,"tokenImageUrl",void 0);S0([Q({type:Number})],$u.prototype,"tokenValue",void 0);S0([Q()],$u.prototype,"tokenAmount",void 0);S0([Q()],$u.prototype,"tokenCurrency",void 0);S0([Q({type:Boolean})],$u.prototype,"clickable",void 0);$u=S0([ve("wui-list-token")],$u);const Boe=Ie` button { width: 100%; display: flex; @@ -5610,7 +5610,7 @@ Minimum version required to store current data is: `+s+`. wui-flex { width: auto; } -`;var Tf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let bl=class extends _e{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return q` +`;var Af=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let wl=class extends _e{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return q` `}};ov.styles=[ct,Xt,dae];mE([Y()],ov.prototype,"text",void 0);mE([Y()],ov.prototype,"icon",void 0);ov=mE([ye("wui-icon-button")],ov);const fae=Te` + `}};iv.styles=[ct,Xt,Hoe];sE([Q()],iv.prototype,"text",void 0);sE([Q()],iv.prototype,"icon",void 0);iv=sE([ve("wui-icon-button")],iv);const qoe=Ie` button { column-gap: var(--wui-spacing-s); padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); @@ -5816,11 +5816,11 @@ Minimum version required to store current data is: `+s+`. background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } -`;var wE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let av=class extends _e{constructor(){super(...arguments),this.text="",this.disabled=!1}render(){return q` +`;var oE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let sv=class extends _e{constructor(){super(...arguments),this.text="",this.disabled=!1}render(){return q` - `}};av.styles=[ct,Xt,fae];wE([Y()],av.prototype,"text",void 0);wE([Y({type:Boolean})],av.prototype,"disabled",void 0);av=wE([ye("wui-list-button")],av);const hae=Te` + `}};sv.styles=[ct,Xt,qoe];oE([Q()],sv.prototype,"text",void 0);oE([Q({type:Boolean})],sv.prototype,"disabled",void 0);sv=oE([ve("wui-list-button")],sv);const Voe=Ie` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); @@ -5855,7 +5855,7 @@ Minimum version required to store current data is: `+s+`. background-color: var(--wui-color-gray-glass-015); color: var(--wui-color-gray-glass-015); } -`;var h2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Qh=class extends _e{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return q` +`;var d2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Gh=class extends _e{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return q` - `}templatePlacement(){return this.align==="center"?q` `:null}};Qh.styles=[ct,Xt,hae];h2([Y()],Qh.prototype,"logo",void 0);h2([Y()],Qh.prototype,"name",void 0);h2([Y()],Qh.prototype,"align",void 0);h2([Y({type:Boolean})],Qh.prototype,"disabled",void 0);Qh=h2([ye("wui-list-social")],Qh);const pae=Te` + `}templatePlacement(){return this.align==="center"?q` `:null}};Gh.styles=[ct,Xt,Voe];d2([Q()],Gh.prototype,"logo",void 0);d2([Q()],Gh.prototype,"name",void 0);d2([Q()],Gh.prototype,"align",void 0);d2([Q({type:Boolean})],Gh.prototype,"disabled",void 0);Gh=d2([ve("wui-list-social")],Gh);const Koe=Ie` button { display: block; display: flex; @@ -5896,7 +5896,7 @@ Minimum version required to store current data is: `+s+`. button:active { background-color: var(--wui-color-gray-glass-005); } -`;var pB=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let v5=class extends _e{constructor(){super(...arguments),this.imageSrc=""}render(){return q``}imageTemplate(){return this.imageSrc?q``:q``}};v5.styles=[ct,Xt,D6,pae];pB([Y()],v5.prototype,"imageSrc",void 0);v5=pB([ye("wui-select")],v5);const gae=Te` + >`}};f5.styles=[ct,Xt,k6,Koe];JL([Q()],f5.prototype,"imageSrc",void 0);f5=JL([ve("wui-select")],f5);const Goe=Ie` :host { display: grid; width: inherit; height: inherit; } -`;var Aa=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Js=class extends _e{render(){return this.style.cssText=` +`;var xa=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Ks=class extends _e{render(){return this.style.cssText=` grid-template-rows: ${this.gridTemplateRows}; grid-template-columns: ${this.gridTemplateColumns}; justify-items: ${this.justifyItems}; @@ -5921,15 +5921,15 @@ Minimum version required to store current data is: `+s+`. column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; - padding-top: ${this.padding&&Rt.getSpacingStyles(this.padding,0)}; - padding-right: ${this.padding&&Rt.getSpacingStyles(this.padding,1)}; - padding-bottom: ${this.padding&&Rt.getSpacingStyles(this.padding,2)}; - padding-left: ${this.padding&&Rt.getSpacingStyles(this.padding,3)}; - margin-top: ${this.margin&&Rt.getSpacingStyles(this.margin,0)}; - margin-right: ${this.margin&&Rt.getSpacingStyles(this.margin,1)}; - margin-bottom: ${this.margin&&Rt.getSpacingStyles(this.margin,2)}; - margin-left: ${this.margin&&Rt.getSpacingStyles(this.margin,3)}; - `,q``}};Js.styles=[ct,gae];Aa([Y()],Js.prototype,"gridTemplateRows",void 0);Aa([Y()],Js.prototype,"gridTemplateColumns",void 0);Aa([Y()],Js.prototype,"justifyItems",void 0);Aa([Y()],Js.prototype,"alignItems",void 0);Aa([Y()],Js.prototype,"justifyContent",void 0);Aa([Y()],Js.prototype,"alignContent",void 0);Aa([Y()],Js.prototype,"columnGap",void 0);Aa([Y()],Js.prototype,"rowGap",void 0);Aa([Y()],Js.prototype,"gap",void 0);Aa([Y()],Js.prototype,"padding",void 0);Aa([Y()],Js.prototype,"margin",void 0);Js=Aa([ye("wui-grid")],Js);const mae=Te` + padding-top: ${this.padding&&Pt.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&Pt.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&Pt.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&Pt.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&Pt.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&Pt.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&Pt.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&Pt.getSpacingStyles(this.margin,3)}; + `,q``}};Ks.styles=[ct,Goe];xa([Q()],Ks.prototype,"gridTemplateRows",void 0);xa([Q()],Ks.prototype,"gridTemplateColumns",void 0);xa([Q()],Ks.prototype,"justifyItems",void 0);xa([Q()],Ks.prototype,"alignItems",void 0);xa([Q()],Ks.prototype,"justifyContent",void 0);xa([Q()],Ks.prototype,"alignContent",void 0);xa([Q()],Ks.prototype,"columnGap",void 0);xa([Q()],Ks.prototype,"rowGap",void 0);xa([Q()],Ks.prototype,"gap",void 0);xa([Q()],Ks.prototype,"padding",void 0);xa([Q()],Ks.prototype,"margin",void 0);Ks=xa([ve("wui-grid")],Ks);const Zoe=Ie` :host { position: relative; display: flex; @@ -5945,7 +5945,7 @@ Minimum version required to store current data is: `+s+`. padding: 0px 10px; background-color: var(--wui-color-modal-bg); } -`;var gB=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let y5=class extends _e{constructor(){super(...arguments),this.text=""}render(){return q`${this.template()}`}template(){return this.text?q`${this.text}`:null}};y5.styles=[ct,mae];gB([Y()],y5.prototype,"text",void 0);y5=gB([ye("wui-separator")],y5);const vy={interpolate(t,e,r){if(t.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const n=t[0]||0,i=t[1]||0,s=e[0]||0,o=e[1]||0;return ri?o:(o-s)/(i-n)*(r-n)+s}},wae=3,vae=["receive","deposit","borrow","claim"],yae=["withdraw","repay","burn"],gh={getMonthName(t){const e=new Date;return e.setMonth(t),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(t,e){const r=WA.getYear(),n=this.getMonthName(e);return t===r?n:`${n} ${t}`},getTransactionImages(t){const[e,r]=t,n=!!e&&(t==null?void 0:t.every(o=>!!o.nft_info)),i=(t==null?void 0:t.length)>1;return(t==null?void 0:t.length)===2&&!n?[this.getTransactionImage(e),this.getTransactionImage(r)]:i?t.map(o=>this.getTransactionImage(o)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:gh.getTransactionTransferTokenType(t),url:gh.getTransactionImageURL(t)}},getTransactionImageURL(t){var i,s,o,a,c;let e;const r=!!(t!=null&&t.nft_info),n=!!(t!=null&&t.fungible_info);return t&&r?e=(o=(s=(i=t==null?void 0:t.nft_info)==null?void 0:i.content)==null?void 0:s.preview)==null?void 0:o.url:t&&n&&(e=(c=(a=t==null?void 0:t.fungible_info)==null?void 0:a.icon)==null?void 0:c.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t){var f,g,v;const e=(f=t==null?void 0:t.metadata)==null?void 0:f.operationType,r=t==null?void 0:t.transfers,n=((g=t==null?void 0:t.transfers)==null?void 0:g.length)>0,i=((v=t==null?void 0:t.transfers)==null?void 0:v.length)>1,s=n&&(r==null?void 0:r.every(x=>!!(x!=null&&x.fungible_info))),[o,a]=r;let c=this.getTransferDescription(o),l=this.getTransferDescription(a);if(!n)return(e==="send"||e==="receive")&&s?(c=Rt.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),l=Rt.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[c,l]):[t.metadata.status];if(i)return r.map(x=>this.getTransferDescription(x));let d="";return vae.includes(e)?d="+":yae.includes(e)&&(d="-"),c=d.concat(c),[c]},getTransferDescription(t){var r;let e="";return t&&(t!=null&&t.nft_info?e=((r=t==null?void 0:t.nft_info)==null?void 0:r.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var n;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(n=t==null?void 0:t.fungible_info)==null?void 0:n.symbol].join(" ").trim():null},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(wae):null}},cr={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",WALLET_STANDARD_CONNECTOR_ID:"announced",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"w3mAuth",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"}},ha={ConnectorExplorerIds:{[cr.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[cr.COINBASE_SDK_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[cr.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[cr.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[cr.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[cr.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[cr.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[cr.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[cr.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[cr.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[cr.INJECTED_CONNECTOR_ID]:"Browser Wallet",[cr.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[cr.COINBASE_CONNECTOR_ID]:"Coinbase",[cr.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[cr.LEDGER_CONNECTOR_ID]:"Ledger",[cr.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[cr.INJECTED_CONNECTOR_ID]:"INJECTED",[cr.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[cr.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[cr.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},PR={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([r,n])=>{e[`${cr.EIP155}:${r}`]=n}),e}};var b5;(function(t){t.Google="google",t.Github="github",t.Apple="apple",t.Facebook="facebook",t.X="x",t.Discord="discord",t.Farcaster="farcaster"})(b5||(b5={}));var vE={exports:{}},Gp=typeof Reflect=="object"?Reflect:null,NR=Gp&&typeof Gp.apply=="function"?Gp.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},ib;Gp&&typeof Gp.ownKeys=="function"?ib=Gp.ownKeys:Object.getOwnPropertySymbols?ib=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ib=function(e){return Object.getOwnPropertyNames(e)};function bae(t){console&&console.warn&&console.warn(t)}var mB=Number.isNaN||function(e){return e!==e};function Kr(){Kr.init.call(this)}vE.exports=Kr;vE.exports.once=Aae;Kr.EventEmitter=Kr;Kr.prototype._events=void 0;Kr.prototype._eventsCount=0;Kr.prototype._maxListeners=void 0;var MR=10;function X6(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Kr,"defaultMaxListeners",{enumerable:!0,get:function(){return MR},set:function(t){if(typeof t!="number"||t<0||mB(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");MR=t}});Kr.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};Kr.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||mB(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 wB(t){return t._maxListeners===void 0?Kr.defaultMaxListeners:t._maxListeners}Kr.prototype.getMaxListeners=function(){return wB(this)};Kr.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")NR(c,this,r);else for(var l=c.length,d=CB(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,bae(a)}return t}Kr.prototype.addListener=function(e,r){return vB(this,e,r,!1)};Kr.prototype.on=Kr.prototype.addListener;Kr.prototype.prependListener=function(e,r){return vB(this,e,r,!0)};function xae(){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 yB(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=xae.bind(n);return i.listener=r,n.wrapFn=i,i}Kr.prototype.once=function(e,r){return X6(r),this.on(e,yB(this,e,r)),this};Kr.prototype.prependOnceListener=function(e,r){return X6(r),this.prependListener(e,yB(this,e,r)),this};Kr.prototype.removeListener=function(e,r){var n,i,s,o,a;if(X6(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():Cae(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Kr.prototype.off=Kr.prototype.removeListener;Kr.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 bB(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?_ae(i):CB(i,i.length)}Kr.prototype.listeners=function(e){return bB(this,e,!0)};Kr.prototype.rawListeners=function(e){return bB(this,e,!1)};Kr.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):xB.call(t,e)};Kr.prototype.listenerCount=xB;function xB(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}Kr.prototype.eventNames=function(){return this._eventsCount>0?ib(this._events):[]};function CB(t,e){for(var r=new Array(e),n=0;n"u")throw new TypeError("[unstorage] Buffer is not supported!")}const xC="base64:";function $ae(t){if(typeof t=="string")return t;AB();const e=Buffer.from(t).toString("base64");return xC+e}function Oae(t){return typeof t!="string"||!t.startsWith(xC)?t:(AB(),Buffer.from(t.slice(xC.length),"base64"))}function js(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Dae(...t){return js(t.join(":"))}function by(t){return t=js(t),t?t+":":""}const Lae="memory",Bae=()=>{const t=new Map;return{name:Lae,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 Uae(t={}){const e={mounts:{"":t.driver||Bae()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const d of e.mountpoints)if(l.startsWith(d))return{base:d,relativeKey:l.slice(d.length),driver:e.mounts[d]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,d)=>e.mountpoints.filter(f=>f.startsWith(l)||d&&l.startsWith(f)).map(f=>({relativeBase:l.length>f.length?l.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(l,d)=>{if(e.watching){d=js(d);for(const f of e.watchListeners)f(l,d)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await $R(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,d,f)=>{const g=new Map,v=x=>{let P=g.get(x.base);return P||(P={driver:x.driver,base:x.base,items:[]},g.set(x.base,P)),P};for(const x of l){const P=typeof x=="string",M=js(P?x:x.key),N=P?void 0:x.value,E=P||!x.options?d:{...d,...x.options},$=r(M);v($).items.push({key:M,value:N,relativeKey:$.relativeKey,options:E})}return Promise.all([...g.values()].map(x=>f(x))).then(x=>x.flat())},c={hasItem(l,d={}){l=js(l);const{relativeKey:f,driver:g}=r(l);return pi(g.hasItem,f,d)},getItem(l,d={}){l=js(l);const{relativeKey:f,driver:g}=r(l);return pi(g.getItem,f,d).then(v=>yy(v))},getItems(l,d){return a(l,d,f=>f.driver.getItems?pi(f.driver.getItems,f.items.map(g=>({key:g.relativeKey,options:g.options})),d).then(g=>g.map(v=>({key:Dae(f.base,v.key),value:yy(v.value)}))):Promise.all(f.items.map(g=>pi(f.driver.getItem,g.relativeKey,g.options).then(v=>({key:g.key,value:yy(v)})))))},getItemRaw(l,d={}){l=js(l);const{relativeKey:f,driver:g}=r(l);return g.getItemRaw?pi(g.getItemRaw,f,d):pi(g.getItem,f,d).then(v=>Oae(v))},async setItem(l,d,f={}){if(d===void 0)return c.removeItem(l);l=js(l);const{relativeKey:g,driver:v}=r(l);v.setItem&&(await pi(v.setItem,g,sb(d),f),v.watch||i("update",l))},async setItems(l,d){await a(l,d,async f=>{if(f.driver.setItems)return pi(f.driver.setItems,f.items.map(g=>({key:g.relativeKey,value:sb(g.value),options:g.options})),d);f.driver.setItem&&await Promise.all(f.items.map(g=>pi(f.driver.setItem,g.relativeKey,sb(g.value),g.options)))})},async setItemRaw(l,d,f={}){if(d===void 0)return c.removeItem(l,f);l=js(l);const{relativeKey:g,driver:v}=r(l);if(v.setItemRaw)await pi(v.setItemRaw,g,d,f);else if(v.setItem)await pi(v.setItem,g,$ae(d),f);else return;v.watch||i("update",l)},async removeItem(l,d={}){typeof d=="boolean"&&(d={removeMeta:d}),l=js(l);const{relativeKey:f,driver:g}=r(l);g.removeItem&&(await pi(g.removeItem,f,d),(d.removeMeta||d.removeMata)&&await pi(g.removeItem,f+"$",d),g.watch||i("remove",l))},async getMeta(l,d={}){typeof d=="boolean"&&(d={nativeOnly:d}),l=js(l);const{relativeKey:f,driver:g}=r(l),v=Object.create(null);if(g.getMeta&&Object.assign(v,await pi(g.getMeta,f,d)),!d.nativeOnly){const x=await pi(g.getItem,f+"$",d).then(P=>yy(P));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(v,x))}return v},setMeta(l,d,f={}){return this.setItem(l+"$",d,f)},removeMeta(l,d={}){return this.removeItem(l+"$",d)},async getKeys(l,d={}){l=by(l);const f=n(l,!0);let g=[];const v=[];for(const x of f){const P=await pi(x.driver.getKeys,x.relativeBase,d);for(const M of P){const N=x.mountpoint+js(M);g.some(E=>N.startsWith(E))||v.push(N)}g=[x.mountpoint,...g.filter(M=>!M.startsWith(x.mountpoint))]}return l?v.filter(x=>x.startsWith(l)&&x[x.length-1]!=="$"):v.filter(x=>x[x.length-1]!=="$")},async clear(l,d={}){l=by(l),await Promise.all(n(l,!1).map(async f=>{if(f.driver.clear)return pi(f.driver.clear,f.relativeBase,d);if(f.driver.removeItem){const g=await f.driver.getKeys(f.relativeBase||"",d);return Promise.all(g.map(v=>f.driver.removeItem(v,d)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>OR(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(d=>d!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,d){if(l=by(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((f,g)=>g.length-f.length)),e.mounts[l]=d,e.watching&&Promise.resolve($R(d,i,l)).then(f=>{e.unwatch[l]=f}).catch(console.error),c},async unmount(l,d=!0){l=by(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),d&&await OR(e.mounts[l]),e.mountpoints=e.mountpoints.filter(f=>f!==l),delete e.mounts[l])},getMount(l=""){l=js(l)+":";const d=r(l);return{driver:d.driver,base:d.base}},getMounts(l="",d={}){return l=js(l),n(l,d.parents).map(g=>({driver:g.driver,base:g.mountpoint}))},keys:(l,d={})=>c.getKeys(l,d),get:(l,d={})=>c.getItem(l,d),set:(l,d,f={})=>c.setItem(l,d,f),has:(l,d={})=>c.hasItem(l,d),del:(l,d={})=>c.removeItem(l,d),remove:(l,d={})=>c.removeItem(l,d)};return c}function $R(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function OR(t){typeof t.dispose=="function"&&await pi(t.dispose)}function k0(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function EB(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=k0(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let t9;function p2(){return t9||(t9=EB("keyval-store","keyval")),t9}function DR(t,e=p2()){return e("readonly",r=>k0(r.get(t)))}function jae(t,e,r=p2()){return r("readwrite",n=>(n.put(e,t),k0(n.transaction)))}function Fae(t,e=p2()){return e("readwrite",r=>(r.delete(t),k0(r.transaction)))}function zae(t=p2()){return t("readwrite",e=>(e.clear(),k0(e.transaction)))}function Wae(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},k0(t.transaction)}function Hae(t=p2()){return t("readonly",e=>{if(e.getAllKeys)return k0(e.getAllKeys());const r=[];return Wae(e,n=>r.push(n.key)).then(()=>r)})}const qae="idb-keyval";var Vae=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=EB(t.dbName,t.storeName)),{name:qae,options:t,async hasItem(i){return!(typeof await DR(r(i),n)>"u")},async getItem(i){return await DR(r(i),n)??null},setItem(i,s){return jae(r(i),s,n)},removeItem(i){return Fae(r(i),n)},getKeys(){return Hae(n)},clear(){return zae(n)}}};const Kae="WALLET_CONNECT_V2_INDEXED_DB",Gae="keyvaluestorage";let Zae=class{constructor(){this.indexedDb=Uae({driver:Vae({dbName:Kae,storeName:Gae})})}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,Ru(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var r9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ob={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 r9<"u"&&r9.localStorage?ob.exports=r9.localStorage:typeof window<"u"&&window.localStorage?ob.exports=window.localStorage:ob.exports=new e})();function Qae(t){var e;return[t[0],jh((e=t[1])!=null?e:"")]}let Yae=class{constructor(){this.localStorage=ob.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Qae)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return jh(r)}async setItem(e,r){this.localStorage.setItem(e,Ru(r))}async removeItem(e){this.localStorage.removeItem(e)}};const Jae="wc_storage_version",LR=1,Xae=async(t,e,r)=>{const n=Jae,i=await e.getItem(n);if(i&&i>=LR){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,LR),r(e),ece(t,o)},ece=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let tce=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new Yae;this.storage=e;try{const r=new Zae;Xae(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)})}};var Je={};/*! ***************************************************************************** +`;var XL=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let h5=class extends _e{constructor(){super(...arguments),this.text=""}render(){return q`${this.template()}`}template(){return this.text?q`${this.text}`:null}};h5.styles=[ct,Zoe];XL([Q()],h5.prototype,"text",void 0);h5=XL([ve("wui-separator")],h5);const gy={interpolate(t,e,r){if(t.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const n=t[0]||0,i=t[1]||0,s=e[0]||0,o=e[1]||0;return ri?o:(o-s)/(i-n)*(r-n)+s}},Qoe=3,Yoe=["receive","deposit","borrow","claim"],Joe=["withdraw","repay","burn"],hh={getMonthName(t){const e=new Date;return e.setMonth(t),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(t,e){const r=NA.getYear(),n=this.getMonthName(e);return t===r?n:`${n} ${t}`},getTransactionImages(t){const[e,r]=t,n=!!e&&(t==null?void 0:t.every(o=>!!o.nft_info)),i=(t==null?void 0:t.length)>1;return(t==null?void 0:t.length)===2&&!n?[this.getTransactionImage(e),this.getTransactionImage(r)]:i?t.map(o=>this.getTransactionImage(o)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:hh.getTransactionTransferTokenType(t),url:hh.getTransactionImageURL(t)}},getTransactionImageURL(t){var i,s,o,a,c;let e;const r=!!(t!=null&&t.nft_info),n=!!(t!=null&&t.fungible_info);return t&&r?e=(o=(s=(i=t==null?void 0:t.nft_info)==null?void 0:i.content)==null?void 0:s.preview)==null?void 0:o.url:t&&n&&(e=(c=(a=t==null?void 0:t.fungible_info)==null?void 0:a.icon)==null?void 0:c.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t){var h,g,v;const e=(h=t==null?void 0:t.metadata)==null?void 0:h.operationType,r=t==null?void 0:t.transfers,n=((g=t==null?void 0:t.transfers)==null?void 0:g.length)>0,i=((v=t==null?void 0:t.transfers)==null?void 0:v.length)>1,s=n&&(r==null?void 0:r.every(x=>!!(x!=null&&x.fungible_info))),[o,a]=r;let c=this.getTransferDescription(o),l=this.getTransferDescription(a);if(!n)return(e==="send"||e==="receive")&&s?(c=Pt.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),l=Pt.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[c,l]):[t.metadata.status];if(i)return r.map(x=>this.getTransferDescription(x));let d="";return Yoe.includes(e)?d="+":Joe.includes(e)&&(d="-"),c=d.concat(c),[c]},getTransferDescription(t){var r;let e="";return t&&(t!=null&&t.nft_info?e=((r=t==null?void 0:t.nft_info)==null?void 0:r.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var n;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(n=t==null?void 0:t.fungible_info)==null?void 0:n.symbol].join(" ").trim():null},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(Qoe):null}},cr={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",WALLET_STANDARD_CONNECTOR_ID:"announced",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"w3mAuth",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"}},ua={ConnectorExplorerIds:{[cr.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[cr.COINBASE_SDK_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[cr.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[cr.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[cr.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[cr.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[cr.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[cr.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[cr.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[cr.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[cr.INJECTED_CONNECTOR_ID]:"Browser Wallet",[cr.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[cr.COINBASE_CONNECTOR_ID]:"Coinbase",[cr.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[cr.LEDGER_CONNECTOR_ID]:"Ledger",[cr.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[cr.INJECTED_CONNECTOR_ID]:"INJECTED",[cr.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[cr.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[cr.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},vP={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([r,n])=>{e[`${cr.EIP155}:${r}`]=n}),e}};var p5;(function(t){t.Google="google",t.Github="github",t.Apple="apple",t.Facebook="facebook",t.X="x",t.Discord="discord",t.Farcaster="farcaster"})(p5||(p5={}));var aE={exports:{}},Vp=typeof Reflect=="object"?Reflect:null,yP=Vp&&typeof Vp.apply=="function"?Vp.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Xy;Vp&&typeof Vp.ownKeys=="function"?Xy=Vp.ownKeys:Object.getOwnPropertySymbols?Xy=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Xy=function(e){return Object.getOwnPropertyNames(e)};function Xoe(t){console&&console.warn&&console.warn(t)}var eB=Number.isNaN||function(e){return e!==e};function Kr(){Kr.init.call(this)}aE.exports=Kr;aE.exports.once=nae;Kr.EventEmitter=Kr;Kr.prototype._events=void 0;Kr.prototype._eventsCount=0;Kr.prototype._maxListeners=void 0;var bP=10;function V6(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Kr,"defaultMaxListeners",{enumerable:!0,get:function(){return bP},set:function(t){if(typeof t!="number"||t<0||eB(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");bP=t}});Kr.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};Kr.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||eB(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 tB(t){return t._maxListeners===void 0?Kr.defaultMaxListeners:t._maxListeners}Kr.prototype.getMaxListeners=function(){return tB(this)};Kr.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")yP(c,this,r);else for(var l=c.length,d=oB(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,Xoe(a)}return t}Kr.prototype.addListener=function(e,r){return rB(this,e,r,!1)};Kr.prototype.on=Kr.prototype.addListener;Kr.prototype.prependListener=function(e,r){return rB(this,e,r,!0)};function eae(){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 nB(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=eae.bind(n);return i.listener=r,n.wrapFn=i,i}Kr.prototype.once=function(e,r){return V6(r),this.on(e,nB(this,e,r)),this};Kr.prototype.prependOnceListener=function(e,r){return V6(r),this.prependListener(e,nB(this,e,r)),this};Kr.prototype.removeListener=function(e,r){var n,i,s,o,a;if(V6(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():tae(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Kr.prototype.off=Kr.prototype.removeListener;Kr.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 iB(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?rae(i):oB(i,i.length)}Kr.prototype.listeners=function(e){return iB(this,e,!0)};Kr.prototype.rawListeners=function(e){return iB(this,e,!1)};Kr.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):sB.call(t,e)};Kr.prototype.listenerCount=sB;function sB(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}Kr.prototype.eventNames=function(){return this._eventsCount>0?Xy(this._events):[]};function oB(t,e){for(var r=new Array(e),n=0;n"u")throw new TypeError("[unstorage] Buffer is not supported!")}const h_="base64:";function hae(t){if(typeof t=="string")return t;cB();const e=Buffer.from(t).toString("base64");return h_+e}function pae(t){return typeof t!="string"||!t.startsWith(h_)?t:(cB(),Buffer.from(t.slice(h_.length),"base64"))}function $s(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function gae(...t){return $s(t.join(":"))}function wy(t){return t=$s(t),t?t+":":""}const mae="memory",wae=()=>{const t=new Map;return{name:mae,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 vae(t={}){const e={mounts:{"":t.driver||wae()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const d of e.mountpoints)if(l.startsWith(d))return{base:d,relativeKey:l.slice(d.length),driver:e.mounts[d]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,d)=>e.mountpoints.filter(h=>h.startsWith(l)||d&&l.startsWith(h)).map(h=>({relativeBase:l.length>h.length?l.slice(h.length):void 0,mountpoint:h,driver:e.mounts[h]})),i=(l,d)=>{if(e.watching){d=$s(d);for(const h of e.watchListeners)h(l,d)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await xP(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,d,h)=>{const g=new Map,v=x=>{let R=g.get(x.base);return R||(R={driver:x.driver,base:x.base,items:[]},g.set(x.base,R)),R};for(const x of l){const R=typeof x=="string",M=$s(R?x:x.key),N=R?void 0:x.value,E=R||!x.options?d:{...d,...x.options},O=r(M);v(O).items.push({key:M,value:N,relativeKey:O.relativeKey,options:E})}return Promise.all([...g.values()].map(x=>h(x))).then(x=>x.flat())},c={hasItem(l,d={}){l=$s(l);const{relativeKey:h,driver:g}=r(l);return hi(g.hasItem,h,d)},getItem(l,d={}){l=$s(l);const{relativeKey:h,driver:g}=r(l);return hi(g.getItem,h,d).then(v=>my(v))},getItems(l,d){return a(l,d,h=>h.driver.getItems?hi(h.driver.getItems,h.items.map(g=>({key:g.relativeKey,options:g.options})),d).then(g=>g.map(v=>({key:gae(h.base,v.key),value:my(v.value)}))):Promise.all(h.items.map(g=>hi(h.driver.getItem,g.relativeKey,g.options).then(v=>({key:g.key,value:my(v)})))))},getItemRaw(l,d={}){l=$s(l);const{relativeKey:h,driver:g}=r(l);return g.getItemRaw?hi(g.getItemRaw,h,d):hi(g.getItem,h,d).then(v=>pae(v))},async setItem(l,d,h={}){if(d===void 0)return c.removeItem(l);l=$s(l);const{relativeKey:g,driver:v}=r(l);v.setItem&&(await hi(v.setItem,g,eb(d),h),v.watch||i("update",l))},async setItems(l,d){await a(l,d,async h=>{if(h.driver.setItems)return hi(h.driver.setItems,h.items.map(g=>({key:g.relativeKey,value:eb(g.value),options:g.options})),d);h.driver.setItem&&await Promise.all(h.items.map(g=>hi(h.driver.setItem,g.relativeKey,eb(g.value),g.options)))})},async setItemRaw(l,d,h={}){if(d===void 0)return c.removeItem(l,h);l=$s(l);const{relativeKey:g,driver:v}=r(l);if(v.setItemRaw)await hi(v.setItemRaw,g,d,h);else if(v.setItem)await hi(v.setItem,g,hae(d),h);else return;v.watch||i("update",l)},async removeItem(l,d={}){typeof d=="boolean"&&(d={removeMeta:d}),l=$s(l);const{relativeKey:h,driver:g}=r(l);g.removeItem&&(await hi(g.removeItem,h,d),(d.removeMeta||d.removeMata)&&await hi(g.removeItem,h+"$",d),g.watch||i("remove",l))},async getMeta(l,d={}){typeof d=="boolean"&&(d={nativeOnly:d}),l=$s(l);const{relativeKey:h,driver:g}=r(l),v=Object.create(null);if(g.getMeta&&Object.assign(v,await hi(g.getMeta,h,d)),!d.nativeOnly){const x=await hi(g.getItem,h+"$",d).then(R=>my(R));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(v,x))}return v},setMeta(l,d,h={}){return this.setItem(l+"$",d,h)},removeMeta(l,d={}){return this.removeItem(l+"$",d)},async getKeys(l,d={}){l=wy(l);const h=n(l,!0);let g=[];const v=[];for(const x of h){const R=await hi(x.driver.getKeys,x.relativeBase,d);for(const M of R){const N=x.mountpoint+$s(M);g.some(E=>N.startsWith(E))||v.push(N)}g=[x.mountpoint,...g.filter(M=>!M.startsWith(x.mountpoint))]}return l?v.filter(x=>x.startsWith(l)&&x[x.length-1]!=="$"):v.filter(x=>x[x.length-1]!=="$")},async clear(l,d={}){l=wy(l),await Promise.all(n(l,!1).map(async h=>{if(h.driver.clear)return hi(h.driver.clear,h.relativeBase,d);if(h.driver.removeItem){const g=await h.driver.getKeys(h.relativeBase||"",d);return Promise.all(g.map(v=>h.driver.removeItem(v,d)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>_P(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(d=>d!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,d){if(l=wy(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((h,g)=>g.length-h.length)),e.mounts[l]=d,e.watching&&Promise.resolve(xP(d,i,l)).then(h=>{e.unwatch[l]=h}).catch(console.error),c},async unmount(l,d=!0){l=wy(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),d&&await _P(e.mounts[l]),e.mountpoints=e.mountpoints.filter(h=>h!==l),delete e.mounts[l])},getMount(l=""){l=$s(l)+":";const d=r(l);return{driver:d.driver,base:d.base}},getMounts(l="",d={}){return l=$s(l),n(l,d.parents).map(g=>({driver:g.driver,base:g.mountpoint}))},keys:(l,d={})=>c.getKeys(l,d),get:(l,d={})=>c.getItem(l,d),set:(l,d,h={})=>c.setItem(l,d,h),has:(l,d={})=>c.hasItem(l,d),del:(l,d={})=>c.removeItem(l,d),remove:(l,d={})=>c.removeItem(l,d)};return c}function xP(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function _P(t){typeof t.dispose=="function"&&await hi(t.dispose)}function I0(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function lB(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=I0(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let Gx;function f2(){return Gx||(Gx=lB("keyval-store","keyval")),Gx}function CP(t,e=f2()){return e("readonly",r=>I0(r.get(t)))}function yae(t,e,r=f2()){return r("readwrite",n=>(n.put(e,t),I0(n.transaction)))}function bae(t,e=f2()){return e("readwrite",r=>(r.delete(t),I0(r.transaction)))}function xae(t=f2()){return t("readwrite",e=>(e.clear(),I0(e.transaction)))}function _ae(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},I0(t.transaction)}function Cae(t=f2()){return t("readonly",e=>{if(e.getAllKeys)return I0(e.getAllKeys());const r=[];return _ae(e,n=>r.push(n.key)).then(()=>r)})}const Aae="idb-keyval";var Eae=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=lB(t.dbName,t.storeName)),{name:Aae,options:t,async hasItem(i){return!(typeof await CP(r(i),n)>"u")},async getItem(i){return await CP(r(i),n)??null},setItem(i,s){return yae(r(i),s,n)},removeItem(i){return bae(r(i),n)},getKeys(){return Cae(n)},clear(){return xae(n)}}};const Sae="WALLET_CONNECT_V2_INDEXED_DB",Iae="keyvaluestorage";let Tae=class{constructor(){this.indexedDb=vae({driver:Eae({dbName:Sae,storeName:Iae})})}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,Iu(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Zx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},tb={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 Zx<"u"&&Zx.localStorage?tb.exports=Zx.localStorage:typeof window<"u"&&window.localStorage?tb.exports=window.localStorage:tb.exports=new e})();function kae(t){var e;return[t[0],Bh((e=t[1])!=null?e:"")]}let Pae=class{constructor(){this.localStorage=tb.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(kae)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Bh(r)}async setItem(e,r){this.localStorage.setItem(e,Iu(r))}async removeItem(e){this.localStorage.removeItem(e)}};const Rae="wc_storage_version",AP=1,Nae=async(t,e,r)=>{const n=Rae,i=await e.getItem(n);if(i&&i>=AP){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,AP),r(e),Mae(t,o)},Mae=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let Oae=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new Pae;this.storage=e;try{const r=new Tae;Nae(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)})}};var Ye={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -5958,108 +5958,108 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var CC=function(t,e){return CC=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])},CC(t,e)};function rce(t,e){CC(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _C=function(){return _C=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 sce(t,e){return function(r,n){e(r,n,t)}}function oce(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ace(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(d){try{l(n.next(d))}catch(f){o(f)}}function c(d){try{l(n.throw(d))}catch(f){o(f)}}function l(d){d.done?s(d.value):i(d.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function cce(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(d){return c([l,d])}}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 SB(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 dce(){for(var t=[],e=0;e1||a(g,v)})})}function a(g,v){try{c(n[g](v))}catch(x){f(s[0][3],x)}}function c(g){g.value instanceof cv?Promise.resolve(g.value.v).then(l,d):f(s[0][2],g)}function l(g){a("next",g)}function d(g){a("throw",g)}function f(g,v){g(v),s.shift(),s.length&&a(s[0][0],s[0][1])}}function pce(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:cv(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function gce(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 AC=="function"?AC(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 mce(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function wce(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 vce(t){return t&&t.__esModule?t:{default:t}}function yce(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function bce(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 xce=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return _C},__asyncDelegator:pce,__asyncGenerator:hce,__asyncValues:gce,__await:cv,__awaiter:ace,__classPrivateFieldGet:yce,__classPrivateFieldSet:bce,__createBinding:lce,__decorate:ice,__exportStar:uce,__extends:rce,__generator:cce,__importDefault:vce,__importStar:wce,__makeTemplateObject:mce,__metadata:oce,__param:sce,__read:SB,__rest:nce,__spread:dce,__spreadArrays:fce,__values:AC},Symbol.toStringTag,{value:"Module"})),g2=Z$(xce);var n9={},dm={},BR;function Cce(){if(BR)return dm;BR=1,Object.defineProperty(dm,"__esModule",{value:!0}),dm.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return dm.delay=t,dm}var th={},i9={},rh={},UR;function _ce(){return UR||(UR=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.ONE_THOUSAND=rh.ONE_HUNDRED=void 0,rh.ONE_HUNDRED=100,rh.ONE_THOUSAND=1e3),rh}var s9={},jR;function Ace(){return jR||(jR=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}(s9)),s9}var FR;function IB(){return FR||(FR=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g2;e.__exportStar(_ce(),t),e.__exportStar(Ace(),t)}(i9)),i9}var zR;function Ece(){if(zR)return th;zR=1,Object.defineProperty(th,"__esModule",{value:!0}),th.fromMiliseconds=th.toMiliseconds=void 0;const t=IB();function e(n){return n*t.ONE_THOUSAND}th.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return th.fromMiliseconds=r,th}var WR;function Sce(){return WR||(WR=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g2;e.__exportStar(Cce(),t),e.__exportStar(Ece(),t)}(n9)),n9}var dp={},HR;function Ice(){if(HR)return dp;HR=1,Object.defineProperty(dp,"__esModule",{value:!0}),dp.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 dp.Watch=t,dp.default=t,dp}var o9={},fm={},qR;function Tce(){if(qR)return fm;qR=1,Object.defineProperty(fm,"__esModule",{value:!0}),fm.IWatch=void 0;class t{}return fm.IWatch=t,fm}var VR;function kce(){return VR||(VR=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),g2.__exportStar(Tce(),t)}(o9)),o9}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g2;e.__exportStar(Sce(),t),e.__exportStar(Ice(),t),e.__exportStar(kce(),t),e.__exportStar(IB(),t)})(Je);class R0{}let Rce=class extends R0{constructor(e){super()}};const KR=Je.FIVE_SECONDS,dg={pulse:"heartbeat_pulse"};let Pce=class TB extends Rce{constructor(e){super(e),this.events=new Ea.EventEmitter,this.interval=KR,this.interval=(e==null?void 0:e.interval)||KR}static async init(e){const r=new TB(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(),Je.toMiliseconds(this.interval))}pulse(){this.events.emit(dg.pulse)}},Nce=class extends R0{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},Mce=class extends R0{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},$ce=class{constructor(e,r){this.logger=e,this.core=r}},Oce=class extends R0{constructor(e,r){super(),this.relayer=e,this.logger=r}},Dce=class extends R0{constructor(e){super()}},Lce=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},Bce=class extends R0{constructor(e,r){super(),this.relayer=e,this.logger=r}};class Uce extends R0{constructor(e,r){super(),this.core=e,this.logger=r}}let jce=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},Fce=class{constructor(e,r){this.projectId=e,this.logger=r}},zce=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},Wce=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},Hce=class{constructor(e){this.client=e}};var bE={},kf={},e4={},t4={};Object.defineProperty(t4,"__esModule",{value:!0});t4.BrowserRandomSource=void 0;const GR=65536;class qce{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n>>16&65535,d=a&65535,f=c>>>16&65535,g=c&65535;return d*g+(l*g+d*f<<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}})(kB);Object.defineProperty(dr,"__esModule",{value:!0});var RB=kB;function tle(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}dr.readInt16BE=tle;function rle(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}dr.readUint16BE=rle;function nle(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}dr.readInt16LE=nle;function ile(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}dr.readUint16LE=ile;function PB(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}dr.writeUint16BE=PB;dr.writeInt16BE=PB;function NB(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}dr.writeUint16LE=NB;dr.writeInt16LE=NB;function EC(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}dr.readInt32BE=EC;function SC(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}dr.readUint32BE=SC;function IC(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}dr.readInt32LE=IC;function TC(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}dr.readUint32LE=TC;function x5(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}dr.writeUint32BE=x5;dr.writeInt32BE=x5;function C5(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}dr.writeUint32LE=C5;dr.writeInt32LE=C5;function sle(t,e){e===void 0&&(e=0);var r=EC(t,e),n=EC(t,e+4);return r*4294967296+n-(n>>31)*4294967296}dr.readInt64BE=sle;function ole(t,e){e===void 0&&(e=0);var r=SC(t,e),n=SC(t,e+4);return r*4294967296+n}dr.readUint64BE=ole;function ale(t,e){e===void 0&&(e=0);var r=IC(t,e),n=IC(t,e+4);return n*4294967296+r-(r>>31)*4294967296}dr.readInt64LE=ale;function cle(t,e){e===void 0&&(e=0);var r=TC(t,e),n=TC(t,e+4);return n*4294967296+r}dr.readUint64LE=cle;function MB(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),x5(t/4294967296>>>0,e,r),x5(t>>>0,e,r+4),e}dr.writeUint64BE=MB;dr.writeInt64BE=MB;function $B(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),C5(t>>>0,e,r),C5(t/4294967296>>>0,e,r+4),e}dr.writeUint64LE=$B;dr.writeInt64LE=$B;function lle(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}dr.readUintBE=lle;function ule(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}dr.writeUintBE=dle;function fle(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(!RB.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s256)throw new Error("randomString charset is too long");let g="";const v=d.length,x=256-256%v;for(;l>0;){const P=i(Math.ceil(l*256/x),f);for(let M=0;M0;M++){const N=P[M];N0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],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&&(d=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,d,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[d++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,d=this._bufferLength,f=l/536870912|0,g=l<<3,v=l%128<112?128:256;this._buffer[d]=128;for(var x=d+1;x0?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,d,f,g,v){for(var x=l[0],P=l[1],M=l[2],N=l[3],E=l[4],$=l[5],L=l[6],j=l[7],H=d[0],I=d[1],T=d[2],B=d[3],K=d[4],U=d[5],C=d[6],p=d[7],m,w,_,R,S,k,y,b;v>=128;){for(var V=0;V<16;V++){var ce=8*V+g;a[V]=e.readUint32BE(f,ce),c[V]=e.readUint32BE(f,ce+4)}for(var V=0;V<80;V++){var fe=x,W=P,ue=M,J=N,ne=E,ie=$,D=L,te=j,me=H,Ce=I,Ee=T,Re=B,He=K,Xe=U,kt=C,rt=p;if(m=j,w=p,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=(E>>>14|K<<18)^(E>>>18|K<<14)^(K>>>9|E<<23),w=(K>>>14|E<<18)^(K>>>18|E<<14)^(E>>>9|K<<23),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=E&$^~E&L,w=K&U^~K&C,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=i[V*2],w=i[V*2+1],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=a[V%16],w=c[V%16],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,_=y&65535|b<<16,R=S&65535|k<<16,m=_,w=R,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=(x>>>28|H<<4)^(H>>>2|x<<30)^(H>>>7|x<<25),w=(H>>>28|x<<4)^(x>>>2|H<<30)^(x>>>7|H<<25),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=x&P^x&M^P&M,w=H&I^H&T^I&T,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,te=y&65535|b<<16,rt=S&65535|k<<16,m=J,w=Re,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=_,w=R,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,J=y&65535|b<<16,Re=S&65535|k<<16,P=fe,M=W,N=ue,E=J,$=ne,L=ie,j=D,x=te,I=me,T=Ce,B=Ee,K=Re,U=He,C=Xe,p=kt,H=rt,V%16===15)for(var ce=0;ce<16;ce++)m=a[ce],w=c[ce],S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=a[(ce+9)%16],w=c[(ce+9)%16],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,_=a[(ce+1)%16],R=c[(ce+1)%16],m=(_>>>1|R<<31)^(_>>>8|R<<24)^_>>>7,w=(R>>>1|_<<31)^(R>>>8|_<<24)^(R>>>7|_<<25),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,_=a[(ce+14)%16],R=c[(ce+14)%16],m=(_>>>19|R<<13)^(R>>>29|_<<3)^_>>>6,w=(R>>>19|_<<13)^(_>>>29|R<<3)^(R>>>6|_<<26),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,a[ce]=y&65535|b<<16,c[ce]=S&65535|k<<16}m=x,w=H,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[0],w=d[0],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[0]=x=y&65535|b<<16,d[0]=H=S&65535|k<<16,m=P,w=I,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[1],w=d[1],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[1]=P=y&65535|b<<16,d[1]=I=S&65535|k<<16,m=M,w=T,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[2],w=d[2],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[2]=M=y&65535|b<<16,d[2]=T=S&65535|k<<16,m=N,w=B,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[3],w=d[3],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[3]=N=y&65535|b<<16,d[3]=B=S&65535|k<<16,m=E,w=K,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[4],w=d[4],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[4]=E=y&65535|b<<16,d[4]=K=S&65535|k<<16,m=$,w=U,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[5],w=d[5],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[5]=$=y&65535|b<<16,d[5]=U=S&65535|k<<16,m=L,w=C,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[6],w=d[6],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[6]=L=y&65535|b<<16,d[6]=C=S&65535|k<<16,m=j,w=p,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[7],w=d[7],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[7]=j=y&65535|b<<16,d[7]=p=S&65535|k<<16,g+=128,v-=128}return g}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(OB);(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=kf,r=OB,n=Mo;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(J){const ne=new Float64Array(16);if(J)for(let ie=0;ie>16&1),ie[Ce-1]&=65535;ie[15]=D[15]-32767-(ie[14]>>16&1);const me=ie[15]>>16&1;ie[14]&=65535,P(D,ie,1-me)}for(let te=0;te<16;te++)J[2*te]=D[te]&255,J[2*te+1]=D[te]>>8}function N(J,ne){let ie=0;for(let D=0;D<32;D++)ie|=J[D]^ne[D];return(1&ie-1>>>8)-1}function E(J,ne){const ie=new Uint8Array(32),D=new Uint8Array(32);return M(ie,J),M(D,ne),N(ie,D)}function $(J){const ne=new Uint8Array(32);return M(ne,J),ne[0]&1}function L(J,ne){for(let ie=0;ie<16;ie++)J[ie]=ne[2*ie]+(ne[2*ie+1]<<8);J[15]&=32767}function j(J,ne,ie){for(let D=0;D<16;D++)J[D]=ne[D]+ie[D]}function H(J,ne,ie){for(let D=0;D<16;D++)J[D]=ne[D]-ie[D]}function I(J,ne,ie){let D,te,me=0,Ce=0,Ee=0,Re=0,He=0,Xe=0,kt=0,rt=0,st=0,Ze=0,Be=0,nt=0,lt=0,je=0,at=0,G=0,O=0,z=0,X=0,ae=0,he=0,be=0,Ne=0,Ve=0,dt=0,Ge=0,wt=0,er=0,Pt=0,yr=0,_r=0,ft=ie[0],$t=ie[1],Ft=ie[2],ht=ie[3],Bt=ie[4],Ot=ie[5],vt=ie[6],Qt=ie[7],zt=ie[8],yt=ie[9],Wt=ie[10],qt=ie[11],pt=ie[12],Nt=ie[13],Yt=ie[14],bt=ie[15];D=ne[0],me+=D*ft,Ce+=D*$t,Ee+=D*Ft,Re+=D*ht,He+=D*Bt,Xe+=D*Ot,kt+=D*vt,rt+=D*Qt,st+=D*zt,Ze+=D*yt,Be+=D*Wt,nt+=D*qt,lt+=D*pt,je+=D*Nt,at+=D*Yt,G+=D*bt,D=ne[1],Ce+=D*ft,Ee+=D*$t,Re+=D*Ft,He+=D*ht,Xe+=D*Bt,kt+=D*Ot,rt+=D*vt,st+=D*Qt,Ze+=D*zt,Be+=D*yt,nt+=D*Wt,lt+=D*qt,je+=D*pt,at+=D*Nt,G+=D*Yt,O+=D*bt,D=ne[2],Ee+=D*ft,Re+=D*$t,He+=D*Ft,Xe+=D*ht,kt+=D*Bt,rt+=D*Ot,st+=D*vt,Ze+=D*Qt,Be+=D*zt,nt+=D*yt,lt+=D*Wt,je+=D*qt,at+=D*pt,G+=D*Nt,O+=D*Yt,z+=D*bt,D=ne[3],Re+=D*ft,He+=D*$t,Xe+=D*Ft,kt+=D*ht,rt+=D*Bt,st+=D*Ot,Ze+=D*vt,Be+=D*Qt,nt+=D*zt,lt+=D*yt,je+=D*Wt,at+=D*qt,G+=D*pt,O+=D*Nt,z+=D*Yt,X+=D*bt,D=ne[4],He+=D*ft,Xe+=D*$t,kt+=D*Ft,rt+=D*ht,st+=D*Bt,Ze+=D*Ot,Be+=D*vt,nt+=D*Qt,lt+=D*zt,je+=D*yt,at+=D*Wt,G+=D*qt,O+=D*pt,z+=D*Nt,X+=D*Yt,ae+=D*bt,D=ne[5],Xe+=D*ft,kt+=D*$t,rt+=D*Ft,st+=D*ht,Ze+=D*Bt,Be+=D*Ot,nt+=D*vt,lt+=D*Qt,je+=D*zt,at+=D*yt,G+=D*Wt,O+=D*qt,z+=D*pt,X+=D*Nt,ae+=D*Yt,he+=D*bt,D=ne[6],kt+=D*ft,rt+=D*$t,st+=D*Ft,Ze+=D*ht,Be+=D*Bt,nt+=D*Ot,lt+=D*vt,je+=D*Qt,at+=D*zt,G+=D*yt,O+=D*Wt,z+=D*qt,X+=D*pt,ae+=D*Nt,he+=D*Yt,be+=D*bt,D=ne[7],rt+=D*ft,st+=D*$t,Ze+=D*Ft,Be+=D*ht,nt+=D*Bt,lt+=D*Ot,je+=D*vt,at+=D*Qt,G+=D*zt,O+=D*yt,z+=D*Wt,X+=D*qt,ae+=D*pt,he+=D*Nt,be+=D*Yt,Ne+=D*bt,D=ne[8],st+=D*ft,Ze+=D*$t,Be+=D*Ft,nt+=D*ht,lt+=D*Bt,je+=D*Ot,at+=D*vt,G+=D*Qt,O+=D*zt,z+=D*yt,X+=D*Wt,ae+=D*qt,he+=D*pt,be+=D*Nt,Ne+=D*Yt,Ve+=D*bt,D=ne[9],Ze+=D*ft,Be+=D*$t,nt+=D*Ft,lt+=D*ht,je+=D*Bt,at+=D*Ot,G+=D*vt,O+=D*Qt,z+=D*zt,X+=D*yt,ae+=D*Wt,he+=D*qt,be+=D*pt,Ne+=D*Nt,Ve+=D*Yt,dt+=D*bt,D=ne[10],Be+=D*ft,nt+=D*$t,lt+=D*Ft,je+=D*ht,at+=D*Bt,G+=D*Ot,O+=D*vt,z+=D*Qt,X+=D*zt,ae+=D*yt,he+=D*Wt,be+=D*qt,Ne+=D*pt,Ve+=D*Nt,dt+=D*Yt,Ge+=D*bt,D=ne[11],nt+=D*ft,lt+=D*$t,je+=D*Ft,at+=D*ht,G+=D*Bt,O+=D*Ot,z+=D*vt,X+=D*Qt,ae+=D*zt,he+=D*yt,be+=D*Wt,Ne+=D*qt,Ve+=D*pt,dt+=D*Nt,Ge+=D*Yt,wt+=D*bt,D=ne[12],lt+=D*ft,je+=D*$t,at+=D*Ft,G+=D*ht,O+=D*Bt,z+=D*Ot,X+=D*vt,ae+=D*Qt,he+=D*zt,be+=D*yt,Ne+=D*Wt,Ve+=D*qt,dt+=D*pt,Ge+=D*Nt,wt+=D*Yt,er+=D*bt,D=ne[13],je+=D*ft,at+=D*$t,G+=D*Ft,O+=D*ht,z+=D*Bt,X+=D*Ot,ae+=D*vt,he+=D*Qt,be+=D*zt,Ne+=D*yt,Ve+=D*Wt,dt+=D*qt,Ge+=D*pt,wt+=D*Nt,er+=D*Yt,Pt+=D*bt,D=ne[14],at+=D*ft,G+=D*$t,O+=D*Ft,z+=D*ht,X+=D*Bt,ae+=D*Ot,he+=D*vt,be+=D*Qt,Ne+=D*zt,Ve+=D*yt,dt+=D*Wt,Ge+=D*qt,wt+=D*pt,er+=D*Nt,Pt+=D*Yt,yr+=D*bt,D=ne[15],G+=D*ft,O+=D*$t,z+=D*Ft,X+=D*ht,ae+=D*Bt,he+=D*Ot,be+=D*vt,Ne+=D*Qt,Ve+=D*zt,dt+=D*yt,Ge+=D*Wt,wt+=D*qt,er+=D*pt,Pt+=D*Nt,yr+=D*Yt,_r+=D*bt,me+=38*O,Ce+=38*z,Ee+=38*X,Re+=38*ae,He+=38*he,Xe+=38*be,kt+=38*Ne,rt+=38*Ve,st+=38*dt,Ze+=38*Ge,Be+=38*wt,nt+=38*er,lt+=38*Pt,je+=38*yr,at+=38*_r,te=1,D=me+te+65535,te=Math.floor(D/65536),me=D-te*65536,D=Ce+te+65535,te=Math.floor(D/65536),Ce=D-te*65536,D=Ee+te+65535,te=Math.floor(D/65536),Ee=D-te*65536,D=Re+te+65535,te=Math.floor(D/65536),Re=D-te*65536,D=He+te+65535,te=Math.floor(D/65536),He=D-te*65536,D=Xe+te+65535,te=Math.floor(D/65536),Xe=D-te*65536,D=kt+te+65535,te=Math.floor(D/65536),kt=D-te*65536,D=rt+te+65535,te=Math.floor(D/65536),rt=D-te*65536,D=st+te+65535,te=Math.floor(D/65536),st=D-te*65536,D=Ze+te+65535,te=Math.floor(D/65536),Ze=D-te*65536,D=Be+te+65535,te=Math.floor(D/65536),Be=D-te*65536,D=nt+te+65535,te=Math.floor(D/65536),nt=D-te*65536,D=lt+te+65535,te=Math.floor(D/65536),lt=D-te*65536,D=je+te+65535,te=Math.floor(D/65536),je=D-te*65536,D=at+te+65535,te=Math.floor(D/65536),at=D-te*65536,D=G+te+65535,te=Math.floor(D/65536),G=D-te*65536,me+=te-1+37*(te-1),te=1,D=me+te+65535,te=Math.floor(D/65536),me=D-te*65536,D=Ce+te+65535,te=Math.floor(D/65536),Ce=D-te*65536,D=Ee+te+65535,te=Math.floor(D/65536),Ee=D-te*65536,D=Re+te+65535,te=Math.floor(D/65536),Re=D-te*65536,D=He+te+65535,te=Math.floor(D/65536),He=D-te*65536,D=Xe+te+65535,te=Math.floor(D/65536),Xe=D-te*65536,D=kt+te+65535,te=Math.floor(D/65536),kt=D-te*65536,D=rt+te+65535,te=Math.floor(D/65536),rt=D-te*65536,D=st+te+65535,te=Math.floor(D/65536),st=D-te*65536,D=Ze+te+65535,te=Math.floor(D/65536),Ze=D-te*65536,D=Be+te+65535,te=Math.floor(D/65536),Be=D-te*65536,D=nt+te+65535,te=Math.floor(D/65536),nt=D-te*65536,D=lt+te+65535,te=Math.floor(D/65536),lt=D-te*65536,D=je+te+65535,te=Math.floor(D/65536),je=D-te*65536,D=at+te+65535,te=Math.floor(D/65536),at=D-te*65536,D=G+te+65535,te=Math.floor(D/65536),G=D-te*65536,me+=te-1+37*(te-1),J[0]=me,J[1]=Ce,J[2]=Ee,J[3]=Re,J[4]=He,J[5]=Xe,J[6]=kt,J[7]=rt,J[8]=st,J[9]=Ze,J[10]=Be,J[11]=nt,J[12]=lt,J[13]=je,J[14]=at,J[15]=G}function T(J,ne){I(J,ne,ne)}function B(J,ne){const ie=i();let D;for(D=0;D<16;D++)ie[D]=ne[D];for(D=253;D>=0;D--)T(ie,ie),D!==2&&D!==4&&I(ie,ie,ne);for(D=0;D<16;D++)J[D]=ie[D]}function K(J,ne){const ie=i();let D;for(D=0;D<16;D++)ie[D]=ne[D];for(D=250;D>=0;D--)T(ie,ie),D!==1&&I(ie,ie,ne);for(D=0;D<16;D++)J[D]=ie[D]}function U(J,ne){const ie=i(),D=i(),te=i(),me=i(),Ce=i(),Ee=i(),Re=i(),He=i(),Xe=i();H(ie,J[1],J[0]),H(Xe,ne[1],ne[0]),I(ie,ie,Xe),j(D,J[0],J[1]),j(Xe,ne[0],ne[1]),I(D,D,Xe),I(te,J[3],ne[3]),I(te,te,l),I(me,J[2],ne[2]),j(me,me,me),H(Ce,D,ie),H(Ee,me,te),j(Re,me,te),j(He,D,ie),I(J[0],Ce,Ee),I(J[1],He,Re),I(J[2],Re,Ee),I(J[3],Ce,He)}function C(J,ne,ie){for(let D=0;D<4;D++)P(J[D],ne[D],ie)}function p(J,ne){const ie=i(),D=i(),te=i();B(te,ne[2]),I(ie,ne[0],te),I(D,ne[1],te),M(J,D),J[31]^=$(ie)<<7}function m(J,ne,ie){v(J[0],o),v(J[1],a),v(J[2],a),v(J[3],o);for(let D=255;D>=0;--D){const te=ie[D/8|0]>>(D&7)&1;C(J,ne,te),U(ne,J),U(J,J),C(J,ne,te)}}function w(J,ne){const ie=[i(),i(),i(),i()];v(ie[0],d),v(ie[1],f),v(ie[2],a),I(ie[3],d,f),m(J,ie,ne)}function _(J){if(J.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const ne=(0,r.hash)(J);ne[0]&=248,ne[31]&=127,ne[31]|=64;const ie=new Uint8Array(32),D=[i(),i(),i(),i()];w(D,ne),p(ie,D);const te=new Uint8Array(64);return te.set(J),te.set(ie,32),{publicKey:ie,secretKey:te}}t.generateKeyPairFromSeed=_;function R(J){const ne=(0,e.randomBytes)(32,J),ie=_(ne);return(0,n.wipe)(ne),ie}t.generateKeyPair=R;function S(J){if(J.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}t.extractPublicKeyFromSecretKey=S;const k=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 y(J,ne){let ie,D,te,me;for(D=63;D>=32;--D){for(ie=0,te=D-32,me=D-12;te>4)*k[te],ie=ne[te]>>8,ne[te]&=255;for(te=0;te<32;te++)ne[te]-=ie*k[te];for(D=0;D<32;D++)ne[D+1]+=ne[D]>>8,J[D]=ne[D]&255}function b(J){const ne=new Float64Array(64);for(let ie=0;ie<64;ie++)ne[ie]=J[ie];for(let ie=0;ie<64;ie++)J[ie]=0;y(J,ne)}function V(J,ne){const ie=new Float64Array(64),D=[i(),i(),i(),i()],te=(0,r.hash)(J.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const me=new Uint8Array(64);me.set(te.subarray(32),32);const Ce=new r.SHA512;Ce.update(me.subarray(32)),Ce.update(ne);const Ee=Ce.digest();Ce.clean(),b(Ee),w(D,Ee),p(me,D),Ce.reset(),Ce.update(me.subarray(0,32)),Ce.update(J.subarray(32)),Ce.update(ne);const Re=Ce.digest();b(Re);for(let He=0;He<32;He++)ie[He]=Ee[He];for(let He=0;He<32;He++)for(let Xe=0;Xe<32;Xe++)ie[He+Xe]+=Re[He]*te[Xe];return y(me.subarray(32),ie),me}t.sign=V;function ce(J,ne){const ie=i(),D=i(),te=i(),me=i(),Ce=i(),Ee=i(),Re=i();return v(J[2],a),L(J[1],ne),T(te,J[1]),I(me,te,c),H(te,te,J[2]),j(me,J[2],me),T(Ce,me),T(Ee,Ce),I(Re,Ee,Ce),I(ie,Re,te),I(ie,ie,me),K(ie,ie),I(ie,ie,te),I(ie,ie,me),I(ie,ie,me),I(J[0],ie,me),T(D,J[0]),I(D,D,me),E(D,te)&&I(J[0],J[0],g),T(D,J[0]),I(D,D,me),E(D,te)?-1:($(J[0])===ne[31]>>7&&H(J[0],o,J[0]),I(J[3],J[0],J[1]),0)}function fe(J,ne,ie){const D=new Uint8Array(32),te=[i(),i(),i(),i()],me=[i(),i(),i(),i()];if(ie.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ce(me,J))return!1;const Ce=new r.SHA512;Ce.update(ie.subarray(0,32)),Ce.update(J),Ce.update(ne);const Ee=Ce.digest();return b(Ee),m(te,me,Ee),w(me,ie.subarray(32)),U(te,me),p(D,te),!N(ie,D)}t.verify=fe;function W(J){let ne=[i(),i(),i(),i()];if(ce(ne,J))throw new Error("Ed25519: invalid public key");let ie=i(),D=i(),te=ne[1];j(ie,a,te),H(D,a,te),B(D,D),I(ie,ie,D);let me=new Uint8Array(32);return M(me,ie),me}t.convertPublicKeyToX25519=W;function ue(J){const ne=(0,r.hash)(J.subarray(0,32));ne[0]&=248,ne[31]&=127,ne[31]|=64;const ie=new Uint8Array(ne.subarray(0,32));return(0,n.wipe)(ne),ie}t.convertSecretKeyToX25519=ue})(bE);const xle="EdDSA",Cle="JWT",_5=".",n4="base64url",DB="utf8",LB="utf8",_le=":",Ale="did",Ele="key",ZR="base58btc",Sle="z",Ile="K36",Tle=32;function BB(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function ab(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=BB(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function kle(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($);N!==E;){for(var j=x[N],H=0,I=$-1;(j!==0||H>>0,L[I]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");M=H,N++}for(var T=$-M;T!==$&&L[T]===0;)T++;for(var B=c.repeat(P);T<$;++T)B+=t.charAt(L[T]);return B}function g(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var P=0;if(x[P]!==" "){for(var M=0,N=0;x[P]===c;)M++,P++;for(var E=(x.length-P)*l+1>>>0,$=new Uint8Array(E);x[P];){var L=r[x.charCodeAt(P)];if(L===255)return;for(var j=0,H=E-1;(L!==0||j>>0,$[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");N=j,P++}if(x[P]!==" "){for(var I=E-N;I!==E&&$[I]===0;)I++;for(var T=new Uint8Array(M+(E-I)),B=M;I!==E;)T[B++]=$[I++];return T}}}function v(x){var P=g(x);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:g,decode:v}}var Rle=kle,Ple=Rle;const Nle=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")},Mle=t=>new TextEncoder().encode(t),$le=t=>new TextDecoder().decode(t);class Ole{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 Dle{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 UB(this,e)}}class Lle{constructor(e){this.decoders=e}or(e){return UB(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 UB=(t,e)=>new Lle({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Ble{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ole(e,r,n),this.decoder=new Dle(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const i4=({name:t,prefix:e,encode:r,decode:n})=>new Ble(t,e,r,n),m2=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Ple(r,e);return i4({prefix:t,name:e,encode:n,decode:s=>Nle(i(s))})},Ule=(t,e,r,n)=>{const i={};for(let d=0;d=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},jle=(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<i4({prefix:e,name:t,encode(i){return jle(i,n,r)},decode(i){return Ule(i,n,r,t)}}),Fle=i4({prefix:"\0",name:"identity",encode:t=>$le(t),decode:t=>Mle(t)}),zle=Object.freeze(Object.defineProperty({__proto__:null,identity:Fle},Symbol.toStringTag,{value:"Module"})),Wle=Pi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Hle=Object.freeze(Object.defineProperty({__proto__:null,base2:Wle},Symbol.toStringTag,{value:"Module"})),qle=Pi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Vle=Object.freeze(Object.defineProperty({__proto__:null,base8:qle},Symbol.toStringTag,{value:"Module"})),Kle=m2({prefix:"9",name:"base10",alphabet:"0123456789"}),Gle=Object.freeze(Object.defineProperty({__proto__:null,base10:Kle},Symbol.toStringTag,{value:"Module"})),Zle=Pi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Qle=Pi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Yle=Object.freeze(Object.defineProperty({__proto__:null,base16:Zle,base16upper:Qle},Symbol.toStringTag,{value:"Module"})),Jle=Pi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Xle=Pi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),eue=Pi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tue=Pi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rue=Pi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),nue=Pi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),iue=Pi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sue=Pi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),oue=Pi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),aue=Object.freeze(Object.defineProperty({__proto__:null,base32:Jle,base32hex:rue,base32hexpad:iue,base32hexpadupper:sue,base32hexupper:nue,base32pad:eue,base32padupper:tue,base32upper:Xle,base32z:oue},Symbol.toStringTag,{value:"Module"})),cue=m2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),lue=m2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),uue=Object.freeze(Object.defineProperty({__proto__:null,base36:cue,base36upper:lue},Symbol.toStringTag,{value:"Module"})),due=m2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fue=m2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hue=Object.freeze(Object.defineProperty({__proto__:null,base58btc:due,base58flickr:fue},Symbol.toStringTag,{value:"Module"})),pue=Pi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),gue=Pi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),mue=Pi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wue=Pi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),vue=Object.freeze(Object.defineProperty({__proto__:null,base64:pue,base64pad:gue,base64url:mue,base64urlpad:wue},Symbol.toStringTag,{value:"Module"})),jB=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),yue=jB.reduce((t,e,r)=>(t[r]=e,t),[]),bue=jB.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function xue(t){return t.reduce((e,r)=>(e+=yue[r],e),"")}function Cue(t){const e=[];for(const r of t){const n=bue[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const _ue=i4({prefix:"🚀",name:"base256emoji",encode:xue,decode:Cue}),Aue=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:_ue},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const QR={...zle,...Hle,...Vle,...Gle,...Yle,...aue,...uue,...hue,...vue,...Aue};function FB(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const YR=FB("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),a9=FB("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=BB(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new $ue:typeof navigator<"u"?jue(navigator.userAgent):zue()}function Uue(t){return t!==""&&Lue.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 jue(t){var e=Uue(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Mue;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length-1){const M=x.getAttribute("href");if(M)if(M.toLowerCase().indexOf("https:")===-1&&M.toLowerCase().indexOf("http:")===-1&&M.indexOf("//")!==0){let N=e.protocol+"//"+e.host;if(M.indexOf("/")===0)N+=M;else{const E=e.pathname.split("/");E.pop();const $=E.join("/");N+=$+"/"+M}g.push(N)}else if(M.indexOf("//")===0){const N=e.protocol+M;g.push(N)}else g.push(M)}}return g}function n(...f){const g=t.getElementsByTagName("meta");for(let v=0;vx.getAttribute(M)).filter(M=>M?f.includes(M):!1);if(P.length&&P){const M=x.getAttribute("content");if(M)return M}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}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}}qB=_E.getWindowMetadata=ede;var lv={},tde=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),VB="%[a-f0-9]{2}",iP=new RegExp("("+VB+")|([^%]+?)","gi"),sP=new RegExp("("+VB+")+","gi");function RC(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([],RC(r),RC(n))}function rde(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(iP)||[],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)]},ode=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sE==null,o=Symbol("encodeFragmentIdentifier");function a(E){switch(E.arrayFormat){case"index":return $=>(L,j)=>{const H=L.length;return j===void 0||E.skipNull&&j===null||E.skipEmptyString&&j===""?L:j===null?[...L,[d($,E),"[",H,"]"].join("")]:[...L,[d($,E),"[",d(H,E),"]=",d(j,E)].join("")]};case"bracket":return $=>(L,j)=>j===void 0||E.skipNull&&j===null||E.skipEmptyString&&j===""?L:j===null?[...L,[d($,E),"[]"].join("")]:[...L,[d($,E),"[]=",d(j,E)].join("")];case"colon-list-separator":return $=>(L,j)=>j===void 0||E.skipNull&&j===null||E.skipEmptyString&&j===""?L:j===null?[...L,[d($,E),":list="].join("")]:[...L,[d($,E),":list=",d(j,E)].join("")];case"comma":case"separator":case"bracket-separator":{const $=E.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(j,H)=>H===void 0||E.skipNull&&H===null||E.skipEmptyString&&H===""?j:(H=H===null?"":H,j.length===0?[[d(L,E),$,d(H,E)].join("")]:[[j,d(H,E)].join(E.arrayFormatSeparator)])}default:return $=>(L,j)=>j===void 0||E.skipNull&&j===null||E.skipEmptyString&&j===""?L:j===null?[...L,d($,E)]:[...L,[d($,E),"=",d(j,E)].join("")]}}function c(E){let $;switch(E.arrayFormat){case"index":return(L,j,H)=>{if($=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!$){H[L]=j;return}H[L]===void 0&&(H[L]={}),H[L][$[1]]=j};case"bracket":return(L,j,H)=>{if($=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!$){H[L]=j;return}if(H[L]===void 0){H[L]=[j];return}H[L]=[].concat(H[L],j)};case"colon-list-separator":return(L,j,H)=>{if($=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!$){H[L]=j;return}if(H[L]===void 0){H[L]=[j];return}H[L]=[].concat(H[L],j)};case"comma":case"separator":return(L,j,H)=>{const I=typeof j=="string"&&j.includes(E.arrayFormatSeparator),T=typeof j=="string"&&!I&&f(j,E).includes(E.arrayFormatSeparator);j=T?f(j,E):j;const B=I||T?j.split(E.arrayFormatSeparator).map(K=>f(K,E)):j===null?j:f(j,E);H[L]=B};case"bracket-separator":return(L,j,H)=>{const I=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!I){H[L]=j&&f(j,E);return}const T=j===null?[]:j.split(E.arrayFormatSeparator).map(B=>f(B,E));if(H[L]===void 0){H[L]=T;return}H[L]=[].concat(H[L],T)};default:return(L,j,H)=>{if(H[L]===void 0){H[L]=j;return}H[L]=[].concat(H[L],j)}}}function l(E){if(typeof E!="string"||E.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function d(E,$){return $.encode?$.strict?e(E):encodeURIComponent(E):E}function f(E,$){return $.decode?r(E):E}function g(E){return Array.isArray(E)?E.sort():typeof E=="object"?g(Object.keys(E)).sort(($,L)=>Number($)-Number(L)).map($=>E[$]):E}function v(E){const $=E.indexOf("#");return $!==-1&&(E=E.slice(0,$)),E}function x(E){let $="";const L=E.indexOf("#");return L!==-1&&($=E.slice(L)),$}function P(E){E=v(E);const $=E.indexOf("?");return $===-1?"":E.slice($+1)}function M(E,$){return $.parseNumbers&&!Number.isNaN(Number(E))&&typeof E=="string"&&E.trim()!==""?E=Number(E):$.parseBooleans&&E!==null&&(E.toLowerCase()==="true"||E.toLowerCase()==="false")&&(E=E.toLowerCase()==="true"),E}function N(E,$){$=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},$),l($.arrayFormatSeparator);const L=c($),j=Object.create(null);if(typeof E!="string"||(E=E.trim().replace(/^[?#&]/,""),!E))return j;for(const H of E.split("&")){if(H==="")continue;let[I,T]=n($.decode?H.replace(/\+/g," "):H,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes($.arrayFormat)?T:f(T,$),L(f(I,$),T,j)}for(const H of Object.keys(j)){const I=j[H];if(typeof I=="object"&&I!==null)for(const T of Object.keys(I))I[T]=M(I[T],$);else j[H]=M(I,$)}return $.sort===!1?j:($.sort===!0?Object.keys(j).sort():Object.keys(j).sort($.sort)).reduce((H,I)=>{const T=j[I];return T&&typeof T=="object"&&!Array.isArray(T)?H[I]=g(T):H[I]=T,H},Object.create(null))}t.extract=P,t.parse=N,t.stringify=(E,$)=>{if(!E)return"";$=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},$),l($.arrayFormatSeparator);const L=T=>$.skipNull&&s(E[T])||$.skipEmptyString&&E[T]==="",j=a($),H={};for(const T of Object.keys(E))L(T)||(H[T]=E[T]);const I=Object.keys(H);return $.sort!==!1&&I.sort($.sort),I.map(T=>{const B=E[T];return B===void 0?"":B===null?d(T,$):Array.isArray(B)?B.length===0&&$.arrayFormat==="bracket-separator"?d(T,$)+"[]":B.reduce(j(T),[]).join("&"):d(T,$)+"="+d(B,$)}).filter(T=>T.length>0).join("&")},t.parseUrl=(E,$)=>{$=Object.assign({decode:!0},$);const[L,j]=n(E,"#");return Object.assign({url:L.split("?")[0]||"",query:N(P(E),$)},$&&$.parseFragmentIdentifier&&j?{fragmentIdentifier:f(j,$)}:{})},t.stringifyUrl=(E,$)=>{$=Object.assign({encode:!0,strict:!0,[o]:!0},$);const L=v(E.url).split("?")[0]||"",j=t.extract(E.url),H=t.parse(j,{sort:!1}),I=Object.assign(H,E.query);let T=t.stringify(I,$);T&&(T=`?${T}`);let B=x(E.url);return E.fragmentIdentifier&&(B=`#${$[o]?d(E.fragmentIdentifier,$):E.fragmentIdentifier}`),`${L}${T}${B}`},t.pick=(E,$,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:j,query:H,fragmentIdentifier:I}=t.parseUrl(E,L);return t.stringifyUrl({url:j,query:i(H,$),fragmentIdentifier:I},L)},t.exclude=(E,$,L)=>{const j=Array.isArray($)?H=>!$.includes(H):(H,I)=>!$(H,I);return t.pick(E,j,L)}})(lv);var AE={},o4={};Object.defineProperty(o4,"__esModule",{value:!0});var Vi=dr,PC=Mo,ade=20;function cde(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,o=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],f=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],x=r[31]<<24|r[30]<<16|r[29]<<8|r[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],M=e[7]<<24|e[6]<<16|e[5]<<8|e[4],N=e[11]<<24|e[10]<<16|e[9]<<8|e[8],E=e[15]<<24|e[14]<<16|e[13]<<8|e[12],$=n,L=i,j=s,H=o,I=a,T=c,B=l,K=d,U=f,C=g,p=v,m=x,w=P,_=M,R=N,S=E,k=0;k>>16|w<<16,U=U+w|0,I^=U,I=I>>>20|I<<12,L=L+T|0,_^=L,_=_>>>16|_<<16,C=C+_|0,T^=C,T=T>>>20|T<<12,j=j+B|0,R^=j,R=R>>>16|R<<16,p=p+R|0,B^=p,B=B>>>20|B<<12,H=H+K|0,S^=H,S=S>>>16|S<<16,m=m+S|0,K^=m,K=K>>>20|K<<12,j=j+B|0,R^=j,R=R>>>24|R<<8,p=p+R|0,B^=p,B=B>>>25|B<<7,H=H+K|0,S^=H,S=S>>>24|S<<8,m=m+S|0,K^=m,K=K>>>25|K<<7,L=L+T|0,_^=L,_=_>>>24|_<<8,C=C+_|0,T^=C,T=T>>>25|T<<7,$=$+I|0,w^=$,w=w>>>24|w<<8,U=U+w|0,I^=U,I=I>>>25|I<<7,$=$+T|0,S^=$,S=S>>>16|S<<16,p=p+S|0,T^=p,T=T>>>20|T<<12,L=L+B|0,w^=L,w=w>>>16|w<<16,m=m+w|0,B^=m,B=B>>>20|B<<12,j=j+K|0,_^=j,_=_>>>16|_<<16,U=U+_|0,K^=U,K=K>>>20|K<<12,H=H+I|0,R^=H,R=R>>>16|R<<16,C=C+R|0,I^=C,I=I>>>20|I<<12,j=j+K|0,_^=j,_=_>>>24|_<<8,U=U+_|0,K^=U,K=K>>>25|K<<7,H=H+I|0,R^=H,R=R>>>24|R<<8,C=C+R|0,I^=C,I=I>>>25|I<<7,L=L+B|0,w^=L,w=w>>>24|w<<8,m=m+w|0,B^=m,B=B>>>25|B<<7,$=$+T|0,S^=$,S=S>>>24|S<<8,p=p+S|0,T^=p,T=T>>>25|T<<7;Vi.writeUint32LE($+n|0,t,0),Vi.writeUint32LE(L+i|0,t,4),Vi.writeUint32LE(j+s|0,t,8),Vi.writeUint32LE(H+o|0,t,12),Vi.writeUint32LE(I+a|0,t,16),Vi.writeUint32LE(T+c|0,t,20),Vi.writeUint32LE(B+l|0,t,24),Vi.writeUint32LE(K+d|0,t,28),Vi.writeUint32LE(U+f|0,t,32),Vi.writeUint32LE(C+g|0,t,36),Vi.writeUint32LE(p+v|0,t,40),Vi.writeUint32LE(m+x|0,t,44),Vi.writeUint32LE(w+P|0,t,48),Vi.writeUint32LE(_+M|0,t,52),Vi.writeUint32LE(R+N|0,t,56),Vi.writeUint32LE(S+E|0,t,60)}function KB(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 GB={},Rf={};Object.defineProperty(Rf,"__esModule",{value:!0});function dde(t,e,r){return~(t-1)&e|t-1&r}Rf.select=dde;function fde(t,e){return(t|0)-(e|0)-1>>>31&1}Rf.lessOrEqual=fde;function ZB(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Rf.compare=ZB;function hde(t,e){return t.length===0||e.length===0?!1:ZB(t,e)!==0}Rf.equal=hde;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Rf,r=Mo;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 d=a[4]|a[5]<<8;this._r[2]=(l>>>10|d<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(d>>>7|f<<9)&8191;var g=a[8]|a[9]<<8;this._r[4]=(f>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var v=a[10]|a[11]<<8;this._r[6]=(g>>>14|v<<2)&8191;var x=a[12]|a[13]<<8;this._r[7]=(v>>>11|x<<5)&8065;var P=a[14]|a[15]<<8;this._r[8]=(x>>>8|P<<8)&8191,this._r[9]=P>>>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 d=this._fin?0:2048,f=this._h[0],g=this._h[1],v=this._h[2],x=this._h[3],P=this._h[4],M=this._h[5],N=this._h[6],E=this._h[7],$=this._h[8],L=this._h[9],j=this._r[0],H=this._r[1],I=this._r[2],T=this._r[3],B=this._r[4],K=this._r[5],U=this._r[6],C=this._r[7],p=this._r[8],m=this._r[9];l>=16;){var w=a[c+0]|a[c+1]<<8;f+=w&8191;var _=a[c+2]|a[c+3]<<8;g+=(w>>>13|_<<3)&8191;var R=a[c+4]|a[c+5]<<8;v+=(_>>>10|R<<6)&8191;var S=a[c+6]|a[c+7]<<8;x+=(R>>>7|S<<9)&8191;var k=a[c+8]|a[c+9]<<8;P+=(S>>>4|k<<12)&8191,M+=k>>>1&8191;var y=a[c+10]|a[c+11]<<8;N+=(k>>>14|y<<2)&8191;var b=a[c+12]|a[c+13]<<8;E+=(y>>>11|b<<5)&8191;var V=a[c+14]|a[c+15]<<8;$+=(b>>>8|V<<8)&8191,L+=V>>>5|d;var ce=0,fe=ce;fe+=f*j,fe+=g*(5*m),fe+=v*(5*p),fe+=x*(5*C),fe+=P*(5*U),ce=fe>>>13,fe&=8191,fe+=M*(5*K),fe+=N*(5*B),fe+=E*(5*T),fe+=$*(5*I),fe+=L*(5*H),ce+=fe>>>13,fe&=8191;var W=ce;W+=f*H,W+=g*j,W+=v*(5*m),W+=x*(5*p),W+=P*(5*C),ce=W>>>13,W&=8191,W+=M*(5*U),W+=N*(5*K),W+=E*(5*B),W+=$*(5*T),W+=L*(5*I),ce+=W>>>13,W&=8191;var ue=ce;ue+=f*I,ue+=g*H,ue+=v*j,ue+=x*(5*m),ue+=P*(5*p),ce=ue>>>13,ue&=8191,ue+=M*(5*C),ue+=N*(5*U),ue+=E*(5*K),ue+=$*(5*B),ue+=L*(5*T),ce+=ue>>>13,ue&=8191;var J=ce;J+=f*T,J+=g*I,J+=v*H,J+=x*j,J+=P*(5*m),ce=J>>>13,J&=8191,J+=M*(5*p),J+=N*(5*C),J+=E*(5*U),J+=$*(5*K),J+=L*(5*B),ce+=J>>>13,J&=8191;var ne=ce;ne+=f*B,ne+=g*T,ne+=v*I,ne+=x*H,ne+=P*j,ce=ne>>>13,ne&=8191,ne+=M*(5*m),ne+=N*(5*p),ne+=E*(5*C),ne+=$*(5*U),ne+=L*(5*K),ce+=ne>>>13,ne&=8191;var ie=ce;ie+=f*K,ie+=g*B,ie+=v*T,ie+=x*I,ie+=P*H,ce=ie>>>13,ie&=8191,ie+=M*j,ie+=N*(5*m),ie+=E*(5*p),ie+=$*(5*C),ie+=L*(5*U),ce+=ie>>>13,ie&=8191;var D=ce;D+=f*U,D+=g*K,D+=v*B,D+=x*T,D+=P*I,ce=D>>>13,D&=8191,D+=M*H,D+=N*j,D+=E*(5*m),D+=$*(5*p),D+=L*(5*C),ce+=D>>>13,D&=8191;var te=ce;te+=f*C,te+=g*U,te+=v*K,te+=x*B,te+=P*T,ce=te>>>13,te&=8191,te+=M*I,te+=N*H,te+=E*j,te+=$*(5*m),te+=L*(5*p),ce+=te>>>13,te&=8191;var me=ce;me+=f*p,me+=g*C,me+=v*U,me+=x*K,me+=P*B,ce=me>>>13,me&=8191,me+=M*T,me+=N*I,me+=E*H,me+=$*j,me+=L*(5*m),ce+=me>>>13,me&=8191;var Ce=ce;Ce+=f*m,Ce+=g*p,Ce+=v*C,Ce+=x*U,Ce+=P*K,ce=Ce>>>13,Ce&=8191,Ce+=M*B,Ce+=N*T,Ce+=E*I,Ce+=$*H,Ce+=L*j,ce+=Ce>>>13,Ce&=8191,ce=(ce<<2)+ce|0,ce=ce+fe|0,fe=ce&8191,ce=ce>>>13,W+=ce,f=fe,g=W,v=ue,x=J,P=ne,M=ie,N=D,E=te,$=me,L=Ce,c+=16,l-=16}this._h[0]=f,this._h[1]=g,this._h[2]=v,this._h[3]=x,this._h[4]=P,this._h[5]=M,this._h[6]=N,this._h[7]=E,this._h[8]=$,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),d,f,g,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(d=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=d,d=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=d*5,d=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=d,d=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=d,l[0]=this._h[0]+5,d=l[0]>>>13,l[0]&=8191,v=1;v<10;v++)l[v]=this._h[v]+d,d=l[v]>>>13,l[v]&=8191;for(l[9]-=8192,f=(d^1)-1,v=0;v<10;v++)l[v]&=f;for(f=~f,v=0;v<10;v++)this._h[v]=this._h[v]&f|l[v];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,g=this._h[0]+this._pad[0],this._h[0]=g&65535,v=1;v<8;v++)g=(this._h[v]+this._pad[v]|0)+(g>>>16)|0,this._h[v]=g&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,d;if(this._leftover){d=16-this._leftover,d>l&&(d=l);for(var f=0;f=16&&(d=l-l%16,this._blocks(a,c,d),c+=d,l-=d),l){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(l,v.length-l.length);var x=new Uint8Array(32);e.stream(this._key,v,x,4);var P=d.length+this.tagLength,M;if(g){if(g.length!==P)throw new Error("ChaCha20Poly1305: incorrect destination length");M=g}else M=new Uint8Array(P);return e.streamXOR(this._key,v,d,M,4),this._authenticate(M.subarray(M.length-this.tagLength,M.length),x,M.subarray(0,M.length-this.tagLength),f),n.wipe(v),M},c.prototype.open=function(l,d,f,g){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(d.length0&&v.update(o.subarray(g.length%16))),v.update(f),f.length%16>0&&v.update(o.subarray(f.length%16));var x=new Uint8Array(8);g&&i.writeUint64LE(g.length,x),v.update(x),i.writeUint64LE(f.length,x),v.update(x);for(var P=v.digest(),M=0;Mthis.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;n0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(d=s(this._temp,this._state,c,d,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[d++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,d=this._bufferLength,f=l/536870912|0,g=l<<3,v=l%64<56?64:128;this._buffer[d]=128;for(var x=d+1;x0?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,d,f){for(;f>=64;){for(var g=c[0],v=c[1],x=c[2],P=c[3],M=c[4],N=c[5],E=c[6],$=c[7],L=0;L<16;L++){var j=d+L*4;a[L]=e.readUint32BE(l,j)}for(var L=16;L<64;L++){var H=a[L-2],I=(H>>>17|H<<15)^(H>>>19|H<<13)^H>>>10;H=a[L-15];var T=(H>>>7|H<<25)^(H>>>18|H<<14)^H>>>3;a[L]=(I+a[L-7]|0)+(T+a[L-16]|0)}for(var L=0;L<64;L++){var I=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&N^~M&E)|0)+($+(i[L]+a[L]|0)|0)|0,T=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&x^v&x)|0;$=E,E=N,N=M,M=P+I|0,P=x,x=v,v=g,g=I+T|0}c[0]+=g,c[1]+=v,c[2]+=x,c[3]+=P,c[4]+=M,c[5]+=N,c[6]+=E,c[7]+=$,d+=64,f-=64}return d}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(v2);var SE={};(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=kf,r=Mo;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const j=new Float64Array(16);if(L)for(let H=0;H>16&1),H[K-1]&=65535;H[15]=I[15]-32767-(H[14]>>16&1);const B=H[15]>>16&1;H[14]&=65535,a(I,H,1-B)}for(let T=0;T<16;T++)L[2*T]=I[T]&255,L[2*T+1]=I[T]>>8}function l(L,j){for(let H=0;H<16;H++)L[H]=j[2*H]+(j[2*H+1]<<8);L[15]&=32767}function d(L,j,H){for(let I=0;I<16;I++)L[I]=j[I]+H[I]}function f(L,j,H){for(let I=0;I<16;I++)L[I]=j[I]-H[I]}function g(L,j,H){let I,T,B=0,K=0,U=0,C=0,p=0,m=0,w=0,_=0,R=0,S=0,k=0,y=0,b=0,V=0,ce=0,fe=0,W=0,ue=0,J=0,ne=0,ie=0,D=0,te=0,me=0,Ce=0,Ee=0,Re=0,He=0,Xe=0,kt=0,rt=0,st=H[0],Ze=H[1],Be=H[2],nt=H[3],lt=H[4],je=H[5],at=H[6],G=H[7],O=H[8],z=H[9],X=H[10],ae=H[11],he=H[12],be=H[13],Ne=H[14],Ve=H[15];I=j[0],B+=I*st,K+=I*Ze,U+=I*Be,C+=I*nt,p+=I*lt,m+=I*je,w+=I*at,_+=I*G,R+=I*O,S+=I*z,k+=I*X,y+=I*ae,b+=I*he,V+=I*be,ce+=I*Ne,fe+=I*Ve,I=j[1],K+=I*st,U+=I*Ze,C+=I*Be,p+=I*nt,m+=I*lt,w+=I*je,_+=I*at,R+=I*G,S+=I*O,k+=I*z,y+=I*X,b+=I*ae,V+=I*he,ce+=I*be,fe+=I*Ne,W+=I*Ve,I=j[2],U+=I*st,C+=I*Ze,p+=I*Be,m+=I*nt,w+=I*lt,_+=I*je,R+=I*at,S+=I*G,k+=I*O,y+=I*z,b+=I*X,V+=I*ae,ce+=I*he,fe+=I*be,W+=I*Ne,ue+=I*Ve,I=j[3],C+=I*st,p+=I*Ze,m+=I*Be,w+=I*nt,_+=I*lt,R+=I*je,S+=I*at,k+=I*G,y+=I*O,b+=I*z,V+=I*X,ce+=I*ae,fe+=I*he,W+=I*be,ue+=I*Ne,J+=I*Ve,I=j[4],p+=I*st,m+=I*Ze,w+=I*Be,_+=I*nt,R+=I*lt,S+=I*je,k+=I*at,y+=I*G,b+=I*O,V+=I*z,ce+=I*X,fe+=I*ae,W+=I*he,ue+=I*be,J+=I*Ne,ne+=I*Ve,I=j[5],m+=I*st,w+=I*Ze,_+=I*Be,R+=I*nt,S+=I*lt,k+=I*je,y+=I*at,b+=I*G,V+=I*O,ce+=I*z,fe+=I*X,W+=I*ae,ue+=I*he,J+=I*be,ne+=I*Ne,ie+=I*Ve,I=j[6],w+=I*st,_+=I*Ze,R+=I*Be,S+=I*nt,k+=I*lt,y+=I*je,b+=I*at,V+=I*G,ce+=I*O,fe+=I*z,W+=I*X,ue+=I*ae,J+=I*he,ne+=I*be,ie+=I*Ne,D+=I*Ve,I=j[7],_+=I*st,R+=I*Ze,S+=I*Be,k+=I*nt,y+=I*lt,b+=I*je,V+=I*at,ce+=I*G,fe+=I*O,W+=I*z,ue+=I*X,J+=I*ae,ne+=I*he,ie+=I*be,D+=I*Ne,te+=I*Ve,I=j[8],R+=I*st,S+=I*Ze,k+=I*Be,y+=I*nt,b+=I*lt,V+=I*je,ce+=I*at,fe+=I*G,W+=I*O,ue+=I*z,J+=I*X,ne+=I*ae,ie+=I*he,D+=I*be,te+=I*Ne,me+=I*Ve,I=j[9],S+=I*st,k+=I*Ze,y+=I*Be,b+=I*nt,V+=I*lt,ce+=I*je,fe+=I*at,W+=I*G,ue+=I*O,J+=I*z,ne+=I*X,ie+=I*ae,D+=I*he,te+=I*be,me+=I*Ne,Ce+=I*Ve,I=j[10],k+=I*st,y+=I*Ze,b+=I*Be,V+=I*nt,ce+=I*lt,fe+=I*je,W+=I*at,ue+=I*G,J+=I*O,ne+=I*z,ie+=I*X,D+=I*ae,te+=I*he,me+=I*be,Ce+=I*Ne,Ee+=I*Ve,I=j[11],y+=I*st,b+=I*Ze,V+=I*Be,ce+=I*nt,fe+=I*lt,W+=I*je,ue+=I*at,J+=I*G,ne+=I*O,ie+=I*z,D+=I*X,te+=I*ae,me+=I*he,Ce+=I*be,Ee+=I*Ne,Re+=I*Ve,I=j[12],b+=I*st,V+=I*Ze,ce+=I*Be,fe+=I*nt,W+=I*lt,ue+=I*je,J+=I*at,ne+=I*G,ie+=I*O,D+=I*z,te+=I*X,me+=I*ae,Ce+=I*he,Ee+=I*be,Re+=I*Ne,He+=I*Ve,I=j[13],V+=I*st,ce+=I*Ze,fe+=I*Be,W+=I*nt,ue+=I*lt,J+=I*je,ne+=I*at,ie+=I*G,D+=I*O,te+=I*z,me+=I*X,Ce+=I*ae,Ee+=I*he,Re+=I*be,He+=I*Ne,Xe+=I*Ve,I=j[14],ce+=I*st,fe+=I*Ze,W+=I*Be,ue+=I*nt,J+=I*lt,ne+=I*je,ie+=I*at,D+=I*G,te+=I*O,me+=I*z,Ce+=I*X,Ee+=I*ae,Re+=I*he,He+=I*be,Xe+=I*Ne,kt+=I*Ve,I=j[15],fe+=I*st,W+=I*Ze,ue+=I*Be,J+=I*nt,ne+=I*lt,ie+=I*je,D+=I*at,te+=I*G,me+=I*O,Ce+=I*z,Ee+=I*X,Re+=I*ae,He+=I*he,Xe+=I*be,kt+=I*Ne,rt+=I*Ve,B+=38*W,K+=38*ue,U+=38*J,C+=38*ne,p+=38*ie,m+=38*D,w+=38*te,_+=38*me,R+=38*Ce,S+=38*Ee,k+=38*Re,y+=38*He,b+=38*Xe,V+=38*kt,ce+=38*rt,T=1,I=B+T+65535,T=Math.floor(I/65536),B=I-T*65536,I=K+T+65535,T=Math.floor(I/65536),K=I-T*65536,I=U+T+65535,T=Math.floor(I/65536),U=I-T*65536,I=C+T+65535,T=Math.floor(I/65536),C=I-T*65536,I=p+T+65535,T=Math.floor(I/65536),p=I-T*65536,I=m+T+65535,T=Math.floor(I/65536),m=I-T*65536,I=w+T+65535,T=Math.floor(I/65536),w=I-T*65536,I=_+T+65535,T=Math.floor(I/65536),_=I-T*65536,I=R+T+65535,T=Math.floor(I/65536),R=I-T*65536,I=S+T+65535,T=Math.floor(I/65536),S=I-T*65536,I=k+T+65535,T=Math.floor(I/65536),k=I-T*65536,I=y+T+65535,T=Math.floor(I/65536),y=I-T*65536,I=b+T+65535,T=Math.floor(I/65536),b=I-T*65536,I=V+T+65535,T=Math.floor(I/65536),V=I-T*65536,I=ce+T+65535,T=Math.floor(I/65536),ce=I-T*65536,I=fe+T+65535,T=Math.floor(I/65536),fe=I-T*65536,B+=T-1+37*(T-1),T=1,I=B+T+65535,T=Math.floor(I/65536),B=I-T*65536,I=K+T+65535,T=Math.floor(I/65536),K=I-T*65536,I=U+T+65535,T=Math.floor(I/65536),U=I-T*65536,I=C+T+65535,T=Math.floor(I/65536),C=I-T*65536,I=p+T+65535,T=Math.floor(I/65536),p=I-T*65536,I=m+T+65535,T=Math.floor(I/65536),m=I-T*65536,I=w+T+65535,T=Math.floor(I/65536),w=I-T*65536,I=_+T+65535,T=Math.floor(I/65536),_=I-T*65536,I=R+T+65535,T=Math.floor(I/65536),R=I-T*65536,I=S+T+65535,T=Math.floor(I/65536),S=I-T*65536,I=k+T+65535,T=Math.floor(I/65536),k=I-T*65536,I=y+T+65535,T=Math.floor(I/65536),y=I-T*65536,I=b+T+65535,T=Math.floor(I/65536),b=I-T*65536,I=V+T+65535,T=Math.floor(I/65536),V=I-T*65536,I=ce+T+65535,T=Math.floor(I/65536),ce=I-T*65536,I=fe+T+65535,T=Math.floor(I/65536),fe=I-T*65536,B+=T-1+37*(T-1),L[0]=B,L[1]=K,L[2]=U,L[3]=C,L[4]=p,L[5]=m,L[6]=w,L[7]=_,L[8]=R,L[9]=S,L[10]=k,L[11]=y,L[12]=b,L[13]=V,L[14]=ce,L[15]=fe}function v(L,j){g(L,j,j)}function x(L,j){const H=n();for(let I=0;I<16;I++)H[I]=j[I];for(let I=253;I>=0;I--)v(H,H),I!==2&&I!==4&&g(H,H,j);for(let I=0;I<16;I++)L[I]=H[I]}function P(L,j){const H=new Uint8Array(32),I=new Float64Array(80),T=n(),B=n(),K=n(),U=n(),C=n(),p=n();for(let R=0;R<31;R++)H[R]=L[R];H[31]=L[31]&127|64,H[0]&=248,l(I,j);for(let R=0;R<16;R++)B[R]=I[R];T[0]=U[0]=1;for(let R=254;R>=0;--R){const S=H[R>>>3]>>>(R&7)&1;a(T,B,S),a(K,U,S),d(C,T,K),f(T,T,K),d(K,B,U),f(B,B,U),v(U,C),v(p,T),g(T,K,T),g(K,B,C),d(C,T,K),f(T,T,K),v(B,T),f(K,U,p),g(T,K,s),d(T,T,U),g(K,K,T),g(T,U,p),g(U,B,I),v(B,C),a(T,B,S),a(K,U,S)}for(let R=0;R<16;R++)I[R+16]=T[R],I[R+32]=K[R],I[R+48]=B[R],I[R+64]=U[R];const m=I.subarray(32),w=I.subarray(16);x(m,m),g(w,w,m);const _=new Uint8Array(32);return c(_,w),_}t.scalarMult=P;function M(L){return P(L,i)}t.scalarMultBase=M;function N(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(L);return{publicKey:M(j),secretKey:j}}t.generateKeyPairFromSeed=N;function E(L){const j=(0,e.randomBytes)(32,L),H=N(j);return(0,r.wipe)(j),H}t.generateKeyPair=E;function $(L,j,H=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const I=P(L,j);if(H){let T=0;for(let B=0;B",kde="MIT",Rde={url:"https://github.com/indutny/elliptic/issues"},Pde="https://github.com/indutny/elliptic",Nde={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"},Mde={"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"},$de={name:bde,version:xde,description:Cde,main:_de,files:Ade,scripts:Ede,repository:Sde,keywords:Ide,author:Tde,license:kde,bugs:Rde,homepage:Pde,devDependencies:Nde,dependencies:Mde};var $o={},IE={exports:{}};IE.exports;(function(t){(function(e,r){function n(U,C){if(!U)throw new Error(C||"Assertion failed")}function i(U,C){U.super_=C;var p=function(){};p.prototype=C.prototype,U.prototype=new p,U.prototype.constructor=U}function s(U,C,p){if(s.isBN(U))return U;this.negative=0,this.words=null,this.length=0,this.red=null,U!==null&&((C==="le"||C==="be")&&(p=C,C=10),this._init(U||0,C||10,p||"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=xE.Buffer}catch{}s.isBN=function(C){return C instanceof s?!0:C!==null&&typeof C=="object"&&C.constructor.wordSize===s.wordSize&&Array.isArray(C.words)},s.max=function(C,p){return C.cmp(p)>0?C:p},s.min=function(C,p){return C.cmp(p)<0?C:p},s.prototype._init=function(C,p,m){if(typeof C=="number")return this._initNumber(C,p,m);if(typeof C=="object")return this._initArray(C,p,m);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),C=C.toString().replace(/\s+/g,"");var w=0;C[0]==="-"&&(w++,this.negative=1),w=0;w-=3)R=C[w]|C[w-1]<<8|C[w-2]<<16,this.words[_]|=R<>>26-S&67108863,S+=24,S>=26&&(S-=26,_++);else if(m==="le")for(w=0,_=0;w>>26-S&67108863,S+=24,S>=26&&(S-=26,_++);return this.strip()};function a(U,C){var p=U.charCodeAt(C);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(U,C,p){var m=a(U,p);return p-1>=C&&(m|=a(U,p-1)<<4),m}s.prototype._parseHex=function(C,p,m){this.length=Math.ceil((C.length-p)/6),this.words=new Array(this.length);for(var w=0;w=p;w-=2)S=c(C,p,w)<<_,this.words[R]|=S&67108863,_>=18?(_-=18,R+=1,this.words[R]|=S>>>26):_+=8;else{var k=C.length-p;for(w=k%2===0?p+1:p;w=18?(_-=18,R+=1,this.words[R]|=S>>>26):_+=8}this.strip()};function l(U,C,p,m){for(var w=0,_=Math.min(U.length,p),R=C;R<_;R++){var S=U.charCodeAt(R)-48;w*=m,S>=49?w+=S-49+10:S>=17?w+=S-17+10:w+=S}return w}s.prototype._parseBase=function(C,p,m){this.words=[0],this.length=1;for(var w=0,_=1;_<=67108863;_*=p)w++;w--,_=_/p|0;for(var R=C.length-m,S=R%w,k=Math.min(R,R-S)+m,y=0,b=m;b1&&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 d=["","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"],f=[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],g=[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(C,p){C=C||10,p=p|0||1;var m;if(C===16||C==="hex"){m="";for(var w=0,_=0,R=0;R>>24-w&16777215,_!==0||R!==this.length-1?m=d[6-k.length]+k+m:m=k+m,w+=2,w>=26&&(w-=26,R--)}for(_!==0&&(m=_.toString(16)+m);m.length%p!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(C===(C|0)&&C>=2&&C<=36){var y=f[C],b=g[C];m="";var V=this.clone();for(V.negative=0;!V.isZero();){var ce=V.modn(b).toString(C);V=V.idivn(b),V.isZero()?m=ce+m:m=d[y-ce.length]+ce+m}for(this.isZero()&&(m="0"+m);m.length%p!==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 C=this.words[0];return this.length===2?C+=this.words[1]*67108864:this.length===3&&this.words[2]===1?C+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-C:C},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(C,p){return n(typeof o<"u"),this.toArrayLike(o,C,p)},s.prototype.toArray=function(C,p){return this.toArrayLike(Array,C,p)},s.prototype.toArrayLike=function(C,p,m){var w=this.byteLength(),_=m||Math.max(1,w);n(w<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0"),this.strip();var R=p==="le",S=new C(_),k,y,b=this.clone();if(R){for(y=0;!b.isZero();y++)k=b.andln(255),b.iushrn(8),S[y]=k;for(;y<_;y++)S[y]=0}else{for(y=0;y<_-w;y++)S[y]=0;for(y=0;!b.isZero();y++)k=b.andln(255),b.iushrn(8),S[_-y-1]=k}return S},Math.clz32?s.prototype._countBits=function(C){return 32-Math.clz32(C)}:s.prototype._countBits=function(C){var p=C,m=0;return p>=4096&&(m+=13,p>>>=13),p>=64&&(m+=7,p>>>=7),p>=8&&(m+=4,p>>>=4),p>=2&&(m+=2,p>>>=2),m+p},s.prototype._zeroBits=function(C){if(C===0)return 26;var p=C,m=0;return p&8191||(m+=13,p>>>=13),p&127||(m+=7,p>>>=7),p&15||(m+=4,p>>>=4),p&3||(m+=2,p>>>=2),p&1||m++,m},s.prototype.bitLength=function(){var C=this.words[this.length-1],p=this._countBits(C);return(this.length-1)*26+p};function v(U){for(var C=new Array(U.bitLength()),p=0;p>>w}return C}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var C=0,p=0;pC.length?this.clone().ior(C):C.clone().ior(this)},s.prototype.uor=function(C){return this.length>C.length?this.clone().iuor(C):C.clone().iuor(this)},s.prototype.iuand=function(C){var p;this.length>C.length?p=C:p=this;for(var m=0;mC.length?this.clone().iand(C):C.clone().iand(this)},s.prototype.uand=function(C){return this.length>C.length?this.clone().iuand(C):C.clone().iuand(this)},s.prototype.iuxor=function(C){var p,m;this.length>C.length?(p=this,m=C):(p=C,m=this);for(var w=0;wC.length?this.clone().ixor(C):C.clone().ixor(this)},s.prototype.uxor=function(C){return this.length>C.length?this.clone().iuxor(C):C.clone().iuxor(this)},s.prototype.inotn=function(C){n(typeof C=="number"&&C>=0);var p=Math.ceil(C/26)|0,m=C%26;this._expand(p),m>0&&p--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-m),this.strip()},s.prototype.notn=function(C){return this.clone().inotn(C)},s.prototype.setn=function(C,p){n(typeof C=="number"&&C>=0);var m=C/26|0,w=C%26;return this._expand(m+1),p?this.words[m]=this.words[m]|1<C.length?(m=this,w=C):(m=C,w=this);for(var _=0,R=0;R>>26;for(;_!==0&&R>>26;if(this.length=m.length,_!==0)this.words[this.length]=_,this.length++;else if(m!==this)for(;RC.length?this.clone().iadd(C):C.clone().iadd(this)},s.prototype.isub=function(C){if(C.negative!==0){C.negative=0;var p=this.iadd(C);return C.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(C),this.negative=1,this._normSign();var m=this.cmp(C);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,_;m>0?(w=this,_=C):(w=C,_=this);for(var R=0,S=0;S<_.length;S++)p=(w.words[S]|0)-(_.words[S]|0)+R,R=p>>26,this.words[S]=p&67108863;for(;R!==0&&S>26,this.words[S]=p&67108863;if(R===0&&S>>26,V=k&67108863,ce=Math.min(y,C.length-1),fe=Math.max(0,y-U.length+1);fe<=ce;fe++){var W=y-fe|0;w=U.words[W]|0,_=C.words[fe]|0,R=w*_+V,b+=R/67108864|0,V=R&67108863}p.words[y]=V|0,k=b|0}return k!==0?p.words[y]=k|0:p.length--,p.strip()}var P=function(C,p,m){var w=C.words,_=p.words,R=m.words,S=0,k,y,b,V=w[0]|0,ce=V&8191,fe=V>>>13,W=w[1]|0,ue=W&8191,J=W>>>13,ne=w[2]|0,ie=ne&8191,D=ne>>>13,te=w[3]|0,me=te&8191,Ce=te>>>13,Ee=w[4]|0,Re=Ee&8191,He=Ee>>>13,Xe=w[5]|0,kt=Xe&8191,rt=Xe>>>13,st=w[6]|0,Ze=st&8191,Be=st>>>13,nt=w[7]|0,lt=nt&8191,je=nt>>>13,at=w[8]|0,G=at&8191,O=at>>>13,z=w[9]|0,X=z&8191,ae=z>>>13,he=_[0]|0,be=he&8191,Ne=he>>>13,Ve=_[1]|0,dt=Ve&8191,Ge=Ve>>>13,wt=_[2]|0,er=wt&8191,Pt=wt>>>13,yr=_[3]|0,_r=yr&8191,ft=yr>>>13,$t=_[4]|0,Ft=$t&8191,ht=$t>>>13,Bt=_[5]|0,Ot=Bt&8191,vt=Bt>>>13,Qt=_[6]|0,zt=Qt&8191,yt=Qt>>>13,Wt=_[7]|0,qt=Wt&8191,pt=Wt>>>13,Nt=_[8]|0,Yt=Nt&8191,bt=Nt>>>13,Mr=_[9]|0,$r=Mr&8191,Vt=Mr>>>13;m.negative=C.negative^p.negative,m.length=19,k=Math.imul(ce,be),y=Math.imul(ce,Ne),y=y+Math.imul(fe,be)|0,b=Math.imul(fe,Ne);var ar=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(ar>>>26)|0,ar&=67108863,k=Math.imul(ue,be),y=Math.imul(ue,Ne),y=y+Math.imul(J,be)|0,b=Math.imul(J,Ne),k=k+Math.imul(ce,dt)|0,y=y+Math.imul(ce,Ge)|0,y=y+Math.imul(fe,dt)|0,b=b+Math.imul(fe,Ge)|0;var Oi=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,k=Math.imul(ie,be),y=Math.imul(ie,Ne),y=y+Math.imul(D,be)|0,b=Math.imul(D,Ne),k=k+Math.imul(ue,dt)|0,y=y+Math.imul(ue,Ge)|0,y=y+Math.imul(J,dt)|0,b=b+Math.imul(J,Ge)|0,k=k+Math.imul(ce,er)|0,y=y+Math.imul(ce,Pt)|0,y=y+Math.imul(fe,er)|0,b=b+Math.imul(fe,Pt)|0;var Di=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Di>>>26)|0,Di&=67108863,k=Math.imul(me,be),y=Math.imul(me,Ne),y=y+Math.imul(Ce,be)|0,b=Math.imul(Ce,Ne),k=k+Math.imul(ie,dt)|0,y=y+Math.imul(ie,Ge)|0,y=y+Math.imul(D,dt)|0,b=b+Math.imul(D,Ge)|0,k=k+Math.imul(ue,er)|0,y=y+Math.imul(ue,Pt)|0,y=y+Math.imul(J,er)|0,b=b+Math.imul(J,Pt)|0,k=k+Math.imul(ce,_r)|0,y=y+Math.imul(ce,ft)|0,y=y+Math.imul(fe,_r)|0,b=b+Math.imul(fe,ft)|0;var Li=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Li>>>26)|0,Li&=67108863,k=Math.imul(Re,be),y=Math.imul(Re,Ne),y=y+Math.imul(He,be)|0,b=Math.imul(He,Ne),k=k+Math.imul(me,dt)|0,y=y+Math.imul(me,Ge)|0,y=y+Math.imul(Ce,dt)|0,b=b+Math.imul(Ce,Ge)|0,k=k+Math.imul(ie,er)|0,y=y+Math.imul(ie,Pt)|0,y=y+Math.imul(D,er)|0,b=b+Math.imul(D,Pt)|0,k=k+Math.imul(ue,_r)|0,y=y+Math.imul(ue,ft)|0,y=y+Math.imul(J,_r)|0,b=b+Math.imul(J,ft)|0,k=k+Math.imul(ce,Ft)|0,y=y+Math.imul(ce,ht)|0,y=y+Math.imul(fe,Ft)|0,b=b+Math.imul(fe,ht)|0;var Bi=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Bi>>>26)|0,Bi&=67108863,k=Math.imul(kt,be),y=Math.imul(kt,Ne),y=y+Math.imul(rt,be)|0,b=Math.imul(rt,Ne),k=k+Math.imul(Re,dt)|0,y=y+Math.imul(Re,Ge)|0,y=y+Math.imul(He,dt)|0,b=b+Math.imul(He,Ge)|0,k=k+Math.imul(me,er)|0,y=y+Math.imul(me,Pt)|0,y=y+Math.imul(Ce,er)|0,b=b+Math.imul(Ce,Pt)|0,k=k+Math.imul(ie,_r)|0,y=y+Math.imul(ie,ft)|0,y=y+Math.imul(D,_r)|0,b=b+Math.imul(D,ft)|0,k=k+Math.imul(ue,Ft)|0,y=y+Math.imul(ue,ht)|0,y=y+Math.imul(J,Ft)|0,b=b+Math.imul(J,ht)|0,k=k+Math.imul(ce,Ot)|0,y=y+Math.imul(ce,vt)|0,y=y+Math.imul(fe,Ot)|0,b=b+Math.imul(fe,vt)|0;var Ui=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,k=Math.imul(Ze,be),y=Math.imul(Ze,Ne),y=y+Math.imul(Be,be)|0,b=Math.imul(Be,Ne),k=k+Math.imul(kt,dt)|0,y=y+Math.imul(kt,Ge)|0,y=y+Math.imul(rt,dt)|0,b=b+Math.imul(rt,Ge)|0,k=k+Math.imul(Re,er)|0,y=y+Math.imul(Re,Pt)|0,y=y+Math.imul(He,er)|0,b=b+Math.imul(He,Pt)|0,k=k+Math.imul(me,_r)|0,y=y+Math.imul(me,ft)|0,y=y+Math.imul(Ce,_r)|0,b=b+Math.imul(Ce,ft)|0,k=k+Math.imul(ie,Ft)|0,y=y+Math.imul(ie,ht)|0,y=y+Math.imul(D,Ft)|0,b=b+Math.imul(D,ht)|0,k=k+Math.imul(ue,Ot)|0,y=y+Math.imul(ue,vt)|0,y=y+Math.imul(J,Ot)|0,b=b+Math.imul(J,vt)|0,k=k+Math.imul(ce,zt)|0,y=y+Math.imul(ce,yt)|0,y=y+Math.imul(fe,zt)|0,b=b+Math.imul(fe,yt)|0;var Pn=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,k=Math.imul(lt,be),y=Math.imul(lt,Ne),y=y+Math.imul(je,be)|0,b=Math.imul(je,Ne),k=k+Math.imul(Ze,dt)|0,y=y+Math.imul(Ze,Ge)|0,y=y+Math.imul(Be,dt)|0,b=b+Math.imul(Be,Ge)|0,k=k+Math.imul(kt,er)|0,y=y+Math.imul(kt,Pt)|0,y=y+Math.imul(rt,er)|0,b=b+Math.imul(rt,Pt)|0,k=k+Math.imul(Re,_r)|0,y=y+Math.imul(Re,ft)|0,y=y+Math.imul(He,_r)|0,b=b+Math.imul(He,ft)|0,k=k+Math.imul(me,Ft)|0,y=y+Math.imul(me,ht)|0,y=y+Math.imul(Ce,Ft)|0,b=b+Math.imul(Ce,ht)|0,k=k+Math.imul(ie,Ot)|0,y=y+Math.imul(ie,vt)|0,y=y+Math.imul(D,Ot)|0,b=b+Math.imul(D,vt)|0,k=k+Math.imul(ue,zt)|0,y=y+Math.imul(ue,yt)|0,y=y+Math.imul(J,zt)|0,b=b+Math.imul(J,yt)|0,k=k+Math.imul(ce,qt)|0,y=y+Math.imul(ce,pt)|0,y=y+Math.imul(fe,qt)|0,b=b+Math.imul(fe,pt)|0;var ks=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(ks>>>26)|0,ks&=67108863,k=Math.imul(G,be),y=Math.imul(G,Ne),y=y+Math.imul(O,be)|0,b=Math.imul(O,Ne),k=k+Math.imul(lt,dt)|0,y=y+Math.imul(lt,Ge)|0,y=y+Math.imul(je,dt)|0,b=b+Math.imul(je,Ge)|0,k=k+Math.imul(Ze,er)|0,y=y+Math.imul(Ze,Pt)|0,y=y+Math.imul(Be,er)|0,b=b+Math.imul(Be,Pt)|0,k=k+Math.imul(kt,_r)|0,y=y+Math.imul(kt,ft)|0,y=y+Math.imul(rt,_r)|0,b=b+Math.imul(rt,ft)|0,k=k+Math.imul(Re,Ft)|0,y=y+Math.imul(Re,ht)|0,y=y+Math.imul(He,Ft)|0,b=b+Math.imul(He,ht)|0,k=k+Math.imul(me,Ot)|0,y=y+Math.imul(me,vt)|0,y=y+Math.imul(Ce,Ot)|0,b=b+Math.imul(Ce,vt)|0,k=k+Math.imul(ie,zt)|0,y=y+Math.imul(ie,yt)|0,y=y+Math.imul(D,zt)|0,b=b+Math.imul(D,yt)|0,k=k+Math.imul(ue,qt)|0,y=y+Math.imul(ue,pt)|0,y=y+Math.imul(J,qt)|0,b=b+Math.imul(J,pt)|0,k=k+Math.imul(ce,Yt)|0,y=y+Math.imul(ce,bt)|0,y=y+Math.imul(fe,Yt)|0,b=b+Math.imul(fe,bt)|0;var ka=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(ka>>>26)|0,ka&=67108863,k=Math.imul(X,be),y=Math.imul(X,Ne),y=y+Math.imul(ae,be)|0,b=Math.imul(ae,Ne),k=k+Math.imul(G,dt)|0,y=y+Math.imul(G,Ge)|0,y=y+Math.imul(O,dt)|0,b=b+Math.imul(O,Ge)|0,k=k+Math.imul(lt,er)|0,y=y+Math.imul(lt,Pt)|0,y=y+Math.imul(je,er)|0,b=b+Math.imul(je,Pt)|0,k=k+Math.imul(Ze,_r)|0,y=y+Math.imul(Ze,ft)|0,y=y+Math.imul(Be,_r)|0,b=b+Math.imul(Be,ft)|0,k=k+Math.imul(kt,Ft)|0,y=y+Math.imul(kt,ht)|0,y=y+Math.imul(rt,Ft)|0,b=b+Math.imul(rt,ht)|0,k=k+Math.imul(Re,Ot)|0,y=y+Math.imul(Re,vt)|0,y=y+Math.imul(He,Ot)|0,b=b+Math.imul(He,vt)|0,k=k+Math.imul(me,zt)|0,y=y+Math.imul(me,yt)|0,y=y+Math.imul(Ce,zt)|0,b=b+Math.imul(Ce,yt)|0,k=k+Math.imul(ie,qt)|0,y=y+Math.imul(ie,pt)|0,y=y+Math.imul(D,qt)|0,b=b+Math.imul(D,pt)|0,k=k+Math.imul(ue,Yt)|0,y=y+Math.imul(ue,bt)|0,y=y+Math.imul(J,Yt)|0,b=b+Math.imul(J,bt)|0,k=k+Math.imul(ce,$r)|0,y=y+Math.imul(ce,Vt)|0,y=y+Math.imul(fe,$r)|0,b=b+Math.imul(fe,Vt)|0;var Rs=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,k=Math.imul(X,dt),y=Math.imul(X,Ge),y=y+Math.imul(ae,dt)|0,b=Math.imul(ae,Ge),k=k+Math.imul(G,er)|0,y=y+Math.imul(G,Pt)|0,y=y+Math.imul(O,er)|0,b=b+Math.imul(O,Pt)|0,k=k+Math.imul(lt,_r)|0,y=y+Math.imul(lt,ft)|0,y=y+Math.imul(je,_r)|0,b=b+Math.imul(je,ft)|0,k=k+Math.imul(Ze,Ft)|0,y=y+Math.imul(Ze,ht)|0,y=y+Math.imul(Be,Ft)|0,b=b+Math.imul(Be,ht)|0,k=k+Math.imul(kt,Ot)|0,y=y+Math.imul(kt,vt)|0,y=y+Math.imul(rt,Ot)|0,b=b+Math.imul(rt,vt)|0,k=k+Math.imul(Re,zt)|0,y=y+Math.imul(Re,yt)|0,y=y+Math.imul(He,zt)|0,b=b+Math.imul(He,yt)|0,k=k+Math.imul(me,qt)|0,y=y+Math.imul(me,pt)|0,y=y+Math.imul(Ce,qt)|0,b=b+Math.imul(Ce,pt)|0,k=k+Math.imul(ie,Yt)|0,y=y+Math.imul(ie,bt)|0,y=y+Math.imul(D,Yt)|0,b=b+Math.imul(D,bt)|0,k=k+Math.imul(ue,$r)|0,y=y+Math.imul(ue,Vt)|0,y=y+Math.imul(J,$r)|0,b=b+Math.imul(J,Vt)|0;var Ra=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,k=Math.imul(X,er),y=Math.imul(X,Pt),y=y+Math.imul(ae,er)|0,b=Math.imul(ae,Pt),k=k+Math.imul(G,_r)|0,y=y+Math.imul(G,ft)|0,y=y+Math.imul(O,_r)|0,b=b+Math.imul(O,ft)|0,k=k+Math.imul(lt,Ft)|0,y=y+Math.imul(lt,ht)|0,y=y+Math.imul(je,Ft)|0,b=b+Math.imul(je,ht)|0,k=k+Math.imul(Ze,Ot)|0,y=y+Math.imul(Ze,vt)|0,y=y+Math.imul(Be,Ot)|0,b=b+Math.imul(Be,vt)|0,k=k+Math.imul(kt,zt)|0,y=y+Math.imul(kt,yt)|0,y=y+Math.imul(rt,zt)|0,b=b+Math.imul(rt,yt)|0,k=k+Math.imul(Re,qt)|0,y=y+Math.imul(Re,pt)|0,y=y+Math.imul(He,qt)|0,b=b+Math.imul(He,pt)|0,k=k+Math.imul(me,Yt)|0,y=y+Math.imul(me,bt)|0,y=y+Math.imul(Ce,Yt)|0,b=b+Math.imul(Ce,bt)|0,k=k+Math.imul(ie,$r)|0,y=y+Math.imul(ie,Vt)|0,y=y+Math.imul(D,$r)|0,b=b+Math.imul(D,Vt)|0;var Pa=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,k=Math.imul(X,_r),y=Math.imul(X,ft),y=y+Math.imul(ae,_r)|0,b=Math.imul(ae,ft),k=k+Math.imul(G,Ft)|0,y=y+Math.imul(G,ht)|0,y=y+Math.imul(O,Ft)|0,b=b+Math.imul(O,ht)|0,k=k+Math.imul(lt,Ot)|0,y=y+Math.imul(lt,vt)|0,y=y+Math.imul(je,Ot)|0,b=b+Math.imul(je,vt)|0,k=k+Math.imul(Ze,zt)|0,y=y+Math.imul(Ze,yt)|0,y=y+Math.imul(Be,zt)|0,b=b+Math.imul(Be,yt)|0,k=k+Math.imul(kt,qt)|0,y=y+Math.imul(kt,pt)|0,y=y+Math.imul(rt,qt)|0,b=b+Math.imul(rt,pt)|0,k=k+Math.imul(Re,Yt)|0,y=y+Math.imul(Re,bt)|0,y=y+Math.imul(He,Yt)|0,b=b+Math.imul(He,bt)|0,k=k+Math.imul(me,$r)|0,y=y+Math.imul(me,Vt)|0,y=y+Math.imul(Ce,$r)|0,b=b+Math.imul(Ce,Vt)|0;var Ps=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,k=Math.imul(X,Ft),y=Math.imul(X,ht),y=y+Math.imul(ae,Ft)|0,b=Math.imul(ae,ht),k=k+Math.imul(G,Ot)|0,y=y+Math.imul(G,vt)|0,y=y+Math.imul(O,Ot)|0,b=b+Math.imul(O,vt)|0,k=k+Math.imul(lt,zt)|0,y=y+Math.imul(lt,yt)|0,y=y+Math.imul(je,zt)|0,b=b+Math.imul(je,yt)|0,k=k+Math.imul(Ze,qt)|0,y=y+Math.imul(Ze,pt)|0,y=y+Math.imul(Be,qt)|0,b=b+Math.imul(Be,pt)|0,k=k+Math.imul(kt,Yt)|0,y=y+Math.imul(kt,bt)|0,y=y+Math.imul(rt,Yt)|0,b=b+Math.imul(rt,bt)|0,k=k+Math.imul(Re,$r)|0,y=y+Math.imul(Re,Vt)|0,y=y+Math.imul(He,$r)|0,b=b+Math.imul(He,Vt)|0;var Bo=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,k=Math.imul(X,Ot),y=Math.imul(X,vt),y=y+Math.imul(ae,Ot)|0,b=Math.imul(ae,vt),k=k+Math.imul(G,zt)|0,y=y+Math.imul(G,yt)|0,y=y+Math.imul(O,zt)|0,b=b+Math.imul(O,yt)|0,k=k+Math.imul(lt,qt)|0,y=y+Math.imul(lt,pt)|0,y=y+Math.imul(je,qt)|0,b=b+Math.imul(je,pt)|0,k=k+Math.imul(Ze,Yt)|0,y=y+Math.imul(Ze,bt)|0,y=y+Math.imul(Be,Yt)|0,b=b+Math.imul(Be,bt)|0,k=k+Math.imul(kt,$r)|0,y=y+Math.imul(kt,Vt)|0,y=y+Math.imul(rt,$r)|0,b=b+Math.imul(rt,Vt)|0;var Uo=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,k=Math.imul(X,zt),y=Math.imul(X,yt),y=y+Math.imul(ae,zt)|0,b=Math.imul(ae,yt),k=k+Math.imul(G,qt)|0,y=y+Math.imul(G,pt)|0,y=y+Math.imul(O,qt)|0,b=b+Math.imul(O,pt)|0,k=k+Math.imul(lt,Yt)|0,y=y+Math.imul(lt,bt)|0,y=y+Math.imul(je,Yt)|0,b=b+Math.imul(je,bt)|0,k=k+Math.imul(Ze,$r)|0,y=y+Math.imul(Ze,Vt)|0,y=y+Math.imul(Be,$r)|0,b=b+Math.imul(Be,Vt)|0;var Yn=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,k=Math.imul(X,qt),y=Math.imul(X,pt),y=y+Math.imul(ae,qt)|0,b=Math.imul(ae,pt),k=k+Math.imul(G,Yt)|0,y=y+Math.imul(G,bt)|0,y=y+Math.imul(O,Yt)|0,b=b+Math.imul(O,bt)|0,k=k+Math.imul(lt,$r)|0,y=y+Math.imul(lt,Vt)|0,y=y+Math.imul(je,$r)|0,b=b+Math.imul(je,Vt)|0;var Na=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Na>>>26)|0,Na&=67108863,k=Math.imul(X,Yt),y=Math.imul(X,bt),y=y+Math.imul(ae,Yt)|0,b=Math.imul(ae,bt),k=k+Math.imul(G,$r)|0,y=y+Math.imul(G,Vt)|0,y=y+Math.imul(O,$r)|0,b=b+Math.imul(O,Vt)|0;var Ma=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,k=Math.imul(X,$r),y=Math.imul(X,Vt),y=y+Math.imul(ae,$r)|0,b=Math.imul(ae,Vt);var $a=(S+k|0)+((y&8191)<<13)|0;return S=(b+(y>>>13)|0)+($a>>>26)|0,$a&=67108863,R[0]=ar,R[1]=Oi,R[2]=Di,R[3]=Li,R[4]=Bi,R[5]=Ui,R[6]=Pn,R[7]=ks,R[8]=ka,R[9]=Rs,R[10]=Ra,R[11]=Pa,R[12]=Ps,R[13]=Bo,R[14]=Uo,R[15]=Yn,R[16]=Na,R[17]=Ma,R[18]=$a,S!==0&&(R[19]=S,m.length++),m};Math.imul||(P=x);function M(U,C,p){p.negative=C.negative^U.negative,p.length=U.length+C.length;for(var m=0,w=0,_=0;_>>26)|0,w+=R>>>26,R&=67108863}p.words[_]=S,m=R,R=w}return m!==0?p.words[_]=m:p.length--,p.strip()}function N(U,C,p){var m=new E;return m.mulp(U,C,p)}s.prototype.mulTo=function(C,p){var m,w=this.length+C.length;return this.length===10&&C.length===10?m=P(this,C,p):w<63?m=x(this,C,p):w<1024?m=M(this,C,p):m=N(this,C,p),m};function E(U,C){this.x=U,this.y=C}E.prototype.makeRBT=function(C){for(var p=new Array(C),m=s.prototype._countBits(C)-1,w=0;w>=1;return w},E.prototype.permute=function(C,p,m,w,_,R){for(var S=0;S>>1)_++;return 1<<_+1+w},E.prototype.conjugate=function(C,p,m){if(!(m<=1))for(var w=0;w>>13,m[2*R+1]=_&8191,_=_>>>13;for(R=2*p;R>=26,p+=w/67108864|0,p+=_>>>26,this.words[m]=_&67108863}return p!==0&&(this.words[m]=p,this.length++),this},s.prototype.muln=function(C){return this.clone().imuln(C)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(C){var p=v(C);if(p.length===0)return new s(1);for(var m=this,w=0;w=0);var p=C%26,m=(C-p)/26,w=67108863>>>26-p<<26-p,_;if(p!==0){var R=0;for(_=0;_>>26-p}R&&(this.words[_]=R,this.length++)}if(m!==0){for(_=this.length-1;_>=0;_--)this.words[_+m]=this.words[_];for(_=0;_=0);var w;p?w=(p-p%26)/26:w=0;var _=C%26,R=Math.min((C-_)/26,this.length),S=67108863^67108863>>>_<<_,k=m;if(w-=R,w=Math.max(0,w),k){for(var y=0;yR)for(this.length-=R,y=0;y=0&&(b!==0||y>=w);y--){var V=this.words[y]|0;this.words[y]=b<<26-_|V>>>_,b=V&S}return k&&b!==0&&(k.words[k.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(C,p,m){return n(this.negative===0),this.iushrn(C,p,m)},s.prototype.shln=function(C){return this.clone().ishln(C)},s.prototype.ushln=function(C){return this.clone().iushln(C)},s.prototype.shrn=function(C){return this.clone().ishrn(C)},s.prototype.ushrn=function(C){return this.clone().iushrn(C)},s.prototype.testn=function(C){n(typeof C=="number"&&C>=0);var p=C%26,m=(C-p)/26,w=1<=0);var p=C%26,m=(C-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(p!==0&&m++,this.length=Math.min(m,this.length),p!==0){var w=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(C){if(n(typeof C=="number"),n(C<67108864),C<0)return this.iaddn(-C);if(this.negative!==0)return this.negative=0,this.iaddn(C),this.negative=1,this;if(this.words[0]-=C,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(k/67108864|0),this.words[_+m]=R&67108863}for(;_>26,this.words[_+m]=R&67108863;if(S===0)return this.strip();for(n(S===-1),S=0,_=0;_>26,this.words[_]=R&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(C,p){var m=this.length-C.length,w=this.clone(),_=C,R=_.words[_.length-1]|0,S=this._countBits(R);m=26-S,m!==0&&(_=_.ushln(m),w.iushln(m),R=_.words[_.length-1]|0);var k=w.length-_.length,y;if(p!=="mod"){y=new s(null),y.length=k+1,y.words=new Array(y.length);for(var b=0;b=0;ce--){var fe=(w.words[_.length+ce]|0)*67108864+(w.words[_.length+ce-1]|0);for(fe=Math.min(fe/R|0,67108863),w._ishlnsubmul(_,fe,ce);w.negative!==0;)fe--,w.negative=0,w._ishlnsubmul(_,1,ce),w.isZero()||(w.negative^=1);y&&(y.words[ce]=fe)}return y&&y.strip(),w.strip(),p!=="div"&&m!==0&&w.iushrn(m),{div:y||null,mod:w}},s.prototype.divmod=function(C,p,m){if(n(!C.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,_,R;return this.negative!==0&&C.negative===0?(R=this.neg().divmod(C,p),p!=="mod"&&(w=R.div.neg()),p!=="div"&&(_=R.mod.neg(),m&&_.negative!==0&&_.iadd(C)),{div:w,mod:_}):this.negative===0&&C.negative!==0?(R=this.divmod(C.neg(),p),p!=="mod"&&(w=R.div.neg()),{div:w,mod:R.mod}):this.negative&C.negative?(R=this.neg().divmod(C.neg(),p),p!=="div"&&(_=R.mod.neg(),m&&_.negative!==0&&_.isub(C)),{div:R.div,mod:_}):C.length>this.length||this.cmp(C)<0?{div:new s(0),mod:this}:C.length===1?p==="div"?{div:this.divn(C.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modn(C.words[0]))}:{div:this.divn(C.words[0]),mod:new s(this.modn(C.words[0]))}:this._wordDiv(C,p)},s.prototype.div=function(C){return this.divmod(C,"div",!1).div},s.prototype.mod=function(C){return this.divmod(C,"mod",!1).mod},s.prototype.umod=function(C){return this.divmod(C,"mod",!0).mod},s.prototype.divRound=function(C){var p=this.divmod(C);if(p.mod.isZero())return p.div;var m=p.div.negative!==0?p.mod.isub(C):p.mod,w=C.ushrn(1),_=C.andln(1),R=m.cmp(w);return R<0||_===1&&R===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modn=function(C){n(C<=67108863);for(var p=(1<<26)%C,m=0,w=this.length-1;w>=0;w--)m=(p*m+(this.words[w]|0))%C;return m},s.prototype.idivn=function(C){n(C<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var w=(this.words[m]|0)+p*67108864;this.words[m]=w/C|0,p=w%C}return this.strip()},s.prototype.divn=function(C){return this.clone().idivn(C)},s.prototype.egcd=function(C){n(C.negative===0),n(!C.isZero());var p=this,m=C.clone();p.negative!==0?p=p.umod(C):p=p.clone();for(var w=new s(1),_=new s(0),R=new s(0),S=new s(1),k=0;p.isEven()&&m.isEven();)p.iushrn(1),m.iushrn(1),++k;for(var y=m.clone(),b=p.clone();!p.isZero();){for(var V=0,ce=1;!(p.words[0]&ce)&&V<26;++V,ce<<=1);if(V>0)for(p.iushrn(V);V-- >0;)(w.isOdd()||_.isOdd())&&(w.iadd(y),_.isub(b)),w.iushrn(1),_.iushrn(1);for(var fe=0,W=1;!(m.words[0]&W)&&fe<26;++fe,W<<=1);if(fe>0)for(m.iushrn(fe);fe-- >0;)(R.isOdd()||S.isOdd())&&(R.iadd(y),S.isub(b)),R.iushrn(1),S.iushrn(1);p.cmp(m)>=0?(p.isub(m),w.isub(R),_.isub(S)):(m.isub(p),R.isub(w),S.isub(_))}return{a:R,b:S,gcd:m.iushln(k)}},s.prototype._invmp=function(C){n(C.negative===0),n(!C.isZero());var p=this,m=C.clone();p.negative!==0?p=p.umod(C):p=p.clone();for(var w=new s(1),_=new s(0),R=m.clone();p.cmpn(1)>0&&m.cmpn(1)>0;){for(var S=0,k=1;!(p.words[0]&k)&&S<26;++S,k<<=1);if(S>0)for(p.iushrn(S);S-- >0;)w.isOdd()&&w.iadd(R),w.iushrn(1);for(var y=0,b=1;!(m.words[0]&b)&&y<26;++y,b<<=1);if(y>0)for(m.iushrn(y);y-- >0;)_.isOdd()&&_.iadd(R),_.iushrn(1);p.cmp(m)>=0?(p.isub(m),w.isub(_)):(m.isub(p),_.isub(w))}var V;return p.cmpn(1)===0?V=w:V=_,V.cmpn(0)<0&&V.iadd(C),V},s.prototype.gcd=function(C){if(this.isZero())return C.abs();if(C.isZero())return this.abs();var p=this.clone(),m=C.clone();p.negative=0,m.negative=0;for(var w=0;p.isEven()&&m.isEven();w++)p.iushrn(1),m.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;m.isEven();)m.iushrn(1);var _=p.cmp(m);if(_<0){var R=p;p=m,m=R}else if(_===0||m.cmpn(1)===0)break;p.isub(m)}while(!0);return m.iushln(w)},s.prototype.invm=function(C){return this.egcd(C).a.umod(C)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(C){return this.words[0]&C},s.prototype.bincn=function(C){n(typeof C=="number");var p=C%26,m=(C-p)/26,w=1<>>26,S&=67108863,this.words[R]=S}return _!==0&&(this.words[R]=_,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(C){var p=C<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var m;if(this.length>1)m=1;else{p&&(C=-C),n(C<=67108863,"Number is too big");var w=this.words[0]|0;m=w===C?0:wC.length)return 1;if(this.length=0;m--){var w=this.words[m]|0,_=C.words[m]|0;if(w!==_){w<_?p=-1:w>_&&(p=1);break}}return p},s.prototype.gtn=function(C){return this.cmpn(C)===1},s.prototype.gt=function(C){return this.cmp(C)===1},s.prototype.gten=function(C){return this.cmpn(C)>=0},s.prototype.gte=function(C){return this.cmp(C)>=0},s.prototype.ltn=function(C){return this.cmpn(C)===-1},s.prototype.lt=function(C){return this.cmp(C)===-1},s.prototype.lten=function(C){return this.cmpn(C)<=0},s.prototype.lte=function(C){return this.cmp(C)<=0},s.prototype.eqn=function(C){return this.cmpn(C)===0},s.prototype.eq=function(C){return this.cmp(C)===0},s.red=function(C){return new B(C)},s.prototype.toRed=function(C){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),C.convertTo(this)._forceRed(C)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(C){return this.red=C,this},s.prototype.forceRed=function(C){return n(!this.red,"Already a number in reduction context"),this._forceRed(C)},s.prototype.redAdd=function(C){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,C)},s.prototype.redIAdd=function(C){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,C)},s.prototype.redSub=function(C){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,C)},s.prototype.redISub=function(C){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,C)},s.prototype.redShl=function(C){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,C)},s.prototype.redMul=function(C){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,C),this.red.mul(this,C)},s.prototype.redIMul=function(C){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,C),this.red.imul(this,C)},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(C){return n(this.red&&!C.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,C)};var $={k256:null,p224:null,p192:null,p25519:null};function L(U,C){this.name=U,this.p=new s(C,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 C=new s(null);return C.words=new Array(Math.ceil(this.n/13)),C},L.prototype.ireduce=function(C){var p=C,m;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),m=p.bitLength();while(m>this.n);var w=m0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},L.prototype.split=function(C,p){C.iushrn(this.n,0,p)},L.prototype.imulK=function(C){return C.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(C,p){for(var m=4194303,w=Math.min(C.length,9),_=0;_>>22,R=S}R>>>=22,C.words[_-10]=R,R===0&&C.length>10?C.length-=10:C.length-=9},j.prototype.imulK=function(C){C.words[C.length]=0,C.words[C.length+1]=0,C.length+=2;for(var p=0,m=0;m>>=26,C.words[m]=_,p=w}return p!==0&&(C.words[C.length++]=p),C},s._prime=function(C){if($[C])return $[C];var p;if(C==="k256")p=new j;else if(C==="p224")p=new H;else if(C==="p192")p=new I;else if(C==="p25519")p=new T;else throw new Error("Unknown prime "+C);return $[C]=p,p};function B(U){if(typeof U=="string"){var C=s._prime(U);this.m=C.p,this.prime=C}else n(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}B.prototype._verify1=function(C){n(C.negative===0,"red works only with positives"),n(C.red,"red works only with red numbers")},B.prototype._verify2=function(C,p){n((C.negative|p.negative)===0,"red works only with positives"),n(C.red&&C.red===p.red,"red works only with red numbers")},B.prototype.imod=function(C){return this.prime?this.prime.ireduce(C)._forceRed(this):C.umod(this.m)._forceRed(this)},B.prototype.neg=function(C){return C.isZero()?C.clone():this.m.sub(C)._forceRed(this)},B.prototype.add=function(C,p){this._verify2(C,p);var m=C.add(p);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},B.prototype.iadd=function(C,p){this._verify2(C,p);var m=C.iadd(p);return m.cmp(this.m)>=0&&m.isub(this.m),m},B.prototype.sub=function(C,p){this._verify2(C,p);var m=C.sub(p);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},B.prototype.isub=function(C,p){this._verify2(C,p);var m=C.isub(p);return m.cmpn(0)<0&&m.iadd(this.m),m},B.prototype.shl=function(C,p){return this._verify1(C),this.imod(C.ushln(p))},B.prototype.imul=function(C,p){return this._verify2(C,p),this.imod(C.imul(p))},B.prototype.mul=function(C,p){return this._verify2(C,p),this.imod(C.mul(p))},B.prototype.isqr=function(C){return this.imul(C,C.clone())},B.prototype.sqr=function(C){return this.mul(C,C)},B.prototype.sqrt=function(C){if(C.isZero())return C.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(C,m)}for(var w=this.m.subn(1),_=0;!w.isZero()&&w.andln(1)===0;)_++,w.iushrn(1);n(!w.isZero());var R=new s(1).toRed(this),S=R.redNeg(),k=this.m.subn(1).iushrn(1),y=this.m.bitLength();for(y=new s(2*y*y).toRed(this);this.pow(y,k).cmp(S)!==0;)y.redIAdd(S);for(var b=this.pow(y,w),V=this.pow(C,w.addn(1).iushrn(1)),ce=this.pow(C,w),fe=_;ce.cmp(R)!==0;){for(var W=ce,ue=0;W.cmp(R)!==0;ue++)W=W.redSqr();n(ue=0;_--){for(var b=p.words[_],V=y-1;V>=0;V--){var ce=b>>V&1;if(R!==w[0]&&(R=this.sqr(R)),ce===0&&S===0){k=0;continue}S<<=1,S|=ce,k++,!(k!==m&&(_!==0||V!==0))&&(R=this.mul(R,w[S]),k=0,S=0)}y=26}return R},B.prototype.convertTo=function(C){var p=C.umod(this.m);return p===C?p.clone():p},B.prototype.convertFrom=function(C){var p=C.clone();return p.red=null,p},s.mont=function(C){return new K(C)};function K(U){B.call(this,U),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,B),K.prototype.convertTo=function(C){return this.imod(C.ushln(this.shift))},K.prototype.convertFrom=function(C){var p=this.imod(C.mul(this.rinv));return p.red=null,p},K.prototype.imul=function(C,p){if(C.isZero()||p.isZero())return C.words[0]=0,C.length=1,C;var m=C.imul(p),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=m.isub(w).iushrn(this.shift),R=_;return _.cmp(this.m)>=0?R=_.isub(this.m):_.cmpn(0)<0&&(R=_.iadd(this.m)),R._forceRed(this)},K.prototype.mul=function(C,p){if(C.isZero()||p.isZero())return new s(0)._forceRed(this);var m=C.mul(p),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=m.isub(w).iushrn(this.shift),R=_;return _.cmp(this.m)>=0?R=_.isub(this.m):_.cmpn(0)<0&&(R=_.iadd(this.m)),R._forceRed(this)},K.prototype.invm=function(C){var p=this.imod(C._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,Yi)})(IE);var Zu=IE.exports,N0=XB;function XB(t,e){if(!t)throw new Error(e||"Assertion failed")}XB.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var TE={};(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,f=l&255;d?a.push(d,f):a.push(f)}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(P>>1)-1?N=(P>>1)-E:N=E,M.isubn(N)):N=0,v[x]=N,M.iushrn(1)}return v}e.getNAF=s;function o(d,f){var g=[[],[]];d=d.clone(),f=f.clone();for(var v=0,x=0,P;d.cmpn(-v)>0||f.cmpn(-x)>0;){var M=d.andln(3)+v&3,N=f.andln(3)+x&3;M===3&&(M=-1),N===3&&(N=-1);var E;M&1?(P=d.andln(7)+v&7,(P===3||P===5)&&N===2?E=-M:E=M):E=0,g[0].push(E);var $;N&1?(P=f.andln(7)+x&7,(P===3||P===5)&&M===2?$=-N:$=N):$=0,g[1].push($),2*v===E+1&&(v=1-v),2*x===$+1&&(x=1-x),d.iushrn(1),f.iushrn(1)}return g}e.getJSF=o;function a(d,f,g){var v="_"+f;d.prototype[f]=function(){return this[v]!==void 0?this[v]:this[v]=g.call(this)}}e.cachedProperty=a;function c(d){return typeof d=="string"?e.toArray(d,"hex"):d}e.parseBytes=c;function l(d){return new r(d,"hex","le")}e.intFromLE=l})($o);var kE={exports:{}},c9;kE.exports=function(e){return c9||(c9=new Ud(null)),c9.generate(e)};function Ud(t){this.rand=t}kE.exports.Rand=Ud;Ud.prototype.generate=function(e){return this._rand(e)};Ud.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 a4=Pf;Pf.prototype.point=function(){throw new Error("Not implemented")};Pf.prototype.validate=function(){throw new Error("Not implemented")};Pf.prototype._fixedNafMul=function(e,r){S5(e.precomputed);var n=e._getDoubles(),i=E5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),g=s;g>0;g--){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 d=o[c];S5(d!==0),e.type==="affine"?d>0?a=a.mixedAdd(s[d-1>>1]):a=a.mixedAdd(s[-d-1>>1].neg()):d>0?a=a.add(s[d-1>>1]):a=a.add(s[-d-1>>1].neg())}return e.type==="affine"?a.toP():a};Pf.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,d,f,g;for(d=0;d=1;d-=2){var x=d-1,P=d;if(o[x]!==1||o[P]!==1){c[x]=E5(n[x],o[x],this._bitLength),c[P]=E5(n[P],o[P],this._bitLength),l=Math.max(c[x].length,l),l=Math.max(c[P].length,l);continue}var M=[r[x],null,null,r[P]];r[x].y.cmp(r[P].y)===0?(M[1]=r[x].add(r[P]),M[2]=r[x].toJ().mixedAdd(r[P].neg())):r[x].y.cmp(r[P].y.redNeg())===0?(M[1]=r[x].toJ().mixedAdd(r[P]),M[2]=r[x].add(r[P].neg())):(M[1]=r[x].toJ().mixedAdd(r[P]),M[2]=r[x].toJ().mixedAdd(r[P].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],E=Ode(n[x],n[P]);for(l=Math.max(E[0].length,l),c[x]=new Array(l),c[P]=new Array(l),f=0;f=0;d--){for(var I=0;d>=0;){var T=!0;for(f=0;f=0&&I++,j=j.dblp(I),d<0)break;for(f=0;f0?g=a[f][B-1>>1]:B<0&&(g=a[f][-B-1>>1].neg()),g.type==="affine"?j=j.mixedAdd(g):j=j.add(g))}}for(d=0;d=Math.ceil((e.bitLength()+1)/r.step):!1};Sa.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&&(v=l,x=d),f.negative&&(f=f.neg(),g=g.neg()),v.negative&&(v=v.neg(),x=x.neg()),[{a:f,b:g},{a:v,b:x}]};Ia.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),d=o.mul(i.b),f=e.sub(a).sub(c),g=l.add(d).neg();return{k1:f,k2:g}};Ia.prototype.pointFromX=function(e,r){e=new Ln(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)};Ia.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};Ia.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};xi.prototype.isInfinity=function(){return this.inf};xi.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)};xi.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)};xi.prototype.getX=function(){return this.x.fromRed()};xi.prototype.getY=function(){return this.y.fromRed()};xi.prototype.mul=function(e){return e=new Ln(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)};xi.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)};xi.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)};xi.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)};xi.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};xi.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 Ni(t,e,r,n){hg.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ln(0)):(this.x=new Ln(e,16),this.y=new Ln(r,16),this.z=new Ln(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}PE(Ni,hg.BasePoint);Ia.prototype.jpoint=function(e,r,n){return new Ni(this,e,r,n)};Ni.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)};Ni.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Ni.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 d=c.redSqr(),f=d.redMul(c),g=i.redMul(d),v=l.redSqr().redIAdd(f).redISub(g).redISub(g),x=l.redMul(g.redISub(v)).redISub(o.redMul(f)),P=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(v,x,P)};Ni.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(),d=l.redMul(a),f=n.redMul(l),g=c.redSqr().redIAdd(d).redISub(f).redISub(f),v=c.redMul(f.redISub(g)).redISub(s.redMul(d)),x=this.z.redMul(a);return this.curve.jpoint(g,v,x)};Ni.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}};Ni.prototype.inspect=function(){return this.isInfinity()?"":""};Ni.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Mp=Zu,tU=c4,l4=a4,Ude=$o;function pg(t){l4.call(this,"mont",t),this.a=new Mp(t.a,16).toRed(this.red),this.b=new Mp(t.b,16).toRed(this.red),this.i4=new Mp(4).toRed(this.red).redInvm(),this.two=new Mp(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}tU(pg,l4);var jde=pg;pg.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 bi(t,e,r){l4.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Mp(e,16),this.z=new Mp(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}tU(bi,l4.BasePoint);pg.prototype.decodePoint=function(e,r){return this.point(Ude.toArray(e,r),1)};pg.prototype.point=function(e,r){return new bi(this,e,r)};pg.prototype.pointFromJSON=function(e){return bi.fromJSON(this,e)};bi.prototype.precompute=function(){};bi.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};bi.fromJSON=function(e,r){return new bi(e,r[0],r[1]||e.one)};bi.prototype.inspect=function(){return this.isInfinity()?"":""};bi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};bi.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)};bi.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};bi.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()),d=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,d)};bi.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};bi.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};bi.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};bi.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};bi.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};bi.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Fde=$o,yu=Zu,rU=c4,u4=a4,zde=Fde.assert;function Ol(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,u4.call(this,"edwards",t),this.a=new yu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new yu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new yu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),zde(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}rU(Ol,u4);var Wde=Ol;Ol.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Ol.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Ol.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Ol.prototype.pointFromX=function(e,r){e=new yu(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)};Ol.prototype.pointFromY=function(e,r){e=new yu(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)};Ol.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 cn(t,e,r,n,i){u4.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 yu(e,16),this.y=new yu(r,16),this.z=n?new yu(n,16):this.curve.one,this.t=i&&new yu(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()))))}rU(cn,u4.BasePoint);Ol.prototype.pointFromJSON=function(e){return cn.fromJSON(this,e)};Ol.prototype.point=function(e,r,n,i){return new cn(this,e,r,n,i)};cn.fromJSON=function(e,r){return new cn(e,r[0],r[1],r[2])};cn.prototype.inspect=function(){return this.isInfinity()?"":""};cn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};cn.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),d=o.redMul(c),f=s.redMul(c),g=a.redMul(o);return this.curve.point(l,d,g,f)};cn.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 d=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(d.redSub(this.curve.two)),s=d.redMul(a.redSub(n)),o=d.redSqr().redSub(d).redSub(d)):(c=this.z.redSqr(),l=d.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=d.redMul(a.redSub(n)),o=d.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)};cn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};cn.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),d=o.redMul(a),f=c.redMul(l),g=o.redMul(l),v=a.redMul(c);return this.curve.point(d,f,v,g)};cn.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),d=r.redMul(a).redMul(l),f,g;return this.curve.twisted?(f=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),g=a.redMul(c)):(f=r.redMul(c).redMul(s.redSub(i)),g=this.curve._mulC(a).redMul(c)),this.curve.point(d,f,g)};cn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};cn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};cn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};cn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};cn.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};cn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};cn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};cn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};cn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};cn.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}};cn.prototype.toP=cn.prototype.normalize;cn.prototype.mixedAdd=cn.prototype.add;(function(t){var e=t;e.base=a4,e.short=Bde,e.mont=jde,e.edwards=Wde})(RE);var d4={},f4={},Ir={},Hde=N0,qde=c4;Ir.inherits=qde;function Vde(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Kde(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):Vde(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}Ir.htonl=nU;function Zde(t,e){for(var r="",n=0;n>>0}return s}Ir.join32=Qde;function Yde(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}Ir.split32=Yde;function Jde(t,e){return t>>>e|t<<32-e}Ir.rotr32=Jde;function Xde(t,e){return t<>>32-e}Ir.rotl32=Xde;function efe(t,e){return t+e>>>0}Ir.sum32=efe;function tfe(t,e,r){return t+e+r>>>0}Ir.sum32_3=tfe;function rfe(t,e,r,n){return t+e+r+n>>>0}Ir.sum32_4=rfe;function nfe(t,e,r,n,i){return t+e+r+n+i>>>0}Ir.sum32_5=nfe;function ife(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Ir.sum64=ife;function sfe(t,e,r,n){var i=e+n>>>0,s=(i>>0}Ir.sum64_hi=sfe;function ofe(t,e,r,n){var i=e+n;return i>>>0}Ir.sum64_lo=ofe;function afe(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}Ir.sum64_4_hi=afe;function cfe(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Ir.sum64_4_lo=cfe;function lfe(t,e,r,n,i,s,o,a,c,l){var d=0,f=e;f=f+n>>>0,d+=f>>0,d+=f>>0,d+=f>>0,d+=f>>0}Ir.sum64_5_hi=lfe;function ufe(t,e,r,n,i,s,o,a,c,l){var d=e+n+s+a+l;return d>>>0}Ir.sum64_5_lo=ufe;function dfe(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ir.rotr64_hi=dfe;function ffe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ir.rotr64_lo=ffe;function hfe(t,e,r){return t>>>r}Ir.shr64_hi=hfe;function pfe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ir.shr64_lo=pfe;var gg={},lP=Ir,gfe=N0;function h4(){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}gg.BlockHash=h4;h4.prototype.update=function(e,r){if(e=lP.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=lP.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}Dl.g0_256=bfe;function xfe(t){return cl(t,17)^cl(t,19)^t>>>10}Dl.g1_256=xfe;var D1=Ir,Cfe=gg,_fe=Dl,l9=D1.rotl32,hm=D1.sum32,Afe=D1.sum32_5,Efe=_fe.ft_1,lU=Cfe.BlockHash,Sfe=[1518500249,1859775393,2400959708,3395469782];function xl(){if(!(this instanceof xl))return new xl;lU.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}D1.inherits(xl,lU);var Ife=xl;xl.blockSize=512;xl.outSize=160;xl.hmacStrength=80;xl.padLength=64;xl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),phe(e.length<=this.blockSize);for(var r=e.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var vhe=hf;hf.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};hf.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=Th.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var I5=Zu,NE=$o,Che=NE.assert;function p4(t,e){if(t instanceof p4)return t;this._importDER(t,e)||(Che(t.r&&t.s,"Signature without r or s"),this.r=new I5(t.r,16),this.s=new I5(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var _he=p4;function Ahe(){this.place=0}function h9(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function pP(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)}p4.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=pP(r),n=pP(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];p9(i,r.length),i=i.concat(r),i.push(2),p9(i,n.length);var s=i.concat(n),o=[48];return p9(o,s.length),o=o.concat(s),NE.encode(o,e)};var kh=Zu,xU=vhe,Ehe=$o,g9=d4,She=eU,CU=Ehe.assert,ME=xhe,g4=_he;function xa(t){if(!(this instanceof xa))return new xa(t);typeof t=="string"&&(CU(Object.prototype.hasOwnProperty.call(g9,t),"Unknown curve "+t),t=g9[t]),t instanceof g9.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 Ihe=xa;xa.prototype.keyPair=function(e){return new ME(this,e)};xa.prototype.keyFromPrivate=function(e,r){return ME.fromPrivate(this,e,r)};xa.prototype.keyFromPublic=function(e,r){return ME.fromPublic(this,e,r)};xa.prototype.genKeyPair=function(e){e||(e={});for(var r=new xU({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||She(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new kh(2));;){var s=new kh(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};xa.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};xa.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 kh(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new xU({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new kh(1)),d=0;;d++){var f=i.k?i.k(d):new kh(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var g=this.g.mul(f);if(!g.isInfinity()){var v=g.getX(),x=v.umod(this.n);if(x.cmpn(0)!==0){var P=f.invm(this.n).mul(x.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var M=(g.getY().isOdd()?1:0)|(v.cmp(x)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),M^=1),new g4({r:x,s:P,recoveryParam:M})}}}}}};xa.prototype.verify=function(e,r,n,i){e=this._truncateToN(new kh(e,16)),n=this.keyFromPublic(n,i),r=new g4(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),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(c,n.getPublic(),l),d.isInfinity()?!1:d.eqXToP(s)):(d=this.g.mulAdd(c,n.getPublic(),l),d.isInfinity()?!1:d.getX().umod(this.n).cmp(s)===0)};xa.prototype.recoverPubKey=function(t,e,r,n){CU((3&r)===r,"The recovery param is more than two bits"),e=new g4(e,n);var i=this.n,s=new kh(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 d=e.r.invm(i),f=i.sub(s).mul(d).umod(i),g=a.mul(d).umod(i);return this.g.mulAdd(f,o,g)};xa.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new g4(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 b2=$o,_U=b2.assert,gP=b2.parseBytes,vg=b2.cachedProperty;function yi(t,e){this.eddsa=t,this._secret=gP(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=gP(e.pub)}yi.fromPublic=function(e,r){return r instanceof yi?r:new yi(e,{pub:r})};yi.fromSecret=function(e,r){return r instanceof yi?r:new yi(e,{secret:r})};yi.prototype.secret=function(){return this._secret};vg(yi,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});vg(yi,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});vg(yi,"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});vg(yi,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});vg(yi,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});vg(yi,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});yi.prototype.sign=function(e){return _U(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};yi.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};yi.prototype.getSecret=function(e){return _U(this._secret,"KeyPair is public only"),b2.encode(this.secret(),e)};yi.prototype.getPublic=function(e){return b2.encode(this.pubBytes(),e)};var The=yi,khe=Zu,m4=$o,mP=m4.assert,w4=m4.cachedProperty,Rhe=m4.parseBytes;function M0(t,e){this.eddsa=t,typeof e!="object"&&(e=Rhe(e)),Array.isArray(e)&&(mP(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),mP(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof khe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}w4(M0,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});w4(M0,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});w4(M0,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});w4(M0,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});M0.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};M0.prototype.toHex=function(){return m4.encode(this.toBytes(),"hex").toUpperCase()};var Phe=M0,Nhe=f4,Mhe=d4,U1=$o,$he=U1.assert,AU=U1.parseBytes,EU=The,wP=Phe;function eo(t){if($he(t==="ed25519","only tested with ed25519 so far"),!(this instanceof eo))return new eo(t);t=Mhe[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=Nhe.sha512}var Ohe=eo;eo.prototype.sign=function(e,r){e=AU(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})};eo.prototype.verify=function(e,r,n){if(e=AU(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)};eo.prototype.hashInt=function(){for(var e=this.hash(),r=0;re in t?Bhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bP=(t,e)=>{for(var r in e||(e={}))Uhe.call(e,r)&&yP(t,r,e[r]);if(vP)for(var r of vP(e))jhe.call(e,r)&&yP(t,r,e[r]);return t};const Fhe="ReactNative",vo={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},zhe="js";function uv(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function yg(){return!s4()&&!!CE()&&navigator.product===Fhe}function x2(){return!uv()&&!!CE()&&!!s4()}function C2(){return yg()?vo.reactNative:uv()?vo.node:x2()?vo.browser:vo.unknown}function Whe(){var t;try{return yg()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Hhe(t,e){let r=lv.parse(t);return r=bP(bP({},r),e),t=lv.stringify(r),t}function qhe(){return qB()||{name:"",description:"",url:"",icons:[""]}}function Vhe(){if(C2()===vo.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=Bue();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 Khe(){var t;const e=C2();return e===vo.browser?[e,((t=HB())==null?void 0:t.host)||"unknown"].join(":"):e}function Ghe(t,e,r){const n=Vhe(),i=Khe();return[[t,e].join("-"),[zhe,r].join("-"),n,i].join("/")}function Zhe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=Ghe(t,e,n),d={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},f=Hhe(c[1]||"",d);return c[0]+"?"+f}function mh(t,e){return t.filter(r=>e.includes(r)).length===t.length}function IU(t){return Object.fromEntries(t.entries())}function TU(t){return new Map(Object.entries(t))}function ch(t=Je.FIVE_MINUTES,e){const r=Je.toMiliseconds(t||Je.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 Zp(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 kU(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 Qhe(t){return kU("topic",t)}function Yhe(t){return kU("id",t)}function RU(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 ti(t,e){return Je.fromMiliseconds(Date.now()+Je.toMiliseconds(t))}function bd(t){return Date.now()>=Je.toMiliseconds(t)}function xr(t,e){return`${t}${e?`:${e}`:""}`}function cb(t=[],e=[]){return[...new Set([...t,...e])]}async function Jhe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r;let s=i==null?void 0:i.href;if(typeof s!="string")return;s.endsWith("/")&&(s=s.slice(0,-1));const o=`${s}/wc?requestId=${t}&sessionTopic=${e}`,a=C2();if(a===vo.browser){if(!((n=s4())!=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,"_self","noreferrer noopener")}else a===vo.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}async function Xhe(t,e){try{return await t.getItem(e)||(x2()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}function xP(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function e0e(){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)})}var PU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t0e(t){var e=t.default;if(typeof e=="function"){var r=function(){return 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 NU={exports:{}};/** +***************************************************************************** */var p_=function(t,e){return p_=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])},p_(t,e)};function $ae(t,e){p_(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var g_=function(){return g_=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 Bae(t,e){return function(r,n){e(r,n,t)}}function Uae(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function jae(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(d){try{l(n.next(d))}catch(h){o(h)}}function c(d){try{l(n.throw(d))}catch(h){o(h)}}function l(d){d.done?s(d.value):i(d.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Fae(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(d){return c([l,d])}}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 uB(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 Hae(){for(var t=[],e=0;e1||a(g,v)})})}function a(g,v){try{c(n[g](v))}catch(x){h(s[0][3],x)}}function c(g){g.value instanceof ov?Promise.resolve(g.value.v).then(l,d):h(s[0][2],g)}function l(g){a("next",g)}function d(g){a("throw",g)}function h(g,v){g(v),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Kae(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:ov(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Gae(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 m_=="function"?m_(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 Zae(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Qae(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 Yae(t){return t&&t.__esModule?t:{default:t}}function Jae(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Xae(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 ece=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return g_},__asyncDelegator:Kae,__asyncGenerator:Vae,__asyncValues:Gae,__await:ov,__awaiter:jae,__classPrivateFieldGet:Jae,__classPrivateFieldSet:Xae,__createBinding:zae,__decorate:Lae,__exportStar:Wae,__extends:$ae,__generator:Fae,__importDefault:Yae,__importStar:Qae,__makeTemplateObject:Zae,__metadata:Uae,__param:Bae,__read:uB,__rest:Dae,__spread:Hae,__spreadArrays:qae,__values:m_},Symbol.toStringTag,{value:"Module"})),h2=MO(ece);var Qx={},lm={},EP;function tce(){if(EP)return lm;EP=1,Object.defineProperty(lm,"__esModule",{value:!0}),lm.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return lm.delay=t,lm}var Xf={},Yx={},eh={},SP;function rce(){return SP||(SP=1,Object.defineProperty(eh,"__esModule",{value:!0}),eh.ONE_THOUSAND=eh.ONE_HUNDRED=void 0,eh.ONE_HUNDRED=100,eh.ONE_THOUSAND=1e3),eh}var Jx={},IP;function nce(){return IP||(IP=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}(Jx)),Jx}var TP;function dB(){return TP||(TP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=h2;e.__exportStar(rce(),t),e.__exportStar(nce(),t)}(Yx)),Yx}var kP;function ice(){if(kP)return Xf;kP=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.fromMiliseconds=Xf.toMiliseconds=void 0;const t=dB();function e(n){return n*t.ONE_THOUSAND}Xf.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Xf.fromMiliseconds=r,Xf}var PP;function sce(){return PP||(PP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=h2;e.__exportStar(tce(),t),e.__exportStar(ice(),t)}(Qx)),Qx}var lp={},RP;function oce(){if(RP)return lp;RP=1,Object.defineProperty(lp,"__esModule",{value:!0}),lp.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 lp.Watch=t,lp.default=t,lp}var Xx={},um={},NP;function ace(){if(NP)return um;NP=1,Object.defineProperty(um,"__esModule",{value:!0}),um.IWatch=void 0;class t{}return um.IWatch=t,um}var MP;function cce(){return MP||(MP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),h2.__exportStar(ace(),t)}(Xx)),Xx}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=h2;e.__exportStar(sce(),t),e.__exportStar(oce(),t),e.__exportStar(cce(),t),e.__exportStar(dB(),t)})(Ye);class T0{}let lce=class extends T0{constructor(e){super()}};const OP=Ye.FIVE_SECONDS,lg={pulse:"heartbeat_pulse"};let uce=class fB extends lce{constructor(e){super(e),this.events=new _a.EventEmitter,this.interval=OP,this.interval=(e==null?void 0:e.interval)||OP}static async init(e){const r=new fB(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(),Ye.toMiliseconds(this.interval))}pulse(){this.events.emit(lg.pulse)}},dce=class extends T0{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},fce=class extends T0{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},hce=class{constructor(e,r){this.logger=e,this.core=r}},pce=class extends T0{constructor(e,r){super(),this.relayer=e,this.logger=r}},gce=class extends T0{constructor(e){super()}},mce=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},wce=class extends T0{constructor(e,r){super(),this.relayer=e,this.logger=r}};class vce extends T0{constructor(e,r){super(),this.core=e,this.logger=r}}let yce=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},bce=class{constructor(e,r){this.projectId=e,this.logger=r}},xce=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},_ce=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},Cce=class{constructor(e){this.client=e}};var lE={},Ef={},K6={},G6={};Object.defineProperty(G6,"__esModule",{value:!0});G6.BrowserRandomSource=void 0;const $P=65536;class Ace{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n>>16&65535,d=a&65535,h=c>>>16&65535,g=c&65535;return d*g+(l*g+d*h<<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}})(hB);Object.defineProperty(dr,"__esModule",{value:!0});var pB=hB;function Oce(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}dr.readInt16BE=Oce;function $ce(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}dr.readUint16BE=$ce;function Dce(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}dr.readInt16LE=Dce;function Lce(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}dr.readUint16LE=Lce;function gB(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}dr.writeUint16BE=gB;dr.writeInt16BE=gB;function mB(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}dr.writeUint16LE=mB;dr.writeInt16LE=mB;function w_(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}dr.readInt32BE=w_;function v_(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}dr.readUint32BE=v_;function y_(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}dr.readInt32LE=y_;function b_(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}dr.readUint32LE=b_;function g5(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}dr.writeUint32BE=g5;dr.writeInt32BE=g5;function m5(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}dr.writeUint32LE=m5;dr.writeInt32LE=m5;function Bce(t,e){e===void 0&&(e=0);var r=w_(t,e),n=w_(t,e+4);return r*4294967296+n-(n>>31)*4294967296}dr.readInt64BE=Bce;function Uce(t,e){e===void 0&&(e=0);var r=v_(t,e),n=v_(t,e+4);return r*4294967296+n}dr.readUint64BE=Uce;function jce(t,e){e===void 0&&(e=0);var r=y_(t,e),n=y_(t,e+4);return n*4294967296+r-(r>>31)*4294967296}dr.readInt64LE=jce;function Fce(t,e){e===void 0&&(e=0);var r=b_(t,e),n=b_(t,e+4);return n*4294967296+r}dr.readUint64LE=Fce;function wB(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),g5(t/4294967296>>>0,e,r),g5(t>>>0,e,r+4),e}dr.writeUint64BE=wB;dr.writeInt64BE=wB;function vB(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),m5(t>>>0,e,r),m5(t/4294967296>>>0,e,r+4),e}dr.writeUint64LE=vB;dr.writeInt64LE=vB;function zce(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}dr.readUintBE=zce;function Wce(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}dr.writeUintBE=Hce;function qce(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(!pB.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s256)throw new Error("randomString charset is too long");let g="";const v=d.length,x=256-256%v;for(;l>0;){const R=i(Math.ceil(l*256/x),h);for(let M=0;M0;M++){const N=R[M];N0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],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&&(d=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,d,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[d++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,d=this._bufferLength,h=l/536870912|0,g=l<<3,v=l%128<112?128:256;this._buffer[d]=128;for(var x=d+1;x0?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,d,h,g,v){for(var x=l[0],R=l[1],M=l[2],N=l[3],E=l[4],O=l[5],L=l[6],U=l[7],H=d[0],I=d[1],T=d[2],F=d[3],K=d[4],B=d[5],_=d[6],p=d[7],m,w,A,P,S,k,y,b;v>=128;){for(var V=0;V<16;V++){var ce=8*V+g;a[V]=e.readUint32BE(h,ce),c[V]=e.readUint32BE(h,ce+4)}for(var V=0;V<80;V++){var de=x,W=R,le=M,Y=N,re=E,ne=O,D=L,ee=U,ge=H,xe=I,Ae=T,ke=F,He=K,Je=B,kt=_,tt=p;if(m=U,w=p,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=(E>>>14|K<<18)^(E>>>18|K<<14)^(K>>>9|E<<23),w=(K>>>14|E<<18)^(K>>>18|E<<14)^(E>>>9|K<<23),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=E&O^~E&L,w=K&B^~K&_,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=i[V*2],w=i[V*2+1],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=a[V%16],w=c[V%16],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,A=y&65535|b<<16,P=S&65535|k<<16,m=A,w=P,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=(x>>>28|H<<4)^(H>>>2|x<<30)^(H>>>7|x<<25),w=(H>>>28|x<<4)^(x>>>2|H<<30)^(x>>>7|H<<25),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,m=x&R^x&M^R&M,w=H&I^H&T^I&T,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,ee=y&65535|b<<16,tt=S&65535|k<<16,m=Y,w=ke,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=A,w=P,S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,Y=y&65535|b<<16,ke=S&65535|k<<16,R=de,M=W,N=le,E=Y,O=re,L=ne,U=D,x=ee,I=ge,T=xe,F=Ae,K=ke,B=He,_=Je,p=kt,H=tt,V%16===15)for(var ce=0;ce<16;ce++)m=a[ce],w=c[ce],S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=a[(ce+9)%16],w=c[(ce+9)%16],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,A=a[(ce+1)%16],P=c[(ce+1)%16],m=(A>>>1|P<<31)^(A>>>8|P<<24)^A>>>7,w=(P>>>1|A<<31)^(P>>>8|A<<24)^(P>>>7|A<<25),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,A=a[(ce+14)%16],P=c[(ce+14)%16],m=(A>>>19|P<<13)^(P>>>29|A<<3)^A>>>6,w=(P>>>19|A<<13)^(A>>>29|P<<3)^(P>>>6|A<<26),S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,a[ce]=y&65535|b<<16,c[ce]=S&65535|k<<16}m=x,w=H,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[0],w=d[0],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[0]=x=y&65535|b<<16,d[0]=H=S&65535|k<<16,m=R,w=I,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[1],w=d[1],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[1]=R=y&65535|b<<16,d[1]=I=S&65535|k<<16,m=M,w=T,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[2],w=d[2],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[2]=M=y&65535|b<<16,d[2]=T=S&65535|k<<16,m=N,w=F,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[3],w=d[3],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[3]=N=y&65535|b<<16,d[3]=F=S&65535|k<<16,m=E,w=K,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[4],w=d[4],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[4]=E=y&65535|b<<16,d[4]=K=S&65535|k<<16,m=O,w=B,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[5],w=d[5],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[5]=O=y&65535|b<<16,d[5]=B=S&65535|k<<16,m=L,w=_,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[6],w=d[6],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[6]=L=y&65535|b<<16,d[6]=_=S&65535|k<<16,m=U,w=p,S=w&65535,k=w>>>16,y=m&65535,b=m>>>16,m=l[7],w=d[7],S+=w&65535,k+=w>>>16,y+=m&65535,b+=m>>>16,k+=S>>>16,y+=k>>>16,b+=y>>>16,l[7]=U=y&65535|b<<16,d[7]=p=S&65535|k<<16,g+=128,v-=128}return g}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(yB);(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=Ef,r=yB,n=Po;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Y){const re=new Float64Array(16);if(Y)for(let ne=0;ne>16&1),ne[xe-1]&=65535;ne[15]=D[15]-32767-(ne[14]>>16&1);const ge=ne[15]>>16&1;ne[14]&=65535,R(D,ne,1-ge)}for(let ee=0;ee<16;ee++)Y[2*ee]=D[ee]&255,Y[2*ee+1]=D[ee]>>8}function N(Y,re){let ne=0;for(let D=0;D<32;D++)ne|=Y[D]^re[D];return(1&ne-1>>>8)-1}function E(Y,re){const ne=new Uint8Array(32),D=new Uint8Array(32);return M(ne,Y),M(D,re),N(ne,D)}function O(Y){const re=new Uint8Array(32);return M(re,Y),re[0]&1}function L(Y,re){for(let ne=0;ne<16;ne++)Y[ne]=re[2*ne]+(re[2*ne+1]<<8);Y[15]&=32767}function U(Y,re,ne){for(let D=0;D<16;D++)Y[D]=re[D]+ne[D]}function H(Y,re,ne){for(let D=0;D<16;D++)Y[D]=re[D]-ne[D]}function I(Y,re,ne){let D,ee,ge=0,xe=0,Ae=0,ke=0,He=0,Je=0,kt=0,tt=0,st=0,Ze=0,Le=0,rt=0,lt=0,Ue=0,at=0,G=0,$=0,z=0,J=0,oe=0,fe=0,ye=0,Re=0,Ve=0,dt=0,Ge=0,wt=0,er=0,Rt=0,yr=0,Cr=0,ft=ne[0],Ot=ne[1],Ft=ne[2],ht=ne[3],Bt=ne[4],$t=ne[5],vt=ne[6],Qt=ne[7],zt=ne[8],yt=ne[9],Wt=ne[10],qt=ne[11],pt=ne[12],Nt=ne[13],Yt=ne[14],bt=ne[15];D=re[0],ge+=D*ft,xe+=D*Ot,Ae+=D*Ft,ke+=D*ht,He+=D*Bt,Je+=D*$t,kt+=D*vt,tt+=D*Qt,st+=D*zt,Ze+=D*yt,Le+=D*Wt,rt+=D*qt,lt+=D*pt,Ue+=D*Nt,at+=D*Yt,G+=D*bt,D=re[1],xe+=D*ft,Ae+=D*Ot,ke+=D*Ft,He+=D*ht,Je+=D*Bt,kt+=D*$t,tt+=D*vt,st+=D*Qt,Ze+=D*zt,Le+=D*yt,rt+=D*Wt,lt+=D*qt,Ue+=D*pt,at+=D*Nt,G+=D*Yt,$+=D*bt,D=re[2],Ae+=D*ft,ke+=D*Ot,He+=D*Ft,Je+=D*ht,kt+=D*Bt,tt+=D*$t,st+=D*vt,Ze+=D*Qt,Le+=D*zt,rt+=D*yt,lt+=D*Wt,Ue+=D*qt,at+=D*pt,G+=D*Nt,$+=D*Yt,z+=D*bt,D=re[3],ke+=D*ft,He+=D*Ot,Je+=D*Ft,kt+=D*ht,tt+=D*Bt,st+=D*$t,Ze+=D*vt,Le+=D*Qt,rt+=D*zt,lt+=D*yt,Ue+=D*Wt,at+=D*qt,G+=D*pt,$+=D*Nt,z+=D*Yt,J+=D*bt,D=re[4],He+=D*ft,Je+=D*Ot,kt+=D*Ft,tt+=D*ht,st+=D*Bt,Ze+=D*$t,Le+=D*vt,rt+=D*Qt,lt+=D*zt,Ue+=D*yt,at+=D*Wt,G+=D*qt,$+=D*pt,z+=D*Nt,J+=D*Yt,oe+=D*bt,D=re[5],Je+=D*ft,kt+=D*Ot,tt+=D*Ft,st+=D*ht,Ze+=D*Bt,Le+=D*$t,rt+=D*vt,lt+=D*Qt,Ue+=D*zt,at+=D*yt,G+=D*Wt,$+=D*qt,z+=D*pt,J+=D*Nt,oe+=D*Yt,fe+=D*bt,D=re[6],kt+=D*ft,tt+=D*Ot,st+=D*Ft,Ze+=D*ht,Le+=D*Bt,rt+=D*$t,lt+=D*vt,Ue+=D*Qt,at+=D*zt,G+=D*yt,$+=D*Wt,z+=D*qt,J+=D*pt,oe+=D*Nt,fe+=D*Yt,ye+=D*bt,D=re[7],tt+=D*ft,st+=D*Ot,Ze+=D*Ft,Le+=D*ht,rt+=D*Bt,lt+=D*$t,Ue+=D*vt,at+=D*Qt,G+=D*zt,$+=D*yt,z+=D*Wt,J+=D*qt,oe+=D*pt,fe+=D*Nt,ye+=D*Yt,Re+=D*bt,D=re[8],st+=D*ft,Ze+=D*Ot,Le+=D*Ft,rt+=D*ht,lt+=D*Bt,Ue+=D*$t,at+=D*vt,G+=D*Qt,$+=D*zt,z+=D*yt,J+=D*Wt,oe+=D*qt,fe+=D*pt,ye+=D*Nt,Re+=D*Yt,Ve+=D*bt,D=re[9],Ze+=D*ft,Le+=D*Ot,rt+=D*Ft,lt+=D*ht,Ue+=D*Bt,at+=D*$t,G+=D*vt,$+=D*Qt,z+=D*zt,J+=D*yt,oe+=D*Wt,fe+=D*qt,ye+=D*pt,Re+=D*Nt,Ve+=D*Yt,dt+=D*bt,D=re[10],Le+=D*ft,rt+=D*Ot,lt+=D*Ft,Ue+=D*ht,at+=D*Bt,G+=D*$t,$+=D*vt,z+=D*Qt,J+=D*zt,oe+=D*yt,fe+=D*Wt,ye+=D*qt,Re+=D*pt,Ve+=D*Nt,dt+=D*Yt,Ge+=D*bt,D=re[11],rt+=D*ft,lt+=D*Ot,Ue+=D*Ft,at+=D*ht,G+=D*Bt,$+=D*$t,z+=D*vt,J+=D*Qt,oe+=D*zt,fe+=D*yt,ye+=D*Wt,Re+=D*qt,Ve+=D*pt,dt+=D*Nt,Ge+=D*Yt,wt+=D*bt,D=re[12],lt+=D*ft,Ue+=D*Ot,at+=D*Ft,G+=D*ht,$+=D*Bt,z+=D*$t,J+=D*vt,oe+=D*Qt,fe+=D*zt,ye+=D*yt,Re+=D*Wt,Ve+=D*qt,dt+=D*pt,Ge+=D*Nt,wt+=D*Yt,er+=D*bt,D=re[13],Ue+=D*ft,at+=D*Ot,G+=D*Ft,$+=D*ht,z+=D*Bt,J+=D*$t,oe+=D*vt,fe+=D*Qt,ye+=D*zt,Re+=D*yt,Ve+=D*Wt,dt+=D*qt,Ge+=D*pt,wt+=D*Nt,er+=D*Yt,Rt+=D*bt,D=re[14],at+=D*ft,G+=D*Ot,$+=D*Ft,z+=D*ht,J+=D*Bt,oe+=D*$t,fe+=D*vt,ye+=D*Qt,Re+=D*zt,Ve+=D*yt,dt+=D*Wt,Ge+=D*qt,wt+=D*pt,er+=D*Nt,Rt+=D*Yt,yr+=D*bt,D=re[15],G+=D*ft,$+=D*Ot,z+=D*Ft,J+=D*ht,oe+=D*Bt,fe+=D*$t,ye+=D*vt,Re+=D*Qt,Ve+=D*zt,dt+=D*yt,Ge+=D*Wt,wt+=D*qt,er+=D*pt,Rt+=D*Nt,yr+=D*Yt,Cr+=D*bt,ge+=38*$,xe+=38*z,Ae+=38*J,ke+=38*oe,He+=38*fe,Je+=38*ye,kt+=38*Re,tt+=38*Ve,st+=38*dt,Ze+=38*Ge,Le+=38*wt,rt+=38*er,lt+=38*Rt,Ue+=38*yr,at+=38*Cr,ee=1,D=ge+ee+65535,ee=Math.floor(D/65536),ge=D-ee*65536,D=xe+ee+65535,ee=Math.floor(D/65536),xe=D-ee*65536,D=Ae+ee+65535,ee=Math.floor(D/65536),Ae=D-ee*65536,D=ke+ee+65535,ee=Math.floor(D/65536),ke=D-ee*65536,D=He+ee+65535,ee=Math.floor(D/65536),He=D-ee*65536,D=Je+ee+65535,ee=Math.floor(D/65536),Je=D-ee*65536,D=kt+ee+65535,ee=Math.floor(D/65536),kt=D-ee*65536,D=tt+ee+65535,ee=Math.floor(D/65536),tt=D-ee*65536,D=st+ee+65535,ee=Math.floor(D/65536),st=D-ee*65536,D=Ze+ee+65535,ee=Math.floor(D/65536),Ze=D-ee*65536,D=Le+ee+65535,ee=Math.floor(D/65536),Le=D-ee*65536,D=rt+ee+65535,ee=Math.floor(D/65536),rt=D-ee*65536,D=lt+ee+65535,ee=Math.floor(D/65536),lt=D-ee*65536,D=Ue+ee+65535,ee=Math.floor(D/65536),Ue=D-ee*65536,D=at+ee+65535,ee=Math.floor(D/65536),at=D-ee*65536,D=G+ee+65535,ee=Math.floor(D/65536),G=D-ee*65536,ge+=ee-1+37*(ee-1),ee=1,D=ge+ee+65535,ee=Math.floor(D/65536),ge=D-ee*65536,D=xe+ee+65535,ee=Math.floor(D/65536),xe=D-ee*65536,D=Ae+ee+65535,ee=Math.floor(D/65536),Ae=D-ee*65536,D=ke+ee+65535,ee=Math.floor(D/65536),ke=D-ee*65536,D=He+ee+65535,ee=Math.floor(D/65536),He=D-ee*65536,D=Je+ee+65535,ee=Math.floor(D/65536),Je=D-ee*65536,D=kt+ee+65535,ee=Math.floor(D/65536),kt=D-ee*65536,D=tt+ee+65535,ee=Math.floor(D/65536),tt=D-ee*65536,D=st+ee+65535,ee=Math.floor(D/65536),st=D-ee*65536,D=Ze+ee+65535,ee=Math.floor(D/65536),Ze=D-ee*65536,D=Le+ee+65535,ee=Math.floor(D/65536),Le=D-ee*65536,D=rt+ee+65535,ee=Math.floor(D/65536),rt=D-ee*65536,D=lt+ee+65535,ee=Math.floor(D/65536),lt=D-ee*65536,D=Ue+ee+65535,ee=Math.floor(D/65536),Ue=D-ee*65536,D=at+ee+65535,ee=Math.floor(D/65536),at=D-ee*65536,D=G+ee+65535,ee=Math.floor(D/65536),G=D-ee*65536,ge+=ee-1+37*(ee-1),Y[0]=ge,Y[1]=xe,Y[2]=Ae,Y[3]=ke,Y[4]=He,Y[5]=Je,Y[6]=kt,Y[7]=tt,Y[8]=st,Y[9]=Ze,Y[10]=Le,Y[11]=rt,Y[12]=lt,Y[13]=Ue,Y[14]=at,Y[15]=G}function T(Y,re){I(Y,re,re)}function F(Y,re){const ne=i();let D;for(D=0;D<16;D++)ne[D]=re[D];for(D=253;D>=0;D--)T(ne,ne),D!==2&&D!==4&&I(ne,ne,re);for(D=0;D<16;D++)Y[D]=ne[D]}function K(Y,re){const ne=i();let D;for(D=0;D<16;D++)ne[D]=re[D];for(D=250;D>=0;D--)T(ne,ne),D!==1&&I(ne,ne,re);for(D=0;D<16;D++)Y[D]=ne[D]}function B(Y,re){const ne=i(),D=i(),ee=i(),ge=i(),xe=i(),Ae=i(),ke=i(),He=i(),Je=i();H(ne,Y[1],Y[0]),H(Je,re[1],re[0]),I(ne,ne,Je),U(D,Y[0],Y[1]),U(Je,re[0],re[1]),I(D,D,Je),I(ee,Y[3],re[3]),I(ee,ee,l),I(ge,Y[2],re[2]),U(ge,ge,ge),H(xe,D,ne),H(Ae,ge,ee),U(ke,ge,ee),U(He,D,ne),I(Y[0],xe,Ae),I(Y[1],He,ke),I(Y[2],ke,Ae),I(Y[3],xe,He)}function _(Y,re,ne){for(let D=0;D<4;D++)R(Y[D],re[D],ne)}function p(Y,re){const ne=i(),D=i(),ee=i();F(ee,re[2]),I(ne,re[0],ee),I(D,re[1],ee),M(Y,D),Y[31]^=O(ne)<<7}function m(Y,re,ne){v(Y[0],o),v(Y[1],a),v(Y[2],a),v(Y[3],o);for(let D=255;D>=0;--D){const ee=ne[D/8|0]>>(D&7)&1;_(Y,re,ee),B(re,Y),B(Y,Y),_(Y,re,ee)}}function w(Y,re){const ne=[i(),i(),i(),i()];v(ne[0],d),v(ne[1],h),v(ne[2],a),I(ne[3],d,h),m(Y,ne,re)}function A(Y){if(Y.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const re=(0,r.hash)(Y);re[0]&=248,re[31]&=127,re[31]|=64;const ne=new Uint8Array(32),D=[i(),i(),i(),i()];w(D,re),p(ne,D);const ee=new Uint8Array(64);return ee.set(Y),ee.set(ne,32),{publicKey:ne,secretKey:ee}}t.generateKeyPairFromSeed=A;function P(Y){const re=(0,e.randomBytes)(32,Y),ne=A(re);return(0,n.wipe)(re),ne}t.generateKeyPair=P;function S(Y){if(Y.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Y.subarray(32))}t.extractPublicKeyFromSecretKey=S;const k=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 y(Y,re){let ne,D,ee,ge;for(D=63;D>=32;--D){for(ne=0,ee=D-32,ge=D-12;ee>4)*k[ee],ne=re[ee]>>8,re[ee]&=255;for(ee=0;ee<32;ee++)re[ee]-=ne*k[ee];for(D=0;D<32;D++)re[D+1]+=re[D]>>8,Y[D]=re[D]&255}function b(Y){const re=new Float64Array(64);for(let ne=0;ne<64;ne++)re[ne]=Y[ne];for(let ne=0;ne<64;ne++)Y[ne]=0;y(Y,re)}function V(Y,re){const ne=new Float64Array(64),D=[i(),i(),i(),i()],ee=(0,r.hash)(Y.subarray(0,32));ee[0]&=248,ee[31]&=127,ee[31]|=64;const ge=new Uint8Array(64);ge.set(ee.subarray(32),32);const xe=new r.SHA512;xe.update(ge.subarray(32)),xe.update(re);const Ae=xe.digest();xe.clean(),b(Ae),w(D,Ae),p(ge,D),xe.reset(),xe.update(ge.subarray(0,32)),xe.update(Y.subarray(32)),xe.update(re);const ke=xe.digest();b(ke);for(let He=0;He<32;He++)ne[He]=Ae[He];for(let He=0;He<32;He++)for(let Je=0;Je<32;Je++)ne[He+Je]+=ke[He]*ee[Je];return y(ge.subarray(32),ne),ge}t.sign=V;function ce(Y,re){const ne=i(),D=i(),ee=i(),ge=i(),xe=i(),Ae=i(),ke=i();return v(Y[2],a),L(Y[1],re),T(ee,Y[1]),I(ge,ee,c),H(ee,ee,Y[2]),U(ge,Y[2],ge),T(xe,ge),T(Ae,xe),I(ke,Ae,xe),I(ne,ke,ee),I(ne,ne,ge),K(ne,ne),I(ne,ne,ee),I(ne,ne,ge),I(ne,ne,ge),I(Y[0],ne,ge),T(D,Y[0]),I(D,D,ge),E(D,ee)&&I(Y[0],Y[0],g),T(D,Y[0]),I(D,D,ge),E(D,ee)?-1:(O(Y[0])===re[31]>>7&&H(Y[0],o,Y[0]),I(Y[3],Y[0],Y[1]),0)}function de(Y,re,ne){const D=new Uint8Array(32),ee=[i(),i(),i(),i()],ge=[i(),i(),i(),i()];if(ne.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ce(ge,Y))return!1;const xe=new r.SHA512;xe.update(ne.subarray(0,32)),xe.update(Y),xe.update(re);const Ae=xe.digest();return b(Ae),m(ee,ge,Ae),w(ge,ne.subarray(32)),B(ee,ge),p(D,ee),!N(ne,D)}t.verify=de;function W(Y){let re=[i(),i(),i(),i()];if(ce(re,Y))throw new Error("Ed25519: invalid public key");let ne=i(),D=i(),ee=re[1];U(ne,a,ee),H(D,a,ee),F(D,D),I(ne,ne,D);let ge=new Uint8Array(32);return M(ge,ne),ge}t.convertPublicKeyToX25519=W;function le(Y){const re=(0,r.hash)(Y.subarray(0,32));re[0]&=248,re[31]&=127,re[31]|=64;const ne=new Uint8Array(re.subarray(0,32));return(0,n.wipe)(re),ne}t.convertSecretKeyToX25519=le})(lE);const ele="EdDSA",tle="JWT",w5=".",Q6="base64url",bB="utf8",xB="utf8",rle=":",nle="did",ile="key",DP="base58btc",sle="z",ole="K36",ale=32;function _B(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function rb(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=_B(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function cle(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);N!==E;){for(var U=x[N],H=0,I=O-1;(U!==0||H>>0,L[I]=U%a>>>0,U=U/a>>>0;if(U!==0)throw new Error("Non-zero carry");M=H,N++}for(var T=O-M;T!==O&&L[T]===0;)T++;for(var F=c.repeat(R);T>>0,O=new Uint8Array(E);x[R];){var L=r[x.charCodeAt(R)];if(L===255)return;for(var U=0,H=E-1;(L!==0||U>>0,O[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");N=U,R++}if(x[R]!==" "){for(var I=E-N;I!==E&&O[I]===0;)I++;for(var T=new Uint8Array(M+(E-I)),F=M;I!==E;)T[F++]=O[I++];return T}}}function v(x){var R=g(x);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:g,decode:v}}var lle=cle,ule=lle;const dle=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")},fle=t=>new TextEncoder().encode(t),hle=t=>new TextDecoder().decode(t);class ple{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 gle{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 CB(this,e)}}class mle{constructor(e){this.decoders=e}or(e){return CB(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 CB=(t,e)=>new mle({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class wle{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ple(e,r,n),this.decoder=new gle(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Y6=({name:t,prefix:e,encode:r,decode:n})=>new wle(t,e,r,n),p2=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=ule(r,e);return Y6({prefix:t,name:e,encode:n,decode:s=>dle(i(s))})},vle=(t,e,r,n)=>{const i={};for(let d=0;d=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},yle=(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<Y6({prefix:e,name:t,encode(i){return yle(i,n,r)},decode(i){return vle(i,n,r,t)}}),ble=Y6({prefix:"\0",name:"identity",encode:t=>hle(t),decode:t=>fle(t)}),xle=Object.freeze(Object.defineProperty({__proto__:null,identity:ble},Symbol.toStringTag,{value:"Module"})),_le=ki({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Cle=Object.freeze(Object.defineProperty({__proto__:null,base2:_le},Symbol.toStringTag,{value:"Module"})),Ale=ki({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ele=Object.freeze(Object.defineProperty({__proto__:null,base8:Ale},Symbol.toStringTag,{value:"Module"})),Sle=p2({prefix:"9",name:"base10",alphabet:"0123456789"}),Ile=Object.freeze(Object.defineProperty({__proto__:null,base10:Sle},Symbol.toStringTag,{value:"Module"})),Tle=ki({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kle=ki({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Ple=Object.freeze(Object.defineProperty({__proto__:null,base16:Tle,base16upper:kle},Symbol.toStringTag,{value:"Module"})),Rle=ki({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Nle=ki({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Mle=ki({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ole=ki({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$le=ki({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Dle=ki({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Lle=ki({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ble=ki({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ule=ki({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),jle=Object.freeze(Object.defineProperty({__proto__:null,base32:Rle,base32hex:$le,base32hexpad:Lle,base32hexpadupper:Ble,base32hexupper:Dle,base32pad:Mle,base32padupper:Ole,base32upper:Nle,base32z:Ule},Symbol.toStringTag,{value:"Module"})),Fle=p2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),zle=p2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Wle=Object.freeze(Object.defineProperty({__proto__:null,base36:Fle,base36upper:zle},Symbol.toStringTag,{value:"Module"})),Hle=p2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),qle=p2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Vle=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Hle,base58flickr:qle},Symbol.toStringTag,{value:"Module"})),Kle=ki({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Gle=ki({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zle=ki({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Qle=ki({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Yle=Object.freeze(Object.defineProperty({__proto__:null,base64:Kle,base64pad:Gle,base64url:Zle,base64urlpad:Qle},Symbol.toStringTag,{value:"Module"})),AB=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Jle=AB.reduce((t,e,r)=>(t[r]=e,t),[]),Xle=AB.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function eue(t){return t.reduce((e,r)=>(e+=Jle[r],e),"")}function tue(t){const e=[];for(const r of t){const n=Xle[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const rue=Y6({prefix:"🚀",name:"base256emoji",encode:eue,decode:tue}),nue=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:rue},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const LP={...xle,...Cle,...Ele,...Ile,...Ple,...jle,...Wle,...Vle,...Yle,...nue};function EB(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const BP=EB("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),e9=EB("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=_B(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new hue:typeof navigator<"u"?yue(navigator.userAgent):xue()}function vue(t){return t!==""&&mue.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 yue(t){var e=vue(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new fue;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length-1){const M=x.getAttribute("href");if(M)if(M.toLowerCase().indexOf("https:")===-1&&M.toLowerCase().indexOf("http:")===-1&&M.indexOf("//")!==0){let N=e.protocol+"//"+e.host;if(M.indexOf("/")===0)N+=M;else{const E=e.pathname.split("/");E.pop();const O=E.join("/");N+=O+"/"+M}g.push(N)}else if(M.indexOf("//")===0){const N=e.protocol+M;g.push(N)}else g.push(M)}}return g}function n(...h){const g=t.getElementsByTagName("meta");for(let v=0;vx.getAttribute(M)).filter(M=>M?h.includes(M):!1);if(R.length&&R){const M=x.getAttribute("content");if(M)return M}}return""}function i(){let h=n("name","og:site_name","og:title","twitter:title");return h||(h=t.title),h}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}}kB=fE.getWindowMetadata=Mue;var av={},Oue=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),PB="%[a-f0-9]{2}",qP=new RegExp("("+PB+")|([^%]+?)","gi"),VP=new RegExp("("+PB+")+","gi");function __(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([],__(r),__(n))}function $ue(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(qP)||[],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)]},Uue=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sE==null,o=Symbol("encodeFragmentIdentifier");function a(E){switch(E.arrayFormat){case"index":return O=>(L,U)=>{const H=L.length;return U===void 0||E.skipNull&&U===null||E.skipEmptyString&&U===""?L:U===null?[...L,[d(O,E),"[",H,"]"].join("")]:[...L,[d(O,E),"[",d(H,E),"]=",d(U,E)].join("")]};case"bracket":return O=>(L,U)=>U===void 0||E.skipNull&&U===null||E.skipEmptyString&&U===""?L:U===null?[...L,[d(O,E),"[]"].join("")]:[...L,[d(O,E),"[]=",d(U,E)].join("")];case"colon-list-separator":return O=>(L,U)=>U===void 0||E.skipNull&&U===null||E.skipEmptyString&&U===""?L:U===null?[...L,[d(O,E),":list="].join("")]:[...L,[d(O,E),":list=",d(U,E)].join("")];case"comma":case"separator":case"bracket-separator":{const O=E.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(U,H)=>H===void 0||E.skipNull&&H===null||E.skipEmptyString&&H===""?U:(H=H===null?"":H,U.length===0?[[d(L,E),O,d(H,E)].join("")]:[[U,d(H,E)].join(E.arrayFormatSeparator)])}default:return O=>(L,U)=>U===void 0||E.skipNull&&U===null||E.skipEmptyString&&U===""?L:U===null?[...L,d(O,E)]:[...L,[d(O,E),"=",d(U,E)].join("")]}}function c(E){let O;switch(E.arrayFormat){case"index":return(L,U,H)=>{if(O=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!O){H[L]=U;return}H[L]===void 0&&(H[L]={}),H[L][O[1]]=U};case"bracket":return(L,U,H)=>{if(O=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!O){H[L]=U;return}if(H[L]===void 0){H[L]=[U];return}H[L]=[].concat(H[L],U)};case"colon-list-separator":return(L,U,H)=>{if(O=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!O){H[L]=U;return}if(H[L]===void 0){H[L]=[U];return}H[L]=[].concat(H[L],U)};case"comma":case"separator":return(L,U,H)=>{const I=typeof U=="string"&&U.includes(E.arrayFormatSeparator),T=typeof U=="string"&&!I&&h(U,E).includes(E.arrayFormatSeparator);U=T?h(U,E):U;const F=I||T?U.split(E.arrayFormatSeparator).map(K=>h(K,E)):U===null?U:h(U,E);H[L]=F};case"bracket-separator":return(L,U,H)=>{const I=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!I){H[L]=U&&h(U,E);return}const T=U===null?[]:U.split(E.arrayFormatSeparator).map(F=>h(F,E));if(H[L]===void 0){H[L]=T;return}H[L]=[].concat(H[L],T)};default:return(L,U,H)=>{if(H[L]===void 0){H[L]=U;return}H[L]=[].concat(H[L],U)}}}function l(E){if(typeof E!="string"||E.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function d(E,O){return O.encode?O.strict?e(E):encodeURIComponent(E):E}function h(E,O){return O.decode?r(E):E}function g(E){return Array.isArray(E)?E.sort():typeof E=="object"?g(Object.keys(E)).sort((O,L)=>Number(O)-Number(L)).map(O=>E[O]):E}function v(E){const O=E.indexOf("#");return O!==-1&&(E=E.slice(0,O)),E}function x(E){let O="";const L=E.indexOf("#");return L!==-1&&(O=E.slice(L)),O}function R(E){E=v(E);const O=E.indexOf("?");return O===-1?"":E.slice(O+1)}function M(E,O){return O.parseNumbers&&!Number.isNaN(Number(E))&&typeof E=="string"&&E.trim()!==""?E=Number(E):O.parseBooleans&&E!==null&&(E.toLowerCase()==="true"||E.toLowerCase()==="false")&&(E=E.toLowerCase()==="true"),E}function N(E,O){O=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},O),l(O.arrayFormatSeparator);const L=c(O),U=Object.create(null);if(typeof E!="string"||(E=E.trim().replace(/^[?#&]/,""),!E))return U;for(const H of E.split("&")){if(H==="")continue;let[I,T]=n(O.decode?H.replace(/\+/g," "):H,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes(O.arrayFormat)?T:h(T,O),L(h(I,O),T,U)}for(const H of Object.keys(U)){const I=U[H];if(typeof I=="object"&&I!==null)for(const T of Object.keys(I))I[T]=M(I[T],O);else U[H]=M(I,O)}return O.sort===!1?U:(O.sort===!0?Object.keys(U).sort():Object.keys(U).sort(O.sort)).reduce((H,I)=>{const T=U[I];return T&&typeof T=="object"&&!Array.isArray(T)?H[I]=g(T):H[I]=T,H},Object.create(null))}t.extract=R,t.parse=N,t.stringify=(E,O)=>{if(!E)return"";O=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},O),l(O.arrayFormatSeparator);const L=T=>O.skipNull&&s(E[T])||O.skipEmptyString&&E[T]==="",U=a(O),H={};for(const T of Object.keys(E))L(T)||(H[T]=E[T]);const I=Object.keys(H);return O.sort!==!1&&I.sort(O.sort),I.map(T=>{const F=E[T];return F===void 0?"":F===null?d(T,O):Array.isArray(F)?F.length===0&&O.arrayFormat==="bracket-separator"?d(T,O)+"[]":F.reduce(U(T),[]).join("&"):d(T,O)+"="+d(F,O)}).filter(T=>T.length>0).join("&")},t.parseUrl=(E,O)=>{O=Object.assign({decode:!0},O);const[L,U]=n(E,"#");return Object.assign({url:L.split("?")[0]||"",query:N(R(E),O)},O&&O.parseFragmentIdentifier&&U?{fragmentIdentifier:h(U,O)}:{})},t.stringifyUrl=(E,O)=>{O=Object.assign({encode:!0,strict:!0,[o]:!0},O);const L=v(E.url).split("?")[0]||"",U=t.extract(E.url),H=t.parse(U,{sort:!1}),I=Object.assign(H,E.query);let T=t.stringify(I,O);T&&(T=`?${T}`);let F=x(E.url);return E.fragmentIdentifier&&(F=`#${O[o]?d(E.fragmentIdentifier,O):E.fragmentIdentifier}`),`${L}${T}${F}`},t.pick=(E,O,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[o]:!1},L);const{url:U,query:H,fragmentIdentifier:I}=t.parseUrl(E,L);return t.stringifyUrl({url:U,query:i(H,O),fragmentIdentifier:I},L)},t.exclude=(E,O,L)=>{const U=Array.isArray(O)?H=>!O.includes(H):(H,I)=>!O(H,I);return t.pick(E,U,L)}})(av);var hE={},X6={};Object.defineProperty(X6,"__esModule",{value:!0});var Hi=dr,C_=Po,jue=20;function Fue(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,o=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],h=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],x=r[31]<<24|r[30]<<16|r[29]<<8|r[28],R=e[3]<<24|e[2]<<16|e[1]<<8|e[0],M=e[7]<<24|e[6]<<16|e[5]<<8|e[4],N=e[11]<<24|e[10]<<16|e[9]<<8|e[8],E=e[15]<<24|e[14]<<16|e[13]<<8|e[12],O=n,L=i,U=s,H=o,I=a,T=c,F=l,K=d,B=h,_=g,p=v,m=x,w=R,A=M,P=N,S=E,k=0;k>>16|w<<16,B=B+w|0,I^=B,I=I>>>20|I<<12,L=L+T|0,A^=L,A=A>>>16|A<<16,_=_+A|0,T^=_,T=T>>>20|T<<12,U=U+F|0,P^=U,P=P>>>16|P<<16,p=p+P|0,F^=p,F=F>>>20|F<<12,H=H+K|0,S^=H,S=S>>>16|S<<16,m=m+S|0,K^=m,K=K>>>20|K<<12,U=U+F|0,P^=U,P=P>>>24|P<<8,p=p+P|0,F^=p,F=F>>>25|F<<7,H=H+K|0,S^=H,S=S>>>24|S<<8,m=m+S|0,K^=m,K=K>>>25|K<<7,L=L+T|0,A^=L,A=A>>>24|A<<8,_=_+A|0,T^=_,T=T>>>25|T<<7,O=O+I|0,w^=O,w=w>>>24|w<<8,B=B+w|0,I^=B,I=I>>>25|I<<7,O=O+T|0,S^=O,S=S>>>16|S<<16,p=p+S|0,T^=p,T=T>>>20|T<<12,L=L+F|0,w^=L,w=w>>>16|w<<16,m=m+w|0,F^=m,F=F>>>20|F<<12,U=U+K|0,A^=U,A=A>>>16|A<<16,B=B+A|0,K^=B,K=K>>>20|K<<12,H=H+I|0,P^=H,P=P>>>16|P<<16,_=_+P|0,I^=_,I=I>>>20|I<<12,U=U+K|0,A^=U,A=A>>>24|A<<8,B=B+A|0,K^=B,K=K>>>25|K<<7,H=H+I|0,P^=H,P=P>>>24|P<<8,_=_+P|0,I^=_,I=I>>>25|I<<7,L=L+F|0,w^=L,w=w>>>24|w<<8,m=m+w|0,F^=m,F=F>>>25|F<<7,O=O+T|0,S^=O,S=S>>>24|S<<8,p=p+S|0,T^=p,T=T>>>25|T<<7;Hi.writeUint32LE(O+n|0,t,0),Hi.writeUint32LE(L+i|0,t,4),Hi.writeUint32LE(U+s|0,t,8),Hi.writeUint32LE(H+o|0,t,12),Hi.writeUint32LE(I+a|0,t,16),Hi.writeUint32LE(T+c|0,t,20),Hi.writeUint32LE(F+l|0,t,24),Hi.writeUint32LE(K+d|0,t,28),Hi.writeUint32LE(B+h|0,t,32),Hi.writeUint32LE(_+g|0,t,36),Hi.writeUint32LE(p+v|0,t,40),Hi.writeUint32LE(m+x|0,t,44),Hi.writeUint32LE(w+R|0,t,48),Hi.writeUint32LE(A+M|0,t,52),Hi.writeUint32LE(P+N|0,t,56),Hi.writeUint32LE(S+E|0,t,60)}function RB(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 NB={},Sf={};Object.defineProperty(Sf,"__esModule",{value:!0});function Hue(t,e,r){return~(t-1)&e|t-1&r}Sf.select=Hue;function que(t,e){return(t|0)-(e|0)-1>>>31&1}Sf.lessOrEqual=que;function MB(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Sf.compare=MB;function Vue(t,e){return t.length===0||e.length===0?!1:MB(t,e)!==0}Sf.equal=Vue;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Sf,r=Po;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 d=a[4]|a[5]<<8;this._r[2]=(l>>>10|d<<6)&7939;var h=a[6]|a[7]<<8;this._r[3]=(d>>>7|h<<9)&8191;var g=a[8]|a[9]<<8;this._r[4]=(h>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var v=a[10]|a[11]<<8;this._r[6]=(g>>>14|v<<2)&8191;var x=a[12]|a[13]<<8;this._r[7]=(v>>>11|x<<5)&8065;var R=a[14]|a[15]<<8;this._r[8]=(x>>>8|R<<8)&8191,this._r[9]=R>>>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 d=this._fin?0:2048,h=this._h[0],g=this._h[1],v=this._h[2],x=this._h[3],R=this._h[4],M=this._h[5],N=this._h[6],E=this._h[7],O=this._h[8],L=this._h[9],U=this._r[0],H=this._r[1],I=this._r[2],T=this._r[3],F=this._r[4],K=this._r[5],B=this._r[6],_=this._r[7],p=this._r[8],m=this._r[9];l>=16;){var w=a[c+0]|a[c+1]<<8;h+=w&8191;var A=a[c+2]|a[c+3]<<8;g+=(w>>>13|A<<3)&8191;var P=a[c+4]|a[c+5]<<8;v+=(A>>>10|P<<6)&8191;var S=a[c+6]|a[c+7]<<8;x+=(P>>>7|S<<9)&8191;var k=a[c+8]|a[c+9]<<8;R+=(S>>>4|k<<12)&8191,M+=k>>>1&8191;var y=a[c+10]|a[c+11]<<8;N+=(k>>>14|y<<2)&8191;var b=a[c+12]|a[c+13]<<8;E+=(y>>>11|b<<5)&8191;var V=a[c+14]|a[c+15]<<8;O+=(b>>>8|V<<8)&8191,L+=V>>>5|d;var ce=0,de=ce;de+=h*U,de+=g*(5*m),de+=v*(5*p),de+=x*(5*_),de+=R*(5*B),ce=de>>>13,de&=8191,de+=M*(5*K),de+=N*(5*F),de+=E*(5*T),de+=O*(5*I),de+=L*(5*H),ce+=de>>>13,de&=8191;var W=ce;W+=h*H,W+=g*U,W+=v*(5*m),W+=x*(5*p),W+=R*(5*_),ce=W>>>13,W&=8191,W+=M*(5*B),W+=N*(5*K),W+=E*(5*F),W+=O*(5*T),W+=L*(5*I),ce+=W>>>13,W&=8191;var le=ce;le+=h*I,le+=g*H,le+=v*U,le+=x*(5*m),le+=R*(5*p),ce=le>>>13,le&=8191,le+=M*(5*_),le+=N*(5*B),le+=E*(5*K),le+=O*(5*F),le+=L*(5*T),ce+=le>>>13,le&=8191;var Y=ce;Y+=h*T,Y+=g*I,Y+=v*H,Y+=x*U,Y+=R*(5*m),ce=Y>>>13,Y&=8191,Y+=M*(5*p),Y+=N*(5*_),Y+=E*(5*B),Y+=O*(5*K),Y+=L*(5*F),ce+=Y>>>13,Y&=8191;var re=ce;re+=h*F,re+=g*T,re+=v*I,re+=x*H,re+=R*U,ce=re>>>13,re&=8191,re+=M*(5*m),re+=N*(5*p),re+=E*(5*_),re+=O*(5*B),re+=L*(5*K),ce+=re>>>13,re&=8191;var ne=ce;ne+=h*K,ne+=g*F,ne+=v*T,ne+=x*I,ne+=R*H,ce=ne>>>13,ne&=8191,ne+=M*U,ne+=N*(5*m),ne+=E*(5*p),ne+=O*(5*_),ne+=L*(5*B),ce+=ne>>>13,ne&=8191;var D=ce;D+=h*B,D+=g*K,D+=v*F,D+=x*T,D+=R*I,ce=D>>>13,D&=8191,D+=M*H,D+=N*U,D+=E*(5*m),D+=O*(5*p),D+=L*(5*_),ce+=D>>>13,D&=8191;var ee=ce;ee+=h*_,ee+=g*B,ee+=v*K,ee+=x*F,ee+=R*T,ce=ee>>>13,ee&=8191,ee+=M*I,ee+=N*H,ee+=E*U,ee+=O*(5*m),ee+=L*(5*p),ce+=ee>>>13,ee&=8191;var ge=ce;ge+=h*p,ge+=g*_,ge+=v*B,ge+=x*K,ge+=R*F,ce=ge>>>13,ge&=8191,ge+=M*T,ge+=N*I,ge+=E*H,ge+=O*U,ge+=L*(5*m),ce+=ge>>>13,ge&=8191;var xe=ce;xe+=h*m,xe+=g*p,xe+=v*_,xe+=x*B,xe+=R*K,ce=xe>>>13,xe&=8191,xe+=M*F,xe+=N*T,xe+=E*I,xe+=O*H,xe+=L*U,ce+=xe>>>13,xe&=8191,ce=(ce<<2)+ce|0,ce=ce+de|0,de=ce&8191,ce=ce>>>13,W+=ce,h=de,g=W,v=le,x=Y,R=re,M=ne,N=D,E=ee,O=ge,L=xe,c+=16,l-=16}this._h[0]=h,this._h[1]=g,this._h[2]=v,this._h[3]=x,this._h[4]=R,this._h[5]=M,this._h[6]=N,this._h[7]=E,this._h[8]=O,this._h[9]=L},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),d,h,g,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(d=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=d,d=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=d*5,d=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=d,d=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=d,l[0]=this._h[0]+5,d=l[0]>>>13,l[0]&=8191,v=1;v<10;v++)l[v]=this._h[v]+d,d=l[v]>>>13,l[v]&=8191;for(l[9]-=8192,h=(d^1)-1,v=0;v<10;v++)l[v]&=h;for(h=~h,v=0;v<10;v++)this._h[v]=this._h[v]&h|l[v];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,g=this._h[0]+this._pad[0],this._h[0]=g&65535,v=1;v<8;v++)g=(this._h[v]+this._pad[v]|0)+(g>>>16)|0,this._h[v]=g&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,d;if(this._leftover){d=16-this._leftover,d>l&&(d=l);for(var h=0;h=16&&(d=l-l%16,this._blocks(a,c,d),c+=d,l-=d),l){for(var h=0;h16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(l,v.length-l.length);var x=new Uint8Array(32);e.stream(this._key,v,x,4);var R=d.length+this.tagLength,M;if(g){if(g.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");M=g}else M=new Uint8Array(R);return e.streamXOR(this._key,v,d,M,4),this._authenticate(M.subarray(M.length-this.tagLength,M.length),x,M.subarray(0,M.length-this.tagLength),h),n.wipe(v),M},c.prototype.open=function(l,d,h,g){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(d.length0&&v.update(o.subarray(g.length%16))),v.update(h),h.length%16>0&&v.update(o.subarray(h.length%16));var x=new Uint8Array(8);g&&i.writeUint64LE(g.length,x),v.update(x),i.writeUint64LE(h.length,x),v.update(x);for(var R=v.digest(),M=0;Mthis.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;n0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[d++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(d=s(this._temp,this._state,c,d,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[d++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,d=this._bufferLength,h=l/536870912|0,g=l<<3,v=l%64<56?64:128;this._buffer[d]=128;for(var x=d+1;x0?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,d,h){for(;h>=64;){for(var g=c[0],v=c[1],x=c[2],R=c[3],M=c[4],N=c[5],E=c[6],O=c[7],L=0;L<16;L++){var U=d+L*4;a[L]=e.readUint32BE(l,U)}for(var L=16;L<64;L++){var H=a[L-2],I=(H>>>17|H<<15)^(H>>>19|H<<13)^H>>>10;H=a[L-15];var T=(H>>>7|H<<25)^(H>>>18|H<<14)^H>>>3;a[L]=(I+a[L-7]|0)+(T+a[L-16]|0)}for(var L=0;L<64;L++){var I=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&N^~M&E)|0)+(O+(i[L]+a[L]|0)|0)|0,T=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&x^v&x)|0;O=E,E=N,N=M,M=R+I|0,R=x,x=v,v=g,g=I+T|0}c[0]+=g,c[1]+=v,c[2]+=x,c[3]+=R,c[4]+=M,c[5]+=N,c[6]+=E,c[7]+=O,d+=64,h-=64}return d}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(m2);var gE={};(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=Ef,r=Po;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(L){const U=new Float64Array(16);if(L)for(let H=0;H>16&1),H[K-1]&=65535;H[15]=I[15]-32767-(H[14]>>16&1);const F=H[15]>>16&1;H[14]&=65535,a(I,H,1-F)}for(let T=0;T<16;T++)L[2*T]=I[T]&255,L[2*T+1]=I[T]>>8}function l(L,U){for(let H=0;H<16;H++)L[H]=U[2*H]+(U[2*H+1]<<8);L[15]&=32767}function d(L,U,H){for(let I=0;I<16;I++)L[I]=U[I]+H[I]}function h(L,U,H){for(let I=0;I<16;I++)L[I]=U[I]-H[I]}function g(L,U,H){let I,T,F=0,K=0,B=0,_=0,p=0,m=0,w=0,A=0,P=0,S=0,k=0,y=0,b=0,V=0,ce=0,de=0,W=0,le=0,Y=0,re=0,ne=0,D=0,ee=0,ge=0,xe=0,Ae=0,ke=0,He=0,Je=0,kt=0,tt=0,st=H[0],Ze=H[1],Le=H[2],rt=H[3],lt=H[4],Ue=H[5],at=H[6],G=H[7],$=H[8],z=H[9],J=H[10],oe=H[11],fe=H[12],ye=H[13],Re=H[14],Ve=H[15];I=U[0],F+=I*st,K+=I*Ze,B+=I*Le,_+=I*rt,p+=I*lt,m+=I*Ue,w+=I*at,A+=I*G,P+=I*$,S+=I*z,k+=I*J,y+=I*oe,b+=I*fe,V+=I*ye,ce+=I*Re,de+=I*Ve,I=U[1],K+=I*st,B+=I*Ze,_+=I*Le,p+=I*rt,m+=I*lt,w+=I*Ue,A+=I*at,P+=I*G,S+=I*$,k+=I*z,y+=I*J,b+=I*oe,V+=I*fe,ce+=I*ye,de+=I*Re,W+=I*Ve,I=U[2],B+=I*st,_+=I*Ze,p+=I*Le,m+=I*rt,w+=I*lt,A+=I*Ue,P+=I*at,S+=I*G,k+=I*$,y+=I*z,b+=I*J,V+=I*oe,ce+=I*fe,de+=I*ye,W+=I*Re,le+=I*Ve,I=U[3],_+=I*st,p+=I*Ze,m+=I*Le,w+=I*rt,A+=I*lt,P+=I*Ue,S+=I*at,k+=I*G,y+=I*$,b+=I*z,V+=I*J,ce+=I*oe,de+=I*fe,W+=I*ye,le+=I*Re,Y+=I*Ve,I=U[4],p+=I*st,m+=I*Ze,w+=I*Le,A+=I*rt,P+=I*lt,S+=I*Ue,k+=I*at,y+=I*G,b+=I*$,V+=I*z,ce+=I*J,de+=I*oe,W+=I*fe,le+=I*ye,Y+=I*Re,re+=I*Ve,I=U[5],m+=I*st,w+=I*Ze,A+=I*Le,P+=I*rt,S+=I*lt,k+=I*Ue,y+=I*at,b+=I*G,V+=I*$,ce+=I*z,de+=I*J,W+=I*oe,le+=I*fe,Y+=I*ye,re+=I*Re,ne+=I*Ve,I=U[6],w+=I*st,A+=I*Ze,P+=I*Le,S+=I*rt,k+=I*lt,y+=I*Ue,b+=I*at,V+=I*G,ce+=I*$,de+=I*z,W+=I*J,le+=I*oe,Y+=I*fe,re+=I*ye,ne+=I*Re,D+=I*Ve,I=U[7],A+=I*st,P+=I*Ze,S+=I*Le,k+=I*rt,y+=I*lt,b+=I*Ue,V+=I*at,ce+=I*G,de+=I*$,W+=I*z,le+=I*J,Y+=I*oe,re+=I*fe,ne+=I*ye,D+=I*Re,ee+=I*Ve,I=U[8],P+=I*st,S+=I*Ze,k+=I*Le,y+=I*rt,b+=I*lt,V+=I*Ue,ce+=I*at,de+=I*G,W+=I*$,le+=I*z,Y+=I*J,re+=I*oe,ne+=I*fe,D+=I*ye,ee+=I*Re,ge+=I*Ve,I=U[9],S+=I*st,k+=I*Ze,y+=I*Le,b+=I*rt,V+=I*lt,ce+=I*Ue,de+=I*at,W+=I*G,le+=I*$,Y+=I*z,re+=I*J,ne+=I*oe,D+=I*fe,ee+=I*ye,ge+=I*Re,xe+=I*Ve,I=U[10],k+=I*st,y+=I*Ze,b+=I*Le,V+=I*rt,ce+=I*lt,de+=I*Ue,W+=I*at,le+=I*G,Y+=I*$,re+=I*z,ne+=I*J,D+=I*oe,ee+=I*fe,ge+=I*ye,xe+=I*Re,Ae+=I*Ve,I=U[11],y+=I*st,b+=I*Ze,V+=I*Le,ce+=I*rt,de+=I*lt,W+=I*Ue,le+=I*at,Y+=I*G,re+=I*$,ne+=I*z,D+=I*J,ee+=I*oe,ge+=I*fe,xe+=I*ye,Ae+=I*Re,ke+=I*Ve,I=U[12],b+=I*st,V+=I*Ze,ce+=I*Le,de+=I*rt,W+=I*lt,le+=I*Ue,Y+=I*at,re+=I*G,ne+=I*$,D+=I*z,ee+=I*J,ge+=I*oe,xe+=I*fe,Ae+=I*ye,ke+=I*Re,He+=I*Ve,I=U[13],V+=I*st,ce+=I*Ze,de+=I*Le,W+=I*rt,le+=I*lt,Y+=I*Ue,re+=I*at,ne+=I*G,D+=I*$,ee+=I*z,ge+=I*J,xe+=I*oe,Ae+=I*fe,ke+=I*ye,He+=I*Re,Je+=I*Ve,I=U[14],ce+=I*st,de+=I*Ze,W+=I*Le,le+=I*rt,Y+=I*lt,re+=I*Ue,ne+=I*at,D+=I*G,ee+=I*$,ge+=I*z,xe+=I*J,Ae+=I*oe,ke+=I*fe,He+=I*ye,Je+=I*Re,kt+=I*Ve,I=U[15],de+=I*st,W+=I*Ze,le+=I*Le,Y+=I*rt,re+=I*lt,ne+=I*Ue,D+=I*at,ee+=I*G,ge+=I*$,xe+=I*z,Ae+=I*J,ke+=I*oe,He+=I*fe,Je+=I*ye,kt+=I*Re,tt+=I*Ve,F+=38*W,K+=38*le,B+=38*Y,_+=38*re,p+=38*ne,m+=38*D,w+=38*ee,A+=38*ge,P+=38*xe,S+=38*Ae,k+=38*ke,y+=38*He,b+=38*Je,V+=38*kt,ce+=38*tt,T=1,I=F+T+65535,T=Math.floor(I/65536),F=I-T*65536,I=K+T+65535,T=Math.floor(I/65536),K=I-T*65536,I=B+T+65535,T=Math.floor(I/65536),B=I-T*65536,I=_+T+65535,T=Math.floor(I/65536),_=I-T*65536,I=p+T+65535,T=Math.floor(I/65536),p=I-T*65536,I=m+T+65535,T=Math.floor(I/65536),m=I-T*65536,I=w+T+65535,T=Math.floor(I/65536),w=I-T*65536,I=A+T+65535,T=Math.floor(I/65536),A=I-T*65536,I=P+T+65535,T=Math.floor(I/65536),P=I-T*65536,I=S+T+65535,T=Math.floor(I/65536),S=I-T*65536,I=k+T+65535,T=Math.floor(I/65536),k=I-T*65536,I=y+T+65535,T=Math.floor(I/65536),y=I-T*65536,I=b+T+65535,T=Math.floor(I/65536),b=I-T*65536,I=V+T+65535,T=Math.floor(I/65536),V=I-T*65536,I=ce+T+65535,T=Math.floor(I/65536),ce=I-T*65536,I=de+T+65535,T=Math.floor(I/65536),de=I-T*65536,F+=T-1+37*(T-1),T=1,I=F+T+65535,T=Math.floor(I/65536),F=I-T*65536,I=K+T+65535,T=Math.floor(I/65536),K=I-T*65536,I=B+T+65535,T=Math.floor(I/65536),B=I-T*65536,I=_+T+65535,T=Math.floor(I/65536),_=I-T*65536,I=p+T+65535,T=Math.floor(I/65536),p=I-T*65536,I=m+T+65535,T=Math.floor(I/65536),m=I-T*65536,I=w+T+65535,T=Math.floor(I/65536),w=I-T*65536,I=A+T+65535,T=Math.floor(I/65536),A=I-T*65536,I=P+T+65535,T=Math.floor(I/65536),P=I-T*65536,I=S+T+65535,T=Math.floor(I/65536),S=I-T*65536,I=k+T+65535,T=Math.floor(I/65536),k=I-T*65536,I=y+T+65535,T=Math.floor(I/65536),y=I-T*65536,I=b+T+65535,T=Math.floor(I/65536),b=I-T*65536,I=V+T+65535,T=Math.floor(I/65536),V=I-T*65536,I=ce+T+65535,T=Math.floor(I/65536),ce=I-T*65536,I=de+T+65535,T=Math.floor(I/65536),de=I-T*65536,F+=T-1+37*(T-1),L[0]=F,L[1]=K,L[2]=B,L[3]=_,L[4]=p,L[5]=m,L[6]=w,L[7]=A,L[8]=P,L[9]=S,L[10]=k,L[11]=y,L[12]=b,L[13]=V,L[14]=ce,L[15]=de}function v(L,U){g(L,U,U)}function x(L,U){const H=n();for(let I=0;I<16;I++)H[I]=U[I];for(let I=253;I>=0;I--)v(H,H),I!==2&&I!==4&&g(H,H,U);for(let I=0;I<16;I++)L[I]=H[I]}function R(L,U){const H=new Uint8Array(32),I=new Float64Array(80),T=n(),F=n(),K=n(),B=n(),_=n(),p=n();for(let P=0;P<31;P++)H[P]=L[P];H[31]=L[31]&127|64,H[0]&=248,l(I,U);for(let P=0;P<16;P++)F[P]=I[P];T[0]=B[0]=1;for(let P=254;P>=0;--P){const S=H[P>>>3]>>>(P&7)&1;a(T,F,S),a(K,B,S),d(_,T,K),h(T,T,K),d(K,F,B),h(F,F,B),v(B,_),v(p,T),g(T,K,T),g(K,F,_),d(_,T,K),h(T,T,K),v(F,T),h(K,B,p),g(T,K,s),d(T,T,B),g(K,K,T),g(T,B,p),g(B,F,I),v(F,_),a(T,F,S),a(K,B,S)}for(let P=0;P<16;P++)I[P+16]=T[P],I[P+32]=K[P],I[P+48]=F[P],I[P+64]=B[P];const m=I.subarray(32),w=I.subarray(16);x(m,m),g(w,w,m);const A=new Uint8Array(32);return c(A,w),A}t.scalarMult=R;function M(L){return R(L,i)}t.scalarMultBase=M;function N(L){if(L.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(L);return{publicKey:M(U),secretKey:U}}t.generateKeyPairFromSeed=N;function E(L){const U=(0,e.randomBytes)(32,L),H=N(U);return(0,r.wipe)(U),H}t.generateKeyPair=E;function O(L,U,H=!1){if(L.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const I=R(L,U);if(H){let T=0;for(let F=0;F",cde="MIT",lde={url:"https://github.com/indutny/elliptic/issues"},ude="https://github.com/indutny/elliptic",dde={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"},fde={"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"},hde={name:Xue,version:ede,description:tde,main:rde,files:nde,scripts:ide,repository:sde,keywords:ode,author:ade,license:cde,bugs:lde,homepage:ude,devDependencies:dde,dependencies:fde};var Ro={},mE={exports:{}};mE.exports;(function(t){(function(e,r){function n(B,_){if(!B)throw new Error(_||"Assertion failed")}function i(B,_){B.super_=_;var p=function(){};p.prototype=_.prototype,B.prototype=new p,B.prototype.constructor=B}function s(B,_,p){if(s.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((_==="le"||_==="be")&&(p=_,_=10),this._init(B||0,_||10,p||"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=uE.Buffer}catch{}s.isBN=function(_){return _ instanceof s?!0:_!==null&&typeof _=="object"&&_.constructor.wordSize===s.wordSize&&Array.isArray(_.words)},s.max=function(_,p){return _.cmp(p)>0?_:p},s.min=function(_,p){return _.cmp(p)<0?_:p},s.prototype._init=function(_,p,m){if(typeof _=="number")return this._initNumber(_,p,m);if(typeof _=="object")return this._initArray(_,p,m);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),_=_.toString().replace(/\s+/g,"");var w=0;_[0]==="-"&&(w++,this.negative=1),w<_.length&&(p===16?this._parseHex(_,w,m):(this._parseBase(_,p,w),m==="le"&&this._initArray(this.toArray(),p,m)))},s.prototype._initNumber=function(_,p,m){_<0&&(this.negative=1,_=-_),_<67108864?(this.words=[_&67108863],this.length=1):_<4503599627370496?(this.words=[_&67108863,_/67108864&67108863],this.length=2):(n(_<9007199254740992),this.words=[_&67108863,_/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),p,m)},s.prototype._initArray=function(_,p,m){if(n(typeof _.length=="number"),_.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(_.length/3),this.words=new Array(this.length);for(var w=0;w=0;w-=3)P=_[w]|_[w-1]<<8|_[w-2]<<16,this.words[A]|=P<>>26-S&67108863,S+=24,S>=26&&(S-=26,A++);else if(m==="le")for(w=0,A=0;w<_.length;w+=3)P=_[w]|_[w+1]<<8|_[w+2]<<16,this.words[A]|=P<>>26-S&67108863,S+=24,S>=26&&(S-=26,A++);return this.strip()};function a(B,_){var p=B.charCodeAt(_);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(B,_,p){var m=a(B,p);return p-1>=_&&(m|=a(B,p-1)<<4),m}s.prototype._parseHex=function(_,p,m){this.length=Math.ceil((_.length-p)/6),this.words=new Array(this.length);for(var w=0;w=p;w-=2)S=c(_,p,w)<=18?(A-=18,P+=1,this.words[P]|=S>>>26):A+=8;else{var k=_.length-p;for(w=k%2===0?p+1:p;w<_.length;w+=2)S=c(_,p,w)<=18?(A-=18,P+=1,this.words[P]|=S>>>26):A+=8}this.strip()};function l(B,_,p,m){for(var w=0,A=Math.min(B.length,p),P=_;P=49?w+=S-49+10:S>=17?w+=S-17+10:w+=S}return w}s.prototype._parseBase=function(_,p,m){this.words=[0],this.length=1;for(var w=0,A=1;A<=67108863;A*=p)w++;w--,A=A/p|0;for(var P=_.length-m,S=P%w,k=Math.min(P,P-S)+m,y=0,b=m;b1&&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 d=["","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"],h=[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],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(_,p){_=_||10,p=p|0||1;var m;if(_===16||_==="hex"){m="";for(var w=0,A=0,P=0;P>>24-w&16777215,A!==0||P!==this.length-1?m=d[6-k.length]+k+m:m=k+m,w+=2,w>=26&&(w-=26,P--)}for(A!==0&&(m=A.toString(16)+m);m.length%p!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(_===(_|0)&&_>=2&&_<=36){var y=h[_],b=g[_];m="";var V=this.clone();for(V.negative=0;!V.isZero();){var ce=V.modn(b).toString(_);V=V.idivn(b),V.isZero()?m=ce+m:m=d[y-ce.length]+ce+m}for(this.isZero()&&(m="0"+m);m.length%p!==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 _=this.words[0];return this.length===2?_+=this.words[1]*67108864:this.length===3&&this.words[2]===1?_+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-_:_},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(_,p){return n(typeof o<"u"),this.toArrayLike(o,_,p)},s.prototype.toArray=function(_,p){return this.toArrayLike(Array,_,p)},s.prototype.toArrayLike=function(_,p,m){var w=this.byteLength(),A=m||Math.max(1,w);n(w<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0"),this.strip();var P=p==="le",S=new _(A),k,y,b=this.clone();if(P){for(y=0;!b.isZero();y++)k=b.andln(255),b.iushrn(8),S[y]=k;for(;y=4096&&(m+=13,p>>>=13),p>=64&&(m+=7,p>>>=7),p>=8&&(m+=4,p>>>=4),p>=2&&(m+=2,p>>>=2),m+p},s.prototype._zeroBits=function(_){if(_===0)return 26;var p=_,m=0;return p&8191||(m+=13,p>>>=13),p&127||(m+=7,p>>>=7),p&15||(m+=4,p>>>=4),p&3||(m+=2,p>>>=2),p&1||m++,m},s.prototype.bitLength=function(){var _=this.words[this.length-1],p=this._countBits(_);return(this.length-1)*26+p};function v(B){for(var _=new Array(B.bitLength()),p=0;p<_.length;p++){var m=p/26|0,w=p%26;_[p]=(B.words[m]&1<>>w}return _}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var _=0,p=0;p_.length?this.clone().ior(_):_.clone().ior(this)},s.prototype.uor=function(_){return this.length>_.length?this.clone().iuor(_):_.clone().iuor(this)},s.prototype.iuand=function(_){var p;this.length>_.length?p=_:p=this;for(var m=0;m_.length?this.clone().iand(_):_.clone().iand(this)},s.prototype.uand=function(_){return this.length>_.length?this.clone().iuand(_):_.clone().iuand(this)},s.prototype.iuxor=function(_){var p,m;this.length>_.length?(p=this,m=_):(p=_,m=this);for(var w=0;w_.length?this.clone().ixor(_):_.clone().ixor(this)},s.prototype.uxor=function(_){return this.length>_.length?this.clone().iuxor(_):_.clone().iuxor(this)},s.prototype.inotn=function(_){n(typeof _=="number"&&_>=0);var p=Math.ceil(_/26)|0,m=_%26;this._expand(p),m>0&&p--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-m),this.strip()},s.prototype.notn=function(_){return this.clone().inotn(_)},s.prototype.setn=function(_,p){n(typeof _=="number"&&_>=0);var m=_/26|0,w=_%26;return this._expand(m+1),p?this.words[m]=this.words[m]|1<_.length?(m=this,w=_):(m=_,w=this);for(var A=0,P=0;P>>26;for(;A!==0&&P>>26;if(this.length=m.length,A!==0)this.words[this.length]=A,this.length++;else if(m!==this)for(;P_.length?this.clone().iadd(_):_.clone().iadd(this)},s.prototype.isub=function(_){if(_.negative!==0){_.negative=0;var p=this.iadd(_);return _.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(_),this.negative=1,this._normSign();var m=this.cmp(_);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,A;m>0?(w=this,A=_):(w=_,A=this);for(var P=0,S=0;S>26,this.words[S]=p&67108863;for(;P!==0&&S>26,this.words[S]=p&67108863;if(P===0&&S>>26,V=k&67108863,ce=Math.min(y,_.length-1),de=Math.max(0,y-B.length+1);de<=ce;de++){var W=y-de|0;w=B.words[W]|0,A=_.words[de]|0,P=w*A+V,b+=P/67108864|0,V=P&67108863}p.words[y]=V|0,k=b|0}return k!==0?p.words[y]=k|0:p.length--,p.strip()}var R=function(_,p,m){var w=_.words,A=p.words,P=m.words,S=0,k,y,b,V=w[0]|0,ce=V&8191,de=V>>>13,W=w[1]|0,le=W&8191,Y=W>>>13,re=w[2]|0,ne=re&8191,D=re>>>13,ee=w[3]|0,ge=ee&8191,xe=ee>>>13,Ae=w[4]|0,ke=Ae&8191,He=Ae>>>13,Je=w[5]|0,kt=Je&8191,tt=Je>>>13,st=w[6]|0,Ze=st&8191,Le=st>>>13,rt=w[7]|0,lt=rt&8191,Ue=rt>>>13,at=w[8]|0,G=at&8191,$=at>>>13,z=w[9]|0,J=z&8191,oe=z>>>13,fe=A[0]|0,ye=fe&8191,Re=fe>>>13,Ve=A[1]|0,dt=Ve&8191,Ge=Ve>>>13,wt=A[2]|0,er=wt&8191,Rt=wt>>>13,yr=A[3]|0,Cr=yr&8191,ft=yr>>>13,Ot=A[4]|0,Ft=Ot&8191,ht=Ot>>>13,Bt=A[5]|0,$t=Bt&8191,vt=Bt>>>13,Qt=A[6]|0,zt=Qt&8191,yt=Qt>>>13,Wt=A[7]|0,qt=Wt&8191,pt=Wt>>>13,Nt=A[8]|0,Yt=Nt&8191,bt=Nt>>>13,Mr=A[9]|0,Or=Mr&8191,Vt=Mr>>>13;m.negative=_.negative^p.negative,m.length=19,k=Math.imul(ce,ye),y=Math.imul(ce,Re),y=y+Math.imul(de,ye)|0,b=Math.imul(de,Re);var ar=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(ar>>>26)|0,ar&=67108863,k=Math.imul(le,ye),y=Math.imul(le,Re),y=y+Math.imul(Y,ye)|0,b=Math.imul(Y,Re),k=k+Math.imul(ce,dt)|0,y=y+Math.imul(ce,Ge)|0,y=y+Math.imul(de,dt)|0,b=b+Math.imul(de,Ge)|0;var Mi=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,k=Math.imul(ne,ye),y=Math.imul(ne,Re),y=y+Math.imul(D,ye)|0,b=Math.imul(D,Re),k=k+Math.imul(le,dt)|0,y=y+Math.imul(le,Ge)|0,y=y+Math.imul(Y,dt)|0,b=b+Math.imul(Y,Ge)|0,k=k+Math.imul(ce,er)|0,y=y+Math.imul(ce,Rt)|0,y=y+Math.imul(de,er)|0,b=b+Math.imul(de,Rt)|0;var Oi=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,k=Math.imul(ge,ye),y=Math.imul(ge,Re),y=y+Math.imul(xe,ye)|0,b=Math.imul(xe,Re),k=k+Math.imul(ne,dt)|0,y=y+Math.imul(ne,Ge)|0,y=y+Math.imul(D,dt)|0,b=b+Math.imul(D,Ge)|0,k=k+Math.imul(le,er)|0,y=y+Math.imul(le,Rt)|0,y=y+Math.imul(Y,er)|0,b=b+Math.imul(Y,Rt)|0,k=k+Math.imul(ce,Cr)|0,y=y+Math.imul(ce,ft)|0,y=y+Math.imul(de,Cr)|0,b=b+Math.imul(de,ft)|0;var $i=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+($i>>>26)|0,$i&=67108863,k=Math.imul(ke,ye),y=Math.imul(ke,Re),y=y+Math.imul(He,ye)|0,b=Math.imul(He,Re),k=k+Math.imul(ge,dt)|0,y=y+Math.imul(ge,Ge)|0,y=y+Math.imul(xe,dt)|0,b=b+Math.imul(xe,Ge)|0,k=k+Math.imul(ne,er)|0,y=y+Math.imul(ne,Rt)|0,y=y+Math.imul(D,er)|0,b=b+Math.imul(D,Rt)|0,k=k+Math.imul(le,Cr)|0,y=y+Math.imul(le,ft)|0,y=y+Math.imul(Y,Cr)|0,b=b+Math.imul(Y,ft)|0,k=k+Math.imul(ce,Ft)|0,y=y+Math.imul(ce,ht)|0,y=y+Math.imul(de,Ft)|0,b=b+Math.imul(de,ht)|0;var Di=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Di>>>26)|0,Di&=67108863,k=Math.imul(kt,ye),y=Math.imul(kt,Re),y=y+Math.imul(tt,ye)|0,b=Math.imul(tt,Re),k=k+Math.imul(ke,dt)|0,y=y+Math.imul(ke,Ge)|0,y=y+Math.imul(He,dt)|0,b=b+Math.imul(He,Ge)|0,k=k+Math.imul(ge,er)|0,y=y+Math.imul(ge,Rt)|0,y=y+Math.imul(xe,er)|0,b=b+Math.imul(xe,Rt)|0,k=k+Math.imul(ne,Cr)|0,y=y+Math.imul(ne,ft)|0,y=y+Math.imul(D,Cr)|0,b=b+Math.imul(D,ft)|0,k=k+Math.imul(le,Ft)|0,y=y+Math.imul(le,ht)|0,y=y+Math.imul(Y,Ft)|0,b=b+Math.imul(Y,ht)|0,k=k+Math.imul(ce,$t)|0,y=y+Math.imul(ce,vt)|0,y=y+Math.imul(de,$t)|0,b=b+Math.imul(de,vt)|0;var Li=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Li>>>26)|0,Li&=67108863,k=Math.imul(Ze,ye),y=Math.imul(Ze,Re),y=y+Math.imul(Le,ye)|0,b=Math.imul(Le,Re),k=k+Math.imul(kt,dt)|0,y=y+Math.imul(kt,Ge)|0,y=y+Math.imul(tt,dt)|0,b=b+Math.imul(tt,Ge)|0,k=k+Math.imul(ke,er)|0,y=y+Math.imul(ke,Rt)|0,y=y+Math.imul(He,er)|0,b=b+Math.imul(He,Rt)|0,k=k+Math.imul(ge,Cr)|0,y=y+Math.imul(ge,ft)|0,y=y+Math.imul(xe,Cr)|0,b=b+Math.imul(xe,ft)|0,k=k+Math.imul(ne,Ft)|0,y=y+Math.imul(ne,ht)|0,y=y+Math.imul(D,Ft)|0,b=b+Math.imul(D,ht)|0,k=k+Math.imul(le,$t)|0,y=y+Math.imul(le,vt)|0,y=y+Math.imul(Y,$t)|0,b=b+Math.imul(Y,vt)|0,k=k+Math.imul(ce,zt)|0,y=y+Math.imul(ce,yt)|0,y=y+Math.imul(de,zt)|0,b=b+Math.imul(de,yt)|0;var kn=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(kn>>>26)|0,kn&=67108863,k=Math.imul(lt,ye),y=Math.imul(lt,Re),y=y+Math.imul(Ue,ye)|0,b=Math.imul(Ue,Re),k=k+Math.imul(Ze,dt)|0,y=y+Math.imul(Ze,Ge)|0,y=y+Math.imul(Le,dt)|0,b=b+Math.imul(Le,Ge)|0,k=k+Math.imul(kt,er)|0,y=y+Math.imul(kt,Rt)|0,y=y+Math.imul(tt,er)|0,b=b+Math.imul(tt,Rt)|0,k=k+Math.imul(ke,Cr)|0,y=y+Math.imul(ke,ft)|0,y=y+Math.imul(He,Cr)|0,b=b+Math.imul(He,ft)|0,k=k+Math.imul(ge,Ft)|0,y=y+Math.imul(ge,ht)|0,y=y+Math.imul(xe,Ft)|0,b=b+Math.imul(xe,ht)|0,k=k+Math.imul(ne,$t)|0,y=y+Math.imul(ne,vt)|0,y=y+Math.imul(D,$t)|0,b=b+Math.imul(D,vt)|0,k=k+Math.imul(le,zt)|0,y=y+Math.imul(le,yt)|0,y=y+Math.imul(Y,zt)|0,b=b+Math.imul(Y,yt)|0,k=k+Math.imul(ce,qt)|0,y=y+Math.imul(ce,pt)|0,y=y+Math.imul(de,qt)|0,b=b+Math.imul(de,pt)|0;var As=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(As>>>26)|0,As&=67108863,k=Math.imul(G,ye),y=Math.imul(G,Re),y=y+Math.imul($,ye)|0,b=Math.imul($,Re),k=k+Math.imul(lt,dt)|0,y=y+Math.imul(lt,Ge)|0,y=y+Math.imul(Ue,dt)|0,b=b+Math.imul(Ue,Ge)|0,k=k+Math.imul(Ze,er)|0,y=y+Math.imul(Ze,Rt)|0,y=y+Math.imul(Le,er)|0,b=b+Math.imul(Le,Rt)|0,k=k+Math.imul(kt,Cr)|0,y=y+Math.imul(kt,ft)|0,y=y+Math.imul(tt,Cr)|0,b=b+Math.imul(tt,ft)|0,k=k+Math.imul(ke,Ft)|0,y=y+Math.imul(ke,ht)|0,y=y+Math.imul(He,Ft)|0,b=b+Math.imul(He,ht)|0,k=k+Math.imul(ge,$t)|0,y=y+Math.imul(ge,vt)|0,y=y+Math.imul(xe,$t)|0,b=b+Math.imul(xe,vt)|0,k=k+Math.imul(ne,zt)|0,y=y+Math.imul(ne,yt)|0,y=y+Math.imul(D,zt)|0,b=b+Math.imul(D,yt)|0,k=k+Math.imul(le,qt)|0,y=y+Math.imul(le,pt)|0,y=y+Math.imul(Y,qt)|0,b=b+Math.imul(Y,pt)|0,k=k+Math.imul(ce,Yt)|0,y=y+Math.imul(ce,bt)|0,y=y+Math.imul(de,Yt)|0,b=b+Math.imul(de,bt)|0;var Sa=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,k=Math.imul(J,ye),y=Math.imul(J,Re),y=y+Math.imul(oe,ye)|0,b=Math.imul(oe,Re),k=k+Math.imul(G,dt)|0,y=y+Math.imul(G,Ge)|0,y=y+Math.imul($,dt)|0,b=b+Math.imul($,Ge)|0,k=k+Math.imul(lt,er)|0,y=y+Math.imul(lt,Rt)|0,y=y+Math.imul(Ue,er)|0,b=b+Math.imul(Ue,Rt)|0,k=k+Math.imul(Ze,Cr)|0,y=y+Math.imul(Ze,ft)|0,y=y+Math.imul(Le,Cr)|0,b=b+Math.imul(Le,ft)|0,k=k+Math.imul(kt,Ft)|0,y=y+Math.imul(kt,ht)|0,y=y+Math.imul(tt,Ft)|0,b=b+Math.imul(tt,ht)|0,k=k+Math.imul(ke,$t)|0,y=y+Math.imul(ke,vt)|0,y=y+Math.imul(He,$t)|0,b=b+Math.imul(He,vt)|0,k=k+Math.imul(ge,zt)|0,y=y+Math.imul(ge,yt)|0,y=y+Math.imul(xe,zt)|0,b=b+Math.imul(xe,yt)|0,k=k+Math.imul(ne,qt)|0,y=y+Math.imul(ne,pt)|0,y=y+Math.imul(D,qt)|0,b=b+Math.imul(D,pt)|0,k=k+Math.imul(le,Yt)|0,y=y+Math.imul(le,bt)|0,y=y+Math.imul(Y,Yt)|0,b=b+Math.imul(Y,bt)|0,k=k+Math.imul(ce,Or)|0,y=y+Math.imul(ce,Vt)|0,y=y+Math.imul(de,Or)|0,b=b+Math.imul(de,Vt)|0;var Es=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Es>>>26)|0,Es&=67108863,k=Math.imul(J,dt),y=Math.imul(J,Ge),y=y+Math.imul(oe,dt)|0,b=Math.imul(oe,Ge),k=k+Math.imul(G,er)|0,y=y+Math.imul(G,Rt)|0,y=y+Math.imul($,er)|0,b=b+Math.imul($,Rt)|0,k=k+Math.imul(lt,Cr)|0,y=y+Math.imul(lt,ft)|0,y=y+Math.imul(Ue,Cr)|0,b=b+Math.imul(Ue,ft)|0,k=k+Math.imul(Ze,Ft)|0,y=y+Math.imul(Ze,ht)|0,y=y+Math.imul(Le,Ft)|0,b=b+Math.imul(Le,ht)|0,k=k+Math.imul(kt,$t)|0,y=y+Math.imul(kt,vt)|0,y=y+Math.imul(tt,$t)|0,b=b+Math.imul(tt,vt)|0,k=k+Math.imul(ke,zt)|0,y=y+Math.imul(ke,yt)|0,y=y+Math.imul(He,zt)|0,b=b+Math.imul(He,yt)|0,k=k+Math.imul(ge,qt)|0,y=y+Math.imul(ge,pt)|0,y=y+Math.imul(xe,qt)|0,b=b+Math.imul(xe,pt)|0,k=k+Math.imul(ne,Yt)|0,y=y+Math.imul(ne,bt)|0,y=y+Math.imul(D,Yt)|0,b=b+Math.imul(D,bt)|0,k=k+Math.imul(le,Or)|0,y=y+Math.imul(le,Vt)|0,y=y+Math.imul(Y,Or)|0,b=b+Math.imul(Y,Vt)|0;var Ia=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,k=Math.imul(J,er),y=Math.imul(J,Rt),y=y+Math.imul(oe,er)|0,b=Math.imul(oe,Rt),k=k+Math.imul(G,Cr)|0,y=y+Math.imul(G,ft)|0,y=y+Math.imul($,Cr)|0,b=b+Math.imul($,ft)|0,k=k+Math.imul(lt,Ft)|0,y=y+Math.imul(lt,ht)|0,y=y+Math.imul(Ue,Ft)|0,b=b+Math.imul(Ue,ht)|0,k=k+Math.imul(Ze,$t)|0,y=y+Math.imul(Ze,vt)|0,y=y+Math.imul(Le,$t)|0,b=b+Math.imul(Le,vt)|0,k=k+Math.imul(kt,zt)|0,y=y+Math.imul(kt,yt)|0,y=y+Math.imul(tt,zt)|0,b=b+Math.imul(tt,yt)|0,k=k+Math.imul(ke,qt)|0,y=y+Math.imul(ke,pt)|0,y=y+Math.imul(He,qt)|0,b=b+Math.imul(He,pt)|0,k=k+Math.imul(ge,Yt)|0,y=y+Math.imul(ge,bt)|0,y=y+Math.imul(xe,Yt)|0,b=b+Math.imul(xe,bt)|0,k=k+Math.imul(ne,Or)|0,y=y+Math.imul(ne,Vt)|0,y=y+Math.imul(D,Or)|0,b=b+Math.imul(D,Vt)|0;var Ta=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,k=Math.imul(J,Cr),y=Math.imul(J,ft),y=y+Math.imul(oe,Cr)|0,b=Math.imul(oe,ft),k=k+Math.imul(G,Ft)|0,y=y+Math.imul(G,ht)|0,y=y+Math.imul($,Ft)|0,b=b+Math.imul($,ht)|0,k=k+Math.imul(lt,$t)|0,y=y+Math.imul(lt,vt)|0,y=y+Math.imul(Ue,$t)|0,b=b+Math.imul(Ue,vt)|0,k=k+Math.imul(Ze,zt)|0,y=y+Math.imul(Ze,yt)|0,y=y+Math.imul(Le,zt)|0,b=b+Math.imul(Le,yt)|0,k=k+Math.imul(kt,qt)|0,y=y+Math.imul(kt,pt)|0,y=y+Math.imul(tt,qt)|0,b=b+Math.imul(tt,pt)|0,k=k+Math.imul(ke,Yt)|0,y=y+Math.imul(ke,bt)|0,y=y+Math.imul(He,Yt)|0,b=b+Math.imul(He,bt)|0,k=k+Math.imul(ge,Or)|0,y=y+Math.imul(ge,Vt)|0,y=y+Math.imul(xe,Or)|0,b=b+Math.imul(xe,Vt)|0;var Ss=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,k=Math.imul(J,Ft),y=Math.imul(J,ht),y=y+Math.imul(oe,Ft)|0,b=Math.imul(oe,ht),k=k+Math.imul(G,$t)|0,y=y+Math.imul(G,vt)|0,y=y+Math.imul($,$t)|0,b=b+Math.imul($,vt)|0,k=k+Math.imul(lt,zt)|0,y=y+Math.imul(lt,yt)|0,y=y+Math.imul(Ue,zt)|0,b=b+Math.imul(Ue,yt)|0,k=k+Math.imul(Ze,qt)|0,y=y+Math.imul(Ze,pt)|0,y=y+Math.imul(Le,qt)|0,b=b+Math.imul(Le,pt)|0,k=k+Math.imul(kt,Yt)|0,y=y+Math.imul(kt,bt)|0,y=y+Math.imul(tt,Yt)|0,b=b+Math.imul(tt,bt)|0,k=k+Math.imul(ke,Or)|0,y=y+Math.imul(ke,Vt)|0,y=y+Math.imul(He,Or)|0,b=b+Math.imul(He,Vt)|0;var $o=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+($o>>>26)|0,$o&=67108863,k=Math.imul(J,$t),y=Math.imul(J,vt),y=y+Math.imul(oe,$t)|0,b=Math.imul(oe,vt),k=k+Math.imul(G,zt)|0,y=y+Math.imul(G,yt)|0,y=y+Math.imul($,zt)|0,b=b+Math.imul($,yt)|0,k=k+Math.imul(lt,qt)|0,y=y+Math.imul(lt,pt)|0,y=y+Math.imul(Ue,qt)|0,b=b+Math.imul(Ue,pt)|0,k=k+Math.imul(Ze,Yt)|0,y=y+Math.imul(Ze,bt)|0,y=y+Math.imul(Le,Yt)|0,b=b+Math.imul(Le,bt)|0,k=k+Math.imul(kt,Or)|0,y=y+Math.imul(kt,Vt)|0,y=y+Math.imul(tt,Or)|0,b=b+Math.imul(tt,Vt)|0;var Do=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Do>>>26)|0,Do&=67108863,k=Math.imul(J,zt),y=Math.imul(J,yt),y=y+Math.imul(oe,zt)|0,b=Math.imul(oe,yt),k=k+Math.imul(G,qt)|0,y=y+Math.imul(G,pt)|0,y=y+Math.imul($,qt)|0,b=b+Math.imul($,pt)|0,k=k+Math.imul(lt,Yt)|0,y=y+Math.imul(lt,bt)|0,y=y+Math.imul(Ue,Yt)|0,b=b+Math.imul(Ue,bt)|0,k=k+Math.imul(Ze,Or)|0,y=y+Math.imul(Ze,Vt)|0,y=y+Math.imul(Le,Or)|0,b=b+Math.imul(Le,Vt)|0;var Qn=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,k=Math.imul(J,qt),y=Math.imul(J,pt),y=y+Math.imul(oe,qt)|0,b=Math.imul(oe,pt),k=k+Math.imul(G,Yt)|0,y=y+Math.imul(G,bt)|0,y=y+Math.imul($,Yt)|0,b=b+Math.imul($,bt)|0,k=k+Math.imul(lt,Or)|0,y=y+Math.imul(lt,Vt)|0,y=y+Math.imul(Ue,Or)|0,b=b+Math.imul(Ue,Vt)|0;var ka=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(ka>>>26)|0,ka&=67108863,k=Math.imul(J,Yt),y=Math.imul(J,bt),y=y+Math.imul(oe,Yt)|0,b=Math.imul(oe,bt),k=k+Math.imul(G,Or)|0,y=y+Math.imul(G,Vt)|0,y=y+Math.imul($,Or)|0,b=b+Math.imul($,Vt)|0;var Pa=(S+k|0)+((y&8191)<<13)|0;S=(b+(y>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,k=Math.imul(J,Or),y=Math.imul(J,Vt),y=y+Math.imul(oe,Or)|0,b=Math.imul(oe,Vt);var Ra=(S+k|0)+((y&8191)<<13)|0;return S=(b+(y>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,P[0]=ar,P[1]=Mi,P[2]=Oi,P[3]=$i,P[4]=Di,P[5]=Li,P[6]=kn,P[7]=As,P[8]=Sa,P[9]=Es,P[10]=Ia,P[11]=Ta,P[12]=Ss,P[13]=$o,P[14]=Do,P[15]=Qn,P[16]=ka,P[17]=Pa,P[18]=Ra,S!==0&&(P[19]=S,m.length++),m};Math.imul||(R=x);function M(B,_,p){p.negative=_.negative^B.negative,p.length=B.length+_.length;for(var m=0,w=0,A=0;A>>26)|0,w+=P>>>26,P&=67108863}p.words[A]=S,m=P,P=w}return m!==0?p.words[A]=m:p.length--,p.strip()}function N(B,_,p){var m=new E;return m.mulp(B,_,p)}s.prototype.mulTo=function(_,p){var m,w=this.length+_.length;return this.length===10&&_.length===10?m=R(this,_,p):w<63?m=x(this,_,p):w<1024?m=M(this,_,p):m=N(this,_,p),m};function E(B,_){this.x=B,this.y=_}E.prototype.makeRBT=function(_){for(var p=new Array(_),m=s.prototype._countBits(_)-1,w=0;w<_;w++)p[w]=this.revBin(w,m,_);return p},E.prototype.revBin=function(_,p,m){if(_===0||_===m-1)return _;for(var w=0,A=0;A>=1;return w},E.prototype.permute=function(_,p,m,w,A,P){for(var S=0;S>>1)A++;return 1<>>13,m[2*P+1]=A&8191,A=A>>>13;for(P=2*p;P>=26,p+=w/67108864|0,p+=A>>>26,this.words[m]=A&67108863}return p!==0&&(this.words[m]=p,this.length++),this},s.prototype.muln=function(_){return this.clone().imuln(_)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(_){var p=v(_);if(p.length===0)return new s(1);for(var m=this,w=0;w=0);var p=_%26,m=(_-p)/26,w=67108863>>>26-p<<26-p,A;if(p!==0){var P=0;for(A=0;A>>26-p}P&&(this.words[A]=P,this.length++)}if(m!==0){for(A=this.length-1;A>=0;A--)this.words[A+m]=this.words[A];for(A=0;A=0);var w;p?w=(p-p%26)/26:w=0;var A=_%26,P=Math.min((_-A)/26,this.length),S=67108863^67108863>>>A<P)for(this.length-=P,y=0;y=0&&(b!==0||y>=w);y--){var V=this.words[y]|0;this.words[y]=b<<26-A|V>>>A,b=V&S}return k&&b!==0&&(k.words[k.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(_,p,m){return n(this.negative===0),this.iushrn(_,p,m)},s.prototype.shln=function(_){return this.clone().ishln(_)},s.prototype.ushln=function(_){return this.clone().iushln(_)},s.prototype.shrn=function(_){return this.clone().ishrn(_)},s.prototype.ushrn=function(_){return this.clone().iushrn(_)},s.prototype.testn=function(_){n(typeof _=="number"&&_>=0);var p=_%26,m=(_-p)/26,w=1<=0);var p=_%26,m=(_-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(p!==0&&m++,this.length=Math.min(m,this.length),p!==0){var w=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(_){if(n(typeof _=="number"),n(_<67108864),_<0)return this.iaddn(-_);if(this.negative!==0)return this.negative=0,this.iaddn(_),this.negative=1,this;if(this.words[0]-=_,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(k/67108864|0),this.words[A+m]=P&67108863}for(;A>26,this.words[A+m]=P&67108863;if(S===0)return this.strip();for(n(S===-1),S=0,A=0;A>26,this.words[A]=P&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(_,p){var m=this.length-_.length,w=this.clone(),A=_,P=A.words[A.length-1]|0,S=this._countBits(P);m=26-S,m!==0&&(A=A.ushln(m),w.iushln(m),P=A.words[A.length-1]|0);var k=w.length-A.length,y;if(p!=="mod"){y=new s(null),y.length=k+1,y.words=new Array(y.length);for(var b=0;b=0;ce--){var de=(w.words[A.length+ce]|0)*67108864+(w.words[A.length+ce-1]|0);for(de=Math.min(de/P|0,67108863),w._ishlnsubmul(A,de,ce);w.negative!==0;)de--,w.negative=0,w._ishlnsubmul(A,1,ce),w.isZero()||(w.negative^=1);y&&(y.words[ce]=de)}return y&&y.strip(),w.strip(),p!=="div"&&m!==0&&w.iushrn(m),{div:y||null,mod:w}},s.prototype.divmod=function(_,p,m){if(n(!_.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,A,P;return this.negative!==0&&_.negative===0?(P=this.neg().divmod(_,p),p!=="mod"&&(w=P.div.neg()),p!=="div"&&(A=P.mod.neg(),m&&A.negative!==0&&A.iadd(_)),{div:w,mod:A}):this.negative===0&&_.negative!==0?(P=this.divmod(_.neg(),p),p!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&_.negative?(P=this.neg().divmod(_.neg(),p),p!=="div"&&(A=P.mod.neg(),m&&A.negative!==0&&A.isub(_)),{div:P.div,mod:A}):_.length>this.length||this.cmp(_)<0?{div:new s(0),mod:this}:_.length===1?p==="div"?{div:this.divn(_.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modn(_.words[0]))}:{div:this.divn(_.words[0]),mod:new s(this.modn(_.words[0]))}:this._wordDiv(_,p)},s.prototype.div=function(_){return this.divmod(_,"div",!1).div},s.prototype.mod=function(_){return this.divmod(_,"mod",!1).mod},s.prototype.umod=function(_){return this.divmod(_,"mod",!0).mod},s.prototype.divRound=function(_){var p=this.divmod(_);if(p.mod.isZero())return p.div;var m=p.div.negative!==0?p.mod.isub(_):p.mod,w=_.ushrn(1),A=_.andln(1),P=m.cmp(w);return P<0||A===1&&P===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modn=function(_){n(_<=67108863);for(var p=(1<<26)%_,m=0,w=this.length-1;w>=0;w--)m=(p*m+(this.words[w]|0))%_;return m},s.prototype.idivn=function(_){n(_<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var w=(this.words[m]|0)+p*67108864;this.words[m]=w/_|0,p=w%_}return this.strip()},s.prototype.divn=function(_){return this.clone().idivn(_)},s.prototype.egcd=function(_){n(_.negative===0),n(!_.isZero());var p=this,m=_.clone();p.negative!==0?p=p.umod(_):p=p.clone();for(var w=new s(1),A=new s(0),P=new s(0),S=new s(1),k=0;p.isEven()&&m.isEven();)p.iushrn(1),m.iushrn(1),++k;for(var y=m.clone(),b=p.clone();!p.isZero();){for(var V=0,ce=1;!(p.words[0]&ce)&&V<26;++V,ce<<=1);if(V>0)for(p.iushrn(V);V-- >0;)(w.isOdd()||A.isOdd())&&(w.iadd(y),A.isub(b)),w.iushrn(1),A.iushrn(1);for(var de=0,W=1;!(m.words[0]&W)&&de<26;++de,W<<=1);if(de>0)for(m.iushrn(de);de-- >0;)(P.isOdd()||S.isOdd())&&(P.iadd(y),S.isub(b)),P.iushrn(1),S.iushrn(1);p.cmp(m)>=0?(p.isub(m),w.isub(P),A.isub(S)):(m.isub(p),P.isub(w),S.isub(A))}return{a:P,b:S,gcd:m.iushln(k)}},s.prototype._invmp=function(_){n(_.negative===0),n(!_.isZero());var p=this,m=_.clone();p.negative!==0?p=p.umod(_):p=p.clone();for(var w=new s(1),A=new s(0),P=m.clone();p.cmpn(1)>0&&m.cmpn(1)>0;){for(var S=0,k=1;!(p.words[0]&k)&&S<26;++S,k<<=1);if(S>0)for(p.iushrn(S);S-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var y=0,b=1;!(m.words[0]&b)&&y<26;++y,b<<=1);if(y>0)for(m.iushrn(y);y-- >0;)A.isOdd()&&A.iadd(P),A.iushrn(1);p.cmp(m)>=0?(p.isub(m),w.isub(A)):(m.isub(p),A.isub(w))}var V;return p.cmpn(1)===0?V=w:V=A,V.cmpn(0)<0&&V.iadd(_),V},s.prototype.gcd=function(_){if(this.isZero())return _.abs();if(_.isZero())return this.abs();var p=this.clone(),m=_.clone();p.negative=0,m.negative=0;for(var w=0;p.isEven()&&m.isEven();w++)p.iushrn(1),m.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;m.isEven();)m.iushrn(1);var A=p.cmp(m);if(A<0){var P=p;p=m,m=P}else if(A===0||m.cmpn(1)===0)break;p.isub(m)}while(!0);return m.iushln(w)},s.prototype.invm=function(_){return this.egcd(_).a.umod(_)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(_){return this.words[0]&_},s.prototype.bincn=function(_){n(typeof _=="number");var p=_%26,m=(_-p)/26,w=1<>>26,S&=67108863,this.words[P]=S}return A!==0&&(this.words[P]=A,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(_){var p=_<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var m;if(this.length>1)m=1;else{p&&(_=-_),n(_<=67108863,"Number is too big");var w=this.words[0]|0;m=w===_?0:w<_?-1:1}return this.negative!==0?-m|0:m},s.prototype.cmp=function(_){if(this.negative!==0&&_.negative===0)return-1;if(this.negative===0&&_.negative!==0)return 1;var p=this.ucmp(_);return this.negative!==0?-p|0:p},s.prototype.ucmp=function(_){if(this.length>_.length)return 1;if(this.length<_.length)return-1;for(var p=0,m=this.length-1;m>=0;m--){var w=this.words[m]|0,A=_.words[m]|0;if(w!==A){wA&&(p=1);break}}return p},s.prototype.gtn=function(_){return this.cmpn(_)===1},s.prototype.gt=function(_){return this.cmp(_)===1},s.prototype.gten=function(_){return this.cmpn(_)>=0},s.prototype.gte=function(_){return this.cmp(_)>=0},s.prototype.ltn=function(_){return this.cmpn(_)===-1},s.prototype.lt=function(_){return this.cmp(_)===-1},s.prototype.lten=function(_){return this.cmpn(_)<=0},s.prototype.lte=function(_){return this.cmp(_)<=0},s.prototype.eqn=function(_){return this.cmpn(_)===0},s.prototype.eq=function(_){return this.cmp(_)===0},s.red=function(_){return new F(_)},s.prototype.toRed=function(_){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),_.convertTo(this)._forceRed(_)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(_){return this.red=_,this},s.prototype.forceRed=function(_){return n(!this.red,"Already a number in reduction context"),this._forceRed(_)},s.prototype.redAdd=function(_){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,_)},s.prototype.redIAdd=function(_){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,_)},s.prototype.redSub=function(_){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,_)},s.prototype.redISub=function(_){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,_)},s.prototype.redShl=function(_){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,_)},s.prototype.redMul=function(_){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.mul(this,_)},s.prototype.redIMul=function(_){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.imul(this,_)},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(_){return n(this.red&&!_.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,_)};var O={k256:null,p224:null,p192:null,p25519:null};function L(B,_){this.name=B,this.p=new s(_,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 _=new s(null);return _.words=new Array(Math.ceil(this.n/13)),_},L.prototype.ireduce=function(_){var p=_,m;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),m=p.bitLength();while(m>this.n);var w=m0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},L.prototype.split=function(_,p){_.iushrn(this.n,0,p)},L.prototype.imulK=function(_){return _.imul(this.k)};function U(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(U,L),U.prototype.split=function(_,p){for(var m=4194303,w=Math.min(_.length,9),A=0;A>>22,P=S}P>>>=22,_.words[A-10]=P,P===0&&_.length>10?_.length-=10:_.length-=9},U.prototype.imulK=function(_){_.words[_.length]=0,_.words[_.length+1]=0,_.length+=2;for(var p=0,m=0;m<_.length;m++){var w=_.words[m]|0;p+=w*977,_.words[m]=p&67108863,p=w*64+(p/67108864|0)}return _.words[_.length-1]===0&&(_.length--,_.words[_.length-1]===0&&_.length--),_};function H(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(H,L);function I(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(I,L);function T(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(T,L),T.prototype.imulK=function(_){for(var p=0,m=0;m<_.length;m++){var w=(_.words[m]|0)*19+p,A=w&67108863;w>>>=26,_.words[m]=A,p=w}return p!==0&&(_.words[_.length++]=p),_},s._prime=function(_){if(O[_])return O[_];var p;if(_==="k256")p=new U;else if(_==="p224")p=new H;else if(_==="p192")p=new I;else if(_==="p25519")p=new T;else throw new Error("Unknown prime "+_);return O[_]=p,p};function F(B){if(typeof B=="string"){var _=s._prime(B);this.m=_.p,this.prime=_}else n(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}F.prototype._verify1=function(_){n(_.negative===0,"red works only with positives"),n(_.red,"red works only with red numbers")},F.prototype._verify2=function(_,p){n((_.negative|p.negative)===0,"red works only with positives"),n(_.red&&_.red===p.red,"red works only with red numbers")},F.prototype.imod=function(_){return this.prime?this.prime.ireduce(_)._forceRed(this):_.umod(this.m)._forceRed(this)},F.prototype.neg=function(_){return _.isZero()?_.clone():this.m.sub(_)._forceRed(this)},F.prototype.add=function(_,p){this._verify2(_,p);var m=_.add(p);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},F.prototype.iadd=function(_,p){this._verify2(_,p);var m=_.iadd(p);return m.cmp(this.m)>=0&&m.isub(this.m),m},F.prototype.sub=function(_,p){this._verify2(_,p);var m=_.sub(p);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},F.prototype.isub=function(_,p){this._verify2(_,p);var m=_.isub(p);return m.cmpn(0)<0&&m.iadd(this.m),m},F.prototype.shl=function(_,p){return this._verify1(_),this.imod(_.ushln(p))},F.prototype.imul=function(_,p){return this._verify2(_,p),this.imod(_.imul(p))},F.prototype.mul=function(_,p){return this._verify2(_,p),this.imod(_.mul(p))},F.prototype.isqr=function(_){return this.imul(_,_.clone())},F.prototype.sqr=function(_){return this.mul(_,_)},F.prototype.sqrt=function(_){if(_.isZero())return _.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(_,m)}for(var w=this.m.subn(1),A=0;!w.isZero()&&w.andln(1)===0;)A++,w.iushrn(1);n(!w.isZero());var P=new s(1).toRed(this),S=P.redNeg(),k=this.m.subn(1).iushrn(1),y=this.m.bitLength();for(y=new s(2*y*y).toRed(this);this.pow(y,k).cmp(S)!==0;)y.redIAdd(S);for(var b=this.pow(y,w),V=this.pow(_,w.addn(1).iushrn(1)),ce=this.pow(_,w),de=A;ce.cmp(P)!==0;){for(var W=ce,le=0;W.cmp(P)!==0;le++)W=W.redSqr();n(le=0;A--){for(var b=p.words[A],V=y-1;V>=0;V--){var ce=b>>V&1;if(P!==w[0]&&(P=this.sqr(P)),ce===0&&S===0){k=0;continue}S<<=1,S|=ce,k++,!(k!==m&&(A!==0||V!==0))&&(P=this.mul(P,w[S]),k=0,S=0)}y=26}return P},F.prototype.convertTo=function(_){var p=_.umod(this.m);return p===_?p.clone():p},F.prototype.convertFrom=function(_){var p=_.clone();return p.red=null,p},s.mont=function(_){return new K(_)};function K(B){F.call(this,B),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,F),K.prototype.convertTo=function(_){return this.imod(_.ushln(this.shift))},K.prototype.convertFrom=function(_){var p=this.imod(_.mul(this.rinv));return p.red=null,p},K.prototype.imul=function(_,p){if(_.isZero()||p.isZero())return _.words[0]=0,_.length=1,_;var m=_.imul(p),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=m.isub(w).iushrn(this.shift),P=A;return A.cmp(this.m)>=0?P=A.isub(this.m):A.cmpn(0)<0&&(P=A.iadd(this.m)),P._forceRed(this)},K.prototype.mul=function(_,p){if(_.isZero()||p.isZero())return new s(0)._forceRed(this);var m=_.mul(p),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=m.isub(w).iushrn(this.shift),P=A;return A.cmp(this.m)>=0?P=A.isub(this.m):A.cmpn(0)<0&&(P=A.iadd(this.m)),P._forceRed(this)},K.prototype.invm=function(_){var p=this.imod(_._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,Gi)})(mE);var Vu=mE.exports,P0=LB;function LB(t,e){if(!t)throw new Error(e||"Assertion failed")}LB.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var wE={};(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,h=l&255;d?a.push(d,h):a.push(h)}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(R>>1)-1?N=(R>>1)-E:N=E,M.isubn(N)):N=0,v[x]=N,M.iushrn(1)}return v}e.getNAF=s;function o(d,h){var g=[[],[]];d=d.clone(),h=h.clone();for(var v=0,x=0,R;d.cmpn(-v)>0||h.cmpn(-x)>0;){var M=d.andln(3)+v&3,N=h.andln(3)+x&3;M===3&&(M=-1),N===3&&(N=-1);var E;M&1?(R=d.andln(7)+v&7,(R===3||R===5)&&N===2?E=-M:E=M):E=0,g[0].push(E);var O;N&1?(R=h.andln(7)+x&7,(R===3||R===5)&&M===2?O=-N:O=N):O=0,g[1].push(O),2*v===E+1&&(v=1-v),2*x===O+1&&(x=1-x),d.iushrn(1),h.iushrn(1)}return g}e.getJSF=o;function a(d,h,g){var v="_"+h;d.prototype[h]=function(){return this[v]!==void 0?this[v]:this[v]=g.call(this)}}e.cachedProperty=a;function c(d){return typeof d=="string"?e.toArray(d,"hex"):d}e.parseBytes=c;function l(d){return new r(d,"hex","le")}e.intFromLE=l})(Ro);var vE={exports:{}},t9;vE.exports=function(e){return t9||(t9=new Dd(null)),t9.generate(e)};function Dd(t){this.rand=t}vE.exports.Rand=Dd;Dd.prototype.generate=function(e){return this._rand(e)};Dd.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 e4=If;If.prototype.point=function(){throw new Error("Not implemented")};If.prototype.validate=function(){throw new Error("Not implemented")};If.prototype._fixedNafMul=function(e,r){b5(e.precomputed);var n=e._getDoubles(),i=y5(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),g=s;g>0;g--){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 d=o[c];b5(d!==0),e.type==="affine"?d>0?a=a.mixedAdd(s[d-1>>1]):a=a.mixedAdd(s[-d-1>>1].neg()):d>0?a=a.add(s[d-1>>1]):a=a.add(s[-d-1>>1].neg())}return e.type==="affine"?a.toP():a};If.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,d,h,g;for(d=0;d=1;d-=2){var x=d-1,R=d;if(o[x]!==1||o[R]!==1){c[x]=y5(n[x],o[x],this._bitLength),c[R]=y5(n[R],o[R],this._bitLength),l=Math.max(c[x].length,l),l=Math.max(c[R].length,l);continue}var M=[r[x],null,null,r[R]];r[x].y.cmp(r[R].y)===0?(M[1]=r[x].add(r[R]),M[2]=r[x].toJ().mixedAdd(r[R].neg())):r[x].y.cmp(r[R].y.redNeg())===0?(M[1]=r[x].toJ().mixedAdd(r[R]),M[2]=r[x].add(r[R].neg())):(M[1]=r[x].toJ().mixedAdd(r[R]),M[2]=r[x].toJ().mixedAdd(r[R].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],E=pde(n[x],n[R]);for(l=Math.max(E[0].length,l),c[x]=new Array(l),c[R]=new Array(l),h=0;h=0;d--){for(var I=0;d>=0;){var T=!0;for(h=0;h=0&&I++,U=U.dblp(I),d<0)break;for(h=0;h0?g=a[h][F-1>>1]:F<0&&(g=a[h][-F-1>>1].neg()),g.type==="affine"?U=U.mixedAdd(g):U=U.add(g))}}for(d=0;d=Math.ceil((e.bitLength()+1)/r.step):!1};Ca.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&&(v=l,x=d),h.negative&&(h=h.neg(),g=g.neg()),v.negative&&(v=v.neg(),x=x.neg()),[{a:h,b:g},{a:v,b:x}]};Aa.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),d=o.mul(i.b),h=e.sub(a).sub(c),g=l.add(d).neg();return{k1:h,k2:g}};Aa.prototype.pointFromX=function(e,r){e=new $n(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)};Aa.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};Aa.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};bi.prototype.isInfinity=function(){return this.inf};bi.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)};bi.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)};bi.prototype.getX=function(){return this.x.fromRed()};bi.prototype.getY=function(){return this.y.fromRed()};bi.prototype.mul=function(e){return e=new $n(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)};bi.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)};bi.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)};bi.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)};bi.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};bi.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 Pi(t,e,r,n){dg.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new $n(0)):(this.x=new $n(e,16),this.y=new $n(r,16),this.z=new $n(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}bE(Pi,dg.BasePoint);Aa.prototype.jpoint=function(e,r,n){return new Pi(this,e,r,n)};Pi.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)};Pi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Pi.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 d=c.redSqr(),h=d.redMul(c),g=i.redMul(d),v=l.redSqr().redIAdd(h).redISub(g).redISub(g),x=l.redMul(g.redISub(v)).redISub(o.redMul(h)),R=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(v,x,R)};Pi.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(),d=l.redMul(a),h=n.redMul(l),g=c.redSqr().redIAdd(d).redISub(h).redISub(h),v=c.redMul(h.redISub(g)).redISub(s.redMul(d)),x=this.z.redMul(a);return this.curve.jpoint(g,v,x)};Pi.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}};Pi.prototype.inspect=function(){return this.isInfinity()?"":""};Pi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Np=Vu,UB=t4,r4=e4,vde=Ro;function fg(t){r4.call(this,"mont",t),this.a=new Np(t.a,16).toRed(this.red),this.b=new Np(t.b,16).toRed(this.red),this.i4=new Np(4).toRed(this.red).redInvm(),this.two=new Np(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}UB(fg,r4);var yde=fg;fg.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 yi(t,e,r){r4.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Np(e,16),this.z=new Np(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}UB(yi,r4.BasePoint);fg.prototype.decodePoint=function(e,r){return this.point(vde.toArray(e,r),1)};fg.prototype.point=function(e,r){return new yi(this,e,r)};fg.prototype.pointFromJSON=function(e){return yi.fromJSON(this,e)};yi.prototype.precompute=function(){};yi.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};yi.fromJSON=function(e,r){return new yi(e,r[0],r[1]||e.one)};yi.prototype.inspect=function(){return this.isInfinity()?"":""};yi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};yi.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)};yi.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};yi.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()),d=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(l,d)};yi.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};yi.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};yi.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};yi.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};yi.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};yi.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var bde=Ro,mu=Vu,jB=t4,n4=e4,xde=bde.assert;function Nl(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,n4.call(this,"edwards",t),this.a=new mu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new mu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new mu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),xde(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}jB(Nl,n4);var _de=Nl;Nl.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Nl.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Nl.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Nl.prototype.pointFromX=function(e,r){e=new mu(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)};Nl.prototype.pointFromY=function(e,r){e=new mu(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)};Nl.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 an(t,e,r,n,i){n4.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 mu(e,16),this.y=new mu(r,16),this.z=n?new mu(n,16):this.curve.one,this.t=i&&new mu(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()))))}jB(an,n4.BasePoint);Nl.prototype.pointFromJSON=function(e){return an.fromJSON(this,e)};Nl.prototype.point=function(e,r,n,i){return new an(this,e,r,n,i)};an.fromJSON=function(e,r){return new an(e,r[0],r[1],r[2])};an.prototype.inspect=function(){return this.isInfinity()?"":""};an.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};an.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),d=o.redMul(c),h=s.redMul(c),g=a.redMul(o);return this.curve.point(l,d,g,h)};an.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 d=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(d.redSub(this.curve.two)),s=d.redMul(a.redSub(n)),o=d.redSqr().redSub(d).redSub(d)):(c=this.z.redSqr(),l=d.redSub(c).redISub(c),i=e.redSub(r).redISub(n).redMul(l),s=d.redMul(a.redSub(n)),o=d.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)};an.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};an.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),d=o.redMul(a),h=c.redMul(l),g=o.redMul(l),v=a.redMul(c);return this.curve.point(d,h,v,g)};an.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),d=r.redMul(a).redMul(l),h,g;return this.curve.twisted?(h=r.redMul(c).redMul(s.redSub(this.curve._mulA(i))),g=a.redMul(c)):(h=r.redMul(c).redMul(s.redSub(i)),g=this.curve._mulC(a).redMul(c)),this.curve.point(d,h,g)};an.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};an.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};an.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};an.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};an.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};an.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};an.prototype.getX=function(){return this.normalize(),this.x.fromRed()};an.prototype.getY=function(){return this.normalize(),this.y.fromRed()};an.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};an.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}};an.prototype.toP=an.prototype.normalize;an.prototype.mixedAdd=an.prototype.add;(function(t){var e=t;e.base=e4,e.short=wde,e.mont=yde,e.edwards=_de})(yE);var i4={},s4={},Ir={},Cde=P0,Ade=t4;Ir.inherits=Ade;function Ede(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Sde(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):Ede(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}Ir.htonl=FB;function Tde(t,e){for(var r="",n=0;n>>0}return s}Ir.join32=kde;function Pde(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}Ir.split32=Pde;function Rde(t,e){return t>>>e|t<<32-e}Ir.rotr32=Rde;function Nde(t,e){return t<>>32-e}Ir.rotl32=Nde;function Mde(t,e){return t+e>>>0}Ir.sum32=Mde;function Ode(t,e,r){return t+e+r>>>0}Ir.sum32_3=Ode;function $de(t,e,r,n){return t+e+r+n>>>0}Ir.sum32_4=$de;function Dde(t,e,r,n,i){return t+e+r+n+i>>>0}Ir.sum32_5=Dde;function Lde(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Ir.sum64=Lde;function Bde(t,e,r,n){var i=e+n>>>0,s=(i>>0}Ir.sum64_hi=Bde;function Ude(t,e,r,n){var i=e+n;return i>>>0}Ir.sum64_lo=Ude;function jde(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}Ir.sum64_4_hi=jde;function Fde(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Ir.sum64_4_lo=Fde;function zde(t,e,r,n,i,s,o,a,c,l){var d=0,h=e;h=h+n>>>0,d+=h>>0,d+=h>>0,d+=h>>0,d+=h>>0}Ir.sum64_5_hi=zde;function Wde(t,e,r,n,i,s,o,a,c,l){var d=e+n+s+a+l;return d>>>0}Ir.sum64_5_lo=Wde;function Hde(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ir.rotr64_hi=Hde;function qde(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ir.rotr64_lo=qde;function Vde(t,e,r){return t>>>r}Ir.shr64_hi=Vde;function Kde(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ir.shr64_lo=Kde;var hg={},QP=Ir,Gde=P0;function o4(){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}hg.BlockHash=o4;o4.prototype.update=function(e,r){if(e=QP.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=QP.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}Ml.g0_256=Xde;function efe(t){return sl(t,17)^sl(t,19)^t>>>10}Ml.g1_256=efe;var O1=Ir,tfe=hg,rfe=Ml,r9=O1.rotl32,dm=O1.sum32,nfe=O1.sum32_5,ife=rfe.ft_1,KB=tfe.BlockHash,sfe=[1518500249,1859775393,2400959708,3395469782];function vl(){if(!(this instanceof vl))return new vl;KB.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}O1.inherits(vl,KB);var ofe=vl;vl.blockSize=512;vl.outSize=160;vl.hmacStrength=80;vl.padLength=64;vl.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()),Kfe(e.length<=this.blockSize);for(var r=e.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Yfe=uf;uf.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};uf.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=Sh.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var x5=Vu,xE=Ro,the=xE.assert;function a4(t,e){if(t instanceof a4)return t;this._importDER(t,e)||(the(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 rhe=a4;function nhe(){this.place=0}function o9(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 tR(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)}a4.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=tR(r),n=tR(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];a9(i,r.length),i=i.concat(r),i.push(2),a9(i,n.length);var s=i.concat(n),o=[48];return a9(o,s.length),o=o.concat(s),xE.encode(o,e)};var Ih=Vu,sU=Yfe,ihe=Ro,c9=i4,she=BB,oU=ihe.assert,_E=ehe,c4=rhe;function va(t){if(!(this instanceof va))return new va(t);typeof t=="string"&&(oU(Object.prototype.hasOwnProperty.call(c9,t),"Unknown curve "+t),t=c9[t]),t instanceof c9.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 ohe=va;va.prototype.keyPair=function(e){return new _E(this,e)};va.prototype.keyFromPrivate=function(e,r){return _E.fromPrivate(this,e,r)};va.prototype.keyFromPublic=function(e,r){return _E.fromPublic(this,e,r)};va.prototype.genKeyPair=function(e){e||(e={});for(var r=new sU({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||she(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ih(2));;){var s=new Ih(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};va.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};va.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 Ih(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new sU({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new Ih(1)),d=0;;d++){var h=i.k?i.k(d):new Ih(c.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(l)>=0)){var g=this.g.mul(h);if(!g.isInfinity()){var v=g.getX(),x=v.umod(this.n);if(x.cmpn(0)!==0){var R=h.invm(this.n).mul(x.mul(r.getPrivate()).iadd(e));if(R=R.umod(this.n),R.cmpn(0)!==0){var M=(g.getY().isOdd()?1:0)|(v.cmp(x)!==0?2:0);return i.canonical&&R.cmp(this.nh)>0&&(R=this.n.sub(R),M^=1),new c4({r:x,s:R,recoveryParam:M})}}}}}};va.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Ih(e,16)),n=this.keyFromPublic(n,i),r=new c4(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),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(c,n.getPublic(),l),d.isInfinity()?!1:d.eqXToP(s)):(d=this.g.mulAdd(c,n.getPublic(),l),d.isInfinity()?!1:d.getX().umod(this.n).cmp(s)===0)};va.prototype.recoverPubKey=function(t,e,r,n){oU((3&r)===r,"The recovery param is more than two bits"),e=new c4(e,n);var i=this.n,s=new Ih(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 d=e.r.invm(i),h=i.sub(s).mul(d).umod(i),g=a.mul(d).umod(i);return this.g.mulAdd(h,o,g)};va.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new c4(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 v2=Ro,aU=v2.assert,rR=v2.parseBytes,mg=v2.cachedProperty;function vi(t,e){this.eddsa=t,this._secret=rR(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=rR(e.pub)}vi.fromPublic=function(e,r){return r instanceof vi?r:new vi(e,{pub:r})};vi.fromSecret=function(e,r){return r instanceof vi?r:new vi(e,{secret:r})};vi.prototype.secret=function(){return this._secret};mg(vi,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});mg(vi,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});mg(vi,"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});mg(vi,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});mg(vi,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});mg(vi,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});vi.prototype.sign=function(e){return aU(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};vi.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};vi.prototype.getSecret=function(e){return aU(this._secret,"KeyPair is public only"),v2.encode(this.secret(),e)};vi.prototype.getPublic=function(e){return v2.encode(this.pubBytes(),e)};var ahe=vi,che=Vu,l4=Ro,nR=l4.assert,u4=l4.cachedProperty,lhe=l4.parseBytes;function R0(t,e){this.eddsa=t,typeof e!="object"&&(e=lhe(e)),Array.isArray(e)&&(nR(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),nR(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof che&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}u4(R0,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});u4(R0,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});u4(R0,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});u4(R0,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});R0.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};R0.prototype.toHex=function(){return l4.encode(this.toBytes(),"hex").toUpperCase()};var uhe=R0,dhe=s4,fhe=i4,L1=Ro,hhe=L1.assert,cU=L1.parseBytes,lU=ahe,iR=uhe;function Zs(t){if(hhe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Zs))return new Zs(t);t=fhe[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=dhe.sha512}var phe=Zs;Zs.prototype.sign=function(e,r){e=cU(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})};Zs.prototype.verify=function(e,r,n){if(e=cU(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)};Zs.prototype.hashInt=function(){for(var e=this.hash(),r=0;re in t?whe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aR=(t,e)=>{for(var r in e||(e={}))vhe.call(e,r)&&oR(t,r,e[r]);if(sR)for(var r of sR(e))yhe.call(e,r)&&oR(t,r,e[r]);return t};const bhe="ReactNative",po={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},xhe="js";function cv(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function wg(){return!J6()&&!!dE()&&navigator.product===bhe}function y2(){return!cv()&&!!dE()&&!!J6()}function b2(){return wg()?po.reactNative:cv()?po.node:y2()?po.browser:po.unknown}function _he(){var t;try{return wg()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Che(t,e){let r=av.parse(t);return r=aR(aR({},r),e),t=av.stringify(r),t}function Ahe(){return kB()||{name:"",description:"",url:"",icons:[""]}}function Ehe(){if(b2()===po.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=wue();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 She(){var t;const e=b2();return e===po.browser?[e,((t=TB())==null?void 0:t.host)||"unknown"].join(":"):e}function Ihe(t,e,r){const n=Ehe(),i=She();return[[t,e].join("-"),[xhe,r].join("-"),n,i].join("/")}function The({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=Ihe(t,e,n),d={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},h=Che(c[1]||"",d);return c[0]+"?"+h}function ph(t,e){return t.filter(r=>e.includes(r)).length===t.length}function dU(t){return Object.fromEntries(t.entries())}function fU(t){return new Map(Object.entries(t))}function oh(t=Ye.FIVE_MINUTES,e){const r=Ye.toMiliseconds(t||Ye.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 Kp(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 hU(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 khe(t){return hU("topic",t)}function Phe(t){return hU("id",t)}function pU(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function ei(t,e){return Ye.fromMiliseconds(Date.now()+Ye.toMiliseconds(t))}function wd(t){return Date.now()>=Ye.toMiliseconds(t)}function xr(t,e){return`${t}${e?`:${e}`:""}`}function nb(t=[],e=[]){return[...new Set([...t,...e])]}async function Rhe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r;let s=i==null?void 0:i.href;if(typeof s!="string")return;s.endsWith("/")&&(s=s.slice(0,-1));const o=`${s}/wc?requestId=${t}&sessionTopic=${e}`,a=b2();if(a===po.browser){if(!((n=J6())!=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,"_self","noreferrer noopener")}else a===po.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}async function Nhe(t,e){try{return await t.getItem(e)||(y2()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}function cR(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Mhe(){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)})}var gU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ohe(t){var e=t.default;if(typeof e=="function"){var r=function(){return 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 mU={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=PU: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(""),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],g=[1,256,65536,16777216],v=[6,1536,393216,100663296],x=[0,8,16,24],P=[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],M=[224,256,384,512],N=[128,256],E=["hex","buffer","arrayBuffer","array","digest"],$={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});for(var L=function(W,ue,J){return function(ne){return new V(W,ue,W).update(ne)[J]()}},j=function(W,ue,J){return function(ne,ie){return new V(W,ue,ie).update(ne)[J]()}},H=function(W,ue,J){return function(ne,ie,D,te){return m["cshake"+W].update(ne,ie,D,te)[J]()}},I=function(W,ue,J){return function(ne,ie,D,te){return m["kmac"+W].update(ne,ie,D,te)[J]()}},T=function(W,ue,J,ne){for(var ie=0;ie>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var ne=0;ne<50;++ne)this.s[ne]=0}V.prototype.update=function(W){if(this.finalized)throw new Error(r);var ue,J=typeof W;if(J!=="string"){if(J==="object"){if(W===null)throw new Error(e);if(c&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!c||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);ue=!0}for(var ne=this.blocks,ie=this.byteCount,D=W.length,te=this.blockCount,me=0,Ce=this.s,Ee,Re;me>2]|=W[me]<>2]|=Re<>2]|=(192|Re>>6)<>2]|=(128|Re&63)<=57344?(ne[Ee>>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)<=ie){for(this.start=Ee-ie,this.block=ne[te],Ee=0;Ee>8,J=W&255;J>0;)ie.unshift(J),W=W>>8,J=W&255,++ne;return ue?ie.push(ne):ie.unshift(ne),this.update(ie),ie.length},V.prototype.encodeString=function(W){var ue,J=typeof W;if(J!=="string"){if(J==="object"){if(W===null)throw new Error(e);if(c&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!c||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);ue=!0}var ne=0,ie=W.length;if(ue)ne=ie;else for(var D=0;D=57344?ne+=3:(te=65536+((te&1023)<<10|W.charCodeAt(++D)&1023),ne+=4)}return ne+=this.encode(ne*8),this.update(W),ne},V.prototype.bytepad=function(W,ue){for(var J=this.encode(ue),ne=0;ne>2]|=this.padding[ue&3],this.lastByteIndex===this.byteCount)for(W[0]=W[J],ue=1;ue>4&15]+l[me&15]+l[me>>12&15]+l[me>>8&15]+l[me>>20&15]+l[me>>16&15]+l[me>>28&15]+l[me>>24&15];D%W===0&&(fe(ue),ie=0)}return ne&&(me=ue[ie],te+=l[me>>4&15]+l[me&15],ne>1&&(te+=l[me>>12&15]+l[me>>8&15]),ne>2&&(te+=l[me>>20&15]+l[me>>16&15])),te},V.prototype.arrayBuffer=function(){this.finalize();var W=this.blockCount,ue=this.s,J=this.outputBlocks,ne=this.extraBytes,ie=0,D=0,te=this.outputBits>>3,me;ne?me=new ArrayBuffer(J+1<<2):me=new ArrayBuffer(te);for(var Ce=new Uint32Array(me);D>8&255,te[me+2]=Ce>>16&255,te[me+3]=Ce>>24&255;D%W===0&&fe(ue)}return ne&&(me=D<<2,Ce=ue[ie],te[me]=Ce&255,ne>1&&(te[me+1]=Ce>>8&255),ne>2&&(te[me+2]=Ce>>16&255)),te};function ce(W,ue,J){V.call(this,W,ue,J)}ce.prototype=new V,ce.prototype.finalize=function(){return this.encode(this.outputBits,!0),V.prototype.finalize.call(this)};var fe=function(W){var ue,J,ne,ie,D,te,me,Ce,Ee,Re,He,Xe,kt,rt,st,Ze,Be,nt,lt,je,at,G,O,z,X,ae,he,be,Ne,Ve,dt,Ge,wt,er,Pt,yr,_r,ft,$t,Ft,ht,Bt,Ot,vt,Qt,zt,yt,Wt,qt,pt,Nt,Yt,bt,Mr,$r,Vt,ar,Oi,Di,Li,Bi,Ui,Pn;for(ne=0;ne<48;ne+=2)ie=W[0]^W[10]^W[20]^W[30]^W[40],D=W[1]^W[11]^W[21]^W[31]^W[41],te=W[2]^W[12]^W[22]^W[32]^W[42],me=W[3]^W[13]^W[23]^W[33]^W[43],Ce=W[4]^W[14]^W[24]^W[34]^W[44],Ee=W[5]^W[15]^W[25]^W[35]^W[45],Re=W[6]^W[16]^W[26]^W[36]^W[46],He=W[7]^W[17]^W[27]^W[37]^W[47],Xe=W[8]^W[18]^W[28]^W[38]^W[48],kt=W[9]^W[19]^W[29]^W[39]^W[49],ue=Xe^(te<<1|me>>>31),J=kt^(me<<1|te>>>31),W[0]^=ue,W[1]^=J,W[10]^=ue,W[11]^=J,W[20]^=ue,W[21]^=J,W[30]^=ue,W[31]^=J,W[40]^=ue,W[41]^=J,ue=ie^(Ce<<1|Ee>>>31),J=D^(Ee<<1|Ce>>>31),W[2]^=ue,W[3]^=J,W[12]^=ue,W[13]^=J,W[22]^=ue,W[23]^=J,W[32]^=ue,W[33]^=J,W[42]^=ue,W[43]^=J,ue=te^(Re<<1|He>>>31),J=me^(He<<1|Re>>>31),W[4]^=ue,W[5]^=J,W[14]^=ue,W[15]^=J,W[24]^=ue,W[25]^=J,W[34]^=ue,W[35]^=J,W[44]^=ue,W[45]^=J,ue=Ce^(Xe<<1|kt>>>31),J=Ee^(kt<<1|Xe>>>31),W[6]^=ue,W[7]^=J,W[16]^=ue,W[17]^=J,W[26]^=ue,W[27]^=J,W[36]^=ue,W[37]^=J,W[46]^=ue,W[47]^=J,ue=Re^(ie<<1|D>>>31),J=He^(D<<1|ie>>>31),W[8]^=ue,W[9]^=J,W[18]^=ue,W[19]^=J,W[28]^=ue,W[29]^=J,W[38]^=ue,W[39]^=J,W[48]^=ue,W[49]^=J,rt=W[0],st=W[1],zt=W[11]<<4|W[10]>>>28,yt=W[10]<<4|W[11]>>>28,be=W[20]<<3|W[21]>>>29,Ne=W[21]<<3|W[20]>>>29,Li=W[31]<<9|W[30]>>>23,Bi=W[30]<<9|W[31]>>>23,Bt=W[40]<<18|W[41]>>>14,Ot=W[41]<<18|W[40]>>>14,er=W[2]<<1|W[3]>>>31,Pt=W[3]<<1|W[2]>>>31,Ze=W[13]<<12|W[12]>>>20,Be=W[12]<<12|W[13]>>>20,Wt=W[22]<<10|W[23]>>>22,qt=W[23]<<10|W[22]>>>22,Ve=W[33]<<13|W[32]>>>19,dt=W[32]<<13|W[33]>>>19,Ui=W[42]<<2|W[43]>>>30,Pn=W[43]<<2|W[42]>>>30,Mr=W[5]<<30|W[4]>>>2,$r=W[4]<<30|W[5]>>>2,yr=W[14]<<6|W[15]>>>26,_r=W[15]<<6|W[14]>>>26,nt=W[25]<<11|W[24]>>>21,lt=W[24]<<11|W[25]>>>21,pt=W[34]<<15|W[35]>>>17,Nt=W[35]<<15|W[34]>>>17,Ge=W[45]<<29|W[44]>>>3,wt=W[44]<<29|W[45]>>>3,z=W[6]<<28|W[7]>>>4,X=W[7]<<28|W[6]>>>4,Vt=W[17]<<23|W[16]>>>9,ar=W[16]<<23|W[17]>>>9,ft=W[26]<<25|W[27]>>>7,$t=W[27]<<25|W[26]>>>7,je=W[36]<<21|W[37]>>>11,at=W[37]<<21|W[36]>>>11,Yt=W[47]<<24|W[46]>>>8,bt=W[46]<<24|W[47]>>>8,vt=W[8]<<27|W[9]>>>5,Qt=W[9]<<27|W[8]>>>5,ae=W[18]<<20|W[19]>>>12,he=W[19]<<20|W[18]>>>12,Oi=W[29]<<7|W[28]>>>25,Di=W[28]<<7|W[29]>>>25,Ft=W[38]<<8|W[39]>>>24,ht=W[39]<<8|W[38]>>>24,G=W[48]<<14|W[49]>>>18,O=W[49]<<14|W[48]>>>18,W[0]=rt^~Ze&nt,W[1]=st^~Be<,W[10]=z^~ae&be,W[11]=X^~he&Ne,W[20]=er^~yr&ft,W[21]=Pt^~_r&$t,W[30]=vt^~zt&Wt,W[31]=Qt^~yt&qt,W[40]=Mr^~Vt&Oi,W[41]=$r^~ar&Di,W[2]=Ze^~nt&je,W[3]=Be^~lt&at,W[12]=ae^~be&Ve,W[13]=he^~Ne&dt,W[22]=yr^~ft&Ft,W[23]=_r^~$t&ht,W[32]=zt^~Wt&pt,W[33]=yt^~qt&Nt,W[42]=Vt^~Oi&Li,W[43]=ar^~Di&Bi,W[4]=nt^~je&G,W[5]=lt^~at&O,W[14]=be^~Ve&Ge,W[15]=Ne^~dt&wt,W[24]=ft^~Ft&Bt,W[25]=$t^~ht&Ot,W[34]=Wt^~pt&Yt,W[35]=qt^~Nt&bt,W[44]=Oi^~Li&Ui,W[45]=Di^~Bi&Pn,W[6]=je^~G&rt,W[7]=at^~O&st,W[16]=Ve^~Ge&z,W[17]=dt^~wt&X,W[26]=Ft^~Bt&er,W[27]=ht^~Ot&Pt,W[36]=pt^~Yt&vt,W[37]=Nt^~bt&Qt,W[46]=Li^~Ui&Mr,W[47]=Bi^~Pn&$r,W[8]=G^~rt&Ze,W[9]=O^~st&Be,W[18]=Ge^~z&ae,W[19]=wt^~X&he,W[28]=Bt^~er&yr,W[29]=Ot^~Pt&_r,W[38]=Yt^~vt&zt,W[39]=bt^~Qt&yt,W[48]=Ui^~Mr&Vt,W[49]=Pn^~$r&ar,W[0]^=P[ne],W[1]^=P[ne+1]};if(a)t.exports=m;else for(_=0;_{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 EP=i0e();var DC;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(DC||(DC={}));var Ja;(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"})(Ja||(Ja={}));const SP="0123456789abcdef";let Si=class ei{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();lb[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(AP>lb[n])&&console.log.apply(console,r)}debug(...e){this._log(ei.levels.DEBUG,e)}info(...e){this._log(ei.levels.INFO,e)}warn(...e){this._log(ei.levels.WARNING,e)}makeError(e,r,n){if(_P)return this.makeError("censored error",r,{});r||(r=ei.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let d="";for(let f=0;f>4],d+=SP[l[f]&15];i.push(c+"=Uint8Array(0x"+d+")")}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 Ja.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 Ja.CALL_EXCEPTION:case Ja.INSUFFICIENT_FUNDS:case Ja.MISSING_NEW:case Ja.NONCE_EXPIRED:case Ja.REPLACEMENT_UNDERPRICED:case Ja.TRANSACTION_REPLACED:case Ja.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,ei.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){EP&&this.throwError("platform missing String.prototype.normalize",ei.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:EP})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ei.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ei.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,ei.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ei.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",ei.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ei.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return m9||(m9=new ei(n0e)),m9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ei.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),CP){if(!e)return;this.globalLogger().throwError("error censorship permanent",ei.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_P=!!e,CP=!!r}static setLogLevel(e){const r=lb[e.toLowerCase()];if(r==null){ei.globalLogger().warn("invalid log level - "+e);return}AP=r}static from(e){return new ei(e)}};Si.errors=Ja,Si.levels=DC;const s0e="bytes/5.7.0",zn=new Si(s0e);function MU(t){return!!t.toHexString}function Qp(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Qp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function o0e(t){return xo(t)&&!(t.length%2)||bg(t)}function IP(t){return typeof t=="number"&&t==t&&t%1===0}function bg(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!IP(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function Dn(t,e){if(e||(e={}),typeof t=="number"){zn.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),Qp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MU(t)&&(t=t.toHexString()),xo(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":zn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iDn(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),Qp(n)}function c0e(t,e){t=Dn(t),t.length>e&&zn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Qp(r)}function xo(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const w9="0123456789abcdef";function zs(t,e){if(e||(e={}),typeof t=="number"){zn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=w9[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),MU(t))return t.toHexString();if(xo(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":zn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(bg(t)){let r="0x";for(let n=0;n>4]+w9[i&15]}return r}return zn.throwArgumentError("invalid hexlify value","value",t)}function l0e(t){if(typeof t!="string")t=zs(t);else if(!xo(t)||t.length%2)return null;return(t.length-2)/2}function TP(t,e,r){return typeof t!="string"?t=zs(t):(!xo(t)||t.length%2)&&zn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function dl(t,e){for(typeof t!="string"?t=zs(t):xo(t)||zn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&zn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function $U(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(o0e(t)){let r=Dn(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=zs(r.slice(0,32)),e.s=zs(r.slice(32,64))):r.length===65?(e.r=zs(r.slice(0,32)),e.s=zs(r.slice(32,64)),e.v=r[64]):zn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:zn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=zs(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=c0e(Dn(e._vs),32);e._vs=zs(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&zn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=zs(i);e.s==null?e.s=o:e.s!==o&&zn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?zn.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&&zn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!xo(e.r)?zn.throwArgumentError("signature missing or invalid r","signature",t):e.r=dl(e.r,32),e.s==null||!xo(e.s)?zn.throwArgumentError("signature missing or invalid s","signature",t):e.s=dl(e.s,32);const r=Dn(e.s);r[0]>=128&&zn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=zs(r);e._vs&&(xo(e._vs)||zn.throwArgumentError("signature invalid _vs","signature",t),e._vs=dl(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&zn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function $E(t){return"0x"+r0e.keccak_256(Dn(t))}var OU={exports:{}},u0e={},d0e=Object.freeze({__proto__:null,default:u0e}),f0e=t0e(d0e);(function(t){(function(e,r){function n(p,m){if(!p)throw new Error(m||"Assertion failed")}function i(p,m){p.super_=m;var w=function(){};w.prototype=m.prototype,p.prototype=new w,p.prototype.constructor=p}function s(p,m,w){if(s.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((m==="le"||m==="be")&&(w=m,m=10),this._init(p||0,m||10,w||"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=f0e.Buffer}catch{}s.isBN=function(p){return p instanceof s?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===s.wordSize&&Array.isArray(p.words)},s.max=function(p,m){return p.cmp(m)>0?p:m},s.min=function(p,m){return p.cmp(m)<0?p:m},s.prototype._init=function(p,m,w){if(typeof p=="number")return this._initNumber(p,m,w);if(typeof p=="object")return this._initArray(p,m,w);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var _=0;p[0]==="-"&&(_++,this.negative=1),_=0;_-=3)S=p[_]|p[_-1]<<8|p[_-2]<<16,this.words[R]|=S<>>26-k&67108863,k+=24,k>=26&&(k-=26,R++);else if(w==="le")for(_=0,R=0;_>>26-k&67108863,k+=24,k>=26&&(k-=26,R++);return this._strip()};function a(p,m){var w=p.charCodeAt(m);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;n(!1,"Invalid character in "+p)}function c(p,m,w){var _=a(p,w);return w-1>=m&&(_|=a(p,w-1)<<4),_}s.prototype._parseHex=function(p,m,w){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var _=0;_=m;_-=2)k=c(p,m,_)<=18?(R-=18,S+=1,this.words[S]|=k>>>26):R+=8;else{var y=p.length-m;for(_=y%2===0?m+1:m;_=18?(R-=18,S+=1,this.words[S]|=k>>>26):R+=8}this._strip()};function l(p,m,w,_){for(var R=0,S=0,k=Math.min(p.length,w),y=m;y=49?S=b-49+10:b>=17?S=b-17+10:S=b,n(b>=0&&S<_,"Invalid character"),R+=S}return R}s.prototype._parseBase=function(p,m,w){this.words=[0],this.length=1;for(var _=0,R=1;R<=67108863;R*=m)_++;_--,R=R/m|0;for(var S=p.length-w,k=S%_,y=Math.min(S,S-k)+w,b=0,V=w;V1&&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")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var g=["","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"],v=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(p,m){p=p||10,m=m|0||1;var w;if(p===16||p==="hex"){w="";for(var _=0,R=0,S=0;S>>24-_&16777215,_+=2,_>=26&&(_-=26,S--),R!==0||S!==this.length-1?w=g[6-y.length]+y+w:w=y+w}for(R!==0&&(w=R.toString(16)+w);w.length%m!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(p===(p|0)&&p>=2&&p<=36){var b=v[p],V=x[p];w="";var ce=this.clone();for(ce.negative=0;!ce.isZero();){var fe=ce.modrn(V).toString(p);ce=ce.idivn(V),ce.isZero()?w=fe+w:w=g[b-fe.length]+fe+w}for(this.isZero()&&(w="0"+w);w.length%m!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(p,m){return this.toArrayLike(o,p,m)}),s.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)};var P=function(p,m){return p.allocUnsafe?p.allocUnsafe(m):new p(m)};s.prototype.toArrayLike=function(p,m,w){this._strip();var _=this.byteLength(),R=w||Math.max(1,_);n(_<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var S=P(p,R),k=m==="le"?"LE":"BE";return this["_toArrayLike"+k](S,_),S},s.prototype._toArrayLikeLE=function(p,m){for(var w=0,_=0,R=0,S=0;R>8&255),w>16&255),S===6?(w>24&255),_=0,S=0):(_=k>>>24,S+=2)}if(w=0&&(p[w--]=k>>8&255),w>=0&&(p[w--]=k>>16&255),S===6?(w>=0&&(p[w--]=k>>24&255),_=0,S=0):(_=k>>>24,S+=2)}if(w>=0)for(p[w--]=_;w>=0;)p[w--]=0},Math.clz32?s.prototype._countBits=function(p){return 32-Math.clz32(p)}:s.prototype._countBits=function(p){var m=p,w=0;return m>=4096&&(w+=13,m>>>=13),m>=64&&(w+=7,m>>>=7),m>=8&&(w+=4,m>>>=4),m>=2&&(w+=2,m>>>=2),w+m},s.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,w=0;return m&8191||(w+=13,m>>>=13),m&127||(w+=7,m>>>=7),m&15||(w+=4,m>>>=4),m&3||(w+=2,m>>>=2),m&1||w++,w},s.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function M(p){for(var m=new Array(p.bitLength()),w=0;w>>R&1}return m}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;mp.length?this.clone().ior(p):p.clone().ior(this)},s.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},s.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var w=0;wp.length?this.clone().iand(p):p.clone().iand(this)},s.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},s.prototype.iuxor=function(p){var m,w;this.length>p.length?(m=this,w=p):(m=p,w=this);for(var _=0;_p.length?this.clone().ixor(p):p.clone().ixor(this)},s.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},s.prototype.inotn=function(p){n(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,w=p%26;this._expand(m),w>0&&m--;for(var _=0;_0&&(this.words[_]=~this.words[_]&67108863>>26-w),this._strip()},s.prototype.notn=function(p){return this.clone().inotn(p)},s.prototype.setn=function(p,m){n(typeof p=="number"&&p>=0);var w=p/26|0,_=p%26;return this._expand(w+1),m?this.words[w]=this.words[w]|1<<_:this.words[w]=this.words[w]&~(1<<_),this._strip()},s.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var w,_;this.length>p.length?(w=this,_=p):(w=p,_=this);for(var R=0,S=0;S<_.length;S++)m=(w.words[S]|0)+(_.words[S]|0)+R,this.words[S]=m&67108863,R=m>>>26;for(;R!==0&&S>>26;if(this.length=w.length,R!==0)this.words[this.length]=R,this.length++;else if(w!==this)for(;Sp.length?this.clone().iadd(p):p.clone().iadd(this)},s.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var w=this.cmp(p);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,R;w>0?(_=this,R=p):(_=p,R=this);for(var S=0,k=0;k>26,this.words[k]=m&67108863;for(;S!==0&&k<_.length;k++)m=(_.words[k]|0)+S,S=m>>26,this.words[k]=m&67108863;if(S===0&&k<_.length&&_!==this)for(;k<_.length;k++)this.words[k]=_.words[k];return this.length=Math.max(this.length,k),_!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(p){return this.clone().isub(p)};function N(p,m,w){w.negative=m.negative^p.negative;var _=p.length+m.length|0;w.length=_,_=_-1|0;var R=p.words[0]|0,S=m.words[0]|0,k=R*S,y=k&67108863,b=k/67108864|0;w.words[0]=y;for(var V=1;V<_;V++){for(var ce=b>>>26,fe=b&67108863,W=Math.min(V,m.length-1),ue=Math.max(0,V-p.length+1);ue<=W;ue++){var J=V-ue|0;R=p.words[J]|0,S=m.words[ue]|0,k=R*S+fe,ce+=k/67108864|0,fe=k&67108863}w.words[V]=fe|0,b=ce|0}return b!==0?w.words[V]=b|0:w.length--,w._strip()}var E=function(p,m,w){var _=p.words,R=m.words,S=w.words,k=0,y,b,V,ce=_[0]|0,fe=ce&8191,W=ce>>>13,ue=_[1]|0,J=ue&8191,ne=ue>>>13,ie=_[2]|0,D=ie&8191,te=ie>>>13,me=_[3]|0,Ce=me&8191,Ee=me>>>13,Re=_[4]|0,He=Re&8191,Xe=Re>>>13,kt=_[5]|0,rt=kt&8191,st=kt>>>13,Ze=_[6]|0,Be=Ze&8191,nt=Ze>>>13,lt=_[7]|0,je=lt&8191,at=lt>>>13,G=_[8]|0,O=G&8191,z=G>>>13,X=_[9]|0,ae=X&8191,he=X>>>13,be=R[0]|0,Ne=be&8191,Ve=be>>>13,dt=R[1]|0,Ge=dt&8191,wt=dt>>>13,er=R[2]|0,Pt=er&8191,yr=er>>>13,_r=R[3]|0,ft=_r&8191,$t=_r>>>13,Ft=R[4]|0,ht=Ft&8191,Bt=Ft>>>13,Ot=R[5]|0,vt=Ot&8191,Qt=Ot>>>13,zt=R[6]|0,yt=zt&8191,Wt=zt>>>13,qt=R[7]|0,pt=qt&8191,Nt=qt>>>13,Yt=R[8]|0,bt=Yt&8191,Mr=Yt>>>13,$r=R[9]|0,Vt=$r&8191,ar=$r>>>13;w.negative=p.negative^m.negative,w.length=19,y=Math.imul(fe,Ne),b=Math.imul(fe,Ve),b=b+Math.imul(W,Ne)|0,V=Math.imul(W,Ve);var Oi=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,y=Math.imul(J,Ne),b=Math.imul(J,Ve),b=b+Math.imul(ne,Ne)|0,V=Math.imul(ne,Ve),y=y+Math.imul(fe,Ge)|0,b=b+Math.imul(fe,wt)|0,b=b+Math.imul(W,Ge)|0,V=V+Math.imul(W,wt)|0;var Di=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Di>>>26)|0,Di&=67108863,y=Math.imul(D,Ne),b=Math.imul(D,Ve),b=b+Math.imul(te,Ne)|0,V=Math.imul(te,Ve),y=y+Math.imul(J,Ge)|0,b=b+Math.imul(J,wt)|0,b=b+Math.imul(ne,Ge)|0,V=V+Math.imul(ne,wt)|0,y=y+Math.imul(fe,Pt)|0,b=b+Math.imul(fe,yr)|0,b=b+Math.imul(W,Pt)|0,V=V+Math.imul(W,yr)|0;var Li=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Li>>>26)|0,Li&=67108863,y=Math.imul(Ce,Ne),b=Math.imul(Ce,Ve),b=b+Math.imul(Ee,Ne)|0,V=Math.imul(Ee,Ve),y=y+Math.imul(D,Ge)|0,b=b+Math.imul(D,wt)|0,b=b+Math.imul(te,Ge)|0,V=V+Math.imul(te,wt)|0,y=y+Math.imul(J,Pt)|0,b=b+Math.imul(J,yr)|0,b=b+Math.imul(ne,Pt)|0,V=V+Math.imul(ne,yr)|0,y=y+Math.imul(fe,ft)|0,b=b+Math.imul(fe,$t)|0,b=b+Math.imul(W,ft)|0,V=V+Math.imul(W,$t)|0;var Bi=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Bi>>>26)|0,Bi&=67108863,y=Math.imul(He,Ne),b=Math.imul(He,Ve),b=b+Math.imul(Xe,Ne)|0,V=Math.imul(Xe,Ve),y=y+Math.imul(Ce,Ge)|0,b=b+Math.imul(Ce,wt)|0,b=b+Math.imul(Ee,Ge)|0,V=V+Math.imul(Ee,wt)|0,y=y+Math.imul(D,Pt)|0,b=b+Math.imul(D,yr)|0,b=b+Math.imul(te,Pt)|0,V=V+Math.imul(te,yr)|0,y=y+Math.imul(J,ft)|0,b=b+Math.imul(J,$t)|0,b=b+Math.imul(ne,ft)|0,V=V+Math.imul(ne,$t)|0,y=y+Math.imul(fe,ht)|0,b=b+Math.imul(fe,Bt)|0,b=b+Math.imul(W,ht)|0,V=V+Math.imul(W,Bt)|0;var Ui=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,y=Math.imul(rt,Ne),b=Math.imul(rt,Ve),b=b+Math.imul(st,Ne)|0,V=Math.imul(st,Ve),y=y+Math.imul(He,Ge)|0,b=b+Math.imul(He,wt)|0,b=b+Math.imul(Xe,Ge)|0,V=V+Math.imul(Xe,wt)|0,y=y+Math.imul(Ce,Pt)|0,b=b+Math.imul(Ce,yr)|0,b=b+Math.imul(Ee,Pt)|0,V=V+Math.imul(Ee,yr)|0,y=y+Math.imul(D,ft)|0,b=b+Math.imul(D,$t)|0,b=b+Math.imul(te,ft)|0,V=V+Math.imul(te,$t)|0,y=y+Math.imul(J,ht)|0,b=b+Math.imul(J,Bt)|0,b=b+Math.imul(ne,ht)|0,V=V+Math.imul(ne,Bt)|0,y=y+Math.imul(fe,vt)|0,b=b+Math.imul(fe,Qt)|0,b=b+Math.imul(W,vt)|0,V=V+Math.imul(W,Qt)|0;var Pn=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,y=Math.imul(Be,Ne),b=Math.imul(Be,Ve),b=b+Math.imul(nt,Ne)|0,V=Math.imul(nt,Ve),y=y+Math.imul(rt,Ge)|0,b=b+Math.imul(rt,wt)|0,b=b+Math.imul(st,Ge)|0,V=V+Math.imul(st,wt)|0,y=y+Math.imul(He,Pt)|0,b=b+Math.imul(He,yr)|0,b=b+Math.imul(Xe,Pt)|0,V=V+Math.imul(Xe,yr)|0,y=y+Math.imul(Ce,ft)|0,b=b+Math.imul(Ce,$t)|0,b=b+Math.imul(Ee,ft)|0,V=V+Math.imul(Ee,$t)|0,y=y+Math.imul(D,ht)|0,b=b+Math.imul(D,Bt)|0,b=b+Math.imul(te,ht)|0,V=V+Math.imul(te,Bt)|0,y=y+Math.imul(J,vt)|0,b=b+Math.imul(J,Qt)|0,b=b+Math.imul(ne,vt)|0,V=V+Math.imul(ne,Qt)|0,y=y+Math.imul(fe,yt)|0,b=b+Math.imul(fe,Wt)|0,b=b+Math.imul(W,yt)|0,V=V+Math.imul(W,Wt)|0;var ks=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(ks>>>26)|0,ks&=67108863,y=Math.imul(je,Ne),b=Math.imul(je,Ve),b=b+Math.imul(at,Ne)|0,V=Math.imul(at,Ve),y=y+Math.imul(Be,Ge)|0,b=b+Math.imul(Be,wt)|0,b=b+Math.imul(nt,Ge)|0,V=V+Math.imul(nt,wt)|0,y=y+Math.imul(rt,Pt)|0,b=b+Math.imul(rt,yr)|0,b=b+Math.imul(st,Pt)|0,V=V+Math.imul(st,yr)|0,y=y+Math.imul(He,ft)|0,b=b+Math.imul(He,$t)|0,b=b+Math.imul(Xe,ft)|0,V=V+Math.imul(Xe,$t)|0,y=y+Math.imul(Ce,ht)|0,b=b+Math.imul(Ce,Bt)|0,b=b+Math.imul(Ee,ht)|0,V=V+Math.imul(Ee,Bt)|0,y=y+Math.imul(D,vt)|0,b=b+Math.imul(D,Qt)|0,b=b+Math.imul(te,vt)|0,V=V+Math.imul(te,Qt)|0,y=y+Math.imul(J,yt)|0,b=b+Math.imul(J,Wt)|0,b=b+Math.imul(ne,yt)|0,V=V+Math.imul(ne,Wt)|0,y=y+Math.imul(fe,pt)|0,b=b+Math.imul(fe,Nt)|0,b=b+Math.imul(W,pt)|0,V=V+Math.imul(W,Nt)|0;var ka=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(ka>>>26)|0,ka&=67108863,y=Math.imul(O,Ne),b=Math.imul(O,Ve),b=b+Math.imul(z,Ne)|0,V=Math.imul(z,Ve),y=y+Math.imul(je,Ge)|0,b=b+Math.imul(je,wt)|0,b=b+Math.imul(at,Ge)|0,V=V+Math.imul(at,wt)|0,y=y+Math.imul(Be,Pt)|0,b=b+Math.imul(Be,yr)|0,b=b+Math.imul(nt,Pt)|0,V=V+Math.imul(nt,yr)|0,y=y+Math.imul(rt,ft)|0,b=b+Math.imul(rt,$t)|0,b=b+Math.imul(st,ft)|0,V=V+Math.imul(st,$t)|0,y=y+Math.imul(He,ht)|0,b=b+Math.imul(He,Bt)|0,b=b+Math.imul(Xe,ht)|0,V=V+Math.imul(Xe,Bt)|0,y=y+Math.imul(Ce,vt)|0,b=b+Math.imul(Ce,Qt)|0,b=b+Math.imul(Ee,vt)|0,V=V+Math.imul(Ee,Qt)|0,y=y+Math.imul(D,yt)|0,b=b+Math.imul(D,Wt)|0,b=b+Math.imul(te,yt)|0,V=V+Math.imul(te,Wt)|0,y=y+Math.imul(J,pt)|0,b=b+Math.imul(J,Nt)|0,b=b+Math.imul(ne,pt)|0,V=V+Math.imul(ne,Nt)|0,y=y+Math.imul(fe,bt)|0,b=b+Math.imul(fe,Mr)|0,b=b+Math.imul(W,bt)|0,V=V+Math.imul(W,Mr)|0;var Rs=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Rs>>>26)|0,Rs&=67108863,y=Math.imul(ae,Ne),b=Math.imul(ae,Ve),b=b+Math.imul(he,Ne)|0,V=Math.imul(he,Ve),y=y+Math.imul(O,Ge)|0,b=b+Math.imul(O,wt)|0,b=b+Math.imul(z,Ge)|0,V=V+Math.imul(z,wt)|0,y=y+Math.imul(je,Pt)|0,b=b+Math.imul(je,yr)|0,b=b+Math.imul(at,Pt)|0,V=V+Math.imul(at,yr)|0,y=y+Math.imul(Be,ft)|0,b=b+Math.imul(Be,$t)|0,b=b+Math.imul(nt,ft)|0,V=V+Math.imul(nt,$t)|0,y=y+Math.imul(rt,ht)|0,b=b+Math.imul(rt,Bt)|0,b=b+Math.imul(st,ht)|0,V=V+Math.imul(st,Bt)|0,y=y+Math.imul(He,vt)|0,b=b+Math.imul(He,Qt)|0,b=b+Math.imul(Xe,vt)|0,V=V+Math.imul(Xe,Qt)|0,y=y+Math.imul(Ce,yt)|0,b=b+Math.imul(Ce,Wt)|0,b=b+Math.imul(Ee,yt)|0,V=V+Math.imul(Ee,Wt)|0,y=y+Math.imul(D,pt)|0,b=b+Math.imul(D,Nt)|0,b=b+Math.imul(te,pt)|0,V=V+Math.imul(te,Nt)|0,y=y+Math.imul(J,bt)|0,b=b+Math.imul(J,Mr)|0,b=b+Math.imul(ne,bt)|0,V=V+Math.imul(ne,Mr)|0,y=y+Math.imul(fe,Vt)|0,b=b+Math.imul(fe,ar)|0,b=b+Math.imul(W,Vt)|0,V=V+Math.imul(W,ar)|0;var Ra=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,y=Math.imul(ae,Ge),b=Math.imul(ae,wt),b=b+Math.imul(he,Ge)|0,V=Math.imul(he,wt),y=y+Math.imul(O,Pt)|0,b=b+Math.imul(O,yr)|0,b=b+Math.imul(z,Pt)|0,V=V+Math.imul(z,yr)|0,y=y+Math.imul(je,ft)|0,b=b+Math.imul(je,$t)|0,b=b+Math.imul(at,ft)|0,V=V+Math.imul(at,$t)|0,y=y+Math.imul(Be,ht)|0,b=b+Math.imul(Be,Bt)|0,b=b+Math.imul(nt,ht)|0,V=V+Math.imul(nt,Bt)|0,y=y+Math.imul(rt,vt)|0,b=b+Math.imul(rt,Qt)|0,b=b+Math.imul(st,vt)|0,V=V+Math.imul(st,Qt)|0,y=y+Math.imul(He,yt)|0,b=b+Math.imul(He,Wt)|0,b=b+Math.imul(Xe,yt)|0,V=V+Math.imul(Xe,Wt)|0,y=y+Math.imul(Ce,pt)|0,b=b+Math.imul(Ce,Nt)|0,b=b+Math.imul(Ee,pt)|0,V=V+Math.imul(Ee,Nt)|0,y=y+Math.imul(D,bt)|0,b=b+Math.imul(D,Mr)|0,b=b+Math.imul(te,bt)|0,V=V+Math.imul(te,Mr)|0,y=y+Math.imul(J,Vt)|0,b=b+Math.imul(J,ar)|0,b=b+Math.imul(ne,Vt)|0,V=V+Math.imul(ne,ar)|0;var Pa=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,y=Math.imul(ae,Pt),b=Math.imul(ae,yr),b=b+Math.imul(he,Pt)|0,V=Math.imul(he,yr),y=y+Math.imul(O,ft)|0,b=b+Math.imul(O,$t)|0,b=b+Math.imul(z,ft)|0,V=V+Math.imul(z,$t)|0,y=y+Math.imul(je,ht)|0,b=b+Math.imul(je,Bt)|0,b=b+Math.imul(at,ht)|0,V=V+Math.imul(at,Bt)|0,y=y+Math.imul(Be,vt)|0,b=b+Math.imul(Be,Qt)|0,b=b+Math.imul(nt,vt)|0,V=V+Math.imul(nt,Qt)|0,y=y+Math.imul(rt,yt)|0,b=b+Math.imul(rt,Wt)|0,b=b+Math.imul(st,yt)|0,V=V+Math.imul(st,Wt)|0,y=y+Math.imul(He,pt)|0,b=b+Math.imul(He,Nt)|0,b=b+Math.imul(Xe,pt)|0,V=V+Math.imul(Xe,Nt)|0,y=y+Math.imul(Ce,bt)|0,b=b+Math.imul(Ce,Mr)|0,b=b+Math.imul(Ee,bt)|0,V=V+Math.imul(Ee,Mr)|0,y=y+Math.imul(D,Vt)|0,b=b+Math.imul(D,ar)|0,b=b+Math.imul(te,Vt)|0,V=V+Math.imul(te,ar)|0;var Ps=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,y=Math.imul(ae,ft),b=Math.imul(ae,$t),b=b+Math.imul(he,ft)|0,V=Math.imul(he,$t),y=y+Math.imul(O,ht)|0,b=b+Math.imul(O,Bt)|0,b=b+Math.imul(z,ht)|0,V=V+Math.imul(z,Bt)|0,y=y+Math.imul(je,vt)|0,b=b+Math.imul(je,Qt)|0,b=b+Math.imul(at,vt)|0,V=V+Math.imul(at,Qt)|0,y=y+Math.imul(Be,yt)|0,b=b+Math.imul(Be,Wt)|0,b=b+Math.imul(nt,yt)|0,V=V+Math.imul(nt,Wt)|0,y=y+Math.imul(rt,pt)|0,b=b+Math.imul(rt,Nt)|0,b=b+Math.imul(st,pt)|0,V=V+Math.imul(st,Nt)|0,y=y+Math.imul(He,bt)|0,b=b+Math.imul(He,Mr)|0,b=b+Math.imul(Xe,bt)|0,V=V+Math.imul(Xe,Mr)|0,y=y+Math.imul(Ce,Vt)|0,b=b+Math.imul(Ce,ar)|0,b=b+Math.imul(Ee,Vt)|0,V=V+Math.imul(Ee,ar)|0;var Bo=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,y=Math.imul(ae,ht),b=Math.imul(ae,Bt),b=b+Math.imul(he,ht)|0,V=Math.imul(he,Bt),y=y+Math.imul(O,vt)|0,b=b+Math.imul(O,Qt)|0,b=b+Math.imul(z,vt)|0,V=V+Math.imul(z,Qt)|0,y=y+Math.imul(je,yt)|0,b=b+Math.imul(je,Wt)|0,b=b+Math.imul(at,yt)|0,V=V+Math.imul(at,Wt)|0,y=y+Math.imul(Be,pt)|0,b=b+Math.imul(Be,Nt)|0,b=b+Math.imul(nt,pt)|0,V=V+Math.imul(nt,Nt)|0,y=y+Math.imul(rt,bt)|0,b=b+Math.imul(rt,Mr)|0,b=b+Math.imul(st,bt)|0,V=V+Math.imul(st,Mr)|0,y=y+Math.imul(He,Vt)|0,b=b+Math.imul(He,ar)|0,b=b+Math.imul(Xe,Vt)|0,V=V+Math.imul(Xe,ar)|0;var Uo=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,y=Math.imul(ae,vt),b=Math.imul(ae,Qt),b=b+Math.imul(he,vt)|0,V=Math.imul(he,Qt),y=y+Math.imul(O,yt)|0,b=b+Math.imul(O,Wt)|0,b=b+Math.imul(z,yt)|0,V=V+Math.imul(z,Wt)|0,y=y+Math.imul(je,pt)|0,b=b+Math.imul(je,Nt)|0,b=b+Math.imul(at,pt)|0,V=V+Math.imul(at,Nt)|0,y=y+Math.imul(Be,bt)|0,b=b+Math.imul(Be,Mr)|0,b=b+Math.imul(nt,bt)|0,V=V+Math.imul(nt,Mr)|0,y=y+Math.imul(rt,Vt)|0,b=b+Math.imul(rt,ar)|0,b=b+Math.imul(st,Vt)|0,V=V+Math.imul(st,ar)|0;var Yn=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,y=Math.imul(ae,yt),b=Math.imul(ae,Wt),b=b+Math.imul(he,yt)|0,V=Math.imul(he,Wt),y=y+Math.imul(O,pt)|0,b=b+Math.imul(O,Nt)|0,b=b+Math.imul(z,pt)|0,V=V+Math.imul(z,Nt)|0,y=y+Math.imul(je,bt)|0,b=b+Math.imul(je,Mr)|0,b=b+Math.imul(at,bt)|0,V=V+Math.imul(at,Mr)|0,y=y+Math.imul(Be,Vt)|0,b=b+Math.imul(Be,ar)|0,b=b+Math.imul(nt,Vt)|0,V=V+Math.imul(nt,ar)|0;var Na=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Na>>>26)|0,Na&=67108863,y=Math.imul(ae,pt),b=Math.imul(ae,Nt),b=b+Math.imul(he,pt)|0,V=Math.imul(he,Nt),y=y+Math.imul(O,bt)|0,b=b+Math.imul(O,Mr)|0,b=b+Math.imul(z,bt)|0,V=V+Math.imul(z,Mr)|0,y=y+Math.imul(je,Vt)|0,b=b+Math.imul(je,ar)|0,b=b+Math.imul(at,Vt)|0,V=V+Math.imul(at,ar)|0;var Ma=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,y=Math.imul(ae,bt),b=Math.imul(ae,Mr),b=b+Math.imul(he,bt)|0,V=Math.imul(he,Mr),y=y+Math.imul(O,Vt)|0,b=b+Math.imul(O,ar)|0,b=b+Math.imul(z,Vt)|0,V=V+Math.imul(z,ar)|0;var $a=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+($a>>>26)|0,$a&=67108863,y=Math.imul(ae,Vt),b=Math.imul(ae,ar),b=b+Math.imul(he,Vt)|0,V=Math.imul(he,ar);var Uf=(k+y|0)+((b&8191)<<13)|0;return k=(V+(b>>>13)|0)+(Uf>>>26)|0,Uf&=67108863,S[0]=Oi,S[1]=Di,S[2]=Li,S[3]=Bi,S[4]=Ui,S[5]=Pn,S[6]=ks,S[7]=ka,S[8]=Rs,S[9]=Ra,S[10]=Pa,S[11]=Ps,S[12]=Bo,S[13]=Uo,S[14]=Yn,S[15]=Na,S[16]=Ma,S[17]=$a,S[18]=Uf,k!==0&&(S[19]=k,w.length++),w};Math.imul||(E=N);function $(p,m,w){w.negative=m.negative^p.negative,w.length=p.length+m.length;for(var _=0,R=0,S=0;S>>26)|0,R+=k>>>26,k&=67108863}w.words[S]=y,_=k,k=R}return _!==0?w.words[S]=_:w.length--,w._strip()}function L(p,m,w){return $(p,m,w)}s.prototype.mulTo=function(p,m){var w,_=this.length+p.length;return this.length===10&&p.length===10?w=E(this,p,m):_<63?w=N(this,p,m):_<1024?w=$(this,p,m):w=L(this,p,m),w},s.prototype.mul=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},s.prototype.mulf=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),L(this,p,m)},s.prototype.imul=function(p){return this.clone().mulTo(p,this)},s.prototype.imuln=function(p){var m=p<0;m&&(p=-p),n(typeof p=="number"),n(p<67108864);for(var w=0,_=0;_>=26,w+=R/67108864|0,w+=S>>>26,this.words[_]=S&67108863}return w!==0&&(this.words[_]=w,this.length++),m?this.ineg():this},s.prototype.muln=function(p){return this.clone().imuln(p)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(p){var m=M(p);if(m.length===0)return new s(1);for(var w=this,_=0;_=0);var m=p%26,w=(p-m)/26,_=67108863>>>26-m<<26-m,R;if(m!==0){var S=0;for(R=0;R>>26-m}S&&(this.words[R]=S,this.length++)}if(w!==0){for(R=this.length-1;R>=0;R--)this.words[R+w]=this.words[R];for(R=0;R=0);var _;m?_=(m-m%26)/26:_=0;var R=p%26,S=Math.min((p-R)/26,this.length),k=67108863^67108863>>>R<S)for(this.length-=S,b=0;b=0&&(V!==0||b>=_);b--){var ce=this.words[b]|0;this.words[b]=V<<26-R|ce>>>R,V=ce&k}return y&&V!==0&&(y.words[y.length++]=V),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(p,m,w){return n(this.negative===0),this.iushrn(p,m,w)},s.prototype.shln=function(p){return this.clone().ishln(p)},s.prototype.ushln=function(p){return this.clone().iushln(p)},s.prototype.shrn=function(p){return this.clone().ishrn(p)},s.prototype.ushrn=function(p){return this.clone().iushrn(p)},s.prototype.testn=function(p){n(typeof p=="number"&&p>=0);var m=p%26,w=(p-m)/26,_=1<=0);var m=p%26,w=(p-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(m!==0&&w++,this.length=Math.min(w,this.length),m!==0){var _=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(p){if(n(typeof p=="number"),n(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(y/67108864|0),this.words[R+w]=S&67108863}for(;R>26,this.words[R+w]=S&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,R=0;R>26,this.words[R]=S&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(p,m){var w=this.length-p.length,_=this.clone(),R=p,S=R.words[R.length-1]|0,k=this._countBits(S);w=26-k,w!==0&&(R=R.ushln(w),_.iushln(w),S=R.words[R.length-1]|0);var y=_.length-R.length,b;if(m!=="mod"){b=new s(null),b.length=y+1,b.words=new Array(b.length);for(var V=0;V=0;fe--){var W=(_.words[R.length+fe]|0)*67108864+(_.words[R.length+fe-1]|0);for(W=Math.min(W/S|0,67108863),_._ishlnsubmul(R,W,fe);_.negative!==0;)W--,_.negative=0,_._ishlnsubmul(R,1,fe),_.isZero()||(_.negative^=1);b&&(b.words[fe]=W)}return b&&b._strip(),_._strip(),m!=="div"&&w!==0&&_.iushrn(w),{div:b||null,mod:_}},s.prototype.divmod=function(p,m,w){if(n(!p.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var _,R,S;return this.negative!==0&&p.negative===0?(S=this.neg().divmod(p,m),m!=="mod"&&(_=S.div.neg()),m!=="div"&&(R=S.mod.neg(),w&&R.negative!==0&&R.iadd(p)),{div:_,mod:R}):this.negative===0&&p.negative!==0?(S=this.divmod(p.neg(),m),m!=="mod"&&(_=S.div.neg()),{div:_,mod:S.mod}):this.negative&p.negative?(S=this.neg().divmod(p.neg(),m),m!=="div"&&(R=S.mod.neg(),w&&R.negative!==0&&R.isub(p)),{div:S.div,mod:R}):p.length>this.length||this.cmp(p)<0?{div:new s(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new s(this.modrn(p.words[0]))}:this._wordDiv(p,m)},s.prototype.div=function(p){return this.divmod(p,"div",!1).div},s.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},s.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},s.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var w=m.div.negative!==0?m.mod.isub(p):m.mod,_=p.ushrn(1),R=p.andln(1),S=w.cmp(_);return S<0||R===1&&S===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var w=(1<<26)%p,_=0,R=this.length-1;R>=0;R--)_=(w*_+(this.words[R]|0))%p;return m?-_:_},s.prototype.modn=function(p){return this.modrn(p)},s.prototype.idivn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var w=0,_=this.length-1;_>=0;_--){var R=(this.words[_]|0)+w*67108864;this.words[_]=R/p|0,w=R%p}return this._strip(),m?this.ineg():this},s.prototype.divn=function(p){return this.clone().idivn(p)},s.prototype.egcd=function(p){n(p.negative===0),n(!p.isZero());var m=this,w=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var _=new s(1),R=new s(0),S=new s(0),k=new s(1),y=0;m.isEven()&&w.isEven();)m.iushrn(1),w.iushrn(1),++y;for(var b=w.clone(),V=m.clone();!m.isZero();){for(var ce=0,fe=1;!(m.words[0]&fe)&&ce<26;++ce,fe<<=1);if(ce>0)for(m.iushrn(ce);ce-- >0;)(_.isOdd()||R.isOdd())&&(_.iadd(b),R.isub(V)),_.iushrn(1),R.iushrn(1);for(var W=0,ue=1;!(w.words[0]&ue)&&W<26;++W,ue<<=1);if(W>0)for(w.iushrn(W);W-- >0;)(S.isOdd()||k.isOdd())&&(S.iadd(b),k.isub(V)),S.iushrn(1),k.iushrn(1);m.cmp(w)>=0?(m.isub(w),_.isub(S),R.isub(k)):(w.isub(m),S.isub(_),k.isub(R))}return{a:S,b:k,gcd:w.iushln(y)}},s.prototype._invmp=function(p){n(p.negative===0),n(!p.isZero());var m=this,w=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var _=new s(1),R=new s(0),S=w.clone();m.cmpn(1)>0&&w.cmpn(1)>0;){for(var k=0,y=1;!(m.words[0]&y)&&k<26;++k,y<<=1);if(k>0)for(m.iushrn(k);k-- >0;)_.isOdd()&&_.iadd(S),_.iushrn(1);for(var b=0,V=1;!(w.words[0]&V)&&b<26;++b,V<<=1);if(b>0)for(w.iushrn(b);b-- >0;)R.isOdd()&&R.iadd(S),R.iushrn(1);m.cmp(w)>=0?(m.isub(w),_.isub(R)):(w.isub(m),R.isub(_))}var ce;return m.cmpn(1)===0?ce=_:ce=R,ce.cmpn(0)<0&&ce.iadd(p),ce},s.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),w=p.clone();m.negative=0,w.negative=0;for(var _=0;m.isEven()&&w.isEven();_++)m.iushrn(1),w.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;w.isEven();)w.iushrn(1);var R=m.cmp(w);if(R<0){var S=m;m=w,w=S}else if(R===0||w.cmpn(1)===0)break;m.isub(w)}while(!0);return w.iushln(_)},s.prototype.invm=function(p){return this.egcd(p).a.umod(p)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(p){return this.words[0]&p},s.prototype.bincn=function(p){n(typeof p=="number");var m=p%26,w=(p-m)/26,_=1<>>26,k&=67108863,this.words[S]=k}return R!==0&&(this.words[S]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var w;if(this.length>1)w=1;else{m&&(p=-p),n(p<=67108863,"Number is too big");var _=this.words[0]|0;w=_===p?0:_p.length)return 1;if(this.length=0;w--){var _=this.words[w]|0,R=p.words[w]|0;if(_!==R){_R&&(m=1);break}}return m},s.prototype.gtn=function(p){return this.cmpn(p)===1},s.prototype.gt=function(p){return this.cmp(p)===1},s.prototype.gten=function(p){return this.cmpn(p)>=0},s.prototype.gte=function(p){return this.cmp(p)>=0},s.prototype.ltn=function(p){return this.cmpn(p)===-1},s.prototype.lt=function(p){return this.cmp(p)===-1},s.prototype.lten=function(p){return this.cmpn(p)<=0},s.prototype.lte=function(p){return this.cmp(p)<=0},s.prototype.eqn=function(p){return this.cmpn(p)===0},s.prototype.eq=function(p){return this.cmp(p)===0},s.red=function(p){return new U(p)},s.prototype.toRed=function(p){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(p){return this.red=p,this},s.prototype.forceRed=function(p){return n(!this.red,"Already a number in reduction context"),this._forceRed(p)},s.prototype.redAdd=function(p){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},s.prototype.redIAdd=function(p){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},s.prototype.redSub=function(p){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},s.prototype.redISub=function(p){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},s.prototype.redShl=function(p){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},s.prototype.redMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},s.prototype.redIMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(p){return n(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var j={k256:null,p224:null,p192:null,p25519:null};function H(p,m){this.name=p,this.p=new s(m,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var p=new s(null);return p.words=new Array(Math.ceil(this.n/13)),p},H.prototype.ireduce=function(p){var m=p,w;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),w=m.bitLength();while(w>this.n);var _=w0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},H.prototype.split=function(p,m){p.iushrn(this.n,0,m)},H.prototype.imulK=function(p){return p.imul(this.k)};function I(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(I,H),I.prototype.split=function(p,m){for(var w=4194303,_=Math.min(p.length,9),R=0;R<_;R++)m.words[R]=p.words[R];if(m.length=_,p.length<=9){p.words[0]=0,p.length=1;return}var S=p.words[9];for(m.words[m.length++]=S&w,R=10;R>>22,S=k}S>>>=22,p.words[R-10]=S,S===0&&p.length>10?p.length-=10:p.length-=9},I.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,w=0;w>>=26,p.words[w]=R,m=_}return m!==0&&(p.words[p.length++]=m),p},s._prime=function(p){if(j[p])return j[p];var m;if(p==="k256")m=new I;else if(p==="p224")m=new T;else if(p==="p192")m=new B;else if(p==="p25519")m=new K;else throw new Error("Unknown prime "+p);return j[p]=m,m};function U(p){if(typeof p=="string"){var m=s._prime(p);this.m=m.p,this.prime=m}else n(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}U.prototype._verify1=function(p){n(p.negative===0,"red works only with positives"),n(p.red,"red works only with red numbers")},U.prototype._verify2=function(p,m){n((p.negative|m.negative)===0,"red works only with positives"),n(p.red&&p.red===m.red,"red works only with red numbers")},U.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):(d(p,p.umod(this.m)._forceRed(this)),p)},U.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},U.prototype.add=function(p,m){this._verify2(p,m);var w=p.add(m);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},U.prototype.iadd=function(p,m){this._verify2(p,m);var w=p.iadd(m);return w.cmp(this.m)>=0&&w.isub(this.m),w},U.prototype.sub=function(p,m){this._verify2(p,m);var w=p.sub(m);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},U.prototype.isub=function(p,m){this._verify2(p,m);var w=p.isub(m);return w.cmpn(0)<0&&w.iadd(this.m),w},U.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},U.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},U.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},U.prototype.isqr=function(p){return this.imul(p,p.clone())},U.prototype.sqr=function(p){return this.mul(p,p)},U.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var w=this.m.add(new s(1)).iushrn(2);return this.pow(p,w)}for(var _=this.m.subn(1),R=0;!_.isZero()&&_.andln(1)===0;)R++,_.iushrn(1);n(!_.isZero());var S=new s(1).toRed(this),k=S.redNeg(),y=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new s(2*b*b).toRed(this);this.pow(b,y).cmp(k)!==0;)b.redIAdd(k);for(var V=this.pow(b,_),ce=this.pow(p,_.addn(1).iushrn(1)),fe=this.pow(p,_),W=R;fe.cmp(S)!==0;){for(var ue=fe,J=0;ue.cmp(S)!==0;J++)ue=ue.redSqr();n(J=0;R--){for(var V=m.words[R],ce=b-1;ce>=0;ce--){var fe=V>>ce&1;if(S!==_[0]&&(S=this.sqr(S)),fe===0&&k===0){y=0;continue}k<<=1,k|=fe,y++,!(y!==w&&(R!==0||ce!==0))&&(S=this.mul(S,_[k]),y=0,k=0)}b=26}return S},U.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},U.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},s.mont=function(p){return new C(p)};function C(p){U.call(this,p),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(C,U),C.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},C.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},C.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var w=p.imul(m),_=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=w.isub(_).iushrn(this.shift),S=R;return R.cmp(this.m)>=0?S=R.isub(this.m):R.cmpn(0)<0&&(S=R.iadd(this.m)),S._forceRed(this)},C.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new s(0)._forceRed(this);var w=p.mul(m),_=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=w.isub(_).iushrn(this.shift),S=R;return R.cmp(this.m)>=0?S=R.isub(this.m):R.cmpn(0)<0&&(S=R.iadd(this.m)),S._forceRed(this)},C.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,PU)})(OU);var or=OU.exports;const DU="bignumber/5.7.0";var T5=or.BN;const uu=new Si(DU),v9={},kP=9007199254740991;function h0e(t){return t!=null&&(_s.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||xo(t)||typeof t=="bigint"||bg(t))}let RP=!1,_s=class Za{constructor(e,r){e!==v9&&uu.throwError("cannot call constructor directly; use BigNumber.from",Si.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ls(Er(this).fromTwos(e))}toTwos(e){return Ls(Er(this).toTwos(e))}abs(){return this._hex[0]==="-"?Za.from(this._hex.substring(1)):this}add(e){return Ls(Er(this).add(Er(e)))}sub(e){return Ls(Er(this).sub(Er(e)))}div(e){return Za.from(e).isZero()&&Jo("division-by-zero","div"),Ls(Er(this).div(Er(e)))}mul(e){return Ls(Er(this).mul(Er(e)))}mod(e){const r=Er(e);return r.isNeg()&&Jo("division-by-zero","mod"),Ls(Er(this).umod(r))}pow(e){const r=Er(e);return r.isNeg()&&Jo("negative-power","pow"),Ls(Er(this).pow(r))}and(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","and"),Ls(Er(this).and(r))}or(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","or"),Ls(Er(this).or(r))}xor(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","xor"),Ls(Er(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Jo("negative-width","mask"),Ls(Er(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Jo("negative-width","shl"),Ls(Er(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Jo("negative-width","shr"),Ls(Er(this).shrn(e))}eq(e){return Er(this).eq(Er(e))}lt(e){return Er(this).lt(Er(e))}lte(e){return Er(this).lte(Er(e))}gt(e){return Er(this).gt(Er(e))}gte(e){return Er(this).gte(Er(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Er(this).isZero()}toNumber(){try{return Er(this).toNumber()}catch{Jo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return uu.throwError("this platform does not support BigInt",Si.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?RP||(RP=!0,uu.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?uu.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Si.errors.UNEXPECTED_ARGUMENT,{}):uu.throwError("BigNumber.toString does not accept parameters",Si.errors.UNEXPECTED_ARGUMENT,{})),Er(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Za)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Za(v9,dv(e)):e.match(/^-?[0-9]+$/)?new Za(v9,dv(new T5(e))):uu.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Jo("underflow","BigNumber.from",e),(e>=kP||e<=-kP)&&Jo("overflow","BigNumber.from",e),Za.from(String(e));const r=e;if(typeof r=="bigint")return Za.from(r.toString());if(bg(r))return Za.from(zs(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Za.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(xo(n)||n[0]==="-"&&xo(n.substring(1))))return Za.from(n)}return uu.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function dv(t){if(typeof t!="string")return dv(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&uu.throwArgumentError("invalid hex","value",t),t=dv(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Ls(t){return _s.from(dv(t))}function Er(t){const e=_s.from(t).toHexString();return e[0]==="-"?new T5("-"+e.substring(3),16):new T5(e.substring(2),16)}function Jo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),uu.throwError(t,Si.errors.NUMERIC_FAULT,n)}function p0e(t){return new T5(t,36).toString(16)}const ms=new Si(DU),tw={},LU=_s.from(0),BU=_s.from(-1);function UU(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),ms.throwError(t,Si.errors.NUMERIC_FAULT,i)}let rw="0";for(;rw.length<256;)rw+=rw;function OE(t){if(typeof t!="number")try{t=_s.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+rw.substring(0,t):ms.throwArgumentError("invalid decimal size","decimals",t)}function y9(t,e){e==null&&(e=0);const r=OE(e);t=_s.from(t);const n=t.lt(LU);n&&(t=t.mul(BU));let i=t.mod(r).toString();for(;i.length2&&ms.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&UU("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&ms.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&ms.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&ms.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new LC(tw,r,n,i)}},jU=class us{constructor(e,r,n,i){e!==tw&&ms.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Si.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ms.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=tu(this._value,this.format.decimals),n=tu(e._value,e.format.decimals);return us.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=tu(this._value,this.format.decimals),n=tu(e._value,e.format.decimals);return us.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=tu(this._value,this.format.decimals),n=tu(e._value,e.format.decimals);return us.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=tu(this._value,this.format.decimals),n=tu(e._value,e.format.decimals);return us.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=us.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(PP.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=us.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(PP.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&ms.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=us.from("1"+rw.substring(0,e),this.format),i=g0e.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&ms.throwArgumentError("invalid byte width","width",e);const r=_s.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return dl(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return us.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!h0e(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),us.fromString(y9(e,r),b9.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=b9.from(r),i=tu(e,n.decimals);!n.signed&&i.lt(LU)&&UU("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=dl(s,n.width/8));const o=y9(i,n.decimals);return new us(tw,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=b9.from(r);if(Dn(e).length>n.width/8)throw new Error("overflow");let i=_s.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=y9(i,n.decimals);return new us(tw,s,o,n)}static from(e,r){if(typeof e=="string")return us.fromString(e,r);if(bg(e))return us.fromBytes(e,r);try{return us.fromValue(e,0,r)}catch(n){if(n.code!==Si.errors.INVALID_ARGUMENT)throw n}return ms.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const PP=jU.from(1),g0e=jU.from("0.5"),m0e="strings/5.7.0",w0e=new Si(m0e);var k5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(k5||(k5={}));var NP;(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"})(NP||(NP={}));function x9(t,e=k5.current){e!=k5.current&&(w0e.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 Dn(r)}function v0e(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function MP(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}MP("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),C9("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),C9("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),C9("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",v0e),MP("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function y0e(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function b0e(t){const e={};for(let r=0;r>--c&1}const f=31,g=Math.pow(2,f),v=g>>>1,x=v>>1,P=g-1;let M=0;for(let j=0;j1;){let K=H+I>>>1;j>>1|d(),T=T<<1^v,B=(B^v)<<1|v|1;E=T,$=1+B-T}let L=n-4;return N.map(j=>{switch(j-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 j-1}})}function C0e(t){let e=0;return()=>t[e++]}function _0e(t){return C0e(x0e(t))}function A0e(t){return t&1?~t>>1:t>>1}function E0e(t,e){let r=Array(t);for(let n=0;ne[o]):r}function I0e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(k0e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(R0e(r,t))}return b0e(FU(e))}function T0e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function zU(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function k0e(t,e){let r=1+e(),n=e(),i=T0e(e),s=zU(i.length,1+t,e);return FU(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((d,f)=>{let g=f*n;return[c+f*r,l.map(v=>v+g)]})}))}function R0e(t,e){let r=1+e();return zU(r,1+t,e).map(n=>[n[0],n.slice(1)])}function P0e(t){let e=R5(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=R5(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,d)=>d.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function N0e(){return _0e(y0e("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Cy=N0e();new Set(R5(Cy)),new Set(R5(Cy)),I0e(Cy),P0e(Cy);const M0e=new Uint8Array(32);M0e.fill(0);const $0e=`Ethereum Signed Message: -`;function WU(t){return typeof t=="string"&&(t=x9(t)),$E(a0e([x9($0e),x9(String(t.length)),t]))}const O0e="address/5.7.0",$m=new Si(O0e);function OP(t){xo(t,20)||$m.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=Dn($E(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 D0e=9007199254740991;function L0e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const DE={};for(let t=0;t<10;t++)DE[String(t)]=String(t);for(let t=0;t<26;t++)DE[String.fromCharCode(65+t)]=String(10+t);const DP=Math.floor(L0e(D0e));function B0e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>DE[n]).join("");for(;e.length>=DP;){let n=e.substring(0,DP);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 U0e(t){let e=null;if(typeof t!="string"&&$m.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=OP(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&$m.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)!==B0e(t)&&$m.throwArgumentError("bad icap checksum","address",t),e=p0e(t.substring(4));e.length<40;)e="0"+e;e=OP("0x"+e)}else $m.throwArgumentError("invalid address","address",t);return e}function gm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}const j0e=new Uint8Array(32);j0e.fill(0),_s.from(-1);const F0e=_s.from(0),z0e=_s.from(1);_s.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),dl(z0e.toHexString(),32),dl(F0e.toHexString(),32);var Gc={},Tr={},_2=HU;function HU(t,e){if(!t)throw new Error(e||"Assertion failed")}HU.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var BC={exports:{}};typeof Object.create=="function"?BC.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:BC.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var W0e=_2,H0e=BC.exports;Tr.inherits=H0e;function q0e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function V0e(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):q0e(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}Tr.htonl=qU;function G0e(t,e){for(var r="",n=0;n>>0}return s}Tr.join32=Z0e;function Q0e(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}Tr.split32=Q0e;function Y0e(t,e){return t>>>e|t<<32-e}Tr.rotr32=Y0e;function J0e(t,e){return t<>>32-e}Tr.rotl32=J0e;function X0e(t,e){return t+e>>>0}Tr.sum32=X0e;function epe(t,e,r){return t+e+r>>>0}Tr.sum32_3=epe;function tpe(t,e,r,n){return t+e+r+n>>>0}Tr.sum32_4=tpe;function rpe(t,e,r,n,i){return t+e+r+n+i>>>0}Tr.sum32_5=rpe;function npe(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Tr.sum64=npe;function ipe(t,e,r,n){var i=e+n>>>0,s=(i>>0}Tr.sum64_hi=ipe;function spe(t,e,r,n){var i=e+n;return i>>>0}Tr.sum64_lo=spe;function ope(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}Tr.sum64_4_hi=ope;function ape(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Tr.sum64_4_lo=ape;function cpe(t,e,r,n,i,s,o,a,c,l){var d=0,f=e;f=f+n>>>0,d+=f>>0,d+=f>>0,d+=f>>0,d+=f>>0}Tr.sum64_5_hi=cpe;function lpe(t,e,r,n,i,s,o,a,c,l){var d=e+n+s+a+l;return d>>>0}Tr.sum64_5_lo=lpe;function upe(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Tr.rotr64_hi=upe;function dpe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Tr.rotr64_lo=dpe;function fpe(t,e,r){return t>>>r}Tr.shr64_hi=fpe;function hpe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Tr.shr64_lo=hpe;var xg={},LP=Tr,ppe=_2;function _y(){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}xg.BlockHash=_y,_y.prototype.update=function(t,e){if(t=LP.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=LP.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=t&255}else for(n[i++]=t&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,s=8;s>>3}Ll.g0_256=ype;function bpe(t){return fl(t,17)^fl(t,19)^t>>>10}Ll.g1_256=bpe;var j1=Tr,xpe=xg,Cpe=Ll,_9=j1.rotl32,mm=j1.sum32,_pe=j1.sum32_5,Ape=Cpe.ft_1,YU=xpe.BlockHash,Epe=[1518500249,1859775393,2400959708,3395469782];function tl(){if(!(this instanceof tl))return new tl;YU.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}j1.inherits(tl,YU);var Spe=tl;tl.blockSize=512,tl.outSize=160,tl.hmacStrength=80,tl.padLength=64,tl.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=new this.Hash().update(t).digest()),h1e(t.length<=this.blockSize);for(var e=t.length;e>8,g=d&255;f?c.push(f,g):c.push(g)}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(g>>1)-1?P=(g>>1)-M:P=M,v.isubn(P)):P=0,f[x]=P,v.iushrn(1)}return f}r.getNAF=n;function i(c,l){var d=[[],[]];c=c.clone(),l=l.clone();for(var f=0,g=0,v;c.cmpn(-f)>0||l.cmpn(-g)>0;){var x=c.andln(3)+f&3,P=l.andln(3)+g&3;x===3&&(x=-1),P===3&&(P=-1);var M;x&1?(v=c.andln(7)+f&7,(v===3||v===5)&&P===2?M=-x:M=x):M=0,d[0].push(M);var N;P&1?(v=l.andln(7)+g&7,(v===3||v===5)&&x===2?N=-P:N=P):N=0,d[1].push(N),2*f===M+1&&(f=1-f),2*g===N+1&&(g=1-g),c.iushrn(1),l.iushrn(1)}return d}r.getJSF=i;function s(c,l,d){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=d.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 or(c,"hex","le")}r.intFromLE=a}),Ey=Eo.getNAF,m1e=Eo.getJSF,P5=Eo.assert;function Td(t,e){this.type=t,this.p=new or(e.p,16),this.red=e.prime?or.red(e.prime):or.mont(this.p),this.zero=new or(0).toRed(this.red),this.one=new or(1).toRed(this.red),this.two=new or(2).toRed(this.red),this.n=e.n&&new or(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 $0=Td;Td.prototype.point=function(){throw new Error("Not implemented")},Td.prototype.validate=function(){throw new Error("Not implemented")},Td.prototype._fixedNafMul=function(t,e){P5(t.precomputed);var r=t._getDoubles(),n=Ey(e,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;a--){for(var c=0;a>=0&&s[a]===0;a--)c++;if(a>=0&&c++,o=o.dblp(c),a<0)break;var l=s[a];P5(l!==0),t.type==="affine"?l>0?o=o.mixedAdd(i[l-1>>1]):o=o.mixedAdd(i[-l-1>>1].neg()):l>0?o=o.add(i[l-1>>1]):o=o.add(i[-l-1>>1].neg())}return t.type==="affine"?o.toP():o},Td.prototype._wnafMulAdd=function(t,e,r,n,i){var s=this._wnafT1,o=this._wnafT2,a=this._wnafT3,c=0,l,d,f;for(l=0;l=1;l-=2){var v=l-1,x=l;if(s[v]!==1||s[x]!==1){a[v]=Ey(r[v],s[v],this._bitLength),a[x]=Ey(r[x],s[x],this._bitLength),c=Math.max(a[v].length,c),c=Math.max(a[x].length,c);continue}var P=[e[v],null,null,e[x]];e[v].y.cmp(e[x].y)===0?(P[1]=e[v].add(e[x]),P[2]=e[v].toJ().mixedAdd(e[x].neg())):e[v].y.cmp(e[x].y.redNeg())===0?(P[1]=e[v].toJ().mixedAdd(e[x]),P[2]=e[v].add(e[x].neg())):(P[1]=e[v].toJ().mixedAdd(e[x]),P[2]=e[v].toJ().mixedAdd(e[x].neg()));var M=[-3,-1,-5,-7,0,7,5,1,3],N=m1e(r[v],r[x]);for(c=Math.max(N[0].length,c),a[v]=new Array(c),a[x]=new Array(c),d=0;d=0;l--){for(var H=0;l>=0;){var I=!0;for(d=0;d=0&&H++,L=L.dblp(H),l<0)break;for(d=0;d0?f=o[d][T-1>>1]:T<0&&(f=o[d][-T-1>>1].neg()),f.type==="affine"?L=L.mixedAdd(f):L=L.add(f))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step):!1},Xo.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(g=c,v=l),d.negative&&(d=d.neg(),f=f.neg()),g.negative&&(g=g.neg(),v=v.neg()),[{a:d,b:f},{a:g,b:v}]},ua.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),c=i.mul(r.b),l=s.mul(n.b),d=t.sub(o).sub(a),f=c.add(l).neg();return{k1:d,k2:f}},ua.prototype.pointFromX=function(t,e){t=new or(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},ua.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},ua.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s":""},fi.prototype.isInfinity=function(){return this.inf},fi.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},fi.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},fi.prototype.getX=function(){return this.x.fromRed()},fi.prototype.getY=function(){return this.y.fromRed()},fi.prototype.mul=function(t){return t=new or(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},fi.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},fi.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},fi.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},fi.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},fi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function _i(t,e,r,n){$0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new or(0)):(this.x=new or(e,16),this.y=new or(r,16),this.z=new or(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}BE(_i,$0.BasePoint),ua.prototype.jpoint=function(t,e,r){return new _i(this,t,e,r)},_i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},_i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_i.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.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(),d=l.redMul(a),f=n.redMul(l),g=c.redSqr().redIAdd(d).redISub(f).redISub(f),v=c.redMul(f.redISub(g)).redISub(s.redMul(d)),x=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(g,v,x)},_i.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(o.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),l=c.redMul(o),d=r.redMul(c),f=a.redSqr().redIAdd(l).redISub(d).redISub(d),g=a.redMul(d.redISub(f)).redISub(i.redMul(l)),v=this.z.redMul(o);return this.curve.jpoint(f,g,v)},_i.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},_i.prototype.inspect=function(){return this.isInfinity()?"":""},_i.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ub=_g(function(t,e){var r=e;r.base=$0,r.short=v1e,r.mont=null,r.edwards=null}),db=_g(function(t,e){var r=e,n=Eo.assert;function i(a){a.type==="short"?this.curve=new ub.short(a):a.type==="edwards"?this.curve=new ub.edwards(a):this.curve=new ub.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:Gc.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:Gc.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:Gc.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:Gc.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:Gc.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:Gc.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:Gc.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:Gc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function kd(t){if(!(this instanceof kd))return new kd(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=cc.toArray(t.entropy,t.entropyEnc||"hex"),r=cc.toArray(t.nonce,t.nonceEnc||"hex"),n=cc.toArray(t.pers,t.persEnc||"hex");LE(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var FP=kd;kd.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},kd.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(n=r,r=e,e=null),r&&(r=cc.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var y1e=Eo.assert;function v4(t,e){if(t instanceof v4)return t;this._importDER(t,e)||(y1e(t.r&&t.s,"Signature without r or s"),this.r=new or(t.r,16),this.s=new or(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Sy=v4;function b1e(){this.place=0}function T9(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 zP(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)}v4.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=zP(e),r=zP(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];k9(n,e.length),n=n.concat(e),n.push(2),k9(n,r.length);var i=n.concat(r),s=[48];return k9(s,i.length),s=s.concat(i),Eo.encode(s,t)};var x1e=function(){throw new Error("unsupported")},lj=Eo.assert;function aa(t){if(!(this instanceof aa))return new aa(t);typeof t=="string"&&(lj(Object.prototype.hasOwnProperty.call(db,t),"Unknown curve "+t),t=db[t]),t instanceof db.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 C1e=aa;aa.prototype.keyPair=function(t){return new I9(this,t)},aa.prototype.keyFromPrivate=function(t,e){return I9.fromPrivate(this,t,e)},aa.prototype.keyFromPublic=function(t,e){return I9.fromPublic(this,t,e)},aa.prototype.genKeyPair=function(t){t||(t={});for(var e=new FP({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||x1e(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new or(2));;){var i=new or(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},aa.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},aa.prototype.sign=function(t,e,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new or(t,16));for(var i=this.n.byteLength(),s=e.getPrivate().toArray("be",i),o=t.toArray("be",i),a=new FP({hash:this.hash,entropy:s,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new or(1)),l=0;;l++){var d=n.k?n.k(l):new or(a.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(c)>=0)){var f=this.g.mul(d);if(!f.isInfinity()){var g=f.getX(),v=g.umod(this.n);if(v.cmpn(0)!==0){var x=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(x=x.umod(this.n),x.cmpn(0)!==0){var P=(f.getY().isOdd()?1:0)|(g.cmp(v)!==0?2:0);return n.canonical&&x.cmp(this.nh)>0&&(x=this.n.sub(x),P^=1),new Sy({r:v,s:x,recoveryParam:P})}}}}}},aa.prototype.verify=function(t,e,r,n){t=this._truncateToN(new or(t,16)),r=this.keyFromPublic(r,n),e=new Sy(e,"hex");var i=e.r,s=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o=s.invm(this.n),a=o.mul(t).umod(this.n),c=o.mul(i).umod(this.n),l;return this.curve._maxwellTrick?(l=this.g.jmulAdd(a,r.getPublic(),c),l.isInfinity()?!1:l.eqXToP(i)):(l=this.g.mulAdd(a,r.getPublic(),c),l.isInfinity()?!1:l.getX().umod(this.n).cmp(i)===0)},aa.prototype.recoverPubKey=function(t,e,r,n){lj((3&r)===r,"The recovery param is more than two bits"),e=new Sy(e,n);var i=this.n,s=new or(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 d=e.r.invm(i),f=i.sub(s).mul(d).umod(i),g=a.mul(d).umod(i);return this.g.mulAdd(f,o,g)},aa.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Sy(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 _1e=_g(function(t,e){var r=e;r.version="6.5.4",r.utils=Eo,r.rand=function(){throw new Error("unsupported")},r.curve=ub,r.curves=db,r.ec=C1e,r.eddsa=null}),A1e=_1e.ec;const E1e="signing-key/5.7.0",FC=new Si(E1e);let R9=null;function xd(){return R9||(R9=new A1e("secp256k1")),R9}class S1e{constructor(e){gm(this,"curve","secp256k1"),gm(this,"privateKey",zs(e)),l0e(this.privateKey)!==32&&FC.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=xd().keyFromPrivate(Dn(this.privateKey));gm(this,"publicKey","0x"+r.getPublic(!1,"hex")),gm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),gm(this,"_isSigningKey",!0)}_addPoint(e){const r=xd().keyFromPublic(Dn(this.publicKey)),n=xd().keyFromPublic(Dn(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=xd().keyFromPrivate(Dn(this.privateKey)),n=Dn(e);n.length!==32&&FC.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return $U({recoveryParam:i.recoveryParam,r:dl("0x"+i.r.toString(16),32),s:dl("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=xd().keyFromPrivate(Dn(this.privateKey)),n=xd().keyFromPublic(Dn(uj(e)));return dl("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function I1e(t,e){const r=$U(e),n={r:Dn(r.r),s:Dn(r.s)};return"0x"+xd().recoverPubKey(Dn(t),n,r.recoveryParam).encode("hex",!1)}function uj(t,e){const r=Dn(t);return r.length===32?new S1e(r).publicKey:r.length===33?"0x"+xd().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?zs(r):FC.throwArgumentError("invalid public or private key","key","[REDACTED]")}var WP;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(WP||(WP={}));function T1e(t){const e=uj(t);return U0e(TP($E(TP(e,1)),12))}function k1e(t,e){return T1e(I1e(Dn(t),e))}const R1e="https://rpc.walletconnect.com/v1";async function P1e(t,e,r,n,i,s){switch(r.t){case"eip191":return N1e(t,e,r.s);case"eip1271":return await M1e(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function N1e(t,e,r){return k1e(WU(e),r).toLowerCase()===t.toLowerCase()}async function M1e(t,e,r,n,i,s){try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",l=r.substring(2),d=WU(e).substring(2),f=o+d+a+c+l,g=await fetch(`${s||R1e}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:$1e(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:v}=await g.json();return v?v.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function $1e(){return Date.now()+Math.floor(Math.random()*1e3)}var O1e=Object.defineProperty,D1e=Object.defineProperties,L1e=Object.getOwnPropertyDescriptors,HP=Object.getOwnPropertySymbols,B1e=Object.prototype.hasOwnProperty,U1e=Object.prototype.propertyIsEnumerable,qP=(t,e,r)=>e in t?O1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j1e=(t,e)=>{for(var r in e||(e={}))B1e.call(e,r)&&qP(t,r,e[r]);if(HP)for(var r of HP(e))U1e.call(e,r)&&qP(t,r,e[r]);return t},F1e=(t,e)=>D1e(t,L1e(e));const z1e="did:pkh:",UE=t=>t==null?void 0:t.split(":"),dj=t=>{const e=t&&UE(t);if(e)return t.includes(z1e)?e[3]:e[1]},VP=t=>{const e=t&&UE(t);if(e)return e[2]+":"+e[3]},N5=t=>{const e=t&&UE(t);if(e)return e.pop()};async function KP(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=fj(i,i.iss),o=N5(i.iss);return await P1e(o,s,n,dj(i.iss),r)}const fj=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=N5(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: ${dj(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,d=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,g=t.requestId?`Request ID: ${t.requestId}`:void 0,v=t.resources?`Resources:${t.resources.map(P=>` -- ${P}`).join("")}`:void 0,x=fb(t.resources);if(x){const P=fv(x);i=Y1e(i,P)}return[r,n,"",i,"",s,o,a,c,l,d,f,g,v].filter(P=>P!=null).join(` -`)};function W1e(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function H1e(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Jh(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 q1e(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:V1e(e,r,n)}}}function V1e(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 hj(t){return Jh(t),`urn:recap:${W1e(t).replace(/=/g,"")}`}function fv(t){const e=H1e(t.replace("urn:recap:",""));return Jh(e),e}function K1e(t,e,r){const n=q1e(t,e,r);return hj(n)}function G1e(t){return t&&t.includes("urn:recap:")}function Z1e(t,e){const r=fv(t),n=fv(e),i=Q1e(r,n);return hj(i)}function Q1e(t,e){Jh(t),Jh(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]=F1e(j1e({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function Y1e(t="",e){Jh(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(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));c.sort((f,g)=>f.action.localeCompare(g.action));const l={};c.forEach(f=>{l[f.ability]||(l[f.ability]=[]),l[f.ability].push(f.action)});const d=Object.keys(l).map(f=>(i++,`(${i}) '${f}': '${l[f].join("', '")}' for '${a}'.`));n.push(d.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function GP(t){var e;const r=fv(t);Jh(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function ZP(t){const e=fv(t);Jh(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 fb(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return G1e(e)?e:void 0}const pj="base10",vs="base16",jd="base64pad",vm="base64url",A2="utf8",gj=0,_u=1,E2=2,J1e=0,QP=1,nw=12,jE=32;function X1e(){const t=SE.generateKeyPair();return{privateKey:vi(t.secretKey,vs),publicKey:vi(t.publicKey,vs)}}function zC(){const t=kf.randomBytes(jE);return vi(t,vs)}function ege(t,e){const r=SE.sharedKey(mi(t,vs),mi(e,vs),!0),n=new yde(v2.SHA256,r).expand(jE);return vi(n,vs)}function hb(t){const e=v2.hash(mi(t,vs));return vi(e,vs)}function fu(t){const e=v2.hash(mi(t,A2));return vi(e,vs)}function mj(t){return mi(`${t}`,pj)}function Xh(t){return Number(vi(t,pj))}function tge(t){const e=mj(typeof t.type<"u"?t.type:gj);if(Xh(e)===_u&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?mi(t.senderPublicKey,vs):void 0,n=typeof t.iv<"u"?mi(t.iv,vs):kf.randomBytes(nw),i=new AE.ChaCha20Poly1305(mi(t.symKey,vs)).seal(n,mi(t.message,A2));return wj({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function rge(t,e){const r=mj(E2),n=kf.randomBytes(nw),i=mi(t,A2);return wj({type:r,sealed:i,iv:n,encoding:e})}function nge(t){const e=new AE.ChaCha20Poly1305(mi(t.symKey,vs)),{sealed:r,iv:n}=hv({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 vi(i,A2)}function ige(t,e){const{sealed:r}=hv({encoded:t,encoding:e});return vi(r,A2)}function wj(t){const{encoding:e=jd}=t;if(Xh(t.type)===E2)return vi(ab([t.type,t.sealed]),e);if(Xh(t.type)===_u){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return vi(ab([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return vi(ab([t.type,t.iv,t.sealed]),e)}function hv(t){const{encoded:e,encoding:r=jd}=t,n=mi(e,r),i=n.slice(J1e,QP),s=QP;if(Xh(i)===_u){const l=s+jE,d=l+nw,f=n.slice(s,l),g=n.slice(l,d),v=n.slice(d);return{type:i,sealed:v,iv:g,senderPublicKey:f}}if(Xh(i)===E2){const l=n.slice(s),d=kf.randomBytes(nw);return{type:i,sealed:l,iv:d}}const o=s+nw,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function sge(t,e){const r=hv({encoded:t,encoding:e==null?void 0:e.encoding});return vj({type:Xh(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?vi(r.senderPublicKey,vs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function vj(t){const e=(t==null?void 0:t.type)||gj;if(e===_u){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 YP(t){return t.type===_u&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function JP(t){return t.type===E2}function oge(t){return new JB.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function age(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function cge(t){return Buffer.from(age(t),"base64")}function lge(t,e){const[r,n,i]=t.split("."),s=cge(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 v2.SHA256().update(Buffer.from(c)).digest(),d=oge(e),f=Buffer.from(l).toString("hex");if(!d.verify(f,{r:o,s:a}))throw new Error("Invalid signature");return kC(t).payload}const uge="irn";function WC(t){return(t==null?void 0:t.relay)||{protocol:uge}}function Om(t){const e=Dhe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var dge=Object.defineProperty,fge=Object.defineProperties,hge=Object.getOwnPropertyDescriptors,XP=Object.getOwnPropertySymbols,pge=Object.prototype.hasOwnProperty,gge=Object.prototype.propertyIsEnumerable,eN=(t,e,r)=>e in t?dge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tN=(t,e)=>{for(var r in e||(e={}))pge.call(e,r)&&eN(t,r,e[r]);if(XP)for(var r of XP(e))gge.call(e,r)&&eN(t,r,e[r]);return t},mge=(t,e)=>fge(t,hge(e));function wge(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 rN(t){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=lv.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:vge(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:wge(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function vge(t){return t.startsWith("//")?t.substring(2):t}function yge(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 bge(t){return`${t.protocol}:${t.topic}@${t.version}?`+lv.stringify(tN(mge(tN({symKey:t.symKey},yge(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Iy(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Ag(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function xge(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ag(r.accounts))}),e}function Cge(t,e){const r=[];return Object.values(t).forEach(n=>{Ag(n.accounts).includes(e)&&r.push(...n.methods)}),r}function _ge(t,e){const r=[];return Object.values(t).forEach(n=>{Ag(n.accounts).includes(e)&&r.push(...n.events)}),r}function FE(t){return t.includes(":")}function Dm(t){return FE(t)?t.split(":")[0]:t}function Age(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 nN(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=Age(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=cb(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const Ege={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}},Sge={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 Qe(t,e){const{message:r,code:n}=Sge[t];return{message:e?`${r} ${e}`:r,code:n}}function Vr(t,e){const{message:r,code:n}=Ege[t];return{message:e?`${r} ${e}`:r,code:n}}function e0(t,e){return!!Array.isArray(t)}function pv(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Hs(t){return typeof t>"u"}function Wn(t,e){return e&&Hs(t)?!0:typeof t=="string"&&!!t.trim().length}function zE(t,e){return typeof t=="number"&&!isNaN(t)}function Ige(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return mh(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],d=Ag(a),f=r[o];(!mh(SU(o,f),d)||!mh(f.methods,c)||!mh(f.events,l))&&(s=!1)}),s):!1}function M5(t){return Wn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Tge(t){if(Wn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&M5(r)}}return!1}function kge(t){if(Wn(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Rge(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function Pge(t){return t==null?void 0:t.topic}function Nge(t,e){let r=null;return Wn(t==null?void 0:t.publicKey,!1)||(r=Qe("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function iN(t){let e=!0;return e0(t)?t.length&&(e=t.every(r=>Wn(r,!1))):e=!1,e}function Mge(t,e,r){let n=null;return e0(e)&&e.length?e.forEach(i=>{n||M5(i)||(n=Vr("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):M5(t)||(n=Vr("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 $ge(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=Mge(i,SU(i,s),`${e} ${r}`);o&&(n=o)}),n}function Oge(t,e){let r=null;return e0(t)?t.forEach(n=>{r||Tge(n)||(r=Vr("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Vr("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Dge(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Oge(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function Lge(t,e){let r=null;return iN(t==null?void 0:t.methods)?iN(t==null?void 0:t.events)||(r=Vr("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Vr("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function yj(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Lge(n,`${e}, namespace`);i&&(r=i)}),r}function Bge(t,e,r){let n=null;if(t&&pv(t)){const i=yj(t,e);i&&(n=i);const s=$ge(t,e,r);s&&(n=s)}else n=Qe("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function P9(t,e){let r=null;if(t&&pv(t)){const n=yj(t,e);n&&(r=n);const i=Dge(t,e);i&&(r=i)}else r=Qe("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function bj(t){return Wn(t.protocol,!0)}function Uge(t,e){let r=!1;return t?t&&e0(t)&&t.length&&t.forEach(n=>{r=bj(n)}):r=!0,r}function jge(t){return typeof t=="number"}function Fs(t){return typeof t<"u"&&typeof t!==null}function Fge(t){return!(!t||typeof t!="object"||!t.code||!zE(t.code)||!t.message||!Wn(t.message,!1))}function zge(t){return!(Hs(t)||!Wn(t.method,!1))}function Wge(t){return!(Hs(t)||Hs(t.result)&&Hs(t.error)||!zE(t.id)||!Wn(t.jsonrpc,!1))}function Hge(t){return!(Hs(t)||!Wn(t.name,!1))}function sN(t,e){return!(!M5(e)||!xge(t).includes(e))}function qge(t,e,r){return Wn(r,!1)?Cge(t,e).includes(r):!1}function Vge(t,e,r){return Wn(r,!1)?_ge(t,e).includes(r):!1}function oN(t,e,r){let n=null;const i=Kge(t),s=Gge(e),o=Object.keys(i),a=Object.keys(s),c=aN(Object.keys(t)),l=aN(Object.keys(e)),d=c.filter(f=>!l.includes(f));return d.length&&(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. +*/(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=gU: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(""),d=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],g=[1,256,65536,16777216],v=[6,1536,393216,100663296],x=[0,8,16,24],R=[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],M=[224,256,384,512],N=[128,256],E=["hex","buffer","arrayBuffer","array","digest"],O={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});for(var L=function(W,le,Y){return function(re){return new V(W,le,W).update(re)[Y]()}},U=function(W,le,Y){return function(re,ne){return new V(W,le,ne).update(re)[Y]()}},H=function(W,le,Y){return function(re,ne,D,ee){return m["cshake"+W].update(re,ne,D,ee)[Y]()}},I=function(W,le,Y){return function(re,ne,D,ee){return m["kmac"+W].update(re,ne,D,ee)[Y]()}},T=function(W,le,Y,re){for(var ne=0;ne>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Y>>5,this.extraBytes=(Y&31)>>3;for(var re=0;re<50;++re)this.s[re]=0}V.prototype.update=function(W){if(this.finalized)throw new Error(r);var le,Y=typeof W;if(Y!=="string"){if(Y==="object"){if(W===null)throw new Error(e);if(c&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!c||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);le=!0}for(var re=this.blocks,ne=this.byteCount,D=W.length,ee=this.blockCount,ge=0,xe=this.s,Ae,ke;ge>2]|=W[ge]<>2]|=ke<>2]|=(192|ke>>6)<>2]|=(128|ke&63)<=57344?(re[Ae>>2]|=(224|ke>>12)<>2]|=(128|ke>>6&63)<>2]|=(128|ke&63)<>2]|=(240|ke>>18)<>2]|=(128|ke>>12&63)<>2]|=(128|ke>>6&63)<>2]|=(128|ke&63)<=ne){for(this.start=Ae-ne,this.block=re[ee],Ae=0;Ae>8,Y=W&255;Y>0;)ne.unshift(Y),W=W>>8,Y=W&255,++re;return le?ne.push(re):ne.unshift(re),this.update(ne),ne.length},V.prototype.encodeString=function(W){var le,Y=typeof W;if(Y!=="string"){if(Y==="object"){if(W===null)throw new Error(e);if(c&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!c||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);le=!0}var re=0,ne=W.length;if(le)re=ne;else for(var D=0;D=57344?re+=3:(ee=65536+((ee&1023)<<10|W.charCodeAt(++D)&1023),re+=4)}return re+=this.encode(re*8),this.update(W),re},V.prototype.bytepad=function(W,le){for(var Y=this.encode(le),re=0;re>2]|=this.padding[le&3],this.lastByteIndex===this.byteCount)for(W[0]=W[Y],le=1;le>4&15]+l[ge&15]+l[ge>>12&15]+l[ge>>8&15]+l[ge>>20&15]+l[ge>>16&15]+l[ge>>28&15]+l[ge>>24&15];D%W===0&&(de(le),ne=0)}return re&&(ge=le[ne],ee+=l[ge>>4&15]+l[ge&15],re>1&&(ee+=l[ge>>12&15]+l[ge>>8&15]),re>2&&(ee+=l[ge>>20&15]+l[ge>>16&15])),ee},V.prototype.arrayBuffer=function(){this.finalize();var W=this.blockCount,le=this.s,Y=this.outputBlocks,re=this.extraBytes,ne=0,D=0,ee=this.outputBits>>3,ge;re?ge=new ArrayBuffer(Y+1<<2):ge=new ArrayBuffer(ee);for(var xe=new Uint32Array(ge);D>8&255,ee[ge+2]=xe>>16&255,ee[ge+3]=xe>>24&255;D%W===0&&de(le)}return re&&(ge=D<<2,xe=le[ne],ee[ge]=xe&255,re>1&&(ee[ge+1]=xe>>8&255),re>2&&(ee[ge+2]=xe>>16&255)),ee};function ce(W,le,Y){V.call(this,W,le,Y)}ce.prototype=new V,ce.prototype.finalize=function(){return this.encode(this.outputBits,!0),V.prototype.finalize.call(this)};var de=function(W){var le,Y,re,ne,D,ee,ge,xe,Ae,ke,He,Je,kt,tt,st,Ze,Le,rt,lt,Ue,at,G,$,z,J,oe,fe,ye,Re,Ve,dt,Ge,wt,er,Rt,yr,Cr,ft,Ot,Ft,ht,Bt,$t,vt,Qt,zt,yt,Wt,qt,pt,Nt,Yt,bt,Mr,Or,Vt,ar,Mi,Oi,$i,Di,Li,kn;for(re=0;re<48;re+=2)ne=W[0]^W[10]^W[20]^W[30]^W[40],D=W[1]^W[11]^W[21]^W[31]^W[41],ee=W[2]^W[12]^W[22]^W[32]^W[42],ge=W[3]^W[13]^W[23]^W[33]^W[43],xe=W[4]^W[14]^W[24]^W[34]^W[44],Ae=W[5]^W[15]^W[25]^W[35]^W[45],ke=W[6]^W[16]^W[26]^W[36]^W[46],He=W[7]^W[17]^W[27]^W[37]^W[47],Je=W[8]^W[18]^W[28]^W[38]^W[48],kt=W[9]^W[19]^W[29]^W[39]^W[49],le=Je^(ee<<1|ge>>>31),Y=kt^(ge<<1|ee>>>31),W[0]^=le,W[1]^=Y,W[10]^=le,W[11]^=Y,W[20]^=le,W[21]^=Y,W[30]^=le,W[31]^=Y,W[40]^=le,W[41]^=Y,le=ne^(xe<<1|Ae>>>31),Y=D^(Ae<<1|xe>>>31),W[2]^=le,W[3]^=Y,W[12]^=le,W[13]^=Y,W[22]^=le,W[23]^=Y,W[32]^=le,W[33]^=Y,W[42]^=le,W[43]^=Y,le=ee^(ke<<1|He>>>31),Y=ge^(He<<1|ke>>>31),W[4]^=le,W[5]^=Y,W[14]^=le,W[15]^=Y,W[24]^=le,W[25]^=Y,W[34]^=le,W[35]^=Y,W[44]^=le,W[45]^=Y,le=xe^(Je<<1|kt>>>31),Y=Ae^(kt<<1|Je>>>31),W[6]^=le,W[7]^=Y,W[16]^=le,W[17]^=Y,W[26]^=le,W[27]^=Y,W[36]^=le,W[37]^=Y,W[46]^=le,W[47]^=Y,le=ke^(ne<<1|D>>>31),Y=He^(D<<1|ne>>>31),W[8]^=le,W[9]^=Y,W[18]^=le,W[19]^=Y,W[28]^=le,W[29]^=Y,W[38]^=le,W[39]^=Y,W[48]^=le,W[49]^=Y,tt=W[0],st=W[1],zt=W[11]<<4|W[10]>>>28,yt=W[10]<<4|W[11]>>>28,ye=W[20]<<3|W[21]>>>29,Re=W[21]<<3|W[20]>>>29,$i=W[31]<<9|W[30]>>>23,Di=W[30]<<9|W[31]>>>23,Bt=W[40]<<18|W[41]>>>14,$t=W[41]<<18|W[40]>>>14,er=W[2]<<1|W[3]>>>31,Rt=W[3]<<1|W[2]>>>31,Ze=W[13]<<12|W[12]>>>20,Le=W[12]<<12|W[13]>>>20,Wt=W[22]<<10|W[23]>>>22,qt=W[23]<<10|W[22]>>>22,Ve=W[33]<<13|W[32]>>>19,dt=W[32]<<13|W[33]>>>19,Li=W[42]<<2|W[43]>>>30,kn=W[43]<<2|W[42]>>>30,Mr=W[5]<<30|W[4]>>>2,Or=W[4]<<30|W[5]>>>2,yr=W[14]<<6|W[15]>>>26,Cr=W[15]<<6|W[14]>>>26,rt=W[25]<<11|W[24]>>>21,lt=W[24]<<11|W[25]>>>21,pt=W[34]<<15|W[35]>>>17,Nt=W[35]<<15|W[34]>>>17,Ge=W[45]<<29|W[44]>>>3,wt=W[44]<<29|W[45]>>>3,z=W[6]<<28|W[7]>>>4,J=W[7]<<28|W[6]>>>4,Vt=W[17]<<23|W[16]>>>9,ar=W[16]<<23|W[17]>>>9,ft=W[26]<<25|W[27]>>>7,Ot=W[27]<<25|W[26]>>>7,Ue=W[36]<<21|W[37]>>>11,at=W[37]<<21|W[36]>>>11,Yt=W[47]<<24|W[46]>>>8,bt=W[46]<<24|W[47]>>>8,vt=W[8]<<27|W[9]>>>5,Qt=W[9]<<27|W[8]>>>5,oe=W[18]<<20|W[19]>>>12,fe=W[19]<<20|W[18]>>>12,Mi=W[29]<<7|W[28]>>>25,Oi=W[28]<<7|W[29]>>>25,Ft=W[38]<<8|W[39]>>>24,ht=W[39]<<8|W[38]>>>24,G=W[48]<<14|W[49]>>>18,$=W[49]<<14|W[48]>>>18,W[0]=tt^~Ze&rt,W[1]=st^~Le<,W[10]=z^~oe&ye,W[11]=J^~fe&Re,W[20]=er^~yr&ft,W[21]=Rt^~Cr&Ot,W[30]=vt^~zt&Wt,W[31]=Qt^~yt&qt,W[40]=Mr^~Vt&Mi,W[41]=Or^~ar&Oi,W[2]=Ze^~rt&Ue,W[3]=Le^~lt&at,W[12]=oe^~ye&Ve,W[13]=fe^~Re&dt,W[22]=yr^~ft&Ft,W[23]=Cr^~Ot&ht,W[32]=zt^~Wt&pt,W[33]=yt^~qt&Nt,W[42]=Vt^~Mi&$i,W[43]=ar^~Oi&Di,W[4]=rt^~Ue&G,W[5]=lt^~at&$,W[14]=ye^~Ve&Ge,W[15]=Re^~dt&wt,W[24]=ft^~Ft&Bt,W[25]=Ot^~ht&$t,W[34]=Wt^~pt&Yt,W[35]=qt^~Nt&bt,W[44]=Mi^~$i&Li,W[45]=Oi^~Di&kn,W[6]=Ue^~G&tt,W[7]=at^~$&st,W[16]=Ve^~Ge&z,W[17]=dt^~wt&J,W[26]=Ft^~Bt&er,W[27]=ht^~$t&Rt,W[36]=pt^~Yt&vt,W[37]=Nt^~bt&Qt,W[46]=$i^~Li&Mr,W[47]=Di^~kn&Or,W[8]=G^~tt&Ze,W[9]=$^~st&Le,W[18]=Ge^~z&oe,W[19]=wt^~J&fe,W[28]=Bt^~er&yr,W[29]=$t^~Rt&Cr,W[38]=Yt^~vt&zt,W[39]=bt^~Qt&yt,W[48]=Li^~Mr&Vt,W[49]=kn^~Or&ar,W[0]^=R[re],W[1]^=R[re+1]};if(a)t.exports=m;else for(A=0;A{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 fR=Lhe();var T_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(T_||(T_={}));var Za;(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"})(Za||(Za={}));const hR="0123456789abcdef";let Ai=class Xn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();ib[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(dR>ib[n])&&console.log.apply(console,r)}debug(...e){this._log(Xn.levels.DEBUG,e)}info(...e){this._log(Xn.levels.INFO,e)}warn(...e){this._log(Xn.levels.WARNING,e)}makeError(e,r,n){if(uR)return this.makeError("censored error",r,{});r||(r=Xn.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let d="";for(let h=0;h>4],d+=hR[l[h]&15];i.push(c+"=Uint8Array(0x"+d+")")}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 Za.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 Za.CALL_EXCEPTION:case Za.INSUFFICIENT_FUNDS:case Za.MISSING_NEW:case Za.NONCE_EXPIRED:case Za.REPLACEMENT_UNDERPRICED:case Za.TRANSACTION_REPLACED:case Za.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,Xn.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){fR&&this.throwError("platform missing String.prototype.normalize",Xn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:fR})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Xn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Xn.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,Xn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Xn.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",Xn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Xn.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return l9||(l9=new Xn(Dhe)),l9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Xn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),lR){if(!e)return;this.globalLogger().throwError("error censorship permanent",Xn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uR=!!e,lR=!!r}static setLogLevel(e){const r=ib[e.toLowerCase()];if(r==null){Xn.globalLogger().warn("invalid log level - "+e);return}dR=r}static from(e){return new Xn(e)}};Ai.errors=Za,Ai.levels=T_;const Bhe="bytes/5.7.0",jn=new Ai(Bhe);function wU(t){return!!t.toHexString}function Gp(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Gp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Uhe(t){return wo(t)&&!(t.length%2)||vg(t)}function pR(t){return typeof t=="number"&&t==t&&t%1===0}function vg(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!pR(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function On(t,e){if(e||(e={}),typeof t=="number"){jn.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),Gp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),wU(t)&&(t=t.toHexString()),wo(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":jn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iOn(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),Gp(n)}function Fhe(t,e){t=On(t),t.length>e&&jn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Gp(r)}function wo(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const u9="0123456789abcdef";function Ls(t,e){if(e||(e={}),typeof t=="number"){jn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=u9[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),wU(t))return t.toHexString();if(wo(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":jn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(vg(t)){let r="0x";for(let n=0;n>4]+u9[i&15]}return r}return jn.throwArgumentError("invalid hexlify value","value",t)}function zhe(t){if(typeof t!="string")t=Ls(t);else if(!wo(t)||t.length%2)return null;return(t.length-2)/2}function gR(t,e,r){return typeof t!="string"?t=Ls(t):(!wo(t)||t.length%2)&&jn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function cl(t,e){for(typeof t!="string"?t=Ls(t):wo(t)||jn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&jn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function vU(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Uhe(t)){let r=On(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Ls(r.slice(0,32)),e.s=Ls(r.slice(32,64))):r.length===65?(e.r=Ls(r.slice(0,32)),e.s=Ls(r.slice(32,64)),e.v=r[64]):jn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:jn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Ls(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=Fhe(On(e._vs),32);e._vs=Ls(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&jn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=Ls(i);e.s==null?e.s=o:e.s!==o&&jn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?jn.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&&jn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!wo(e.r)?jn.throwArgumentError("signature missing or invalid r","signature",t):e.r=cl(e.r,32),e.s==null||!wo(e.s)?jn.throwArgumentError("signature missing or invalid s","signature",t):e.s=cl(e.s,32);const r=On(e.s);r[0]>=128&&jn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Ls(r);e._vs&&(wo(e._vs)||jn.throwArgumentError("signature invalid _vs","signature",t),e._vs=cl(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&jn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function CE(t){return"0x"+$he.keccak_256(On(t))}var yU={exports:{}},Whe={},Hhe=Object.freeze({__proto__:null,default:Whe}),qhe=Ohe(Hhe);(function(t){(function(e,r){function n(p,m){if(!p)throw new Error(m||"Assertion failed")}function i(p,m){p.super_=m;var w=function(){};w.prototype=m.prototype,p.prototype=new w,p.prototype.constructor=p}function s(p,m,w){if(s.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((m==="le"||m==="be")&&(w=m,m=10),this._init(p||0,m||10,w||"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=qhe.Buffer}catch{}s.isBN=function(p){return p instanceof s?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===s.wordSize&&Array.isArray(p.words)},s.max=function(p,m){return p.cmp(m)>0?p:m},s.min=function(p,m){return p.cmp(m)<0?p:m},s.prototype._init=function(p,m,w){if(typeof p=="number")return this._initNumber(p,m,w);if(typeof p=="object")return this._initArray(p,m,w);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var A=0;p[0]==="-"&&(A++,this.negative=1),A=0;A-=3)S=p[A]|p[A-1]<<8|p[A-2]<<16,this.words[P]|=S<>>26-k&67108863,k+=24,k>=26&&(k-=26,P++);else if(w==="le")for(A=0,P=0;A>>26-k&67108863,k+=24,k>=26&&(k-=26,P++);return this._strip()};function a(p,m){var w=p.charCodeAt(m);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;n(!1,"Invalid character in "+p)}function c(p,m,w){var A=a(p,w);return w-1>=m&&(A|=a(p,w-1)<<4),A}s.prototype._parseHex=function(p,m,w){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var A=0;A=m;A-=2)k=c(p,m,A)<=18?(P-=18,S+=1,this.words[S]|=k>>>26):P+=8;else{var y=p.length-m;for(A=y%2===0?m+1:m;A=18?(P-=18,S+=1,this.words[S]|=k>>>26):P+=8}this._strip()};function l(p,m,w,A){for(var P=0,S=0,k=Math.min(p.length,w),y=m;y=49?S=b-49+10:b>=17?S=b-17+10:S=b,n(b>=0&&S1&&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")]=h}catch{s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?""}var g=["","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"],v=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(p,m){p=p||10,m=m|0||1;var w;if(p===16||p==="hex"){w="";for(var A=0,P=0,S=0;S>>24-A&16777215,A+=2,A>=26&&(A-=26,S--),P!==0||S!==this.length-1?w=g[6-y.length]+y+w:w=y+w}for(P!==0&&(w=P.toString(16)+w);w.length%m!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(p===(p|0)&&p>=2&&p<=36){var b=v[p],V=x[p];w="";var ce=this.clone();for(ce.negative=0;!ce.isZero();){var de=ce.modrn(V).toString(p);ce=ce.idivn(V),ce.isZero()?w=de+w:w=g[b-de.length]+de+w}for(this.isZero()&&(w="0"+w);w.length%m!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(p,m){return this.toArrayLike(o,p,m)}),s.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)};var R=function(p,m){return p.allocUnsafe?p.allocUnsafe(m):new p(m)};s.prototype.toArrayLike=function(p,m,w){this._strip();var A=this.byteLength(),P=w||Math.max(1,A);n(A<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0");var S=R(p,P),k=m==="le"?"LE":"BE";return this["_toArrayLike"+k](S,A),S},s.prototype._toArrayLikeLE=function(p,m){for(var w=0,A=0,P=0,S=0;P>8&255),w>16&255),S===6?(w>24&255),A=0,S=0):(A=k>>>24,S+=2)}if(w=0&&(p[w--]=k>>8&255),w>=0&&(p[w--]=k>>16&255),S===6?(w>=0&&(p[w--]=k>>24&255),A=0,S=0):(A=k>>>24,S+=2)}if(w>=0)for(p[w--]=A;w>=0;)p[w--]=0},Math.clz32?s.prototype._countBits=function(p){return 32-Math.clz32(p)}:s.prototype._countBits=function(p){var m=p,w=0;return m>=4096&&(w+=13,m>>>=13),m>=64&&(w+=7,m>>>=7),m>=8&&(w+=4,m>>>=4),m>=2&&(w+=2,m>>>=2),w+m},s.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,w=0;return m&8191||(w+=13,m>>>=13),m&127||(w+=7,m>>>=7),m&15||(w+=4,m>>>=4),m&3||(w+=2,m>>>=2),m&1||w++,w},s.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function M(p){for(var m=new Array(p.bitLength()),w=0;w>>P&1}return m}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;mp.length?this.clone().ior(p):p.clone().ior(this)},s.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},s.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var w=0;wp.length?this.clone().iand(p):p.clone().iand(this)},s.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},s.prototype.iuxor=function(p){var m,w;this.length>p.length?(m=this,w=p):(m=p,w=this);for(var A=0;Ap.length?this.clone().ixor(p):p.clone().ixor(this)},s.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},s.prototype.inotn=function(p){n(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,w=p%26;this._expand(m),w>0&&m--;for(var A=0;A0&&(this.words[A]=~this.words[A]&67108863>>26-w),this._strip()},s.prototype.notn=function(p){return this.clone().inotn(p)},s.prototype.setn=function(p,m){n(typeof p=="number"&&p>=0);var w=p/26|0,A=p%26;return this._expand(w+1),m?this.words[w]=this.words[w]|1<p.length?(w=this,A=p):(w=p,A=this);for(var P=0,S=0;S>>26;for(;P!==0&&S>>26;if(this.length=w.length,P!==0)this.words[this.length]=P,this.length++;else if(w!==this)for(;Sp.length?this.clone().iadd(p):p.clone().iadd(this)},s.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var w=this.cmp(p);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var A,P;w>0?(A=this,P=p):(A=p,P=this);for(var S=0,k=0;k>26,this.words[k]=m&67108863;for(;S!==0&&k>26,this.words[k]=m&67108863;if(S===0&&k>>26,de=b&67108863,W=Math.min(V,m.length-1),le=Math.max(0,V-p.length+1);le<=W;le++){var Y=V-le|0;P=p.words[Y]|0,S=m.words[le]|0,k=P*S+de,ce+=k/67108864|0,de=k&67108863}w.words[V]=de|0,b=ce|0}return b!==0?w.words[V]=b|0:w.length--,w._strip()}var E=function(p,m,w){var A=p.words,P=m.words,S=w.words,k=0,y,b,V,ce=A[0]|0,de=ce&8191,W=ce>>>13,le=A[1]|0,Y=le&8191,re=le>>>13,ne=A[2]|0,D=ne&8191,ee=ne>>>13,ge=A[3]|0,xe=ge&8191,Ae=ge>>>13,ke=A[4]|0,He=ke&8191,Je=ke>>>13,kt=A[5]|0,tt=kt&8191,st=kt>>>13,Ze=A[6]|0,Le=Ze&8191,rt=Ze>>>13,lt=A[7]|0,Ue=lt&8191,at=lt>>>13,G=A[8]|0,$=G&8191,z=G>>>13,J=A[9]|0,oe=J&8191,fe=J>>>13,ye=P[0]|0,Re=ye&8191,Ve=ye>>>13,dt=P[1]|0,Ge=dt&8191,wt=dt>>>13,er=P[2]|0,Rt=er&8191,yr=er>>>13,Cr=P[3]|0,ft=Cr&8191,Ot=Cr>>>13,Ft=P[4]|0,ht=Ft&8191,Bt=Ft>>>13,$t=P[5]|0,vt=$t&8191,Qt=$t>>>13,zt=P[6]|0,yt=zt&8191,Wt=zt>>>13,qt=P[7]|0,pt=qt&8191,Nt=qt>>>13,Yt=P[8]|0,bt=Yt&8191,Mr=Yt>>>13,Or=P[9]|0,Vt=Or&8191,ar=Or>>>13;w.negative=p.negative^m.negative,w.length=19,y=Math.imul(de,Re),b=Math.imul(de,Ve),b=b+Math.imul(W,Re)|0,V=Math.imul(W,Ve);var Mi=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,y=Math.imul(Y,Re),b=Math.imul(Y,Ve),b=b+Math.imul(re,Re)|0,V=Math.imul(re,Ve),y=y+Math.imul(de,Ge)|0,b=b+Math.imul(de,wt)|0,b=b+Math.imul(W,Ge)|0,V=V+Math.imul(W,wt)|0;var Oi=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,y=Math.imul(D,Re),b=Math.imul(D,Ve),b=b+Math.imul(ee,Re)|0,V=Math.imul(ee,Ve),y=y+Math.imul(Y,Ge)|0,b=b+Math.imul(Y,wt)|0,b=b+Math.imul(re,Ge)|0,V=V+Math.imul(re,wt)|0,y=y+Math.imul(de,Rt)|0,b=b+Math.imul(de,yr)|0,b=b+Math.imul(W,Rt)|0,V=V+Math.imul(W,yr)|0;var $i=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+($i>>>26)|0,$i&=67108863,y=Math.imul(xe,Re),b=Math.imul(xe,Ve),b=b+Math.imul(Ae,Re)|0,V=Math.imul(Ae,Ve),y=y+Math.imul(D,Ge)|0,b=b+Math.imul(D,wt)|0,b=b+Math.imul(ee,Ge)|0,V=V+Math.imul(ee,wt)|0,y=y+Math.imul(Y,Rt)|0,b=b+Math.imul(Y,yr)|0,b=b+Math.imul(re,Rt)|0,V=V+Math.imul(re,yr)|0,y=y+Math.imul(de,ft)|0,b=b+Math.imul(de,Ot)|0,b=b+Math.imul(W,ft)|0,V=V+Math.imul(W,Ot)|0;var Di=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Di>>>26)|0,Di&=67108863,y=Math.imul(He,Re),b=Math.imul(He,Ve),b=b+Math.imul(Je,Re)|0,V=Math.imul(Je,Ve),y=y+Math.imul(xe,Ge)|0,b=b+Math.imul(xe,wt)|0,b=b+Math.imul(Ae,Ge)|0,V=V+Math.imul(Ae,wt)|0,y=y+Math.imul(D,Rt)|0,b=b+Math.imul(D,yr)|0,b=b+Math.imul(ee,Rt)|0,V=V+Math.imul(ee,yr)|0,y=y+Math.imul(Y,ft)|0,b=b+Math.imul(Y,Ot)|0,b=b+Math.imul(re,ft)|0,V=V+Math.imul(re,Ot)|0,y=y+Math.imul(de,ht)|0,b=b+Math.imul(de,Bt)|0,b=b+Math.imul(W,ht)|0,V=V+Math.imul(W,Bt)|0;var Li=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Li>>>26)|0,Li&=67108863,y=Math.imul(tt,Re),b=Math.imul(tt,Ve),b=b+Math.imul(st,Re)|0,V=Math.imul(st,Ve),y=y+Math.imul(He,Ge)|0,b=b+Math.imul(He,wt)|0,b=b+Math.imul(Je,Ge)|0,V=V+Math.imul(Je,wt)|0,y=y+Math.imul(xe,Rt)|0,b=b+Math.imul(xe,yr)|0,b=b+Math.imul(Ae,Rt)|0,V=V+Math.imul(Ae,yr)|0,y=y+Math.imul(D,ft)|0,b=b+Math.imul(D,Ot)|0,b=b+Math.imul(ee,ft)|0,V=V+Math.imul(ee,Ot)|0,y=y+Math.imul(Y,ht)|0,b=b+Math.imul(Y,Bt)|0,b=b+Math.imul(re,ht)|0,V=V+Math.imul(re,Bt)|0,y=y+Math.imul(de,vt)|0,b=b+Math.imul(de,Qt)|0,b=b+Math.imul(W,vt)|0,V=V+Math.imul(W,Qt)|0;var kn=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(kn>>>26)|0,kn&=67108863,y=Math.imul(Le,Re),b=Math.imul(Le,Ve),b=b+Math.imul(rt,Re)|0,V=Math.imul(rt,Ve),y=y+Math.imul(tt,Ge)|0,b=b+Math.imul(tt,wt)|0,b=b+Math.imul(st,Ge)|0,V=V+Math.imul(st,wt)|0,y=y+Math.imul(He,Rt)|0,b=b+Math.imul(He,yr)|0,b=b+Math.imul(Je,Rt)|0,V=V+Math.imul(Je,yr)|0,y=y+Math.imul(xe,ft)|0,b=b+Math.imul(xe,Ot)|0,b=b+Math.imul(Ae,ft)|0,V=V+Math.imul(Ae,Ot)|0,y=y+Math.imul(D,ht)|0,b=b+Math.imul(D,Bt)|0,b=b+Math.imul(ee,ht)|0,V=V+Math.imul(ee,Bt)|0,y=y+Math.imul(Y,vt)|0,b=b+Math.imul(Y,Qt)|0,b=b+Math.imul(re,vt)|0,V=V+Math.imul(re,Qt)|0,y=y+Math.imul(de,yt)|0,b=b+Math.imul(de,Wt)|0,b=b+Math.imul(W,yt)|0,V=V+Math.imul(W,Wt)|0;var As=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(As>>>26)|0,As&=67108863,y=Math.imul(Ue,Re),b=Math.imul(Ue,Ve),b=b+Math.imul(at,Re)|0,V=Math.imul(at,Ve),y=y+Math.imul(Le,Ge)|0,b=b+Math.imul(Le,wt)|0,b=b+Math.imul(rt,Ge)|0,V=V+Math.imul(rt,wt)|0,y=y+Math.imul(tt,Rt)|0,b=b+Math.imul(tt,yr)|0,b=b+Math.imul(st,Rt)|0,V=V+Math.imul(st,yr)|0,y=y+Math.imul(He,ft)|0,b=b+Math.imul(He,Ot)|0,b=b+Math.imul(Je,ft)|0,V=V+Math.imul(Je,Ot)|0,y=y+Math.imul(xe,ht)|0,b=b+Math.imul(xe,Bt)|0,b=b+Math.imul(Ae,ht)|0,V=V+Math.imul(Ae,Bt)|0,y=y+Math.imul(D,vt)|0,b=b+Math.imul(D,Qt)|0,b=b+Math.imul(ee,vt)|0,V=V+Math.imul(ee,Qt)|0,y=y+Math.imul(Y,yt)|0,b=b+Math.imul(Y,Wt)|0,b=b+Math.imul(re,yt)|0,V=V+Math.imul(re,Wt)|0,y=y+Math.imul(de,pt)|0,b=b+Math.imul(de,Nt)|0,b=b+Math.imul(W,pt)|0,V=V+Math.imul(W,Nt)|0;var Sa=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,y=Math.imul($,Re),b=Math.imul($,Ve),b=b+Math.imul(z,Re)|0,V=Math.imul(z,Ve),y=y+Math.imul(Ue,Ge)|0,b=b+Math.imul(Ue,wt)|0,b=b+Math.imul(at,Ge)|0,V=V+Math.imul(at,wt)|0,y=y+Math.imul(Le,Rt)|0,b=b+Math.imul(Le,yr)|0,b=b+Math.imul(rt,Rt)|0,V=V+Math.imul(rt,yr)|0,y=y+Math.imul(tt,ft)|0,b=b+Math.imul(tt,Ot)|0,b=b+Math.imul(st,ft)|0,V=V+Math.imul(st,Ot)|0,y=y+Math.imul(He,ht)|0,b=b+Math.imul(He,Bt)|0,b=b+Math.imul(Je,ht)|0,V=V+Math.imul(Je,Bt)|0,y=y+Math.imul(xe,vt)|0,b=b+Math.imul(xe,Qt)|0,b=b+Math.imul(Ae,vt)|0,V=V+Math.imul(Ae,Qt)|0,y=y+Math.imul(D,yt)|0,b=b+Math.imul(D,Wt)|0,b=b+Math.imul(ee,yt)|0,V=V+Math.imul(ee,Wt)|0,y=y+Math.imul(Y,pt)|0,b=b+Math.imul(Y,Nt)|0,b=b+Math.imul(re,pt)|0,V=V+Math.imul(re,Nt)|0,y=y+Math.imul(de,bt)|0,b=b+Math.imul(de,Mr)|0,b=b+Math.imul(W,bt)|0,V=V+Math.imul(W,Mr)|0;var Es=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Es>>>26)|0,Es&=67108863,y=Math.imul(oe,Re),b=Math.imul(oe,Ve),b=b+Math.imul(fe,Re)|0,V=Math.imul(fe,Ve),y=y+Math.imul($,Ge)|0,b=b+Math.imul($,wt)|0,b=b+Math.imul(z,Ge)|0,V=V+Math.imul(z,wt)|0,y=y+Math.imul(Ue,Rt)|0,b=b+Math.imul(Ue,yr)|0,b=b+Math.imul(at,Rt)|0,V=V+Math.imul(at,yr)|0,y=y+Math.imul(Le,ft)|0,b=b+Math.imul(Le,Ot)|0,b=b+Math.imul(rt,ft)|0,V=V+Math.imul(rt,Ot)|0,y=y+Math.imul(tt,ht)|0,b=b+Math.imul(tt,Bt)|0,b=b+Math.imul(st,ht)|0,V=V+Math.imul(st,Bt)|0,y=y+Math.imul(He,vt)|0,b=b+Math.imul(He,Qt)|0,b=b+Math.imul(Je,vt)|0,V=V+Math.imul(Je,Qt)|0,y=y+Math.imul(xe,yt)|0,b=b+Math.imul(xe,Wt)|0,b=b+Math.imul(Ae,yt)|0,V=V+Math.imul(Ae,Wt)|0,y=y+Math.imul(D,pt)|0,b=b+Math.imul(D,Nt)|0,b=b+Math.imul(ee,pt)|0,V=V+Math.imul(ee,Nt)|0,y=y+Math.imul(Y,bt)|0,b=b+Math.imul(Y,Mr)|0,b=b+Math.imul(re,bt)|0,V=V+Math.imul(re,Mr)|0,y=y+Math.imul(de,Vt)|0,b=b+Math.imul(de,ar)|0,b=b+Math.imul(W,Vt)|0,V=V+Math.imul(W,ar)|0;var Ia=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,y=Math.imul(oe,Ge),b=Math.imul(oe,wt),b=b+Math.imul(fe,Ge)|0,V=Math.imul(fe,wt),y=y+Math.imul($,Rt)|0,b=b+Math.imul($,yr)|0,b=b+Math.imul(z,Rt)|0,V=V+Math.imul(z,yr)|0,y=y+Math.imul(Ue,ft)|0,b=b+Math.imul(Ue,Ot)|0,b=b+Math.imul(at,ft)|0,V=V+Math.imul(at,Ot)|0,y=y+Math.imul(Le,ht)|0,b=b+Math.imul(Le,Bt)|0,b=b+Math.imul(rt,ht)|0,V=V+Math.imul(rt,Bt)|0,y=y+Math.imul(tt,vt)|0,b=b+Math.imul(tt,Qt)|0,b=b+Math.imul(st,vt)|0,V=V+Math.imul(st,Qt)|0,y=y+Math.imul(He,yt)|0,b=b+Math.imul(He,Wt)|0,b=b+Math.imul(Je,yt)|0,V=V+Math.imul(Je,Wt)|0,y=y+Math.imul(xe,pt)|0,b=b+Math.imul(xe,Nt)|0,b=b+Math.imul(Ae,pt)|0,V=V+Math.imul(Ae,Nt)|0,y=y+Math.imul(D,bt)|0,b=b+Math.imul(D,Mr)|0,b=b+Math.imul(ee,bt)|0,V=V+Math.imul(ee,Mr)|0,y=y+Math.imul(Y,Vt)|0,b=b+Math.imul(Y,ar)|0,b=b+Math.imul(re,Vt)|0,V=V+Math.imul(re,ar)|0;var Ta=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,y=Math.imul(oe,Rt),b=Math.imul(oe,yr),b=b+Math.imul(fe,Rt)|0,V=Math.imul(fe,yr),y=y+Math.imul($,ft)|0,b=b+Math.imul($,Ot)|0,b=b+Math.imul(z,ft)|0,V=V+Math.imul(z,Ot)|0,y=y+Math.imul(Ue,ht)|0,b=b+Math.imul(Ue,Bt)|0,b=b+Math.imul(at,ht)|0,V=V+Math.imul(at,Bt)|0,y=y+Math.imul(Le,vt)|0,b=b+Math.imul(Le,Qt)|0,b=b+Math.imul(rt,vt)|0,V=V+Math.imul(rt,Qt)|0,y=y+Math.imul(tt,yt)|0,b=b+Math.imul(tt,Wt)|0,b=b+Math.imul(st,yt)|0,V=V+Math.imul(st,Wt)|0,y=y+Math.imul(He,pt)|0,b=b+Math.imul(He,Nt)|0,b=b+Math.imul(Je,pt)|0,V=V+Math.imul(Je,Nt)|0,y=y+Math.imul(xe,bt)|0,b=b+Math.imul(xe,Mr)|0,b=b+Math.imul(Ae,bt)|0,V=V+Math.imul(Ae,Mr)|0,y=y+Math.imul(D,Vt)|0,b=b+Math.imul(D,ar)|0,b=b+Math.imul(ee,Vt)|0,V=V+Math.imul(ee,ar)|0;var Ss=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,y=Math.imul(oe,ft),b=Math.imul(oe,Ot),b=b+Math.imul(fe,ft)|0,V=Math.imul(fe,Ot),y=y+Math.imul($,ht)|0,b=b+Math.imul($,Bt)|0,b=b+Math.imul(z,ht)|0,V=V+Math.imul(z,Bt)|0,y=y+Math.imul(Ue,vt)|0,b=b+Math.imul(Ue,Qt)|0,b=b+Math.imul(at,vt)|0,V=V+Math.imul(at,Qt)|0,y=y+Math.imul(Le,yt)|0,b=b+Math.imul(Le,Wt)|0,b=b+Math.imul(rt,yt)|0,V=V+Math.imul(rt,Wt)|0,y=y+Math.imul(tt,pt)|0,b=b+Math.imul(tt,Nt)|0,b=b+Math.imul(st,pt)|0,V=V+Math.imul(st,Nt)|0,y=y+Math.imul(He,bt)|0,b=b+Math.imul(He,Mr)|0,b=b+Math.imul(Je,bt)|0,V=V+Math.imul(Je,Mr)|0,y=y+Math.imul(xe,Vt)|0,b=b+Math.imul(xe,ar)|0,b=b+Math.imul(Ae,Vt)|0,V=V+Math.imul(Ae,ar)|0;var $o=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+($o>>>26)|0,$o&=67108863,y=Math.imul(oe,ht),b=Math.imul(oe,Bt),b=b+Math.imul(fe,ht)|0,V=Math.imul(fe,Bt),y=y+Math.imul($,vt)|0,b=b+Math.imul($,Qt)|0,b=b+Math.imul(z,vt)|0,V=V+Math.imul(z,Qt)|0,y=y+Math.imul(Ue,yt)|0,b=b+Math.imul(Ue,Wt)|0,b=b+Math.imul(at,yt)|0,V=V+Math.imul(at,Wt)|0,y=y+Math.imul(Le,pt)|0,b=b+Math.imul(Le,Nt)|0,b=b+Math.imul(rt,pt)|0,V=V+Math.imul(rt,Nt)|0,y=y+Math.imul(tt,bt)|0,b=b+Math.imul(tt,Mr)|0,b=b+Math.imul(st,bt)|0,V=V+Math.imul(st,Mr)|0,y=y+Math.imul(He,Vt)|0,b=b+Math.imul(He,ar)|0,b=b+Math.imul(Je,Vt)|0,V=V+Math.imul(Je,ar)|0;var Do=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Do>>>26)|0,Do&=67108863,y=Math.imul(oe,vt),b=Math.imul(oe,Qt),b=b+Math.imul(fe,vt)|0,V=Math.imul(fe,Qt),y=y+Math.imul($,yt)|0,b=b+Math.imul($,Wt)|0,b=b+Math.imul(z,yt)|0,V=V+Math.imul(z,Wt)|0,y=y+Math.imul(Ue,pt)|0,b=b+Math.imul(Ue,Nt)|0,b=b+Math.imul(at,pt)|0,V=V+Math.imul(at,Nt)|0,y=y+Math.imul(Le,bt)|0,b=b+Math.imul(Le,Mr)|0,b=b+Math.imul(rt,bt)|0,V=V+Math.imul(rt,Mr)|0,y=y+Math.imul(tt,Vt)|0,b=b+Math.imul(tt,ar)|0,b=b+Math.imul(st,Vt)|0,V=V+Math.imul(st,ar)|0;var Qn=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,y=Math.imul(oe,yt),b=Math.imul(oe,Wt),b=b+Math.imul(fe,yt)|0,V=Math.imul(fe,Wt),y=y+Math.imul($,pt)|0,b=b+Math.imul($,Nt)|0,b=b+Math.imul(z,pt)|0,V=V+Math.imul(z,Nt)|0,y=y+Math.imul(Ue,bt)|0,b=b+Math.imul(Ue,Mr)|0,b=b+Math.imul(at,bt)|0,V=V+Math.imul(at,Mr)|0,y=y+Math.imul(Le,Vt)|0,b=b+Math.imul(Le,ar)|0,b=b+Math.imul(rt,Vt)|0,V=V+Math.imul(rt,ar)|0;var ka=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(ka>>>26)|0,ka&=67108863,y=Math.imul(oe,pt),b=Math.imul(oe,Nt),b=b+Math.imul(fe,pt)|0,V=Math.imul(fe,Nt),y=y+Math.imul($,bt)|0,b=b+Math.imul($,Mr)|0,b=b+Math.imul(z,bt)|0,V=V+Math.imul(z,Mr)|0,y=y+Math.imul(Ue,Vt)|0,b=b+Math.imul(Ue,ar)|0,b=b+Math.imul(at,Vt)|0,V=V+Math.imul(at,ar)|0;var Pa=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,y=Math.imul(oe,bt),b=Math.imul(oe,Mr),b=b+Math.imul(fe,bt)|0,V=Math.imul(fe,Mr),y=y+Math.imul($,Vt)|0,b=b+Math.imul($,ar)|0,b=b+Math.imul(z,Vt)|0,V=V+Math.imul(z,ar)|0;var Ra=(k+y|0)+((b&8191)<<13)|0;k=(V+(b>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,y=Math.imul(oe,Vt),b=Math.imul(oe,ar),b=b+Math.imul(fe,Vt)|0,V=Math.imul(fe,ar);var Lf=(k+y|0)+((b&8191)<<13)|0;return k=(V+(b>>>13)|0)+(Lf>>>26)|0,Lf&=67108863,S[0]=Mi,S[1]=Oi,S[2]=$i,S[3]=Di,S[4]=Li,S[5]=kn,S[6]=As,S[7]=Sa,S[8]=Es,S[9]=Ia,S[10]=Ta,S[11]=Ss,S[12]=$o,S[13]=Do,S[14]=Qn,S[15]=ka,S[16]=Pa,S[17]=Ra,S[18]=Lf,k!==0&&(S[19]=k,w.length++),w};Math.imul||(E=N);function O(p,m,w){w.negative=m.negative^p.negative,w.length=p.length+m.length;for(var A=0,P=0,S=0;S>>26)|0,P+=k>>>26,k&=67108863}w.words[S]=y,A=k,k=P}return A!==0?w.words[S]=A:w.length--,w._strip()}function L(p,m,w){return O(p,m,w)}s.prototype.mulTo=function(p,m){var w,A=this.length+p.length;return this.length===10&&p.length===10?w=E(this,p,m):A<63?w=N(this,p,m):A<1024?w=O(this,p,m):w=L(this,p,m),w},s.prototype.mul=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},s.prototype.mulf=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),L(this,p,m)},s.prototype.imul=function(p){return this.clone().mulTo(p,this)},s.prototype.imuln=function(p){var m=p<0;m&&(p=-p),n(typeof p=="number"),n(p<67108864);for(var w=0,A=0;A>=26,w+=P/67108864|0,w+=S>>>26,this.words[A]=S&67108863}return w!==0&&(this.words[A]=w,this.length++),m?this.ineg():this},s.prototype.muln=function(p){return this.clone().imuln(p)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(p){var m=M(p);if(m.length===0)return new s(1);for(var w=this,A=0;A=0);var m=p%26,w=(p-m)/26,A=67108863>>>26-m<<26-m,P;if(m!==0){var S=0;for(P=0;P>>26-m}S&&(this.words[P]=S,this.length++)}if(w!==0){for(P=this.length-1;P>=0;P--)this.words[P+w]=this.words[P];for(P=0;P=0);var A;m?A=(m-m%26)/26:A=0;var P=p%26,S=Math.min((p-P)/26,this.length),k=67108863^67108863>>>P<S)for(this.length-=S,b=0;b=0&&(V!==0||b>=A);b--){var ce=this.words[b]|0;this.words[b]=V<<26-P|ce>>>P,V=ce&k}return y&&V!==0&&(y.words[y.length++]=V),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(p,m,w){return n(this.negative===0),this.iushrn(p,m,w)},s.prototype.shln=function(p){return this.clone().ishln(p)},s.prototype.ushln=function(p){return this.clone().iushln(p)},s.prototype.shrn=function(p){return this.clone().ishrn(p)},s.prototype.ushrn=function(p){return this.clone().iushrn(p)},s.prototype.testn=function(p){n(typeof p=="number"&&p>=0);var m=p%26,w=(p-m)/26,A=1<=0);var m=p%26,w=(p-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(m!==0&&w++,this.length=Math.min(w,this.length),m!==0){var A=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(p){if(n(typeof p=="number"),n(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(y/67108864|0),this.words[P+w]=S&67108863}for(;P>26,this.words[P+w]=S&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,P=0;P>26,this.words[P]=S&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(p,m){var w=this.length-p.length,A=this.clone(),P=p,S=P.words[P.length-1]|0,k=this._countBits(S);w=26-k,w!==0&&(P=P.ushln(w),A.iushln(w),S=P.words[P.length-1]|0);var y=A.length-P.length,b;if(m!=="mod"){b=new s(null),b.length=y+1,b.words=new Array(b.length);for(var V=0;V=0;de--){var W=(A.words[P.length+de]|0)*67108864+(A.words[P.length+de-1]|0);for(W=Math.min(W/S|0,67108863),A._ishlnsubmul(P,W,de);A.negative!==0;)W--,A.negative=0,A._ishlnsubmul(P,1,de),A.isZero()||(A.negative^=1);b&&(b.words[de]=W)}return b&&b._strip(),A._strip(),m!=="div"&&w!==0&&A.iushrn(w),{div:b||null,mod:A}},s.prototype.divmod=function(p,m,w){if(n(!p.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var A,P,S;return this.negative!==0&&p.negative===0?(S=this.neg().divmod(p,m),m!=="mod"&&(A=S.div.neg()),m!=="div"&&(P=S.mod.neg(),w&&P.negative!==0&&P.iadd(p)),{div:A,mod:P}):this.negative===0&&p.negative!==0?(S=this.divmod(p.neg(),m),m!=="mod"&&(A=S.div.neg()),{div:A,mod:S.mod}):this.negative&p.negative?(S=this.neg().divmod(p.neg(),m),m!=="div"&&(P=S.mod.neg(),w&&P.negative!==0&&P.isub(p)),{div:S.div,mod:P}):p.length>this.length||this.cmp(p)<0?{div:new s(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new s(this.modrn(p.words[0]))}:this._wordDiv(p,m)},s.prototype.div=function(p){return this.divmod(p,"div",!1).div},s.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},s.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},s.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var w=m.div.negative!==0?m.mod.isub(p):m.mod,A=p.ushrn(1),P=p.andln(1),S=w.cmp(A);return S<0||P===1&&S===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var w=(1<<26)%p,A=0,P=this.length-1;P>=0;P--)A=(w*A+(this.words[P]|0))%p;return m?-A:A},s.prototype.modn=function(p){return this.modrn(p)},s.prototype.idivn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var w=0,A=this.length-1;A>=0;A--){var P=(this.words[A]|0)+w*67108864;this.words[A]=P/p|0,w=P%p}return this._strip(),m?this.ineg():this},s.prototype.divn=function(p){return this.clone().idivn(p)},s.prototype.egcd=function(p){n(p.negative===0),n(!p.isZero());var m=this,w=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var A=new s(1),P=new s(0),S=new s(0),k=new s(1),y=0;m.isEven()&&w.isEven();)m.iushrn(1),w.iushrn(1),++y;for(var b=w.clone(),V=m.clone();!m.isZero();){for(var ce=0,de=1;!(m.words[0]&de)&&ce<26;++ce,de<<=1);if(ce>0)for(m.iushrn(ce);ce-- >0;)(A.isOdd()||P.isOdd())&&(A.iadd(b),P.isub(V)),A.iushrn(1),P.iushrn(1);for(var W=0,le=1;!(w.words[0]&le)&&W<26;++W,le<<=1);if(W>0)for(w.iushrn(W);W-- >0;)(S.isOdd()||k.isOdd())&&(S.iadd(b),k.isub(V)),S.iushrn(1),k.iushrn(1);m.cmp(w)>=0?(m.isub(w),A.isub(S),P.isub(k)):(w.isub(m),S.isub(A),k.isub(P))}return{a:S,b:k,gcd:w.iushln(y)}},s.prototype._invmp=function(p){n(p.negative===0),n(!p.isZero());var m=this,w=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var A=new s(1),P=new s(0),S=w.clone();m.cmpn(1)>0&&w.cmpn(1)>0;){for(var k=0,y=1;!(m.words[0]&y)&&k<26;++k,y<<=1);if(k>0)for(m.iushrn(k);k-- >0;)A.isOdd()&&A.iadd(S),A.iushrn(1);for(var b=0,V=1;!(w.words[0]&V)&&b<26;++b,V<<=1);if(b>0)for(w.iushrn(b);b-- >0;)P.isOdd()&&P.iadd(S),P.iushrn(1);m.cmp(w)>=0?(m.isub(w),A.isub(P)):(w.isub(m),P.isub(A))}var ce;return m.cmpn(1)===0?ce=A:ce=P,ce.cmpn(0)<0&&ce.iadd(p),ce},s.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),w=p.clone();m.negative=0,w.negative=0;for(var A=0;m.isEven()&&w.isEven();A++)m.iushrn(1),w.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;w.isEven();)w.iushrn(1);var P=m.cmp(w);if(P<0){var S=m;m=w,w=S}else if(P===0||w.cmpn(1)===0)break;m.isub(w)}while(!0);return w.iushln(A)},s.prototype.invm=function(p){return this.egcd(p).a.umod(p)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(p){return this.words[0]&p},s.prototype.bincn=function(p){n(typeof p=="number");var m=p%26,w=(p-m)/26,A=1<>>26,k&=67108863,this.words[S]=k}return P!==0&&(this.words[S]=P,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var w;if(this.length>1)w=1;else{m&&(p=-p),n(p<=67108863,"Number is too big");var A=this.words[0]|0;w=A===p?0:Ap.length)return 1;if(this.length=0;w--){var A=this.words[w]|0,P=p.words[w]|0;if(A!==P){AP&&(m=1);break}}return m},s.prototype.gtn=function(p){return this.cmpn(p)===1},s.prototype.gt=function(p){return this.cmp(p)===1},s.prototype.gten=function(p){return this.cmpn(p)>=0},s.prototype.gte=function(p){return this.cmp(p)>=0},s.prototype.ltn=function(p){return this.cmpn(p)===-1},s.prototype.lt=function(p){return this.cmp(p)===-1},s.prototype.lten=function(p){return this.cmpn(p)<=0},s.prototype.lte=function(p){return this.cmp(p)<=0},s.prototype.eqn=function(p){return this.cmpn(p)===0},s.prototype.eq=function(p){return this.cmp(p)===0},s.red=function(p){return new B(p)},s.prototype.toRed=function(p){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(p){return this.red=p,this},s.prototype.forceRed=function(p){return n(!this.red,"Already a number in reduction context"),this._forceRed(p)},s.prototype.redAdd=function(p){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},s.prototype.redIAdd=function(p){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},s.prototype.redSub=function(p){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},s.prototype.redISub=function(p){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},s.prototype.redShl=function(p){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},s.prototype.redMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},s.prototype.redIMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(p){return n(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var U={k256:null,p224:null,p192:null,p25519:null};function H(p,m){this.name=p,this.p=new s(m,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var p=new s(null);return p.words=new Array(Math.ceil(this.n/13)),p},H.prototype.ireduce=function(p){var m=p,w;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),w=m.bitLength();while(w>this.n);var A=w0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},H.prototype.split=function(p,m){p.iushrn(this.n,0,m)},H.prototype.imulK=function(p){return p.imul(this.k)};function I(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(I,H),I.prototype.split=function(p,m){for(var w=4194303,A=Math.min(p.length,9),P=0;P>>22,S=k}S>>>=22,p.words[P-10]=S,S===0&&p.length>10?p.length-=10:p.length-=9},I.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,w=0;w>>=26,p.words[w]=P,m=A}return m!==0&&(p.words[p.length++]=m),p},s._prime=function(p){if(U[p])return U[p];var m;if(p==="k256")m=new I;else if(p==="p224")m=new T;else if(p==="p192")m=new F;else if(p==="p25519")m=new K;else throw new Error("Unknown prime "+p);return U[p]=m,m};function B(p){if(typeof p=="string"){var m=s._prime(p);this.m=m.p,this.prime=m}else n(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}B.prototype._verify1=function(p){n(p.negative===0,"red works only with positives"),n(p.red,"red works only with red numbers")},B.prototype._verify2=function(p,m){n((p.negative|m.negative)===0,"red works only with positives"),n(p.red&&p.red===m.red,"red works only with red numbers")},B.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):(d(p,p.umod(this.m)._forceRed(this)),p)},B.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},B.prototype.add=function(p,m){this._verify2(p,m);var w=p.add(m);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},B.prototype.iadd=function(p,m){this._verify2(p,m);var w=p.iadd(m);return w.cmp(this.m)>=0&&w.isub(this.m),w},B.prototype.sub=function(p,m){this._verify2(p,m);var w=p.sub(m);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},B.prototype.isub=function(p,m){this._verify2(p,m);var w=p.isub(m);return w.cmpn(0)<0&&w.iadd(this.m),w},B.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},B.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},B.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},B.prototype.isqr=function(p){return this.imul(p,p.clone())},B.prototype.sqr=function(p){return this.mul(p,p)},B.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var w=this.m.add(new s(1)).iushrn(2);return this.pow(p,w)}for(var A=this.m.subn(1),P=0;!A.isZero()&&A.andln(1)===0;)P++,A.iushrn(1);n(!A.isZero());var S=new s(1).toRed(this),k=S.redNeg(),y=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new s(2*b*b).toRed(this);this.pow(b,y).cmp(k)!==0;)b.redIAdd(k);for(var V=this.pow(b,A),ce=this.pow(p,A.addn(1).iushrn(1)),de=this.pow(p,A),W=P;de.cmp(S)!==0;){for(var le=de,Y=0;le.cmp(S)!==0;Y++)le=le.redSqr();n(Y=0;P--){for(var V=m.words[P],ce=b-1;ce>=0;ce--){var de=V>>ce&1;if(S!==A[0]&&(S=this.sqr(S)),de===0&&k===0){y=0;continue}k<<=1,k|=de,y++,!(y!==w&&(P!==0||ce!==0))&&(S=this.mul(S,A[k]),y=0,k=0)}b=26}return S},B.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},B.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},s.mont=function(p){return new _(p)};function _(p){B.call(this,p),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(_,B),_.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},_.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},_.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var w=p.imul(m),A=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=w.isub(A).iushrn(this.shift),S=P;return P.cmp(this.m)>=0?S=P.isub(this.m):P.cmpn(0)<0&&(S=P.iadd(this.m)),S._forceRed(this)},_.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new s(0)._forceRed(this);var w=p.mul(m),A=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=w.isub(A).iushrn(this.shift),S=P;return P.cmp(this.m)>=0?S=P.isub(this.m):P.cmpn(0)<0&&(S=P.iadd(this.m)),S._forceRed(this)},_.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,gU)})(yU);var or=yU.exports;const bU="bignumber/5.7.0";var _5=or.BN;const au=new Ai(bU),d9={},mR=9007199254740991;function Vhe(t){return t!=null&&(vs.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||wo(t)||typeof t=="bigint"||vg(t))}let wR=!1,vs=class Va{constructor(e,r){e!==d9&&au.throwError("cannot call constructor directly; use BigNumber.from",Ai.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ns(Er(this).fromTwos(e))}toTwos(e){return Ns(Er(this).toTwos(e))}abs(){return this._hex[0]==="-"?Va.from(this._hex.substring(1)):this}add(e){return Ns(Er(this).add(Er(e)))}sub(e){return Ns(Er(this).sub(Er(e)))}div(e){return Va.from(e).isZero()&&Zo("division-by-zero","div"),Ns(Er(this).div(Er(e)))}mul(e){return Ns(Er(this).mul(Er(e)))}mod(e){const r=Er(e);return r.isNeg()&&Zo("division-by-zero","mod"),Ns(Er(this).umod(r))}pow(e){const r=Er(e);return r.isNeg()&&Zo("negative-power","pow"),Ns(Er(this).pow(r))}and(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Zo("unbound-bitwise-result","and"),Ns(Er(this).and(r))}or(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Zo("unbound-bitwise-result","or"),Ns(Er(this).or(r))}xor(e){const r=Er(e);return(this.isNegative()||r.isNeg())&&Zo("unbound-bitwise-result","xor"),Ns(Er(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Zo("negative-width","mask"),Ns(Er(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Zo("negative-width","shl"),Ns(Er(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Zo("negative-width","shr"),Ns(Er(this).shrn(e))}eq(e){return Er(this).eq(Er(e))}lt(e){return Er(this).lt(Er(e))}lte(e){return Er(this).lte(Er(e))}gt(e){return Er(this).gt(Er(e))}gte(e){return Er(this).gte(Er(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Er(this).isZero()}toNumber(){try{return Er(this).toNumber()}catch{Zo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return au.throwError("this platform does not support BigInt",Ai.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?wR||(wR=!0,au.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?au.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ai.errors.UNEXPECTED_ARGUMENT,{}):au.throwError("BigNumber.toString does not accept parameters",Ai.errors.UNEXPECTED_ARGUMENT,{})),Er(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Va)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Va(d9,lv(e)):e.match(/^-?[0-9]+$/)?new Va(d9,lv(new _5(e))):au.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Zo("underflow","BigNumber.from",e),(e>=mR||e<=-mR)&&Zo("overflow","BigNumber.from",e),Va.from(String(e));const r=e;if(typeof r=="bigint")return Va.from(r.toString());if(vg(r))return Va.from(Ls(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Va.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(wo(n)||n[0]==="-"&&wo(n.substring(1))))return Va.from(n)}return au.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function lv(t){if(typeof t!="string")return lv(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&au.throwArgumentError("invalid hex","value",t),t=lv(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Ns(t){return vs.from(lv(t))}function Er(t){const e=vs.from(t).toHexString();return e[0]==="-"?new _5("-"+e.substring(3),16):new _5(e.substring(2),16)}function Zo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),au.throwError(t,Ai.errors.NUMERIC_FAULT,n)}function Khe(t){return new _5(t,36).toString(16)}const fs=new Ai(bU),Xm={},xU=vs.from(0),_U=vs.from(-1);function CU(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),fs.throwError(t,Ai.errors.NUMERIC_FAULT,i)}let ew="0";for(;ew.length<256;)ew+=ew;function AE(t){if(typeof t!="number")try{t=vs.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+ew.substring(0,t):fs.throwArgumentError("invalid decimal size","decimals",t)}function f9(t,e){e==null&&(e=0);const r=AE(e);t=vs.from(t);const n=t.lt(xU);n&&(t=t.mul(_U));let i=t.mod(r).toString();for(;i.length2&&fs.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&CU("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&fs.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&fs.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&fs.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new k_(Xm,r,n,i)}},AU=class as{constructor(e,r,n,i){e!==Xm&&fs.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ai.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&fs.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Jl(this._value,this.format.decimals),n=Jl(e._value,e.format.decimals);return as.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Jl(this._value,this.format.decimals),n=Jl(e._value,e.format.decimals);return as.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Jl(this._value,this.format.decimals),n=Jl(e._value,e.format.decimals);return as.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Jl(this._value,this.format.decimals),n=Jl(e._value,e.format.decimals);return as.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=as.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(vR.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=as.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(vR.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&fs.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=as.from("1"+ew.substring(0,e),this.format),i=Ghe.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&fs.throwArgumentError("invalid byte width","width",e);const r=vs.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return cl(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return as.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!Vhe(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),as.fromString(f9(e,r),h9.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=h9.from(r),i=Jl(e,n.decimals);!n.signed&&i.lt(xU)&&CU("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=cl(s,n.width/8));const o=f9(i,n.decimals);return new as(Xm,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=h9.from(r);if(On(e).length>n.width/8)throw new Error("overflow");let i=vs.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=f9(i,n.decimals);return new as(Xm,s,o,n)}static from(e,r){if(typeof e=="string")return as.fromString(e,r);if(vg(e))return as.fromBytes(e,r);try{return as.fromValue(e,0,r)}catch(n){if(n.code!==Ai.errors.INVALID_ARGUMENT)throw n}return fs.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const vR=AU.from(1),Ghe=AU.from("0.5"),Zhe="strings/5.7.0",Qhe=new Ai(Zhe);var C5;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(C5||(C5={}));var yR;(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"})(yR||(yR={}));function p9(t,e=C5.current){e!=C5.current&&(Qhe.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 On(r)}function Yhe(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function bR(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}bR("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),g9("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),g9("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g9("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Yhe),bR("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Jhe(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function Xhe(t){const e={};for(let r=0;r>--c&1}const h=31,g=Math.pow(2,h),v=g>>>1,x=v>>1,R=g-1;let M=0;for(let U=0;U1;){let K=H+I>>>1;U>>1|d(),T=T<<1^v,F=(F^v)<<1|v|1;E=T,O=1+F-T}let L=n-4;return N.map(U=>{switch(U-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 U-1}})}function t0e(t){let e=0;return()=>t[e++]}function r0e(t){return t0e(e0e(t))}function n0e(t){return t&1?~t>>1:t>>1}function i0e(t,e){let r=Array(t);for(let n=0;ne[o]):r}function o0e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(c0e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(l0e(r,t))}return Xhe(EU(e))}function a0e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function SU(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function c0e(t,e){let r=1+e(),n=e(),i=a0e(e),s=SU(i.length,1+t,e);return EU(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((d,h)=>{let g=h*n;return[c+h*r,l.map(v=>v+g)]})}))}function l0e(t,e){let r=1+e();return SU(r,1+t,e).map(n=>[n[0],n.slice(1)])}function u0e(t){let e=A5(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=A5(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,d)=>d.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function d0e(){return r0e(Jhe("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const yy=d0e();new Set(A5(yy)),new Set(A5(yy)),o0e(yy),u0e(yy);const f0e=new Uint8Array(32);f0e.fill(0);const h0e=`Ethereum Signed Message: +`;function IU(t){return typeof t=="string"&&(t=p9(t)),CE(jhe([p9(h0e),p9(String(t.length)),t]))}const p0e="address/5.7.0",Nm=new Ai(p0e);function _R(t){wo(t,20)||Nm.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=On(CE(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 g0e=9007199254740991;function m0e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const EE={};for(let t=0;t<10;t++)EE[String(t)]=String(t);for(let t=0;t<26;t++)EE[String.fromCharCode(65+t)]=String(10+t);const CR=Math.floor(m0e(g0e));function w0e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>EE[n]).join("");for(;e.length>=CR;){let n=e.substring(0,CR);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 v0e(t){let e=null;if(typeof t!="string"&&Nm.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=_R(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Nm.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)!==w0e(t)&&Nm.throwArgumentError("bad icap checksum","address",t),e=Khe(t.substring(4));e.length<40;)e="0"+e;e=_R("0x"+e)}else Nm.throwArgumentError("invalid address","address",t);return e}function hm(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}const y0e=new Uint8Array(32);y0e.fill(0),vs.from(-1);const b0e=vs.from(0),x0e=vs.from(1);vs.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),cl(x0e.toHexString(),32),cl(b0e.toHexString(),32);var qc={},Tr={},x2=TU;function TU(t,e){if(!t)throw new Error(e||"Assertion failed")}TU.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var P_={exports:{}};typeof Object.create=="function"?P_.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:P_.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var _0e=x2,C0e=P_.exports;Tr.inherits=C0e;function A0e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function E0e(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):A0e(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}Tr.htonl=kU;function I0e(t,e){for(var r="",n=0;n>>0}return s}Tr.join32=T0e;function k0e(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}Tr.split32=k0e;function P0e(t,e){return t>>>e|t<<32-e}Tr.rotr32=P0e;function R0e(t,e){return t<>>32-e}Tr.rotl32=R0e;function N0e(t,e){return t+e>>>0}Tr.sum32=N0e;function M0e(t,e,r){return t+e+r>>>0}Tr.sum32_3=M0e;function O0e(t,e,r,n){return t+e+r+n>>>0}Tr.sum32_4=O0e;function $0e(t,e,r,n,i){return t+e+r+n+i>>>0}Tr.sum32_5=$0e;function D0e(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Tr.sum64=D0e;function L0e(t,e,r,n){var i=e+n>>>0,s=(i>>0}Tr.sum64_hi=L0e;function B0e(t,e,r,n){var i=e+n;return i>>>0}Tr.sum64_lo=B0e;function U0e(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}Tr.sum64_4_hi=U0e;function j0e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Tr.sum64_4_lo=j0e;function F0e(t,e,r,n,i,s,o,a,c,l){var d=0,h=e;h=h+n>>>0,d+=h>>0,d+=h>>0,d+=h>>0,d+=h>>0}Tr.sum64_5_hi=F0e;function z0e(t,e,r,n,i,s,o,a,c,l){var d=e+n+s+a+l;return d>>>0}Tr.sum64_5_lo=z0e;function W0e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Tr.rotr64_hi=W0e;function H0e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Tr.rotr64_lo=H0e;function q0e(t,e,r){return t>>>r}Tr.shr64_hi=q0e;function V0e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Tr.shr64_lo=V0e;var yg={},AR=Tr,K0e=x2;function by(){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}yg.BlockHash=by,by.prototype.update=function(t,e){if(t=AR.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=AR.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=t&255}else for(n[i++]=t&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,s=8;s>>3}Ol.g0_256=J0e;function X0e(t){return ll(t,17)^ll(t,19)^t>>>10}Ol.g1_256=X0e;var B1=Tr,epe=yg,tpe=Ol,m9=B1.rotl32,pm=B1.sum32,rpe=B1.sum32_5,npe=tpe.ft_1,$U=epe.BlockHash,ipe=[1518500249,1859775393,2400959708,3395469782];function Jc(){if(!(this instanceof Jc))return new Jc;$U.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}B1.inherits(Jc,$U);var spe=Jc;Jc.blockSize=512,Jc.outSize=160,Jc.hmacStrength=80,Jc.padLength=64,Jc.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=new this.Hash().update(t).digest()),Vpe(t.length<=this.blockSize);for(var e=t.length;e>8,g=d&255;h?c.push(h,g):c.push(g)}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(g>>1)-1?R=(g>>1)-M:R=M,v.isubn(R)):R=0,h[x]=R,v.iushrn(1)}return h}r.getNAF=n;function i(c,l){var d=[[],[]];c=c.clone(),l=l.clone();for(var h=0,g=0,v;c.cmpn(-h)>0||l.cmpn(-g)>0;){var x=c.andln(3)+h&3,R=l.andln(3)+g&3;x===3&&(x=-1),R===3&&(R=-1);var M;x&1?(v=c.andln(7)+h&7,(v===3||v===5)&&R===2?M=-x:M=x):M=0,d[0].push(M);var N;R&1?(v=l.andln(7)+g&7,(v===3||v===5)&&x===2?N=-R:N=R):N=0,d[1].push(N),2*h===M+1&&(h=1-h),2*g===N+1&&(g=1-g),c.iushrn(1),l.iushrn(1)}return d}r.getJSF=i;function s(c,l,d){var h="_"+l;c.prototype[l]=function(){return this[h]!==void 0?this[h]:this[h]=d.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 or(c,"hex","le")}r.intFromLE=a}),_y=_o.getNAF,Zpe=_o.getJSF,E5=_o.assert;function Ed(t,e){this.type=t,this.p=new or(e.p,16),this.red=e.prime?or.red(e.prime):or.mont(this.p),this.zero=new or(0).toRed(this.red),this.one=new or(1).toRed(this.red),this.two=new or(2).toRed(this.red),this.n=e.n&&new or(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 N0=Ed;Ed.prototype.point=function(){throw new Error("Not implemented")},Ed.prototype.validate=function(){throw new Error("Not implemented")},Ed.prototype._fixedNafMul=function(t,e){E5(t.precomputed);var r=t._getDoubles(),n=_y(e,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o=0;a--){for(var c=0;a>=0&&s[a]===0;a--)c++;if(a>=0&&c++,o=o.dblp(c),a<0)break;var l=s[a];E5(l!==0),t.type==="affine"?l>0?o=o.mixedAdd(i[l-1>>1]):o=o.mixedAdd(i[-l-1>>1].neg()):l>0?o=o.add(i[l-1>>1]):o=o.add(i[-l-1>>1].neg())}return t.type==="affine"?o.toP():o},Ed.prototype._wnafMulAdd=function(t,e,r,n,i){var s=this._wnafT1,o=this._wnafT2,a=this._wnafT3,c=0,l,d,h;for(l=0;l=1;l-=2){var v=l-1,x=l;if(s[v]!==1||s[x]!==1){a[v]=_y(r[v],s[v],this._bitLength),a[x]=_y(r[x],s[x],this._bitLength),c=Math.max(a[v].length,c),c=Math.max(a[x].length,c);continue}var R=[e[v],null,null,e[x]];e[v].y.cmp(e[x].y)===0?(R[1]=e[v].add(e[x]),R[2]=e[v].toJ().mixedAdd(e[x].neg())):e[v].y.cmp(e[x].y.redNeg())===0?(R[1]=e[v].toJ().mixedAdd(e[x]),R[2]=e[v].add(e[x].neg())):(R[1]=e[v].toJ().mixedAdd(e[x]),R[2]=e[v].toJ().mixedAdd(e[x].neg()));var M=[-3,-1,-5,-7,0,7,5,1,3],N=Zpe(r[v],r[x]);for(c=Math.max(N[0].length,c),a[v]=new Array(c),a[x]=new Array(c),d=0;d=0;l--){for(var H=0;l>=0;){var I=!0;for(d=0;d=0&&H++,L=L.dblp(H),l<0)break;for(d=0;d0?h=o[d][T-1>>1]:T<0&&(h=o[d][-T-1>>1].neg()),h.type==="affine"?L=L.mixedAdd(h):L=L.add(h))}}for(l=0;l=Math.ceil((t.bitLength()+1)/e.step):!1},Qo.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(g=c,v=l),d.negative&&(d=d.neg(),h=h.neg()),g.negative&&(g=g.neg(),v=v.neg()),[{a:d,b:h},{a:g,b:v}]},aa.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),c=i.mul(r.b),l=s.mul(n.b),d=t.sub(o).sub(a),h=c.add(l).neg();return{k1:d,k2:h}},aa.prototype.pointFromX=function(t,e){t=new or(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},aa.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},aa.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s":""},di.prototype.isInfinity=function(){return this.inf},di.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},di.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},di.prototype.getX=function(){return this.x.fromRed()},di.prototype.getY=function(){return this.y.fromRed()},di.prototype.mul=function(t){return t=new or(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},di.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},di.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},di.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},di.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},di.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function _i(t,e,r,n){N0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new or(0)):(this.x=new or(e,16),this.y=new or(r,16),this.z=new or(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}IE(_i,N0.BasePoint),aa.prototype.jpoint=function(t,e,r){return new _i(this,t,e,r)},_i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},_i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_i.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.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(),d=l.redMul(a),h=n.redMul(l),g=c.redSqr().redIAdd(d).redISub(h).redISub(h),v=c.redMul(h.redISub(g)).redISub(s.redMul(d)),x=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(g,v,x)},_i.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(o.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),l=c.redMul(o),d=r.redMul(c),h=a.redSqr().redIAdd(l).redISub(d).redISub(d),g=a.redMul(d.redISub(h)).redISub(i.redMul(l)),v=this.z.redMul(o);return this.curve.jpoint(h,g,v)},_i.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},_i.prototype.inspect=function(){return this.isInfinity()?"":""},_i.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var sb=xg(function(t,e){var r=e;r.base=N0,r.short=Ype,r.mont=null,r.edwards=null}),ob=xg(function(t,e){var r=e,n=_o.assert;function i(a){a.type==="short"?this.curve=new sb.short(a):a.type==="edwards"?this.curve=new sb.edwards(a):this.curve=new sb.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:qc.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:qc.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:qc.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:qc.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:qc.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:qc.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:qc.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:qc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Sd(t){if(!(this instanceof Sd))return new Sd(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=sc.toArray(t.entropy,t.entropyEnc||"hex"),r=sc.toArray(t.nonce,t.nonceEnc||"hex"),n=sc.toArray(t.pers,t.persEnc||"hex");SE(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var TR=Sd;Sd.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Sd.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(n=r,r=e,e=null),r&&(r=sc.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Jpe=_o.assert;function d4(t,e){if(t instanceof d4)return t;this._importDER(t,e)||(Jpe(t.r&&t.s,"Signature without r or s"),this.r=new or(t.r,16),this.s=new or(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Cy=d4;function Xpe(){this.place=0}function x9(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 kR(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)}d4.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=kR(e),r=kR(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];_9(n,e.length),n=n.concat(e),n.push(2),_9(n,r.length);var i=n.concat(r),s=[48];return _9(s,i.length),s=s.concat(i),_o.encode(s,t)};var e1e=function(){throw new Error("unsupported")},KU=_o.assert;function ia(t){if(!(this instanceof ia))return new ia(t);typeof t=="string"&&(KU(Object.prototype.hasOwnProperty.call(ob,t),"Unknown curve "+t),t=ob[t]),t instanceof ob.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 t1e=ia;ia.prototype.keyPair=function(t){return new b9(this,t)},ia.prototype.keyFromPrivate=function(t,e){return b9.fromPrivate(this,t,e)},ia.prototype.keyFromPublic=function(t,e){return b9.fromPublic(this,t,e)},ia.prototype.genKeyPair=function(t){t||(t={});for(var e=new TR({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||e1e(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new or(2));;){var i=new or(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},ia.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},ia.prototype.sign=function(t,e,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new or(t,16));for(var i=this.n.byteLength(),s=e.getPrivate().toArray("be",i),o=t.toArray("be",i),a=new TR({hash:this.hash,entropy:s,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new or(1)),l=0;;l++){var d=n.k?n.k(l):new or(a.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(c)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var g=h.getX(),v=g.umod(this.n);if(v.cmpn(0)!==0){var x=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(x=x.umod(this.n),x.cmpn(0)!==0){var R=(h.getY().isOdd()?1:0)|(g.cmp(v)!==0?2:0);return n.canonical&&x.cmp(this.nh)>0&&(x=this.n.sub(x),R^=1),new Cy({r:v,s:x,recoveryParam:R})}}}}}},ia.prototype.verify=function(t,e,r,n){t=this._truncateToN(new or(t,16)),r=this.keyFromPublic(r,n),e=new Cy(e,"hex");var i=e.r,s=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o=s.invm(this.n),a=o.mul(t).umod(this.n),c=o.mul(i).umod(this.n),l;return this.curve._maxwellTrick?(l=this.g.jmulAdd(a,r.getPublic(),c),l.isInfinity()?!1:l.eqXToP(i)):(l=this.g.mulAdd(a,r.getPublic(),c),l.isInfinity()?!1:l.getX().umod(this.n).cmp(i)===0)},ia.prototype.recoverPubKey=function(t,e,r,n){KU((3&r)===r,"The recovery param is more than two bits"),e=new Cy(e,n);var i=this.n,s=new or(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 d=e.r.invm(i),h=i.sub(s).mul(d).umod(i),g=a.mul(d).umod(i);return this.g.mulAdd(h,o,g)},ia.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Cy(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 r1e=xg(function(t,e){var r=e;r.version="6.5.4",r.utils=_o,r.rand=function(){throw new Error("unsupported")},r.curve=sb,r.curves=ob,r.ec=t1e,r.eddsa=null}),n1e=r1e.ec;const i1e="signing-key/5.7.0",M_=new Ai(i1e);let C9=null;function vd(){return C9||(C9=new n1e("secp256k1")),C9}class s1e{constructor(e){hm(this,"curve","secp256k1"),hm(this,"privateKey",Ls(e)),zhe(this.privateKey)!==32&&M_.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=vd().keyFromPrivate(On(this.privateKey));hm(this,"publicKey","0x"+r.getPublic(!1,"hex")),hm(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),hm(this,"_isSigningKey",!0)}_addPoint(e){const r=vd().keyFromPublic(On(this.publicKey)),n=vd().keyFromPublic(On(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=vd().keyFromPrivate(On(this.privateKey)),n=On(e);n.length!==32&&M_.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return vU({recoveryParam:i.recoveryParam,r:cl("0x"+i.r.toString(16),32),s:cl("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=vd().keyFromPrivate(On(this.privateKey)),n=vd().keyFromPublic(On(GU(e)));return cl("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function o1e(t,e){const r=vU(e),n={r:On(r.r),s:On(r.s)};return"0x"+vd().recoverPubKey(On(t),n,r.recoveryParam).encode("hex",!1)}function GU(t,e){const r=On(t);return r.length===32?new s1e(r).publicKey:r.length===33?"0x"+vd().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Ls(r):M_.throwArgumentError("invalid public or private key","key","[REDACTED]")}var PR;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(PR||(PR={}));function a1e(t){const e=GU(t);return v0e(gR(CE(gR(e,1)),12))}function c1e(t,e){return a1e(o1e(On(t),e))}const l1e="https://rpc.walletconnect.com/v1";async function u1e(t,e,r,n,i,s){switch(r.t){case"eip191":return d1e(t,e,r.s);case"eip1271":return await f1e(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function d1e(t,e,r){return c1e(IU(e),r).toLowerCase()===t.toLowerCase()}async function f1e(t,e,r,n,i,s){try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",l=r.substring(2),d=IU(e).substring(2),h=o+d+a+c+l,g=await fetch(`${s||l1e}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:h1e(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:v}=await g.json();return v?v.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function h1e(){return Date.now()+Math.floor(Math.random()*1e3)}var p1e=Object.defineProperty,g1e=Object.defineProperties,m1e=Object.getOwnPropertyDescriptors,RR=Object.getOwnPropertySymbols,w1e=Object.prototype.hasOwnProperty,v1e=Object.prototype.propertyIsEnumerable,NR=(t,e,r)=>e in t?p1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,y1e=(t,e)=>{for(var r in e||(e={}))w1e.call(e,r)&&NR(t,r,e[r]);if(RR)for(var r of RR(e))v1e.call(e,r)&&NR(t,r,e[r]);return t},b1e=(t,e)=>g1e(t,m1e(e));const x1e="did:pkh:",TE=t=>t==null?void 0:t.split(":"),ZU=t=>{const e=t&&TE(t);if(e)return t.includes(x1e)?e[3]:e[1]},MR=t=>{const e=t&&TE(t);if(e)return e[2]+":"+e[3]},S5=t=>{const e=t&&TE(t);if(e)return e.pop()};async function OR(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=QU(i,i.iss),o=S5(i.iss);return await u1e(o,s,n,ZU(i.iss),r)}const QU=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=S5(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: ${ZU(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,d=t.exp?`Expiration Time: ${t.exp}`:void 0,h=t.nbf?`Not Before: ${t.nbf}`:void 0,g=t.requestId?`Request ID: ${t.requestId}`:void 0,v=t.resources?`Resources:${t.resources.map(R=>` +- ${R}`).join("")}`:void 0,x=ab(t.resources);if(x){const R=uv(x);i=P1e(i,R)}return[r,n,"",i,"",s,o,a,c,l,d,h,g,v].filter(R=>R!=null).join(` +`)};function _1e(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function C1e(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Qh(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 A1e(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:E1e(e,r,n)}}}function E1e(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 YU(t){return Qh(t),`urn:recap:${_1e(t).replace(/=/g,"")}`}function uv(t){const e=C1e(t.replace("urn:recap:",""));return Qh(e),e}function S1e(t,e,r){const n=A1e(t,e,r);return YU(n)}function I1e(t){return t&&t.includes("urn:recap:")}function T1e(t,e){const r=uv(t),n=uv(e),i=k1e(r,n);return YU(i)}function k1e(t,e){Qh(t),Qh(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]=b1e(y1e({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function P1e(t="",e){Qh(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(h=>({ability:h.split("/")[0],action:h.split("/")[1]}));c.sort((h,g)=>h.action.localeCompare(g.action));const l={};c.forEach(h=>{l[h.ability]||(l[h.ability]=[]),l[h.ability].push(h.action)});const d=Object.keys(l).map(h=>(i++,`(${i}) '${h}': '${l[h].join("', '")}' for '${a}'.`));n.push(d.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function $R(t){var e;const r=uv(t);Qh(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function DR(t){const e=uv(t);Qh(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 ab(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return I1e(e)?e:void 0}const JU="base10",ps="base16",Ld="base64pad",mm="base64url",_2="utf8",XU=0,bu=1,C2=2,R1e=0,LR=1,tw=12,kE=32;function N1e(){const t=gE.generateKeyPair();return{privateKey:wi(t.secretKey,ps),publicKey:wi(t.publicKey,ps)}}function O_(){const t=Ef.randomBytes(kE);return wi(t,ps)}function M1e(t,e){const r=gE.sharedKey(gi(t,ps),gi(e,ps),!0),n=new Jue(m2.SHA256,r).expand(kE);return wi(n,ps)}function cb(t){const e=m2.hash(gi(t,ps));return wi(e,ps)}function lu(t){const e=m2.hash(gi(t,_2));return wi(e,ps)}function ej(t){return gi(`${t}`,JU)}function Yh(t){return Number(wi(t,JU))}function O1e(t){const e=ej(typeof t.type<"u"?t.type:XU);if(Yh(e)===bu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?gi(t.senderPublicKey,ps):void 0,n=typeof t.iv<"u"?gi(t.iv,ps):Ef.randomBytes(tw),i=new hE.ChaCha20Poly1305(gi(t.symKey,ps)).seal(n,gi(t.message,_2));return tj({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function $1e(t,e){const r=ej(C2),n=Ef.randomBytes(tw),i=gi(t,_2);return tj({type:r,sealed:i,iv:n,encoding:e})}function D1e(t){const e=new hE.ChaCha20Poly1305(gi(t.symKey,ps)),{sealed:r,iv:n}=dv({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 wi(i,_2)}function L1e(t,e){const{sealed:r}=dv({encoded:t,encoding:e});return wi(r,_2)}function tj(t){const{encoding:e=Ld}=t;if(Yh(t.type)===C2)return wi(rb([t.type,t.sealed]),e);if(Yh(t.type)===bu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return wi(rb([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return wi(rb([t.type,t.iv,t.sealed]),e)}function dv(t){const{encoded:e,encoding:r=Ld}=t,n=gi(e,r),i=n.slice(R1e,LR),s=LR;if(Yh(i)===bu){const l=s+kE,d=l+tw,h=n.slice(s,l),g=n.slice(l,d),v=n.slice(d);return{type:i,sealed:v,iv:g,senderPublicKey:h}}if(Yh(i)===C2){const l=n.slice(s),d=Ef.randomBytes(tw);return{type:i,sealed:l,iv:d}}const o=s+tw,a=n.slice(s,o),c=n.slice(o);return{type:i,sealed:c,iv:a}}function B1e(t,e){const r=dv({encoded:t,encoding:e==null?void 0:e.encoding});return rj({type:Yh(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?wi(r.senderPublicKey,ps):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function rj(t){const e=(t==null?void 0:t.type)||XU;if(e===bu){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 BR(t){return t.type===bu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function UR(t){return t.type===C2}function U1e(t){return new DB.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function j1e(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function F1e(t){return Buffer.from(j1e(t),"base64")}function z1e(t,e){const[r,n,i]=t.split("."),s=F1e(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 m2.SHA256().update(Buffer.from(c)).digest(),d=U1e(e),h=Buffer.from(l).toString("hex");if(!d.verify(h,{r:o,s:a}))throw new Error("Invalid signature");return x_(t).payload}const W1e="irn";function $_(t){return(t==null?void 0:t.relay)||{protocol:W1e}}function Mm(t){const e=ghe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var H1e=Object.defineProperty,q1e=Object.defineProperties,V1e=Object.getOwnPropertyDescriptors,jR=Object.getOwnPropertySymbols,K1e=Object.prototype.hasOwnProperty,G1e=Object.prototype.propertyIsEnumerable,FR=(t,e,r)=>e in t?H1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zR=(t,e)=>{for(var r in e||(e={}))K1e.call(e,r)&&FR(t,r,e[r]);if(jR)for(var r of jR(e))G1e.call(e,r)&&FR(t,r,e[r]);return t},Z1e=(t,e)=>q1e(t,V1e(e));function Q1e(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 WR(t){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=av.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:Y1e(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Q1e(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Y1e(t){return t.startsWith("//")?t.substring(2):t}function J1e(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 X1e(t){return`${t.protocol}:${t.topic}@${t.version}?`+av.stringify(zR(Z1e(zR({symKey:t.symKey},J1e(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Ay(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function _g(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function ege(t){const e=[];return Object.values(t).forEach(r=>{e.push(..._g(r.accounts))}),e}function tge(t,e){const r=[];return Object.values(t).forEach(n=>{_g(n.accounts).includes(e)&&r.push(...n.methods)}),r}function rge(t,e){const r=[];return Object.values(t).forEach(n=>{_g(n.accounts).includes(e)&&r.push(...n.events)}),r}function PE(t){return t.includes(":")}function Om(t){return PE(t)?t.split(":")[0]:t}function nge(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 HR(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=nge(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=nb(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const ige={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}},sge={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 Qe(t,e){const{message:r,code:n}=sge[t];return{message:e?`${r} ${e}`:r,code:n}}function Vr(t,e){const{message:r,code:n}=ige[t];return{message:e?`${r} ${e}`:r,code:n}}function Jh(t,e){return!!Array.isArray(t)}function fv(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function js(t){return typeof t>"u"}function Fn(t,e){return e&&js(t)?!0:typeof t=="string"&&!!t.trim().length}function RE(t,e){return typeof t=="number"&&!isNaN(t)}function oge(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return ph(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],d=_g(a),h=r[o];(!ph(uU(o,h),d)||!ph(h.methods,c)||!ph(h.events,l))&&(s=!1)}),s):!1}function I5(t){return Fn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function age(t){if(Fn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&I5(r)}}return!1}function cge(t){if(Fn(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function lge(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function uge(t){return t==null?void 0:t.topic}function dge(t,e){let r=null;return Fn(t==null?void 0:t.publicKey,!1)||(r=Qe("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function qR(t){let e=!0;return Jh(t)?t.length&&(e=t.every(r=>Fn(r,!1))):e=!1,e}function fge(t,e,r){let n=null;return Jh(e)&&e.length?e.forEach(i=>{n||I5(i)||(n=Vr("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):I5(t)||(n=Vr("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 hge(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=fge(i,uU(i,s),`${e} ${r}`);o&&(n=o)}),n}function pge(t,e){let r=null;return Jh(t)?t.forEach(n=>{r||age(n)||(r=Vr("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Vr("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function gge(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=pge(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function mge(t,e){let r=null;return qR(t==null?void 0:t.methods)?qR(t==null?void 0:t.events)||(r=Vr("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Vr("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function nj(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=mge(n,`${e}, namespace`);i&&(r=i)}),r}function wge(t,e,r){let n=null;if(t&&fv(t)){const i=nj(t,e);i&&(n=i);const s=hge(t,e,r);s&&(n=s)}else n=Qe("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function A9(t,e){let r=null;if(t&&fv(t)){const n=nj(t,e);n&&(r=n);const i=gge(t,e);i&&(r=i)}else r=Qe("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function ij(t){return Fn(t.protocol,!0)}function vge(t,e){let r=!1;return t?t&&Jh(t)&&t.length&&t.forEach(n=>{r=ij(n)}):r=!0,r}function yge(t){return typeof t=="number"}function Ds(t){return typeof t<"u"&&typeof t!==null}function bge(t){return!(!t||typeof t!="object"||!t.code||!RE(t.code)||!t.message||!Fn(t.message,!1))}function xge(t){return!(js(t)||!Fn(t.method,!1))}function _ge(t){return!(js(t)||js(t.result)&&js(t.error)||!RE(t.id)||!Fn(t.jsonrpc,!1))}function Cge(t){return!(js(t)||!Fn(t.name,!1))}function VR(t,e){return!(!I5(e)||!ege(t).includes(e))}function Age(t,e,r){return Fn(r,!1)?tge(t,e).includes(r):!1}function Ege(t,e,r){return Fn(r,!1)?rge(t,e).includes(r):!1}function KR(t,e,r){let n=null;const i=Sge(t),s=Ige(e),o=Object.keys(i),a=Object.keys(s),c=GR(Object.keys(t)),l=GR(Object.keys(e)),d=c.filter(h=>!l.includes(h));return d.length&&(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${d.toString()} - Received: ${Object.keys(e).toString()}`)),mh(o,a)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(e).toString()}`)),ph(o,a)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const g=Ag(e[f].accounts);g.includes(f)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} - Required: ${f} - Approved: ${g.toString()}`))}),o.forEach(f=>{n||(mh(i[f].methods,s[f].methods)?mh(i[f].events,s[f].events)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function Kge(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 aN(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Gge(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ag(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 Zge(t,e){return zE(t)&&t<=e.max&&t>=e.min}function cN(){const t=C2();return new Promise(e=>{switch(t){case vo.browser:e(Qge());break;case vo.reactNative:e(Yge());break;case vo.node:e(Jge());break;default:e(!0)}})}function Qge(){return x2()&&(navigator==null?void 0:navigator.onLine)}async function Yge(){if(yg()&&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 Jge(){return!0}function Xge(t){switch(C2()){case vo.browser:eme(t);break;case vo.reactNative:tme(t);break}}function eme(t){!yg()&&x2()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function tme(t){yg()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const N9={};class ym{static get(e){return N9[e]}static set(e,r){N9[e]=r}static delete(e){delete N9[e]}}const rme="PARSE_ERROR",nme="INVALID_REQUEST",ime="METHOD_NOT_FOUND",sme="INVALID_PARAMS",xj="INTERNAL_ERROR",WE="SERVER_ERROR",ome=[-32700,-32600,-32601,-32602,-32603],iw={[rme]:{code:-32700,message:"Parse error"},[nme]:{code:-32600,message:"Invalid Request"},[ime]:{code:-32601,message:"Method not found"},[sme]:{code:-32602,message:"Invalid params"},[xj]:{code:-32603,message:"Internal error"},[WE]:{code:-32e3,message:"Server error"}},Cj=WE;function ame(t){return ome.includes(t)}function lN(t){return Object.keys(iw).includes(t)?iw[t]:iw[Cj]}function cme(t){const e=Object.values(iw).find(r=>r.code===t);return e||iw[Cj]}function _j(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Aj={},ru={},uN;function lme(){if(uN)return ru;uN=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.isBrowserCryptoAvailable=ru.getSubtleCrypto=ru.getBrowerCrypto=void 0;function t(){return(Yi==null?void 0:Yi.crypto)||(Yi==null?void 0:Yi.msCrypto)||{}}ru.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}ru.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return ru.isBrowserCryptoAvailable=r,ru}var nu={},dN;function ume(){if(dN)return nu;dN=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.isBrowser=nu.isNode=nu.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}nu.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}nu.isNode=e;function r(){return!t()&&!e()}return nu.isBrowser=r,nu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g2;e.__exportStar(lme(),t),e.__exportStar(ume(),t)})(Aj);function Cd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function wh(t=6){return BigInt(Cd(t))}function vh(t,e,r){return{id:r||Cd(),jsonrpc:"2.0",method:t,params:e}}function y4(t,e){return{id:t,jsonrpc:"2.0",result:e}}function b4(t,e,r){return{id:t,jsonrpc:"2.0",error:dme(e)}}function dme(t,e){return typeof t>"u"?lN(xj):(typeof t=="string"&&(t=Object.assign(Object.assign({},lN(WE)),{message:t})),ame(t.code)&&(t=cme(t.code)),t)}let fme=class{},hme=class extends fme{constructor(){super()}},pme=class extends hme{constructor(e){super()}};const gme="^https?:",mme="^wss?:";function wme(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Ej(t,e){const r=wme(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function fN(t){return Ej(t,gme)}function hN(t){return Ej(t,mme)}function vme(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Sj(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function HE(t){return Sj(t)&&"method"in t}function x4(t){return Sj(t)&&(Qc(t)||la(t))}function Qc(t){return"result"in t}function la(t){return"error"in t}let Tc=class extends pme{constructor(e){super(e),this.events=new Ea.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(vh(e.method,e.params||[],e.id||wh().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=>{la(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),x4(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 yme=()=>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"),bme=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",pN=t=>t.split("?")[0],gN=10,xme=yme();let Cme=class{constructor(e){if(this.url=e,this.events=new Ea.EventEmitter,this.registering=!1,!hN(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(Ru(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!hN(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=Aj.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!vme(e)},o=new xme(e,[],s);bme()?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"?jh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=b4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return _j(e,pN(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>gN&&this.events.setMaxListeners(gN)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${pN(this.url)}`));return this.events.emit("register_error",r),r}};var $5={exports:{}};$5.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]",d="[object Boolean]",f="[object Date]",g="[object Error]",v="[object Function]",x="[object GeneratorFunction]",P="[object Map]",M="[object Number]",N="[object Null]",E="[object Object]",$="[object Promise]",L="[object Proxy]",j="[object RegExp]",H="[object Set]",I="[object String]",T="[object Symbol]",B="[object Undefined]",K="[object WeakMap]",U="[object ArrayBuffer]",C="[object DataView]",p="[object Float32Array]",m="[object Float64Array]",w="[object Int8Array]",_="[object Int16Array]",R="[object Int32Array]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",y="[object Uint16Array]",b="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,ce=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,W={};W[p]=W[m]=W[w]=W[_]=W[R]=W[S]=W[k]=W[y]=W[b]=!0,W[a]=W[c]=W[U]=W[d]=W[C]=W[f]=W[g]=W[v]=W[P]=W[M]=W[E]=W[j]=W[H]=W[I]=W[K]=!1;var ue=typeof Yi=="object"&&Yi&&Yi.Object===Object&&Yi,J=typeof self=="object"&&self&&self.Object===Object&&self,ne=ue||J||Function("return this")(),ie=e&&!e.nodeType&&e,D=ie&&!0&&t&&!t.nodeType&&t,te=D&&D.exports===ie,me=te&&ue.process,Ce=function(){try{return me&&me.binding&&me.binding("util")}catch{}}(),Ee=Ce&&Ce.isTypedArray;function Re(oe,we){for(var De=-1,mt=oe==null?0:oe.length,Zr=0,nr=[];++De-1}function Ui(oe,we){var De=this.__data__,mt=jf(De,oe);return mt<0?(++this.size,De.push([oe,we])):De[mt][1]=we,this}ar.prototype.clear=Oi,ar.prototype.delete=Di,ar.prototype.get=Li,ar.prototype.has=Bi,ar.prototype.set=Ui;function Pn(oe){var we=-1,De=oe==null?0:oe.length;for(this.clear();++weKn))return!1;var Qr=nr.get(oe);if(Qr&&nr.get(we))return Qr==we;var Bn=-1,Ns=!0,Gn=De&s?new Ps:void 0;for(nr.set(oe,we),nr.set(we,oe);++Bn-1&&oe%1==0&&oe-1&&oe%1==0&&oe<=o}function s3(oe){var we=typeof oe;return oe!=null&&(we=="object"||we=="function")}function Wf(oe){return oe!=null&&typeof oe=="object"}var o3=Ee?rt(Ee):K2;function n8(oe){return t8(oe)?q2(oe):G2(oe)}function Gr(){return[]}function qr(){return!1}t.exports=r8})($5,$5.exports);var _me=$5.exports;const Ame=Ec(_me);var Eme={};function Sme(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($);N!==E;){for(var j=x[N],H=0,I=$-1;(j!==0||H>>0,L[I]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");M=H,N++}for(var T=$-M;T!==$&&L[T]===0;)T++;for(var B=c.repeat(P);T<$;++T)B+=t.charAt(L[T]);return B}function g(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var P=0;if(x[P]!==" "){for(var M=0,N=0;x[P]===c;)M++,P++;for(var E=(x.length-P)*l+1>>>0,$=new Uint8Array(E);x[P];){var L=r[x.charCodeAt(P)];if(L===255)return;for(var j=0,H=E-1;(L!==0||j>>0,$[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");N=j,P++}if(x[P]!==" "){for(var I=E-N;I!==E&&$[I]===0;)I++;for(var T=new Uint8Array(M+(E-I)),B=M;I!==E;)T[B++]=$[I++];return T}}}function v(x){var P=g(x);if(P)return P;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:g,decode:v}}var Ime=Sme,Tme=Ime;const Ij=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")},kme=t=>new TextEncoder().encode(t),Rme=t=>new TextDecoder().decode(t);let Pme=class{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")}},Nme=class{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 Tj(this,e)}},Mme=class{constructor(e){this.decoders=e}or(e){return Tj(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 Tj=(t,e)=>new Mme({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let $me=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Pme(e,r,n),this.decoder=new Nme(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const C4=({name:t,prefix:e,encode:r,decode:n})=>new $me(t,e,r,n),S2=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Tme(r,e);return C4({prefix:t,name:e,encode:n,decode:s=>Ij(i(s))})},Ome=(t,e,r,n)=>{const i={};for(let d=0;d=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Dme=(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<C4({prefix:e,name:t,encode(i){return Dme(i,n,r)},decode(i){return Ome(i,n,r,t)}}),Lme=C4({prefix:"\0",name:"identity",encode:t=>Rme(t),decode:t=>kme(t)});var Bme=Object.freeze({__proto__:null,identity:Lme});const Ume=Mi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var jme=Object.freeze({__proto__:null,base2:Ume});const Fme=Mi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zme=Object.freeze({__proto__:null,base8:Fme});const Wme=S2({prefix:"9",name:"base10",alphabet:"0123456789"});var Hme=Object.freeze({__proto__:null,base10:Wme});const qme=Mi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vme=Mi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Kme=Object.freeze({__proto__:null,base16:qme,base16upper:Vme});const Gme=Mi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Zme=Mi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Qme=Mi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Yme=Mi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jme=Mi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Xme=Mi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ewe=Mi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),twe=Mi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rwe=Mi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var nwe=Object.freeze({__proto__:null,base32:Gme,base32upper:Zme,base32pad:Qme,base32padupper:Yme,base32hex:Jme,base32hexupper:Xme,base32hexpad:ewe,base32hexpadupper:twe,base32z:rwe});const iwe=S2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),swe=S2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var owe=Object.freeze({__proto__:null,base36:iwe,base36upper:swe});const awe=S2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),cwe=S2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var lwe=Object.freeze({__proto__:null,base58btc:awe,base58flickr:cwe});const uwe=Mi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),dwe=Mi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fwe=Mi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),hwe=Mi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var pwe=Object.freeze({__proto__:null,base64:uwe,base64pad:dwe,base64url:fwe,base64urlpad:hwe});const kj=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),gwe=kj.reduce((t,e,r)=>(t[r]=e,t),[]),mwe=kj.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function wwe(t){return t.reduce((e,r)=>(e+=gwe[r],e),"")}function vwe(t){const e=[];for(const r of t){const n=mwe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const ywe=C4({prefix:"🚀",name:"base256emoji",encode:wwe,decode:vwe});var bwe=Object.freeze({__proto__:null,base256emoji:ywe}),xwe=Rj,mN=128,Cwe=127,_we=~Cwe,Awe=Math.pow(2,31);function Rj(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Awe;)e[r++]=t&255|mN,t/=128;for(;t&_we;)e[r++]=t&255|mN,t>>>=7;return e[r]=t|0,Rj.bytes=r-n+1,e}var Ewe=HC,Swe=128,wN=127;function HC(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw HC.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&wN)<=Swe);return HC.bytes=s-n,r}var Iwe=Math.pow(2,7),Twe=Math.pow(2,14),kwe=Math.pow(2,21),Rwe=Math.pow(2,28),Pwe=Math.pow(2,35),Nwe=Math.pow(2,42),Mwe=Math.pow(2,49),$we=Math.pow(2,56),Owe=Math.pow(2,63),Dwe=function(t){return t(Pj.encode(t,e,r),e),yN=t=>Pj.encodingLength(t),qC=(t,e)=>{const r=e.byteLength,n=yN(t),i=n+yN(r),s=new Uint8Array(i+r);return vN(t,s,0),vN(r,s,n),s.set(e,i),new Bwe(t,r,e,s)};class Bwe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Nj=({name:t,code:e,encode:r})=>new Uwe(t,e,r);class Uwe{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?qC(this.code,r):r.then(n=>qC(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Mj=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),jwe=Nj({name:"sha2-256",code:18,encode:Mj("SHA-256")}),Fwe=Nj({name:"sha2-512",code:19,encode:Mj("SHA-512")});var zwe=Object.freeze({__proto__:null,sha256:jwe,sha512:Fwe});const $j=0,Wwe="identity",Oj=Ij,Hwe=t=>qC($j,Oj(t)),qwe={code:$j,name:Wwe,encode:Oj,digest:Hwe};var Vwe=Object.freeze({__proto__:null,identity:qwe});new TextEncoder,new TextDecoder;const bN={...Bme,...jme,...zme,...Hme,...Kme,...nwe,...owe,...lwe,...pwe,...bwe};({...zwe,...Vwe});function Kwe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Dj(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const xN=Dj("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),M9=Dj("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Kwe(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}=Qe("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=is(r,this.name)}get context(){return io(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,IU(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?TU(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Nve{constructor(e,r,n){this.core=e,this.logger=r,this.name=Jwe,this.randomSessionIdentifier=zC(),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=XR(i);return WB(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=X1e();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=XR(s),a=this.randomSessionIdentifier;return await kue(a,i,Xwe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=ege(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||hb(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=vj(o),c=Ru(s);if(JP(a))return rge(c,o==null?void 0:o.encoding);if(YP(a)){const g=a.senderPublicKey,v=a.receiverPublicKey;i=await this.generateSharedKey(g,v)}const l=this.getSymKey(i),{type:d,senderPublicKey:f}=a;return tge({type:d,symKey:l,message:c,senderPublicKey:f,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=sge(s,o);if(JP(a)){const c=ige(s,o==null?void 0:o.encoding);return jh(c)}if(YP(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=nge({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return jh(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=jd)=>{const o=hv({encoded:i,encoding:s});return Xh(o.type)},this.getPayloadSenderPublicKey=(i,s=jd)=>{const o=hv({encoded:i,encoding:s});return o.senderPublicKey?vi(o.senderPublicKey,vs):void 0},this.core=e,this.logger=is(r,this.name),this.keychain=n||new Pve(this.core,this.logger)}get context(){return io(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(CN)}catch{e=zC(),await this.keychain.set(CN,e)}return Zwe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Mve extends $ce{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=rve,this.version=nve,this.initialized=!1,this.storagePrefix=Al,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=fu(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=fu(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=is(e,this.name),this.core=r}get context(){return io(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,IU(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?TU(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $ve extends Oce{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Ea.EventEmitter,this.name=sve,this.queue=new Map,this.publishTimeout=Je.toMiliseconds(Je.ONE_MINUTE),this.failedPublishTimeout=Je.toMiliseconds(Je.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)||ive,c=WC(s),l=(s==null?void 0:s.prompt)||!1,d=(s==null?void 0:s.tag)||0,f=(s==null?void 0:s.id)||wh().toString(),g={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:d,id:f,attestation:s==null?void 0:s.attestation}},v=`Failed to publish payload, please try again. id:${f} tag:${d}`,x=Date.now();let P,M=1;try{for(;P===void 0;){if(Date.now()-x>this.publishTimeout)throw new Error(v);this.logger.trace({id:f,attempts:M},`publisher.publish - attempt ${M}`),P=await await Zp(this.rpcPublish(n,i,a,c,l,d,f,s==null?void 0:s.attestation).catch(N=>this.logger.warn(N)),this.publishTimeout,v),M++,P||await new Promise(N=>setTimeout(N,this.failedPublishTimeout))}this.relayer.events.emit(ps.publish,g),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:s}})}catch(N){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(N),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw N;this.queue.set(f,g)}},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=is(r,this.name),this.registerEventListeners()}get context(){return io(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,d,f,g;const v={method:Om(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return Hs((l=v.params)==null?void 0:l.prompt)&&((d=v.params)==null||delete d.prompt),Hs((f=v.params)==null?void 0:f.tag)&&((g=v.params)==null||delete g.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:v}),this.relayer.request(v)}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(dg.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(ps.connection_stalled);return}this.checkQueue()}),this.relayer.on(ps.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class Ove{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 Dve=Object.defineProperty,Lve=Object.defineProperties,Bve=Object.getOwnPropertyDescriptors,AN=Object.getOwnPropertySymbols,Uve=Object.prototype.hasOwnProperty,jve=Object.prototype.propertyIsEnumerable,EN=(t,e,r)=>e in t?Dve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cm=(t,e)=>{for(var r in e||(e={}))Uve.call(e,r)&&EN(t,r,e[r]);if(AN)for(var r of AN(e))jve.call(e,r)&&EN(t,r,e[r]);return t},$9=(t,e)=>Lve(t,Bve(e));class Fve extends Bce{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new Ove,this.events=new Ea.EventEmitter,this.name=fve,this.version=hve,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Al,this.subscribeTimeout=Je.toMiliseconds(Je.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=WC(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==null?void 0:i.transportType);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 Je.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)>=pve&&(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=is(r,this.name),this.clientId=""}get context(){return io(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=WC(n);await this.rpcUnsubscribe(e,r,i);const s=Vr("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=Jr.relay){n===Jr.relay&&await this.restartToComplete();const i={method:Om(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{const s=fu(e+this.clientId);return n===Jr.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(o=>this.logger.warn(o))},Je.toMiliseconds(Je.ONE_SECOND)),s):await await Zp(this.relayer.request(i).catch(o=>this.logger.warn(o)),this.subscribeTimeout)?s:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(ps.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Om(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 Zp(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(ps.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:Om(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 Zp(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(ps.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:Om(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,$9(Cm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Cm({},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,Cm({},r)),this.topicMap.set(r.topic,e),this.events.emit(Yc.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}=Qe("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(Yc.deleted,$9(Cm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Yc.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}=Qe("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);e0(r)&&this.onBatchSubscribe(r.map((n,i)=>$9(Cm({},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(dg.pulse,async()=>{await this.checkPending()}),this.events.on(Yc.created,async e=>{const r=Yc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Yc.deleted,async e=>{const r=Yc.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}=Qe("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 zve=Object.defineProperty,SN=Object.getOwnPropertySymbols,Wve=Object.prototype.hasOwnProperty,Hve=Object.prototype.propertyIsEnumerable,IN=(t,e,r)=>e in t?zve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qve=(t,e)=>{for(var r in e||(e={}))Wve.call(e,r)&&IN(t,r,e[r]);if(SN)for(var r of SN(e))Hve.call(e,r)&&IN(t,r,e[r]);return t};class Vve extends Dce{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Ea.EventEmitter,this.name=ave,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=Je.toMiliseconds(Je.THIRTY_SECONDS+Je.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||wh().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 d=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(ea.disconnect,d);const f=await o;this.provider.off(ea.disconnect,d),c(f)});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(uv())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(ps.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(ps.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(ea.payload,this.onPayloadHandler),this.provider.on(ea.connect,this.onConnectHandler),this.provider.on(ea.disconnect,this.onDisconnectHandler),this.provider.on(ea.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?is(e.logger,this.name):t2(n2({level:e.logger||ove})),this.messages=new Mve(this.logger,e.core),this.subscriber=new Fve(this,this.logger),this.publisher=new $ve(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||jj,this.projectId=e.projectId,this.bundleId=Whe(),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 io(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:Jr.relay})}async subscribe(e,r){var n;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",s;const o=a=>{a.topic===e&&(this.subscriber.off(Yc.created,o),s())};return await Promise.all([new Promise(a=>{s=a,this.subscriber.on(Yc.created,o)}),new Promise(async a=>{i=await this.subscriber.subscribe(e,r)||i,a()})]),i}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.hasExperiencedNetworkDisruption||this.connected?await Zp(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(ea.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(ea.disconnect,i),await Zp(this.provider.connect(),Je.toMiliseconds(Je.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 cN())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=ti(Je.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(ps.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(uv())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 Tc(new Cme(Zhe({sdkVersion:Fj,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}),HE(e)){if(!e.method.endsWith(cve))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:Jr.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(qve({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else x4(e)&&this.events.emit(ps.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(ps.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=y4(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(ea.payload,this.onPayloadHandler),this.provider.off(ea.connect,this.onConnectHandler),this.provider.off(ea.disconnect,this.onDisconnectHandler),this.provider.off(ea.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await cN();Xge(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(ps.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Je.toMiliseconds(lve))))}isInitialized(){if(!this.initialized){const{message:e}=Qe("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 Kve=Object.defineProperty,TN=Object.getOwnPropertySymbols,Gve=Object.prototype.hasOwnProperty,Zve=Object.prototype.propertyIsEnumerable,kN=(t,e,r)=>e in t?Kve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,RN=(t,e)=>{for(var r in e||(e={}))Gve.call(e,r)&&kN(t,r,e[r]);if(TN)for(var r of TN(e))Zve.call(e,r)&&kN(t,r,e[r]);return t};class O0 extends Lce{constructor(e,r,n,i=Al,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=uve,this.cached=[],this.initialized=!1,this.storagePrefix=Al,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&&!Hs(o)?this.map.set(this.getKey(o),o):Rge(o)?this.map.set(o.id,o):Pge(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=>Ame(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=RN(RN({},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=is(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return io(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}=Qe("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=Qe("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}=Qe("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}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Qve{constructor(e,r){this.core=e,this.logger=r,this.name=gve,this.version=mve,this.events=new yE,this.initialized=!1,this.storagePrefix=Al,this.ignoredPayloadTypes=[_u],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=zC(),s=await this.core.crypto.setSymKey(i),o=ti(Je.FIVE_MINUTES),a={protocol:Uj},c={topic:s,expiry:o,relay:a,active:!1},l=bge({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.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:[qc.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=rN(n.uri);i.props.properties.topic=s,i.addTrace(qc.pairing_uri_validation_success),i.addTrace(qc.pairing_uri_not_expired);let d;if(this.pairings.keys.includes(s)){if(d=this.pairings.get(s),i.addTrace(qc.existing_pairing),d.active)throw i.setError(au.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(qc.pairing_not_expired)}const f=c||ti(Je.FIVE_MINUTES),g={topic:s,relay:a,expiry:f,active:!1,methods:l};this.core.expirer.set(s,f),await this.pairings.set(s,g),i.addTrace(qc.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit($p.create,g),i.addTrace(qc.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(qc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(au.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(v){throw i.setError(au.subscribe_pairing_topic_failure),v}return i.addTrace(qc.subscribe_pairing_topic_success),g},this.activate=async({topic:n})=>{this.isInitialized();const i=ti(Je.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}=ch();this.events.once(xr("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",Vr("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=vh(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=y4(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=b4(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,Vr("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=>bd(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($p.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(()=>{Qc(i)?this.events.emit(xr("pairing_ping",s),{}):la(i)&&this.events.emit(xr("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($p.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=Vr("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(Vr("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!Fs(n)){const{message:a}=Qe("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(au.malformed_pairing_uri),new Error(a)}if(!kge(n.uri)){const{message:a}=Qe("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(au.malformed_pairing_uri),new Error(a)}const o=rN(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=Qe("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(au.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=Qe("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(au.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&Je.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Fs(n)){const{message:s}=Qe("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Fs(n)){const{message:s}=Qe("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Wn(n,!1)){const{message:i}=Qe("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=Qe("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(bd(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=Qe("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=is(r,this.name),this.pairings=new O0(this.core,this.logger,this.name,this.storagePrefix)}get context(){return io(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(ps.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Jr.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{HE(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):x4(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(sa.expired,async e=>{const{topic:r}=RU(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit($p.expire,{topic:r}))})}}class Yve extends Mce{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Ea.EventEmitter,this.name=wve,this.version=vve,this.cached=[],this.initialized=!1,this.storagePrefix=Al,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:ti(Je.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Va.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=la(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Va.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(Va.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=is(r,this.name)}get context(){return io(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:vh(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}=Qe("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Va.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Qe("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(Va.created,e=>{const r=Va.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Va.updated,e=>{const r=Va.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Va.deleted,e=>{const r=Va.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(dg.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Je.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Va.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Jve extends Uce{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Ea.EventEmitter,this.name=yve,this.version=bve,this.cached=[],this.initialized=!1,this.storagePrefix=Al,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(sa.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(sa.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=is(r,this.name)}get context(){return io(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 Qhe(e);if(typeof e=="number")return Yhe(e);const{message:r}=Qe("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(sa.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Je.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(sa.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(dg.pulse,()=>this.checkExpirations()),this.events.on(sa.created,e=>{const r=sa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(sa.expired,e=>{const r=sa.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(sa.deleted,e=>{const r=sa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.getLocalStorage=hn.getLocalStorageOrThrow=hn.getCrypto=hn.getCryptoOrThrow=hn.getLocation=hn.getLocationOrThrow=hn.getNavigator=hn.getNavigatorOrThrow=Wj=hn.getDocument=hn.getDocumentOrThrow=hn.getFromWindowOrThrow=hn.getFromWindow=void 0;function D0(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}hn.getFromWindow=D0;function Eg(t){const e=D0(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}hn.getFromWindowOrThrow=Eg;function Xve(){return Eg("document")}hn.getDocumentOrThrow=Xve;function e2e(){return D0("document")}var Wj=hn.getDocument=e2e;function t2e(){return Eg("navigator")}hn.getNavigatorOrThrow=t2e;function r2e(){return D0("navigator")}hn.getNavigator=r2e;function n2e(){return Eg("location")}hn.getLocationOrThrow=n2e;function i2e(){return D0("location")}hn.getLocation=i2e;function s2e(){return Eg("crypto")}hn.getCryptoOrThrow=s2e;function o2e(){return D0("crypto")}hn.getCrypto=o2e;function a2e(){return Eg("localStorage")}hn.getLocalStorageOrThrow=a2e;function c2e(){return D0("localStorage")}hn.getLocalStorage=c2e;class l2e extends jce{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=xve,this.verifyUrlV3=_ve,this.storagePrefix=Al,this.version=Bj,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Je.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!x2()||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=Wj(),d=this.startAbortTimer(Je.ONE_SECOND*5),f=await new Promise((g,v)=>{const x=()=>{window.removeEventListener("message",M),l.body.removeChild(P),v("attestation aborted")};this.abortController.signal.addEventListener("abort",x);const P=l.createElement("iframe");P.src=c,P.style.display="none",P.addEventListener("error",x,{signal:this.abortController.signal});const M=N=>{if(!N.data)return;const E=JSON.parse(N.data);if(E.type==="verify_attestation"){if(kC(E.attestation).payload.id!==o)return;clearInterval(d),l.body.removeChild(P),this.abortController.signal.removeEventListener("abort",x),window.removeEventListener("message",M),g(E.attestation===null?"":E.attestation)}};l.body.appendChild(P),window.addEventListener("message",M,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}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(kC(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(Je.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||sw;return Ave.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${sw}`),s=sw),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Je.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=lge(i,s.publicKey),a={hasExpired:Je.toMiliseconds(o.exp)this.abortController.abort(),Je.toMiliseconds(e))}}class u2e extends Fce{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=Eve,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${Sve}/${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=is(r,this.context)}}var d2e=Object.defineProperty,PN=Object.getOwnPropertySymbols,f2e=Object.prototype.hasOwnProperty,h2e=Object.prototype.propertyIsEnumerable,NN=(t,e,r)=>e in t?d2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_m=(t,e)=>{for(var r in e||(e={}))f2e.call(e,r)&&NN(t,r,e[r]);if(PN)for(var r of PN(e))h2e.call(e,r)&&NN(t,r,e[r]);return t};class p2e extends zce{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=Tve,this.storagePrefix=Al,this.storageVersion=Ive,this.events=new Map,this.shouldPersist=!1,this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=e0e(),d=this.core.projectId||"",f=Date.now(),g=_m({eventId:l,bundleId:d,timestamp:f,props:{event:s,type:o,properties:{topic:a,trace:c}}},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,g),this.shouldPersist=!0),g},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 _m(_m({},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(dg.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Je.fromMiliseconds(Date.now())-Je.fromMiliseconds(i.timestamp)>kve&&(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,_m(_m({},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 fetch(`${Rve}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Fj}`,{method:"POST",body:JSON.stringify(i)})).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.logger=is(r,this.context),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 g2e=Object.defineProperty,MN=Object.getOwnPropertySymbols,m2e=Object.prototype.hasOwnProperty,w2e=Object.prototype.propertyIsEnumerable,$N=(t,e,r)=>e in t?g2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ON=(t,e)=>{for(var r in e||(e={}))m2e.call(e,r)&&$N(t,r,e[r]);if(MN)for(var r of MN(e))w2e.call(e,r)&&$N(t,r,e[r]);return t};let v2e=class Hj extends Nce{constructor(e){var r;super(e),this.protocol=Lj,this.version=Bj,this.name=qE,this.events=new Ea.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:Jr.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||jj,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=n2({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:Qwe.logger}),{logger:i,chunkLoggerController:s}=RL({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=is(i,this.name),this.heartbeat=new Pce,this.crypto=new Nve(this,this.logger,e==null?void 0:e.keychain),this.history=new Yve(this,this.logger),this.expirer=new Jve(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new tce(ON(ON({},Ywe),e==null?void 0:e.storageOptions)),this.relayer=new Vve({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Qve(this,this.logger),this.verify=new l2e(this,this.logger,this.storage),this.echoClient=new u2e(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new p2e(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new Hj(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(dve,n),r}get context(){return io(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(_N,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.linkModeSupportedApps=await this.storage.getItem(_N)||[],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 y2e=v2e;var b2e={};const qj="wc",Vj=2,Kj="client",VE=`${qj}@${Vj}:${Kj}:`,O9={name:Kj,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},DN="WALLETCONNECT_DEEPLINK_CHOICE",x2e="proposal",Gj="Proposal expired",C2e="session",fp=Je.SEVEN_DAYS,_2e="engine",hi={wc_sessionPropose:{req:{ttl:Je.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Je.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Je.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Je.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Je.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Je.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Je.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Je.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Je.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Je.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Je.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Je.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Je.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Je.FIVE_MINUTES,prompt:!1,tag:1119}}},D9={min:Je.FIVE_MINUTES,max:Je.SEVEN_DAYS},Wc={idle:"IDLE",active:"ACTIVE"},A2e="request",E2e=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],S2e="wc",I2e="auth",T2e="authKeys",k2e="pairingTopics",R2e="requests",_4=`${S2e}@${1.5}:${I2e}:`,pb=`${_4}:PUB_KEY`;var P2e=Object.defineProperty,N2e=Object.defineProperties,M2e=Object.getOwnPropertyDescriptors,LN=Object.getOwnPropertySymbols,$2e=Object.prototype.hasOwnProperty,O2e=Object.prototype.propertyIsEnumerable,BN=(t,e,r)=>e in t?P2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mn=(t,e)=>{for(var r in e||(e={}))$2e.call(e,r)&&BN(t,r,e[r]);if(LN)for(var r of LN(e))O2e.call(e,r)&&BN(t,r,e[r]);return t},Ga=(t,e)=>N2e(t,M2e(e));class D2e extends Hce{constructor(e){super(e),this.name=_2e,this.events=new yE,this.initialized=!1,this.requestQueue={state:Wc.idle,queue:[]},this.sessionRequestQueue={state:Wc.idle,queue:[]},this.requestQueueDelay=Je.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(hi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Je.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Ga(Mn({},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,d,f=!1;try{l&&(f=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!f){const{topic:L,uri:j}=await this.client.core.pairing.create();l=L,d=j}if(!l){const{message:L}=Qe("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const g=await this.client.core.crypto.generateKeyPair(),v=hi.wc_sessionPropose.req.ttl||Je.FIVE_MINUTES,x=ti(v),P=Mn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Uj}],proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:x,pairingTopic:l},a&&{sessionProperties:a}),{reject:M,resolve:N,done:E}=ch(v,Gj);this.events.once(xr("session_connect"),async({error:L,session:j})=>{if(L)M(L);else if(j){j.self.publicKey=g;const H=Ga(Mn({},j),{pairingTopic:P.pairingTopic,requiredNamespaces:P.requiredNamespaces,optionalNamespaces:P.optionalNamespaces,transportType:Jr.relay});await this.client.session.set(j.topic,H),await this.setExpiry(j.topic,j.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:j.peer.metadata}),this.cleanupDuplicatePairings(H),N(H)}});const $=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:P,throwOnFailedPublish:!0});return await this.setProposal($,Mn({id:$},P)),{uri:d,approval:E}},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:[Ka.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(T){throw o.setError(ih.no_internet_connection),T}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(T){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(ih.proposal_not_found),T}try{await this.isValidApprove(r)}catch(T){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(ih.session_approve_namespace_validation_failure),T}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:d,sessionConfig:f}=r,g=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:v,proposer:x,requiredNamespaces:P,optionalNamespaces:M}=g;let N=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:v});N||(N=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Ka.session_approve_started,properties:{topic:v,trace:[Ka.session_approve_started,Ka.session_namespaces_validation_success]}}));const E=await this.client.core.crypto.generateKeyPair(),$=x.publicKey,L=await this.client.core.crypto.generateSharedKey(E,$),j=Mn(Mn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:E,metadata:this.client.metadata},expiry:ti(fp)},d&&{sessionProperties:d}),f&&{sessionConfig:f}),H=Jr.relay;N.addTrace(Ka.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:H})}catch(T){throw N.setError(ih.subscribe_session_topic_failure),T}N.addTrace(Ka.subscribe_session_topic_success);const I=Ga(Mn({},j),{topic:L,requiredNamespaces:P,optionalNamespaces:M,pairingTopic:v,acknowledged:!1,self:j.controller,peer:{publicKey:x.publicKey,metadata:x.metadata},controller:E,transportType:Jr.relay});await this.client.session.set(L,I),N.addTrace(Ka.store_session);try{N.addTrace(Ka.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(T=>{throw N==null||N.setError(ih.session_settle_publish_failure),T}),N.addTrace(Ka.session_settle_publish_success),N.addTrace(Ka.publishing_session_approve),await this.sendResult({id:a,topic:v,result:{relay:{protocol:c??"irn"},responderPublicKey:E},throwOnFailedPublish:!0}).catch(T=>{throw N==null||N.setError(ih.session_approve_publish_failure),T}),N.addTrace(Ka.session_approve_publish_success)}catch(T){throw this.client.logger.error(T),this.client.session.delete(L,Vr("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),T}return this.client.core.eventClient.deleteEvent({eventId:N.eventId}),await this.client.core.pairing.updateMetadata({topic:v,metadata:x.metadata}),await this.client.proposal.delete(a,Vr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:v}),await this.setExpiry(L,ti(fp)),{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:hi.wc_sessionPropose.reject}),await this.client.proposal.delete(n,Vr("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=ch(),c=Cd(),l=wh().toString(),d=this.client.session.get(n).namespaces;return this.events.once(xr("session_update",c),({error:f})=>{f?a(f):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(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:d}),a(f)}),{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=Cd(),{done:s,resolve:o,reject:a}=ch();return this.events.once(xr("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,ti(fp)),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(x){throw this.client.logger.error("request() -> isValidRequest() failed"),x}const{chainId:n,request:i,topic:s,expiry:o=hi.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===Jr.relay&&await this.confirmOnlineStateOrThrow();const c=Cd(),l=wh().toString(),{done:d,resolve:f,reject:g}=ch(o,"Request expired. Please try again.");this.events.once(xr("session_request",c),({error:x,result:P})=>{x?g(x):f(P)});const v=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return v?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ga(Mn({},i),{expiryTimestamp:ti(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:v}).catch(x=>g(x)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await d()):await Promise.all([new Promise(async x=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:Ga(Mn({},i),{expiryTimestamp:ti(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(P=>g(P)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),x()}),new Promise(async x=>{var P;if(!((P=a.sessionConfig)!=null&&P.disableDeepLink)){const M=await Xhe(this.client.core.storage,DN);Jhe({id:c,topic:s,wcDeepLink:M})}x()}),d()]).then(x=>x[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===Jr.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);Qc(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):la(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=Cd(),s=wh().toString(),{done:o,resolve:a,reject:c}=ch();this.events.once(xr("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=wh().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:Vr("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}=Qe("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Ige(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?Jr.link_mode:Jr.relay;o===Jr.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:d,nonce:f,type:g,exp:v,nbf:x,methods:P=[],expiry:M}=r,N=[...r.resources||[]],{topic:E,uri:$}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:E,uri:$}});const L=await this.client.core.crypto.generateKeyPair(),j=hb(L);if(await Promise.all([this.client.auth.authKeys.set(pb,{responseTopic:j,publicKey:L}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:E})]),await this.client.core.relayer.subscribe(j,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${E}`),P.length>0){const{namespace:S}=ew(a[0]);let k=K1e(S,"request",P);fb(N)&&(k=Z1e(k,N.pop())),N.push(k)}const H=M&&M>hi.wc_sessionAuthenticate.req.ttl?M:hi.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:g??"caip122",chains:a,statement:c,aud:l,domain:d,version:"1",nonce:f,iat:new Date().toISOString(),exp:v,nbf:x,resources:N},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:ti(H)},T={eip155:{chains:a,methods:[...new Set(["personal_sign",...P])],events:["chainChanged","accountsChanged"]}},B={requiredNamespaces:{},optionalNamespaces:T,relays:[{protocol:"irn"}],pairingTopic:E,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:ti(hi.wc_sessionPropose.req.ttl)},{done:K,resolve:U,reject:C}=ch(H,"Request expired"),p=async({error:S,session:k})=>{if(this.events.off(xr("session_request",w),m),S)C(S);else if(k){k.self.publicKey=L,await this.client.session.set(k.topic,k),await this.setExpiry(k.topic,k.expiry),E&&await this.client.core.pairing.updateMetadata({topic:E,metadata:k.peer.metadata});const y=this.client.session.get(k.topic);await this.deleteProposal(_),U({session:y})}},m=async S=>{var k,y,b;if(await this.deletePendingAuthRequest(w,{message:"fulfilled",code:0}),S.error){const ne=Vr("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return S.error.code===ne.code?void 0:(this.events.off(xr("session_connect"),p),C(S.error.message))}await this.deleteProposal(_),this.events.off(xr("session_connect"),p);const{cacaos:V,responder:ce}=S.result,fe=[],W=[];for(const ne of V){await KP({cacao:ne,projectId:this.client.core.projectId})||(this.client.logger.error(ne,"Signature verification failed"),C(Vr("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ie}=ne,D=fb(ie.resources),te=[VP(ie.iss)],me=N5(ie.iss);if(D){const Ce=GP(D),Ee=ZP(D);fe.push(...Ce),te.push(...Ee)}for(const Ce of te)W.push(`${Ce}:${me}`)}const ue=await this.client.core.crypto.generateSharedKey(L,ce.publicKey);let J;fe.length>0&&(J={topic:ue,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:ce,controller:ce.publicKey,expiry:ti(fp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:E,namespaces:nN([...new Set(fe)],[...new Set(W)]),transportType:o},await this.client.core.relayer.subscribe(ue,{transportType:o}),await this.client.session.set(ue,J),E&&await this.client.core.pairing.updateMetadata({topic:E,metadata:ce.metadata}),J=this.client.session.get(ue)),(k=this.client.metadata.redirect)!=null&&k.linkMode&&(y=ce.metadata.redirect)!=null&&y.linkMode&&(b=ce.metadata.redirect)!=null&&b.universal&&n&&(this.client.core.addLinkModeSupportedApp(ce.metadata.redirect.universal),this.client.session.update(ue,{transportType:Jr.link_mode})),U({auths:V,session:J})},w=Cd(),_=Cd();this.events.once(xr("session_connect"),p),this.events.once(xr("session_request",w),m);let R;try{if(s){const S=vh("wc_sessionAuthenticate",I,w);this.client.core.history.set(E,S);const k=await this.client.core.crypto.encode("",S,{type:E2,encoding:vm});R=Iy(n,E,k)}else await Promise.all([this.sendRequest({topic:E,method:"wc_sessionAuthenticate",params:I,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:w}),this.sendRequest({topic:E,method:"wc_sessionPropose",params:B,expiry:hi.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:_})])}catch(S){throw this.events.off(xr("session_connect"),p),this.events.off(xr("session_request",w),m),S}return await this.setProposal(_,Mn({id:_},B)),await this.setAuthRequest(w,{request:Ga(Mn({},I),{verifyContext:{}}),pairingTopic:E,transportType:o}),{uri:R??$,response:K}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[sh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(M){throw s.setError(xm.no_internet_connection),M}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(xm.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||Jr.relay;a===Jr.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),d=hb(c),f={type:_u,receiverPublicKey:c,senderPublicKey:l},g=[],v=[];for(const M of i){if(!await KP({cacao:M,projectId:this.client.core.projectId})){s.setError(xm.invalid_cacao);const j=Vr("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:d,error:j,encodeOpts:f}),new Error(j.message)}s.addTrace(sh.cacaos_verified);const{p:N}=M,E=fb(N.resources),$=[VP(N.iss)],L=N5(N.iss);if(E){const j=GP(E),H=ZP(E);g.push(...j),$.push(...H)}for(const j of $)v.push(`${j}:${L}`)}const x=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(sh.create_authenticated_session_topic);let P;if((g==null?void 0:g.length)>0){P={topic:x,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:ti(fp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:nN([...new Set(g)],[...new Set(v)]),transportType:a},s.addTrace(sh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(x,{transportType:a})}catch(M){throw s.setError(xm.subscribe_authenticated_session_topic_failure),M}s.addTrace(sh.subscribe_authenticated_session_topic_success),await this.client.session.set(x,P),s.addTrace(sh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(sh.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(M){throw s.setError(xm.authenticated_session_approve_publish_failure),M}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:P}},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===Jr.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=hb(o),l={type:_u,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:hi.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,Vr("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return fj(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,Vr("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(DN).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,Vr("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Wc.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(ih.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,Vr("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=Wc.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,ti(hi.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=Jr.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||ti(hi.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:d}=r,f=vh(i,s,c);let g;const v=!!d;try{const M=v?vm:jd;g=await this.client.core.crypto.encode(n,f,{encoding:M})}catch(M){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),M}let x;if(E2e.includes(i)){const M=fu(JSON.stringify(f)),N=fu(g);x=await this.client.core.verify.register({id:N,decryptedId:M})}const P=hi[i].req;if(P.attestation=x,o&&(P.ttl=o),a&&(P.id=a),this.client.core.history.set(n,f),v){const M=Iy(d,n,g);await global.Linking.openURL(M,this.client.name)}else{const M=hi[i].req;o&&(M.ttl=o),a&&(M.id=a),l?(M.internal=Ga(Mn({},M.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,g,M)):this.client.core.relayer.publish(n,g,M).catch(N=>this.client.logger.error(N))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=y4(n,s);let d;const f=c&&typeof(global==null?void 0:global.Linking)<"u";try{const v=f?vm:jd;d=await this.client.core.crypto.encode(i,l,Ga(Mn({},a||{}),{encoding:v}))}catch(v){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),v}let g;try{g=await this.client.core.history.get(i,n)}catch(v){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),v}if(f){const v=Iy(c,i,d);await global.Linking.openURL(v,this.client.name)}else{const v=hi[g.request.method].res;o?(v.internal=Ga(Mn({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,d,v)):this.client.core.relayer.publish(i,d,v).catch(x=>this.client.logger.error(x))}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=b4(n,s);let d;const f=c&&typeof(global==null?void 0:global.Linking)<"u";try{const v=f?vm:jd;d=await this.client.core.crypto.encode(i,l,Ga(Mn({},o||{}),{encoding:v}))}catch(v){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),v}let g;try{g=await this.client.core.history.get(i,n)}catch(v){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),v}if(f){const v=Iy(c,i,d);await global.Linking.openURL(v,this.client.name)}else{const v=a||hi[g.request.method].res;this.client.core.relayer.publish(i,d,v)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;bd(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=>{bd(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===Wc.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=Wc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Wc.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}=Qe("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(Mn({},i.params));const d=a.expiryTimestamp||ti(hi.wc_sessionPropose.req.ttl),f=Mn({id:c,pairingTopic:n,expiryTimestamp:d},a);await this.setProposal(c,f);const g=await this.getVerifyContext({attestationId:s,hash:fu(JSON.stringify(i)),encryptedId:o,metadata:f.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(au.proposal_listener_not_found)),l==null||l.addTrace(qc.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:f,verifyContext:g})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:hi.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(Qc(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 d=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const f=await this.client.core.relayer.subscribe(d,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(la(n)){await this.client.proposal.delete(s,Vr("USER_DISCONNECTED"));const o=xr("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(xr("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:d,sessionConfig:f}=n.params,g=Ga(Mn(Mn({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}},d&&{sessionProperties:d}),f&&{sessionConfig:f}),{transportType:Jr.relay}),v=xr("session_connect");if(this.events.listenerCount(v)===0)throw new Error(`emitting ${v} without any listeners 997`);this.events.emit(xr("session_connect"),{session:g}),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;Qc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(xr("session_approve",i),{})):la(n)&&(await this.client.session.delete(r,Vr("USER_DISCONNECTED")),this.events.emit(xr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=ym.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:Vr("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Mn({topic:r},i));try{ym.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 ym.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=xr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Qc(n)?this.events.emit(xr("session_update",i),{}):la(n)&&this.events.emit(xr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,ti(fp)),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=xr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Qc(n)?this.events.emit(xr("session_extend",i),{}):la(n)&&this.events.emit(xr("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=xr("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{Qc(n)?this.events.emit(xr("session_ping",i),{}):la(n)&&this.events.emit(xr("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(ps.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:Vr("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:d}=r,{id:f,params:g}=a;try{await this.isValidRequest(Mn({topic:o},g));const v=this.client.session.get(o),x=await this.getVerifyContext({attestationId:c,hash:fu(JSON.stringify(vh("wc_sessionRequest",g,f))),encryptedId:l,metadata:v.peer.metadata,transportType:d}),P={id:f,topic:o,params:g,verifyContext:x};await this.setPendingSessionRequest(P),d===Jr.link_mode&&(n=v.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=v.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(P):(this.addSessionRequestToSessionRequestQueue(P),this.processSessionRequestQueue())}catch(v){await this.sendError({id:f,topic:o,error:v}),this.client.logger.error(v)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=xr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Qc(n)?this.events.emit(xr("session_request",i),{result:n.result}):la(n)&&this.events.emit(xr("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=ym.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Mn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),ym.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}),Qc(n)?this.events.emit(xr("session_request",i),{result:n.result}):la(n)&&this.events.emit(xr("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:d,expiryTimestamp:f}=s.params,g=await this.getVerifyContext({attestationId:o,hash:fu(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),v={requester:l,pairingTopic:i,id:s.id,authPayload:d,verifyContext:g,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:v,pairingTopic:i,transportType:c}),c===Jr.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:g})}catch(l){this.client.logger.error(l);const d=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),g=this.getAppLinkIfEnabled(s.params.requester.metadata,c),v={type:_u,receiverPublicKey:d,senderPublicKey:f};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:v,rpcOpts:hi.wc_sessionAuthenticate.autoReject,appLink:g})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Wc.idle,this.processSessionRequestQueue()},Je.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=xr("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(xr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Wc.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=Wc.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:vh("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Fs(r)){const{message:c}=Qe("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(Hs(n)||await this.isValidPairingTopic(n),!Uge(a)){const{message:c}=Qe("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Hs(i)&&pv(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Hs(s)&&pv(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Hs(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Bge(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Fs(r))throw new Error(Qe("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=P9(i,"approve()");if(c)throw new Error(c.message);const l=oN(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!Wn(s,!0)){const{message:d}=Qe("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}Hs(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Fs(r)){const{message:s}=Qe("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!Fge(i)){const{message:s}=Qe("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Fs(r)){const{message:l}=Qe("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!bj(n)){const{message:l}=Qe("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=Nge(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=P9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(bd(o)){const{message:l}=Qe("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Fs(r)){const{message:c}=Qe("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=P9(i,"update()");if(o)throw new Error(o.message);const a=oN(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Fs(r)){const{message:i}=Qe("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(!Fs(r)){const{message:c}=Qe("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(!sN(a,s)){const{message:c}=Qe("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!zge(i)){const{message:c}=Qe("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!qge(a,s,i.method)){const{message:c}=Qe("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!Zge(o,D9)){const{message:c}=Qe("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${D9.min} and ${D9.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!Fs(r)){const{message:o}=Qe("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(!Wge(s)){const{message:o}=Qe("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Fs(r)){const{message:i}=Qe("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Fs(r)){const{message:a}=Qe("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(!sN(o,s)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!Hge(i)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!Vge(o,s,i.name)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Fs(r)){const{message:i}=Qe("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(!Wn(i,!1))throw new Error("uri is required parameter");if(!Wn(s,!1))throw new Error("domain is required parameter");if(!Wn(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>ew(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=ew(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||sw,validation:"UNKNOWN",origin:o.url||""}};try{if(a===Jr.link_mode){const d=this.getAppLinkIfEnabled(o,a);return c.verified.validation=d&&new URL(d).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(!Wn(i,!1)){const{message:s}=Qe("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}=Qe("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,d,f,g;return!r||n!==Jr.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)!==""&&((d=r==null?void 0:r.redirect)==null?void 0:d.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((g=r==null?void 0:r.redirect)==null?void 0:g.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=xP(r,"topic")||"",i=decodeURIComponent(xP(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:Jr.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(typeof process<"u"&&b2e.IS_VITEST||yg()&&(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}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(ps.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(pb)?this.client.auth.authKeys.get(pb):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===Jr.link_mode?vm:jd});try{HE(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:fu(n)})):x4(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(sa.expired,async e=>{const{topic:r,id:n}=RU(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Qe("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Qe("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($p.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on($p.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Wn(e,!1)){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(bd(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Qe("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Wn(e,!1)){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(bd(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Qe("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Qe("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(Wn(e,!1)){const{message:r}=Qe("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Qe("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!jge(e)){const{message:r}=Qe("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Qe("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(bd(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Qe("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class L2e extends O0{constructor(e,r){super(e,r,x2e,VE),this.core=e,this.logger=r}}class B2e extends O0{constructor(e,r){super(e,r,C2e,VE),this.core=e,this.logger=r}}class U2e extends O0{constructor(e,r){super(e,r,A2e,VE,n=>n.id),this.core=e,this.logger=r}}class j2e extends O0{constructor(e,r){super(e,r,T2e,_4,()=>pb),this.core=e,this.logger=r}}class F2e extends O0{constructor(e,r){super(e,r,k2e,_4),this.core=e,this.logger=r}}class z2e extends O0{constructor(e,r){super(e,r,R2e,_4,n=>n.id),this.core=e,this.logger=r}}class W2e{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new j2e(this.core,this.logger),this.pairingTopics=new F2e(this.core,this.logger),this.requests=new z2e(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let H2e=class Zj extends Wce{constructor(e){super(e),this.protocol=qj,this.version=Vj,this.name=O9.name,this.events=new Ea.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)||O9.name,this.metadata=(e==null?void 0:e.metadata)||qhe(),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:t2(n2({level:(e==null?void 0:e.logger)||O9.logger}));this.core=(e==null?void 0:e.core)||new y2e(e),this.logger=is(r,this.name),this.session=new B2e(this.core,this.logger),this.proposal=new L2e(this.core,this.logger),this.pendingRequest=new U2e(this.core,this.logger),this.engine=new D2e(this),this.auth=new W2e(this.core,this.logger)}static async init(e){const r=new Zj(e);return await r.initialize(),r}get context(){return io(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 VC={exports:{}};(function(t,e){var r=typeof self<"u"?self:Yi,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(m){return m&&DataView.prototype.isPrototypeOf(m)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(m){return m&&l.indexOf(Object.prototype.toString.call(m))>-1};function f(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(m))throw new TypeError("Invalid character in header field name");return m.toLowerCase()}function g(m){return typeof m!="string"&&(m=String(m)),m}function v(m){var w={next:function(){var _=m.shift();return{done:_===void 0,value:_}}};return a.iterable&&(w[Symbol.iterator]=function(){return w}),w}function x(m){this.map={},m instanceof x?m.forEach(function(w,_){this.append(_,w)},this):Array.isArray(m)?m.forEach(function(w){this.append(w[0],w[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(w){this.append(w,m[w])},this)}x.prototype.append=function(m,w){m=f(m),w=g(w);var _=this.map[m];this.map[m]=_?_+", "+w:w},x.prototype.delete=function(m){delete this.map[f(m)]},x.prototype.get=function(m){return m=f(m),this.has(m)?this.map[m]:null},x.prototype.has=function(m){return this.map.hasOwnProperty(f(m))},x.prototype.set=function(m,w){this.map[f(m)]=g(w)},x.prototype.forEach=function(m,w){for(var _ in this.map)this.map.hasOwnProperty(_)&&m.call(w,this.map[_],_,this)},x.prototype.keys=function(){var m=[];return this.forEach(function(w,_){m.push(_)}),v(m)},x.prototype.values=function(){var m=[];return this.forEach(function(w){m.push(w)}),v(m)},x.prototype.entries=function(){var m=[];return this.forEach(function(w,_){m.push([_,w])}),v(m)},a.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function P(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function M(m){return new Promise(function(w,_){m.onload=function(){w(m.result)},m.onerror=function(){_(m.error)}})}function N(m){var w=new FileReader,_=M(w);return w.readAsArrayBuffer(m),_}function E(m){var w=new FileReader,_=M(w);return w.readAsText(m),_}function $(m){for(var w=new Uint8Array(m),_=new Array(w.length),R=0;R-1?w:m}function T(m,w){w=w||{};var _=w.body;if(m instanceof T){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,w.headers||(this.headers=new x(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!_&&m._bodyInit!=null&&(_=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new x(w.headers)),this.method=I(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(_)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function B(m){var w=new FormData;return m.trim().split("&").forEach(function(_){if(_){var R=_.split("="),S=R.shift().replace(/\+/g," "),k=R.join("=").replace(/\+/g," ");w.append(decodeURIComponent(S),decodeURIComponent(k))}}),w}function K(m){var w=new x,_=m.replace(/\r?\n[\t ]+/g," ");return _.split(/\r?\n/).forEach(function(R){var S=R.split(":"),k=S.shift().trim();if(k){var y=S.join(":").trim();w.append(k,y)}}),w}j.call(T.prototype);function U(m,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new x(w.headers),this.url=w.url||"",this._initBody(m)}j.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},U.error=function(){var m=new U(null,{status:0,statusText:""});return m.type="error",m};var C=[301,302,303,307,308];U.redirect=function(m,w){if(C.indexOf(w)===-1)throw new RangeError("Invalid status code");return new U(null,{status:w,headers:{location:m}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,_){this.message=w,this.name=_;var R=Error(w);this.stack=R.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function p(m,w){return new Promise(function(_,R){var S=new T(m,w);if(S.signal&&S.signal.aborted)return R(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function y(){k.abort()}k.onload=function(){var b={status:k.status,statusText:k.statusText,headers:K(k.getAllResponseHeaders()||"")};b.url="responseURL"in k?k.responseURL:b.headers.get("X-Request-URL");var V="response"in k?k.response:k.responseText;_(new U(V,b))},k.onerror=function(){R(new TypeError("Network request failed"))},k.ontimeout=function(){R(new TypeError("Network request failed"))},k.onabort=function(){R(new o.DOMException("Aborted","AbortError"))},k.open(S.method,S.url,!0),S.credentials==="include"?k.withCredentials=!0:S.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&a.blob&&(k.responseType="blob"),S.headers.forEach(function(b,V){k.setRequestHeader(V,b)}),S.signal&&(S.signal.addEventListener("abort",y),k.onreadystatechange=function(){k.readyState===4&&S.signal.removeEventListener("abort",y)}),k.send(typeof S._bodyInit>"u"?null:S._bodyInit)})}return p.polyfill=!0,s.fetch||(s.fetch=p,s.Headers=x,s.Request=T,s.Response=U),o.Headers=x,o.Request=T,o.Response=U,o.fetch=p,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})(VC,VC.exports);var q2e=VC.exports;const UN=Ec(q2e);var V2e=Object.defineProperty,K2e=Object.defineProperties,G2e=Object.getOwnPropertyDescriptors,jN=Object.getOwnPropertySymbols,Z2e=Object.prototype.hasOwnProperty,Q2e=Object.prototype.propertyIsEnumerable,FN=(t,e,r)=>e in t?V2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zN=(t,e)=>{for(var r in e||(e={}))Z2e.call(e,r)&&FN(t,r,e[r]);if(jN)for(var r of jN(e))Q2e.call(e,r)&&FN(t,r,e[r]);return t},WN=(t,e)=>K2e(t,G2e(e));const Y2e={Accept:"application/json","Content-Type":"application/json"},J2e="POST",HN={headers:Y2e,method:J2e},qN=10;let Bl=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Ea.EventEmitter,this.isAvailable=!1,this.registering=!1,!fN(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=Ru(e),n=await(await UN(this.url,WN(zN({},HN),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!fN(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=Ru({id:1,jsonrpc:"2.0",method:"test",params:[]});await UN(e,WN(zN({},HN),{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"?jh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=b4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return _j(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>qN&&this.events.setMaxListeners(qN)}};const VN="error",X2e="wss://relay.walletconnect.com",e3e="wc",t3e="universal_provider",KN=`${e3e}@2:${t3e}:`,r3e="https://rpc.walletconnect.com/v1/",wp="generic",kc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Am=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},KC={exports:{}};/** + Approved: ${a.toString()}`)),Object.keys(e).forEach(h=>{if(!h.includes(":")||n)return;const g=_g(e[h].accounts);g.includes(h)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${h} + Required: ${h} + Approved: ${g.toString()}`))}),o.forEach(h=>{n||(ph(i[h].methods,s[h].methods)?ph(i[h].events,s[h].events)||(n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${h}`)):n=Qe("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${h}`))}),n}function Sge(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 GR(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Ige(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=_g(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 Tge(t,e){return RE(t)&&t<=e.max&&t>=e.min}function ZR(){const t=b2();return new Promise(e=>{switch(t){case po.browser:e(kge());break;case po.reactNative:e(Pge());break;case po.node:e(Rge());break;default:e(!0)}})}function kge(){return y2()&&(navigator==null?void 0:navigator.onLine)}async function Pge(){if(wg()&&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 Rge(){return!0}function Nge(t){switch(b2()){case po.browser:Mge(t);break;case po.reactNative:Oge(t);break}}function Mge(t){!wg()&&y2()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function Oge(t){wg()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const E9={};class wm{static get(e){return E9[e]}static set(e,r){E9[e]=r}static delete(e){delete E9[e]}}const $ge="PARSE_ERROR",Dge="INVALID_REQUEST",Lge="METHOD_NOT_FOUND",Bge="INVALID_PARAMS",sj="INTERNAL_ERROR",NE="SERVER_ERROR",Uge=[-32700,-32600,-32601,-32602,-32603],rw={[$ge]:{code:-32700,message:"Parse error"},[Dge]:{code:-32600,message:"Invalid Request"},[Lge]:{code:-32601,message:"Method not found"},[Bge]:{code:-32602,message:"Invalid params"},[sj]:{code:-32603,message:"Internal error"},[NE]:{code:-32e3,message:"Server error"}},oj=NE;function jge(t){return Uge.includes(t)}function QR(t){return Object.keys(rw).includes(t)?rw[t]:rw[oj]}function Fge(t){const e=Object.values(rw).find(r=>r.code===t);return e||rw[oj]}function aj(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var cj={},Xl={},YR;function zge(){if(YR)return Xl;YR=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.isBrowserCryptoAvailable=Xl.getSubtleCrypto=Xl.getBrowerCrypto=void 0;function t(){return(Gi==null?void 0:Gi.crypto)||(Gi==null?void 0:Gi.msCrypto)||{}}Xl.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Xl.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Xl.isBrowserCryptoAvailable=r,Xl}var eu={},JR;function Wge(){if(JR)return eu;JR=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.isBrowser=eu.isNode=eu.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}eu.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}eu.isNode=e;function r(){return!t()&&!e()}return eu.isBrowser=r,eu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=h2;e.__exportStar(zge(),t),e.__exportStar(Wge(),t)})(cj);function yd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function gh(t=6){return BigInt(yd(t))}function mh(t,e,r){return{id:r||yd(),jsonrpc:"2.0",method:t,params:e}}function f4(t,e){return{id:t,jsonrpc:"2.0",result:e}}function h4(t,e,r){return{id:t,jsonrpc:"2.0",error:Hge(e)}}function Hge(t,e){return typeof t>"u"?QR(sj):(typeof t=="string"&&(t=Object.assign(Object.assign({},QR(NE)),{message:t})),jge(t.code)&&(t=Fge(t.code)),t)}let qge=class{},Vge=class extends qge{constructor(){super()}},Kge=class extends Vge{constructor(e){super()}};const Gge="^https?:",Zge="^wss?:";function Qge(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function lj(t,e){const r=Qge(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function XR(t){return lj(t,Gge)}function eN(t){return lj(t,Zge)}function Yge(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function uj(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ME(t){return uj(t)&&"method"in t}function p4(t){return uj(t)&&(Kc(t)||oa(t))}function Kc(t){return"result"in t}function oa(t){return"error"in t}let Ec=class extends Kge{constructor(e){super(e),this.events=new _a.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(mh(e.method,e.params||[],e.id||gh().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=>{oa(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),p4(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 Jge=()=>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"),Xge=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",tN=t=>t.split("?")[0],rN=10,eme=Jge();let tme=class{constructor(e){if(this.url=e,this.events=new _a.EventEmitter,this.registering=!1,!eN(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(Iu(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!eN(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=cj.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!Yge(e)},o=new eme(e,[],s);Xge()?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"?Bh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=h4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return aj(e,tN(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>rN&&this.events.setMaxListeners(rN)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${tN(this.url)}`));return this.events.emit("register_error",r),r}};var T5={exports:{}};T5.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]",d="[object Boolean]",h="[object Date]",g="[object Error]",v="[object Function]",x="[object GeneratorFunction]",R="[object Map]",M="[object Number]",N="[object Null]",E="[object Object]",O="[object Promise]",L="[object Proxy]",U="[object RegExp]",H="[object Set]",I="[object String]",T="[object Symbol]",F="[object Undefined]",K="[object WeakMap]",B="[object ArrayBuffer]",_="[object DataView]",p="[object Float32Array]",m="[object Float64Array]",w="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",y="[object Uint16Array]",b="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,ce=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,W={};W[p]=W[m]=W[w]=W[A]=W[P]=W[S]=W[k]=W[y]=W[b]=!0,W[a]=W[c]=W[B]=W[d]=W[_]=W[h]=W[g]=W[v]=W[R]=W[M]=W[E]=W[U]=W[H]=W[I]=W[K]=!1;var le=typeof Gi=="object"&&Gi&&Gi.Object===Object&&Gi,Y=typeof self=="object"&&self&&self.Object===Object&&self,re=le||Y||Function("return this")(),ne=e&&!e.nodeType&&e,D=ne&&!0&&t&&!t.nodeType&&t,ee=D&&D.exports===ne,ge=ee&&le.process,xe=function(){try{return ge&&ge.binding&&ge.binding("util")}catch{}}(),Ae=xe&&xe.isTypedArray;function ke(se,me){for(var $e=-1,mt=se==null?0:se.length,Zr=0,nr=[];++$e-1}function Li(se,me){var $e=this.__data__,mt=Bf($e,se);return mt<0?(++this.size,$e.push([se,me])):$e[mt][1]=me,this}ar.prototype.clear=Mi,ar.prototype.delete=Oi,ar.prototype.get=$i,ar.prototype.has=Di,ar.prototype.set=Li;function kn(se){var me=-1,$e=se==null?0:se.length;for(this.clear();++me<$e;){var mt=se[me];this.set(mt[0],mt[1])}}function As(){this.size=0,this.__data__={hash:new Nt,map:new(Ot||ar),string:new Nt}}function Sa(se){var me=Yu(this,se).delete(se);return this.size-=me?1:0,me}function Es(se){return Yu(this,se).get(se)}function Ia(se){return Yu(this,se).has(se)}function Ta(se,me){var $e=Yu(this,se),mt=$e.size;return $e.set(se,me),this.size+=$e.size==mt?0:1,this}kn.prototype.clear=As,kn.prototype.delete=Sa,kn.prototype.get=Es,kn.prototype.has=Ia,kn.prototype.set=Ta;function Ss(se){var me=-1,$e=se==null?0:se.length;for(this.__data__=new kn;++me<$e;)this.add(se[me])}function $o(se){return this.__data__.set(se,n),this}function Do(se){return this.__data__.has(se)}Ss.prototype.add=Ss.prototype.push=$o,Ss.prototype.has=Do;function Qn(se){var me=this.__data__=new ar(se);this.size=me.size}function ka(){this.__data__=new ar,this.size=0}function Pa(se){var me=this.__data__,$e=me.delete(se);return this.size=me.size,$e}function Ra(se){return this.__data__.get(se)}function Lf(se){return this.__data__.has(se)}function F2(se,me){var $e=this.__data__;if($e instanceof ar){var mt=$e.__data__;if(!Ot||mt.lengthqn))return!1;var Qr=nr.get(se);if(Qr&&nr.get(me))return Qr==me;var Dn=-1,Is=!0,Vn=$e&s?new Ss:void 0;for(nr.set(se,me),nr.set(me,se);++Dn-1&&se%1==0&&se-1&&se%1==0&&se<=o}function r3(se){var me=typeof se;return se!=null&&(me=="object"||me=="function")}function Ff(se){return se!=null&&typeof se=="object"}var n3=Ae?tt(Ae):H2;function Q4(se){return G4(se)?z2(se):q2(se)}function Gr(){return[]}function qr(){return!1}t.exports=Z4})(T5,T5.exports);var rme=T5.exports;const nme=_c(rme);var ime={};function sme(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);N!==E;){for(var U=x[N],H=0,I=O-1;(U!==0||H>>0,L[I]=U%a>>>0,U=U/a>>>0;if(U!==0)throw new Error("Non-zero carry");M=H,N++}for(var T=O-M;T!==O&&L[T]===0;)T++;for(var F=c.repeat(R);T>>0,O=new Uint8Array(E);x[R];){var L=r[x.charCodeAt(R)];if(L===255)return;for(var U=0,H=E-1;(L!==0||U>>0,O[H]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");N=U,R++}if(x[R]!==" "){for(var I=E-N;I!==E&&O[I]===0;)I++;for(var T=new Uint8Array(M+(E-I)),F=M;I!==E;)T[F++]=O[I++];return T}}}function v(x){var R=g(x);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:g,decode:v}}var ome=sme,ame=ome;const dj=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")},cme=t=>new TextEncoder().encode(t),lme=t=>new TextDecoder().decode(t);let ume=class{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")}},dme=class{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 fj(this,e)}},fme=class{constructor(e){this.decoders=e}or(e){return fj(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 fj=(t,e)=>new fme({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let hme=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ume(e,r,n),this.decoder=new dme(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const g4=({name:t,prefix:e,encode:r,decode:n})=>new hme(t,e,r,n),A2=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=ame(r,e);return g4({prefix:t,name:e,encode:n,decode:s=>dj(i(s))})},pme=(t,e,r,n)=>{const i={};for(let d=0;d=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},gme=(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<g4({prefix:e,name:t,encode(i){return gme(i,n,r)},decode(i){return pme(i,n,r,t)}}),mme=g4({prefix:"\0",name:"identity",encode:t=>lme(t),decode:t=>cme(t)});var wme=Object.freeze({__proto__:null,identity:mme});const vme=Ri({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var yme=Object.freeze({__proto__:null,base2:vme});const bme=Ri({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var xme=Object.freeze({__proto__:null,base8:bme});const _me=A2({prefix:"9",name:"base10",alphabet:"0123456789"});var Cme=Object.freeze({__proto__:null,base10:_me});const Ame=Ri({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Eme=Ri({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Sme=Object.freeze({__proto__:null,base16:Ame,base16upper:Eme});const Ime=Ri({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Tme=Ri({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kme=Ri({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Pme=Ri({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Rme=Ri({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nme=Ri({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Mme=Ri({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ome=Ri({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$me=Ri({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Dme=Object.freeze({__proto__:null,base32:Ime,base32upper:Tme,base32pad:kme,base32padupper:Pme,base32hex:Rme,base32hexupper:Nme,base32hexpad:Mme,base32hexpadupper:Ome,base32z:$me});const Lme=A2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Bme=A2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ume=Object.freeze({__proto__:null,base36:Lme,base36upper:Bme});const jme=A2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Fme=A2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var zme=Object.freeze({__proto__:null,base58btc:jme,base58flickr:Fme});const Wme=Ri({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Hme=Ri({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qme=Ri({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vme=Ri({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Kme=Object.freeze({__proto__:null,base64:Wme,base64pad:Hme,base64url:qme,base64urlpad:Vme});const hj=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Gme=hj.reduce((t,e,r)=>(t[r]=e,t),[]),Zme=hj.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Qme(t){return t.reduce((e,r)=>(e+=Gme[r],e),"")}function Yme(t){const e=[];for(const r of t){const n=Zme[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Jme=g4({prefix:"🚀",name:"base256emoji",encode:Qme,decode:Yme});var Xme=Object.freeze({__proto__:null,base256emoji:Jme}),ewe=pj,nN=128,twe=127,rwe=~twe,nwe=Math.pow(2,31);function pj(t,e,r){e=e||[],r=r||0;for(var n=r;t>=nwe;)e[r++]=t&255|nN,t/=128;for(;t&rwe;)e[r++]=t&255|nN,t>>>=7;return e[r]=t|0,pj.bytes=r-n+1,e}var iwe=D_,swe=128,iN=127;function D_(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw D_.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&iN)<=swe);return D_.bytes=s-n,r}var owe=Math.pow(2,7),awe=Math.pow(2,14),cwe=Math.pow(2,21),lwe=Math.pow(2,28),uwe=Math.pow(2,35),dwe=Math.pow(2,42),fwe=Math.pow(2,49),hwe=Math.pow(2,56),pwe=Math.pow(2,63),gwe=function(t){return t(gj.encode(t,e,r),e),oN=t=>gj.encodingLength(t),L_=(t,e)=>{const r=e.byteLength,n=oN(t),i=n+oN(r),s=new Uint8Array(i+r);return sN(t,s,0),sN(r,s,n),s.set(e,i),new wwe(t,r,e,s)};class wwe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const mj=({name:t,code:e,encode:r})=>new vwe(t,e,r);class vwe{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?L_(this.code,r):r.then(n=>L_(this.code,n))}else throw Error("Unknown type, must be binary type")}}const wj=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),ywe=mj({name:"sha2-256",code:18,encode:wj("SHA-256")}),bwe=mj({name:"sha2-512",code:19,encode:wj("SHA-512")});var xwe=Object.freeze({__proto__:null,sha256:ywe,sha512:bwe});const vj=0,_we="identity",yj=dj,Cwe=t=>L_(vj,yj(t)),Awe={code:vj,name:_we,encode:yj,digest:Cwe};var Ewe=Object.freeze({__proto__:null,identity:Awe});new TextEncoder,new TextDecoder;const aN={...wme,...yme,...xme,...Cme,...Sme,...Dme,...Ume,...zme,...Kme,...Xme};({...xwe,...Ewe});function Swe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function bj(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const cN=bj("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),S9=bj("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Swe(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}=Qe("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=ts(r,this.name)}get context(){return Xs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,dU(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?fU(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class dve{constructor(e,r,n){this.core=e,this.logger=r,this.name=Rwe,this.randomSessionIdentifier=O_(),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=jP(i);return IB(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=N1e();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=jP(s),a=this.randomSessionIdentifier;return await cue(a,i,Nwe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=M1e(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||cb(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=rj(o),c=Iu(s);if(UR(a))return $1e(c,o==null?void 0:o.encoding);if(BR(a)){const g=a.senderPublicKey,v=a.receiverPublicKey;i=await this.generateSharedKey(g,v)}const l=this.getSymKey(i),{type:d,senderPublicKey:h}=a;return O1e({type:d,symKey:l,message:c,senderPublicKey:h,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=B1e(s,o);if(UR(a)){const c=L1e(s,o==null?void 0:o.encoding);return Bh(c)}if(BR(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=D1e({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return Bh(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=Ld)=>{const o=dv({encoded:i,encoding:s});return Yh(o.type)},this.getPayloadSenderPublicKey=(i,s=Ld)=>{const o=dv({encoded:i,encoding:s});return o.senderPublicKey?wi(o.senderPublicKey,ps):void 0},this.core=e,this.logger=ts(r,this.name),this.keychain=n||new uve(this.core,this.logger)}get context(){return Xs(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(lN)}catch{e=O_(),await this.keychain.set(lN,e)}return Twe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class fve extends hce{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=$we,this.version=Dwe,this.initialized=!1,this.storagePrefix=xl,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=lu(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=lu(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ts(e,this.name),this.core=r}get context(){return Xs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,dU(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?fU(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class hve extends pce{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new _a.EventEmitter,this.name=Bwe,this.queue=new Map,this.publishTimeout=Ye.toMiliseconds(Ye.ONE_MINUTE),this.failedPublishTimeout=Ye.toMiliseconds(Ye.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)||Lwe,c=$_(s),l=(s==null?void 0:s.prompt)||!1,d=(s==null?void 0:s.tag)||0,h=(s==null?void 0:s.id)||gh().toString(),g={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:d,id:h,attestation:s==null?void 0:s.attestation}},v=`Failed to publish payload, please try again. id:${h} tag:${d}`,x=Date.now();let R,M=1;try{for(;R===void 0;){if(Date.now()-x>this.publishTimeout)throw new Error(v);this.logger.trace({id:h,attempts:M},`publisher.publish - attempt ${M}`),R=await await Kp(this.rpcPublish(n,i,a,c,l,d,h,s==null?void 0:s.attestation).catch(N=>this.logger.warn(N)),this.publishTimeout,v),M++,R||await new Promise(N=>setTimeout(N,this.failedPublishTimeout))}this.relayer.events.emit(us.publish,g),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:h,topic:n,message:i,opts:s}})}catch(N){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(N),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw N;this.queue.set(h,g)}},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=ts(r,this.name),this.registerEventListeners()}get context(){return Xs(this.logger)}rpcPublish(e,r,n,i,s,o,a,c){var l,d,h,g;const v={method:Mm(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o,attestation:c},id:a};return js((l=v.params)==null?void 0:l.prompt)&&((d=v.params)==null||delete d.prompt),js((h=v.params)==null?void 0:h.tag)&&((g=v.params)==null||delete g.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:v}),this.relayer.request(v)}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(lg.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(us.connection_stalled);return}this.checkQueue()}),this.relayer.on(us.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class pve{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 gve=Object.defineProperty,mve=Object.defineProperties,wve=Object.getOwnPropertyDescriptors,dN=Object.getOwnPropertySymbols,vve=Object.prototype.hasOwnProperty,yve=Object.prototype.propertyIsEnumerable,fN=(t,e,r)=>e in t?gve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bm=(t,e)=>{for(var r in e||(e={}))vve.call(e,r)&&fN(t,r,e[r]);if(dN)for(var r of dN(e))yve.call(e,r)&&fN(t,r,e[r]);return t},I9=(t,e)=>mve(t,wve(e));class bve extends wce{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new pve,this.events=new _a.EventEmitter,this.name=qwe,this.version=Vwe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=xl,this.subscribeTimeout=Ye.toMiliseconds(Ye.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=$_(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==null?void 0:i.transportType);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 Ye.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)>=Kwe&&(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=ts(r,this.name),this.clientId=""}get context(){return Xs(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=$_(n);await this.rpcUnsubscribe(e,r,i);const s=Vr("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=Jr.relay){n===Jr.relay&&await this.restartToComplete();const i={method:Mm(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{const s=lu(e+this.clientId);return n===Jr.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(o=>this.logger.warn(o))},Ye.toMiliseconds(Ye.ONE_SECOND)),s):await await Kp(this.relayer.request(i).catch(o=>this.logger.warn(o)),this.subscribeTimeout)?s:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(us.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Mm(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 Kp(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(us.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:Mm(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 Kp(this.relayer.request(n).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(us.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:Mm(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,I9(bm({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,bm({},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,bm({},r)),this.topicMap.set(r.topic,e),this.events.emit(Gc.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}=Qe("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(Gc.deleted,I9(bm({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Gc.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}=Qe("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);Jh(r)&&this.onBatchSubscribe(r.map((n,i)=>I9(bm({},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(lg.pulse,async()=>{await this.checkPending()}),this.events.on(Gc.created,async e=>{const r=Gc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Gc.deleted,async e=>{const r=Gc.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}=Qe("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 xve=Object.defineProperty,hN=Object.getOwnPropertySymbols,_ve=Object.prototype.hasOwnProperty,Cve=Object.prototype.propertyIsEnumerable,pN=(t,e,r)=>e in t?xve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ave=(t,e)=>{for(var r in e||(e={}))_ve.call(e,r)&&pN(t,r,e[r]);if(hN)for(var r of hN(e))Cve.call(e,r)&&pN(t,r,e[r]);return t};class Eve extends gce{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new _a.EventEmitter,this.name=jwe,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=Ye.toMiliseconds(Ye.THIRTY_SECONDS+Ye.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||gh().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 d=()=>{l(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(Yo.disconnect,d);const h=await o;this.provider.off(Yo.disconnect,d),c(h)});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(cv())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(us.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(us.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Yo.payload,this.onPayloadHandler),this.provider.on(Yo.connect,this.onConnectHandler),this.provider.on(Yo.disconnect,this.onDisconnectHandler),this.provider.on(Yo.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ts(e.logger,this.name):Xv(t2({level:e.logger||Uwe})),this.messages=new fve(this.logger,e.core),this.subscriber=new bve(this,this.logger),this.publisher=new hve(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Aj,this.projectId=e.projectId,this.bundleId=_he(),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 Xs(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:Jr.relay})}async subscribe(e,r){var n;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",s;const o=a=>{a.topic===e&&(this.subscriber.off(Gc.created,o),s())};return await Promise.all([new Promise(a=>{s=a,this.subscriber.on(Gc.created,o)}),new Promise(async a=>{i=await this.subscriber.subscribe(e,r)||i,a()})]),i}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.hasExperiencedNetworkDisruption||this.connected?await Kp(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(Yo.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Yo.disconnect,i),await Kp(this.provider.connect(),Ye.toMiliseconds(Ye.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 ZR())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=ei(Ye.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(us.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,s;if(cv())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 Ec(new tme(The({sdkVersion:Ej,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}),ME(e)){if(!e.method.endsWith(Fwe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:Jr.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Ave({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else p4(e)&&this.events.emit(us.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(us.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=f4(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Yo.payload,this.onPayloadHandler),this.provider.off(Yo.connect,this.onConnectHandler),this.provider.off(Yo.disconnect,this.onDisconnectHandler),this.provider.off(Yo.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await ZR();Nge(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(us.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ye.toMiliseconds(zwe))))}isInitialized(){if(!this.initialized){const{message:e}=Qe("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 Sve=Object.defineProperty,gN=Object.getOwnPropertySymbols,Ive=Object.prototype.hasOwnProperty,Tve=Object.prototype.propertyIsEnumerable,mN=(t,e,r)=>e in t?Sve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wN=(t,e)=>{for(var r in e||(e={}))Ive.call(e,r)&&mN(t,r,e[r]);if(gN)for(var r of gN(e))Tve.call(e,r)&&mN(t,r,e[r]);return t};class M0 extends mce{constructor(e,r,n,i=xl,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Wwe,this.cached=[],this.initialized=!1,this.storagePrefix=xl,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&&!js(o)?this.map.set(this.getKey(o),o):lge(o)?this.map.set(o.id,o):uge(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=>nme(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=wN(wN({},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=ts(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Xs(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}=Qe("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=Qe("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}=Qe("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}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class kve{constructor(e,r){this.core=e,this.logger=r,this.name=Gwe,this.version=Zwe,this.events=new cE,this.initialized=!1,this.storagePrefix=xl,this.ignoredPayloadTypes=[bu],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=O_(),s=await this.core.crypto.setSymKey(i),o=ei(Ye.FIVE_MINUTES),a={protocol:Cj},c={topic:s,expiry:o,relay:a,active:!1},l=X1e({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.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:[zc.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=WR(n.uri);i.props.properties.topic=s,i.addTrace(zc.pairing_uri_validation_success),i.addTrace(zc.pairing_uri_not_expired);let d;if(this.pairings.keys.includes(s)){if(d=this.pairings.get(s),i.addTrace(zc.existing_pairing),d.active)throw i.setError(iu.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(zc.pairing_not_expired)}const h=c||ei(Ye.FIVE_MINUTES),g={topic:s,relay:a,expiry:h,active:!1,methods:l};this.core.expirer.set(s,h),await this.pairings.set(s,g),i.addTrace(zc.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(Mp.create,g),i.addTrace(zc.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(zc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(iu.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(v){throw i.setError(iu.subscribe_pairing_topic_failure),v}return i.addTrace(zc.subscribe_pairing_topic_success),g},this.activate=async({topic:n})=>{this.isInitialized();const i=ei(Ye.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}=oh();this.events.once(xr("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",Vr("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=mh(i,s),a=await this.core.crypto.encode(n,o),c=vm[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=f4(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=vm[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=h4(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=vm[c.request.method]?vm[c.request.method].res:vm.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,Vr("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=>wd(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(Mp.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(()=>{Kc(i)?this.events.emit(xr("pairing_ping",s),{}):oa(i)&&this.events.emit(xr("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(Mp.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=Vr("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(Vr("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!Ds(n)){const{message:a}=Qe("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(iu.malformed_pairing_uri),new Error(a)}if(!cge(n.uri)){const{message:a}=Qe("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(iu.malformed_pairing_uri),new Error(a)}const o=WR(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=Qe("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(iu.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=Qe("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(iu.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&Ye.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Ds(n)){const{message:s}=Qe("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Ds(n)){const{message:s}=Qe("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Fn(n,!1)){const{message:i}=Qe("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=Qe("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(wd(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=Qe("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=ts(r,this.name),this.pairings=new M0(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Xs(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(us.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Jr.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{ME(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):p4(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(ra.expired,async e=>{const{topic:r}=pU(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Mp.expire,{topic:r}))})}}class Pve extends fce{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new _a.EventEmitter,this.name=Qwe,this.version=Ywe,this.cached=[],this.initialized=!1,this.storagePrefix=xl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:ei(Ye.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Wa.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=oa(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Wa.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(Wa.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=ts(r,this.name)}get context(){return Xs(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:mh(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}=Qe("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Wa.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Qe("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(Wa.created,e=>{const r=Wa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Wa.updated,e=>{const r=Wa.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Wa.deleted,e=>{const r=Wa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(lg.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Ye.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Wa.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Rve extends vce{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new _a.EventEmitter,this.name=Jwe,this.version=Xwe,this.cached=[],this.initialized=!1,this.storagePrefix=xl,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(ra.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(ra.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=ts(r,this.name)}get context(){return Xs(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 khe(e);if(typeof e=="number")return Phe(e);const{message:r}=Qe("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(ra.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Ye.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(ra.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(lg.pulse,()=>this.checkExpirations()),this.events.on(ra.created,e=>{const r=ra.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ra.expired,e=>{const r=ra.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ra.deleted,e=>{const r=ra.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}}var fn={};Object.defineProperty(fn,"__esModule",{value:!0}),fn.getLocalStorage=fn.getLocalStorageOrThrow=fn.getCrypto=fn.getCryptoOrThrow=fn.getLocation=fn.getLocationOrThrow=fn.getNavigator=fn.getNavigatorOrThrow=Ij=fn.getDocument=fn.getDocumentOrThrow=fn.getFromWindowOrThrow=fn.getFromWindow=void 0;function O0(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}fn.getFromWindow=O0;function Cg(t){const e=O0(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}fn.getFromWindowOrThrow=Cg;function Nve(){return Cg("document")}fn.getDocumentOrThrow=Nve;function Mve(){return O0("document")}var Ij=fn.getDocument=Mve;function Ove(){return Cg("navigator")}fn.getNavigatorOrThrow=Ove;function $ve(){return O0("navigator")}fn.getNavigator=$ve;function Dve(){return Cg("location")}fn.getLocationOrThrow=Dve;function Lve(){return O0("location")}fn.getLocation=Lve;function Bve(){return Cg("crypto")}fn.getCryptoOrThrow=Bve;function Uve(){return O0("crypto")}fn.getCrypto=Uve;function jve(){return Cg("localStorage")}fn.getLocalStorageOrThrow=jve;function Fve(){return O0("localStorage")}fn.getLocalStorage=Fve;class zve extends yce{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=eve,this.verifyUrlV3=rve,this.storagePrefix=xl,this.version=_j,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ye.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!y2()||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=Ij(),d=this.startAbortTimer(Ye.ONE_SECOND*5),h=await new Promise((g,v)=>{const x=()=>{window.removeEventListener("message",M),l.body.removeChild(R),v("attestation aborted")};this.abortController.signal.addEventListener("abort",x);const R=l.createElement("iframe");R.src=c,R.style.display="none",R.addEventListener("error",x,{signal:this.abortController.signal});const M=N=>{if(!N.data)return;const E=JSON.parse(N.data);if(E.type==="verify_attestation"){if(x_(E.attestation).payload.id!==o)return;clearInterval(d),l.body.removeChild(R),this.abortController.signal.removeEventListener("abort",x),window.removeEventListener("message",M),g(E.attestation===null?"":E.attestation)}};l.body.appendChild(R),window.addEventListener("message",M,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",h),h}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(x_(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(Ye.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||nw;return nve.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${nw}`),s=nw),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Ye.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=z1e(i,s.publicKey),a={hasExpired:Ye.toMiliseconds(o.exp)this.abortController.abort(),Ye.toMiliseconds(e))}}class Wve extends bce{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=ive,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${sve}/${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=ts(r,this.context)}}var Hve=Object.defineProperty,vN=Object.getOwnPropertySymbols,qve=Object.prototype.hasOwnProperty,Vve=Object.prototype.propertyIsEnumerable,yN=(t,e,r)=>e in t?Hve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xm=(t,e)=>{for(var r in e||(e={}))qve.call(e,r)&&yN(t,r,e[r]);if(vN)for(var r of vN(e))Vve.call(e,r)&&yN(t,r,e[r]);return t};class Kve extends xce{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=ave,this.storagePrefix=xl,this.storageVersion=ove,this.events=new Map,this.shouldPersist=!1,this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=Mhe(),d=this.core.projectId||"",h=Date.now(),g=xm({eventId:l,bundleId:d,timestamp:h,props:{event:s,type:o,properties:{topic:a,trace:c}}},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,g),this.shouldPersist=!0),g},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 xm(xm({},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(lg.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Ye.fromMiliseconds(Date.now())-Ye.fromMiliseconds(i.timestamp)>cve&&(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,xm(xm({},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 fetch(`${lve}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Ej}`,{method:"POST",body:JSON.stringify(i)})).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.logger=ts(r,this.context),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 Gve=Object.defineProperty,bN=Object.getOwnPropertySymbols,Zve=Object.prototype.hasOwnProperty,Qve=Object.prototype.propertyIsEnumerable,xN=(t,e,r)=>e in t?Gve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_N=(t,e)=>{for(var r in e||(e={}))Zve.call(e,r)&&xN(t,r,e[r]);if(bN)for(var r of bN(e))Qve.call(e,r)&&xN(t,r,e[r]);return t};let Yve=class Tj extends dce{constructor(e){var r;super(e),this.protocol=xj,this.version=_j,this.name=OE,this.events=new _a.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:Jr.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Aj,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=t2({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:kwe.logger}),{logger:i,chunkLoggerController:s}=pL({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=ts(i,this.name),this.heartbeat=new uce,this.crypto=new dve(this,this.logger,e==null?void 0:e.keychain),this.history=new Pve(this,this.logger),this.expirer=new Rve(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Oae(_N(_N({},Pwe),e==null?void 0:e.storageOptions)),this.relayer=new Eve({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new kve(this,this.logger),this.verify=new zve(this,this.logger,this.storage),this.echoClient=new Wve(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Kve(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new Tj(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(Hwe,n),r}get context(){return Xs(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(uN,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.linkModeSupportedApps=await this.storage.getItem(uN)||[],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 Jve=Yve;var Xve={};const kj="wc",Pj=2,Rj="client",$E=`${kj}@${Pj}:${Rj}:`,T9={name:Rj,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},CN="WALLETCONNECT_DEEPLINK_CHOICE",e2e="proposal",Nj="Proposal expired",t2e="session",up=Ye.SEVEN_DAYS,r2e="engine",fi={wc_sessionPropose:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ye.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ye.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1119}}},k9={min:Ye.FIVE_MINUTES,max:Ye.SEVEN_DAYS},jc={idle:"IDLE",active:"ACTIVE"},n2e="request",i2e=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],s2e="wc",o2e="auth",a2e="authKeys",c2e="pairingTopics",l2e="requests",m4=`${s2e}@${1.5}:${o2e}:`,lb=`${m4}:PUB_KEY`;var u2e=Object.defineProperty,d2e=Object.defineProperties,f2e=Object.getOwnPropertyDescriptors,AN=Object.getOwnPropertySymbols,h2e=Object.prototype.hasOwnProperty,p2e=Object.prototype.propertyIsEnumerable,EN=(t,e,r)=>e in t?u2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rn=(t,e)=>{for(var r in e||(e={}))h2e.call(e,r)&&EN(t,r,e[r]);if(AN)for(var r of AN(e))p2e.call(e,r)&&EN(t,r,e[r]);return t},qa=(t,e)=>d2e(t,f2e(e));class g2e extends Cce{constructor(e){super(e),this.name=r2e,this.events=new cE,this.initialized=!1,this.requestQueue={state:jc.idle,queue:[]},this.sessionRequestQueue={state:jc.idle,queue:[]},this.requestQueueDelay=Ye.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(fi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=qa(Rn({},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,d,h=!1;try{l&&(h=this.client.core.pairing.pairings.get(l).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),L}if(!l||!h){const{topic:L,uri:U}=await this.client.core.pairing.create();l=L,d=U}if(!l){const{message:L}=Qe("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(L)}const g=await this.client.core.crypto.generateKeyPair(),v=fi.wc_sessionPropose.req.ttl||Ye.FIVE_MINUTES,x=ei(v),R=Rn({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Cj}],proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:x,pairingTopic:l},a&&{sessionProperties:a}),{reject:M,resolve:N,done:E}=oh(v,Nj);this.events.once(xr("session_connect"),async({error:L,session:U})=>{if(L)M(L);else if(U){U.self.publicKey=g;const H=qa(Rn({},U),{pairingTopic:R.pairingTopic,requiredNamespaces:R.requiredNamespaces,optionalNamespaces:R.optionalNamespaces,transportType:Jr.relay});await this.client.session.set(U.topic,H),await this.setExpiry(U.topic,U.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:U.peer.metadata}),this.cleanupDuplicatePairings(H),N(H)}});const O=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:R,throwOnFailedPublish:!0});return await this.setProposal(O,Rn({id:O},R)),{uri:d,approval:E}},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:[Ha.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(T){throw o.setError(rh.no_internet_connection),T}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(T){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(rh.proposal_not_found),T}try{await this.isValidApprove(r)}catch(T){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(rh.session_approve_namespace_validation_failure),T}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:d,sessionConfig:h}=r,g=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:v,proposer:x,requiredNamespaces:R,optionalNamespaces:M}=g;let N=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:v});N||(N=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Ha.session_approve_started,properties:{topic:v,trace:[Ha.session_approve_started,Ha.session_namespaces_validation_success]}}));const E=await this.client.core.crypto.generateKeyPair(),O=x.publicKey,L=await this.client.core.crypto.generateSharedKey(E,O),U=Rn(Rn({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:E,metadata:this.client.metadata},expiry:ei(up)},d&&{sessionProperties:d}),h&&{sessionConfig:h}),H=Jr.relay;N.addTrace(Ha.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:H})}catch(T){throw N.setError(rh.subscribe_session_topic_failure),T}N.addTrace(Ha.subscribe_session_topic_success);const I=qa(Rn({},U),{topic:L,requiredNamespaces:R,optionalNamespaces:M,pairingTopic:v,acknowledged:!1,self:U.controller,peer:{publicKey:x.publicKey,metadata:x.metadata},controller:E,transportType:Jr.relay});await this.client.session.set(L,I),N.addTrace(Ha.store_session);try{N.addTrace(Ha.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:U,throwOnFailedPublish:!0}).catch(T=>{throw N==null||N.setError(rh.session_settle_publish_failure),T}),N.addTrace(Ha.session_settle_publish_success),N.addTrace(Ha.publishing_session_approve),await this.sendResult({id:a,topic:v,result:{relay:{protocol:c??"irn"},responderPublicKey:E},throwOnFailedPublish:!0}).catch(T=>{throw N==null||N.setError(rh.session_approve_publish_failure),T}),N.addTrace(Ha.session_approve_publish_success)}catch(T){throw this.client.logger.error(T),this.client.session.delete(L,Vr("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),T}return this.client.core.eventClient.deleteEvent({eventId:N.eventId}),await this.client.core.pairing.updateMetadata({topic:v,metadata:x.metadata}),await this.client.proposal.delete(a,Vr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:v}),await this.setExpiry(L,ei(up)),{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:fi.wc_sessionPropose.reject}),await this.client.proposal.delete(n,Vr("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(h){throw this.client.logger.error("update() -> isValidUpdate() failed"),h}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=oh(),c=yd(),l=gh().toString(),d=this.client.session.get(n).namespaces;return this.events.once(xr("session_update",c),({error:h})=>{h?a(h):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(h=>{this.client.logger.error(h),this.client.session.update(n,{namespaces:d}),a(h)}),{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=yd(),{done:s,resolve:o,reject:a}=oh();return this.events.once(xr("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,ei(up)),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(x){throw this.client.logger.error("request() -> isValidRequest() failed"),x}const{chainId:n,request:i,topic:s,expiry:o=fi.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===Jr.relay&&await this.confirmOnlineStateOrThrow();const c=yd(),l=gh().toString(),{done:d,resolve:h,reject:g}=oh(o,"Request expired. Please try again.");this.events.once(xr("session_request",c),({error:x,result:R})=>{x?g(x):h(R)});const v=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return v?(await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:qa(Rn({},i),{expiryTimestamp:ei(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:v}).catch(x=>g(x)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await d()):await Promise.all([new Promise(async x=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:"wc_sessionRequest",params:{request:qa(Rn({},i),{expiryTimestamp:ei(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(R=>g(R)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),x()}),new Promise(async x=>{var R;if(!((R=a.sessionConfig)!=null&&R.disableDeepLink)){const M=await Nhe(this.client.core.storage,CN);Rhe({id:c,topic:s,wcDeepLink:M})}x()}),d()]).then(x=>x[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===Jr.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);Kc(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):oa(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=yd(),s=gh().toString(),{done:o,resolve:a,reject:c}=oh();this.events.once(xr("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=gh().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:Vr("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}=Qe("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>oge(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?Jr.link_mode:Jr.relay;o===Jr.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:d,nonce:h,type:g,exp:v,nbf:x,methods:R=[],expiry:M}=r,N=[...r.resources||[]],{topic:E,uri:O}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:E,uri:O}});const L=await this.client.core.crypto.generateKeyPair(),U=cb(L);if(await Promise.all([this.client.auth.authKeys.set(lb,{responseTopic:U,publicKey:L}),this.client.auth.pairingTopics.set(U,{topic:U,pairingTopic:E})]),await this.client.core.relayer.subscribe(U,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${E}`),R.length>0){const{namespace:S}=Jm(a[0]);let k=S1e(S,"request",R);ab(N)&&(k=T1e(k,N.pop())),N.push(k)}const H=M&&M>fi.wc_sessionAuthenticate.req.ttl?M:fi.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:g??"caip122",chains:a,statement:c,aud:l,domain:d,version:"1",nonce:h,iat:new Date().toISOString(),exp:v,nbf:x,resources:N},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:ei(H)},T={eip155:{chains:a,methods:[...new Set(["personal_sign",...R])],events:["chainChanged","accountsChanged"]}},F={requiredNamespaces:{},optionalNamespaces:T,relays:[{protocol:"irn"}],pairingTopic:E,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:ei(fi.wc_sessionPropose.req.ttl)},{done:K,resolve:B,reject:_}=oh(H,"Request expired"),p=async({error:S,session:k})=>{if(this.events.off(xr("session_request",w),m),S)_(S);else if(k){k.self.publicKey=L,await this.client.session.set(k.topic,k),await this.setExpiry(k.topic,k.expiry),E&&await this.client.core.pairing.updateMetadata({topic:E,metadata:k.peer.metadata});const y=this.client.session.get(k.topic);await this.deleteProposal(A),B({session:y})}},m=async S=>{var k,y,b;if(await this.deletePendingAuthRequest(w,{message:"fulfilled",code:0}),S.error){const re=Vr("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return S.error.code===re.code?void 0:(this.events.off(xr("session_connect"),p),_(S.error.message))}await this.deleteProposal(A),this.events.off(xr("session_connect"),p);const{cacaos:V,responder:ce}=S.result,de=[],W=[];for(const re of V){await OR({cacao:re,projectId:this.client.core.projectId})||(this.client.logger.error(re,"Signature verification failed"),_(Vr("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ne}=re,D=ab(ne.resources),ee=[MR(ne.iss)],ge=S5(ne.iss);if(D){const xe=$R(D),Ae=DR(D);de.push(...xe),ee.push(...Ae)}for(const xe of ee)W.push(`${xe}:${ge}`)}const le=await this.client.core.crypto.generateSharedKey(L,ce.publicKey);let Y;de.length>0&&(Y={topic:le,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:ce,controller:ce.publicKey,expiry:ei(up),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:E,namespaces:HR([...new Set(de)],[...new Set(W)]),transportType:o},await this.client.core.relayer.subscribe(le,{transportType:o}),await this.client.session.set(le,Y),E&&await this.client.core.pairing.updateMetadata({topic:E,metadata:ce.metadata}),Y=this.client.session.get(le)),(k=this.client.metadata.redirect)!=null&&k.linkMode&&(y=ce.metadata.redirect)!=null&&y.linkMode&&(b=ce.metadata.redirect)!=null&&b.universal&&n&&(this.client.core.addLinkModeSupportedApp(ce.metadata.redirect.universal),this.client.session.update(le,{transportType:Jr.link_mode})),B({auths:V,session:Y})},w=yd(),A=yd();this.events.once(xr("session_connect"),p),this.events.once(xr("session_request",w),m);let P;try{if(s){const S=mh("wc_sessionAuthenticate",I,w);this.client.core.history.set(E,S);const k=await this.client.core.crypto.encode("",S,{type:C2,encoding:mm});P=Ay(n,E,k)}else await Promise.all([this.sendRequest({topic:E,method:"wc_sessionAuthenticate",params:I,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:w}),this.sendRequest({topic:E,method:"wc_sessionPropose",params:F,expiry:fi.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:A})])}catch(S){throw this.events.off(xr("session_connect"),p),this.events.off(xr("session_request",w),m),S}return await this.setProposal(A,Rn({id:A},F)),await this.setAuthRequest(w,{request:qa(Rn({},I),{verifyContext:{}}),pairingTopic:E,transportType:o}),{uri:P??O,response:K}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[nh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(M){throw s.setError(ym.no_internet_connection),M}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(ym.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||Jr.relay;a===Jr.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),d=cb(c),h={type:bu,receiverPublicKey:c,senderPublicKey:l},g=[],v=[];for(const M of i){if(!await OR({cacao:M,projectId:this.client.core.projectId})){s.setError(ym.invalid_cacao);const U=Vr("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:d,error:U,encodeOpts:h}),new Error(U.message)}s.addTrace(nh.cacaos_verified);const{p:N}=M,E=ab(N.resources),O=[MR(N.iss)],L=S5(N.iss);if(E){const U=$R(E),H=DR(E);g.push(...U),O.push(...H)}for(const U of O)v.push(`${U}:${L}`)}const x=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(nh.create_authenticated_session_topic);let R;if((g==null?void 0:g.length)>0){R={topic:x,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:ei(up),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:HR([...new Set(g)],[...new Set(v)]),transportType:a},s.addTrace(nh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(x,{transportType:a})}catch(M){throw s.setError(ym.subscribe_authenticated_session_topic_failure),M}s.addTrace(nh.subscribe_authenticated_session_topic_success),await this.client.session.set(x,R),s.addTrace(nh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(nh.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(M){throw s.setError(ym.authenticated_session_approve_publish_failure),M}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:R}},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===Jr.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=cb(o),l={type:bu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:fi.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,Vr("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return QU(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,Vr("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(CN).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,Vr("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=jc.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(rh.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,Vr("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=jc.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,ei(fi.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=Jr.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||ei(fi.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:d}=r,h=mh(i,s,c);let g;const v=!!d;try{const M=v?mm:Ld;g=await this.client.core.crypto.encode(n,h,{encoding:M})}catch(M){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),M}let x;if(i2e.includes(i)){const M=lu(JSON.stringify(h)),N=lu(g);x=await this.client.core.verify.register({id:N,decryptedId:M})}const R=fi[i].req;if(R.attestation=x,o&&(R.ttl=o),a&&(R.id=a),this.client.core.history.set(n,h),v){const M=Ay(d,n,g);await global.Linking.openURL(M,this.client.name)}else{const M=fi[i].req;o&&(M.ttl=o),a&&(M.id=a),l?(M.internal=qa(Rn({},M.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,g,M)):this.client.core.relayer.publish(n,g,M).catch(N=>this.client.logger.error(N))}return h.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=f4(n,s);let d;const h=c&&typeof(global==null?void 0:global.Linking)<"u";try{const v=h?mm:Ld;d=await this.client.core.crypto.encode(i,l,qa(Rn({},a||{}),{encoding:v}))}catch(v){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),v}let g;try{g=await this.client.core.history.get(i,n)}catch(v){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),v}if(h){const v=Ay(c,i,d);await global.Linking.openURL(v,this.client.name)}else{const v=fi[g.request.method].res;o?(v.internal=qa(Rn({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,d,v)):this.client.core.relayer.publish(i,d,v).catch(x=>this.client.logger.error(x))}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=h4(n,s);let d;const h=c&&typeof(global==null?void 0:global.Linking)<"u";try{const v=h?mm:Ld;d=await this.client.core.crypto.encode(i,l,qa(Rn({},o||{}),{encoding:v}))}catch(v){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),v}let g;try{g=await this.client.core.history.get(i,n)}catch(v){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),v}if(h){const v=Ay(c,i,d);await global.Linking.openURL(v,this.client.name)}else{const v=a||fi[g.request.method].res;this.client.core.relayer.publish(i,d,v)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;wd(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=>{wd(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===jc.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=jc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=jc.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}=Qe("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(Rn({},i.params));const d=a.expiryTimestamp||ei(fi.wc_sessionPropose.req.ttl),h=Rn({id:c,pairingTopic:n,expiryTimestamp:d},a);await this.setProposal(c,h);const g=await this.getVerifyContext({attestationId:s,hash:lu(JSON.stringify(i)),encryptedId:o,metadata:h.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(iu.proposal_listener_not_found)),l==null||l.addTrace(zc.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:h,verifyContext:g})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:fi.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(Kc(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 d=await this.client.core.crypto.generateSharedKey(c,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const h=await this.client.core.relayer.subscribe(d,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:h}),await this.client.core.pairing.activate({topic:r})}else if(oa(n)){await this.client.proposal.delete(s,Vr("USER_DISCONNECTED"));const o=xr("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(xr("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:d,sessionConfig:h}=n.params,g=qa(Rn(Rn({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}},d&&{sessionProperties:d}),h&&{sessionConfig:h}),{transportType:Jr.relay}),v=xr("session_connect");if(this.events.listenerCount(v)===0)throw new Error(`emitting ${v} without any listeners 997`);this.events.emit(xr("session_connect"),{session:g}),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;Kc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(xr("session_approve",i),{})):oa(n)&&(await this.client.session.delete(r,Vr("USER_DISCONNECTED")),this.events.emit(xr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=wm.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:Vr("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Rn({topic:r},i));try{wm.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 wm.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=xr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Kc(n)?this.events.emit(xr("session_update",i),{}):oa(n)&&this.events.emit(xr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,ei(up)),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=xr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Kc(n)?this.events.emit(xr("session_extend",i),{}):oa(n)&&this.events.emit(xr("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=xr("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{Kc(n)?this.events.emit(xr("session_ping",i),{}):oa(n)&&this.events.emit(xr("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(us.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:Vr("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:d}=r,{id:h,params:g}=a;try{await this.isValidRequest(Rn({topic:o},g));const v=this.client.session.get(o),x=await this.getVerifyContext({attestationId:c,hash:lu(JSON.stringify(mh("wc_sessionRequest",g,h))),encryptedId:l,metadata:v.peer.metadata,transportType:d}),R={id:h,topic:o,params:g,verifyContext:x};await this.setPendingSessionRequest(R),d===Jr.link_mode&&(n=v.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=v.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(R):(this.addSessionRequestToSessionRequestQueue(R),this.processSessionRequestQueue())}catch(v){await this.sendError({id:h,topic:o,error:v}),this.client.logger.error(v)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=xr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Kc(n)?this.events.emit(xr("session_request",i),{result:n.result}):oa(n)&&this.events.emit(xr("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=wm.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Rn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),wm.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}),Kc(n)?this.events.emit(xr("session_request",i),{result:n.result}):oa(n)&&this.events.emit(xr("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:d,expiryTimestamp:h}=s.params,g=await this.getVerifyContext({attestationId:o,hash:lu(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),v={requester:l,pairingTopic:i,id:s.id,authPayload:d,verifyContext:g,expiryTimestamp:h};await this.setAuthRequest(s.id,{request:v,pairingTopic:i,transportType:c}),c===Jr.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:g})}catch(l){this.client.logger.error(l);const d=s.params.requester.publicKey,h=await this.client.core.crypto.generateKeyPair(),g=this.getAppLinkIfEnabled(s.params.requester.metadata,c),v={type:bu,receiverPublicKey:d,senderPublicKey:h};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:v,rpcOpts:fi.wc_sessionAuthenticate.autoReject,appLink:g})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=jc.idle,this.processSessionRequestQueue()},Ye.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=xr("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(xr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===jc.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=jc.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:mh("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Ds(r)){const{message:c}=Qe("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(js(n)||await this.isValidPairingTopic(n),!vge(a)){const{message:c}=Qe("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!js(i)&&fv(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!js(s)&&fv(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),js(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=wge(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Ds(r))throw new Error(Qe("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=A9(i,"approve()");if(c)throw new Error(c.message);const l=KR(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!Fn(s,!0)){const{message:d}=Qe("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}js(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!Ds(r)){const{message:s}=Qe("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!bge(i)){const{message:s}=Qe("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Ds(r)){const{message:l}=Qe("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!ij(n)){const{message:l}=Qe("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=dge(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=A9(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(wd(o)){const{message:l}=Qe("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Ds(r)){const{message:c}=Qe("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=A9(i,"update()");if(o)throw new Error(o.message);const a=KR(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Ds(r)){const{message:i}=Qe("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(!Ds(r)){const{message:c}=Qe("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(!VR(a,s)){const{message:c}=Qe("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!xge(i)){const{message:c}=Qe("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!Age(a,s,i.method)){const{message:c}=Qe("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!Tge(o,k9)){const{message:c}=Qe("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${k9.min} and ${k9.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!Ds(r)){const{message:o}=Qe("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(!_ge(s)){const{message:o}=Qe("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Ds(r)){const{message:i}=Qe("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Ds(r)){const{message:a}=Qe("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(!VR(o,s)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!Cge(i)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!Ege(o,s,i.name)){const{message:a}=Qe("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Ds(r)){const{message:i}=Qe("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(!Fn(i,!1))throw new Error("uri is required parameter");if(!Fn(s,!1))throw new Error("domain is required parameter");if(!Fn(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Jm(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Jm(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||nw,validation:"UNKNOWN",origin:o.url||""}};try{if(a===Jr.link_mode){const d=this.getAppLinkIfEnabled(o,a);return c.verified.validation=d&&new URL(d).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(!Fn(i,!1)){const{message:s}=Qe("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}=Qe("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,o,a,c,l,d,h,g;return!r||n!==Jr.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)!==""&&((d=r==null?void 0:r.redirect)==null?void 0:d.universal)!==void 0&&((h=r==null?void 0:r.redirect)==null?void 0:h.universal)!==""&&((g=r==null?void 0:r.redirect)==null?void 0:g.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=cR(r,"topic")||"",i=decodeURIComponent(cR(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:Jr.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(typeof process<"u"&&Xve.IS_VITEST||wg()&&(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}=Qe("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(us.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(lb)?this.client.auth.authKeys.get(lb):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===Jr.link_mode?mm:Ld});try{ME(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:lu(n)})):p4(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(ra.expired,async e=>{const{topic:r,id:n}=pU(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Qe("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Qe("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(Mp.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Mp.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Fn(e,!1)){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(wd(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Qe("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Fn(e,!1)){const{message:r}=Qe("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}=Qe("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(wd(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Qe("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Qe("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(Fn(e,!1)){const{message:r}=Qe("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Qe("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!yge(e)){const{message:r}=Qe("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Qe("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(wd(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Qe("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class m2e extends M0{constructor(e,r){super(e,r,e2e,$E),this.core=e,this.logger=r}}class w2e extends M0{constructor(e,r){super(e,r,t2e,$E),this.core=e,this.logger=r}}class v2e extends M0{constructor(e,r){super(e,r,n2e,$E,n=>n.id),this.core=e,this.logger=r}}class y2e extends M0{constructor(e,r){super(e,r,a2e,m4,()=>lb),this.core=e,this.logger=r}}class b2e extends M0{constructor(e,r){super(e,r,c2e,m4),this.core=e,this.logger=r}}class x2e extends M0{constructor(e,r){super(e,r,l2e,m4,n=>n.id),this.core=e,this.logger=r}}class _2e{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new y2e(this.core,this.logger),this.pairingTopics=new b2e(this.core,this.logger),this.requests=new x2e(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let C2e=class Mj extends _ce{constructor(e){super(e),this.protocol=kj,this.version=Pj,this.name=T9.name,this.events=new _a.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)||T9.name,this.metadata=(e==null?void 0:e.metadata)||Ahe(),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:Xv(t2({level:(e==null?void 0:e.logger)||T9.logger}));this.core=(e==null?void 0:e.core)||new Jve(e),this.logger=ts(r,this.name),this.session=new w2e(this.core,this.logger),this.proposal=new m2e(this.core,this.logger),this.pendingRequest=new v2e(this.core,this.logger),this.engine=new g2e(this),this.auth=new _2e(this.core,this.logger)}static async init(e){const r=new Mj(e);return await r.initialize(),r}get context(){return Xs(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 B_={exports:{}};(function(t,e){var r=typeof self<"u"?self:Gi,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(m){return m&&DataView.prototype.isPrototypeOf(m)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(m){return m&&l.indexOf(Object.prototype.toString.call(m))>-1};function h(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(m))throw new TypeError("Invalid character in header field name");return m.toLowerCase()}function g(m){return typeof m!="string"&&(m=String(m)),m}function v(m){var w={next:function(){var A=m.shift();return{done:A===void 0,value:A}}};return a.iterable&&(w[Symbol.iterator]=function(){return w}),w}function x(m){this.map={},m instanceof x?m.forEach(function(w,A){this.append(A,w)},this):Array.isArray(m)?m.forEach(function(w){this.append(w[0],w[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(w){this.append(w,m[w])},this)}x.prototype.append=function(m,w){m=h(m),w=g(w);var A=this.map[m];this.map[m]=A?A+", "+w:w},x.prototype.delete=function(m){delete this.map[h(m)]},x.prototype.get=function(m){return m=h(m),this.has(m)?this.map[m]:null},x.prototype.has=function(m){return this.map.hasOwnProperty(h(m))},x.prototype.set=function(m,w){this.map[h(m)]=g(w)},x.prototype.forEach=function(m,w){for(var A in this.map)this.map.hasOwnProperty(A)&&m.call(w,this.map[A],A,this)},x.prototype.keys=function(){var m=[];return this.forEach(function(w,A){m.push(A)}),v(m)},x.prototype.values=function(){var m=[];return this.forEach(function(w){m.push(w)}),v(m)},x.prototype.entries=function(){var m=[];return this.forEach(function(w,A){m.push([A,w])}),v(m)},a.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function R(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function M(m){return new Promise(function(w,A){m.onload=function(){w(m.result)},m.onerror=function(){A(m.error)}})}function N(m){var w=new FileReader,A=M(w);return w.readAsArrayBuffer(m),A}function E(m){var w=new FileReader,A=M(w);return w.readAsText(m),A}function O(m){for(var w=new Uint8Array(m),A=new Array(w.length),P=0;P-1?w:m}function T(m,w){w=w||{};var A=w.body;if(m instanceof T){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,w.headers||(this.headers=new x(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!A&&m._bodyInit!=null&&(A=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new x(w.headers)),this.method=I(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&A)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(A)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function F(m){var w=new FormData;return m.trim().split("&").forEach(function(A){if(A){var P=A.split("="),S=P.shift().replace(/\+/g," "),k=P.join("=").replace(/\+/g," ");w.append(decodeURIComponent(S),decodeURIComponent(k))}}),w}function K(m){var w=new x,A=m.replace(/\r?\n[\t ]+/g," ");return A.split(/\r?\n/).forEach(function(P){var S=P.split(":"),k=S.shift().trim();if(k){var y=S.join(":").trim();w.append(k,y)}}),w}U.call(T.prototype);function B(m,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new x(w.headers),this.url=w.url||"",this._initBody(m)}U.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},B.error=function(){var m=new B(null,{status:0,statusText:""});return m.type="error",m};var _=[301,302,303,307,308];B.redirect=function(m,w){if(_.indexOf(w)===-1)throw new RangeError("Invalid status code");return new B(null,{status:w,headers:{location:m}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,A){this.message=w,this.name=A;var P=Error(w);this.stack=P.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function p(m,w){return new Promise(function(A,P){var S=new T(m,w);if(S.signal&&S.signal.aborted)return P(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function y(){k.abort()}k.onload=function(){var b={status:k.status,statusText:k.statusText,headers:K(k.getAllResponseHeaders()||"")};b.url="responseURL"in k?k.responseURL:b.headers.get("X-Request-URL");var V="response"in k?k.response:k.responseText;A(new B(V,b))},k.onerror=function(){P(new TypeError("Network request failed"))},k.ontimeout=function(){P(new TypeError("Network request failed"))},k.onabort=function(){P(new o.DOMException("Aborted","AbortError"))},k.open(S.method,S.url,!0),S.credentials==="include"?k.withCredentials=!0:S.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&a.blob&&(k.responseType="blob"),S.headers.forEach(function(b,V){k.setRequestHeader(V,b)}),S.signal&&(S.signal.addEventListener("abort",y),k.onreadystatechange=function(){k.readyState===4&&S.signal.removeEventListener("abort",y)}),k.send(typeof S._bodyInit>"u"?null:S._bodyInit)})}return p.polyfill=!0,s.fetch||(s.fetch=p,s.Headers=x,s.Request=T,s.Response=B),o.Headers=x,o.Request=T,o.Response=B,o.fetch=p,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})(B_,B_.exports);var A2e=B_.exports;const SN=_c(A2e);var E2e=Object.defineProperty,S2e=Object.defineProperties,I2e=Object.getOwnPropertyDescriptors,IN=Object.getOwnPropertySymbols,T2e=Object.prototype.hasOwnProperty,k2e=Object.prototype.propertyIsEnumerable,TN=(t,e,r)=>e in t?E2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kN=(t,e)=>{for(var r in e||(e={}))T2e.call(e,r)&&TN(t,r,e[r]);if(IN)for(var r of IN(e))k2e.call(e,r)&&TN(t,r,e[r]);return t},PN=(t,e)=>S2e(t,I2e(e));const P2e={Accept:"application/json","Content-Type":"application/json"},R2e="POST",RN={headers:P2e,method:R2e},NN=10;let $l=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new _a.EventEmitter,this.isAvailable=!1,this.registering=!1,!XR(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=Iu(e),n=await(await SN(this.url,PN(kN({},RN),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!XR(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=Iu({id:1,jsonrpc:"2.0",method:"test",params:[]});await SN(e,PN(kN({},RN),{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"?Bh(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=h4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return aj(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>NN&&this.events.setMaxListeners(NN)}};const MN="error",N2e="wss://relay.walletconnect.com",M2e="wc",O2e="universal_provider",ON=`${M2e}@2:${O2e}:`,$2e="https://rpc.walletconnect.com/v1/",gp="generic",Sc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},U_={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 -*/(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,d="__lodash_placeholder__",f=1,g=2,v=4,x=1,P=2,M=1,N=2,E=4,$=8,L=16,j=32,H=64,I=128,T=256,B=512,K=30,U="...",C=800,p=16,m=1,w=2,_=3,R=1/0,S=9007199254740991,k=17976931348623157e292,y=NaN,b=4294967295,V=b-1,ce=b>>>1,fe=[["ary",I],["bind",M],["bindKey",N],["curry",$],["curryRight",L],["flip",B],["partial",j],["partialRight",H],["rearg",T]],W="[object Arguments]",ue="[object Array]",J="[object AsyncFunction]",ne="[object Boolean]",ie="[object Date]",D="[object DOMException]",te="[object Error]",me="[object Function]",Ce="[object GeneratorFunction]",Ee="[object Map]",Re="[object Number]",He="[object Null]",Xe="[object Object]",kt="[object Promise]",rt="[object Proxy]",st="[object RegExp]",Ze="[object Set]",Be="[object String]",nt="[object Symbol]",lt="[object Undefined]",je="[object WeakMap]",at="[object WeakSet]",G="[object ArrayBuffer]",O="[object DataView]",z="[object Float32Array]",X="[object Float64Array]",ae="[object Int8Array]",he="[object Int16Array]",be="[object Int32Array]",Ne="[object Uint8Array]",Ve="[object Uint8ClampedArray]",dt="[object Uint16Array]",Ge="[object Uint32Array]",wt=/\b__p \+= '';/g,er=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yr=/&(?:amp|lt|gt|quot|#39);/g,_r=/[&<>"']/g,ft=RegExp(yr.source),$t=RegExp(_r.source),Ft=/<%-([\s\S]+?)%>/g,ht=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\w*$/,Qt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zt=/[\\^$.*+?()[\]{}|]/g,yt=RegExp(zt.source),Wt=/^\s+/,qt=/\s/,pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nt=/\{\n\/\* \[wrapped with (.+)\] \*/,Yt=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mr=/[()=,{}\[\]\/\s]/,$r=/\\(\\)?/g,Vt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ar=/\w*$/,Oi=/^[-+]0x[0-9a-f]+$/i,Di=/^0b[01]+$/i,Li=/^\[object .+?Constructor\]$/,Bi=/^0o[0-7]+$/i,Ui=/^(?:0|[1-9]\d*)$/,Pn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ks=/($^)/,ka=/['\n\r\u2028\u2029\\]/g,Rs="\\ud800-\\udfff",Ra="\\u0300-\\u036f",Pa="\\ufe20-\\ufe2f",Ps="\\u20d0-\\u20ff",Bo=Ra+Pa+Ps,Uo="\\u2700-\\u27bf",Yn="a-z\\xdf-\\xf6\\xf8-\\xff",Na="\\xac\\xb1\\xd7\\xf7",Ma="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$a="\\u2000-\\u206f",Uf=" \\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",H2="A-Z\\xc0-\\xd6\\xd8-\\xde",q2="\\ufe0e\\ufe0f",jf=Na+Ma+$a+Uf,$g="['’]",Ff="["+Rs+"]",Og="["+jf+"]",zf="["+Bo+"]",V2="\\d+",J4="["+Uo+"]",K2="["+Yn+"]",G2="[^"+Rs+jf+V2+Uo+Yn+H2+"]",W0="\\ud83c[\\udffb-\\udfff]",X4="(?:"+zf+"|"+W0+")",Z2="[^"+Rs+"]",H0="(?:\\ud83c[\\udde6-\\uddff]){2}",ed="[\\ud800-\\udbff][\\udc00-\\udfff]",ao="["+H2+"]",Q2="\\u200d",Y2="(?:"+K2+"|"+G2+")",Oc="(?:"+ao+"|"+G2+")",J2="(?:"+$g+"(?:d|ll|m|re|s|t|ve))?",X2="(?:"+$g+"(?:D|LL|M|RE|S|T|VE))?",e3=X4+"?",t3="["+q2+"]?",e8="(?:"+Q2+"(?:"+[Z2,H0,ed].join("|")+")"+t3+e3+")*",zl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",r3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",n3=t3+e3+e8,q0="(?:"+[J4,H0,ed].join("|")+")"+n3,t8="(?:"+[Z2+zf+"?",zf,H0,ed,Ff].join("|")+")",Dg=RegExp($g,"g"),r8=RegExp(zf,"g"),V0=RegExp(W0+"(?="+W0+")|"+t8+n3,"g"),i3=RegExp([ao+"?"+K2+"+"+J2+"(?="+[Og,ao,"$"].join("|")+")",Oc+"+"+X2+"(?="+[Og,ao+Y2,"$"].join("|")+")",ao+"?"+Y2+"+"+J2,ao+"+"+X2,r3,zl,V2,q0].join("|"),"g"),s3=RegExp("["+Q2+Rs+Bo+q2+"]"),Wf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,o3=["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"],n8=-1,Gr={};Gr[z]=Gr[X]=Gr[ae]=Gr[he]=Gr[be]=Gr[Ne]=Gr[Ve]=Gr[dt]=Gr[Ge]=!0,Gr[W]=Gr[ue]=Gr[G]=Gr[ne]=Gr[O]=Gr[ie]=Gr[te]=Gr[me]=Gr[Ee]=Gr[Re]=Gr[Xe]=Gr[st]=Gr[Ze]=Gr[Be]=Gr[je]=!1;var qr={};qr[W]=qr[ue]=qr[G]=qr[O]=qr[ne]=qr[ie]=qr[z]=qr[X]=qr[ae]=qr[he]=qr[be]=qr[Ee]=qr[Re]=qr[Xe]=qr[st]=qr[Ze]=qr[Be]=qr[nt]=qr[Ne]=qr[Ve]=qr[dt]=qr[Ge]=!0,qr[te]=qr[me]=qr[je]=!1;var oe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},we={"&":"&","<":"<",">":">",'"':""","'":"'"},De={"&":"&","<":"<",">":">",""":'"',"'":"'"},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zr=parseFloat,nr=parseInt,ln=typeof Am=="object"&&Am&&Am.Object===Object&&Am,Kn=typeof self=="object"&&self&&self.Object===Object&&self,kr=ln||Kn||Function("return this")(),Qr=e&&!e.nodeType&&e,Bn=Qr&&!0&&t&&!t.nodeType&&t,Ns=Bn&&Bn.exports===Qr,Gn=Ns&&ln.process,un=function(){try{var ve=Bn&&Bn.require&&Bn.require("util").types;return ve||Gn&&Gn.binding&&Gn.binding("util")}catch{}}(),ss=un&&un.isArrayBuffer,Oa=un&&un.isDate,jo=un&&un.isMap,Dc=un&&un.isRegExp,Lg=un&&un.isSet,Hf=un&&un.isTypedArray;function ai(ve,Pe,ke){switch(ke.length){case 0:return ve.call(Pe);case 1:return ve.call(Pe,ke[0]);case 2:return ve.call(Pe,ke[0],ke[1]);case 3:return ve.call(Pe,ke[0],ke[1],ke[2])}return ve.apply(Pe,ke)}function QW(ve,Pe,ke,xt){for(var tr=-1,Lr=ve==null?0:ve.length;++tr-1}function i8(ve,Pe,ke){for(var xt=-1,tr=ve==null?0:ve.length;++xt-1;);return ke}function VS(ve,Pe){for(var ke=ve.length;ke--&&K0(Pe,ve[ke],0)>-1;);return ke}function sH(ve,Pe){for(var ke=ve.length,xt=0;ke--;)ve[ke]===Pe&&++xt;return xt}var oH=c8(oe),aH=c8(we);function cH(ve){return"\\"+mt[ve]}function lH(ve,Pe){return ve==null?r:ve[Pe]}function G0(ve){return s3.test(ve)}function uH(ve){return Wf.test(ve)}function dH(ve){for(var Pe,ke=[];!(Pe=ve.next()).done;)ke.push(Pe.value);return ke}function f8(ve){var Pe=-1,ke=Array(ve.size);return ve.forEach(function(xt,tr){ke[++Pe]=[tr,xt]}),ke}function KS(ve,Pe){return function(ke){return ve(Pe(ke))}}function nd(ve,Pe){for(var ke=-1,xt=ve.length,tr=0,Lr=[];++ke-1}function JH(u,h){var A=this.__data__,F=A3(A,u);return F<0?(++this.size,A.push([u,h])):A[F][1]=h,this}Wl.prototype.clear=GH,Wl.prototype.delete=ZH,Wl.prototype.get=QH,Wl.prototype.has=YH,Wl.prototype.set=JH;function Hl(u){var h=-1,A=u==null?0:u.length;for(this.clear();++h=h?u:h)),u}function Ho(u,h,A,F,Z,re){var de,pe=h&f,xe=h&g,Me=h&v;if(A&&(de=Z?A(u,F,Z,re):A(u)),de!==r)return de;if(!Cn(u))return u;var $e=ir(u);if($e){if(de=rV(u),!pe)return Ms(u,de)}else{var Le=Fi(u),it=Le==me||Le==Ce;if(ld(u))return kI(u,pe);if(Le==Xe||Le==W||it&&!Z){if(de=xe||it?{}:GI(u),!pe)return xe?qq(u,pq(de,u)):Hq(u,sI(de,u))}else{if(!qr[Le])return Z?u:{};de=nV(u,Le,pe)}}re||(re=new La);var It=re.get(u);if(It)return It;re.set(u,de),_T(u)?u.forEach(function(Gt){de.add(Ho(Gt,h,A,Gt,u,re))}):xT(u)&&u.forEach(function(Gt,br){de.set(br,Ho(Gt,h,A,br,u,re))});var Kt=Me?xe?B8:L8:xe?Os:ci,hr=$e?r:Kt(u);return Fo(hr||u,function(Gt,br){hr&&(br=Gt,Gt=u[br]),Hg(de,br,Ho(Gt,h,A,br,u,re))}),de}function gq(u){var h=ci(u);return function(A){return oI(A,u,h)}}function oI(u,h,A){var F=A.length;if(u==null)return!F;for(u=Yr(u);F--;){var Z=A[F],re=h[Z],de=u[Z];if(de===r&&!(Z in u)||!re(de))return!1}return!0}function aI(u,h,A){if(typeof u!="function")throw new zo(o);return Yg(function(){u.apply(r,A)},h)}function qg(u,h,A,F){var Z=-1,re=a3,de=!0,pe=u.length,xe=[],Me=h.length;if(!pe)return xe;A&&(h=wn(h,co(A))),F?(re=i8,de=!1):h.length>=i&&(re=Bg,de=!1,h=new Kf(h));e:for(;++ZZ?0:Z+A),F=F===r||F>Z?Z:fr(F),F<0&&(F+=Z),F=A>F?0:ET(F);A0&&A(pe)?h>1?Ci(pe,h-1,A,F,Z):rd(Z,pe):F||(Z[Z.length]=pe)}return Z}var y8=OI(),uI=OI(!0);function Lc(u,h){return u&&y8(u,h,ci)}function b8(u,h){return u&&uI(u,h,ci)}function S3(u,h){return td(h,function(A){return Zl(u[A])})}function Zf(u,h){h=ad(h,u);for(var A=0,F=h.length;u!=null&&Ah}function vq(u,h){return u!=null&&Wr.call(u,h)}function yq(u,h){return u!=null&&h in Yr(u)}function bq(u,h,A){return u>=ji(h,A)&&u=120&&$e.length>=120)?new Kf(de&&$e):r}$e=u[0];var Le=-1,it=pe[0];e:for(;++Le-1;)pe!==u&&w3.call(pe,xe,1),w3.call(u,xe,1);return u}function xI(u,h){for(var A=u?h.length:0,F=A-1;A--;){var Z=h[A];if(A==F||Z!==re){var re=Z;Gl(Z)?w3.call(u,Z,1):R8(u,Z)}}return u}function I8(u,h){return u+b3(tI()*(h-u+1))}function Mq(u,h,A,F){for(var Z=-1,re=Xn(y3((h-u)/(A||1)),0),de=ke(re);re--;)de[F?re:++Z]=u,u+=A;return de}function T8(u,h){var A="";if(!u||h<1||h>S)return A;do h%2&&(A+=u),h=b3(h/2),h&&(u+=u);while(h);return A}function wr(u,h){return q8(YI(u,h,Ds),u+"")}function $q(u){return iI(sp(u))}function Oq(u,h){var A=sp(u);return L3(A,Gf(h,0,A.length))}function Gg(u,h,A,F){if(!Cn(u))return u;h=ad(h,u);for(var Z=-1,re=h.length,de=re-1,pe=u;pe!=null&&++ZZ?0:Z+h),A=A>Z?Z:A,A<0&&(A+=Z),Z=h>A?0:A-h>>>0,h>>>=0;for(var re=ke(Z);++F>>1,de=u[re];de!==null&&!uo(de)&&(A?de<=h:de=i){var Me=h?null:Zq(u);if(Me)return l3(Me);de=!1,Z=Bg,xe=new Kf}else xe=h?[]:pe;e:for(;++F=F?u:qo(u,h,A)}var TI=SH||function(u){return kr.clearTimeout(u)};function kI(u,h){if(h)return u.slice();var A=u.length,F=QS?QS(A):new u.constructor(A);return u.copy(F),F}function $8(u){var h=new u.constructor(u.byteLength);return new g3(h).set(new g3(u)),h}function jq(u,h){var A=h?$8(u.buffer):u.buffer;return new u.constructor(A,u.byteOffset,u.byteLength)}function Fq(u){var h=new u.constructor(u.source,ar.exec(u));return h.lastIndex=u.lastIndex,h}function zq(u){return Wg?Yr(Wg.call(u)):{}}function RI(u,h){var A=h?$8(u.buffer):u.buffer;return new u.constructor(A,u.byteOffset,u.length)}function PI(u,h){if(u!==h){var A=u!==r,F=u===null,Z=u===u,re=uo(u),de=h!==r,pe=h===null,xe=h===h,Me=uo(h);if(!pe&&!Me&&!re&&u>h||re&&de&&xe&&!pe&&!Me||F&&de&&xe||!A&&xe||!Z)return 1;if(!F&&!re&&!Me&&u=pe)return xe;var Me=A[F];return xe*(Me=="desc"?-1:1)}}return u.index-h.index}function NI(u,h,A,F){for(var Z=-1,re=u.length,de=A.length,pe=-1,xe=h.length,Me=Xn(re-de,0),$e=ke(xe+Me),Le=!F;++pe1?A[Z-1]:r,de=Z>2?A[2]:r;for(re=u.length>3&&typeof re=="function"?(Z--,re):r,de&&as(A[0],A[1],de)&&(re=Z<3?r:re,Z=1),h=Yr(h);++F-1?Z[re?h[de]:de]:r}}function BI(u){return Kl(function(h){var A=h.length,F=A,Z=Wo.prototype.thru;for(u&&h.reverse();F--;){var re=h[F];if(typeof re!="function")throw new zo(o);if(Z&&!de&&O3(re)=="wrapper")var de=new Wo([],!0)}for(F=de?F:A;++F1&&Rr.reverse(),$e&&xepe))return!1;var Me=re.get(u),$e=re.get(h);if(Me&&$e)return Me==h&&$e==u;var Le=-1,it=!0,It=A&P?new Kf:r;for(re.set(u,h),re.set(h,u);++Le1?"& ":"")+h[F],h=h.join(A>2?", ":" "),u.replace(pt,`{ -/* [wrapped with `+h+`] */ -`)}function sV(u){return ir(u)||Jf(u)||!!(XS&&u&&u[XS])}function Gl(u,h){var A=typeof u;return h=h??S,!!h&&(A=="number"||A!="symbol"&&Ui.test(u))&&u>-1&&u%1==0&&u0){if(++h>=C)return arguments[0]}else h=0;return u.apply(r,arguments)}}function L3(u,h){var A=-1,F=u.length,Z=F-1;for(h=h===r?F:h;++A1?u[h-1]:r;return A=typeof A=="function"?(u.pop(),A):r,lT(u,A)});function uT(u){var h=ee(u);return h.__chain__=!0,h}function mK(u,h){return h(u),u}function B3(u,h){return h(u)}var wK=Kl(function(u){var h=u.length,A=h?u[0]:0,F=this.__wrapped__,Z=function(re){return v8(re,u)};return h>1||this.__actions__.length||!(F instanceof Ar)||!Gl(A)?this.thru(Z):(F=F.slice(A,+A+(h?1:0)),F.__actions__.push({func:B3,args:[Z],thisArg:r}),new Wo(F,this.__chain__).thru(function(re){return h&&!re.length&&re.push(r),re}))});function vK(){return uT(this)}function yK(){return new Wo(this.value(),this.__chain__)}function bK(){this.__values__===r&&(this.__values__=AT(this.value()));var u=this.__index__>=this.__values__.length,h=u?r:this.__values__[this.__index__++];return{done:u,value:h}}function xK(){return this}function CK(u){for(var h,A=this;A instanceof _3;){var F=nT(A);F.__index__=0,F.__values__=r,h?Z.__wrapped__=F:h=F;var Z=F;A=A.__wrapped__}return Z.__wrapped__=u,h}function _K(){var u=this.__wrapped__;if(u instanceof Ar){var h=u;return this.__actions__.length&&(h=new Ar(this)),h=h.reverse(),h.__actions__.push({func:B3,args:[V8],thisArg:r}),new Wo(h,this.__chain__)}return this.thru(V8)}function AK(){return SI(this.__wrapped__,this.__actions__)}var EK=R3(function(u,h,A){Wr.call(u,A)?++u[A]:ql(u,A,1)});function SK(u,h,A){var F=ir(u)?US:mq;return A&&as(u,h,A)&&(h=r),F(u,Ht(h,3))}function IK(u,h){var A=ir(u)?td:lI;return A(u,Ht(h,3))}var TK=LI(iT),kK=LI(sT);function RK(u,h){return Ci(U3(u,h),1)}function PK(u,h){return Ci(U3(u,h),R)}function NK(u,h,A){return A=A===r?1:fr(A),Ci(U3(u,h),A)}function dT(u,h){var A=ir(u)?Fo:sd;return A(u,Ht(h,3))}function fT(u,h){var A=ir(u)?YW:cI;return A(u,Ht(h,3))}var MK=R3(function(u,h,A){Wr.call(u,A)?u[A].push(h):ql(u,A,[h])});function $K(u,h,A,F){u=$s(u)?u:sp(u),A=A&&!F?fr(A):0;var Z=u.length;return A<0&&(A=Xn(Z+A,0)),H3(u)?A<=Z&&u.indexOf(h,A)>-1:!!Z&&K0(u,h,A)>-1}var OK=wr(function(u,h,A){var F=-1,Z=typeof h=="function",re=$s(u)?ke(u.length):[];return sd(u,function(de){re[++F]=Z?ai(h,de,A):Vg(de,h,A)}),re}),DK=R3(function(u,h,A){ql(u,A,h)});function U3(u,h){var A=ir(u)?wn:gI;return A(u,Ht(h,3))}function LK(u,h,A,F){return u==null?[]:(ir(h)||(h=h==null?[]:[h]),A=F?r:A,ir(A)||(A=A==null?[]:[A]),yI(u,h,A))}var BK=R3(function(u,h,A){u[A?0:1].push(h)},function(){return[[],[]]});function UK(u,h,A){var F=ir(u)?s8:WS,Z=arguments.length<3;return F(u,Ht(h,4),A,Z,sd)}function jK(u,h,A){var F=ir(u)?JW:WS,Z=arguments.length<3;return F(u,Ht(h,4),A,Z,cI)}function FK(u,h){var A=ir(u)?td:lI;return A(u,z3(Ht(h,3)))}function zK(u){var h=ir(u)?iI:$q;return h(u)}function WK(u,h,A){(A?as(u,h,A):h===r)?h=1:h=fr(h);var F=ir(u)?dq:Oq;return F(u,h)}function HK(u){var h=ir(u)?fq:Lq;return h(u)}function qK(u){if(u==null)return 0;if($s(u))return H3(u)?Z0(u):u.length;var h=Fi(u);return h==Ee||h==Ze?u.size:A8(u).length}function VK(u,h,A){var F=ir(u)?o8:Bq;return A&&as(u,h,A)&&(h=r),F(u,Ht(h,3))}var KK=wr(function(u,h){if(u==null)return[];var A=h.length;return A>1&&as(u,h[0],h[1])?h=[]:A>2&&as(h[0],h[1],h[2])&&(h=[h[0]]),yI(u,Ci(h,1),[])}),j3=IH||function(){return kr.Date.now()};function GK(u,h){if(typeof h!="function")throw new zo(o);return u=fr(u),function(){if(--u<1)return h.apply(this,arguments)}}function hT(u,h,A){return h=A?r:h,h=u&&h==null?u.length:h,Vl(u,I,r,r,r,r,h)}function pT(u,h){var A;if(typeof h!="function")throw new zo(o);return u=fr(u),function(){return--u>0&&(A=h.apply(this,arguments)),u<=1&&(h=r),A}}var G8=wr(function(u,h,A){var F=M;if(A.length){var Z=nd(A,np(G8));F|=j}return Vl(u,F,h,A,Z)}),gT=wr(function(u,h,A){var F=M|N;if(A.length){var Z=nd(A,np(gT));F|=j}return Vl(h,F,u,A,Z)});function mT(u,h,A){h=A?r:h;var F=Vl(u,$,r,r,r,r,r,h);return F.placeholder=mT.placeholder,F}function wT(u,h,A){h=A?r:h;var F=Vl(u,L,r,r,r,r,r,h);return F.placeholder=wT.placeholder,F}function vT(u,h,A){var F,Z,re,de,pe,xe,Me=0,$e=!1,Le=!1,it=!0;if(typeof u!="function")throw new zo(o);h=Ko(h)||0,Cn(A)&&($e=!!A.leading,Le="maxWait"in A,re=Le?Xn(Ko(A.maxWait)||0,h):re,it="trailing"in A?!!A.trailing:it);function It(jn){var Ua=F,Yl=Z;return F=Z=r,Me=jn,de=u.apply(Yl,Ua),de}function Kt(jn){return Me=jn,pe=Yg(br,h),$e?It(jn):de}function hr(jn){var Ua=jn-xe,Yl=jn-Me,LT=h-Ua;return Le?ji(LT,re-Yl):LT}function Gt(jn){var Ua=jn-xe,Yl=jn-Me;return xe===r||Ua>=h||Ua<0||Le&&Yl>=re}function br(){var jn=j3();if(Gt(jn))return Rr(jn);pe=Yg(br,hr(jn))}function Rr(jn){return pe=r,it&&F?It(jn):(F=Z=r,de)}function fo(){pe!==r&&TI(pe),Me=0,F=xe=Z=pe=r}function cs(){return pe===r?de:Rr(j3())}function ho(){var jn=j3(),Ua=Gt(jn);if(F=arguments,Z=this,xe=jn,Ua){if(pe===r)return Kt(xe);if(Le)return TI(pe),pe=Yg(br,h),It(xe)}return pe===r&&(pe=Yg(br,h)),de}return ho.cancel=fo,ho.flush=cs,ho}var ZK=wr(function(u,h){return aI(u,1,h)}),QK=wr(function(u,h,A){return aI(u,Ko(h)||0,A)});function YK(u){return Vl(u,B)}function F3(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new zo(o);var A=function(){var F=arguments,Z=h?h.apply(this,F):F[0],re=A.cache;if(re.has(Z))return re.get(Z);var de=u.apply(this,F);return A.cache=re.set(Z,de)||re,de};return A.cache=new(F3.Cache||Hl),A}F3.Cache=Hl;function z3(u){if(typeof u!="function")throw new zo(o);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function JK(u){return pT(2,u)}var XK=Uq(function(u,h){h=h.length==1&&ir(h[0])?wn(h[0],co(Ht())):wn(Ci(h,1),co(Ht()));var A=h.length;return wr(function(F){for(var Z=-1,re=ji(F.length,A);++Z=h}),Jf=fI(function(){return arguments}())?fI:function(u){return Nn(u)&&Wr.call(u,"callee")&&!JS.call(u,"callee")},ir=ke.isArray,pG=ss?co(ss):Cq;function $s(u){return u!=null&&W3(u.length)&&!Zl(u)}function Un(u){return Nn(u)&&$s(u)}function gG(u){return u===!0||u===!1||Nn(u)&&os(u)==ne}var ld=kH||ox,mG=Oa?co(Oa):_q;function wG(u){return Nn(u)&&u.nodeType===1&&!Jg(u)}function vG(u){if(u==null)return!0;if($s(u)&&(ir(u)||typeof u=="string"||typeof u.splice=="function"||ld(u)||ip(u)||Jf(u)))return!u.length;var h=Fi(u);if(h==Ee||h==Ze)return!u.size;if(Qg(u))return!A8(u).length;for(var A in u)if(Wr.call(u,A))return!1;return!0}function yG(u,h){return Kg(u,h)}function bG(u,h,A){A=typeof A=="function"?A:r;var F=A?A(u,h):r;return F===r?Kg(u,h,r,A):!!F}function Q8(u){if(!Nn(u))return!1;var h=os(u);return h==te||h==D||typeof u.message=="string"&&typeof u.name=="string"&&!Jg(u)}function xG(u){return typeof u=="number"&&eI(u)}function Zl(u){if(!Cn(u))return!1;var h=os(u);return h==me||h==Ce||h==J||h==rt}function bT(u){return typeof u=="number"&&u==fr(u)}function W3(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=S}function Cn(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function Nn(u){return u!=null&&typeof u=="object"}var xT=jo?co(jo):Eq;function CG(u,h){return u===h||_8(u,h,j8(h))}function _G(u,h,A){return A=typeof A=="function"?A:r,_8(u,h,j8(h),A)}function AG(u){return CT(u)&&u!=+u}function EG(u){if(cV(u))throw new tr(s);return hI(u)}function SG(u){return u===null}function IG(u){return u==null}function CT(u){return typeof u=="number"||Nn(u)&&os(u)==Re}function Jg(u){if(!Nn(u)||os(u)!=Xe)return!1;var h=m3(u);if(h===null)return!0;var A=Wr.call(h,"constructor")&&h.constructor;return typeof A=="function"&&A instanceof A&&f3.call(A)==_H}var Y8=Dc?co(Dc):Sq;function TG(u){return bT(u)&&u>=-S&&u<=S}var _T=Lg?co(Lg):Iq;function H3(u){return typeof u=="string"||!ir(u)&&Nn(u)&&os(u)==Be}function uo(u){return typeof u=="symbol"||Nn(u)&&os(u)==nt}var ip=Hf?co(Hf):Tq;function kG(u){return u===r}function RG(u){return Nn(u)&&Fi(u)==je}function PG(u){return Nn(u)&&os(u)==at}var NG=$3(E8),MG=$3(function(u,h){return u<=h});function AT(u){if(!u)return[];if($s(u))return H3(u)?Da(u):Ms(u);if(Ug&&u[Ug])return dH(u[Ug]());var h=Fi(u),A=h==Ee?f8:h==Ze?l3:sp;return A(u)}function Ql(u){if(!u)return u===0?u:0;if(u=Ko(u),u===R||u===-R){var h=u<0?-1:1;return h*k}return u===u?u:0}function fr(u){var h=Ql(u),A=h%1;return h===h?A?h-A:h:0}function ET(u){return u?Gf(fr(u),0,b):0}function Ko(u){if(typeof u=="number")return u;if(uo(u))return y;if(Cn(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=Cn(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=HS(u);var A=Di.test(u);return A||Bi.test(u)?nr(u.slice(2),A?2:8):Oi.test(u)?y:+u}function ST(u){return Bc(u,Os(u))}function $G(u){return u?Gf(fr(u),-S,S):u===0?u:0}function jr(u){return u==null?"":lo(u)}var OG=tp(function(u,h){if(Qg(h)||$s(h)){Bc(h,ci(h),u);return}for(var A in h)Wr.call(h,A)&&Hg(u,A,h[A])}),IT=tp(function(u,h){Bc(h,Os(h),u)}),q3=tp(function(u,h,A,F){Bc(h,Os(h),u,F)}),DG=tp(function(u,h,A,F){Bc(h,ci(h),u,F)}),LG=Kl(v8);function BG(u,h){var A=ep(u);return h==null?A:sI(A,h)}var UG=wr(function(u,h){u=Yr(u);var A=-1,F=h.length,Z=F>2?h[2]:r;for(Z&&as(h[0],h[1],Z)&&(F=1);++A1),re}),Bc(u,B8(u),A),F&&(A=Ho(A,f|g|v,Qq));for(var Z=h.length;Z--;)R8(A,h[Z]);return A});function nZ(u,h){return kT(u,z3(Ht(h)))}var iZ=Kl(function(u,h){return u==null?{}:Pq(u,h)});function kT(u,h){if(u==null)return{};var A=wn(B8(u),function(F){return[F]});return h=Ht(h),bI(u,A,function(F,Z){return h(F,Z[0])})}function sZ(u,h,A){h=ad(h,u);var F=-1,Z=h.length;for(Z||(Z=1,u=r);++Fh){var F=u;u=h,h=F}if(A||u%1||h%1){var Z=tI();return ji(u+Z*(h-u+Zr("1e-"+((Z+"").length-1))),h)}return I8(u,h)}var mZ=rp(function(u,h,A){return h=h.toLowerCase(),u+(A?NT(h):h)});function NT(u){return ex(jr(u).toLowerCase())}function MT(u){return u=jr(u),u&&u.replace(Pn,oH).replace(r8,"")}function wZ(u,h,A){u=jr(u),h=lo(h);var F=u.length;A=A===r?F:Gf(fr(A),0,F);var Z=A;return A-=h.length,A>=0&&u.slice(A,Z)==h}function vZ(u){return u=jr(u),u&&$t.test(u)?u.replace(_r,aH):u}function yZ(u){return u=jr(u),u&&yt.test(u)?u.replace(zt,"\\$&"):u}var bZ=rp(function(u,h,A){return u+(A?"-":"")+h.toLowerCase()}),xZ=rp(function(u,h,A){return u+(A?" ":"")+h.toLowerCase()}),CZ=DI("toLowerCase");function _Z(u,h,A){u=jr(u),h=fr(h);var F=h?Z0(u):0;if(!h||F>=h)return u;var Z=(h-F)/2;return M3(b3(Z),A)+u+M3(y3(Z),A)}function AZ(u,h,A){u=jr(u),h=fr(h);var F=h?Z0(u):0;return h&&F>>0,A?(u=jr(u),u&&(typeof h=="string"||h!=null&&!Y8(h))&&(h=lo(h),!h&&G0(u))?cd(Da(u),0,A):u.split(h,A)):[]}var PZ=rp(function(u,h,A){return u+(A?" ":"")+ex(h)});function NZ(u,h,A){return u=jr(u),A=A==null?0:Gf(fr(A),0,u.length),h=lo(h),u.slice(A,A+h.length)==h}function MZ(u,h,A){var F=ee.templateSettings;A&&as(u,h,A)&&(h=r),u=jr(u),h=q3({},h,F,WI);var Z=q3({},h.imports,F.imports,WI),re=ci(Z),de=d8(Z,re),pe,xe,Me=0,$e=h.interpolate||ks,Le="__p += '",it=h8((h.escape||ks).source+"|"+$e.source+"|"+($e===Bt?Vt:ks).source+"|"+(h.evaluate||ks).source+"|$","g"),It="//# sourceURL="+(Wr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++n8+"]")+` -`;u.replace(it,function(Gt,br,Rr,fo,cs,ho){return Rr||(Rr=fo),Le+=u.slice(Me,ho).replace(ka,cH),br&&(pe=!0,Le+=`' + +*/(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,d="__lodash_placeholder__",h=1,g=2,v=4,x=1,R=2,M=1,N=2,E=4,O=8,L=16,U=32,H=64,I=128,T=256,F=512,K=30,B="...",_=800,p=16,m=1,w=2,A=3,P=1/0,S=9007199254740991,k=17976931348623157e292,y=NaN,b=4294967295,V=b-1,ce=b>>>1,de=[["ary",I],["bind",M],["bindKey",N],["curry",O],["curryRight",L],["flip",F],["partial",U],["partialRight",H],["rearg",T]],W="[object Arguments]",le="[object Array]",Y="[object AsyncFunction]",re="[object Boolean]",ne="[object Date]",D="[object DOMException]",ee="[object Error]",ge="[object Function]",xe="[object GeneratorFunction]",Ae="[object Map]",ke="[object Number]",He="[object Null]",Je="[object Object]",kt="[object Promise]",tt="[object Proxy]",st="[object RegExp]",Ze="[object Set]",Le="[object String]",rt="[object Symbol]",lt="[object Undefined]",Ue="[object WeakMap]",at="[object WeakSet]",G="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",J="[object Float64Array]",oe="[object Int8Array]",fe="[object Int16Array]",ye="[object Int32Array]",Re="[object Uint8Array]",Ve="[object Uint8ClampedArray]",dt="[object Uint16Array]",Ge="[object Uint32Array]",wt=/\b__p \+= '';/g,er=/\b(__p \+=) '' \+/g,Rt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yr=/&(?:amp|lt|gt|quot|#39);/g,Cr=/[&<>"']/g,ft=RegExp(yr.source),Ot=RegExp(Cr.source),Ft=/<%-([\s\S]+?)%>/g,ht=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,$t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\w*$/,Qt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zt=/[\\^$.*+?()[\]{}|]/g,yt=RegExp(zt.source),Wt=/^\s+/,qt=/\s/,pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nt=/\{\n\/\* \[wrapped with (.+)\] \*/,Yt=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mr=/[()=,{}\[\]\/\s]/,Or=/\\(\\)?/g,Vt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ar=/\w*$/,Mi=/^[-+]0x[0-9a-f]+$/i,Oi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,Di=/^0o[0-7]+$/i,Li=/^(?:0|[1-9]\d*)$/,kn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,As=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,Es="\\ud800-\\udfff",Ia="\\u0300-\\u036f",Ta="\\ufe20-\\ufe2f",Ss="\\u20d0-\\u20ff",$o=Ia+Ta+Ss,Do="\\u2700-\\u27bf",Qn="a-z\\xdf-\\xf6\\xf8-\\xff",ka="\\xac\\xb1\\xd7\\xf7",Pa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ra="\\u2000-\\u206f",Lf=" \\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",F2="A-Z\\xc0-\\xd6\\xd8-\\xde",z2="\\ufe0e\\ufe0f",Bf=ka+Pa+Ra+Lf,Ng="['’]",Uf="["+Es+"]",Mg="["+Bf+"]",jf="["+$o+"]",W2="\\d+",q4="["+Do+"]",H2="["+Qn+"]",q2="[^"+Es+Bf+W2+Do+Qn+F2+"]",F0="\\ud83c[\\udffb-\\udfff]",V4="(?:"+jf+"|"+F0+")",V2="[^"+Es+"]",z0="(?:\\ud83c[\\udde6-\\uddff]){2}",Yu="[\\ud800-\\udbff][\\udc00-\\udfff]",ro="["+F2+"]",K2="\\u200d",G2="(?:"+H2+"|"+q2+")",Nc="(?:"+ro+"|"+q2+")",Z2="(?:"+Ng+"(?:d|ll|m|re|s|t|ve))?",Q2="(?:"+Ng+"(?:D|LL|M|RE|S|T|VE))?",Y2=V4+"?",J2="["+z2+"]?",K4="(?:"+K2+"(?:"+[V2,z0,Yu].join("|")+")"+J2+Y2+")*",Ul="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",X2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",e3=J2+Y2+K4,W0="(?:"+[q4,z0,Yu].join("|")+")"+e3,G4="(?:"+[V2+jf+"?",jf,z0,Yu,Uf].join("|")+")",Og=RegExp(Ng,"g"),Z4=RegExp(jf,"g"),H0=RegExp(F0+"(?="+F0+")|"+G4+e3,"g"),t3=RegExp([ro+"?"+H2+"+"+Z2+"(?="+[Mg,ro,"$"].join("|")+")",Nc+"+"+Q2+"(?="+[Mg,ro+G2,"$"].join("|")+")",ro+"?"+G2+"+"+Z2,ro+"+"+Q2,X2,Ul,W2,W0].join("|"),"g"),r3=RegExp("["+K2+Es+$o+z2+"]"),Ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,n3=["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"],Q4=-1,Gr={};Gr[z]=Gr[J]=Gr[oe]=Gr[fe]=Gr[ye]=Gr[Re]=Gr[Ve]=Gr[dt]=Gr[Ge]=!0,Gr[W]=Gr[le]=Gr[G]=Gr[re]=Gr[$]=Gr[ne]=Gr[ee]=Gr[ge]=Gr[Ae]=Gr[ke]=Gr[Je]=Gr[st]=Gr[Ze]=Gr[Le]=Gr[Ue]=!1;var qr={};qr[W]=qr[le]=qr[G]=qr[$]=qr[re]=qr[ne]=qr[z]=qr[J]=qr[oe]=qr[fe]=qr[ye]=qr[Ae]=qr[ke]=qr[Je]=qr[st]=qr[Ze]=qr[Le]=qr[rt]=qr[Re]=qr[Ve]=qr[dt]=qr[Ge]=!0,qr[ee]=qr[ge]=qr[Ue]=!1;var se={À:"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"},me={"&":"&","<":"<",">":">",'"':""","'":"'"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'"},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zr=parseFloat,nr=parseInt,cn=typeof _m=="object"&&_m&&_m.Object===Object&&_m,qn=typeof self=="object"&&self&&self.Object===Object&&self,kr=cn||qn||Function("return this")(),Qr=e&&!e.nodeType&&e,Dn=Qr&&!0&&t&&!t.nodeType&&t,Is=Dn&&Dn.exports===Qr,Vn=Is&&cn.process,ln=function(){try{var we=Dn&&Dn.require&&Dn.require("util").types;return we||Vn&&Vn.binding&&Vn.binding("util")}catch{}}(),rs=ln&&ln.isArrayBuffer,Na=ln&&ln.isDate,Lo=ln&&ln.isMap,Mc=ln&&ln.isRegExp,$g=ln&&ln.isSet,zf=ln&&ln.isTypedArray;function oi(we,Pe,Te){switch(Te.length){case 0:return we.call(Pe);case 1:return we.call(Pe,Te[0]);case 2:return we.call(Pe,Te[0],Te[1]);case 3:return we.call(Pe,Te[0],Te[1],Te[2])}return we.apply(Pe,Te)}function TW(we,Pe,Te,xt){for(var tr=-1,Lr=we==null?0:we.length;++tr-1}function Y4(we,Pe,Te){for(var xt=-1,tr=we==null?0:we.length;++xt-1;);return Te}function MS(we,Pe){for(var Te=we.length;Te--&&q0(Pe,we[Te],0)>-1;);return Te}function LW(we,Pe){for(var Te=we.length,xt=0;Te--;)we[Te]===Pe&&++xt;return xt}var BW=t8(se),UW=t8(me);function jW(we){return"\\"+mt[we]}function FW(we,Pe){return we==null?r:we[Pe]}function V0(we){return r3.test(we)}function zW(we){return Ff.test(we)}function WW(we){for(var Pe,Te=[];!(Pe=we.next()).done;)Te.push(Pe.value);return Te}function s8(we){var Pe=-1,Te=Array(we.size);return we.forEach(function(xt,tr){Te[++Pe]=[tr,xt]}),Te}function OS(we,Pe){return function(Te){return we(Pe(Te))}}function ed(we,Pe){for(var Te=-1,xt=we.length,tr=0,Lr=[];++Te-1}function PH(u,f){var C=this.__data__,j=x3(C,u);return j<0?(++this.size,C.push([u,f])):C[j][1]=f,this}jl.prototype.clear=SH,jl.prototype.delete=IH,jl.prototype.get=TH,jl.prototype.has=kH,jl.prototype.set=PH;function Fl(u){var f=-1,C=u==null?0:u.length;for(this.clear();++f=f?u:f)),u}function Fo(u,f,C,j,Z,te){var ue,he=f&h,be=f&g,Ne=f&v;if(C&&(ue=Z?C(u,j,Z,te):C(u)),ue!==r)return ue;if(!bn(u))return u;var Me=ir(u);if(Me){if(ue=Oq(u),!he)return Ts(u,ue)}else{var De=Ui(u),nt=De==ge||De==xe;if(od(u))return mI(u,he);if(De==Je||De==W||nt&&!Z){if(ue=be||nt?{}:$I(u),!he)return be?Cq(u,VH(ue,u)):_q(u,VS(ue,u))}else{if(!qr[De])return Z?u:{};ue=$q(u,De,he)}}te||(te=new Oa);var It=te.get(u);if(It)return It;te.set(u,ue),uT(u)?u.forEach(function(Gt){ue.add(Fo(Gt,f,C,Gt,u,te))}):cT(u)&&u.forEach(function(Gt,br){ue.set(br,Fo(Gt,f,C,br,u,te))});var Kt=Ne?be?R8:P8:be?Ps:ai,hr=Me?r:Kt(u);return Bo(hr||u,function(Gt,br){hr&&(br=Gt,Gt=u[br]),zg(ue,br,Fo(Gt,f,C,br,u,te))}),ue}function KH(u){var f=ai(u);return function(C){return KS(C,u,f)}}function KS(u,f,C){var j=C.length;if(u==null)return!j;for(u=Yr(u);j--;){var Z=C[j],te=f[Z],ue=u[Z];if(ue===r&&!(Z in u)||!te(ue))return!1}return!0}function GS(u,f,C){if(typeof u!="function")throw new Uo(o);return Zg(function(){u.apply(r,C)},f)}function Wg(u,f,C,j){var Z=-1,te=i3,ue=!0,he=u.length,be=[],Ne=f.length;if(!he)return be;C&&(f=gn(f,no(C))),j?(te=Y4,ue=!1):f.length>=i&&(te=Dg,ue=!1,f=new qf(f));e:for(;++ZZ?0:Z+C),j=j===r||j>Z?Z:fr(j),j<0&&(j+=Z),j=C>j?0:fT(j);C0&&C(he)?f>1?xi(he,f-1,C,j,Z):Xu(Z,he):j||(Z[Z.length]=he)}return Z}var f8=_I(),YS=_I(!0);function Oc(u,f){return u&&f8(u,f,ai)}function h8(u,f){return u&&YS(u,f,ai)}function C3(u,f){return Ju(f,function(C){return Vl(u[C])})}function Kf(u,f){f=id(f,u);for(var C=0,j=f.length;u!=null&&Cf}function QH(u,f){return u!=null&&Wr.call(u,f)}function YH(u,f){return u!=null&&f in Yr(u)}function JH(u,f,C){return u>=Bi(f,C)&&u=120&&Me.length>=120)?new qf(ue&&Me):r}Me=u[0];var De=-1,nt=he[0];e:for(;++De-1;)he!==u&&p3.call(he,be,1),p3.call(u,be,1);return u}function cI(u,f){for(var C=u?f.length:0,j=C-1;C--;){var Z=f[C];if(C==j||Z!==te){var te=Z;ql(Z)?p3.call(u,Z,1):C8(u,Z)}}return u}function b8(u,f){return u+w3(zS()*(f-u+1))}function dq(u,f,C,j){for(var Z=-1,te=Jn(m3((f-u)/(C||1)),0),ue=Te(te);te--;)ue[j?te:++Z]=u,u+=C;return ue}function x8(u,f){var C="";if(!u||f<1||f>S)return C;do f%2&&(C+=u),f=w3(f/2),f&&(u+=u);while(f);return C}function wr(u,f){return B8(BI(u,f,Rs),u+"")}function fq(u){return qS(np(u))}function hq(u,f){var C=np(u);return O3(C,Vf(f,0,C.length))}function Vg(u,f,C,j){if(!bn(u))return u;f=id(f,u);for(var Z=-1,te=f.length,ue=te-1,he=u;he!=null&&++ZZ?0:Z+f),C=C>Z?Z:C,C<0&&(C+=Z),Z=f>C?0:C-f>>>0,f>>>=0;for(var te=Te(Z);++j>>1,ue=u[te];ue!==null&&!so(ue)&&(C?ue<=f:ue=i){var Ne=f?null:Iq(u);if(Ne)return o3(Ne);ue=!1,Z=Dg,be=new qf}else be=f?[]:he;e:for(;++j=j?u:zo(u,f,C)}var gI=iH||function(u){return kr.clearTimeout(u)};function mI(u,f){if(f)return u.slice();var C=u.length,j=LS?LS(C):new u.constructor(C);return u.copy(j),j}function I8(u){var f=new u.constructor(u.byteLength);return new f3(f).set(new f3(u)),f}function vq(u,f){var C=f?I8(u.buffer):u.buffer;return new u.constructor(C,u.byteOffset,u.byteLength)}function yq(u){var f=new u.constructor(u.source,ar.exec(u));return f.lastIndex=u.lastIndex,f}function bq(u){return Fg?Yr(Fg.call(u)):{}}function wI(u,f){var C=f?I8(u.buffer):u.buffer;return new u.constructor(C,u.byteOffset,u.length)}function vI(u,f){if(u!==f){var C=u!==r,j=u===null,Z=u===u,te=so(u),ue=f!==r,he=f===null,be=f===f,Ne=so(f);if(!he&&!Ne&&!te&&u>f||te&&ue&&be&&!he&&!Ne||j&&ue&&be||!C&&be||!Z)return 1;if(!j&&!te&&!Ne&&u=he)return be;var Ne=C[j];return be*(Ne=="desc"?-1:1)}}return u.index-f.index}function yI(u,f,C,j){for(var Z=-1,te=u.length,ue=C.length,he=-1,be=f.length,Ne=Jn(te-ue,0),Me=Te(be+Ne),De=!j;++he1?C[Z-1]:r,ue=Z>2?C[2]:r;for(te=u.length>3&&typeof te=="function"?(Z--,te):r,ue&&is(C[0],C[1],ue)&&(te=Z<3?r:te,Z=1),f=Yr(f);++j-1?Z[te?f[ue]:ue]:r}}function EI(u){return Hl(function(f){var C=f.length,j=C,Z=jo.prototype.thru;for(u&&f.reverse();j--;){var te=f[j];if(typeof te!="function")throw new Uo(o);if(Z&&!ue&&N3(te)=="wrapper")var ue=new jo([],!0)}for(j=ue?j:C;++j1&&Pr.reverse(),Me&&behe))return!1;var Ne=te.get(u),Me=te.get(f);if(Ne&&Me)return Ne==f&&Me==u;var De=-1,nt=!0,It=C&R?new qf:r;for(te.set(u,f),te.set(f,u);++De1?"& ":"")+f[j],f=f.join(C>2?", ":" "),u.replace(pt,`{ +/* [wrapped with `+f+`] */ +`)}function Lq(u){return ir(u)||Qf(u)||!!(jS&&u&&u[jS])}function ql(u,f){var C=typeof u;return f=f??S,!!f&&(C=="number"||C!="symbol"&&Li.test(u))&&u>-1&&u%1==0&&u0){if(++f>=_)return arguments[0]}else f=0;return u.apply(r,arguments)}}function O3(u,f){var C=-1,j=u.length,Z=j-1;for(f=f===r?j:f;++C1?u[f-1]:r;return C=typeof C=="function"?(u.pop(),C):r,QI(u,C)});function YI(u){var f=X(u);return f.__chain__=!0,f}function GV(u,f){return f(u),u}function $3(u,f){return f(u)}var ZV=Hl(function(u){var f=u.length,C=f?u[0]:0,j=this.__wrapped__,Z=function(te){return d8(te,u)};return f>1||this.__actions__.length||!(j instanceof Ar)||!ql(C)?this.thru(Z):(j=j.slice(C,+C+(f?1:0)),j.__actions__.push({func:$3,args:[Z],thisArg:r}),new jo(j,this.__chain__).thru(function(te){return f&&!te.length&&te.push(r),te}))});function QV(){return YI(this)}function YV(){return new jo(this.value(),this.__chain__)}function JV(){this.__values__===r&&(this.__values__=dT(this.value()));var u=this.__index__>=this.__values__.length,f=u?r:this.__values__[this.__index__++];return{done:u,value:f}}function XV(){return this}function eK(u){for(var f,C=this;C instanceof b3;){var j=HI(C);j.__index__=0,j.__values__=r,f?Z.__wrapped__=j:f=j;var Z=j;C=C.__wrapped__}return Z.__wrapped__=u,f}function tK(){var u=this.__wrapped__;if(u instanceof Ar){var f=u;return this.__actions__.length&&(f=new Ar(this)),f=f.reverse(),f.__actions__.push({func:$3,args:[U8],thisArg:r}),new jo(f,this.__chain__)}return this.thru(U8)}function rK(){return hI(this.__wrapped__,this.__actions__)}var nK=I3(function(u,f,C){Wr.call(u,C)?++u[C]:zl(u,C,1)});function iK(u,f,C){var j=ir(u)?SS:GH;return C&&is(u,f,C)&&(f=r),j(u,Ht(f,3))}function sK(u,f){var C=ir(u)?Ju:QS;return C(u,Ht(f,3))}var oK=AI(qI),aK=AI(VI);function cK(u,f){return xi(D3(u,f),1)}function lK(u,f){return xi(D3(u,f),P)}function uK(u,f,C){return C=C===r?1:fr(C),xi(D3(u,f),C)}function JI(u,f){var C=ir(u)?Bo:rd;return C(u,Ht(f,3))}function XI(u,f){var C=ir(u)?kW:ZS;return C(u,Ht(f,3))}var dK=I3(function(u,f,C){Wr.call(u,C)?u[C].push(f):zl(u,C,[f])});function fK(u,f,C,j){u=ks(u)?u:np(u),C=C&&!j?fr(C):0;var Z=u.length;return C<0&&(C=Jn(Z+C,0)),F3(u)?C<=Z&&u.indexOf(f,C)>-1:!!Z&&q0(u,f,C)>-1}var hK=wr(function(u,f,C){var j=-1,Z=typeof f=="function",te=ks(u)?Te(u.length):[];return rd(u,function(ue){te[++j]=Z?oi(f,ue,C):Hg(ue,f,C)}),te}),pK=I3(function(u,f,C){zl(u,C,f)});function D3(u,f){var C=ir(u)?gn:rI;return C(u,Ht(f,3))}function gK(u,f,C,j){return u==null?[]:(ir(f)||(f=f==null?[]:[f]),C=j?r:C,ir(C)||(C=C==null?[]:[C]),oI(u,f,C))}var mK=I3(function(u,f,C){u[C?0:1].push(f)},function(){return[[],[]]});function wK(u,f,C){var j=ir(u)?J4:PS,Z=arguments.length<3;return j(u,Ht(f,4),C,Z,rd)}function vK(u,f,C){var j=ir(u)?PW:PS,Z=arguments.length<3;return j(u,Ht(f,4),C,Z,ZS)}function yK(u,f){var C=ir(u)?Ju:QS;return C(u,U3(Ht(f,3)))}function bK(u){var f=ir(u)?qS:fq;return f(u)}function xK(u,f,C){(C?is(u,f,C):f===r)?f=1:f=fr(f);var j=ir(u)?WH:hq;return j(u,f)}function _K(u){var f=ir(u)?HH:gq;return f(u)}function CK(u){if(u==null)return 0;if(ks(u))return F3(u)?K0(u):u.length;var f=Ui(u);return f==Ae||f==Ze?u.size:w8(u).length}function AK(u,f,C){var j=ir(u)?X4:mq;return C&&is(u,f,C)&&(f=r),j(u,Ht(f,3))}var EK=wr(function(u,f){if(u==null)return[];var C=f.length;return C>1&&is(u,f[0],f[1])?f=[]:C>2&&is(f[0],f[1],f[2])&&(f=[f[0]]),oI(u,xi(f,1),[])}),L3=sH||function(){return kr.Date.now()};function SK(u,f){if(typeof f!="function")throw new Uo(o);return u=fr(u),function(){if(--u<1)return f.apply(this,arguments)}}function eT(u,f,C){return f=C?r:f,f=u&&f==null?u.length:f,Wl(u,I,r,r,r,r,f)}function tT(u,f){var C;if(typeof f!="function")throw new Uo(o);return u=fr(u),function(){return--u>0&&(C=f.apply(this,arguments)),u<=1&&(f=r),C}}var F8=wr(function(u,f,C){var j=M;if(C.length){var Z=ed(C,tp(F8));j|=U}return Wl(u,j,f,C,Z)}),rT=wr(function(u,f,C){var j=M|N;if(C.length){var Z=ed(C,tp(rT));j|=U}return Wl(f,j,u,C,Z)});function nT(u,f,C){f=C?r:f;var j=Wl(u,O,r,r,r,r,r,f);return j.placeholder=nT.placeholder,j}function iT(u,f,C){f=C?r:f;var j=Wl(u,L,r,r,r,r,r,f);return j.placeholder=iT.placeholder,j}function sT(u,f,C){var j,Z,te,ue,he,be,Ne=0,Me=!1,De=!1,nt=!0;if(typeof u!="function")throw new Uo(o);f=Ho(f)||0,bn(C)&&(Me=!!C.leading,De="maxWait"in C,te=De?Jn(Ho(C.maxWait)||0,f):te,nt="trailing"in C?!!C.trailing:nt);function It(Bn){var Da=j,Gl=Z;return j=Z=r,Ne=Bn,ue=u.apply(Gl,Da),ue}function Kt(Bn){return Ne=Bn,he=Zg(br,f),Me?It(Bn):ue}function hr(Bn){var Da=Bn-be,Gl=Bn-Ne,AT=f-Da;return De?Bi(AT,te-Gl):AT}function Gt(Bn){var Da=Bn-be,Gl=Bn-Ne;return be===r||Da>=f||Da<0||De&&Gl>=te}function br(){var Bn=L3();if(Gt(Bn))return Pr(Bn);he=Zg(br,hr(Bn))}function Pr(Bn){return he=r,nt&&j?It(Bn):(j=Z=r,ue)}function oo(){he!==r&&gI(he),Ne=0,j=be=Z=he=r}function ss(){return he===r?ue:Pr(L3())}function ao(){var Bn=L3(),Da=Gt(Bn);if(j=arguments,Z=this,be=Bn,Da){if(he===r)return Kt(be);if(De)return gI(he),he=Zg(br,f),It(be)}return he===r&&(he=Zg(br,f)),ue}return ao.cancel=oo,ao.flush=ss,ao}var IK=wr(function(u,f){return GS(u,1,f)}),TK=wr(function(u,f,C){return GS(u,Ho(f)||0,C)});function kK(u){return Wl(u,F)}function B3(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new Uo(o);var C=function(){var j=arguments,Z=f?f.apply(this,j):j[0],te=C.cache;if(te.has(Z))return te.get(Z);var ue=u.apply(this,j);return C.cache=te.set(Z,ue)||te,ue};return C.cache=new(B3.Cache||Fl),C}B3.Cache=Fl;function U3(u){if(typeof u!="function")throw new Uo(o);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function PK(u){return tT(2,u)}var RK=wq(function(u,f){f=f.length==1&&ir(f[0])?gn(f[0],no(Ht())):gn(xi(f,1),no(Ht()));var C=f.length;return wr(function(j){for(var Z=-1,te=Bi(j.length,C);++Z=f}),Qf=XS(function(){return arguments}())?XS:function(u){return Pn(u)&&Wr.call(u,"callee")&&!US.call(u,"callee")},ir=Te.isArray,VK=rs?no(rs):eq;function ks(u){return u!=null&&j3(u.length)&&!Vl(u)}function Ln(u){return Pn(u)&&ks(u)}function KK(u){return u===!0||u===!1||Pn(u)&&ns(u)==re}var od=aH||X8,GK=Na?no(Na):tq;function ZK(u){return Pn(u)&&u.nodeType===1&&!Qg(u)}function QK(u){if(u==null)return!0;if(ks(u)&&(ir(u)||typeof u=="string"||typeof u.splice=="function"||od(u)||rp(u)||Qf(u)))return!u.length;var f=Ui(u);if(f==Ae||f==Ze)return!u.size;if(Gg(u))return!w8(u).length;for(var C in u)if(Wr.call(u,C))return!1;return!0}function YK(u,f){return qg(u,f)}function JK(u,f,C){C=typeof C=="function"?C:r;var j=C?C(u,f):r;return j===r?qg(u,f,r,C):!!j}function W8(u){if(!Pn(u))return!1;var f=ns(u);return f==ee||f==D||typeof u.message=="string"&&typeof u.name=="string"&&!Qg(u)}function XK(u){return typeof u=="number"&&FS(u)}function Vl(u){if(!bn(u))return!1;var f=ns(u);return f==ge||f==xe||f==Y||f==tt}function aT(u){return typeof u=="number"&&u==fr(u)}function j3(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=S}function bn(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function Pn(u){return u!=null&&typeof u=="object"}var cT=Lo?no(Lo):nq;function eG(u,f){return u===f||m8(u,f,M8(f))}function tG(u,f,C){return C=typeof C=="function"?C:r,m8(u,f,M8(f),C)}function rG(u){return lT(u)&&u!=+u}function nG(u){if(jq(u))throw new tr(s);return eI(u)}function iG(u){return u===null}function sG(u){return u==null}function lT(u){return typeof u=="number"||Pn(u)&&ns(u)==ke}function Qg(u){if(!Pn(u)||ns(u)!=Je)return!1;var f=h3(u);if(f===null)return!0;var C=Wr.call(f,"constructor")&&f.constructor;return typeof C=="function"&&C instanceof C&&l3.call(C)==tH}var H8=Mc?no(Mc):iq;function oG(u){return aT(u)&&u>=-S&&u<=S}var uT=$g?no($g):sq;function F3(u){return typeof u=="string"||!ir(u)&&Pn(u)&&ns(u)==Le}function so(u){return typeof u=="symbol"||Pn(u)&&ns(u)==rt}var rp=zf?no(zf):oq;function aG(u){return u===r}function cG(u){return Pn(u)&&Ui(u)==Ue}function lG(u){return Pn(u)&&ns(u)==at}var uG=R3(v8),dG=R3(function(u,f){return u<=f});function dT(u){if(!u)return[];if(ks(u))return F3(u)?Ma(u):Ts(u);if(Lg&&u[Lg])return WW(u[Lg]());var f=Ui(u),C=f==Ae?s8:f==Ze?o3:np;return C(u)}function Kl(u){if(!u)return u===0?u:0;if(u=Ho(u),u===P||u===-P){var f=u<0?-1:1;return f*k}return u===u?u:0}function fr(u){var f=Kl(u),C=f%1;return f===f?C?f-C:f:0}function fT(u){return u?Vf(fr(u),0,b):0}function Ho(u){if(typeof u=="number")return u;if(so(u))return y;if(bn(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=bn(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=RS(u);var C=Oi.test(u);return C||Di.test(u)?nr(u.slice(2),C?2:8):Mi.test(u)?y:+u}function hT(u){return $c(u,Ps(u))}function fG(u){return u?Vf(fr(u),-S,S):u===0?u:0}function jr(u){return u==null?"":io(u)}var hG=X0(function(u,f){if(Gg(f)||ks(f)){$c(f,ai(f),u);return}for(var C in f)Wr.call(f,C)&&zg(u,C,f[C])}),pT=X0(function(u,f){$c(f,Ps(f),u)}),z3=X0(function(u,f,C,j){$c(f,Ps(f),u,j)}),pG=X0(function(u,f,C,j){$c(f,ai(f),u,j)}),gG=Hl(d8);function mG(u,f){var C=J0(u);return f==null?C:VS(C,f)}var wG=wr(function(u,f){u=Yr(u);var C=-1,j=f.length,Z=j>2?f[2]:r;for(Z&&is(f[0],f[1],Z)&&(j=1);++C1),te}),$c(u,R8(u),C),j&&(C=Fo(C,h|g|v,Tq));for(var Z=f.length;Z--;)C8(C,f[Z]);return C});function $G(u,f){return mT(u,U3(Ht(f)))}var DG=Hl(function(u,f){return u==null?{}:lq(u,f)});function mT(u,f){if(u==null)return{};var C=gn(R8(u),function(j){return[j]});return f=Ht(f),aI(u,C,function(j,Z){return f(j,Z[0])})}function LG(u,f,C){f=id(f,u);var j=-1,Z=f.length;for(Z||(Z=1,u=r);++jf){var j=u;u=f,f=j}if(C||u%1||f%1){var Z=zS();return Bi(u+Z*(f-u+Zr("1e-"+((Z+"").length-1))),f)}return b8(u,f)}var GG=ep(function(u,f,C){return f=f.toLowerCase(),u+(C?yT(f):f)});function yT(u){return K8(jr(u).toLowerCase())}function bT(u){return u=jr(u),u&&u.replace(kn,BW).replace(Z4,"")}function ZG(u,f,C){u=jr(u),f=io(f);var j=u.length;C=C===r?j:Vf(fr(C),0,j);var Z=C;return C-=f.length,C>=0&&u.slice(C,Z)==f}function QG(u){return u=jr(u),u&&Ot.test(u)?u.replace(Cr,UW):u}function YG(u){return u=jr(u),u&&yt.test(u)?u.replace(zt,"\\$&"):u}var JG=ep(function(u,f,C){return u+(C?"-":"")+f.toLowerCase()}),XG=ep(function(u,f,C){return u+(C?" ":"")+f.toLowerCase()}),eZ=CI("toLowerCase");function tZ(u,f,C){u=jr(u),f=fr(f);var j=f?K0(u):0;if(!f||j>=f)return u;var Z=(f-j)/2;return P3(w3(Z),C)+u+P3(m3(Z),C)}function rZ(u,f,C){u=jr(u),f=fr(f);var j=f?K0(u):0;return f&&j>>0,C?(u=jr(u),u&&(typeof f=="string"||f!=null&&!H8(f))&&(f=io(f),!f&&V0(u))?sd(Ma(u),0,C):u.split(f,C)):[]}var lZ=ep(function(u,f,C){return u+(C?" ":"")+K8(f)});function uZ(u,f,C){return u=jr(u),C=C==null?0:Vf(fr(C),0,u.length),f=io(f),u.slice(C,C+f.length)==f}function dZ(u,f,C){var j=X.templateSettings;C&&is(u,f,C)&&(f=r),u=jr(u),f=z3({},f,j,PI);var Z=z3({},f.imports,j.imports,PI),te=ai(Z),ue=i8(Z,te),he,be,Ne=0,Me=f.interpolate||As,De="__p += '",nt=o8((f.escape||As).source+"|"+Me.source+"|"+(Me===Bt?Vt:As).source+"|"+(f.evaluate||As).source+"|$","g"),It="//# sourceURL="+(Wr.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Q4+"]")+` +`;u.replace(nt,function(Gt,br,Pr,oo,ss,ao){return Pr||(Pr=oo),De+=u.slice(Ne,ao).replace(Sa,jW),br&&(he=!0,De+=`' + __e(`+br+`) + -'`),cs&&(xe=!0,Le+=`'; -`+cs+`; -__p += '`),Rr&&(Le+=`' + -((__t = (`+Rr+`)) == null ? '' : __t) + -'`),Me=ho+Gt.length,Gt}),Le+=`'; -`;var Kt=Wr.call(h,"variable")&&h.variable;if(!Kt)Le=`with (obj) { -`+Le+` +'`),ss&&(be=!0,De+=`'; +`+ss+`; +__p += '`),Pr&&(De+=`' + +((__t = (`+Pr+`)) == null ? '' : __t) + +'`),Ne=ao+Gt.length,Gt}),De+=`'; +`;var Kt=Wr.call(f,"variable")&&f.variable;if(!Kt)De=`with (obj) { +`+De+` } -`;else if(Mr.test(Kt))throw new tr(a);Le=(xe?Le.replace(wt,""):Le).replace(er,"$1").replace(Pt,"$1;"),Le="function("+(Kt||"obj")+`) { +`;else if(Mr.test(Kt))throw new tr(a);De=(be?De.replace(wt,""):De).replace(er,"$1").replace(Rt,"$1;"),De="function("+(Kt||"obj")+`) { `+(Kt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(pe?", __e = _.escape":"")+(xe?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(he?", __e = _.escape":"")+(be?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; -`)+Le+`return __p -}`;var hr=OT(function(){return Lr(re,It+"return "+Le).apply(r,de)});if(hr.source=Le,Q8(hr))throw hr;return hr}function $Z(u){return jr(u).toLowerCase()}function OZ(u){return jr(u).toUpperCase()}function DZ(u,h,A){if(u=jr(u),u&&(A||h===r))return HS(u);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=Da(h),re=qS(F,Z),de=VS(F,Z)+1;return cd(F,re,de).join("")}function LZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.slice(0,GS(u)+1);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=VS(F,Da(h))+1;return cd(F,0,Z).join("")}function BZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.replace(Wt,"");if(!u||!(h=lo(h)))return u;var F=Da(u),Z=qS(F,Da(h));return cd(F,Z).join("")}function UZ(u,h){var A=K,F=U;if(Cn(h)){var Z="separator"in h?h.separator:Z;A="length"in h?fr(h.length):A,F="omission"in h?lo(h.omission):F}u=jr(u);var re=u.length;if(G0(u)){var de=Da(u);re=de.length}if(A>=re)return u;var pe=A-Z0(F);if(pe<1)return F;var xe=de?cd(de,0,pe).join(""):u.slice(0,pe);if(Z===r)return xe+F;if(de&&(pe+=xe.length-pe),Y8(Z)){if(u.slice(pe).search(Z)){var Me,$e=xe;for(Z.global||(Z=h8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Me=Z.exec($e);)var Le=Me.index;xe=xe.slice(0,Le===r?pe:Le)}}else if(u.indexOf(lo(Z),pe)!=pe){var it=xe.lastIndexOf(Z);it>-1&&(xe=xe.slice(0,it))}return xe+F}function jZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,gH):u}var FZ=rp(function(u,h,A){return u+(A?" ":"")+h.toUpperCase()}),ex=DI("toUpperCase");function $T(u,h,A){return u=jr(u),h=A?r:h,h===r?uH(u)?vH(u):tH(u):u.match(h)||[]}var OT=wr(function(u,h){try{return ai(u,r,h)}catch(A){return Q8(A)?A:new tr(A)}}),zZ=Kl(function(u,h){return Fo(h,function(A){A=Uc(A),ql(u,A,G8(u[A],u))}),u});function WZ(u){var h=u==null?0:u.length,A=Ht();return u=h?wn(u,function(F){if(typeof F[1]!="function")throw new zo(o);return[A(F[0]),F[1]]}):[],wr(function(F){for(var Z=-1;++ZS)return[];var A=b,F=ji(u,b);h=Ht(h),u-=b;for(var Z=u8(F,h);++A0||h<0)?new Ar(A):(u<0?A=A.takeRight(-u):u&&(A=A.drop(u)),h!==r&&(h=fr(h),A=h<0?A.dropRight(-h):A.take(h-u)),A)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},Lc(Ar.prototype,function(u,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),F=/^(?:head|last)$/.test(h),Z=ee[F?"take"+(h=="last"?"Right":""):h],re=F||/^find/.test(h);Z&&(ee.prototype[h]=function(){var de=this.__wrapped__,pe=F?[1]:arguments,xe=de instanceof Ar,Me=pe[0],$e=xe||ir(de),Le=function(br){var Rr=Z.apply(ee,rd([br],pe));return F&&it?Rr[0]:Rr};$e&&A&&typeof Me=="function"&&Me.length!=1&&(xe=$e=!1);var it=this.__chain__,It=!!this.__actions__.length,Kt=re&&!it,hr=xe&&!It;if(!re&&$e){de=hr?de:new Ar(this);var Gt=u.apply(de,pe);return Gt.__actions__.push({func:B3,args:[Le],thisArg:r}),new Wo(Gt,it)}return Kt&&hr?u.apply(this,pe):(Gt=this.thru(Le),Kt?F?Gt.value()[0]:Gt.value():Gt)})}),Fo(["pop","push","shift","sort","splice","unshift"],function(u){var h=u3[u],A=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",F=/^(?:pop|shift)$/.test(u);ee.prototype[u]=function(){var Z=arguments;if(F&&!this.__chain__){var re=this.value();return h.apply(ir(re)?re:[],Z)}return this[A](function(de){return h.apply(ir(de)?de:[],Z)})}}),Lc(Ar.prototype,function(u,h){var A=ee[h];if(A){var F=A.name+"";Wr.call(X0,F)||(X0[F]=[]),X0[F].push({name:h,func:A})}}),X0[P3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=jH,Ar.prototype.reverse=FH,Ar.prototype.value=zH,ee.prototype.at=wK,ee.prototype.chain=vK,ee.prototype.commit=yK,ee.prototype.next=bK,ee.prototype.plant=CK,ee.prototype.reverse=_K,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=AK,ee.prototype.first=ee.prototype.head,Ug&&(ee.prototype[Ug]=xK),ee},Q0=yH();Bn?((Bn.exports=Q0)._=Q0,Qr._=Q0):kr._=Q0}).call(Am)})(KC,KC.exports);var n3e=Object.defineProperty,i3e=Object.defineProperties,s3e=Object.getOwnPropertyDescriptors,GN=Object.getOwnPropertySymbols,o3e=Object.prototype.hasOwnProperty,a3e=Object.prototype.propertyIsEnumerable,ZN=(t,e,r)=>e in t?n3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ty=(t,e)=>{for(var r in e||(e={}))o3e.call(e,r)&&ZN(t,r,e[r]);if(GN)for(var r of GN(e))a3e.call(e,r)&&ZN(t,r,e[r]);return t},c3e=(t,e)=>i3e(t,s3e(e));function yc(t,e,r){var n;const i=ew(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${r3e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function L0(t){return t.includes(":")?t.split(":")[1]:t}function Qj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function l3e(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 L9(t={},e={}){const r=QN(t),n=QN(e);return KC.exports.merge(r,n)}function QN(t){var e,r,n,i;const s={};if(!pv(t))return s;for(const[o,a]of Object.entries(t)){const c=FE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],f=a.rpcMap||{},g=Dm(o);s[g]=c3e(Ty(Ty({},s[g]),a),{chains:cb(c,(e=s[g])==null?void 0:e.chains),methods:cb(l,(r=s[g])==null?void 0:r.methods),events:cb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ty(Ty({},f),(i=s[g])==null?void 0:i.rpcMap)})}return s}function u3e(t){return t.includes(":")?t.split(":")[2]:t}function YN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=FE(r)?[r]:n.chains?n.chains:Qj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function B9(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 Yj={},zr=t=>Yj[t],U9=(t,e)=>{Yj[t]=e};class d3e{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(kc.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=L0(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var f3e=Object.defineProperty,h3e=Object.defineProperties,p3e=Object.getOwnPropertyDescriptors,JN=Object.getOwnPropertySymbols,g3e=Object.prototype.hasOwnProperty,m3e=Object.prototype.propertyIsEnumerable,XN=(t,e,r)=>e in t?f3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eM=(t,e)=>{for(var r in e||(e={}))g3e.call(e,r)&&XN(t,r,e[r]);if(JN)for(var r of JN(e))m3e.call(e,r)&&XN(t,r,e[r]);return t},tM=(t,e)=>h3e(t,p3e(e));class w3e{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)}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(kc.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||yc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(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(L0(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:tM(eM({},o.sessionProperties||{}),{capabilities:tM(eM({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class v3e{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(kc.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=L0(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class y3e{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(kc.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=L0(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class b3e{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||yc(`${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(kc.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||yc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class x3e{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(kc.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=L0(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 Tc(new Bl(n,zr("disableProviderPing")))}}class C3e{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(kc.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=L0(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class _3e{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(kc.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=L0(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class A3e{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||yc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kc.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||yc(e,this.namespace);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class E3e{constructor(e){this.name=wp,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(kc.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=ew(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||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var S3e=Object.defineProperty,I3e=Object.defineProperties,T3e=Object.getOwnPropertyDescriptors,rM=Object.getOwnPropertySymbols,k3e=Object.prototype.hasOwnProperty,R3e=Object.prototype.propertyIsEnumerable,nM=(t,e,r)=>e in t?S3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ky=(t,e)=>{for(var r in e||(e={}))k3e.call(e,r)&&nM(t,r,e[r]);if(rM)for(var r of rM(e))R3e.call(e,r)&&nM(t,r,e[r]);return t},j9=(t,e)=>I3e(t,T3e(e));class KE{constructor(e){this.events=new yE,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:t2(n2({level:(e==null?void 0:e.logger)||VN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new KE(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:ky({},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,y4(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:Vr("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=YN(this.session.namespaces);this.namespaces=L9(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=YN(s.namespaces);this.namespaces=L9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Gj)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===wp?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(e0(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 H2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||VN,relayUrl:this.providerOpts.relayUrl||X2e,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=>Dm(r)))];U9("client",this.client),U9("events",this.events),U9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=l3e(r,this.session),i=Qj(n),s=L9(this.namespaces,this.optionalNamespaces),o=j9(ky({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new w3e({namespace:o});break;case"algorand":this.rpcProviders[r]=new b3e({namespace:o});break;case"solana":this.rpcProviders[r]=new v3e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new y3e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new d3e({namespace:o});break;case"cip34":this.rpcProviders[r]=new x3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new C3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new _3e({namespace:o});break;case"near":this.rpcProviders[r]=new A3e({namespace:o});break;default:this.rpcProviders[wp]?this.rpcProviders[wp].updateNamespace(o):this.rpcProviders[wp]=new E3e({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&&e0(i)&&this.events.emit("accountsChanged",i.map(u3e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Dm(i),a=B9(i)!==B9(s)?`${o}:${B9(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=j9(ky({},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",j9(ky({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[wp]}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=>Dm(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=Dm(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(`${KN}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${KN}/${e}`)}}const Jj={getMethodsByChainNamespace(t){switch(t){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_switchEthereumChain"];default:return[]}},createNamespaces(t){return t.reduce((e,r)=>{const{chainId:n,chainNamespace:i,rpcUrl:s}=r,o=this.getMethodsByChainNamespace(i);e[i]||(e[i]={methods:o,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const a=`${i}:${n}`,c=e[i];return c.chains.push(a),c!=null&&c.rpcMap&&(c.rpcMap[n]=s),e},{})}},ta=Rn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),z1={state:ta,subscribeKey(t,e){return Ts(ta,t,e)},subscribeProviders(t){return bs(ta.providers,()=>t(ta.providers))},setProvider(t,e){e&&(ta.providers[t]=sc(e))},getProvider(t){return ta.providers[t]},setProviderId(t,e){e&&(ta.providerIds[t]=e)},getProviderId(t){return ta.providerIds[t]},reset(){ta.providers={eip155:void 0,solana:void 0,polkadot:void 0},ta.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){ta.providers[t]=void 0,ta.providerIds[t]=void 0}},P3e=["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"];class N3e{constructor(e){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.defaultNetwork=void 0,this.options=void 0,this.adapterType="universal";const{siweConfig:r,metadata:n}=e;this.caipNetworks=e.networks,this.chainNamespace="eip155",this.metadata=n,this.defaultNetwork=e.defaultNetwork||e.networks[0],this.networkControllerClient={switchCaipNetwork:i=>{if(i)try{this.switchNetwork(i)}catch{throw new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>(await this.getWalletConnectProvider(),new Promise(i=>{var c,l;const s=(l=(c=this.walletConnectProvider)==null?void 0:c.session)==null?void 0:l.namespaces,o=[];s&&Object.keys(s).forEach(d=>{var g;const f=(g=s==null?void 0:s[d])==null?void 0:g.chains;f&&o.push(...f)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,f,g,v,x,P,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),ge.state.activeChain&&((c=(a=(o=ge.state)==null?void 0:o.chains)==null?void 0:a.get(ge.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=ge.state.chains.get(ge.state.activeChain);await((d=(l=N==null?void 0:N.connectionControllerClient)==null?void 0:l.connectWalletConnect)==null?void 0:d.call(l,i)),this.setWalletConnectProvider()}else{const N=await((f=r==null?void 0:r.getMessageParams)==null?void 0:f.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,$=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&$&&L){const{SIWEController:j,getDidChainId:H,getDidAddress:I}=await Qs(async()=>{const{SIWEController:U,getDidChainId:C,getDidAddress:p}=await import("./index-BpiWtdP0.js");return{SIWEController:U,getDidChainId:C,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(U=>U.chainNamespace==="eip155").map(U=>U.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(U=>U.chainNamespace==="eip155").map(U=>U.chainId);const B=await s.authenticate({nonce:await((P=r==null?void 0:r.getNonce)==null?void 0:P.call(r)),methods:[...P3e],...N,chains:T}),K=(M=B==null?void 0:B.auths)==null?void 0:M[0];if(K){const{p:U,s:C}=K,p=H(U.iss),m=I(U.iss);m&&p&&j.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:U,iss:U.iss});await j.verifyMessage({message:w,signature:C.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await j.signOut().catch(console.error),w}}}else{const j=Jj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:j})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(sn.removeItem(nn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Qs(async()=>{const{SIWEController:l}=await import("./index-BpiWtdP0.js");return{SIWEController:l}},[]);await c.signOut()}await((s=this.walletConnectProvider)==null?void 0:s.disconnect()),(o=this.appKit)==null||o.resetAccount("eip155"),(a=this.appKit)==null||a.resetAccount("solana")},signMessage:async i=>{const s=await this.getWalletConnectProvider(),o=ge.state.activeCaipAddress,a=Ue.getPlainAddress(o);if(!s)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await s.request({method:"personal_sign",params:[i,a]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async i=>await Promise.resolve(i),getEnsAddress:async i=>await Promise.resolve(i),writeContract:async()=>await Promise.resolve("0x"),sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(e,r){if(!r.projectId)throw new Error("Solana:construct - projectId is undefined");this.appKit=e,this.options=r,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(e){e&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(e.id)}async disconnect(){var e,r;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(e=this.appKit)==null||e.resetAccount("eip155"),(r=this.appKit)==null||r.resetAccount("solana"))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var e,r;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((e=this.options)!=null&&e.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((r=this.options)==null?void 0:r.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(e){const r={projectId:e,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await KE.init(r),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(e){[...new Set(e.map(n=>n.chainNamespace))].filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async checkActiveWalletConnectProvider(){const e=await this.getWalletConnectProvider(),r=sn.getItem(nn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;sn.setItem(nn.WALLET_ID,cr.WALLET_CONNECT_CONNECTOR_ID);const e=(n=(r=this.walletConnectProvider)==null?void 0:r.session)==null?void 0:n.namespaces;if(e){Object.keys(e).reverse().forEach(a=>{var l,d;const c=(l=e==null?void 0:e[a])==null?void 0:l.accounts[0];z1.setProvider(a,this.walletConnectProvider),z1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=ge.state.activeCaipNetwork;try{s?Zt.setActiveCaipNetwork(s):o?(i=Zt.state.approvedCaipNetworkIds)!=null&&i.includes(o.id)||this.setDefaultNetwork(e):this.setDefaultNetwork(e)}catch(a){console.warn(">>> Error setting active caip network",a)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(e){var n,i;const r=(n=this.caipNetworks[0])==null?void 0:n.chainNamespace;if(r){const s=e==null?void 0:e[r];if(s!=null&&s.chains){const o=s.chains[0];if(o){const a=(i=Zt.state)==null?void 0:i.requestedCaipNetworks;if(a){const c=a.find(l=>l.id===o);c&&Zt.setActiveCaipNetwork(c)}}}}}async watchWalletConnect(){var o;const e=await this.getWalletConnectProvider(),r=((o=e==null?void 0:e.session)==null?void 0:o.namespaces)||{};function n(){Object.keys(r).forEach(a=>{Se.resetAccount(a)}),Lt.resetWcConnection(),sn.removeItem(nn.WALLET_ID),e==null||e.removeListener("disconnect",n),e==null||e.removeListener("accountsChanged",i)}const i=a=>{a.length>0&&this.syncAccount()},s=a=>{var d,f,g;const c=this.caipNetworks.find(v=>v.chainId==a),l=(d=this.appKit)==null?void 0:d.getCaipNetwork();if(!c){Zt.setActiveCaipNetwork({chainId:Number(a),id:`eip155:${a}`,name:"Unknown Network",currency:"",explorerUrl:"",rpcUrl:"",chainNamespace:((f=this.appKit)==null?void 0:f.getActiveChainNamespace())||"eip155"});return}(!l||(l==null?void 0:l.id)!==(c==null?void 0:c.id))&&((g=this.appKit)==null||g.setCaipNetwork(c))};e&&(e.on("disconnect",n),e.on("accountsChanged",i),e.on("chainChanged",s))}getProviderData(){var i,s,o,a;const e=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{},r=((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1,n=((a=this.appKit)==null?void 0:a.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:e,namespaceKeys:e?Object.keys(e):[],isConnected:r,preferredAccountType:n}}syncAccount(){var s,o,a,c;const{namespaceKeys:e,namespaces:r}=this.getProviderData(),n=(s=this.appKit)==null?void 0:s.getPreferredAccountType();((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1?e.forEach(async l=>{var v,x,P,M,N;const d=l,f=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((P=this.appKit)==null||P.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(f,d),this.syncConnectedWalletInfo(),await Promise.all([(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(d)])),this.syncAccounts()}):((a=this.appKit)==null||a.resetWcConnection(),(c=this.appKit)==null||c.resetNetwork(),this.syncAccounts(!0))}syncAccounts(e=!1){const{namespaces:r}=this.getProviderData();Object.keys(r).forEach(i=>{var o,a,c,l;const s=(a=(o=r==null?void 0:r[i])==null?void 0:o.accounts)==null?void 0:a.map(d=>{const[,,f]=d.split(":");return f}).filter((d,f,g)=>g.indexOf(d)===f);e&&((c=this.appKit)==null||c.setAllAccounts([],i)),s&&((l=this.appKit)==null||l.setAllAccounts(s.map(d=>({address:d,type:"eoa"})),i))})}syncConnectedWalletInfo(){var i,s;const e=sn.getItem(nn.WALLET_ID),r=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{};Object.keys(r).forEach(o=>{var a,c,l,d,f;(a=this.walletConnectProvider)!=null&&a.session?(l=this.appKit)==null||l.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(c=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:c[0]},o):e&&((d=this.appKit)==null||d.setConnectedWalletInfo({name:e},"eip155"),(f=this.appKit)==null||f.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ha.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ha.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ha.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let iM=!1;class M3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Se.setStatus(n,i)},this.getIsConnectedState=()=>!!ge.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Se.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Se.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Se.removeAddressLabel(n,i)},this.getCaipAddress=n=>ge.state.activeChain===n||!n?ge.state.activeCaipAddress:ge.getAccountProp("caipAddress",n),this.getAddress=n=>ge.state.activeChain===n||!n?Se.state.address:ge.getAccountProp("address",n),this.getProvider=()=>Se.state.provider,this.getPreferredAccountType=()=>Se.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Se.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Se.setProvider(n,i)},this.setBalance=(n,i,s)=>{Se.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Se.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Se.setProfileImage(n,i)},this.resetAccount=n=>{Se.resetAccount(n)},this.setCaipNetwork=n=>{ge.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:ge.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>ge.state.activeChain,this.setRequestedCaipNetworks=(n,i)=>{Zt.setRequestedCaipNetworks(n,i)},this.getApprovedCaipNetworkIds=()=>Zt.getApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=n=>Zt.setApprovedCaipNetworksData(n),this.resetNetwork=()=>{Zt.resetNetwork()},this.setConnectors=n=>{const i=[...ut.getConnectors(),...n];ut.setConnectors(i)},this.addConnector=n=>{ut.addConnector(n)},this.getConnectors=()=>ut.getConnectors(),this.resetWcConnection=()=>{Lt.resetWcConnection()},this.fetchIdentity=n=>bn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Se.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Se.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Se.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Se.setPreferredAccountType(n,i)},this.getReownName=n=>Kc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await Kc.resolveName(n);return((o=(Object.values(i==null?void 0:i.addresses)||[])[0])==null?void 0:o.address)||!1},this.setEIP6963Enabled=n=>{qe.setEIP6963Enabled(n)},this.setClientId=n=>{bn.setClientId(n)},this.getConnectorImage=n=>Sr.getConnectorImage(n),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(r=e.adapters)==null?void 0:r[0],this.initControllers(e),this.initOrContinue()}static getInstance(){return this.instance}async open(e){await this.initOrContinue(),jt.open(e)}async close(){await this.initOrContinue(),jt.close()}setLoading(e){jt.setLoading(e)}getError(){return""}getChainId(){var e;return(e=ge.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return ge.state.activeChain?z1.state.providers[ge.state.activeChain]:null}getWalletProviderType(){return ge.state.activeChain?z1.state.providerIds[ge.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return vn.state.themeMode}getThemeVariables(){return vn.state.themeVariables}setThemeMode(e){vn.setThemeMode(e),BL(vn.state.themeMode)}setThemeVariables(e){vn.setThemeVariables(e),Qre(vn.state.themeVariables)}subscribeTheme(e){return vn.subscribe(e)}getWalletInfo(){return Se.state.connectedWalletInfo}subscribeWalletInfo(e){return Se.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Se.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return vu.state}subscribeState(e){return vu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ae.replace(e)}redirect(e){Ae.push(e)}popTransactionStack(e){Ae.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ae.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ae.state.transactionStack[Ae.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){var n;if(qe.setProjectId(e.projectId),qe.setSdkVersion(e.sdkVersion),this.adapters=e.adapters,this.setMetadata(e),this.extendCaipNetworks(e),this.initializeUniversalAdapter(e),this.initializeAdapters(e),this.setDefaultNetwork(e),qe.setAllWallets(e.allWallets),qe.setIncludeWalletIds(e.includeWalletIds),qe.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&Tt.searchWalletByIds({ids:e.excludeWalletIds}),qe.setFeaturedWalletIds(e.featuredWalletIds),qe.setTokens(e.tokens),qe.setTermsConditionsUrl(e.termsConditionsUrl),qe.setPrivacyPolicyUrl(e.privacyPolicyUrl),qe.setCustomWallets(e.customWallets),qe.setFeatures(e.features),qe.setEnableWalletConnect(e.enableWalletConnect!==!1),qe.setEnableWallets(e.enableWallets!==!1),e.metadata&&qe.setMetadata(e.metadata),e.themeMode&&vn.setThemeMode(e.themeMode),e.themeVariables&&vn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===xn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Qs(async()=>{const{SIWEController:s}=await import("./index-BpiWtdP0.js");return{SIWEController:s}},[]);i.setSIWEClient(e.siweConfig)}}setMetadata(e){var r,n,i;typeof window>"u"||typeof document>"u"||(e.metadata={name:((r=document.getElementsByTagName("title")[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]})}extendCaipNetworks(e){e.networks=Tw.extendCaipNetworks(e.networks,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}),e.defaultNetwork=e.networks.find(r=>{var n;return r.id===((n=e.defaultNetwork)==null?void 0:n.id)})}initializeUniversalAdapter(e){var r,n;this.universalAdapter=new N3e(e),ge.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;ge.initialize(e.adapters||[]),(r=e.adapters)==null||r.forEach(n=>{var i;(i=n.construct)==null||i.call(n,this,e)})}setDefaultNetwork(e){const r=e.defaultNetwork?Tw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=sn.getItem(nn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];ge.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!iM&&Ue.isClient()&&(iM=!0,this.initPromise=new Promise(async e=>{await Promise.all([Qs(()=>import("./index-Bn7sbfQV.js"),[]),Qs(()=>import("./w3m-modal-DG2UkRHg.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const $3e="@reown/appkit",O3e="1.0.4",D3e="module",L3e="./dist/esm/exports/index.js",B3e="./dist/types/exports/index.d.ts",U3e=["dist","!tsconfig.tsbuildinfo"],j3e={"build:clean":"rm -rf dist",build:"tsc --build tsconfig.build.json",watch:"tsc --watch",typecheck:"tsc --noEmit",lint:"eslint . --ext .js,.jsx,.ts,.tsx",test:"vitest run --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"},F3e={".":{types:"./dist/types/exports/index.d.ts",import:"./dist/esm/exports/index.js",default:"./dist/esm/exports/index.js"},"./react":{types:"./dist/types/exports/react.d.ts",import:"./dist/esm/exports/react.js",default:"./dist/esm/exports/react.js"},"./vue":{types:"./dist/types/exports/vue.d.ts",import:"./dist/esm/exports/vue.js",default:"./dist/esm/exports/vue.js"},"./library/react":{types:"./dist/types/exports/library/react.d.ts",import:"./dist/esm/exports/library/react.js",default:"./dist/esm/exports/library/react.js"},"./library/vue":{types:"./dist/types/exports/library/vue.d.ts",import:"./dist/esm/exports/library/vue.js",default:"./dist/esm/exports/library/vue.js"},"./store":{types:"./dist/types/exports/store.d.ts",import:"./dist/esm/exports/store.js",default:"./dist/esm/exports/store.js"},"./utils":{types:"./dist/types/exports/utils.d.ts",import:"./dist/esm/exports/utils.js",default:"./dist/esm/exports/utils.js"},"./networks":{types:"./dist/types/exports/networks.d.ts",import:"./dist/esm/exports/networks.js",default:"./dist/esm/exports/networks.js"},"./auth-provider":{types:"./dist/types/exports/auth-provider.d.ts",import:"./dist/esm/exports/auth-provider.js",default:"./dist/esm/exports/auth-provider.js"}},z3e={"*":{react:["./dist/types/exports/react.d.ts"],vue:["./dist/types/exports/vue.d.ts"],"library/react":["./dist/types/exports/library/react.d.ts"],"library/vue":["./dist/types/exports/library/vue.d.ts"],store:["./dist/types/exports/store.d.ts"],networks:["./dist/types/exports/networks.d.ts"],"auth-provider":["./dist/types/exports/auth-provider.d.ts"]}},W3e={"@walletconnect/universal-provider":"2.16.1","@reown/appkit-common":"workspace:*","@reown/appkit-core":"workspace:*","@reown/appkit-polyfills":"workspace:*","@reown/appkit-scaffold-ui":"workspace:*","@reown/appkit-utils":"workspace:*","@reown/appkit-siwe":"workspace:*","@reown/appkit-ui":"workspace:*","@reown/appkit-wallet":"workspace:*","@walletconnect/types":"2.16.1","@walletconnect/utils":"2.16.1",valtio:"1.11.2"},H3e={borsh:"0.7.0",bs58:"5.0.0"},q3e={"@types/react":"18.2.0","@types/react-dom":"18.2.0","@vitest/coverage-v8":"2.0.5","@vue/runtime-core":"3.4.3","@wagmi/connectors":"5.1.9","@wagmi/core":"2.13.4","@wallet-standard/app":"1.0.1","@wallet-standard/base":"1.0.1","@wallet-standard/features":"1.0.3","@wallet-standard/wallet":"1.0.1","@walletconnect/types":"2.13.3","@walletconnect/universal-provider":"2.16.1",ethers:"6.13.2",ethers5:"npm:ethers@5.7.2",react:"18.2.0","react-dom":"18.2.0",viem:"2.21.4",vitest:"2.0.5",vue:"3.4.3",wagmi:"2.12.9"},V3e="Reown (https://reown.com)",K3e="Apache-2.0",G3e="https://github.com/WalletConnect/web3modal",Z3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},Q3e={url:"https://github.com/WalletConnect/web3modal/issues"},Y3e={name:$3e,version:O3e,type:D3e,main:L3e,types:B3e,files:U3e,scripts:j3e,exports:F3e,typesVersions:z3e,dependencies:W3e,optionalDependencies:H3e,devDependencies:q3e,author:V3e,license:K3e,homepage:G3e,repository:Z3e,bugs:Q3e};var Oo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ro=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=ge.state.activeCaipAddress,this.balanceVal=Se.state.balance,this.balanceSymbol=Se.state.balanceSymbol,this.profileName=Se.state.profileName,this.profileImage=Se.state.profileImage,this.network=ge.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(Sn.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),ge.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Se.subscribeKey("balance",e=>this.balanceVal=e),Se.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Se.subscribeKey("profileName",e=>this.profileName=e),Se.subscribeKey("profileImage",e=>this.profileImage=e),ge.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),Zt.subscribeKey("isUnsupportedChain",e=>{this.isUnsupportedChain=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.balance==="show";return q` +`)+De+`return __p +}`;var hr=_T(function(){return Lr(te,It+"return "+De).apply(r,ue)});if(hr.source=De,W8(hr))throw hr;return hr}function fZ(u){return jr(u).toLowerCase()}function hZ(u){return jr(u).toUpperCase()}function pZ(u,f,C){if(u=jr(u),u&&(C||f===r))return RS(u);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=Ma(f),te=NS(j,Z),ue=MS(j,Z)+1;return sd(j,te,ue).join("")}function gZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.slice(0,$S(u)+1);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=MS(j,Ma(f))+1;return sd(j,0,Z).join("")}function mZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.replace(Wt,"");if(!u||!(f=io(f)))return u;var j=Ma(u),Z=NS(j,Ma(f));return sd(j,Z).join("")}function wZ(u,f){var C=K,j=B;if(bn(f)){var Z="separator"in f?f.separator:Z;C="length"in f?fr(f.length):C,j="omission"in f?io(f.omission):j}u=jr(u);var te=u.length;if(V0(u)){var ue=Ma(u);te=ue.length}if(C>=te)return u;var he=C-K0(j);if(he<1)return j;var be=ue?sd(ue,0,he).join(""):u.slice(0,he);if(Z===r)return be+j;if(ue&&(he+=be.length-he),H8(Z)){if(u.slice(he).search(Z)){var Ne,Me=be;for(Z.global||(Z=o8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Ne=Z.exec(Me);)var De=Ne.index;be=be.slice(0,De===r?he:De)}}else if(u.indexOf(io(Z),he)!=he){var nt=be.lastIndexOf(Z);nt>-1&&(be=be.slice(0,nt))}return be+j}function vZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,KW):u}var yZ=ep(function(u,f,C){return u+(C?" ":"")+f.toUpperCase()}),K8=CI("toUpperCase");function xT(u,f,C){return u=jr(u),f=C?r:f,f===r?zW(u)?QW(u):MW(u):u.match(f)||[]}var _T=wr(function(u,f){try{return oi(u,r,f)}catch(C){return W8(C)?C:new tr(C)}}),bZ=Hl(function(u,f){return Bo(f,function(C){C=Dc(C),zl(u,C,F8(u[C],u))}),u});function xZ(u){var f=u==null?0:u.length,C=Ht();return u=f?gn(u,function(j){if(typeof j[1]!="function")throw new Uo(o);return[C(j[0]),j[1]]}):[],wr(function(j){for(var Z=-1;++ZS)return[];var C=b,j=Bi(u,b);f=Ht(f),u-=b;for(var Z=n8(j,f);++C0||f<0)?new Ar(C):(u<0?C=C.takeRight(-u):u&&(C=C.drop(u)),f!==r&&(f=fr(f),C=f<0?C.dropRight(-f):C.take(f-u)),C)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},Oc(Ar.prototype,function(u,f){var C=/^(?:filter|find|map|reject)|While$/.test(f),j=/^(?:head|last)$/.test(f),Z=X[j?"take"+(f=="last"?"Right":""):f],te=j||/^find/.test(f);Z&&(X.prototype[f]=function(){var ue=this.__wrapped__,he=j?[1]:arguments,be=ue instanceof Ar,Ne=he[0],Me=be||ir(ue),De=function(br){var Pr=Z.apply(X,Xu([br],he));return j&&nt?Pr[0]:Pr};Me&&C&&typeof Ne=="function"&&Ne.length!=1&&(be=Me=!1);var nt=this.__chain__,It=!!this.__actions__.length,Kt=te&&!nt,hr=be&&!It;if(!te&&Me){ue=hr?ue:new Ar(this);var Gt=u.apply(ue,he);return Gt.__actions__.push({func:$3,args:[De],thisArg:r}),new jo(Gt,nt)}return Kt&&hr?u.apply(this,he):(Gt=this.thru(De),Kt?j?Gt.value()[0]:Gt.value():Gt)})}),Bo(["pop","push","shift","sort","splice","unshift"],function(u){var f=a3[u],C=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",j=/^(?:pop|shift)$/.test(u);X.prototype[u]=function(){var Z=arguments;if(j&&!this.__chain__){var te=this.value();return f.apply(ir(te)?te:[],Z)}return this[C](function(ue){return f.apply(ir(ue)?ue:[],Z)})}}),Oc(Ar.prototype,function(u,f){var C=X[f];if(C){var j=C.name+"";Wr.call(Y0,j)||(Y0[j]=[]),Y0[j].push({name:f,func:C})}}),Y0[T3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=vH,Ar.prototype.reverse=yH,Ar.prototype.value=bH,X.prototype.at=ZV,X.prototype.chain=QV,X.prototype.commit=YV,X.prototype.next=JV,X.prototype.plant=eK,X.prototype.reverse=tK,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=rK,X.prototype.first=X.prototype.head,Lg&&(X.prototype[Lg]=XV),X},G0=YW();Dn?((Dn.exports=G0)._=G0,Qr._=G0):kr._=G0}).call(_m)})(U_,U_.exports);var D2e=Object.defineProperty,L2e=Object.defineProperties,B2e=Object.getOwnPropertyDescriptors,$N=Object.getOwnPropertySymbols,U2e=Object.prototype.hasOwnProperty,j2e=Object.prototype.propertyIsEnumerable,DN=(t,e,r)=>e in t?D2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ey=(t,e)=>{for(var r in e||(e={}))U2e.call(e,r)&&DN(t,r,e[r]);if($N)for(var r of $N(e))j2e.call(e,r)&&DN(t,r,e[r]);return t},F2e=(t,e)=>L2e(t,B2e(e));function mc(t,e,r){var n;const i=Jm(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${$2e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function $0(t){return t.includes(":")?t.split(":")[1]:t}function Oj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function z2e(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 P9(t={},e={}){const r=LN(t),n=LN(e);return U_.exports.merge(r,n)}function LN(t){var e,r,n,i;const s={};if(!fv(t))return s;for(const[o,a]of Object.entries(t)){const c=PE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],h=a.rpcMap||{},g=Om(o);s[g]=F2e(Ey(Ey({},s[g]),a),{chains:nb(c,(e=s[g])==null?void 0:e.chains),methods:nb(l,(r=s[g])==null?void 0:r.methods),events:nb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ey(Ey({},h),(i=s[g])==null?void 0:i.rpcMap)})}return s}function W2e(t){return t.includes(":")?t.split(":")[2]:t}function BN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=PE(r)?[r]:n.chains?n.chains:Oj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function R9(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 $j={},zr=t=>$j[t],N9=(t,e)=>{$j[t]=e};class H2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}var q2e=Object.defineProperty,V2e=Object.defineProperties,K2e=Object.getOwnPropertyDescriptors,UN=Object.getOwnPropertySymbols,G2e=Object.prototype.hasOwnProperty,Z2e=Object.prototype.propertyIsEnumerable,jN=(t,e,r)=>e in t?q2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,FN=(t,e)=>{for(var r in e||(e={}))G2e.call(e,r)&&jN(t,r,e[r]);if(UN)for(var r of UN(e))Z2e.call(e,r)&&jN(t,r,e[r]);return t},zN=(t,e)=>V2e(t,K2e(e));class Q2e{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)}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(Sc.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||mc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(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($0(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:zN(FN({},o.sessionProperties||{}),{capabilities:zN(FN({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class Y2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}class J2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}class X2e{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||mc(`${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(Sc.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||mc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ec(new $l(n,zr("disableProviderPing")))}}class e3e{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(Sc.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=$0(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 Ec(new $l(n,zr("disableProviderPing")))}}class t3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}class r3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}class n3e{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||mc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Sc.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||mc(e,this.namespace);return typeof n>"u"?void 0:new Ec(new $l(n,zr("disableProviderPing")))}}class i3e{constructor(e){this.name=gp,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(Sc.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=Jm(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new $l(n,zr("disableProviderPing")))}}var s3e=Object.defineProperty,o3e=Object.defineProperties,a3e=Object.getOwnPropertyDescriptors,WN=Object.getOwnPropertySymbols,c3e=Object.prototype.hasOwnProperty,l3e=Object.prototype.propertyIsEnumerable,HN=(t,e,r)=>e in t?s3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sy=(t,e)=>{for(var r in e||(e={}))c3e.call(e,r)&&HN(t,r,e[r]);if(WN)for(var r of WN(e))l3e.call(e,r)&&HN(t,r,e[r]);return t},M9=(t,e)=>o3e(t,a3e(e));class DE{constructor(e){this.events=new cE,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:Xv(t2({level:(e==null?void 0:e.logger)||MN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new DE(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:Sy({},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,f4(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:Vr("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=BN(this.session.namespaces);this.namespaces=P9(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=BN(s.namespaces);this.namespaces=P9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Nj)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===gp?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(Jh(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 C2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||MN,relayUrl:this.providerOpts.relayUrl||N2e,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=>Om(r)))];N9("client",this.client),N9("events",this.events),N9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=z2e(r,this.session),i=Oj(n),s=P9(this.namespaces,this.optionalNamespaces),o=M9(Sy({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Q2e({namespace:o});break;case"algorand":this.rpcProviders[r]=new X2e({namespace:o});break;case"solana":this.rpcProviders[r]=new Y2e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new J2e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new H2e({namespace:o});break;case"cip34":this.rpcProviders[r]=new e3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new t3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new r3e({namespace:o});break;case"near":this.rpcProviders[r]=new n3e({namespace:o});break;default:this.rpcProviders[gp]?this.rpcProviders[gp].updateNamespace(o):this.rpcProviders[gp]=new i3e({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&&Jh(i)&&this.events.emit("accountsChanged",i.map(W2e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Om(i),a=R9(i)!==R9(s)?`${o}:${R9(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=M9(Sy({},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",M9(Sy({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Sc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[gp]}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=>Om(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=Om(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(`${ON}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${ON}/${e}`)}}const Dj={getMethodsByChainNamespace(t){switch(t){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_switchEthereumChain"];default:return[]}},createNamespaces(t){return t.reduce((e,r)=>{const{chainId:n,chainNamespace:i,rpcUrl:s}=r,o=this.getMethodsByChainNamespace(i);e[i]||(e[i]={methods:o,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const a=`${i}:${n}`,c=e[i];return c.chains.push(a),c!=null&&c.rpcMap&&(c.rpcMap[n]=s),e},{})}},Jo=Tn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),j1={state:Jo,subscribeKey(t,e){return Cs(Jo,t,e)},subscribeProviders(t){return gs(Jo.providers,()=>t(Jo.providers))},setProvider(t,e){e&&(Jo.providers[t]=rc(e))},getProvider(t){return Jo.providers[t]},setProviderId(t,e){e&&(Jo.providerIds[t]=e)},getProviderId(t){return Jo.providerIds[t]},reset(){Jo.providers={eip155:void 0,solana:void 0,polkadot:void 0},Jo.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){Jo.providers[t]=void 0,Jo.providerIds[t]=void 0}},u3e=["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"];class d3e{constructor(e){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.defaultNetwork=void 0,this.options=void 0,this.adapterType="universal";const{siweConfig:r,metadata:n}=e;this.caipNetworks=e.networks,this.chainNamespace="eip155",this.metadata=n,this.defaultNetwork=e.defaultNetwork||e.networks[0],this.networkControllerClient={switchCaipNetwork:i=>{if(i)try{this.switchNetwork(i)}catch{throw new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>(await this.getWalletConnectProvider(),new Promise(i=>{var c,l;const s=(l=(c=this.walletConnectProvider)==null?void 0:c.session)==null?void 0:l.namespaces,o=[];s&&Object.keys(s).forEach(d=>{var g;const h=(g=s==null?void 0:s[d])==null?void 0:g.chains;h&&o.push(...h)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,h,g,v,x,R,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),pe.state.activeChain&&((c=(a=(o=pe.state)==null?void 0:o.chains)==null?void 0:a.get(pe.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=pe.state.chains.get(pe.state.activeChain);await((d=(l=N==null?void 0:N.connectionControllerClient)==null?void 0:l.connectWalletConnect)==null?void 0:d.call(l,i)),this.setWalletConnectProvider()}else{const N=await((h=r==null?void 0:r.getMessageParams)==null?void 0:h.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,O=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&O&&L){const{SIWEController:U,getDidChainId:H,getDidAddress:I}=await Zn(async()=>{const{SIWEController:B,getDidChainId:_,getDidAddress:p}=await import("./index-CEnfT4ng.js");return{SIWEController:B,getDidChainId:_,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(B=>B.chainNamespace==="eip155").map(B=>B.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(B=>B.chainNamespace==="eip155").map(B=>B.chainId);const F=await s.authenticate({nonce:await((R=r==null?void 0:r.getNonce)==null?void 0:R.call(r)),methods:[...u3e],...N,chains:T}),K=(M=F==null?void 0:F.auths)==null?void 0:M[0];if(K){const{p:B,s:_}=K,p=H(B.iss),m=I(B.iss);m&&p&&U.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:B,iss:B.iss});await U.verifyMessage({message:w,signature:_.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await U.signOut().catch(console.error),w}}}else{const U=Dj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:U})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(nn.removeItem(rn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Zn(async()=>{const{SIWEController:l}=await import("./index-CEnfT4ng.js");return{SIWEController:l}},[]);await c.signOut()}await((s=this.walletConnectProvider)==null?void 0:s.disconnect()),(o=this.appKit)==null||o.resetAccount("eip155"),(a=this.appKit)==null||a.resetAccount("solana")},signMessage:async i=>{const s=await this.getWalletConnectProvider(),o=pe.state.activeCaipAddress,a=Be.getPlainAddress(o);if(!s)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await s.request({method:"personal_sign",params:[i,a]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async i=>await Promise.resolve(i),getEnsAddress:async i=>await Promise.resolve(i),writeContract:async()=>await Promise.resolve("0x"),sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(e,r){if(!r.projectId)throw new Error("Solana:construct - projectId is undefined");this.appKit=e,this.options=r,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(e){e&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(e.id)}async disconnect(){var e,r;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(e=this.appKit)==null||e.resetAccount("eip155"),(r=this.appKit)==null||r.resetAccount("solana"))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var e,r;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((e=this.options)!=null&&e.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((r=this.options)==null?void 0:r.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(e){const r={projectId:e,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await DE.init(r),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(e){[...new Set(e.map(n=>n.chainNamespace))].filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async checkActiveWalletConnectProvider(){const e=await this.getWalletConnectProvider(),r=nn.getItem(rn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;nn.setItem(rn.WALLET_ID,cr.WALLET_CONNECT_CONNECTOR_ID);const e=(n=(r=this.walletConnectProvider)==null?void 0:r.session)==null?void 0:n.namespaces;if(e){Object.keys(e).reverse().forEach(a=>{var l,d;const c=(l=e==null?void 0:e[a])==null?void 0:l.accounts[0];j1.setProvider(a,this.walletConnectProvider),j1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=pe.state.activeCaipNetwork;try{s?Zt.setActiveCaipNetwork(s):o?(i=Zt.state.approvedCaipNetworkIds)!=null&&i.includes(o.id)||this.setDefaultNetwork(e):this.setDefaultNetwork(e)}catch(a){console.warn(">>> Error setting active caip network",a)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(e){var n,i;const r=(n=this.caipNetworks[0])==null?void 0:n.chainNamespace;if(r){const s=e==null?void 0:e[r];if(s!=null&&s.chains){const o=s.chains[0];if(o){const a=(i=Zt.state)==null?void 0:i.requestedCaipNetworks;if(a){const c=a.find(l=>l.id===o);c&&Zt.setActiveCaipNetwork(c)}}}}}async watchWalletConnect(){var o;const e=await this.getWalletConnectProvider(),r=((o=e==null?void 0:e.session)==null?void 0:o.namespaces)||{};function n(){Object.keys(r).forEach(a=>{Ee.resetAccount(a)}),Lt.resetWcConnection(),nn.removeItem(rn.WALLET_ID),e==null||e.removeListener("disconnect",n),e==null||e.removeListener("accountsChanged",i)}const i=a=>{a.length>0&&this.syncAccount()},s=a=>{var d,h,g;const c=this.caipNetworks.find(v=>v.chainId==a),l=(d=this.appKit)==null?void 0:d.getCaipNetwork();if(!c){Zt.setActiveCaipNetwork({chainId:Number(a),id:`eip155:${a}`,name:"Unknown Network",currency:"",explorerUrl:"",rpcUrl:"",chainNamespace:((h=this.appKit)==null?void 0:h.getActiveChainNamespace())||"eip155"});return}(!l||(l==null?void 0:l.id)!==(c==null?void 0:c.id))&&((g=this.appKit)==null||g.setCaipNetwork(c))};e&&(e.on("disconnect",n),e.on("accountsChanged",i),e.on("chainChanged",s))}getProviderData(){var i,s,o,a;const e=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{},r=((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1,n=((a=this.appKit)==null?void 0:a.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:e,namespaceKeys:e?Object.keys(e):[],isConnected:r,preferredAccountType:n}}syncAccount(){var s,o,a,c;const{namespaceKeys:e,namespaces:r}=this.getProviderData(),n=(s=this.appKit)==null?void 0:s.getPreferredAccountType();((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1?e.forEach(async l=>{var v,x,R,M,N;const d=l,h=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((R=this.appKit)==null||R.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(h,d),this.syncConnectedWalletInfo(),await Promise.all([(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(d)])),this.syncAccounts()}):((a=this.appKit)==null||a.resetWcConnection(),(c=this.appKit)==null||c.resetNetwork(),this.syncAccounts(!0))}syncAccounts(e=!1){const{namespaces:r}=this.getProviderData();Object.keys(r).forEach(i=>{var o,a,c,l;const s=(a=(o=r==null?void 0:r[i])==null?void 0:o.accounts)==null?void 0:a.map(d=>{const[,,h]=d.split(":");return h}).filter((d,h,g)=>g.indexOf(d)===h);e&&((c=this.appKit)==null||c.setAllAccounts([],i)),s&&((l=this.appKit)==null||l.setAllAccounts(s.map(d=>({address:d,type:"eoa"})),i))})}syncConnectedWalletInfo(){var i,s;const e=nn.getItem(rn.WALLET_ID),r=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{};Object.keys(r).forEach(o=>{var a,c,l,d,h;(a=this.walletConnectProvider)!=null&&a.session?(l=this.appKit)==null||l.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(c=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:c[0]},o):e&&((d=this.appKit)==null||d.setConnectedWalletInfo({name:e},"eip155"),(h=this.appKit)==null||h.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ua.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ua.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ua.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let qN=!1;class f3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Ee.setStatus(n,i)},this.getIsConnectedState=()=>!!pe.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Ee.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Ee.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Ee.removeAddressLabel(n,i)},this.getCaipAddress=n=>pe.state.activeChain===n||!n?pe.state.activeCaipAddress:pe.getAccountProp("caipAddress",n),this.getAddress=n=>pe.state.activeChain===n||!n?Ee.state.address:pe.getAccountProp("address",n),this.getProvider=()=>Ee.state.provider,this.getPreferredAccountType=()=>Ee.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Ee.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Ee.setProvider(n,i)},this.setBalance=(n,i,s)=>{Ee.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Ee.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Ee.setProfileImage(n,i)},this.resetAccount=n=>{Ee.resetAccount(n)},this.setCaipNetwork=n=>{pe.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:pe.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>pe.state.activeChain,this.setRequestedCaipNetworks=(n,i)=>{Zt.setRequestedCaipNetworks(n,i)},this.getApprovedCaipNetworkIds=()=>Zt.getApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=n=>Zt.setApprovedCaipNetworksData(n),this.resetNetwork=()=>{Zt.resetNetwork()},this.setConnectors=n=>{const i=[...ut.getConnectors(),...n];ut.setConnectors(i)},this.addConnector=n=>{ut.addConnector(n)},this.getConnectors=()=>ut.getConnectors(),this.resetWcConnection=()=>{Lt.resetWcConnection()},this.fetchIdentity=n=>vn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Ee.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Ee.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Ee.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Ee.setPreferredAccountType(n,i)},this.getReownName=n=>Hc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await Hc.resolveName(n);return((o=(Object.values(i==null?void 0:i.addresses)||[])[0])==null?void 0:o.address)||!1},this.setEIP6963Enabled=n=>{qe.setEIP6963Enabled(n)},this.setClientId=n=>{vn.setClientId(n)},this.getConnectorImage=n=>Sr.getConnectorImage(n),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(r=e.adapters)==null?void 0:r[0],this.initControllers(e),this.initOrContinue()}static getInstance(){return this.instance}async open(e){await this.initOrContinue(),jt.open(e)}async close(){await this.initOrContinue(),jt.close()}setLoading(e){jt.setLoading(e)}getError(){return""}getChainId(){var e;return(e=pe.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return pe.state.activeChain?j1.state.providers[pe.state.activeChain]:null}getWalletProviderType(){return pe.state.activeChain?j1.state.providerIds[pe.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return mn.state.themeMode}getThemeVariables(){return mn.state.themeVariables}setThemeMode(e){mn.setThemeMode(e),_L(mn.state.themeMode)}setThemeVariables(e){mn.setThemeVariables(e),kre(mn.state.themeVariables)}subscribeTheme(e){return mn.subscribe(e)}getWalletInfo(){return Ee.state.connectedWalletInfo}subscribeWalletInfo(e){return Ee.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Ee.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return gu.state}subscribeState(e){return gu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ce.replace(e)}redirect(e){Ce.push(e)}popTransactionStack(e){Ce.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ce.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ce.state.transactionStack[Ce.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){var n;if(qe.setProjectId(e.projectId),qe.setSdkVersion(e.sdkVersion),this.adapters=e.adapters,this.setMetadata(e),this.extendCaipNetworks(e),this.initializeUniversalAdapter(e),this.initializeAdapters(e),this.setDefaultNetwork(e),qe.setAllWallets(e.allWallets),qe.setIncludeWalletIds(e.includeWalletIds),qe.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&Tt.searchWalletByIds({ids:e.excludeWalletIds}),qe.setFeaturedWalletIds(e.featuredWalletIds),qe.setTokens(e.tokens),qe.setTermsConditionsUrl(e.termsConditionsUrl),qe.setPrivacyPolicyUrl(e.privacyPolicyUrl),qe.setCustomWallets(e.customWallets),qe.setFeatures(e.features),qe.setEnableWalletConnect(e.enableWalletConnect!==!1),qe.setEnableWallets(e.enableWallets!==!1),e.metadata&&qe.setMetadata(e.metadata),e.themeMode&&mn.setThemeMode(e.themeMode),e.themeVariables&&mn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===yn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Zn(async()=>{const{SIWEController:s}=await import("./index-CEnfT4ng.js");return{SIWEController:s}},[]);i.setSIWEClient(e.siweConfig)}}setMetadata(e){var r,n,i;typeof window>"u"||typeof document>"u"||(e.metadata={name:((r=document.getElementsByTagName("title")[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]})}extendCaipNetworks(e){e.networks=Sw.extendCaipNetworks(e.networks,{networkImageIds:ua.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}),e.defaultNetwork=e.networks.find(r=>{var n;return r.id===((n=e.defaultNetwork)==null?void 0:n.id)})}initializeUniversalAdapter(e){var r,n;this.universalAdapter=new d3e(e),pe.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;pe.initialize(e.adapters||[]),(r=e.adapters)==null||r.forEach(n=>{var i;(i=n.construct)==null||i.call(n,this,e)})}setDefaultNetwork(e){const r=e.defaultNetwork?Sw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ua.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=nn.getItem(rn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];pe.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!qN&&Be.isClient()&&(qN=!0,this.initPromise=new Promise(async e=>{await Promise.all([Zn(()=>import("./index-DSHVXTMI.js"),[]),Zn(()=>import("./w3m-modal-z0Fgb4-A.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const h3e="@reown/appkit",p3e="1.0.4",g3e="module",m3e="./dist/esm/exports/index.js",w3e="./dist/types/exports/index.d.ts",v3e=["dist","!tsconfig.tsbuildinfo"],y3e={"build:clean":"rm -rf dist",build:"tsc --build tsconfig.build.json",watch:"tsc --watch",typecheck:"tsc --noEmit",lint:"eslint . --ext .js,.jsx,.ts,.tsx",test:"vitest run --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"},b3e={".":{types:"./dist/types/exports/index.d.ts",import:"./dist/esm/exports/index.js",default:"./dist/esm/exports/index.js"},"./react":{types:"./dist/types/exports/react.d.ts",import:"./dist/esm/exports/react.js",default:"./dist/esm/exports/react.js"},"./vue":{types:"./dist/types/exports/vue.d.ts",import:"./dist/esm/exports/vue.js",default:"./dist/esm/exports/vue.js"},"./library/react":{types:"./dist/types/exports/library/react.d.ts",import:"./dist/esm/exports/library/react.js",default:"./dist/esm/exports/library/react.js"},"./library/vue":{types:"./dist/types/exports/library/vue.d.ts",import:"./dist/esm/exports/library/vue.js",default:"./dist/esm/exports/library/vue.js"},"./store":{types:"./dist/types/exports/store.d.ts",import:"./dist/esm/exports/store.js",default:"./dist/esm/exports/store.js"},"./utils":{types:"./dist/types/exports/utils.d.ts",import:"./dist/esm/exports/utils.js",default:"./dist/esm/exports/utils.js"},"./networks":{types:"./dist/types/exports/networks.d.ts",import:"./dist/esm/exports/networks.js",default:"./dist/esm/exports/networks.js"},"./auth-provider":{types:"./dist/types/exports/auth-provider.d.ts",import:"./dist/esm/exports/auth-provider.js",default:"./dist/esm/exports/auth-provider.js"}},x3e={"*":{react:["./dist/types/exports/react.d.ts"],vue:["./dist/types/exports/vue.d.ts"],"library/react":["./dist/types/exports/library/react.d.ts"],"library/vue":["./dist/types/exports/library/vue.d.ts"],store:["./dist/types/exports/store.d.ts"],networks:["./dist/types/exports/networks.d.ts"],"auth-provider":["./dist/types/exports/auth-provider.d.ts"]}},_3e={"@walletconnect/universal-provider":"2.16.1","@reown/appkit-common":"workspace:*","@reown/appkit-core":"workspace:*","@reown/appkit-polyfills":"workspace:*","@reown/appkit-scaffold-ui":"workspace:*","@reown/appkit-utils":"workspace:*","@reown/appkit-siwe":"workspace:*","@reown/appkit-ui":"workspace:*","@reown/appkit-wallet":"workspace:*","@walletconnect/types":"2.16.1","@walletconnect/utils":"2.16.1",valtio:"1.11.2"},C3e={borsh:"0.7.0",bs58:"5.0.0"},A3e={"@types/react":"18.2.0","@types/react-dom":"18.2.0","@vitest/coverage-v8":"2.0.5","@vue/runtime-core":"3.4.3","@wagmi/connectors":"5.1.9","@wagmi/core":"2.13.4","@wallet-standard/app":"1.0.1","@wallet-standard/base":"1.0.1","@wallet-standard/features":"1.0.3","@wallet-standard/wallet":"1.0.1","@walletconnect/types":"2.13.3","@walletconnect/universal-provider":"2.16.1",ethers:"6.13.2",ethers5:"npm:ethers@5.7.2",react:"18.2.0","react-dom":"18.2.0",viem:"2.21.4",vitest:"2.0.5",vue:"3.4.3",wagmi:"2.12.9"},E3e="Reown (https://reown.com)",S3e="Apache-2.0",I3e="https://github.com/WalletConnect/web3modal",T3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},k3e={url:"https://github.com/WalletConnect/web3modal/issues"},P3e={name:h3e,version:p3e,type:g3e,main:m3e,types:w3e,files:v3e,scripts:y3e,exports:b3e,typesVersions:x3e,dependencies:_3e,optionalDependencies:C3e,devDependencies:A3e,author:E3e,license:S3e,homepage:I3e,repository:T3e,bugs:k3e};var No=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Ys=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=pe.state.activeCaipAddress,this.balanceVal=Ee.state.balance,this.balanceSymbol=Ee.state.balanceSymbol,this.profileName=Ee.state.profileName,this.profileImage=Ee.state.profileImage,this.network=pe.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(An.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Ee.subscribeKey("balance",e=>this.balanceVal=e),Ee.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Ee.subscribeKey("profileName",e=>this.profileName=e),Ee.subscribeKey("profileImage",e=>this.profileImage=e),pe.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),Zt.subscribeKey("isUnsupportedChain",e=>{this.isUnsupportedChain=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.balance==="show";return q` - `}onClick(){this.isUnsupportedChain?jt.open({view:"UnsupportedChain"}):jt.open()}};Oo([Y({type:Boolean})],ro.prototype,"disabled",void 0);Oo([Y()],ro.prototype,"balance",void 0);Oo([Y()],ro.prototype,"charsStart",void 0);Oo([Y()],ro.prototype,"charsEnd",void 0);Oo([le()],ro.prototype,"caipAddress",void 0);Oo([le()],ro.prototype,"balanceVal",void 0);Oo([le()],ro.prototype,"balanceSymbol",void 0);Oo([le()],ro.prototype,"profileName",void 0);Oo([le()],ro.prototype,"profileImage",void 0);Oo([le()],ro.prototype,"network",void 0);Oo([le()],ro.prototype,"networkImage",void 0);Oo([le()],ro.prototype,"isUnsupportedChain",void 0);ro=Oo([ye("w3m-account-button")],ro);const J3e=Te` + `}onClick(){this.isUnsupportedChain?jt.open({view:"UnsupportedChain"}):jt.open()}};No([Q({type:Boolean})],Ys.prototype,"disabled",void 0);No([Q()],Ys.prototype,"balance",void 0);No([Q()],Ys.prototype,"charsStart",void 0);No([Q()],Ys.prototype,"charsEnd",void 0);No([ae()],Ys.prototype,"caipAddress",void 0);No([ae()],Ys.prototype,"balanceVal",void 0);No([ae()],Ys.prototype,"balanceSymbol",void 0);No([ae()],Ys.prototype,"profileName",void 0);No([ae()],Ys.prototype,"profileImage",void 0);No([ae()],Ys.prototype,"network",void 0);No([ae()],Ys.prototype,"networkImage",void 0);No([ae()],Ys.prototype,"isUnsupportedChain",void 0);Ys=No([ve("w3m-account-button")],Ys);const R3e=Ie` :host { display: block; width: max-content; } -`;var Ul=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Ca=class extends _e{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.caipAddress=ge.state.activeCaipAddress,this.isLoading=jt.state.loading}firstUpdated(){this.unsubscribe.push(ge.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jt.subscribeKey("loading",e=>this.isLoading=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress&&!this.isLoading?q` +`;var Dl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ya=class extends _e{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.caipAddress=pe.state.activeCaipAddress,this.isLoading=jt.state.loading}firstUpdated(){this.unsubscribe.push(pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jt.subscribeKey("loading",e=>this.isLoading=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress&&!this.isLoading?q` `:q` - `}};Ca.styles=J3e;Ul([Y({type:Boolean})],Ca.prototype,"disabled",void 0);Ul([Y()],Ca.prototype,"balance",void 0);Ul([Y()],Ca.prototype,"size",void 0);Ul([Y()],Ca.prototype,"label",void 0);Ul([Y()],Ca.prototype,"loadingLabel",void 0);Ul([Y()],Ca.prototype,"charsStart",void 0);Ul([Y()],Ca.prototype,"charsEnd",void 0);Ul([le()],Ca.prototype,"caipAddress",void 0);Ul([le()],Ca.prototype,"isLoading",void 0);Ca=Ul([ye("w3m-button")],Ca);var Sg=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let t0=class extends _e{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=jt.state.open,this.loading=jt.state.loading,this.unsubscribe.push(jt.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return q` + `}};ya.styles=R3e;Dl([Q({type:Boolean})],ya.prototype,"disabled",void 0);Dl([Q()],ya.prototype,"balance",void 0);Dl([Q()],ya.prototype,"size",void 0);Dl([Q()],ya.prototype,"label",void 0);Dl([Q()],ya.prototype,"loadingLabel",void 0);Dl([Q()],ya.prototype,"charsStart",void 0);Dl([Q()],ya.prototype,"charsEnd",void 0);Dl([ae()],ya.prototype,"caipAddress",void 0);Dl([ae()],ya.prototype,"isLoading",void 0);ya=Dl([ve("w3m-button")],ya);var Ag=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Xh=class extends _e{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=jt.state.open,this.loading=jt.state.loading,this.unsubscribe.push(jt.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return q` ${e?this.loadingLabel:this.label} - `}onClick(){this.open?jt.close():this.loading||jt.open()}};Sg([Y()],t0.prototype,"size",void 0);Sg([Y()],t0.prototype,"label",void 0);Sg([Y()],t0.prototype,"loadingLabel",void 0);Sg([le()],t0.prototype,"open",void 0);Sg([le()],t0.prototype,"loading",void 0);t0=Sg([ye("w3m-connect-button")],t0);const X3e=Te` + `}onClick(){this.open?jt.close():this.loading||jt.open()}};Ag([Q()],Xh.prototype,"size",void 0);Ag([Q()],Xh.prototype,"label",void 0);Ag([Q()],Xh.prototype,"loadingLabel",void 0);Ag([ae()],Xh.prototype,"open",void 0);Ag([ae()],Xh.prototype,"loading",void 0);Xh=Ag([ve("w3m-connect-button")],Xh);const N3e=Ie` :host { display: block; width: max-content; } -`;var Nf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let El=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=ge.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.caipAddress=ge.state.activeCaipAddress,this.loading=jt.state.loading,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(Sn.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),ge.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),ge.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),jt.subscribeKey("loading",e=>this.loading=e),Zt.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var Tf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let _l=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=pe.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.caipAddress=pe.state.activeCaipAddress,this.loading=jt.state.loading,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(An.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),pe.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),pe.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),jt.subscribeKey("loading",e=>this.loading=e),Zt.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.getLabel()} - `}getLabel(){return this.network?this.network.name:this.label?this.label:this.isUnsupportedChain?"Switch Network":this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(ot.sendEvent({type:"track",event:"CLICK_NETWORKS"}),jt.open({view:"Networks"}))}};El.styles=X3e;Nf([Y({type:Boolean})],El.prototype,"disabled",void 0);Nf([Y({type:String})],El.prototype,"label",void 0);Nf([le()],El.prototype,"network",void 0);Nf([le()],El.prototype,"networkImage",void 0);Nf([le()],El.prototype,"caipAddress",void 0);Nf([le()],El.prototype,"loading",void 0);Nf([le()],El.prototype,"isUnsupportedChain",void 0);El=Nf([ye("w3m-network-button")],El);const eye=Te` + `}getLabel(){return this.network?this.network.name:this.label?this.label:this.isUnsupportedChain?"Switch Network":this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(ot.sendEvent({type:"track",event:"CLICK_NETWORKS"}),jt.open({view:"Networks"}))}};_l.styles=N3e;Tf([Q({type:Boolean})],_l.prototype,"disabled",void 0);Tf([Q({type:String})],_l.prototype,"label",void 0);Tf([ae()],_l.prototype,"network",void 0);Tf([ae()],_l.prototype,"networkImage",void 0);Tf([ae()],_l.prototype,"caipAddress",void 0);Tf([ae()],_l.prototype,"loading",void 0);Tf([ae()],_l.prototype,"isUnsupportedChain",void 0);_l=Tf([ve("w3m-network-button")],_l);const M3e=Ie` :host { --prev-height: 0px; --new-height: 0px; @@ -6128,9 +6128,9 @@ function print() { __p += __j.call(arguments, '') } opacity: 1; } } -`;var tye={};const bu={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:tye.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}};var GE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let gv=class extends _e{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=Ae.state.view,this.viewDirection="",this.unsubscribe.push(Ae.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const r=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",r),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=r,this.style.animation="unset"},bu.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(r=>r())}render(){return q`
+`;var O3e={};const wu={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:O3e.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}};var LE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let hv=class extends _e{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=Ce.state.view,this.viewDirection="",this.unsubscribe.push(Ce.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const r=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",r),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=r,this.style.animation="unset"},wu.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(r=>r())}render(){return q`
${this.viewTemplate()} -
`}viewTemplate(){switch(this.view){case"AccountSettings":return q``;case"Account":return q``;case"AllWallets":return q``;case"ApproveTransaction":return q``;case"BuyInProgress":return q``;case"ChooseAccountName":return q``;case"Connect":return q``;case"ConnectingWalletConnect":return q``;case"ConnectingExternal":return q``;case"ConnectingSiwe":return q``;case"ConnectWallets":return q``;case"ConnectSocials":return q``;case"ConnectingSocial":return q``;case"Downloads":return q``;case"EmailVerifyOtp":return q``;case"EmailVerifyDevice":return q``;case"GetWallet":return q``;case"Networks":return q``;case"SwitchNetwork":return q``;case"Profile":return q``;case"SelectAddresses":return q``;case"SwitchAddress":return q``;case"Transactions":return q``;case"OnRampProviders":return q``;case"OnRampActivity":return q``;case"OnRampTokenSelect":return q``;case"OnRampFiatSelect":return q``;case"UpgradeEmailWallet":return q``;case"UpgradeToSmartAccount":return q``;case"UpdateEmailWallet":return q``;case"UpdateEmailPrimaryOtp":return q``;case"UpdateEmailSecondaryOtp":return q``;case"UnsupportedChain":return q``;case"Swap":return q``;case"SwapSelectToken":return q``;case"SwapPreview":return q``;case"WalletSend":return q``;case"WalletSendSelectToken":return q``;case"WalletSendPreview":return q``;case"WhatIsABuy":return q``;case"WalletReceive":return q``;case"WalletCompatibleNetworks":return q``;case"WhatIsAWallet":return q``;case"ConnectingMultiChain":return q``;case"WhatIsANetwork":return q``;case"ConnectingFarcaster":return q``;case"SwitchActiveChain":return q``;case"RegisterAccountName":return q``;case"RegisterAccountNameSuccess":return q``;default:return q``}}onViewChange(e){mo.hide();let r=bu.VIEW_DIRECTION.Next;const{history:n}=Ae.state;n.length{this.view=e},bu.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("div")}};gv.styles=eye;GE([le()],gv.prototype,"view",void 0);GE([le()],gv.prototype,"viewDirection",void 0);gv=GE([ye("w3m-router")],gv);const rye=Te` +
`}viewTemplate(){switch(this.view){case"AccountSettings":return q``;case"Account":return q``;case"AllWallets":return q``;case"ApproveTransaction":return q``;case"BuyInProgress":return q``;case"ChooseAccountName":return q``;case"Connect":return q``;case"ConnectingWalletConnect":return q``;case"ConnectingExternal":return q``;case"ConnectingSiwe":return q``;case"ConnectWallets":return q``;case"ConnectSocials":return q``;case"ConnectingSocial":return q``;case"Downloads":return q``;case"EmailVerifyOtp":return q``;case"EmailVerifyDevice":return q``;case"GetWallet":return q``;case"Networks":return q``;case"SwitchNetwork":return q``;case"Profile":return q``;case"SelectAddresses":return q``;case"SwitchAddress":return q``;case"Transactions":return q``;case"OnRampProviders":return q``;case"OnRampActivity":return q``;case"OnRampTokenSelect":return q``;case"OnRampFiatSelect":return q``;case"UpgradeEmailWallet":return q``;case"UpgradeToSmartAccount":return q``;case"UpdateEmailWallet":return q``;case"UpdateEmailPrimaryOtp":return q``;case"UpdateEmailSecondaryOtp":return q``;case"UnsupportedChain":return q``;case"Swap":return q``;case"SwapSelectToken":return q``;case"SwapPreview":return q``;case"WalletSend":return q``;case"WalletSendSelectToken":return q``;case"WalletSendPreview":return q``;case"WhatIsABuy":return q``;case"WalletReceive":return q``;case"WalletCompatibleNetworks":return q``;case"WhatIsAWallet":return q``;case"ConnectingMultiChain":return q``;case"WhatIsANetwork":return q``;case"ConnectingFarcaster":return q``;case"SwitchActiveChain":return q``;case"RegisterAccountName":return q``;case"RegisterAccountNameSuccess":return q``;default:return q``}}onViewChange(e){uo.hide();let r=wu.VIEW_DIRECTION.Next;const{history:n}=Ce.state;n.length{this.view=e},wu.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("div")}};hv.styles=M3e;LE([ae()],hv.prototype,"view",void 0);LE([ae()],hv.prototype,"viewDirection",void 0);hv=LE([ve("w3m-router")],hv);const $3e=Ie` :host > wui-flex { width: 100%; max-width: 360px; @@ -6144,7 +6144,7 @@ function print() { __p += __j.call(arguments, '') } .amounts-container { width: 100%; } -`;var Mf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const nye={USD:"$",EUR:"€",GBP:"£"},iye=[100,250,500,1e3];let Sl=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=ge.state.activeCaipAddress,this.loading=jt.state.loading,this.paymentCurrency=Ur.state.paymentCurrency,this.paymentAmount=Ur.state.paymentAmount,this.purchaseAmount=Ur.state.purchaseAmount,this.quoteLoading=Ur.state.quotesLoading,this.unsubscribe.push(ge.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jt.subscribeKey("loading",e=>{this.loading=e}),Ur.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var kf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const D3e={USD:"$",EUR:"€",GBP:"£"},L3e=[100,250,500,1e3];let Cl=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=pe.state.activeCaipAddress,this.loading=jt.state.loading,this.paymentCurrency=Ur.state.paymentCurrency,this.paymentAmount=Ur.state.paymentAmount,this.purchaseAmount=Ur.state.purchaseAmount,this.quoteLoading=Ur.state.quotesLoading,this.unsubscribe.push(pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jt.subscribeKey("loading",e=>{this.loading=e}),Ur.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` - ${iye.map(e=>{var r;return q`{var r;return q`this.selectPresetAmount(e)} - >${`${nye[((r=this.paymentCurrency)==null?void 0:r.id)||"USD"]} ${e}`}${`${D3e[((r=this.paymentCurrency)==null?void 0:r.id)||"USD"]} ${e}`}`})} ${this.templateButton()} @@ -6186,7 +6186,7 @@ function print() { __p += __j.call(arguments, '') } borderRadius="xs" > Connect wallet - `}getQuotes(){this.loading||jt.open({view:"OnRampProviders"})}openModal(){jt.open({view:"Connect"})}async onPaymentAmountChange(e){Ur.setPaymentAmount(Number(e.detail)),await Ur.getQuote()}async selectPresetAmount(e){Ur.setPaymentAmount(e),await Ur.getQuote()}};Sl.styles=rye;Mf([Y({type:Boolean})],Sl.prototype,"disabled",void 0);Mf([le()],Sl.prototype,"caipAddress",void 0);Mf([le()],Sl.prototype,"loading",void 0);Mf([le()],Sl.prototype,"paymentCurrency",void 0);Mf([le()],Sl.prototype,"paymentAmount",void 0);Mf([le()],Sl.prototype,"purchaseAmount",void 0);Mf([le()],Sl.prototype,"quoteLoading",void 0);Sl=Mf([ye("w3m-onramp-widget")],Sl);var jl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let bc=class extends _e{constructor(){super(),this.usubscribe=[],this.networkImages=Sn.state.networkImages,this.address=Se.state.address,this.profileImage=Se.state.profileImage,this.profileName=Se.state.profileName,this.network=ge.state.activeCaipNetwork,this.preferredAccountType=Se.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(Se.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):jt.close()}),Se.subscribeKey("preferredAccountType",e=>this.preferredAccountType=e),ge.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var r,n;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((r=this.network)==null?void 0:r.imageId)??""];return q` + `}getQuotes(){this.loading||jt.open({view:"OnRampProviders"})}openModal(){jt.open({view:"Connect"})}async onPaymentAmountChange(e){Ur.setPaymentAmount(Number(e.detail)),await Ur.getQuote()}async selectPresetAmount(e){Ur.setPaymentAmount(e),await Ur.getQuote()}};Cl.styles=$3e;kf([Q({type:Boolean})],Cl.prototype,"disabled",void 0);kf([ae()],Cl.prototype,"caipAddress",void 0);kf([ae()],Cl.prototype,"loading",void 0);kf([ae()],Cl.prototype,"paymentCurrency",void 0);kf([ae()],Cl.prototype,"paymentAmount",void 0);kf([ae()],Cl.prototype,"purchaseAmount",void 0);kf([ae()],Cl.prototype,"quoteLoading",void 0);Cl=kf([ve("w3m-onramp-widget")],Cl);var Ll=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let wc=class extends _e{constructor(){super(),this.usubscribe=[],this.networkImages=An.state.networkImages,this.address=Ee.state.address,this.profileImage=Ee.state.profileImage,this.profileName=Ee.state.profileName,this.network=pe.state.activeCaipNetwork,this.preferredAccountType=Ee.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(Ee.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):jt.close()}),Ee.subscribeKey("preferredAccountType",e=>this.preferredAccountType=e),pe.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var r,n;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((r=this.network)==null?void 0:r.imageId)??""];return q` - ${Rt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} + ${Pt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} Choose account name - `}authCardTemplate(){const e=vr.getConnectedConnector(),r=ut.getAuthConnector(),{origin:n}=location;return!r||e!=="AUTH"||n.includes(Tn.SECURE_SITE)?null:q` + `}authCardTemplate(){const e=vr.getConnectedConnector(),r=ut.getAuthConnector(),{origin:n}=location;return!r||e!=="AUTH"||n.includes(Sn.SECURE_SITE)?null:q` - `}isAllowedNetworkSwitch(){const e=Zt.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}onCopyAddress(){try{this.address&&(Ue.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const e=Zt.checkIfSmartAccountEnabled(),r=vr.getConnectedConnector();return!ut.getAuthConnector()||r!=="AUTH"||!e?null:(this.switched||(this.text=this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),q` + `}isAllowedNetworkSwitch(){const e=Zt.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}onCopyAddress(){try{this.address&&(Be.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const e=Zt.checkIfSmartAccountEnabled(),r=vr.getConnectedConnector();return!ut.getAuthConnector()||r!=="AUTH"||!e?null:(this.switched||(this.text=this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),q` ${this.text} - `)}onChooseName(){Ae.push("ChooseAccountName")}async changePreferredAccountType(){const e=Zt.checkIfSmartAccountEnabled(),r=this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT||!e?lr.ACCOUNT_TYPES.EOA:lr.ACCOUNT_TYPES.SMART_ACCOUNT;ut.getAuthConnector()&&(this.loading=!0,await Lt.setPreferredAccountType(r),this.text=r===lr.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,Or.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&Ae.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await Lt.disconnect(),ot.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jt.close()}catch{ot.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),St.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){ot.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Ae.push("UpgradeEmailWallet")}};jl([le()],bc.prototype,"address",void 0);jl([le()],bc.prototype,"profileImage",void 0);jl([le()],bc.prototype,"profileName",void 0);jl([le()],bc.prototype,"network",void 0);jl([le()],bc.prototype,"preferredAccountType",void 0);jl([le()],bc.prototype,"disconnecting",void 0);jl([le()],bc.prototype,"loading",void 0);jl([le()],bc.prototype,"switched",void 0);jl([le()],bc.prototype,"text",void 0);bc=jl([ye("w3m-account-settings-view")],bc);var sye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let sM=class extends _e{render(){const e=vr.getConnectedConnector(),r=ut.getAuthConnector();return q` + `)}onChooseName(){Ce.push("ChooseAccountName")}async changePreferredAccountType(){const e=Zt.checkIfSmartAccountEnabled(),r=this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT||!e?lr.ACCOUNT_TYPES.EOA:lr.ACCOUNT_TYPES.SMART_ACCOUNT;ut.getAuthConnector()&&(this.loading=!0,await Lt.setPreferredAccountType(r),this.text=r===lr.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,$r.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&Ce.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await Lt.disconnect(),ot.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jt.close()}catch{ot.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),St.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){ot.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Ce.push("UpgradeEmailWallet")}};Ll([ae()],wc.prototype,"address",void 0);Ll([ae()],wc.prototype,"profileImage",void 0);Ll([ae()],wc.prototype,"profileName",void 0);Ll([ae()],wc.prototype,"network",void 0);Ll([ae()],wc.prototype,"preferredAccountType",void 0);Ll([ae()],wc.prototype,"disconnecting",void 0);Ll([ae()],wc.prototype,"loading",void 0);Ll([ae()],wc.prototype,"switched",void 0);Ll([ae()],wc.prototype,"text",void 0);wc=Ll([ve("w3m-account-settings-view")],wc);var B3e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let VN=class extends _e{render(){const e=vr.getConnectedConnector(),r=ut.getAuthConnector();return q` ${r&&e==="AUTH"?this.walletFeaturesTemplate():this.defaultTemplate()} - `}walletFeaturesTemplate(){return q``}defaultTemplate(){return q``}};sM=sye([ye("w3m-account-view")],sM);var Xj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let GC=class extends _e{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=Ue.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return q` + `}walletFeaturesTemplate(){return q``}defaultTemplate(){return q``}};VN=B3e([ve("w3m-account-view")],VN);var Lj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let j_=class extends _e{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=Be.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return q` ${this.qrButtonTemplate()} ${e?q``:q``} - `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return Ue.isMobile()?q` + `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return Be.isMobile()?q` - `:null}onWalletConnectQr(){Ae.push("ConnectingWalletConnect")}};Xj([le()],GC.prototype,"search",void 0);GC=Xj([ye("w3m-all-wallets-view")],GC);const oye=Te` + `:null}onWalletConnectQr(){Ce.push("ConnectingWalletConnect")}};Lj([ae()],j_.prototype,"search",void 0);j_=Lj([ve("w3m-all-wallets-view")],j_);const U3e=Ie` @keyframes shake { 0% { transform: translateX(0); @@ -6381,9 +6381,9 @@ function print() { __p += __j.call(arguments, '') } wui-link { padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); } -`;var Rc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let So=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Ur.state.selectedProvider,this.uri=Lt.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Ur.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var n,i;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(n=this.selectedOnRampProvider)==null?void 0:n.label}`);const r=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return q` +`;var Ic=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Co=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Ur.state.selectedProvider,this.uri=Lt.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Ur.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var n,i;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(n=this.selectedOnRampProvider)==null?void 0:n.label}`);const r=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return q` @@ -6427,10 +6427,10 @@ function print() { __p += __j.call(arguments, '') } Copy link - `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=Se.state.address,r=qe.state.projectId;if(!e)throw new Error("No address found");(await bn.fetchTransactions({account:e,onramp:"coinbase",projectId:r})).data.filter(s=>new Date(s.metadata.minedAt)>new Date(this.startTime)||s.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),Ae.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){St.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,Ue.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?q` + `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=Ee.state.address,r=qe.state.projectId;if(!e)throw new Error("No address found");(await vn.fetchTransactions({account:e,onramp:"coinbase",projectId:r})).data.filter(s=>new Date(s.metadata.minedAt)>new Date(this.startTime)||s.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),Ce.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){St.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,Be.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?q` Try again - `:null}loaderTemplate(){const e=vn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){St.showError("No link found"),Ae.goBack();return}try{Ue.copyToClopboard(this.selectedOnRampProvider.url),St.showSuccess("Link copied")}catch{St.showError("Failed to copy")}}};So.styles=oye;Rc([le()],So.prototype,"intervalId",void 0);Rc([le()],So.prototype,"selectedOnRampProvider",void 0);Rc([le()],So.prototype,"uri",void 0);Rc([le()],So.prototype,"ready",void 0);Rc([le()],So.prototype,"showRetry",void 0);Rc([le()],So.prototype,"buffering",void 0);Rc([le()],So.prototype,"error",void 0);Rc([le()],So.prototype,"startTime",void 0);Rc([Y({type:Boolean})],So.prototype,"isMobile",void 0);Rc([Y()],So.prototype,"onRetry",void 0);So=Rc([ye("w3m-buy-in-progress-view")],So);const aye=Te` + `:null}loaderTemplate(){const e=mn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){St.showError("No link found"),Ce.goBack();return}try{Be.copyToClopboard(this.selectedOnRampProvider.url),St.showSuccess("Link copied")}catch{St.showError("Failed to copy")}}};Co.styles=U3e;Ic([ae()],Co.prototype,"intervalId",void 0);Ic([ae()],Co.prototype,"selectedOnRampProvider",void 0);Ic([ae()],Co.prototype,"uri",void 0);Ic([ae()],Co.prototype,"ready",void 0);Ic([ae()],Co.prototype,"showRetry",void 0);Ic([ae()],Co.prototype,"buffering",void 0);Ic([ae()],Co.prototype,"error",void 0);Ic([ae()],Co.prototype,"startTime",void 0);Ic([Q({type:Boolean})],Co.prototype,"isMobile",void 0);Ic([Q()],Co.prototype,"onRetry",void 0);Co=Ic([ve("w3m-buy-in-progress-view")],Co);const j3e=Ie` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); scrollbar-width: none; @@ -6445,7 +6445,7 @@ function print() { __p += __j.call(arguments, '') } .all-wallets { flex-flow: column; } -`;var A4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let W1=class extends _e{constructor(){super(),this.unsubscribe=[],this.connectors=ut.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.features=qe.state.features,this.unsubscribe.push(ut.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),qe.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var w4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let F1=class extends _e{constructor(){super(),this.unsubscribe=[],this.connectors=ut.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.features=qe.state.features,this.unsubscribe.push(ut.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),qe.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` @@ -6462,7 +6462,7 @@ function print() { __p += __j.call(arguments, '') } `:q``:q``:null}onContinueWalletClick(){Ae.push("ConnectWallets")}};W1.styles=aye;A4([le()],W1.prototype,"connectors",void 0);A4([le()],W1.prototype,"authConnector",void 0);A4([le()],W1.prototype,"features",void 0);W1=A4([ye("w3m-connect-view")],W1);const cye=Te` + >`:q``:null}onContinueWalletClick(){Ce.push("ConnectWallets")}};F1.styles=j3e;w4([ae()],F1.prototype,"connectors",void 0);w4([ae()],F1.prototype,"authConnector",void 0);w4([ae()],F1.prototype,"features",void 0);F1=w4([ve("w3m-connect-view")],F1);const F3e=Ie` @keyframes shake { 0% { transform: translateX(0); @@ -6523,9 +6523,9 @@ function print() { __p += __j.call(arguments, '') } display: block; opacity: 1; } -`;var B0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};class so extends _e{constructor(){var e,r,n,i;super(),this.wallet=(e=Ae.state.data)==null?void 0:e.wallet,this.connector=(r=Ae.state.data)==null?void 0:r.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=Sr.getWalletImage(this.wallet)??Sr.getConnectorImage(this.connector),this.name=((n=this.wallet)==null?void 0:n.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=Lt.state.wcUri,this.error=Lt.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Lt.subscribeKey("wcUri",s=>{var o;this.uri=s,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(o=this.onConnect)==null||o.call(this))}),Lt.subscribeKey("wcError",s=>this.error=s),Lt.subscribeKey("buffering",s=>this.buffering=s))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var n;(n=this.onRender)==null||n.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let r=`Continue in ${this.name}`;return this.buffering&&(r="Connecting..."),this.error&&(r="Connection declined"),q` +`;var D0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};class eo extends _e{constructor(){var e,r,n,i;super(),this.wallet=(e=Ce.state.data)==null?void 0:e.wallet,this.connector=(r=Ce.state.data)==null?void 0:r.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=Sr.getWalletImage(this.wallet)??Sr.getConnectorImage(this.connector),this.name=((n=this.wallet)==null?void 0:n.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=Lt.state.wcUri,this.error=Lt.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Lt.subscribeKey("wcUri",s=>{var o;this.uri=s,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(o=this.onConnect)==null||o.call(this))}),Lt.subscribeKey("wcError",s=>this.error=s),Lt.subscribeKey("buffering",s=>this.buffering=s))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var n;(n=this.onRender)==null||n.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let r=`Continue in ${this.name}`;return this.buffering&&(r="Connecting..."),this.error&&(r="Connection declined"),q` - + ${this.error?null:this.loaderTemplate()} @@ -6576,12 +6576,12 @@ function print() { __p += __j.call(arguments, '') } `:null} - `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,r;this.buffering||(Lt.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(r=this.onConnect)==null||r.call(this))}loaderTemplate(){const e=vn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}onCopyUri(){try{this.uri&&(Ue.copyToClopboard(this.uri),St.showSuccess("Link copied"))}catch{St.showError("Failed to copy")}}}so.styles=cye;B0([le()],so.prototype,"uri",void 0);B0([le()],so.prototype,"error",void 0);B0([le()],so.prototype,"ready",void 0);B0([le()],so.prototype,"showRetry",void 0);B0([le()],so.prototype,"buffering",void 0);B0([Y({type:Boolean})],so.prototype,"isMobile",void 0);B0([Y()],so.prototype,"onRetry",void 0);var lye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let oM=class extends so{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");ot.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(ge.subscribeKey("activeCaipAddress",e=>{e&&jt.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==cr.COINBASE_SDK_CONNECTOR_ID||!this.error)&&(await Lt.connectExternal(this.connector,this.connector.chain),ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){ot.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};oM=lye([ye("w3m-connecting-external-view")],oM);const uye=Te` + `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,r;this.buffering||(Lt.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(r=this.onConnect)==null||r.call(this))}loaderTemplate(){const e=mn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}onCopyUri(){try{this.uri&&(Be.copyToClopboard(this.uri),St.showSuccess("Link copied"))}catch{St.showError("Failed to copy")}}}eo.styles=F3e;D0([ae()],eo.prototype,"uri",void 0);D0([ae()],eo.prototype,"error",void 0);D0([ae()],eo.prototype,"ready",void 0);D0([ae()],eo.prototype,"showRetry",void 0);D0([ae()],eo.prototype,"buffering",void 0);D0([Q({type:Boolean})],eo.prototype,"isMobile",void 0);D0([Q()],eo.prototype,"onRetry",void 0);var z3e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let KN=class extends eo{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");ot.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(pe.subscribeKey("activeCaipAddress",e=>{e&&jt.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==cr.COINBASE_SDK_CONNECTOR_ID||!this.error)&&(await Lt.connectExternal(this.connector,this.connector.chain),ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){ot.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};KN=z3e([ve("w3m-connecting-external-view")],KN);const W3e=Ie` wui-flex, wui-list-wallet { width: 100%; } -`;var eF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let O5=class extends _e{constructor(){super(),this.unsubscribe=[],this.activeConnector=ge.state.activeConnector,this.unsubscribe.push(ge.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return q` +`;var Bj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let k5=class extends _e{constructor(){super(),this.unsubscribe=[],this.activeConnector=pe.state.activeConnector,this.unsubscribe.push(pe.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return q` `}networksTemplate(){var e,r;return(r=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:r.map(n=>n.name?q` this.onConnector(n)} > - `:null)}onConnector(e){var n,i;const r=(i=(n=this.activeConnector)==null?void 0:n.connectors)==null?void 0:i.find(s=>s.chain===e.chain);if(!r){St.showError("Failed to find connector");return}r.type==="WALLET_CONNECT"?Ue.isMobile()?Ae.push("AllWallets"):Ae.push("ConnectingWalletConnect"):Ae.push("ConnectingExternal",{connector:r})}};O5.styles=uye;eF([le()],O5.prototype,"activeConnector",void 0);O5=eF([ye("w3m-connecting-multi-chain-view")],O5);var ZE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let D5=class extends _e{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=Ae.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),Tn.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(this.determinePlatforms(),q` + `:null)}onConnector(e){var n,i;const r=(i=(n=this.activeConnector)==null?void 0:n.connectors)==null?void 0:i.find(s=>s.chain===e.chain);if(!r){St.showError("Failed to find connector");return}r.type==="WALLET_CONNECT"?Be.isMobile()?Ce.push("AllWallets"):Ce.push("ConnectingWalletConnect"):Ce.push("ConnectingExternal",{connector:r})}};k5.styles=W3e;Bj([ae()],k5.prototype,"activeConnector",void 0);k5=Bj([ve("w3m-connecting-multi-chain-view")],k5);var BE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let P5=class extends _e{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=Ce.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),Sn.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(this.determinePlatforms(),q` ${this.headerTemplate()}
${this.platformTemplate()}
- `):q``}async initializeConnection(e=!1){try{const{wcPairingExpiry:r}=Lt.state;(e||Ue.isPairingExpired(r))&&(await Lt.connectWalletConnect(),this.finalizeConnection(),vr.getConnectedConnector()==="AUTH"&&qe.state.hasMultipleAddresses?Ae.push("SelectAddresses"):jt.close())}catch(r){ot.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),Lt.setWcError(!0),Ue.isAllowedRetry(this.lastRetry)&&(St.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var n;const{wcLinking:e,recentWallet:r}=Lt.state;e&&vr.setWalletConnectDeepLink(e),r&&vr.setAppKitRecent(r),ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((n=this.wallet)==null?void 0:n.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet)throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet");if(this.platform)return;const{mobile_link:e,desktop_link:r,webapp_link:n,injected:i,rdns:s}=this.wallet,o=i==null?void 0:i.map(({injected_id:x})=>x).filter(Boolean),a=s?[s]:o??[],c=qe.state.isUniversalProvider?!1:a.length,l=e,d=n,f=Lt.checkInstalled(a),g=c&&f,v=r&&!Ue.isMobile();g&&this.platforms.push("browser"),l&&this.platforms.push(Ue.isMobile()?"mobile":"qrcode"),d&&this.platforms.push("web"),v&&this.platforms.push("desktop"),!g&&c&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return q``;case"desktop":return q` + `):q``}async initializeConnection(e=!1){try{const{wcPairingExpiry:r}=Lt.state;(e||Be.isPairingExpired(r))&&(await Lt.connectWalletConnect(),this.finalizeConnection(),vr.getConnectedConnector()==="AUTH"&&qe.state.hasMultipleAddresses?Ce.push("SelectAddresses"):jt.close())}catch(r){ot.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),Lt.setWcError(!0),Be.isAllowedRetry(this.lastRetry)&&(St.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var n;const{wcLinking:e,recentWallet:r}=Lt.state;e&&vr.setWalletConnectDeepLink(e),r&&vr.setAppKitRecent(r),ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((n=this.wallet)==null?void 0:n.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet)throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet");if(this.platform)return;const{mobile_link:e,desktop_link:r,webapp_link:n,injected:i,rdns:s}=this.wallet,o=i==null?void 0:i.map(({injected_id:x})=>x).filter(Boolean),a=s?[s]:o??[],c=qe.state.isUniversalProvider?!1:a.length,l=e,d=n,h=Lt.checkInstalled(a),g=c&&h,v=r&&!Be.isMobile();g&&this.platforms.push("browser"),l&&this.platforms.push(Be.isMobile()?"mobile":"qrcode"),d&&this.platforms.push("web"),v&&this.platforms.push("desktop"),!g&&c&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return q``;case"desktop":return q` this.initializeConnection(!0)}> `;case"web":return q` @@ -6641,11 +6641,11 @@ function print() { __p += __j.call(arguments, '') } .onSelectPlatfrom=${this.onSelectPlatform.bind(this)} > - `:null}async onSelectPlatform(e){var n;const r=(n=this.shadowRoot)==null?void 0:n.querySelector("div");r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};ZE([le()],D5.prototype,"platform",void 0);ZE([le()],D5.prototype,"platforms",void 0);D5=ZE([ye("w3m-connecting-wc-view")],D5);const dye=Te` + `:null}async onSelectPlatform(e){var n;const r=(n=this.shadowRoot)==null?void 0:n.querySelector("div");r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};BE([ae()],P5.prototype,"platform",void 0);BE([ae()],P5.prototype,"platforms",void 0);P5=BE([ve("w3m-connecting-wc-view")],P5);const H3e=Ie` .continue-button-container { width: 100%; } -`;var tF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let L5=class extends _e{constructor(){super(...arguments),this.loading=!1}render(){return q` +`;var Uj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let R5=class extends _e{constructor(){super(...arguments),this.loading=!1}render(){return q` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {Ue.openHref(HA.URLS.FAQ,"_blank")}} + @click=${()=>{Be.openHref(MA.URLS.FAQ,"_blank")}} > Learn more about names @@ -6697,7 +6697,7 @@ function print() { __p += __j.call(arguments, '') } @click=${this.handleContinue.bind(this)} >Choose name - `}handleContinue(){Ae.push("RegisterAccountName"),ot.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}})}};L5.styles=dye;tF([le()],L5.prototype,"loading",void 0);L5=tF([ye("w3m-choose-account-name-view")],L5);var fye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let aM=class extends _e{constructor(){var e;super(...arguments),this.wallet=(e=Ae.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return q` +
`}handleContinue(){Ce.push("RegisterAccountName"),ot.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}})}};R5.styles=H3e;Uj([ae()],R5.prototype,"loading",void 0);R5=Uj([ve("w3m-choose-account-name-view")],R5);var q3e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let GN=class extends _e{constructor(){var e;super(...arguments),this.wallet=(e=Ce.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return q` ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} ${this.homepageTemplate()} @@ -6736,7 +6736,7 @@ function print() { __p += __j.call(arguments, '') } > Website - `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&Ue.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&Ue.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&Ue.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&Ue.openHref(this.wallet.homepage,"_blank")}};aM=fye([ye("w3m-downloads-view")],aM);var hye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const pye="https://walletconnect.com/explorer";let cM=class extends _e{render(){return q` + `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&Be.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&Be.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&Be.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&Be.openHref(this.wallet.homepage,"_blank")}};GN=q3e([ve("w3m-downloads-view")],GN);var V3e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const K3e="https://walletconnect.com/explorer";let ZN=class extends _e{render(){return q` ${this.recommendedWalletsTemplate()} {Ue.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} + @click=${()=>{Be.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} > `}recommendedWalletsTemplate(){const{recommended:e,featured:r}=Tt.state,{customWallets:n}=qe.state;return[...r,...n??[],...e].slice(0,4).map(s=>q` {Ue.openHref(s.homepage??pye,"_blank")}} + imageSrc=${et(Sr.getWalletImage(s))} + @click=${()=>{Be.openHref(s.homepage??K3e,"_blank")}} > - `)}};cM=hye([ye("w3m-get-wallet-view")],cM);const gye=Te` + `)}};ZN=V3e([ve("w3m-get-wallet-view")],ZN);const G3e=Ie` wui-flex { width: 100%; } @@ -6785,14 +6785,14 @@ function print() { __p += __j.call(arguments, '') } right: 20px; transform: translateY(11px); } -`;var $f=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Il=class extends _e{constructor(){super(),this.formRef=af(),this.usubscribe=[],this.name="",this.error="",this.loading=Kc.state.loading,this.suggestions=Kc.state.suggestions,this.registered=!1,this.profileName=Se.state.profileName,this.onDebouncedNameInputChange=Ue.debounce(e=>{Kc.validateName(e)?(this.error="",this.name=e,Kc.getSuggestions(e),Kc.isNameRegistered(e).then(r=>{this.registered=r})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(Kc.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}),Se.subscribeKey("profileName",e=>{this.profileName=e,e&&(this.error="You already own a name")}))}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var e;super.disconnectedCallback(),this.usubscribe.forEach(r=>r()),(e=this.formRef.value)==null||e.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return q` +`;var Pf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Al=class extends _e{constructor(){super(),this.formRef=nf(),this.usubscribe=[],this.name="",this.error="",this.loading=Hc.state.loading,this.suggestions=Hc.state.suggestions,this.registered=!1,this.profileName=Ee.state.profileName,this.onDebouncedNameInputChange=Be.debounce(e=>{Hc.validateName(e)?(this.error="",this.name=e,Hc.getSuggestions(e),Hc.isNameRegistered(e).then(r=>{this.registered=r})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(Hc.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}),Ee.subscribeKey("profileName",e=>{this.profileName=e,e&&(this.error="You already own a name")}))}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var e;super.disconnectedCallback(),this.usubscribe.forEach(r=>r()),(e=this.formRef.value)==null||e.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return q` -
+ Available - `}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&Kc.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;const e=`${this.name}${xn.WC_NAME_SUFFIX}`;ot.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}}),await Kc.registerName(e),ot.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}})}catch(e){St.showError(e.message),ot.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${xn.WC_NAME_SUFFIX}`,error:(e==null?void 0:e.message)||"Unknown error"}})}}onEnterKey(e){e.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};Il.styles=gye;$f([Y()],Il.prototype,"errorMessage",void 0);$f([le()],Il.prototype,"name",void 0);$f([le()],Il.prototype,"error",void 0);$f([le()],Il.prototype,"loading",void 0);$f([le()],Il.prototype,"suggestions",void 0);$f([le()],Il.prototype,"registered",void 0);$f([le()],Il.prototype,"profileName",void 0);Il=$f([ye("w3m-register-account-name-view")],Il);const mye=Te` + `}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&Hc.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;const e=`${this.name}${yn.WC_NAME_SUFFIX}`;ot.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}}),await Hc.registerName(e),ot.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}})}catch(e){St.showError(e.message),ot.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${yn.WC_NAME_SUFFIX}`,error:(e==null?void 0:e.message)||"Unknown error"}})}}onEnterKey(e){e.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};Al.styles=G3e;Pf([Q()],Al.prototype,"errorMessage",void 0);Pf([ae()],Al.prototype,"name",void 0);Pf([ae()],Al.prototype,"error",void 0);Pf([ae()],Al.prototype,"loading",void 0);Pf([ae()],Al.prototype,"suggestions",void 0);Pf([ae()],Al.prototype,"registered",void 0);Pf([ae()],Al.prototype,"profileName",void 0);Al=Pf([ve("w3m-register-account-name-view")],Al);const Z3e=Ie` .continue-button-container { width: 100%; } -`;var wye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ZC=class extends _e{render(){return q` +`;var Q3e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let F_=class extends _e{render(){return q` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {Ue.openHref(HA.URLS.FAQ,"_blank")}} + @click=${()=>{Be.openHref(MA.URLS.FAQ,"_blank")}} > Learn more @@ -6885,7 +6885,7 @@ function print() { __p += __j.call(arguments, '') } Let's Go! - `}redirectToAccount(){Ae.replace("Account")}};ZC.styles=mye;ZC=wye([ye("w3m-register-account-name-success-view")],ZC);const vye=Te` + `}redirectToAccount(){Ce.replace("Account")}};F_.styles=Z3e;F_=Q3e([ve("w3m-register-account-name-success-view")],F_);const Y3e=Ie` @keyframes shake { 0% { transform: translateX(0); @@ -6938,7 +6938,7 @@ function print() { __p += __j.call(arguments, '') } display: block; opacity: 1; } -`;var QE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let mv=class extends _e{constructor(){var e;super(),this.network=(e=Ae.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),r=this.getSubLabel();return q` +`;var UE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let pv=class extends _e{constructor(){var e;super(),this.network=(e=Ce.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),r=this.getSubLabel();return q` ${this.error?null:q``} @@ -6981,7 +6981,7 @@ function print() { __p += __j.call(arguments, '') } Try again - `}getSubLabel(){const e=vr.getConnectedConnector();return ut.getAuthConnector()&&e==="AUTH"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var n;const e=vr.getConnectedConnector();return ut.getAuthConnector()&&e==="AUTH"?`Switching to ${((n=this.network)==null?void 0:n.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await Zt.switchActiveNetwork(this.network)}catch{this.error=!0}}};mv.styles=vye;QE([le()],mv.prototype,"showRetry",void 0);QE([le()],mv.prototype,"error",void 0);mv=QE([ye("w3m-network-switch-view")],mv);const yye=Te` + `}getSubLabel(){const e=vr.getConnectedConnector();return ut.getAuthConnector()&&e==="AUTH"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var n;const e=vr.getConnectedConnector();return ut.getAuthConnector()&&e==="AUTH"?`Switching to ${((n=this.network)==null?void 0:n.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await Zt.switchActiveNetwork(this.network)}catch{this.error=!0}}};pv.styles=Y3e;UE([ae()],pv.prototype,"showRetry",void 0);UE([ae()],pv.prototype,"error",void 0);pv=UE([ve("w3m-network-switch-view")],pv);const J3e=Ie` .container { max-height: 360px; overflow: auto; @@ -6990,7 +6990,7 @@ function print() { __p += __j.call(arguments, '') } .container::-webkit-scrollbar { display: none; } -`;var I2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let r0=class extends _e{constructor(){super(),this.unsubscribe=[],this.network=ge.state.activeCaipNetwork,this.requestedCaipNetworks=Zt.getRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=Ue.debounce(e=>{this.search=e},100),this.unsubscribe.push(ge.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var E2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let e0=class extends _e{constructor(){super(),this.unsubscribe=[],this.network=pe.state.activeCaipNetwork,this.requestedCaipNetworks=Zt.getRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=Be.debounce(e=>{this.search=e},100),this.unsubscribe.push(pe.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.templateSearchInput()} - `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){ot.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),Ae.push("WhatIsANetwork")}networksTemplate(){var i;const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=Ue.sortRequestedNetworks(r,e);return this.search?this.filteredNetworks=n==null?void 0:n.filter(s=>{var o;return(o=s==null?void 0:s.name)==null?void 0:o.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=n,(i=this.filteredNetworks)==null?void 0:i.map(s=>{var o;return q` + `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){ot.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),Ce.push("WhatIsANetwork")}networksTemplate(){var i;const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=Be.sortRequestedNetworks(r,e);return this.search?this.filteredNetworks=n==null?void 0:n.filter(s=>{var o;return(o=s==null?void 0:s.name)==null?void 0:o.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=n,(i=this.filteredNetworks)==null?void 0:i.map(s=>{var o;return q` this.onSwitchNetwork(s)} .disabled=${this.getNetworkDisabled(s)} data-testid=${`w3m-network-switch-${s.name??s.id}`} > - `})}getNetworkDisabled(e){const r=e.chainNamespace,n=Se.getCaipAddress(r),i=ge.getAllApprovedCaipNetworks(),s=ge.getNetworkProp("supportsAllNetworks",r)!==!1,o=vr.getConnectedConnector(),a=ut.getAuthConnector();return!n||s||o==="AUTH"&&a?!1:!(i!=null&&i.includes(e.id))}async onSwitchNetwork(e){var d;const r=Se.state.caipAddress,n=Se.getCaipAddress(e.chainNamespace),i=e.id===((d=this.network)==null?void 0:d.id),s=Zt.state.supportsAllNetworks,o=Ae.state.data,a=vr.getConnectedConnector(),c=ut.getAuthConnector(),l=a==="AUTH"&&c;i||(n?s||l?Ae.push("SwitchNetwork",{...o,network:e}):await Zt.switchActiveNetwork(e):ge.state.noAdapters?Ae.push("ConnectingWalletConnect"):l?Ae.push("SwitchNetwork",{...o,network:e}):r?Ae.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):Zt.setActiveCaipNetwork(e))}};r0.styles=yye;I2([le()],r0.prototype,"network",void 0);I2([le()],r0.prototype,"requestedCaipNetworks",void 0);I2([le()],r0.prototype,"filteredNetworks",void 0);I2([le()],r0.prototype,"search",void 0);r0=I2([ye("w3m-networks-view")],r0);const bye=Te` + `})}getNetworkDisabled(e){const r=e.chainNamespace,n=Ee.getCaipAddress(r),i=pe.getAllApprovedCaipNetworks(),s=pe.getNetworkProp("supportsAllNetworks",r)!==!1,o=vr.getConnectedConnector(),a=ut.getAuthConnector();return!n||s||o==="AUTH"&&a?!1:!(i!=null&&i.includes(e.id))}async onSwitchNetwork(e){var d;const r=Ee.state.caipAddress,n=Ee.getCaipAddress(e.chainNamespace),i=e.id===((d=this.network)==null?void 0:d.id),s=Zt.state.supportsAllNetworks,o=Ce.state.data,a=vr.getConnectedConnector(),c=ut.getAuthConnector(),l=a==="AUTH"&&c;i||(n?s||l?Ce.push("SwitchNetwork",{...o,network:e}):await Zt.switchActiveNetwork(e):pe.state.noAdapters?Ce.push("ConnectingWalletConnect"):l?Ce.push("SwitchNetwork",{...o,network:e}):r?Ce.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):Zt.setActiveCaipNetwork(e))}};e0.styles=J3e;E2([ae()],e0.prototype,"network",void 0);E2([ae()],e0.prototype,"requestedCaipNetworks",void 0);E2([ae()],e0.prototype,"filteredNetworks",void 0);E2([ae()],e0.prototype,"search",void 0);e0=E2([ve("w3m-networks-view")],e0);const X3e=Ie` :host > wui-flex { height: 500px; overflow-y: auto; @@ -7056,23 +7056,23 @@ function print() { __p += __j.call(arguments, '') } wui-transaction-list-item-loader { width: 100%; } -`;var T2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const xye=7;let n0=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Ur.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=ri.state.coinbaseTransactions,this.tokenImages=Sn.state.tokenImages,this.unsubscribe.push(Ur.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),Sn.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},ri.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),ri.clearCursor(),this.fetchTransactions()}render(){return q` +`;var S2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const eye=7;let t0=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Ur.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=ti.state.coinbaseTransactions,this.tokenImages=An.state.tokenImages,this.unsubscribe.push(Ur.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),An.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},ti.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),ti.clearCursor(),this.fetchTransactions()}render(){return q` ${this.loading?this.templateLoading():this.templateTransactionsByYear()} - `}templateTransactions(e){return e==null?void 0:e.map(r=>{var a,c,l;const n=WA.formatDate((a=r==null?void 0:r.metadata)==null?void 0:a.minedAt),i=r.transfers[0],s=i==null?void 0:i.fungible_info;if(!s)return null;const o=((c=s==null?void 0:s.icon)==null?void 0:c.url)||((l=this.tokenImages)==null?void 0:l[s.symbol||""]);return q` + `}templateTransactions(e){return e==null?void 0:e.map(r=>{var a,c,l;const n=NA.formatDate((a=r==null?void 0:r.metadata)==null?void 0:a.minedAt),i=r.transfers[0],s=i==null?void 0:i.fungible_info;if(!s)return null;const o=((c=s==null?void 0:s.icon)==null?void 0:c.url)||((l=this.tokenImages)==null?void 0:l[s.symbol||""]);return q` - `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(r=>{const n=parseInt(r,10);return new Array(12).fill(null).map((s,o)=>o).reverse().map(s=>{var c;const o=gh.getTransactionGroupTitle(n,s),a=(c=this.coinbaseTransactions[n])==null?void 0:c[s];return a?q` + `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(r=>{const n=parseInt(r,10);return new Array(12).fill(null).map((s,o)=>o).reverse().map(s=>{var c;const o=hh.getTransactionGroupTitle(n,s),a=(c=this.coinbaseTransactions[n])==null?void 0:c[s];return a?q` - `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=Se.state.address,r=qe.state.projectId;if(!e)throw new Error("No address found");if(!r)throw new Error("No projectId found");this.loading=!0,await ri.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var i;const e=new Date;if((((i=this.coinbaseTransactions[e.getFullYear()])==null?void 0:i[e.getMonth()])||[]).filter(s=>s.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const s=Se.state.address;await ri.fetchTransactions(s,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(xye).fill(q` `).map(e=>e)}};n0.styles=bye;T2([le()],n0.prototype,"selectedOnRampProvider",void 0);T2([le()],n0.prototype,"loading",void 0);T2([le()],n0.prototype,"coinbaseTransactions",void 0);T2([le()],n0.prototype,"tokenImages",void 0);n0=T2([ye("w3m-onramp-activity-view")],n0);const Cye=Te` + `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=Ee.state.address,r=qe.state.projectId;if(!e)throw new Error("No address found");if(!r)throw new Error("No projectId found");this.loading=!0,await ti.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var i;const e=new Date;if((((i=this.coinbaseTransactions[e.getFullYear()])==null?void 0:i[e.getMonth()])||[]).filter(s=>s.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const s=Ee.state.address;await ti.fetchTransactions(s,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(eye).fill(q` `).map(e=>e)}};t0.styles=X3e;S2([ae()],t0.prototype,"selectedOnRampProvider",void 0);S2([ae()],t0.prototype,"loading",void 0);S2([ae()],t0.prototype,"coinbaseTransactions",void 0);S2([ae()],t0.prototype,"tokenImages",void 0);t0=S2([ve("w3m-onramp-activity-view")],t0);const tye=Ie` :host > wui-grid { max-height: 360px; overflow: auto; @@ -7094,25 +7094,25 @@ function print() { __p += __j.call(arguments, '') } wui-grid::-webkit-scrollbar { display: none; } -`;var E4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let H1=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ur.state.paymentCurrency,this.currencies=Ur.state.paymentCurrencies,this.currencyImages=Sn.state.currencyImages,this.unsubscribe.push(Ur.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),Sn.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var v4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let z1=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ur.state.paymentCurrency,this.currencies=Ur.state.paymentCurrencies,this.currencyImages=An.state.currencyImages,this.unsubscribe.push(Ur.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),An.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.currenciesTemplate()} `}currenciesTemplate(){return this.currencies.map(e=>{var r;return q` this.selectCurrency(e)} variant="image" > ${e.id} - `})}selectCurrency(e){e&&(Ur.setPaymentCurrency(e),jt.close())}};H1.styles=Cye;E4([le()],H1.prototype,"selectedCurrency",void 0);E4([le()],H1.prototype,"currencies",void 0);E4([le()],H1.prototype,"currencyImages",void 0);H1=E4([ye("w3m-onramp-fiat-select-view")],H1);var rF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let QC=class extends _e{constructor(){super(),this.unsubscribe=[],this.providers=Ur.state.providers,this.unsubscribe.push(Ur.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async r=>r.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(r==null?void 0:r.url));Promise.all(e).then(r=>{this.providers=this.providers.map((n,i)=>({...n,url:r[i]||""}))})}render(){return q` + `})}selectCurrency(e){e&&(Ur.setPaymentCurrency(e),jt.close())}};z1.styles=tye;v4([ae()],z1.prototype,"selectedCurrency",void 0);v4([ae()],z1.prototype,"currencies",void 0);v4([ae()],z1.prototype,"currencyImages",void 0);z1=v4([ve("w3m-onramp-fiat-select-view")],z1);var jj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let z_=class extends _e{constructor(){super(),this.unsubscribe=[],this.providers=Ur.state.providers,this.unsubscribe.push(Ur.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async r=>r.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(r==null?void 0:r.url));Promise.all(e).then(r=>{this.providers=this.providers.map((n,i)=>({...n,url:r[i]||""}))})}render(){return q` ${this.onRampProvidersTemplate()} - `}onRampProvidersTemplate(){return this.providers.filter(e=>e.supportedChains.includes(ge.state.activeChain??"eip155")).map(e=>q` + `}onRampProvidersTemplate(){return this.providers.filter(e=>e.supportedChains.includes(pe.state.activeChain??"eip155")).map(e=>q` {this.onClickProvider(e)}} ?disabled=${!e.url} > - `)}onClickProvider(e){Ur.setSelectedProvider(e),Ae.push("BuyInProgress"),Ue.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),ot.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const e=Se.state.address,r=ge.state.activeCaipNetwork;if(!e)throw new Error("No address found");if(!(r!=null&&r.name))throw new Error("No network found");const n=Tn.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[r.name]??Tn.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,i=Ur.state.purchaseCurrency,s=i?[i.symbol]:Ur.state.purchaseCurrencies.map(o=>o.symbol);return await bn.generateOnRampURL({defaultNetwork:n,destinationWallets:[{address:e,blockchains:Tn.WC_COINBASE_PAY_SDK_CHAINS,assets:s}],partnerUserId:e,purchaseAmount:Ur.state.purchaseAmount})}};rF([le()],QC.prototype,"providers",void 0);QC=rF([ye("w3m-onramp-providers-view")],QC);const _ye=Te` + `)}onClickProvider(e){Ur.setSelectedProvider(e),Ce.push("BuyInProgress"),Be.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),ot.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const e=Ee.state.address,r=pe.state.activeCaipNetwork;if(!e)throw new Error("No address found");if(!(r!=null&&r.name))throw new Error("No network found");const n=Sn.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[r.name]??Sn.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,i=Ur.state.purchaseCurrency,s=i?[i.symbol]:Ur.state.purchaseCurrencies.map(o=>o.symbol);return await vn.generateOnRampURL({defaultNetwork:n,destinationWallets:[{address:e,blockchains:Sn.WC_COINBASE_PAY_SDK_CHAINS,assets:s}],partnerUserId:e,purchaseAmount:Ur.state.purchaseAmount})}};jj([ae()],z_.prototype,"providers",void 0);z_=jj([ve("w3m-onramp-providers-view")],z_);const rye=Ie` :host > wui-grid { max-height: 360px; overflow: auto; @@ -7129,14 +7129,14 @@ function print() { __p += __j.call(arguments, '') } wui-grid::-webkit-scrollbar { display: none; } -`;var S4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let q1=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ur.state.purchaseCurrencies,this.tokens=Ur.state.purchaseCurrencies,this.tokenImages=Sn.state.tokenImages,this.unsubscribe.push(Ur.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),Sn.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var y4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let W1=class extends _e{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ur.state.purchaseCurrencies,this.tokens=Ur.state.purchaseCurrencies,this.tokenImages=An.state.tokenImages,this.unsubscribe.push(Ur.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),An.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.currenciesTemplate()} `}currenciesTemplate(){return this.tokens.map(e=>{var r;return q` this.selectToken(e)} variant="image" > @@ -7145,7 +7145,7 @@ function print() { __p += __j.call(arguments, '') } ${e.symbol} - `})}selectToken(e){e&&(Ur.setPurchaseCurrency(e),jt.close())}};q1.styles=_ye;S4([le()],q1.prototype,"selectedCurrency",void 0);S4([le()],q1.prototype,"tokens",void 0);S4([le()],q1.prototype,"tokenImages",void 0);q1=S4([ye("w3m-onramp-token-select-view")],q1);const Aye=Te` + `})}selectToken(e){e&&(Ur.setPurchaseCurrency(e),jt.close())}};W1.styles=rye;y4([ae()],W1.prototype,"selectedCurrency",void 0);y4([ae()],W1.prototype,"tokens",void 0);y4([ae()],W1.prototype,"tokenImages",void 0);W1=y4([ve("w3m-onramp-token-select-view")],W1);const nye=Ie` :host > wui-flex:first-child { overflow-y: auto; overflow-x: hidden; @@ -7241,11 +7241,11 @@ function print() { __p += __j.call(arguments, '') } border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); } -`;var $i=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let si=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(e=ge.state.activeCaipNetwork)==null?void 0:e.id,this.initialized=et.state.initialized,this.loadingQuote=et.state.loadingQuote,this.loadingPrices=et.state.loadingPrices,this.loadingTransaction=et.state.loadingTransaction,this.sourceToken=et.state.sourceToken,this.sourceTokenAmount=et.state.sourceTokenAmount,this.sourceTokenPriceInUSD=et.state.sourceTokenPriceInUSD,this.toToken=et.state.toToken,this.toTokenAmount=et.state.toTokenAmount,this.toTokenPriceInUSD=et.state.toTokenPriceInUSD,this.inputError=et.state.inputError,this.gasPriceInUSD=et.state.gasPriceInUSD,this.fetchError=et.state.fetchError,this.onDebouncedGetSwapCalldata=Ue.debounce(async()=>{await et.swapTokens()},200),ge.subscribeKey("activeCaipNetwork",r=>{this.caipNetworkId!==(r==null?void 0:r.id)&&(this.caipNetworkId=r==null?void 0:r.id,et.resetState(),et.initializeState())}),this.unsubscribe.push(jt.subscribeKey("open",r=>{r||et.resetState()}),Ae.subscribeKey("view",r=>{r.includes("Swap")||et.resetValues()}),et.subscribe(r=>{this.initialized=r.initialized,this.loadingQuote=r.loadingQuote,this.loadingPrices=r.loadingPrices,this.loadingTransaction=r.loadingTransaction,this.sourceToken=r.sourceToken,this.sourceTokenAmount=r.sourceTokenAmount,this.sourceTokenPriceInUSD=r.sourceTokenPriceInUSD,this.toToken=r.toToken,this.toTokenAmount=r.toTokenAmount,this.toTokenPriceInUSD=r.toTokenPriceInUSD,this.inputError=r.inputError,this.gasPriceInUSD=r.gasPriceInUSD,this.fetchError=r.fetchError}))}firstUpdated(){et.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return q` +`;var Ni=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ii=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(e=pe.state.activeCaipNetwork)==null?void 0:e.id,this.initialized=Xe.state.initialized,this.loadingQuote=Xe.state.loadingQuote,this.loadingPrices=Xe.state.loadingPrices,this.loadingTransaction=Xe.state.loadingTransaction,this.sourceToken=Xe.state.sourceToken,this.sourceTokenAmount=Xe.state.sourceTokenAmount,this.sourceTokenPriceInUSD=Xe.state.sourceTokenPriceInUSD,this.toToken=Xe.state.toToken,this.toTokenAmount=Xe.state.toTokenAmount,this.toTokenPriceInUSD=Xe.state.toTokenPriceInUSD,this.inputError=Xe.state.inputError,this.gasPriceInUSD=Xe.state.gasPriceInUSD,this.fetchError=Xe.state.fetchError,this.onDebouncedGetSwapCalldata=Be.debounce(async()=>{await Xe.swapTokens()},200),pe.subscribeKey("activeCaipNetwork",r=>{this.caipNetworkId!==(r==null?void 0:r.id)&&(this.caipNetworkId=r==null?void 0:r.id,Xe.resetState(),Xe.initializeState())}),this.unsubscribe.push(jt.subscribeKey("open",r=>{r||Xe.resetState()}),Ce.subscribeKey("view",r=>{r.includes("Swap")||Xe.resetValues()}),Xe.subscribe(r=>{this.initialized=r.initialized,this.loadingQuote=r.loadingQuote,this.loadingPrices=r.loadingPrices,this.loadingTransaction=r.loadingTransaction,this.sourceToken=r.sourceToken,this.sourceTokenAmount=r.sourceTokenAmount,this.sourceTokenPriceInUSD=r.sourceTokenPriceInUSD,this.toToken=r.toToken,this.toTokenAmount=r.toTokenAmount,this.toTokenPriceInUSD=r.toTokenPriceInUSD,this.inputError=r.inputError,this.gasPriceInUSD=r.gasPriceInUSD,this.fetchError=r.fetchError}))}firstUpdated(){Xe.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return q` ${this.initialized?this.templateSwap():this.templateLoading()} - `}watchTokensAndValues(){this.interval=setInterval(()=>{et.getNetworkTokenPrice(),et.getMyTokensWithBalance(),et.swapTokens()},1e4)}templateSwap(){return q` + `}watchTokensAndValues(){this.interval=setInterval(()=>{Xe.getNetworkTokenPrice(),Xe.getMyTokensWithBalance(),Xe.swapTokens()},1e4)}templateSwap(){return q` ${this.templateTokenInput("sourceToken",this.sourceToken)} @@ -7268,7 +7268,7 @@ function print() { __p += __j.call(arguments, '') } ${this.templateActionButton()} - `}templateTokenInput(e,r){var a,c;const n=(a=et.state.myTokensWithBalance)==null?void 0:a.find(l=>(l==null?void 0:l.address)===(r==null?void 0:r.address)),i=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,s=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let o=parseFloat(i)*s;return e==="toToken"&&(o-=this.gasPriceInUSD||0),q`(l==null?void 0:l.address)===(r==null?void 0:r.address)),i=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,s=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let o=parseFloat(i)*s;return e==="toToken"&&(o-=this.gasPriceInUSD||0),q``}onSetMaxValue(e,r){const n=e==="sourceToken"?this.sourceToken:this.toToken,i=(n==null?void 0:n.address)===Zt.getActiveNetworkTokenAddress();let s="0";if(!r){s="0",this.handleChangeAmount(e,s);return}if(!this.gasPriceInUSD){s=r,this.handleChangeAmount(e,s);return}const o=Pr.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),a=i?Pr.bigNumber(r).minus(o):Pr.bigNumber(r);this.handleChangeAmount(e,a.isGreaterThan(0)?a.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:q``}handleChangeAmount(e,r){et.clearError(),e==="sourceToken"?et.setSourceTokenAmount(r):et.setToTokenAmount(r),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,r=!this.sourceTokenAmount,n=this.loadingQuote||this.loadingPrices||this.loadingTransaction,i=n||e||r||this.inputError;return q` + >`}onSetMaxValue(e,r){const n=e==="sourceToken"?this.sourceToken:this.toToken,i=(n==null?void 0:n.address)===Zt.getActiveNetworkTokenAddress();let s="0";if(!r){s="0",this.handleChangeAmount(e,s);return}if(!this.gasPriceInUSD){s=r,this.handleChangeAmount(e,s);return}const o=Rr.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),a=i?Rr.bigNumber(r).minus(o):Rr.bigNumber(r);this.handleChangeAmount(e,a.isGreaterThan(0)?a.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:q``}handleChangeAmount(e,r){Xe.clearError(),e==="sourceToken"?Xe.setSourceTokenAmount(r):Xe.setToTokenAmount(r),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,r=!this.sourceTokenAmount,n=this.loadingQuote||this.loadingPrices||this.loadingTransaction,i=n||e||r||this.inputError;return q` ${this.actionButtonLabel()} - `}onSwitchTokens(){et.switchTokens()}onSwapPreview(){var e,r;if(this.fetchError){et.swapTokens();return}ot.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:((e=this.sourceToken)==null?void 0:e.symbol)||"",swapToToken:((r=this.toToken)==null?void 0:r.symbol)||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:Se.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ae.push("SwapPreview")}};si.styles=Aye;$i([le()],si.prototype,"interval",void 0);$i([le()],si.prototype,"detailsOpen",void 0);$i([le()],si.prototype,"caipNetworkId",void 0);$i([le()],si.prototype,"initialized",void 0);$i([le()],si.prototype,"loadingQuote",void 0);$i([le()],si.prototype,"loadingPrices",void 0);$i([le()],si.prototype,"loadingTransaction",void 0);$i([le()],si.prototype,"sourceToken",void 0);$i([le()],si.prototype,"sourceTokenAmount",void 0);$i([le()],si.prototype,"sourceTokenPriceInUSD",void 0);$i([le()],si.prototype,"toToken",void 0);$i([le()],si.prototype,"toTokenAmount",void 0);$i([le()],si.prototype,"toTokenPriceInUSD",void 0);$i([le()],si.prototype,"inputError",void 0);$i([le()],si.prototype,"gasPriceInUSD",void 0);$i([le()],si.prototype,"fetchError",void 0);si=$i([ye("w3m-swap-view")],si);const Eye=Te` + `}onSwitchTokens(){Xe.switchTokens()}onSwapPreview(){var e,r;if(this.fetchError){Xe.swapTokens();return}ot.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:((e=this.sourceToken)==null?void 0:e.symbol)||"",swapToToken:((r=this.toToken)==null?void 0:r.symbol)||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:Ee.state.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ce.push("SwapPreview")}};ii.styles=nye;Ni([ae()],ii.prototype,"interval",void 0);Ni([ae()],ii.prototype,"detailsOpen",void 0);Ni([ae()],ii.prototype,"caipNetworkId",void 0);Ni([ae()],ii.prototype,"initialized",void 0);Ni([ae()],ii.prototype,"loadingQuote",void 0);Ni([ae()],ii.prototype,"loadingPrices",void 0);Ni([ae()],ii.prototype,"loadingTransaction",void 0);Ni([ae()],ii.prototype,"sourceToken",void 0);Ni([ae()],ii.prototype,"sourceTokenAmount",void 0);Ni([ae()],ii.prototype,"sourceTokenPriceInUSD",void 0);Ni([ae()],ii.prototype,"toToken",void 0);Ni([ae()],ii.prototype,"toTokenAmount",void 0);Ni([ae()],ii.prototype,"toTokenPriceInUSD",void 0);Ni([ae()],ii.prototype,"inputError",void 0);Ni([ae()],ii.prototype,"gasPriceInUSD",void 0);Ni([ae()],ii.prototype,"fetchError",void 0);ii=Ni([ve("w3m-swap-view")],ii);const iye=Ie` @keyframes shake { 0% { transform: translateX(0); @@ -7380,7 +7380,7 @@ function print() { __p += __j.call(arguments, '') } .capitalize { text-transform: capitalize; } -`;var nF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let B5=class extends _e{constructor(){var e,r,n,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=Ae.state.data)==null?void 0:e.switchToChain,this.navigateTo=(r=Ae.state.data)==null?void 0:r.navigateTo,this.navigateWithReplace=(n=Ae.state.data)==null?void 0:n.navigateWithReplace,this.caipNetwork=(i=Ae.state.data)==null?void 0:i.network,this.activeChain=ge.state.activeChain}firstUpdated(){this.unsubscribe.push(ge.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?xn.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const r=this.switchToChain==="eip155"?"Ethereum":this.switchToChain;return q` +`;var Fj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let N5=class extends _e{constructor(){var e,r,n,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=Ce.state.data)==null?void 0:e.switchToChain,this.navigateTo=(r=Ce.state.data)==null?void 0:r.navigateTo,this.navigateWithReplace=(n=Ce.state.data)==null?void 0:n.navigateWithReplace,this.caipNetwork=(i=Ce.state.data)==null?void 0:i.network,this.activeChain=pe.state.activeChain}firstUpdated(){this.unsubscribe.push(pe.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?yn.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const r=this.switchToChain==="eip155"?"Ethereum":this.switchToChain;return q` Switch - `}async switchActiveChain(){this.switchToChain&&(await Zt.switchActiveNetwork(this.caipNetwork),jt.close(),jt.open({view:"Connect"}))}};B5.styles=Eye;nF([Y()],B5.prototype,"activeChain",void 0);B5=nF([ye("w3m-switch-active-chain-view")],B5);const Sye=Te` + `}async switchActiveChain(){this.switchToChain&&(await Zt.switchActiveNetwork(this.caipNetwork),jt.close(),jt.open({view:"Connect"}))}};N5.styles=iye;Fj([Q()],N5.prototype,"activeChain",void 0);N5=Fj([ve("w3m-switch-active-chain-view")],N5);const sye=Ie` :host > wui-flex:first-child { overflow-y: auto; overflow-x: hidden; @@ -7539,11 +7539,11 @@ function print() { __p += __j.call(arguments, '') } border-radius: var(--wui-border-radius-xxs); background: var(--wui-color-gray-glass-002); } -`;var oi=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Vn=class extends _e{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=et.state.approvalTransaction,this.swapTransaction=et.state.swapTransaction,this.sourceToken=et.state.sourceToken,this.sourceTokenAmount=et.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=et.state.sourceTokenPriceInUSD,this.toToken=et.state.toToken,this.toTokenAmount=et.state.toTokenAmount??"",this.toTokenPriceInUSD=et.state.toTokenPriceInUSD,this.caipNetwork=ge.state.activeCaipNetwork,this.balanceSymbol=Se.state.balanceSymbol,this.gasPriceInUSD=et.state.gasPriceInUSD,this.inputError=et.state.inputError,this.loadingQuote=et.state.loadingQuote,this.loadingApprovalTransaction=et.state.loadingApprovalTransaction,this.loadingBuildTransaction=et.state.loadingBuildTransaction,this.loadingTransaction=et.state.loadingTransaction,this.unsubscribe.push(Se.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&Ae.goBack()}),ge.subscribeKey("activeCaipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),et.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,e.inputError&&Ae.goBack(),this.loadingQuote=e.loadingQuote,this.loadingApprovalTransaction=e.loadingApprovalTransaction,this.loadingBuildTransaction=e.loadingBuildTransaction,this.loadingTransaction=e.loadingTransaction}))}firstUpdated(){et.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return q` +`;var si=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Hn=class extends _e{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=Xe.state.approvalTransaction,this.swapTransaction=Xe.state.swapTransaction,this.sourceToken=Xe.state.sourceToken,this.sourceTokenAmount=Xe.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=Xe.state.sourceTokenPriceInUSD,this.toToken=Xe.state.toToken,this.toTokenAmount=Xe.state.toTokenAmount??"",this.toTokenPriceInUSD=Xe.state.toTokenPriceInUSD,this.caipNetwork=pe.state.activeCaipNetwork,this.balanceSymbol=Ee.state.balanceSymbol,this.gasPriceInUSD=Xe.state.gasPriceInUSD,this.inputError=Xe.state.inputError,this.loadingQuote=Xe.state.loadingQuote,this.loadingApprovalTransaction=Xe.state.loadingApprovalTransaction,this.loadingBuildTransaction=Xe.state.loadingBuildTransaction,this.loadingTransaction=Xe.state.loadingTransaction,this.unsubscribe.push(Ee.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&Ce.goBack()}),pe.subscribeKey("activeCaipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),Xe.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,e.inputError&&Ce.goBack(),this.loadingQuote=e.loadingQuote,this.loadingApprovalTransaction=e.loadingApprovalTransaction,this.loadingBuildTransaction=e.loadingBuildTransaction,this.loadingTransaction=e.loadingTransaction}))}firstUpdated(){Xe.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return q` ${this.templateSwap()} - `}refreshTransaction(){this.interval=setInterval(()=>{et.getApprovalLoadingState()||et.getTransaction()},1e4)}templateSwap(){var c,l,d,f;const e=`${Rt.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(c=this.sourceToken)==null?void 0:c.symbol}`,r=`${Rt.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(l=this.toToken)==null?void 0:l.symbol}`,n=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,i=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),s=Rt.formatNumberToLocalString(n),o=Rt.formatNumberToLocalString(i),a=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return q` + `}refreshTransaction(){this.interval=setInterval(()=>{Xe.getApprovalLoadingState()||Xe.getTransaction()},1e4)}templateSwap(){var c,l,d,h;const e=`${Pt.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(c=this.sourceToken)==null?void 0:c.symbol}`,r=`${Pt.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(l=this.toToken)==null?void 0:l.symbol}`,n=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,i=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),s=Pt.formatNumberToLocalString(n),o=Pt.formatNumberToLocalString(i),a=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return q` @@ -7623,7 +7623,7 @@ function print() { __p += __j.call(arguments, '') } - `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:q``}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){Ae.goBack()}onSendTransaction(){this.approvalTransaction?et.sendTransactionForApproval(this.approvalTransaction):et.sendTransactionForSwap(this.swapTransaction)}};Vn.styles=Sye;oi([le()],Vn.prototype,"interval",void 0);oi([le()],Vn.prototype,"detailsOpen",void 0);oi([le()],Vn.prototype,"approvalTransaction",void 0);oi([le()],Vn.prototype,"swapTransaction",void 0);oi([le()],Vn.prototype,"sourceToken",void 0);oi([le()],Vn.prototype,"sourceTokenAmount",void 0);oi([le()],Vn.prototype,"sourceTokenPriceInUSD",void 0);oi([le()],Vn.prototype,"toToken",void 0);oi([le()],Vn.prototype,"toTokenAmount",void 0);oi([le()],Vn.prototype,"toTokenPriceInUSD",void 0);oi([le()],Vn.prototype,"caipNetwork",void 0);oi([le()],Vn.prototype,"balanceSymbol",void 0);oi([le()],Vn.prototype,"gasPriceInUSD",void 0);oi([le()],Vn.prototype,"inputError",void 0);oi([le()],Vn.prototype,"loadingQuote",void 0);oi([le()],Vn.prototype,"loadingApprovalTransaction",void 0);oi([le()],Vn.prototype,"loadingBuildTransaction",void 0);oi([le()],Vn.prototype,"loadingTransaction",void 0);Vn=oi([ye("w3m-swap-preview-view")],Vn);const Iye=Te` + `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:q``}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){Ce.goBack()}onSendTransaction(){this.approvalTransaction?Xe.sendTransactionForApproval(this.approvalTransaction):Xe.sendTransactionForSwap(this.swapTransaction)}};Hn.styles=sye;si([ae()],Hn.prototype,"interval",void 0);si([ae()],Hn.prototype,"detailsOpen",void 0);si([ae()],Hn.prototype,"approvalTransaction",void 0);si([ae()],Hn.prototype,"swapTransaction",void 0);si([ae()],Hn.prototype,"sourceToken",void 0);si([ae()],Hn.prototype,"sourceTokenAmount",void 0);si([ae()],Hn.prototype,"sourceTokenPriceInUSD",void 0);si([ae()],Hn.prototype,"toToken",void 0);si([ae()],Hn.prototype,"toTokenAmount",void 0);si([ae()],Hn.prototype,"toTokenPriceInUSD",void 0);si([ae()],Hn.prototype,"caipNetwork",void 0);si([ae()],Hn.prototype,"balanceSymbol",void 0);si([ae()],Hn.prototype,"gasPriceInUSD",void 0);si([ae()],Hn.prototype,"inputError",void 0);si([ae()],Hn.prototype,"loadingQuote",void 0);si([ae()],Hn.prototype,"loadingApprovalTransaction",void 0);si([ae()],Hn.prototype,"loadingBuildTransaction",void 0);si([ae()],Hn.prototype,"loadingTransaction",void 0);Hn=si([ve("w3m-swap-preview-view")],Hn);const oye=Ie` :host { --tokens-scroll--top-opacity: 0; --tokens-scroll--bottom-opacity: 1; @@ -7717,11 +7717,11 @@ function print() { __p += __j.call(arguments, '') } border-radius: var(--wui-border-radius-xs); box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); } -`;var Qu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let xc=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=Ae.state.data)==null?void 0:e.target,this.sourceToken=et.state.sourceToken,this.sourceTokenAmount=et.state.sourceTokenAmount,this.toToken=et.state.toToken,this.myTokensWithBalance=et.state.myTokensWithBalance,this.popularTokens=et.state.popularTokens,this.searchValue="",this.unsubscribe.push(et.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.myTokensWithBalance=r.myTokensWithBalance}))}updated(){var n,i;const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");r==null||r.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var n,i;super.disconnectedCallback();const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container"),r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),r==null||r.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return q` +`;var Ku=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let vc=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=Ce.state.data)==null?void 0:e.target,this.sourceToken=Xe.state.sourceToken,this.sourceTokenAmount=Xe.state.sourceTokenAmount,this.toToken=Xe.state.toToken,this.myTokensWithBalance=Xe.state.myTokensWithBalance,this.popularTokens=Xe.state.popularTokens,this.searchValue="",this.unsubscribe.push(Xe.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.myTokensWithBalance=r.myTokensWithBalance}))}updated(){var n,i;const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");r==null||r.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var n,i;super.disconnectedCallback();const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container"),r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),r==null||r.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return q` ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()} - `}onSelectToken(e){this.targetToken==="sourceToken"?et.setSourceToken(e):(et.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&et.swapTokens()),Ae.goBack()}templateSearchInput(){return q` + `}onSelectToken(e){this.targetToken==="sourceToken"?Xe.setSourceToken(e):(Xe.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&Xe.swapTokens()),Ce.goBack()}templateSearchInput(){return q` - `}templateSuggestedTokens(){const e=et.state.suggestedTokens?et.state.suggestedTokens.slice(0,8):null;return e?q` + `}templateSuggestedTokens(){const e=Xe.state.suggestedTokens?Xe.state.suggestedTokens.slice(0,8):null;return e?q` ${e.map(r=>q` `)} - `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",vy.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",vy.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",vy.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",vy.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,r){return e.filter(n=>`${n.symbol} ${n.name} ${n.address}`.toLowerCase().includes(r.toLowerCase()))}};xc.styles=Iye;Qu([le()],xc.prototype,"interval",void 0);Qu([le()],xc.prototype,"targetToken",void 0);Qu([le()],xc.prototype,"sourceToken",void 0);Qu([le()],xc.prototype,"sourceTokenAmount",void 0);Qu([le()],xc.prototype,"toToken",void 0);Qu([le()],xc.prototype,"myTokensWithBalance",void 0);Qu([le()],xc.prototype,"popularTokens",void 0);Qu([le()],xc.prototype,"searchValue",void 0);xc=Qu([ye("w3m-swap-select-token-view")],xc);const Tye=Te` + `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",gy.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",gy.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",gy.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",gy.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,r){return e.filter(n=>`${n.symbol} ${n.name} ${n.address}`.toLowerCase().includes(r.toLowerCase()))}};vc.styles=oye;Ku([ae()],vc.prototype,"interval",void 0);Ku([ae()],vc.prototype,"targetToken",void 0);Ku([ae()],vc.prototype,"sourceToken",void 0);Ku([ae()],vc.prototype,"sourceTokenAmount",void 0);Ku([ae()],vc.prototype,"toToken",void 0);Ku([ae()],vc.prototype,"myTokensWithBalance",void 0);Ku([ae()],vc.prototype,"popularTokens",void 0);Ku([ae()],vc.prototype,"searchValue",void 0);vc=Ku([ve("w3m-swap-select-token-view")],vc);const aye=Ie` :host > wui-flex:first-child { height: 500px; overflow-y: auto; @@ -7792,41 +7792,41 @@ function print() { __p += __j.call(arguments, '') } :host > wui-flex:first-child::-webkit-scrollbar { display: none; } -`;var kye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let YC=class extends _e{render(){return q` +`;var cye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let W_=class extends _e{render(){return q` - `}};YC.styles=Tye;YC=kye([ye("w3m-transactions-view")],YC);var Rye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Pye=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let lM=class extends _e{render(){return q` + `}};W_.styles=aye;W_=cye([ve("w3m-transactions-view")],W_);var lye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const uye=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let QN=class extends _e{render(){return q` - + {Ue.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} + @click=${()=>{Be.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} > Learn more - `}};lM=Rye([ye("w3m-what-is-a-network-view")],lM);var Nye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Mye=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let uM=class extends _e{render(){return q` + `}};QN=lye([ve("w3m-what-is-a-network-view")],QN);var dye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const fye=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let YN=class extends _e{render(){return q` - + Get a wallet - `}onGetWallet(){ot.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),Ae.push("GetWallet")}};uM=Nye([ye("w3m-what-is-a-wallet-view")],uM);var $ye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let dM=class extends _e{render(){return q` + `}onGetWallet(){ot.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),Ce.push("GetWallet")}};YN=dye([ve("w3m-what-is-a-wallet-view")],YN);var hye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let JN=class extends _e{render(){return q` - + Buy - `}};dM=$ye([ye("w3m-what-is-a-buy-view")],dM);const Oye=Te` + `}};JN=hye([ve("w3m-what-is-a-buy-view")],JN);const pye=Ie` wui-loading-spinner { margin: 9px auto; } @@ -7857,7 +7857,7 @@ function print() { __p += __j.call(arguments, '') } .email-display wui-text { max-width: 100%; } -`;var I4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const Dye=6;let Fu=class extends _e{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=Xi.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=Ae.state.data)==null?void 0:e.email,this.authConnector=ut.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,r=this.getFooterLabels(e);return q` +`;var b4=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const gye=6;let Bu=class extends _e{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=Qi.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=Ce.state.data)==null?void 0:e.email,this.authConnector=ut.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,r=this.getFooterLabels(e);return q` - `}startOTPTimeout(){this.timeoutTimeLeft=Xi.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=Xi.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var r;try{this.loading||(this.otp=e.detail,this.authConnector&&this.otp.length===Dye&&(this.loading=!0,await((r=this.onOtpSubmit)==null?void 0:r.call(this,this.otp))))}catch(n){this.error=Ue.parseError(n),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!ut.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),St.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){St.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};Fu.styles=Oye;I4([le()],Fu.prototype,"loading",void 0);I4([le()],Fu.prototype,"timeoutTimeLeft",void 0);I4([le()],Fu.prototype,"error",void 0);Fu=I4([ye("w3m-email-otp-widget")],Fu);var iF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let JC=class extends Fu{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=Se.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.authConnector){const r=Zt.checkIfSmartAccountEnabled();if(await this.authConnector.provider.connectOtp({otp:e}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),ge.state.activeChain)await Lt.connectExternal(this.authConnector,ge.state.activeChain);else throw new Error("Active chain is not set on ChainControll");ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),Se.state.allAccounts.length>1?Ae.push("SelectAddresses"):r&&!this.smartAccountDeployed?Ae.push("UpgradeToSmartAccount"):qe.state.isSiweEnabled||jt.close()}}catch(r){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(Se.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};iF([le()],JC.prototype,"smartAccountDeployed",void 0);JC=iF([ye("w3m-email-verify-otp-view")],JC);const Lye=Te` + `}startOTPTimeout(){this.timeoutTimeLeft=Qi.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=Qi.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var r;try{this.loading||(this.otp=e.detail,this.authConnector&&this.otp.length===gye&&(this.loading=!0,await((r=this.onOtpSubmit)==null?void 0:r.call(this,this.otp))))}catch(n){this.error=Be.parseError(n),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!ut.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),St.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){St.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};Bu.styles=pye;b4([ae()],Bu.prototype,"loading",void 0);b4([ae()],Bu.prototype,"timeoutTimeLeft",void 0);b4([ae()],Bu.prototype,"error",void 0);Bu=b4([ve("w3m-email-otp-widget")],Bu);var zj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let H_=class extends Bu{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=Ee.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.authConnector){const r=Zt.checkIfSmartAccountEnabled();if(await this.authConnector.provider.connectOtp({otp:e}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),pe.state.activeChain)await Lt.connectExternal(this.authConnector,pe.state.activeChain);else throw new Error("Active chain is not set on ChainControll");ot.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),Ee.state.allAccounts.length>1?Ce.push("SelectAddresses"):r&&!this.smartAccountDeployed?Ce.push("UpgradeToSmartAccount"):qe.state.isSiweEnabled||jt.close()}}catch(r){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(Ee.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};zj([ae()],H_.prototype,"smartAccountDeployed",void 0);H_=zj([ve("w3m-email-verify-otp-view")],H_);const mye=Ie` wui-icon-box { height: var(--wui-icon-box-size-xl); width: var(--wui-icon-box-size-xl); } -`;var sF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let U5=class extends _e{constructor(){var e;super(),this.email=(e=Ae.state.data)==null?void 0:e.email,this.authConnector=ut.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return q` +`;var Wj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let M5=class extends _e{constructor(){var e;super(),this.email=(e=Ce.state.data)==null?void 0:e.email,this.authConnector=ut.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return q` - `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),ot.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),Ae.replace("EmailVerifyOtp",{email:this.email})}catch{Ae.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),St.showSuccess("Code email resent")}}catch(e){St.showError(e)}finally{this.loading=!1}}};U5.styles=Lye;sF([le()],U5.prototype,"loading",void 0);U5=sF([ye("w3m-email-verify-device-view")],U5);const Bye=Te` + `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),ot.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),Ce.replace("EmailVerifyOtp",{email:this.email})}catch{Ce.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),St.showSuccess("Code email resent")}}catch(e){St.showError(e)}finally{this.loading=!1}}};M5.styles=mye;Wj([ae()],M5.prototype,"loading",void 0);M5=Wj([ve("w3m-email-verify-device-view")],M5);const wye=Ie` div { width: 100%; height: 400px; @@ -7958,14 +7958,14 @@ function print() { __p += __j.call(arguments, '') } transform: translateY(-50px); } } -`;var oF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const fM=400,hM=360,Uye=64;let j5=class extends _e{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(jt.subscribeKey("open",e=>{e||(this.onHideIframe(),Ae.popTransactionStack())}),jt.subscribeKey("shake",e=>{e?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(r=>r()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(e=>{var i,s;const r=(i=e==null?void 0:e[0])==null?void 0:i.contentBoxSize,n=(s=r==null?void 0:r[0])==null?void 0:s.inlineSize;this.iframe.style.height=`${fM}px`,n&&n<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${hM}px`,this.iframe.style.left=`calc(50% - ${hM/2}px)`,this.iframe.style.top=`calc(50% - ${fM/2}px + ${Uye/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return q`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const e=ut.getAuthConnector();if(e){const r=vn.getSnapshot().themeMode,n=vn.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:n,w3mThemeVariables:wu(n,r)})}}};j5.styles=Bye;oF([le()],j5.prototype,"ready",void 0);j5=oF([ye("w3m-approve-transaction-view")],j5);var jye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let pM=class extends _e{render(){return q` +`;var Hj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const XN=400,eM=360,vye=64;let O5=class extends _e{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(jt.subscribeKey("open",e=>{e||(this.onHideIframe(),Ce.popTransactionStack())}),jt.subscribeKey("shake",e=>{e?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(r=>r()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(e=>{var i,s;const r=(i=e==null?void 0:e[0])==null?void 0:i.contentBoxSize,n=(s=r==null?void 0:r[0])==null?void 0:s.inlineSize;this.iframe.style.height=`${XN}px`,n&&n<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${eM}px`,this.iframe.style.left=`calc(50% - ${eM/2}px)`,this.iframe.style.top=`calc(50% - ${XN/2}px + ${vye/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return q`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const e=ut.getAuthConnector();if(e){const r=mn.getSnapshot().themeMode,n=mn.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:n,w3mThemeVariables:pu(n,r)})}}};O5.styles=wye;Hj([ae()],O5.prototype,"ready",void 0);O5=Hj([ve("w3m-approve-transaction-view")],O5);var yye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let tM=class extends _e{render(){return q` Follow the instructions on @@ -7973,7 +7973,7 @@ function print() { __p += __j.call(arguments, '') } You will have to reconnect for security reasons - `}};pM=jye([ye("w3m-upgrade-wallet-view")],pM);var YE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let F5=class extends _e{constructor(){super(...arguments),this.authConnector=ut.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await Lt.setPreferredAccountType(lr.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,Ae.push("Account")}catch{St.showError("Error upgrading to smart account")}}}render(){return q` + `}};tM=yye([ve("w3m-upgrade-wallet-view")],tM);var jE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let $5=class extends _e{constructor(){super(...arguments),this.authConnector=ut.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await Lt.setPreferredAccountType(lr.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,Ce.push("Account")}catch{St.showError("Error upgrading to smart account")}}}render(){return q` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {Ue.openHref(HA.URLS.FAQ,"_blank")}} + @click=${()=>{Be.openHref(MA.URLS.FAQ,"_blank")}} > Learn more @@ -8024,7 +8024,7 @@ function print() { __p += __j.call(arguments, '') } @click=${this.setPreferSmartAccount.bind(this)} >Continue
- `}redirectToAccount(){Ae.push("Account")}};YE([le()],F5.prototype,"authConnector",void 0);YE([le()],F5.prototype,"loading",void 0);F5=YE([ye("w3m-upgrade-to-smart-account-view")],F5);const Fye=Te` + `}redirectToAccount(){Ce.push("Account")}};jE([ae()],$5.prototype,"authConnector",void 0);jE([ae()],$5.prototype,"loading",void 0);$5=jE([ve("w3m-upgrade-to-smart-account-view")],$5);const bye=Ie` wui-email-input { width: 100%; } @@ -8034,9 +8034,9 @@ function print() { __p += __j.call(arguments, '') } display: block; position: relative; } -`;var JE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let wv=class extends _e{constructor(){var e;super(...arguments),this.formRef=af(),this.initialEmail=((e=Ae.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return q` +`;var FE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let gv=class extends _e{constructor(){var e;super(...arguments),this.formRef=nf(),this.initialEmail=((e=Ce.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return q` - + - + Cancel @@ -8063,7 +8063,7 @@ function print() { __p += __j.call(arguments, '') } - `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const r=ut.getAuthConnector();if(!r)throw new Error("w3m-update-email-wallet: Auth connector not found");const n=await r.provider.updateEmail({email:this.email});ot.sendEvent({type:"track",event:"EMAIL_EDIT"}),n.action==="VERIFY_SECONDARY_OTP"?Ae.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):Ae.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(r){St.showError(r),this.loading=!1}}};wv.styles=Fye;JE([le()],wv.prototype,"email",void 0);JE([le()],wv.prototype,"loading",void 0);wv=JE([ye("w3m-update-email-wallet-view")],wv);var zye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let gM=class extends Fu{constructor(){var e;super(),this.email=(e=Ae.state.data)==null?void 0:e.email,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:r}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ae.replace("UpdateEmailSecondaryOtp",Ae.state.data))}catch(n){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ae.replace("UpdateEmailWallet",Ae.state.data)}}};gM=zye([ye("w3m-update-email-primary-otp-view")],gM);var Wye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let mM=class extends Fu{constructor(){var e;super(),this.email=(e=Ae.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:r}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ae.reset("Account"))}catch(n){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ae.replace("UpdateEmailWallet",Ae.state.data)}}};mM=Wye([ye("w3m-update-email-secondary-otp-view")],mM);const Hye=Te` + `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const r=ut.getAuthConnector();if(!r)throw new Error("w3m-update-email-wallet: Auth connector not found");const n=await r.provider.updateEmail({email:this.email});ot.sendEvent({type:"track",event:"EMAIL_EDIT"}),n.action==="VERIFY_SECONDARY_OTP"?Ce.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):Ce.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(r){St.showError(r),this.loading=!1}}};gv.styles=bye;FE([ae()],gv.prototype,"email",void 0);FE([ae()],gv.prototype,"loading",void 0);gv=FE([ve("w3m-update-email-wallet-view")],gv);var xye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let rM=class extends Bu{constructor(){var e;super(),this.email=(e=Ce.state.data)==null?void 0:e.email,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:r}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ce.replace("UpdateEmailSecondaryOtp",Ce.state.data))}catch(n){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ce.replace("UpdateEmailWallet",Ce.state.data)}}};rM=xye([ve("w3m-update-email-primary-otp-view")],rM);var _ye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let nM=class extends Bu{constructor(){var e;super(),this.email=(e=Ce.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:r}),ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ce.reset("Account"))}catch(n){throw ot.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ce.replace("UpdateEmailWallet",Ce.state.data)}}};nM=_ye([ve("w3m-update-email-secondary-otp-view")],nM);const Cye=Ie` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; @@ -8073,7 +8073,7 @@ function print() { __p += __j.call(arguments, '') } :host > wui-flex::-webkit-scrollbar { display: none; } -`;var aF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let z5=class extends _e{constructor(){var e;super(...arguments),this.swapUnsupportedChain=(e=Ae.state.data)==null?void 0:e.swapUnsupportedChain,this.disconecting=!1}render(){return q` +`;var qj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let D5=class extends _e{constructor(){var e;super(...arguments),this.swapUnsupportedChain=(e=Ce.state.data)==null?void 0:e.swapUnsupportedChain,this.disconecting=!1}render(){return q` This app doesn’t support your current network. Switch to an available option to continue. - `}networksTemplate(){const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=Ue.sortRequestedNetworks(r,e);return(this.swapUnsupportedChain?n.filter(s=>Tn.SWAP_SUPPORTED_NETWORKS.includes(s.id)):n).map(s=>q` + `}networksTemplate(){const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=Be.sortRequestedNetworks(r,e);return(this.swapUnsupportedChain?n.filter(s=>Sn.SWAP_SUPPORTED_NETWORKS.includes(s.id)):n).map(s=>q` this.onSwitchNetwork(s)} > - `)}async onDisconnect(){try{this.disconecting=!0,await Lt.disconnect(),ot.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jt.close()}catch{ot.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),St.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const r=Se.state.caipAddress,n=Zt.state.approvedCaipNetworkIds,i=Zt.state.supportsAllNetworks,s=ge.state.activeCaipNetwork,o=Ae.state.data;r&&(s==null?void 0:s.id)!==e.id?n!=null&&n.includes(e.id)?await Zt.switchActiveNetwork(e):i&&Ae.push("SwitchNetwork",{...o,network:e}):r||(Zt.setActiveCaipNetwork(e),Ae.push("Connect"))}};z5.styles=Hye;aF([le()],z5.prototype,"disconecting",void 0);z5=aF([ye("w3m-unsupported-chain-view")],z5);const qye=Te` + `)}async onDisconnect(){try{this.disconecting=!0,await Lt.disconnect(),ot.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jt.close()}catch{ot.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),St.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const r=Ee.state.caipAddress,n=Zt.state.approvedCaipNetworkIds,i=Zt.state.supportsAllNetworks,s=pe.state.activeCaipNetwork,o=Ce.state.data;r&&(s==null?void 0:s.id)!==e.id?n!=null&&n.includes(e.id)?await Zt.switchActiveNetwork(e):i&&Ce.push("SwitchNetwork",{...o,network:e}):r||(Zt.setActiveCaipNetwork(e),Ce.push("Connect"))}};D5.styles=Cye;qj([ae()],D5.prototype,"disconecting",void 0);D5=qj([ve("w3m-unsupported-chain-view")],D5);const Aye=Ie` wui-compatible-network { margin-top: var(--wui-spacing-l); } -`;var k2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let i0=class extends _e{constructor(){super(),this.unsubscribe=[],this.address=Se.state.address,this.profileName=Se.state.profileName,this.network=ge.state.activeCaipNetwork,this.preferredAccountType=Se.state.preferredAccountType,this.unsubscribe.push(Se.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):St.showError("Account not found")}),ge.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=Sr.getNetworkImage(this.network);return q` =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};let r0=class extends _e{constructor(){super(),this.unsubscribe=[],this.address=Ee.state.address,this.profileName=Ee.state.profileName,this.network=pe.state.activeCaipNetwork,this.preferredAccountType=Ee.state.preferredAccountType,this.unsubscribe.push(Ee.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):St.showError("Account not found")}),pe.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=Sr.getNetworkImage(this.network);return q` ${this.networkTemplate()} - `}networkTemplate(){var o;const e=Zt.getRequestedCaipNetworks(),r=Zt.checkIfSmartAccountEnabled(),n=ge.state.activeCaipNetwork;if(this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return n?q``}networkTemplate(){var o;const e=Zt.getRequestedCaipNetworks(),r=Zt.checkIfSmartAccountEnabled(),n=pe.state.activeCaipNetwork;if(this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return n?q``}onReceiveClick(){Ae.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(Ue.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}};i0.styles=qye;k2([le()],i0.prototype,"address",void 0);k2([le()],i0.prototype,"profileName",void 0);k2([le()],i0.prototype,"network",void 0);k2([le()],i0.prototype,"preferredAccountType",void 0);i0=k2([ye("w3m-wallet-receive-view")],i0);const Vye=Te` + >`}onReceiveClick(){Ce.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(Be.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}};r0.styles=Aye;I2([ae()],r0.prototype,"address",void 0);I2([ae()],r0.prototype,"profileName",void 0);I2([ae()],r0.prototype,"network",void 0);I2([ae()],r0.prototype,"preferredAccountType",void 0);r0=I2([ve("w3m-wallet-receive-view")],r0);const Eye=Ie` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; @@ -8174,7 +8174,7 @@ function print() { __p += __j.call(arguments, '') } :host > wui-flex::-webkit-scrollbar { display: none; } -`;var cF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let W5=class extends _e{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=Se.state.preferredAccountType,this.unsubscribe.push(Se.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` =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};let L5=class extends _e{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=Ee.state.preferredAccountType,this.unsubscribe.push(Ee.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.networkTemplate()} - `}networkTemplate(){const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=ge.state.activeCaipNetwork,i=Zt.checkIfSmartAccountEnabled();let s=Ue.sortRequestedNetworks(r,e);if(i&&this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT){if(!n)return null;s=[n]}return s.map(o=>q` + `}networkTemplate(){const e=Zt.getRequestedCaipNetworks(),r=Zt.state.approvedCaipNetworkIds,n=pe.state.activeCaipNetwork,i=Zt.checkIfSmartAccountEnabled();let s=Be.sortRequestedNetworks(r,e);if(i&&this.preferredAccountType===lr.ACCOUNT_TYPES.SMART_ACCOUNT){if(!n)return null;s=[n]}return s.map(o=>q` - `)}};W5.styles=Vye;cF([le()],W5.prototype,"preferredAccountType",void 0);W5=cF([ye("w3m-wallet-compatible-networks-view")],W5);const Kye=Te` + `)}};L5.styles=Eye;Vj([ae()],L5.prototype,"preferredAccountType",void 0);L5=Vj([ve("w3m-wallet-compatible-networks-view")],L5);const Sye=Ie` :host { display: block; } @@ -8220,7 +8220,7 @@ function print() { __p += __j.call(arguments, '') } .inputContainer { height: fit-content; } -`;var Yu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Cc=class extends _e{constructor(){super(),this.unsubscribe=[],this.token=Or.state.token,this.sendTokenAmount=Or.state.sendTokenAmount,this.receiverAddress=Or.state.receiverAddress,this.receiverProfileName=Or.state.receiverProfileName,this.loading=Or.state.loading,this.gasPriceInUSD=Or.state.gasPriceInUSD,this.gasPrice=Or.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(Or.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),q` +`;var Gu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let yc=class extends _e{constructor(){super(),this.unsubscribe=[],this.token=$r.state.token,this.sendTokenAmount=$r.state.sendTokenAmount,this.receiverAddress=$r.state.receiverAddress,this.receiverProfileName=$r.state.receiverProfileName,this.loading=$r.state.loading,this.gasPriceInUSD=$r.state.gasPriceInUSD,this.gasPrice=$r.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push($r.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),q` - `}async fetchNetworkPrice(){await et.getNetworkTokenPrice();const e=await et.getInitialGasPrice();e!=null&&e.gasPrice&&(e!=null&&e.gasPriceInUSD)&&(Or.setGasPrice(e.gasPrice),Or.setGasPriceInUsd(e.gasPriceInUSD))}onButtonClick(){Ae.push("WalletSendPreview")}getMessage(){var e;this.message="Preview Send",this.receiverAddress&&!Ue.isAddress(this.receiverAddress,ge.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((e=this.token)!=null&&e.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};Cc.styles=Kye;Yu([le()],Cc.prototype,"token",void 0);Yu([le()],Cc.prototype,"sendTokenAmount",void 0);Yu([le()],Cc.prototype,"receiverAddress",void 0);Yu([le()],Cc.prototype,"receiverProfileName",void 0);Yu([le()],Cc.prototype,"loading",void 0);Yu([le()],Cc.prototype,"gasPriceInUSD",void 0);Yu([le()],Cc.prototype,"gasPrice",void 0);Yu([le()],Cc.prototype,"message",void 0);Cc=Yu([ye("w3m-wallet-send-view")],Cc);const Gye=Te` + `}async fetchNetworkPrice(){await Xe.getNetworkTokenPrice();const e=await Xe.getInitialGasPrice();e!=null&&e.gasPrice&&(e!=null&&e.gasPriceInUSD)&&($r.setGasPrice(e.gasPrice),$r.setGasPriceInUsd(e.gasPriceInUSD))}onButtonClick(){Ce.push("WalletSendPreview")}getMessage(){var e;this.message="Preview Send",this.receiverAddress&&!Be.isAddress(this.receiverAddress,pe.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((e=this.token)!=null&&e.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};yc.styles=Sye;Gu([ae()],yc.prototype,"token",void 0);Gu([ae()],yc.prototype,"sendTokenAmount",void 0);Gu([ae()],yc.prototype,"receiverAddress",void 0);Gu([ae()],yc.prototype,"receiverProfileName",void 0);Gu([ae()],yc.prototype,"loading",void 0);Gu([ae()],yc.prototype,"gasPriceInUSD",void 0);Gu([ae()],yc.prototype,"gasPrice",void 0);Gu([ae()],yc.prototype,"message",void 0);yc=Gu([ve("w3m-wallet-send-view")],yc);const Iye=Ie` .contentContainer { height: 440px; overflow: scroll; @@ -8268,7 +8268,7 @@ function print() { __p += __j.call(arguments, '') } height: 40px; border-radius: var(--wui-border-radius-xxs); } -`;var R2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let s0=class extends _e{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Se.state.tokenBalance,this.search="",this.onDebouncedSearch=Ue.debounce(e=>{this.search=e}),this.unsubscribe.push(Se.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var T2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let n0=class extends _e{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Ee.state.tokenBalance,this.search="",this.onDebouncedSearch=Be.debounce(e=>{this.search=e}),this.unsubscribe.push(Ee.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.templateSearchInput()} ${this.templateTokens()} @@ -8282,7 +8282,7 @@ function print() { __p += __j.call(arguments, '') } icon="search" > - `}templateTokens(){var e,r;return this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(n=>{var i;return n.chainId===((i=ge.state.activeCaipNetwork)==null?void 0:i.id)}),this.search?this.filteredTokens=(r=this.tokenBalance)==null?void 0:r.filter(n=>n.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,q` + `}templateTokens(){var e,r;return this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(n=>{var i;return n.chainId===((i=pe.state.activeCaipNetwork)==null?void 0:i.id)}),this.search?this.filteredTokens=(r=this.tokenBalance)==null?void 0:r.filter(n=>n.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,q` `} - `}onBuyClick(){Ae.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){Or.setToken(e),Or.setTokenAmount(void 0),Ae.goBack()}};s0.styles=Gye;R2([le()],s0.prototype,"tokenBalance",void 0);R2([le()],s0.prototype,"tokens",void 0);R2([le()],s0.prototype,"filteredTokens",void 0);R2([le()],s0.prototype,"search",void 0);s0=R2([ye("w3m-wallet-send-select-token-view")],s0);const Zye=Te` + `}onBuyClick(){Ce.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){$r.setToken(e),$r.setTokenAmount(void 0),Ce.goBack()}};n0.styles=Iye;T2([ae()],n0.prototype,"tokenBalance",void 0);T2([ae()],n0.prototype,"tokens",void 0);T2([ae()],n0.prototype,"filteredTokens",void 0);T2([ae()],n0.prototype,"search",void 0);n0=T2([ve("w3m-wallet-send-select-token-view")],n0);const Tye=Ie` wui-avatar, wui-image { display: ruby; @@ -8351,7 +8351,7 @@ function print() { __p += __j.call(arguments, '') } --local-width: 100% !important; --local-border-radius: var(--wui-border-radius-xs) !important; } -`;var Of=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Tl=class extends _e{constructor(){super(),this.unsubscribe=[],this.token=Or.state.token,this.sendTokenAmount=Or.state.sendTokenAmount,this.receiverAddress=Or.state.receiverAddress,this.receiverProfileName=Or.state.receiverProfileName,this.receiverProfileImageUrl=Or.state.receiverProfileImageUrl,this.gasPriceInUSD=Or.state.gasPriceInUSD,this.caipNetwork=ge.state.activeCaipNetwork,this.unsubscribe.push(Or.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl}),ge.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,r;return q` +`;var Rf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let El=class extends _e{constructor(){super(),this.unsubscribe=[],this.token=$r.state.token,this.sendTokenAmount=$r.state.sendTokenAmount,this.receiverAddress=$r.state.receiverAddress,this.receiverProfileName=$r.state.receiverProfileName,this.receiverProfileImageUrl=$r.state.receiverProfileImageUrl,this.gasPriceInUSD=$r.state.gasPriceInUSD,this.caipNetwork=pe.state.activeCaipNetwork,this.unsubscribe.push($r.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl}),pe.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,r;return q` @@ -8359,7 +8359,7 @@ function print() { __p += __j.call(arguments, '') } ${this.sendValueTemplate()} @@ -8369,7 +8369,7 @@ function print() { __p += __j.call(arguments, '') } To `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const r=this.token.price*this.sendTokenAmount;return q`$${r.toFixed(2)}`}return null}onSendClick(){Or.sendToken()}onCancelClick(){Ae.goBack()}};Tl.styles=Zye;Of([le()],Tl.prototype,"token",void 0);Of([le()],Tl.prototype,"sendTokenAmount",void 0);Of([le()],Tl.prototype,"receiverAddress",void 0);Of([le()],Tl.prototype,"receiverProfileName",void 0);Of([le()],Tl.prototype,"receiverProfileImageUrl",void 0);Of([le()],Tl.prototype,"gasPriceInUSD",void 0);Of([le()],Tl.prototype,"caipNetwork",void 0);Tl=Of([ye("w3m-wallet-send-preview-view")],Tl);const Qye=Te` + >`}return null}onSendClick(){$r.sendToken()}onCancelClick(){Ce.goBack()}};El.styles=Tye;Rf([ae()],El.prototype,"token",void 0);Rf([ae()],El.prototype,"sendTokenAmount",void 0);Rf([ae()],El.prototype,"receiverAddress",void 0);Rf([ae()],El.prototype,"receiverProfileName",void 0);Rf([ae()],El.prototype,"receiverProfileImageUrl",void 0);Rf([ae()],El.prototype,"gasPriceInUSD",void 0);Rf([ae()],El.prototype,"caipNetwork",void 0);El=Rf([ve("w3m-wallet-send-preview-view")],El);const kye=Ie` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; @@ -8416,12 +8416,12 @@ function print() { __p += __j.call(arguments, '') } wui-flex::-webkit-scrollbar { display: none; } -`;var Yye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let XC=class extends _e{render(){return q` +`;var Pye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let q_=class extends _e{render(){return q` - `}};XC.styles=Qye;XC=Yye([ye("w3m-connect-wallets-view")],XC);const Jye=Te` + `}};q_.styles=kye;q_=Pye([ve("w3m-connect-wallets-view")],q_);const Rye=Ie` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; @@ -8430,12 +8430,12 @@ function print() { __p += __j.call(arguments, '') } wui-flex::-webkit-scrollbar { display: none; } -`;var Xye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let e_=class extends _e{render(){return q` +`;var Nye=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let V_=class extends _e{render(){return q` - `}};e_.styles=Jye;e_=Xye([ye("w3m-connect-socials-view")],e_);const ebe=Te` + `}};V_.styles=Rye;V_=Nye([ve("w3m-connect-socials-view")],V_);const Mye=Ie` wui-logo { width: 80px; height: 80px; @@ -8486,16 +8486,16 @@ function print() { __p += __j.call(arguments, '') } .capitalize { text-transform: capitalize; } -`;var Ig=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let pf=class extends _e{constructor(){super(),this.unsubscribe=[],this.socialProvider=Se.state.socialProvider,this.socialWindow=Se.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=ut.getAuthConnector(),this.handleSocialConnection=async e=>{var r;if((r=e.data)!=null&&r.resultUri)if(e.origin===bu.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),Se.setSocialWindow(void 0,ge.state.activeChain)),this.connecting=!0,this.updateMessage();const n=e.data.resultUri;await this.authConnector.provider.connectSocial(n),this.socialProvider&&(vr.setConnectedSocialProvider(this.socialProvider),await Lt.connectExternal(this.authConnector,this.authConnector.chain),ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else Ae.goBack(),St.showError("Untrusted Origin"),this.socialProvider&&ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(Se.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&jt.state.open&&jt.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return q` +`;var Eg=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let df=class extends _e{constructor(){super(),this.unsubscribe=[],this.socialProvider=Ee.state.socialProvider,this.socialWindow=Ee.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=ut.getAuthConnector(),this.handleSocialConnection=async e=>{var r;if((r=e.data)!=null&&r.resultUri)if(e.origin===wu.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),Ee.setSocialWindow(void 0,pe.state.activeChain)),this.connecting=!0,this.updateMessage();const n=e.data.resultUri;await this.authConnector.provider.connectSocial(n),this.socialProvider&&(vr.setConnectedSocialProvider(this.socialProvider),await Lt.connectExternal(this.authConnector,this.authConnector.chain),ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else Ce.goBack(),St.showError("Untrusted Origin"),this.socialProvider&&ot.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(Ee.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&jt.state.open&&jt.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return q` - + ${this.error?null:this.loaderTemplate()} - `}loaderTemplate(){const e=vn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}connectSocial(){const e=setInterval(()=>{var r;(r=this.socialWindow)!=null&&r.closed&&(!this.connecting&&Ae.state.view==="ConnectingSocial"&&Ae.goBack(),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};pf.styles=ebe;Ig([le()],pf.prototype,"socialProvider",void 0);Ig([le()],pf.prototype,"socialWindow",void 0);Ig([le()],pf.prototype,"error",void 0);Ig([le()],pf.prototype,"connecting",void 0);Ig([le()],pf.prototype,"message",void 0);pf=Ig([ye("w3m-connecting-social-view")],pf);const tbe=Te` + `}loaderTemplate(){const e=mn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}connectSocial(){const e=setInterval(()=>{var r;(r=this.socialWindow)!=null&&r.closed&&(!this.connecting&&Ce.state.view==="ConnectingSocial"&&Ce.goBack(),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};df.styles=Mye;Eg([ae()],df.prototype,"socialProvider",void 0);Eg([ae()],df.prototype,"socialWindow",void 0);Eg([ae()],df.prototype,"error",void 0);Eg([ae()],df.prototype,"connecting",void 0);Eg([ae()],df.prototype,"message",void 0);df=Eg([ve("w3m-connecting-social-view")],df);const Oye=Ie` wui-flex { width: 100%; } @@ -8577,19 +8577,19 @@ function print() { __p += __j.call(arguments, '') } .account-settings-button:hover { background: var(--wui-color-gray-glass-005); } -`;var P2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let o0=class extends _e{constructor(){super(),this.usubscribe=[],this.address=Se.state.address,this.profileImage=Se.state.profileImage,this.profileName=Se.state.profileName,this.accounts=Se.state.allAccounts,this.usubscribe.push(Se.subscribeKey("address",e=>{e?this.address=e:jt.close()})),this.usubscribe.push(Se.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(Se.subscribeKey("profileName",e=>{this.profileName=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return q` +`;var k2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let i0=class extends _e{constructor(){super(),this.usubscribe=[],this.address=Ee.state.address,this.profileImage=Ee.state.profileImage,this.profileName=Ee.state.profileName,this.accounts=Ee.state.allAccounts,this.usubscribe.push(Ee.subscribeKey("address",e=>{e?this.address=e:jt.close()})),this.usubscribe.push(Ee.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(Ee.subscribeKey("profileName",e=>{this.profileName=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return q` - ${this.profileName?Rt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Rt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} + ${this.profileName?Pt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Pt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} @@ -8618,7 +8618,7 @@ function print() { __p += __j.call(arguments, '') } ${this.accounts.map(e=>this.accountTemplate(e))} - `}async onSwitchAccount(e){Se.setShouldUpdateToAddress(e.address,ge.state.activeChain);const r=ut.getAuthConnector();r&&(await r.provider.setPreferredAccount(e.type),await r.provider.connect())}accountTemplate(e){return q` + `}async onSwitchAccount(e){Ee.setShouldUpdateToAddress(e.address,pe.state.activeChain);const r=ut.getAuthConnector();r&&(await r.provider.setPreferredAccount(e.type),await r.provider.connect())}accountTemplate(e){return q` ${e.address===this.address?"":q`this.onSwitchAccount(e)} >Switch`} - `}onCopyAddress(){try{this.profileName?(Ue.copyToClopboard(this.profileName),St.showSuccess("Name copied")):this.address&&(Ue.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}};o0.styles=tbe;P2([le()],o0.prototype,"address",void 0);P2([le()],o0.prototype,"profileImage",void 0);P2([le()],o0.prototype,"profileName",void 0);P2([le()],o0.prototype,"accounts",void 0);o0=P2([ye("w3m-profile-view")],o0);const rbe=Te` + `}onCopyAddress(){try{this.profileName?(Be.copyToClopboard(this.profileName),St.showSuccess("Name copied")):this.address&&(Be.copyToClopboard(this.address),St.showSuccess("Address copied"))}catch{St.showError("Failed to copy")}}};i0.styles=Oye;k2([ae()],i0.prototype,"address",void 0);k2([ae()],i0.prototype,"profileImage",void 0);k2([ae()],i0.prototype,"profileName",void 0);k2([ae()],i0.prototype,"accounts",void 0);i0=k2([ve("w3m-profile-view")],i0);const $ye=Ie` input[type='checkbox'] { all: revert; width: var(--wui-spacing-xl); height: var(--wui-spacing-xl); accent-color: var(--wui-color-accent-100); } -`;var Tg=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let gf=class extends _e{constructor(){super(),this.metadata=qe.state.metadata,this.allAccounts=Se.state.allAccounts,this.selectedAccounts=Se.state.allAccounts,this.selectAll=!0,this.approved=!1,this.isApproving=!1,this.getAddressTemplate=e=>{const r=this.selectedAccounts.some(n=>n.address===e.address);return q` +`;var Sg=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let ff=class extends _e{constructor(){super(),this.metadata=qe.state.metadata,this.allAccounts=Ee.state.allAccounts,this.selectedAccounts=Ee.state.allAccounts,this.selectAll=!0,this.approved=!1,this.isApproving=!1,this.getAddressTemplate=e=>{const r=this.selectedAccounts.some(n=>n.address===e.address);return q` - `},this.onSelectAll=e=>{const r=e.target.checked;this.selectAll=this.selectedAccounts.length===this.allAccounts.length,this.allAccounts.forEach(n=>{this.onSelect(n,r)})},this.onSelect=(e,r)=>{r?this.selectedAccounts.push(e):this.selectedAccounts=this.selectedAccounts.filter(n=>n.address!==e.address),this.selectedAccounts.length>0&&(this.selectAll=this.selectedAccounts.length===this.allAccounts.length)},Se.subscribeKey("allAccounts",e=>{this.allAccounts=e})}render(){var e,r;return q` + `},this.onSelectAll=e=>{const r=e.target.checked;this.selectAll=this.selectedAccounts.length===this.allAccounts.length,this.allAccounts.forEach(n=>{this.onSelect(n,r)})},this.onSelect=(e,r)=>{r?this.selectedAccounts.push(e):this.selectedAccounts=this.selectedAccounts.filter(n=>n.address!==e.address),this.selectedAccounts.length>0&&(this.selectAll=this.selectedAccounts.length===this.allAccounts.length)},Ee.subscribeKey("allAccounts",e=>{this.allAccounts=e})}render(){var e,r;return q` - + Select all @@ -8674,7 +8674,7 @@ function print() { __p += __j.call(arguments, '') } ${this.isApproving?"Signing...":"Continue"} - `}handleClick(e){return r=>{var i;const n=r.target;(i=this.onSelect)==null||i.call(this,{...e},n==null?void 0:n.checked)}}onContinue(){var e;this.selectedAccounts.length>0?(this.isApproving=!0,Se.setAllAccounts(this.selectedAccounts,ge.state.activeChain),Se.setShouldUpdateToAddress(((e=this.selectedAccounts[0])==null?void 0:e.address)??"",ge.state.activeChain),this.approved=!0,this.isApproving=!1,jt.close()):this.onCancel()}async onCancel(){const{activeCaipAddress:e}=ge.state;e?(await Lt.disconnect(),jt.close()):Ae.push("Connect")}disconnectedCallback(){super.disconnectedCallback(),this.approved||this.onCancel()}};gf.styles=rbe;Tg([le()],gf.prototype,"allAccounts",void 0);Tg([le()],gf.prototype,"selectedAccounts",void 0);Tg([le()],gf.prototype,"selectAll",void 0);Tg([le()],gf.prototype,"approved",void 0);Tg([le()],gf.prototype,"isApproving",void 0);gf=Tg([ye("w3m-select-addresses-view")],gf);const nbe=Te` + `}handleClick(e){return r=>{var i;const n=r.target;(i=this.onSelect)==null||i.call(this,{...e},n==null?void 0:n.checked)}}onContinue(){var e;this.selectedAccounts.length>0?(this.isApproving=!0,Ee.setAllAccounts(this.selectedAccounts,pe.state.activeChain),Ee.setShouldUpdateToAddress(((e=this.selectedAccounts[0])==null?void 0:e.address)??"",pe.state.activeChain),this.approved=!0,this.isApproving=!1,jt.close()):this.onCancel()}async onCancel(){const{activeCaipAddress:e}=pe.state;e?(await Lt.disconnect(),jt.close()):Ce.push("Connect")}disconnectedCallback(){super.disconnectedCallback(),this.approved||this.onCancel()}};ff.styles=$ye;Sg([ae()],ff.prototype,"allAccounts",void 0);Sg([ae()],ff.prototype,"selectedAccounts",void 0);Sg([ae()],ff.prototype,"selectAll",void 0);Sg([ae()],ff.prototype,"approved",void 0);Sg([ae()],ff.prototype,"isApproving",void 0);ff=Sg([ve("w3m-select-addresses-view")],ff);const Dye=Ie` wui-avatar { width: var(--wui-spacing-3xl); height: var(--wui-spacing-3xl); @@ -8688,11 +8688,11 @@ function print() { __p += __j.call(arguments, '') } border: 2px solid var(--wui-color-bg-150); background-color: var(--wui-color-bg-125); } -`;var XE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let vv=class extends _e{constructor(){super(),this.metadata=qe.state.metadata,this.allAccounts=Se.state.allAccounts||[],this.balances={},this.labels=Se.state.addressLabels,this.currentAddress=Se.state.address||"",this.connectedConnector=vr.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH",this.caipNetwork=ge.state.activeCaipNetwork,Se.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(e=>{var r;bn.getBalance(e.address,(r=this.caipNetwork)==null?void 0:r.id).then(n=>{let i=this.balances[e.address]||0;n.balances.length>0&&(i=n.balances.reduce((s,o)=>s+((o==null?void 0:o.value)||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return e==="smartAccount"?"lightbulb":"mail"}render(){var e,r;return q` +`;var zE=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let mv=class extends _e{constructor(){super(),this.metadata=qe.state.metadata,this.allAccounts=Ee.state.allAccounts||[],this.balances={},this.labels=Ee.state.addressLabels,this.currentAddress=Ee.state.address||"",this.connectedConnector=vr.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH",this.caipNetwork=pe.state.activeCaipNetwork,Ee.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(e=>{var r;vn.getBalance(e.address,(r=this.caipNetwork)==null?void 0:r.id).then(n=>{let i=this.balances[e.address]||0;n.balances.length>0&&(i=n.balances.reduce((s,o)=>s+((o==null?void 0:o.value)||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return e==="smartAccount"?"lightbulb":"mail"}render(){var e,r;return q` @@ -8717,7 +8717,7 @@ function print() { __p += __j.call(arguments, '') } >`:q``} ${n||Rt.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})}${n||Pt.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})} ${typeof this.balances[e.address]=="number"?`$${(s=this.balances[e.address])==null?void 0:s.toFixed(2)}`:q``} @@ -8737,7 +8737,7 @@ function print() { __p += __j.call(arguments, '') } `} - `}onSwitchAddress(e){const r=ge.state.activeCaipNetwork,n=r==null?void 0:r.chainNamespace,i=`${n}:${r==null?void 0:r.chainId}:${e}`;Se.setCaipAddress(i,n),jt.close()}};vv.styles=nbe;XE([le()],vv.prototype,"allAccounts",void 0);XE([le()],vv.prototype,"balances",void 0);vv=XE([ye("w3m-switch-address-view")],vv);const ibe=Te` + `}onSwitchAddress(e){const r=pe.state.activeCaipNetwork,n=r==null?void 0:r.chainNamespace,i=`${n}:${r==null?void 0:r.chainId}:${e}`;Ee.setCaipAddress(i,n),jt.close()}};mv.styles=Dye;zE([ae()],mv.prototype,"allAccounts",void 0);zE([ae()],mv.prototype,"balances",void 0);mv=zE([ve("w3m-switch-address-view")],mv);const Lye=Ie` @keyframes fadein { from { opacity: 0; @@ -8781,7 +8781,7 @@ function print() { __p += __j.call(arguments, '') } transform: scale(0.5); transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } -`;var N2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let a0=class extends _e{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=Se.state.socialProvider,this.uri=Se.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=ut.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(Se.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),Se.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),q`${this.platformTemplate()}`}platformTemplate(){return Ue.isMobile()?q`${this.mobileTemplate()}`:q`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?q`${this.loadingTemplate()}`:q`${this.qrTemplate()}`}qrTemplate(){return q` =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};let s0=class extends _e{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=Ee.state.socialProvider,this.uri=Ee.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=ut.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(Ee.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),Ee.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),q`${this.platformTemplate()}`}platformTemplate(){return Be.isMobile()?q`${this.mobileTemplate()}`:q`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?q`${this.loadingTemplate()}`:q`${this.qrTemplate()}`}qrTemplate(){return q` ${this.mobileLinkTemplate()} - `}loaderTemplate(){const e=vn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}async connectFarcaster(){var e;if(this.authConnector)try{await((e=this.authConnector)==null?void 0:e.provider.connectFarcaster()),this.socialProvider&&vr.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await Lt.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,jt.close()}catch(r){Ae.goBack(),St.showError(r)}}mobileLinkTemplate(){return q``}loaderTemplate(){const e=mn.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return q``}async connectFarcaster(){var e;if(this.authConnector)try{await((e=this.authConnector)==null?void 0:e.provider.connectFarcaster()),this.socialProvider&&vr.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await Lt.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,jt.close()}catch(r){Ce.goBack(),St.showError(r)}}mobileLinkTemplate(){return q`{this.uri&&Ue.openHref(this.uri,"_blank")}} + @click=${()=>{this.uri&&Be.openHref(this.uri,"_blank")}} > Open farcaster`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40;return q` Copy link - `}onCopyUri(){try{this.uri&&(Ue.copyToClopboard(this.uri),St.showSuccess("Link copied"))}catch{St.showError("Failed to copy")}}};a0.styles=ibe;N2([le()],a0.prototype,"socialProvider",void 0);N2([le()],a0.prototype,"uri",void 0);N2([le()],a0.prototype,"ready",void 0);N2([le()],a0.prototype,"loading",void 0);a0=N2([ye("w3m-connecting-farcaster-view")],a0);const sbe=Te` + `}onCopyUri(){try{this.uri&&(Be.copyToClopboard(this.uri),St.showSuccess("Link copied"))}catch{St.showError("Failed to copy")}}};s0.styles=Lye;P2([ae()],s0.prototype,"socialProvider",void 0);P2([ae()],s0.prototype,"uri",void 0);P2([ae()],s0.prototype,"ready",void 0);P2([ae()],s0.prototype,"loading",void 0);s0=P2([ve("w3m-connecting-farcaster-view")],s0);const Bye=Ie` wui-grid { max-height: clamp(360px, 400px, 80vh); overflow: scroll; @@ -8900,7 +8900,7 @@ function print() { __p += __j.call(arguments, '') } justify-content: center; grid-column: 1 / span 4; } -`;function lF(t){const{connectors:e}=ut.state,r=e.filter(s=>s.type==="ANNOUNCED").reduce((s,o)=>{var a;return(a=o.info)!=null&&a.rdns&&(s[o.info.rdns]=!0),s},{});return t.map(s=>({...s,installed:!!s.rdns&&!!r[s.rdns??""]})).sort((s,o)=>Number(o.installed)-Number(s.installed))}var M2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const wM="local-paginator";let c0=class extends _e{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!Tt.state.wallets.length,this.wallets=Tt.state.wallets,this.recommended=Tt.state.recommended,this.featured=Tt.state.featured,this.unsubscribe.push(Tt.subscribeKey("wallets",e=>this.wallets=e),Tt.subscribeKey("recommended",e=>this.recommended=e),Tt.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(r=>r()),(e=this.paginationObserver)==null||e.disconnect()}render(){return q` +`;function Kj(t){const{connectors:e}=ut.state,r=e.filter(s=>s.type==="ANNOUNCED").reduce((s,o)=>{var a;return(a=o.info)!=null&&a.rdns&&(s[o.info.rdns]=!0),s},{});return t.map(s=>({...s,installed:!!s.rdns&&!!r[s.rdns??""]})).sort((s,o)=>Number(o.installed)-Number(s.installed))}var R2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const iM="local-paginator";let o0=class extends _e{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!Tt.state.wallets.length,this.wallets=Tt.state.wallets,this.recommended=Tt.state.recommended,this.featured=Tt.state.featured,this.unsubscribe.push(Tt.subscribeKey("wallets",e=>this.wallets=e),Tt.subscribeKey("recommended",e=>this.recommended=e),Tt.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(r=>r()),(e=this.paginationObserver)==null||e.disconnect()}render(){return q` `}async initialFetch(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-grid");this.initial&&e&&(await Tt.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,r){return[...Array(e)].map(()=>q` - - `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return lF(e).map(n=>q` + + `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return Kj(e).map(n=>q` this.onConnectWallet(n)} .wallet=${n} > - `)}paginationLoaderTemplate(){const{wallets:e,recommended:r,featured:n,count:i}=Tt.state,s=window.innerWidth<352?3:4,o=e.length+r.length;let c=Math.ceil(o/s)*s-o+s;return c-=e.length?n.length%s:0,i===0&&n.length>0?null:i===0||[...n,...e,...r].length{if(n!=null&&n.isIntersecting&&!this.initial){const{page:i,count:s,wallets:o}=Tt.state;o.length0?null:i===0||[...n,...e,...r].length{if(n!=null&&n.isIntersecting&&!this.initial){const{page:i,count:s,wallets:o}=Tt.state;o.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};let l0=class extends _e{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var e;return q` +`;var N2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let a0=class extends _e{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var e;return q` `:q` `}onFocusChange(e){this.focused=e}onSelectToken(){ot.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),Ae.push("SwapSelectToken",{target:this.target})}onBuyToken(){Ae.push("OnRampProviders")}};Io.styles=[wbe];Pc([Y()],Io.prototype,"focused",void 0);Pc([Y()],Io.prototype,"balance",void 0);Pc([Y()],Io.prototype,"value",void 0);Pc([Y()],Io.prototype,"price",void 0);Pc([Y()],Io.prototype,"marketValue",void 0);Pc([Y()],Io.prototype,"disabled",void 0);Pc([Y()],Io.prototype,"target",void 0);Pc([Y()],Io.prototype,"token",void 0);Pc([Y()],Io.prototype,"onSetAmount",void 0);Pc([Y()],Io.prototype,"onSetMaxValue",void 0);Io=Pc([ye("w3m-swap-input")],Io);const ybe=Te` + `}onFocusChange(e){this.focused=e}onSelectToken(){ot.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),Ce.push("SwapSelectToken",{target:this.target})}onBuyToken(){Ce.push("OnRampProviders")}};Ao.styles=[Qye];Tc([Q()],Ao.prototype,"focused",void 0);Tc([Q()],Ao.prototype,"balance",void 0);Tc([Q()],Ao.prototype,"value",void 0);Tc([Q()],Ao.prototype,"price",void 0);Tc([Q()],Ao.prototype,"marketValue",void 0);Tc([Q()],Ao.prototype,"disabled",void 0);Tc([Q()],Ao.prototype,"target",void 0);Tc([Q()],Ao.prototype,"token",void 0);Tc([Q()],Ao.prototype,"onSetAmount",void 0);Tc([Q()],Ao.prototype,"onSetMaxValue",void 0);Ao=Tc([ve("w3m-swap-input")],Ao);const Jye=Ie` :host { width: 100%; } @@ -9452,7 +9452,7 @@ function print() { __p += __j.call(arguments, '') } :host wui-flex .input_mask__background { fill: var(--wui-color-gray-glass-002); } -`;var uF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let H5=class extends _e{constructor(){super(...arguments),this.target="sourceToken"}render(){return q` +`;var Gj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let B5=class extends _e{constructor(){super(...arguments),this.target="sourceToken"}render(){return q` - `}};H5.styles=[ybe];uF([Y()],H5.prototype,"target",void 0);H5=uF([ye("w3m-swap-input-skeleton")],H5);const bbe=Te` + `}};B5.styles=[Jye];Gj([Q()],B5.prototype,"target",void 0);B5=Gj([ve("w3m-swap-input-skeleton")],B5);const Xye=Ie` :host { height: 64px; } @@ -9552,18 +9552,18 @@ function print() { __p += __j.call(arguments, '') } opacity: 1; } } -`;var Fl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const xbe=["Swap","SwapSelectToken","SwapPreview"];function F9(){var o,a,c,l,d,f,g;const t=(a=(o=Ae.state.data)==null?void 0:o.connector)==null?void 0:a.name,e=(l=(c=Ae.state.data)==null?void 0:c.wallet)==null?void 0:l.name,r=(f=(d=Ae.state.data)==null?void 0:d.network)==null?void 0:f.name,n=e??t,i=ut.getConnectors();return{Connect:`Connect ${i.length===1&&((g=i[0])==null?void 0:g.id)==="w3m-email"?"Email":""} Wallet`,ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:n?`Get ${n}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SelectAddresses:"Select accounts",SwitchNetwork:r??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:Se.state.socialProvider?Se.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain"}}let _a=class extends _e{constructor(){super(),this.unsubscribe=[],this.heading=F9()[Ae.state.view],this.network=ge.state.activeCaipNetwork,this.buffering=!1,this.showBack=!1,this.isSiweEnabled=qe.state.isSiweEnabled,this.prevHistoryLength=1,this.view=Ae.state.view,this.viewDirection="",this.headerText=F9()[Ae.state.view],this.unsubscribe.push(Ae.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=F9()[e]},bu.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),Lt.subscribeKey("buffering",e=>this.buffering=e),ge.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` +`;var Bl=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};const ebe=["Swap","SwapSelectToken","SwapPreview"];function O9(){var o,a,c,l,d,h,g;const t=(a=(o=Ce.state.data)==null?void 0:o.connector)==null?void 0:a.name,e=(l=(c=Ce.state.data)==null?void 0:c.wallet)==null?void 0:l.name,r=(h=(d=Ce.state.data)==null?void 0:d.network)==null?void 0:h.name,n=e??t,i=ut.getConnectors();return{Connect:`Connect ${i.length===1&&((g=i[0])==null?void 0:g.id)==="w3m-email"?"Email":""} Wallet`,ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:n?`Get ${n}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SelectAddresses:"Select accounts",SwitchNetwork:r??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:Ee.state.socialProvider?Ee.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain"}}let ba=class extends _e{constructor(){super(),this.unsubscribe=[],this.heading=O9()[Ce.state.view],this.network=pe.state.activeCaipNetwork,this.buffering=!1,this.showBack=!1,this.isSiweEnabled=qe.state.isSiweEnabled,this.prevHistoryLength=1,this.view=Ce.state.view,this.viewDirection="",this.headerText=O9()[Ce.state.view],this.unsubscribe.push(Ce.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=O9()[e]},wu.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),Lt.subscribeKey("buffering",e=>this.buffering=e),pe.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return q` ${this.dynamicButtonTemplate()} ${this.titleTemplate()} ${this.closeButtonTemplate()} - `}onWalletHelp(){ot.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ae.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Qs(async()=>{const{SIWEController:i}=await import("./index-BpiWtdP0.js");return{SIWEController:i}},[]),r=Ae.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ae.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ae.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` + `}onWalletHelp(){ot.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ce.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Zn(async()=>{const{SIWEController:i}=await import("./index-CEnfT4ng.js");return{SIWEController:i}},[]),r=Ce.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ce.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ce.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` - `}titleTemplate(){const e=xbe.includes(this.view);return q` + `}titleTemplate(){const e=ebe.includes(this.view);return q` ${this.headerText} ${e?q`Beta`:null} - `}dynamicButtonTemplate(){var c;const{view:e}=Ae.state,r=e==="Connect",n=e==="ApproveTransaction",i=e==="UpgradeToSmartAccount",s=e==="ConnectingSiwe",o=e==="Account",a=n||i||s;return o?q``:this.showBack&&!a?q``}onNetworks(){this.isAllowedNetworkSwitch()&&(ot.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Ae.push("Networks"))}isAllowedNetworkSwitch(){const e=Zt.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=Ae.state;let r=bu.VIEW_DIRECTION.Next;e.length1&&!this.showBack&&r?(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){Ae.goBack()}};_a.styles=bbe;Fl([le()],_a.prototype,"heading",void 0);Fl([le()],_a.prototype,"network",void 0);Fl([le()],_a.prototype,"buffering",void 0);Fl([le()],_a.prototype,"showBack",void 0);Fl([le()],_a.prototype,"isSiweEnabled",void 0);Fl([le()],_a.prototype,"prevHistoryLength",void 0);Fl([le()],_a.prototype,"view",void 0);Fl([le()],_a.prototype,"viewDirection",void 0);Fl([le()],_a.prototype,"headerText",void 0);_a=Fl([ye("w3m-header")],_a);var dF=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let r_=class extends _e{constructor(){super(...arguments),this.data=[]}render(){return q` + >`}onNetworks(){this.isAllowedNetworkSwitch()&&(ot.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Ce.push("Networks"))}isAllowedNetworkSwitch(){const e=Zt.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=Ce.state;let r=wu.VIEW_DIRECTION.Next;e.length1&&!this.showBack&&r?(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){Ce.goBack()}};ba.styles=Xye;Bl([ae()],ba.prototype,"heading",void 0);Bl([ae()],ba.prototype,"network",void 0);Bl([ae()],ba.prototype,"buffering",void 0);Bl([ae()],ba.prototype,"showBack",void 0);Bl([ae()],ba.prototype,"isSiweEnabled",void 0);Bl([ae()],ba.prototype,"prevHistoryLength",void 0);Bl([ae()],ba.prototype,"view",void 0);Bl([ae()],ba.prototype,"viewDirection",void 0);Bl([ae()],ba.prototype,"headerText",void 0);ba=Bl([ve("w3m-header")],ba);var Zj=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let G_=class extends _e{constructor(){super(...arguments),this.data=[]}render(){return q` ${this.data.map(e=>q` @@ -9605,7 +9605,7 @@ function print() { __p += __j.call(arguments, '') } `)} - `}};dF([Y({type:Array})],r_.prototype,"data",void 0);r_=dF([ye("w3m-help-widget")],r_);const Cbe=Te` + `}};Zj([Q({type:Array})],G_.prototype,"data",void 0);G_=Zj([ve("w3m-help-widget")],G_);const tbe=Ie` :host { width: 100%; } @@ -9658,7 +9658,7 @@ function print() { __p += __j.call(arguments, '') } bottom: 0; transform: translate(20%, 20%); } -`;var Lo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Es=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return q` +`;var Oo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let bs=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return q` ${this.imageTemplate()} @@ -9688,7 +9688,7 @@ function print() { __p += __j.call(arguments, '') } background="opaque" icon="arrowBottom" borderColor="wui-color-bg-125" - >`}};Es.styles=[Cbe];Lo([Y({type:Boolean})],Es.prototype,"disabled",void 0);Lo([Y()],Es.prototype,"color",void 0);Lo([Y()],Es.prototype,"label",void 0);Lo([Y()],Es.prototype,"purchaseValue",void 0);Lo([Y()],Es.prototype,"purchaseCurrency",void 0);Lo([Y()],Es.prototype,"date",void 0);Lo([Y({type:Boolean})],Es.prototype,"completed",void 0);Lo([Y({type:Boolean})],Es.prototype,"inProgress",void 0);Lo([Y({type:Boolean})],Es.prototype,"failed",void 0);Lo([Y()],Es.prototype,"onClick",void 0);Lo([Y()],Es.prototype,"symbol",void 0);Lo([Y()],Es.prototype,"icon",void 0);Es=Lo([ye("w3m-onramp-activity-item")],Es);const _be=Te` + >`}};bs.styles=[tbe];Oo([Q({type:Boolean})],bs.prototype,"disabled",void 0);Oo([Q()],bs.prototype,"color",void 0);Oo([Q()],bs.prototype,"label",void 0);Oo([Q()],bs.prototype,"purchaseValue",void 0);Oo([Q()],bs.prototype,"purchaseCurrency",void 0);Oo([Q()],bs.prototype,"date",void 0);Oo([Q({type:Boolean})],bs.prototype,"completed",void 0);Oo([Q({type:Boolean})],bs.prototype,"inProgress",void 0);Oo([Q({type:Boolean})],bs.prototype,"failed",void 0);Oo([Q()],bs.prototype,"onClick",void 0);Oo([Q()],bs.prototype,"symbol",void 0);Oo([Q()],bs.prototype,"icon",void 0);bs=Oo([ve("w3m-onramp-activity-item")],bs);const rbe=Ie` :host { width: 100%; } @@ -9720,7 +9720,7 @@ function print() { __p += __j.call(arguments, '') } width: 24px; border-radius: 50%; } -`;var U0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let zu=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=Sn.state.currencyImages,this.tokenImages=Sn.state.tokenImages,this.unsubscribe.push(Ur.subscribeKey("purchaseCurrency",r=>{!r||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(r))}),Ur.subscribeKey("paymentCurrency",r=>{!r||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(r))}),Ur.subscribe(r=>{this.type==="Fiat"?this.currencies=r.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=r.paymentCurrencies.map(this.formatPaymentCurrency)}),Sn.subscribe(r=>{this.currencyImages={...r.currencyImages},this.tokenImages={...r.tokenImages}}))}firstUpdated(){Ur.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var n;const e=((n=this.selectedCurrency)==null?void 0:n.symbol)||"",r=this.currencyImages[e]||this.tokenImages[e];return q` +`;var L0=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Uu=class extends _e{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=An.state.currencyImages,this.tokenImages=An.state.tokenImages,this.unsubscribe.push(Ur.subscribeKey("purchaseCurrency",r=>{!r||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(r))}),Ur.subscribeKey("paymentCurrency",r=>{!r||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(r))}),Ur.subscribe(r=>{this.type==="Fiat"?this.currencies=r.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=r.paymentCurrencies.map(this.formatPaymentCurrency)}),An.subscribe(r=>{this.currencyImages={...r.currencyImages},this.tokenImages={...r.tokenImages}}))}firstUpdated(){Ur.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var n;const e=((n=this.selectedCurrency)==null?void 0:n.symbol)||"",r=this.currencyImages[e]||this.tokenImages[e];return q` ${this.selectedCurrency?q` jt.open({view:`OnRamp${this.type}Select`})} > - + ${this.selectedCurrency.symbol} `:q``} - `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};zu.styles=_be;U0([Y({type:String})],zu.prototype,"type",void 0);U0([Y({type:Number})],zu.prototype,"value",void 0);U0([le()],zu.prototype,"currencies",void 0);U0([le()],zu.prototype,"selectedCurrency",void 0);U0([le()],zu.prototype,"currencyImages",void 0);U0([le()],zu.prototype,"tokenImages",void 0);zu=U0([ye("w3m-onramp-input")],zu);const Abe=Te` + `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};Uu.styles=rbe;L0([Q({type:String})],Uu.prototype,"type",void 0);L0([Q({type:Number})],Uu.prototype,"value",void 0);L0([ae()],Uu.prototype,"currencies",void 0);L0([ae()],Uu.prototype,"selectedCurrency",void 0);L0([ae()],Uu.prototype,"currencyImages",void 0);L0([ae()],Uu.prototype,"tokenImages",void 0);Uu=L0([ve("w3m-onramp-input")],Uu);const nbe=Ie` button { padding: var(--wui-spacing-s); border-radius: var(--wui-border-radius-xs); @@ -9788,9 +9788,9 @@ function print() { __p += __j.call(arguments, '') } 0 0 0 3px var(--wui-color-gray-glass-005), 0 0 0 3px var(--wui-color-modal-bg); } -`;var Df=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let kl=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return q` +`;var Nf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=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};let Sl=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return q`