import{W as S}from"./index-f9496d0e.js";var y={},r={};Object.defineProperty(r,"__esModule",{value:!0});r.getLocalStorage=r.getLocalStorageOrThrow=r.getCrypto=r.getCryptoOrThrow=r.getLocation=r.getLocationOrThrow=r.getNavigator=r.getNavigatorOrThrow=r.getDocument=r.getDocumentOrThrow=r.getFromWindowOrThrow=r.getFromWindow=void 0;function w(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}r.getFromWindow=w;function m(t){const e=w(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}r.getFromWindowOrThrow=m;function G(){return m("document")}r.getDocumentOrThrow=G;function H(){return w("document")}r.getDocument=H;function Q(){return m("navigator")}r.getNavigatorOrThrow=Q;function z(){return w("navigator")}r.getNavigator=z;function Y(){return m("location")}r.getLocationOrThrow=Y;function q(){return w("location")}r.getLocation=q;function Z(){return m("crypto")}r.getCryptoOrThrow=Z;function tt(){return w("crypto")}r.getCrypto=tt;function et(){return m("localStorage")}r.getLocalStorageOrThrow=et;function ot(){return w("localStorage")}r.getLocalStorage=ot;Object.defineProperty(y,"__esModule",{value:!0});var B=y.getWindowMetadata=void 0;const $=r;function rt(){let t,e;try{t=$.getDocumentOrThrow(),e=$.getLocationOrThrow()}catch{return null}function o(){const g=t.getElementsByTagName("link"),d=[];for(let l=0;l-1){const s=p.getAttribute("href");if(s)if(s.toLowerCase().indexOf("https:")===-1&&s.toLowerCase().indexOf("http:")===-1&&s.indexOf("//")!==0){let T=e.protocol+"//"+e.host;if(s.indexOf("/")===0)T+=s;else{const b=e.pathname.split("/");b.pop();const X=b.join("/");T+=X+"/"+s}d.push(T)}else if(s.indexOf("//")===0){const T=e.protocol+s;d.push(T)}else d.push(s)}}return d}function n(...g){const d=t.getElementsByTagName("meta");for(let l=0;lp.getAttribute(s)).filter(s=>s?g.includes(s):!1);if(O.length&&O){const s=p.getAttribute("content");if(s)return s}}return""}function a(){let g=n("name","og:site_name","og:title","twitter:title");return g||(g=t.title),g}function c(){return n("description","og:description","twitter:description","keywords")}const u=a(),f=c(),K=e.origin,U=o();return{description:f,url:K,icons:U,name:u}}B=y.getWindowMetadata=rt;var i={};Object.defineProperty(i,"__esModule",{value:!0});var A=i.getLocalStorage=V=i.getLocalStorageOrThrow=j=i.getCrypto=F=i.getCryptoOrThrow=R=i.getLocation=P=i.getLocationOrThrow=x=i.getNavigator=D=i.getNavigatorOrThrow=I=i.getDocument=k=i.getDocumentOrThrow=M=i.getFromWindowOrThrow=E=i.getFromWindow=void 0;function h(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var E=i.getFromWindow=h;function v(t){const e=h(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var M=i.getFromWindowOrThrow=v;function nt(){return v("document")}var k=i.getDocumentOrThrow=nt;function it(){return h("document")}var I=i.getDocument=it;function at(){return v("navigator")}var D=i.getNavigatorOrThrow=at;function st(){return h("navigator")}var x=i.getNavigator=st;function ct(){return v("location")}var P=i.getLocationOrThrow=ct;function ut(){return h("location")}var R=i.getLocation=ut;function gt(){return v("crypto")}var F=i.getCryptoOrThrow=gt;function ft(){return h("crypto")}var j=i.getCrypto=ft;function dt(){return v("localStorage")}var V=i.getLocalStorageOrThrow=dt;function lt(){return h("localStorage")}A=i.getLocalStorage=lt;var wt=globalThis&&globalThis.__spreadArrays||function(){for(var t=0,e=0,o=arguments.length;e"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ot:typeof navigator<"u"?_(navigator.userAgent):$t()}function Wt(t){return t!==""&&yt.reduce(function(e,o){var n=o[0],a=o[1];if(e)return e;var c=a.exec(t);return!!c&&[n,c]},!1)}function _(t){var e=Wt(t);if(!e)return null;var o=e[0],n=e[1];if(o==="searchbot")return new pt;var a=n[1]&&n[1].split(/[._]/).slice(0,3);a?a.length1:!1}function jt(){return L()?Nt()||_t():!1}function Bt(){const t=J();return t&&t.name?t.name.toLowerCase()==="node":!1}function Vt(){return!Bt()&&!!At()}const Jt=E,Kt=M,Ut=k,Xt=I,Gt=D,At=x,Ht=P,Qt=R,zt=F,Yt=j,qt=V,W=A;function Zt(){return B()}function Et(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Mt(t){return typeof t=="string"?t:JSON.stringify(t)}const kt=Et,It=Mt;function Dt(t,e){const o=It(e),n=W();n&&n.setItem(t,o)}function te(t){let e=null,o=null;const n=W();return n&&(o=n.getItem(t)),e=o&&kt(o),e}function ee(t){const e=W();e&&e.removeItem(t)}const xt="WALLETCONNECT_DEEPLINK_CHOICE";function oe(t,e){const o=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${o}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}function re(t){const e=t.href.split("?")[0];Dt(xt,Object.assign(Object.assign({},t),{href:e}))}function Pt(t,e){return t.filter(o=>o.name.toLowerCase().includes(e.toLowerCase()))[0]}function ne(t,e){let o=t;return e&&(o=e.map(n=>Pt(t,n)).filter(Boolean)),o}export{Bt as A,kt as B,It as C,re as D,te as a,Zt as b,jt as c,J as d,L as e,oe as f,Qt as g,Yt as h,Vt as i,zt as j,Xt as k,Ut as l,xt as m,Jt as n,Kt as o,W as p,qt as q,ee as r,Dt as s,Ht as t,ne as u,Pt as v,At as w,Gt as x,Nt as y,_t as z};