@privy-io/react-auth 1.25.0-beta.2 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Od=Object.create;var Qo=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var $i=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ke=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ji=(e,t)=>{for(var o in t)Qo(e,o,{get:t[o],enumerable:!0})},zi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&Qo(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var Gd=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},zi(t||!e||!e.__esModule?Qo(o,"default",{value:e,enumerable:!0}):o,e)),Zi=e=>zi(Qo({},"__esModule",{value:!0}),e);var hr=Ke((Oh,mr)=>{var Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,qa,ur,Rn,$a,ja,za,qt,Za,Ka,Ja,Ya,Qa,Xa,es,ts,os,fr;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof mr=="object"&&typeof mr.exports=="object"?e(o(t,o(mr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};Oa=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Da=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},Ua=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},Ba=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var f=r.length-1;f>=0;f--)(c=r[f])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Fa=function(r,n){return function(i,a){n(i,a,r)}},Ga=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Ha=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(b){try{p(a.next(b))}catch(y){c(y)}}function g(b){try{p(a.throw(b))}catch(y){c(y)}}function p(b){b.done?l(b.value):s(b.value).then(f,g)}p((a=a.apply(r,n||[])).next())})},Va=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(p){return function(b){return g([p,b])}}function g(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(b){p=[6,b],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},qa=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&fr(n,r,i)},fr=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Rn=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(f){c={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},$a=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Rn(arguments[n]));return r},ja=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,f=l.length;c<f;c++,s++)a[s]=l[c];return a},za=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},qt=function(r){return this instanceof qt?(this.v=r,this):new qt(r)},Za=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(h){return new Promise(function(P,w){l.push([d,h,P,w])>1||f(d,h)})})}function f(d,h){try{g(a[d](h))}catch(P){y(l[0][3],P)}}function g(d){d.value instanceof qt?Promise.resolve(d.value.v).then(p,b):y(l[0][2],d)}function p(d){f("next",d)}function b(d){f("throw",d)}function y(d,h){d(h),l.shift(),l.length&&f(l[0][0],l[0][1])}},Ka=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:qt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Ja=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof ur=="function"?ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(f,g){c=r[l](c),s(f,g,c.done,c.value)})}}function s(l,c,f,g){Promise.resolve(g).then(function(p){l({value:p,done:f})},c)}},Ya=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Qa=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&fr(n,r,i);return o(n,r),n},Xa=function(r){return r&&r.__esModule?r:{default:r}},es=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},ts=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},os=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",Oa),e("__assign",Da),e("__rest",Ua),e("__decorate",Ba),e("__param",Fa),e("__metadata",Ga),e("__awaiter",Ha),e("__generator",Va),e("__exportStar",qa),e("__createBinding",fr),e("__values",ur),e("__read",Rn),e("__spread",$a),e("__spreadArrays",ja),e("__spreadArray",za),e("__await",qt),e("__asyncGenerator",Za),e("__asyncDelegator",Ka),e("__asyncValues",Ja),e("__makeTemplateObject",Ya),e("__importStar",Qa),e("__importDefault",Xa),e("__classPrivateFieldGet",es),e("__classPrivateFieldSet",ts),e("__classPrivateFieldIn",os)})});var Wn=Ke(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.getLocalStorage=H.getLocalStorageOrThrow=H.getCrypto=H.getCryptoOrThrow=H.getLocation=H.getLocationOrThrow=H.getNavigator=H.getNavigatorOrThrow=H.getDocument=H.getDocumentOrThrow=H.getFromWindowOrThrow=H.getFromWindow=void 0;function Et(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}H.getFromWindow=Et;function $t(e){let t=Et(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}H.getFromWindowOrThrow=$t;function b1(){return $t("document")}H.getDocumentOrThrow=b1;function v1(){return Et("document")}H.getDocument=v1;function w1(){return $t("navigator")}H.getNavigatorOrThrow=w1;function C1(){return Et("navigator")}H.getNavigator=C1;function x1(){return $t("location")}H.getLocationOrThrow=x1;function E1(){return Et("location")}H.getLocation=E1;function _1(){return $t("crypto")}H.getCryptoOrThrow=_1;function P1(){return Et("crypto")}H.getCrypto=P1;function T1(){return $t("localStorage")}H.getLocalStorageOrThrow=T1;function A1(){return Et("localStorage")}H.getLocalStorage=A1});var ns=Ke(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.getWindowMetadata=void 0;var rs=Wn();function S1(){let e,t;try{e=rs.getDocumentOrThrow(),t=rs.getLocationOrThrow()}catch{return null}function o(){let g=e.getElementsByTagName("link"),p=[];for(let b=0;b<g.length;b++){let y=g[b],d=y.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=y.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let P=t.protocol+"//"+t.host;if(h.indexOf("/")===0)P+=h;else{let w=t.pathname.split("/");w.pop(),P+=w.join("/")+"/"+h}p.push(P)}else if(h.indexOf("//")===0){let P=t.protocol+h;p.push(P)}else p.push(h)}}return p}function r(...g){let p=e.getElementsByTagName("meta");for(let b=0;b<p.length;b++){let y=p[b],d=["itemprop","property","name"].map(h=>y.getAttribute(h)).filter(h=>h?g.includes(h):!1);if(d.length&&d){let h=y.getAttribute("content");if(h)return h}}return""}function n(){let g=r("name","og:site_name","og:title","twitter:title");return g||(g=e.title),g}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}gr.getWindowMetadata=S1});var hs={};ji(hs,{BotInfo:()=>ds,BrowserInfo:()=>ss,NodeInfo:()=>ls,ReactNativeInfo:()=>ps,SearchBotDeviceInfo:()=>cs,browserName:()=>M1,detect:()=>I1,detectOS:()=>fs,getNodeVersion:()=>ms,parseUserAgent:()=>In});function I1(e){return e?In(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ps:typeof navigator<"u"?In(navigator.userAgent):ms()}function us(e){return e!==""&&W1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function M1(e){var t=us(e);return t?t[0]:null}function In(e){var t=us(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new ds;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<is&&(n=L1(n,N1(is-n.length))):n=[];var i=n.join("."),a=fs(e),s=R1.exec(e);return s&&s[1]?new cs(o,i,a,s[1]):new ss(o,i,a)}function fs(e){for(var t=0,o=as.length;t<o;t++){var r=as[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function ms(){var e=typeof process<"u"&&process.version;return e?new ls(process.version.slice(1)):null}function N1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var L1,ss,ls,cs,ds,ps,k1,R1,is,W1,as,gs=$i(()=>{L1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},ss=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ls=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),cs=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),ds=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ps=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),k1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,R1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,is=3,W1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",k1]],as=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var Nn=Ke(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.getClientMeta=S.getLocalStorage=S.getLocalStorageOrThrow=S.getCrypto=S.getCryptoOrThrow=S.getLocation=S.getLocationOrThrow=S.getNavigator=S.getNavigatorOrThrow=S.getDocument=S.getDocumentOrThrow=S.getFromWindowOrThrow=S.getFromWindow=S.isBrowser=S.isNode=S.isMobile=S.isIOS=S.isAndroid=S.detectOS=S.detectEnv=void 0;var ys=hr(),O1=ys.__importStar(ns()),Le=ys.__importStar(Wn()),D1=(gs(),Zi(hs));function Mn(e){return(0,D1.detect)(e)}S.detectEnv=Mn;function yr(){let e=Mn();return e&&e.os?e.os:void 0}S.detectOS=yr;function bs(){let e=yr();return e?e.toLowerCase().includes("android"):!1}S.isAndroid=bs;function vs(){let e=yr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}S.isIOS=vs;function U1(){return yr()?bs()||vs():!1}S.isMobile=U1;function ws(){let e=Mn();return e&&e.name?e.name.toLowerCase()==="node":!1}S.isNode=ws;function B1(){return!ws()&&!!(0,S.getNavigator)()}S.isBrowser=B1;S.getFromWindow=Le.getFromWindow;S.getFromWindowOrThrow=Le.getFromWindowOrThrow;S.getDocumentOrThrow=Le.getDocumentOrThrow;S.getDocument=Le.getDocument;S.getNavigatorOrThrow=Le.getNavigatorOrThrow;S.getNavigator=Le.getNavigator;S.getLocationOrThrow=Le.getLocationOrThrow;S.getLocation=Le.getLocation;S.getCryptoOrThrow=Le.getCryptoOrThrow;S.getCrypto=Le.getCrypto;S.getLocalStorageOrThrow=Le.getLocalStorageOrThrow;S.getLocalStorage=Le.getLocalStorage;function F1(){return O1.getWindowMetadata()}S.getClientMeta=F1});var Cs={};ji(Cs,{safeJsonParse:()=>G1,safeJsonStringify:()=>H1});function G1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function H1(e){return typeof e=="string"?e:JSON.stringify(e)}var xs=$i(()=>{});var On=Ke(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.safeJsonStringify=jt.safeJsonParse=void 0;var V1=hr(),Es=V1.__importStar((xs(),Zi(Cs)));jt.safeJsonParse=Es.safeJsonParse;jt.safeJsonStringify=Es.safeJsonStringify});var Un=Ke(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.removeLocal=lt.getLocal=lt.setLocal=void 0;var _s=On(),Dn=Nn();function q1(e,t){let o=(0,_s.safeJsonStringify)(t),r=(0,Dn.getLocalStorage)();r&&r.setItem(e,o)}lt.setLocal=q1;function $1(e){let t=null,o=null,r=(0,Dn.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,_s.safeJsonParse)(o),t}lt.getLocal=$1;function j1(e){let t=(0,Dn.getLocalStorage)();t&&t.removeItem(e)}lt.removeLocal=j1});var Ts=Ke(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getMobileLinkRegistry=ye.getMobileRegistryEntry=ye.saveMobileLinkInfo=ye.formatIOSMobile=ye.mobileLinkChoiceKey=void 0;var z1=Un();ye.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Z1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}ye.formatIOSMobile=Z1;function K1(e){let t=e.href.split("?")[0];(0,z1.setLocal)(ye.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}ye.saveMobileLinkInfo=K1;function Ps(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}ye.getMobileRegistryEntry=Ps;function J1(e,t){let o=e;return t&&(o=t.map(r=>Ps(e,r)).filter(Boolean)),o}ye.getMobileLinkRegistry=J1});var Ls=Ke(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.formatMobileRegistry=Ue.formatMobileRegistryEntry=Ue.getDappRegistryUrl=Ue.getWalletRegistryUrl=void 0;var As="https://registry.walletconnect.com";function Y1(){return As+"/api/v2/wallets"}Ue.getWalletRegistryUrl=Y1;function Q1(){return As+"/api/v2/dapps"}Ue.getDappRegistryUrl=Q1;function Ss(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}Ue.formatMobileRegistryEntry=Ss;function X1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ss(o,t))}Ue.formatMobileRegistry=X1});var ks=Ke(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Co=hr();Co.__exportStar(Nn(),_t);Co.__exportStar(On(),_t);Co.__exportStar(Un(),_t);Co.__exportStar(Ts(),_t);Co.__exportStar(Ls(),_t)});import{Web3Provider as jm}from"@ethersproject/providers";import{useEffect as mn,useState as ie}from"react";var C=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Hd from"axios";var Re=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Dt=class extends Re{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},x=class extends Re{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var z=class extends Re{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},J=e=>{if(e instanceof Re)return e;if(!Hd.isAxiosError(e))return Ee(e);if(!e.response)return new Dt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Dt(t||"ApiError",e.response.status,o||r,e,n)},Ee=e=>e instanceof Re?e:e instanceof Error?new x(e.message,e):new x(`Internal error: ${e}`);var Ki=()=>"/api/v1/sessions",Ji=()=>"/api/v1/sessions/logout",Yi=()=>"/api/v1/sessions/fork",Qi=()=>"/api/v1/sessions/fork/recover",Xi=()=>"/api/v1/siwe/init",ea=()=>"/api/v1/siwe/authenticate",ta=()=>"/api/v1/siwe/link",oa=()=>"/api/v1/passwordless/init",ra=()=>"/api/v1/passwordless/authenticate",na=()=>"/api/v1/passwordless/link",ia=()=>"/api/v1/passwordless_sms/init",aa=()=>"/api/v1/passwordless_sms/authenticate",sa=()=>"/api/v1/passwordless_sms/link",la=()=>"/api/v1/oauth/init",ca=()=>"/api/v1/oauth/authenticate",da=()=>"/api/v1/oauth/link",pa=()=>"/api/v1/siwe/unlink",ua=()=>"/api/v1/passwordless/unlink",fa=()=>"/api/v1/passwordless_sms/unlink",ma=()=>"/api/v1/oauth/unlink",ha=()=>"/api/v1/analytics_events";var gt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=ra(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=na();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw J(t)}}async sendCodeEmail(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{let o=oa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw J(o)}}};var it=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=ca(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=da();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw J(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initialzing OAuth authentication.");try{let o=la();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw J(o)}}};var at=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ea(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ta(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw J(t)}}async promptConnect(){if(!this.api)throw new x("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new x("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new x("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Xi(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var yt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=aa(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=sa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw J(t)}}async sendSmsCode(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{let o=ia();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw J(o)}}};import{getAddress as tp}from"@ethersproject/address";var ga="1.25.0-beta.2";var Oe="4df5e2316331463a9130964bd6078dfa",Xo="https://auth.privy.io",ya=1e4,_e=1400,Cn=ga;var Ut="privy:token",er="privy:refresh_token",bo="privy:session_transfer_token",tr="privy:connectors",xn="walletconnect",ba=3e4,Pe=1;var En=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},_n=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function qd(){return typeof window<"u"&&window.localStorage?new _n:new En}var q=qd();import a1 from"@coinbase/wallet-sdk";import{getAddress as s1}from"@ethersproject/address";import{jsx as va,jsxs as $d}from"react/jsx-runtime";var Te=({style:e,...t})=>$d("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[va("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),va("path",{fillRule:"evenodd",clipRule:"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"})]});import{getAddress as n1}from"@ethersproject/address";import{Web3Provider as i1}from"@ethersproject/providers";import{isHexString as Xd}from"@ethersproject/bytes";import{InfuraProvider as e1}from"@ethersproject/providers";import{toUtf8String as t1}from"@ethersproject/strings";import o1 from"eventemitter3";var jd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],wa=e=>jd.includes(e);import{isPossiblePhoneNumber as zd}from"libphonenumber-js/min";var Ca=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),xa=e=>zd(String(e),"US"),Ea=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},We=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},Pn=e=>new Promise(t=>setTimeout(t,e)),_a=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await Pn(o);a||i(new Error("Exceeded max attempts before resolving function"))})},or=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Zd=(e,t)=>e.toLowerCase()===t.toLowerCase(),Tn=(e,t)=>{for(let o of e)if(Zd(o,t))return!0;return!1},rr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),vo=e=>typeof e=="string"?e:"0x"+e.toString(16);import{ErrorCode as Kd}from"@ethersproject/logger";var Bt=class extends z{constructor(){super("Wallet timeout");this.type="wallet_error"}},vt=class extends z{constructor(){super("User rejected connection");this.type="wallet_error"}},Ae=e=>{if(e instanceof z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ft(e);return e.code===Kd.ACTION_REJECTED&&(t.details=bt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ft(e):new z("Unknown connector error",e)},An=class extends Re{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ft=class extends An{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(bt).find(l=>l.eipCode===r.code);this.details=n||bt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=bt.E32002_CONNECTION_ALREADY_PENDING:this.details=bt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=bt.E32002_WALLET_LOCKED))}},Jd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Yd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Qd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},bt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Qd,...Yd},wt={...Jd,...bt};var r1=12e4,Sn=(e=new Bt,t=r1)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ie=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Sn()]).catch(o=>{throw Ae(o)})}},Ct=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},nr=class extends o1{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new e1(n,Oe)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Ct(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await wo()||!this.address)throw new Ct("Disconnected",4900);return(await Ta(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Ct(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=Xd(r)?t1(r):r;return await Pa(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:vo(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return vo(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(wa(o.method)){let r=await wo();if(!r||!this.address)throw new Ct("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Ct("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await wo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},xt=class extends Ie{constructor(o){super(o)}},ir=class extends Ie{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var he=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
1
+ var Od=Object.create;var Qo=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var $i=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ke=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ji=(e,t)=>{for(var o in t)Qo(e,o,{get:t[o],enumerable:!0})},zi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&Qo(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var Gd=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},zi(t||!e||!e.__esModule?Qo(o,"default",{value:e,enumerable:!0}):o,e)),Zi=e=>zi(Qo({},"__esModule",{value:!0}),e);var hr=Ke((Oh,mr)=>{var Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,qa,ur,Rn,$a,ja,za,qt,Za,Ka,Ja,Ya,Qa,Xa,es,ts,os,fr;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof mr=="object"&&typeof mr.exports=="object"?e(o(t,o(mr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};Oa=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Da=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},Ua=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},Ba=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var f=r.length-1;f>=0;f--)(c=r[f])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Fa=function(r,n){return function(i,a){n(i,a,r)}},Ga=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Ha=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(b){try{p(a.next(b))}catch(y){c(y)}}function g(b){try{p(a.throw(b))}catch(y){c(y)}}function p(b){b.done?l(b.value):s(b.value).then(f,g)}p((a=a.apply(r,n||[])).next())})},Va=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(p){return function(b){return g([p,b])}}function g(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(b){p=[6,b],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},qa=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&fr(n,r,i)},fr=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Rn=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(f){c={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},$a=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Rn(arguments[n]));return r},ja=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,f=l.length;c<f;c++,s++)a[s]=l[c];return a},za=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},qt=function(r){return this instanceof qt?(this.v=r,this):new qt(r)},Za=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(h){return new Promise(function(P,w){l.push([d,h,P,w])>1||f(d,h)})})}function f(d,h){try{g(a[d](h))}catch(P){y(l[0][3],P)}}function g(d){d.value instanceof qt?Promise.resolve(d.value.v).then(p,b):y(l[0][2],d)}function p(d){f("next",d)}function b(d){f("throw",d)}function y(d,h){d(h),l.shift(),l.length&&f(l[0][0],l[0][1])}},Ka=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:qt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Ja=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof ur=="function"?ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(f,g){c=r[l](c),s(f,g,c.done,c.value)})}}function s(l,c,f,g){Promise.resolve(g).then(function(p){l({value:p,done:f})},c)}},Ya=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Qa=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&fr(n,r,i);return o(n,r),n},Xa=function(r){return r&&r.__esModule?r:{default:r}},es=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},ts=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},os=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",Oa),e("__assign",Da),e("__rest",Ua),e("__decorate",Ba),e("__param",Fa),e("__metadata",Ga),e("__awaiter",Ha),e("__generator",Va),e("__exportStar",qa),e("__createBinding",fr),e("__values",ur),e("__read",Rn),e("__spread",$a),e("__spreadArrays",ja),e("__spreadArray",za),e("__await",qt),e("__asyncGenerator",Za),e("__asyncDelegator",Ka),e("__asyncValues",Ja),e("__makeTemplateObject",Ya),e("__importStar",Qa),e("__importDefault",Xa),e("__classPrivateFieldGet",es),e("__classPrivateFieldSet",ts),e("__classPrivateFieldIn",os)})});var Wn=Ke(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.getLocalStorage=H.getLocalStorageOrThrow=H.getCrypto=H.getCryptoOrThrow=H.getLocation=H.getLocationOrThrow=H.getNavigator=H.getNavigatorOrThrow=H.getDocument=H.getDocumentOrThrow=H.getFromWindowOrThrow=H.getFromWindow=void 0;function Et(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}H.getFromWindow=Et;function $t(e){let t=Et(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}H.getFromWindowOrThrow=$t;function b1(){return $t("document")}H.getDocumentOrThrow=b1;function v1(){return Et("document")}H.getDocument=v1;function w1(){return $t("navigator")}H.getNavigatorOrThrow=w1;function C1(){return Et("navigator")}H.getNavigator=C1;function x1(){return $t("location")}H.getLocationOrThrow=x1;function E1(){return Et("location")}H.getLocation=E1;function _1(){return $t("crypto")}H.getCryptoOrThrow=_1;function P1(){return Et("crypto")}H.getCrypto=P1;function T1(){return $t("localStorage")}H.getLocalStorageOrThrow=T1;function A1(){return Et("localStorage")}H.getLocalStorage=A1});var ns=Ke(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.getWindowMetadata=void 0;var rs=Wn();function S1(){let e,t;try{e=rs.getDocumentOrThrow(),t=rs.getLocationOrThrow()}catch{return null}function o(){let g=e.getElementsByTagName("link"),p=[];for(let b=0;b<g.length;b++){let y=g[b],d=y.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=y.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let P=t.protocol+"//"+t.host;if(h.indexOf("/")===0)P+=h;else{let w=t.pathname.split("/");w.pop(),P+=w.join("/")+"/"+h}p.push(P)}else if(h.indexOf("//")===0){let P=t.protocol+h;p.push(P)}else p.push(h)}}return p}function r(...g){let p=e.getElementsByTagName("meta");for(let b=0;b<p.length;b++){let y=p[b],d=["itemprop","property","name"].map(h=>y.getAttribute(h)).filter(h=>h?g.includes(h):!1);if(d.length&&d){let h=y.getAttribute("content");if(h)return h}}return""}function n(){let g=r("name","og:site_name","og:title","twitter:title");return g||(g=e.title),g}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}gr.getWindowMetadata=S1});var hs={};ji(hs,{BotInfo:()=>ds,BrowserInfo:()=>ss,NodeInfo:()=>ls,ReactNativeInfo:()=>ps,SearchBotDeviceInfo:()=>cs,browserName:()=>M1,detect:()=>I1,detectOS:()=>fs,getNodeVersion:()=>ms,parseUserAgent:()=>In});function I1(e){return e?In(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ps:typeof navigator<"u"?In(navigator.userAgent):ms()}function us(e){return e!==""&&W1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function M1(e){var t=us(e);return t?t[0]:null}function In(e){var t=us(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new ds;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<is&&(n=L1(n,N1(is-n.length))):n=[];var i=n.join("."),a=fs(e),s=R1.exec(e);return s&&s[1]?new cs(o,i,a,s[1]):new ss(o,i,a)}function fs(e){for(var t=0,o=as.length;t<o;t++){var r=as[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function ms(){var e=typeof process<"u"&&process.version;return e?new ls(process.version.slice(1)):null}function N1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var L1,ss,ls,cs,ds,ps,k1,R1,is,W1,as,gs=$i(()=>{L1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},ss=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ls=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),cs=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),ds=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ps=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),k1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,R1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,is=3,W1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",k1]],as=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var Nn=Ke(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.getClientMeta=S.getLocalStorage=S.getLocalStorageOrThrow=S.getCrypto=S.getCryptoOrThrow=S.getLocation=S.getLocationOrThrow=S.getNavigator=S.getNavigatorOrThrow=S.getDocument=S.getDocumentOrThrow=S.getFromWindowOrThrow=S.getFromWindow=S.isBrowser=S.isNode=S.isMobile=S.isIOS=S.isAndroid=S.detectOS=S.detectEnv=void 0;var ys=hr(),O1=ys.__importStar(ns()),Le=ys.__importStar(Wn()),D1=(gs(),Zi(hs));function Mn(e){return(0,D1.detect)(e)}S.detectEnv=Mn;function yr(){let e=Mn();return e&&e.os?e.os:void 0}S.detectOS=yr;function bs(){let e=yr();return e?e.toLowerCase().includes("android"):!1}S.isAndroid=bs;function vs(){let e=yr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}S.isIOS=vs;function U1(){return yr()?bs()||vs():!1}S.isMobile=U1;function ws(){let e=Mn();return e&&e.name?e.name.toLowerCase()==="node":!1}S.isNode=ws;function B1(){return!ws()&&!!(0,S.getNavigator)()}S.isBrowser=B1;S.getFromWindow=Le.getFromWindow;S.getFromWindowOrThrow=Le.getFromWindowOrThrow;S.getDocumentOrThrow=Le.getDocumentOrThrow;S.getDocument=Le.getDocument;S.getNavigatorOrThrow=Le.getNavigatorOrThrow;S.getNavigator=Le.getNavigator;S.getLocationOrThrow=Le.getLocationOrThrow;S.getLocation=Le.getLocation;S.getCryptoOrThrow=Le.getCryptoOrThrow;S.getCrypto=Le.getCrypto;S.getLocalStorageOrThrow=Le.getLocalStorageOrThrow;S.getLocalStorage=Le.getLocalStorage;function F1(){return O1.getWindowMetadata()}S.getClientMeta=F1});var Cs={};ji(Cs,{safeJsonParse:()=>G1,safeJsonStringify:()=>H1});function G1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function H1(e){return typeof e=="string"?e:JSON.stringify(e)}var xs=$i(()=>{});var On=Ke(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.safeJsonStringify=jt.safeJsonParse=void 0;var V1=hr(),Es=V1.__importStar((xs(),Zi(Cs)));jt.safeJsonParse=Es.safeJsonParse;jt.safeJsonStringify=Es.safeJsonStringify});var Un=Ke(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.removeLocal=lt.getLocal=lt.setLocal=void 0;var _s=On(),Dn=Nn();function q1(e,t){let o=(0,_s.safeJsonStringify)(t),r=(0,Dn.getLocalStorage)();r&&r.setItem(e,o)}lt.setLocal=q1;function $1(e){let t=null,o=null,r=(0,Dn.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,_s.safeJsonParse)(o),t}lt.getLocal=$1;function j1(e){let t=(0,Dn.getLocalStorage)();t&&t.removeItem(e)}lt.removeLocal=j1});var Ts=Ke(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getMobileLinkRegistry=ye.getMobileRegistryEntry=ye.saveMobileLinkInfo=ye.formatIOSMobile=ye.mobileLinkChoiceKey=void 0;var z1=Un();ye.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Z1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}ye.formatIOSMobile=Z1;function K1(e){let t=e.href.split("?")[0];(0,z1.setLocal)(ye.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}ye.saveMobileLinkInfo=K1;function Ps(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}ye.getMobileRegistryEntry=Ps;function J1(e,t){let o=e;return t&&(o=t.map(r=>Ps(e,r)).filter(Boolean)),o}ye.getMobileLinkRegistry=J1});var Ls=Ke(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.formatMobileRegistry=Ue.formatMobileRegistryEntry=Ue.getDappRegistryUrl=Ue.getWalletRegistryUrl=void 0;var As="https://registry.walletconnect.com";function Y1(){return As+"/api/v2/wallets"}Ue.getWalletRegistryUrl=Y1;function Q1(){return As+"/api/v2/dapps"}Ue.getDappRegistryUrl=Q1;function Ss(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}Ue.formatMobileRegistryEntry=Ss;function X1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ss(o,t))}Ue.formatMobileRegistry=X1});var ks=Ke(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Co=hr();Co.__exportStar(Nn(),_t);Co.__exportStar(On(),_t);Co.__exportStar(Un(),_t);Co.__exportStar(Ts(),_t);Co.__exportStar(Ls(),_t)});import{Web3Provider as jm}from"@ethersproject/providers";import{useEffect as mn,useState as ie}from"react";var C=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Hd from"axios";var Re=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Dt=class extends Re{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},x=class extends Re{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var z=class extends Re{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},J=e=>{if(e instanceof Re)return e;if(!Hd.isAxiosError(e))return Ee(e);if(!e.response)return new Dt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Dt(t||"ApiError",e.response.status,o||r,e,n)},Ee=e=>e instanceof Re?e:e instanceof Error?new x(e.message,e):new x(`Internal error: ${e}`);var Ki=()=>"/api/v1/sessions",Ji=()=>"/api/v1/sessions/logout",Yi=()=>"/api/v1/sessions/fork",Qi=()=>"/api/v1/sessions/fork/recover",Xi=()=>"/api/v1/siwe/init",ea=()=>"/api/v1/siwe/authenticate",ta=()=>"/api/v1/siwe/link",oa=()=>"/api/v1/passwordless/init",ra=()=>"/api/v1/passwordless/authenticate",na=()=>"/api/v1/passwordless/link",ia=()=>"/api/v1/passwordless_sms/init",aa=()=>"/api/v1/passwordless_sms/authenticate",sa=()=>"/api/v1/passwordless_sms/link",la=()=>"/api/v1/oauth/init",ca=()=>"/api/v1/oauth/authenticate",da=()=>"/api/v1/oauth/link",pa=()=>"/api/v1/siwe/unlink",ua=()=>"/api/v1/passwordless/unlink",fa=()=>"/api/v1/passwordless_sms/unlink",ma=()=>"/api/v1/oauth/unlink",ha=()=>"/api/v1/analytics_events";var gt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=ra(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=na();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw J(t)}}async sendCodeEmail(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{let o=oa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw J(o)}}};var it=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=ca(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=da();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw J(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initialzing OAuth authentication.");try{let o=la();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw J(o)}}};var at=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ea(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ta(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw J(t)}}async promptConnect(){if(!this.api)throw new x("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new x("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new x("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Xi(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var yt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=aa(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=sa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw J(t)}}async sendSmsCode(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{let o=ia();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw J(o)}}};import{getAddress as tp}from"@ethersproject/address";var ga="1.25.0";var Oe="4df5e2316331463a9130964bd6078dfa",Xo="https://auth.privy.io",ya=1e4,_e=1400,Cn=ga;var Ut="privy:token",er="privy:refresh_token",bo="privy:session_transfer_token",tr="privy:connectors",xn="walletconnect",ba=3e4,Pe=1;var En=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},_n=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function qd(){return typeof window<"u"&&window.localStorage?new _n:new En}var q=qd();import a1 from"@coinbase/wallet-sdk";import{getAddress as s1}from"@ethersproject/address";import{jsx as va,jsxs as $d}from"react/jsx-runtime";var Te=({style:e,...t})=>$d("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[va("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),va("path",{fillRule:"evenodd",clipRule:"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"})]});import{getAddress as n1}from"@ethersproject/address";import{Web3Provider as i1}from"@ethersproject/providers";import{isHexString as Xd}from"@ethersproject/bytes";import{InfuraProvider as e1}from"@ethersproject/providers";import{toUtf8String as t1}from"@ethersproject/strings";import o1 from"eventemitter3";var jd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],wa=e=>jd.includes(e);import{isPossiblePhoneNumber as zd}from"libphonenumber-js/min";var Ca=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),xa=e=>zd(String(e),"US"),Ea=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},We=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},Pn=e=>new Promise(t=>setTimeout(t,e)),_a=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await Pn(o);a||i(new Error("Exceeded max attempts before resolving function"))})},or=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Zd=(e,t)=>e.toLowerCase()===t.toLowerCase(),Tn=(e,t)=>{for(let o of e)if(Zd(o,t))return!0;return!1},rr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),vo=e=>typeof e=="string"?e:"0x"+e.toString(16);import{ErrorCode as Kd}from"@ethersproject/logger";var Bt=class extends z{constructor(){super("Wallet timeout");this.type="wallet_error"}},vt=class extends z{constructor(){super("User rejected connection");this.type="wallet_error"}},Ae=e=>{if(e instanceof z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ft(e);return e.code===Kd.ACTION_REJECTED&&(t.details=bt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ft(e):new z("Unknown connector error",e)},An=class extends Re{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ft=class extends An{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(bt).find(l=>l.eipCode===r.code);this.details=n||bt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=bt.E32002_CONNECTION_ALREADY_PENDING:this.details=bt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=bt.E32002_WALLET_LOCKED))}},Jd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Yd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Qd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},bt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Qd,...Yd},wt={...Jd,...bt};var r1=12e4,Sn=(e=new Bt,t=r1)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ie=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Sn()]).catch(o=>{throw Ae(o)})}},Ct=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},nr=class extends o1{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new e1(n,Oe)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Ct(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await wo()||!this.address)throw new Ct("Disconnected",4900);return(await Ta(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Ct(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=Xd(r)?t1(r):r;return await Pa(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:vo(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return vo(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(wa(o.method)){let r=await wo();if(!r||!this.address)throw new Ct("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Ct("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await wo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},xt=class extends Ie{constructor(o){super(o)}},ir=class extends Ie{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var he=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
2
2
  ${o}
3
3
 
4
4
  ${s}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Od=Object.create;var xr=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var ua=(e,t)=>()=>(e&&(t=e(e=0)),t);var wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yn=(e,t)=>{for(var o in t)xr(e,o,{get:t[o],enumerable:!0})},fa=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&xr(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var E=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},fa(t||!e||!e.__esModule?xr(o,"default",{value:e,enumerable:!0}):o,e)),Qn=e=>fa(xr({},"__esModule",{value:!0}),e);var Gr=wt((Kf,Fr)=>{var ds,ps,us,fs,ms,hs,gs,ys,bs,Ur,ci,vs,ws,Cs,Eo,xs,Es,_s,Ps,Ts,As,Ss,Ls,ks,Br;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof Fr=="object"&&typeof Fr.exports=="object"?e(o(t,o(Fr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};ds=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},ps=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},us=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},fs=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var f=r.length-1;f>=0;f--)(c=r[f])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},ms=function(r,n){return function(i,a){n(i,a,r)}},hs=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},gs=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(b){try{p(a.next(b))}catch(y){c(y)}}function g(b){try{p(a.throw(b))}catch(y){c(y)}}function p(b){b.done?l(b.value):s(b.value).then(f,g)}p((a=a.apply(r,n||[])).next())})},ys=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(p){return function(b){return g([p,b])}}function g(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(b){p=[6,b],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},bs=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Br(n,r,i)},Br=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},Ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ci=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(f){c={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},vs=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ci(arguments[n]));return r},ws=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,f=l.length;c<f;c++,s++)a[s]=l[c];return a},Cs=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},Eo=function(r){return this instanceof Eo?(this.v=r,this):new Eo(r)},xs=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(h){return new Promise(function(A,C){l.push([d,h,A,C])>1||f(d,h)})})}function f(d,h){try{g(a[d](h))}catch(A){y(l[0][3],A)}}function g(d){d.value instanceof Eo?Promise.resolve(d.value.v).then(p,b):y(l[0][2],d)}function p(d){f("next",d)}function b(d){f("throw",d)}function y(d,h){d(h),l.shift(),l.length&&f(l[0][0],l[0][1])}},Es=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:Eo(r[s](c)),done:s==="return"}:l?l(c):c}:l}},_s=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Ur=="function"?Ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(f,g){c=r[l](c),s(f,g,c.done,c.value)})}}function s(l,c,f,g){Promise.resolve(g).then(function(p){l({value:p,done:f})},c)}},Ps=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Ts=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&Br(n,r,i);return o(n,r),n},As=function(r){return r&&r.__esModule?r:{default:r}},Ss=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},Ls=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},ks=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",ds),e("__assign",ps),e("__rest",us),e("__decorate",fs),e("__param",ms),e("__metadata",hs),e("__awaiter",gs),e("__generator",ys),e("__exportStar",bs),e("__createBinding",Br),e("__values",Ur),e("__read",ci),e("__spread",vs),e("__spreadArrays",ws),e("__spreadArray",Cs),e("__await",Eo),e("__asyncGenerator",xs),e("__asyncDelegator",Es),e("__asyncValues",_s),e("__makeTemplateObject",Ps),e("__importStar",Ts),e("__importDefault",As),e("__classPrivateFieldGet",Ss),e("__classPrivateFieldSet",Ls),e("__classPrivateFieldIn",ks)})});var di=wt(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getLocalStorage=j.getLocalStorageOrThrow=j.getCrypto=j.getCryptoOrThrow=j.getLocation=j.getLocationOrThrow=j.getNavigator=j.getNavigatorOrThrow=j.getDocument=j.getDocumentOrThrow=j.getFromWindowOrThrow=j.getFromWindow=void 0;function ro(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}j.getFromWindow=ro;function _o(e){let t=ro(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}j.getFromWindowOrThrow=_o;function Jd(){return _o("document")}j.getDocumentOrThrow=Jd;function Yd(){return ro("document")}j.getDocument=Yd;function Qd(){return _o("navigator")}j.getNavigatorOrThrow=Qd;function Xd(){return ro("navigator")}j.getNavigator=Xd;function e1(){return _o("location")}j.getLocationOrThrow=e1;function t1(){return ro("location")}j.getLocation=t1;function o1(){return _o("crypto")}j.getCryptoOrThrow=o1;function r1(){return ro("crypto")}j.getCrypto=r1;function n1(){return _o("localStorage")}j.getLocalStorageOrThrow=n1;function i1(){return ro("localStorage")}j.getLocalStorage=i1});var Ws=wt(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getWindowMetadata=void 0;var Rs=di();function a1(){let e,t;try{e=Rs.getDocumentOrThrow(),t=Rs.getLocationOrThrow()}catch{return null}function o(){let g=e.getElementsByTagName("link"),p=[];for(let b=0;b<g.length;b++){let y=g[b],d=y.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=y.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let A=t.protocol+"//"+t.host;if(h.indexOf("/")===0)A+=h;else{let C=t.pathname.split("/");C.pop(),A+=C.join("/")+"/"+h}p.push(A)}else if(h.indexOf("//")===0){let A=t.protocol+h;p.push(A)}else p.push(h)}}return p}function r(...g){let p=e.getElementsByTagName("meta");for(let b=0;b<p.length;b++){let y=p[b],d=["itemprop","property","name"].map(h=>y.getAttribute(h)).filter(h=>h?g.includes(h):!1);if(d.length&&d){let h=y.getAttribute("content");if(h)return h}}return""}function n(){let g=r("name","og:site_name","og:title","twitter:title");return g||(g=e.title),g}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}Hr.getWindowMetadata=a1});var Vs={};Yn(Vs,{BotInfo:()=>Us,BrowserInfo:()=>Ns,NodeInfo:()=>Os,ReactNativeInfo:()=>Bs,SearchBotDeviceInfo:()=>Ds,browserName:()=>u1,detect:()=>p1,detectOS:()=>Gs,getNodeVersion:()=>Hs,parseUserAgent:()=>pi});function p1(e){return e?pi(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bs:typeof navigator<"u"?pi(navigator.userAgent):Hs()}function Fs(e){return e!==""&&d1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function u1(e){var t=Fs(e);return t?t[0]:null}function pi(e){var t=Fs(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Us;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Is&&(n=s1(n,f1(Is-n.length))):n=[];var i=n.join("."),a=Gs(e),s=c1.exec(e);return s&&s[1]?new Ds(o,i,a,s[1]):new Ns(o,i,a)}function Gs(e){for(var t=0,o=Ms.length;t<o;t++){var r=Ms[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Hs(){var e=typeof process<"u"&&process.version;return e?new Os(process.version.slice(1)):null}function f1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var s1,Ns,Os,Ds,Us,Bs,l1,c1,Is,d1,Ms,qs=ua(()=>{s1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},Ns=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Os=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ds=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),Us=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Bs=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),l1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,c1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Is=3,d1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",l1]],Ms=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var fi=wt(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.getClientMeta=k.getLocalStorage=k.getLocalStorageOrThrow=k.getCrypto=k.getCryptoOrThrow=k.getLocation=k.getLocationOrThrow=k.getNavigator=k.getNavigatorOrThrow=k.getDocument=k.getDocumentOrThrow=k.getFromWindowOrThrow=k.getFromWindow=k.isBrowser=k.isNode=k.isMobile=k.isIOS=k.isAndroid=k.detectOS=k.detectEnv=void 0;var $s=Gr(),m1=$s.__importStar(Ws()),Ze=$s.__importStar(di()),h1=(qs(),Qn(Vs));function ui(e){return(0,h1.detect)(e)}k.detectEnv=ui;function Vr(){let e=ui();return e&&e.os?e.os:void 0}k.detectOS=Vr;function js(){let e=Vr();return e?e.toLowerCase().includes("android"):!1}k.isAndroid=js;function zs(){let e=Vr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}k.isIOS=zs;function g1(){return Vr()?js()||zs():!1}k.isMobile=g1;function Zs(){let e=ui();return e&&e.name?e.name.toLowerCase()==="node":!1}k.isNode=Zs;function y1(){return!Zs()&&!!(0,k.getNavigator)()}k.isBrowser=y1;k.getFromWindow=Ze.getFromWindow;k.getFromWindowOrThrow=Ze.getFromWindowOrThrow;k.getDocumentOrThrow=Ze.getDocumentOrThrow;k.getDocument=Ze.getDocument;k.getNavigatorOrThrow=Ze.getNavigatorOrThrow;k.getNavigator=Ze.getNavigator;k.getLocationOrThrow=Ze.getLocationOrThrow;k.getLocation=Ze.getLocation;k.getCryptoOrThrow=Ze.getCryptoOrThrow;k.getCrypto=Ze.getCrypto;k.getLocalStorageOrThrow=Ze.getLocalStorageOrThrow;k.getLocalStorage=Ze.getLocalStorage;function b1(){return m1.getWindowMetadata()}k.getClientMeta=b1});var Ks={};Yn(Ks,{safeJsonParse:()=>v1,safeJsonStringify:()=>w1});function v1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function w1(e){return typeof e=="string"?e:JSON.stringify(e)}var Js=ua(()=>{});var mi=wt(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.safeJsonStringify=Po.safeJsonParse=void 0;var C1=Gr(),Ys=C1.__importStar((Js(),Qn(Ks)));Po.safeJsonParse=Ys.safeJsonParse;Po.safeJsonStringify=Ys.safeJsonStringify});var gi=wt(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.removeLocal=Dt.getLocal=Dt.setLocal=void 0;var Qs=mi(),hi=fi();function x1(e,t){let o=(0,Qs.safeJsonStringify)(t),r=(0,hi.getLocalStorage)();r&&r.setItem(e,o)}Dt.setLocal=x1;function E1(e){let t=null,o=null,r=(0,hi.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Qs.safeJsonParse)(o),t}Dt.getLocal=E1;function _1(e){let t=(0,hi.getLocalStorage)();t&&t.removeItem(e)}Dt.removeLocal=_1});var el=wt(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getMobileLinkRegistry=Ae.getMobileRegistryEntry=Ae.saveMobileLinkInfo=Ae.formatIOSMobile=Ae.mobileLinkChoiceKey=void 0;var P1=gi();Ae.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function T1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Ae.formatIOSMobile=T1;function A1(e){let t=e.href.split("?")[0];(0,P1.setLocal)(Ae.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Ae.saveMobileLinkInfo=A1;function Xs(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Ae.getMobileRegistryEntry=Xs;function S1(e,t){let o=e;return t&&(o=t.map(r=>Xs(e,r)).filter(Boolean)),o}Ae.getMobileLinkRegistry=S1});var rl=wt(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.formatMobileRegistry=dt.formatMobileRegistryEntry=dt.getDappRegistryUrl=dt.getWalletRegistryUrl=void 0;var tl="https://registry.walletconnect.com";function L1(){return tl+"/api/v2/wallets"}dt.getWalletRegistryUrl=L1;function k1(){return tl+"/api/v2/dapps"}dt.getDappRegistryUrl=k1;function ol(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}dt.formatMobileRegistryEntry=ol;function R1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>ol(o,t))}dt.formatMobileRegistry=R1});var nl=wt(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var Jo=Gr();Jo.__exportStar(fi(),no);Jo.__exportStar(mi(),no);Jo.__exportStar(gi(),no);Jo.__exportStar(el(),no);Jo.__exportStar(rl(),no)});var W2={};Yn(W2,{AsExternalProvider:()=>Nt,ConnectorManager:()=>To,PrivyClient:()=>So,PrivyProvider:()=>Md,PrivyProxyProvider:()=>$e,VERSION:()=>_r,WalletConnector:()=>Ee,getAccessToken:()=>Co,usePrivy:()=>G});module.exports=Qn(W2);var Rd=require("@ethersproject/providers"),X=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ma=E(require("axios")),Xe=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},yo=class extends Xe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var te=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},le=e=>{if(e instanceof Xe)return e;if(!ma.default.isAxiosError(e))return Fe(e);if(!e.response)return new yo("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new yo(t||"ApiError",e.response.status,o||r,e,n)},Fe=e=>e instanceof Xe?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var ha=()=>"/api/v1/sessions",ga=()=>"/api/v1/sessions/logout",ya=()=>"/api/v1/sessions/fork",ba=()=>"/api/v1/sessions/fork/recover",va=()=>"/api/v1/siwe/init",wa=()=>"/api/v1/siwe/authenticate",Ca=()=>"/api/v1/siwe/link",xa=()=>"/api/v1/passwordless/init",Ea=()=>"/api/v1/passwordless/authenticate",_a=()=>"/api/v1/passwordless/link",Pa=()=>"/api/v1/passwordless_sms/init",Ta=()=>"/api/v1/passwordless_sms/authenticate",Aa=()=>"/api/v1/passwordless_sms/link",Sa=()=>"/api/v1/oauth/init",La=()=>"/api/v1/oauth/authenticate",ka=()=>"/api/v1/oauth/link",Ra=()=>"/api/v1/siwe/unlink",Wa=()=>"/api/v1/passwordless/unlink",Ia=()=>"/api/v1/passwordless_sms/unlink",Ma=()=>"/api/v1/oauth/unlink",Na=()=>"/api/v1/analytics_events";var Yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=Ea(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=_a();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw le(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=xa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw le(o)}}};var It=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=La(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=ka();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw le(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Sa();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw le(o)}}};var Mt=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(wa(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Ca(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw le(t)}}async promptConnect(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new P("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(va(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Qt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Ta(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Aa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw le(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Pa();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw le(o)}}};var pl=require("@ethersproject/address");var Oa="1.25.0-beta.2";var lt="4df5e2316331463a9130964bd6078dfa",Er="https://auth.privy.io",Da=1e4,Ge=1400,_r=Oa;var bo="privy:token",Pr="privy:refresh_token",zo="privy:session_transfer_token",Tr="privy:connectors",Xn="walletconnect",Ua=3e4,He=1;var ei=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},ti=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Hd(){return typeof window<"u"&&window.localStorage?new ti:new ei}var Y=Hd();var es=E(require("@coinbase/wallet-sdk")),ts=require("@ethersproject/address");var Zo=require("react/jsx-runtime"),Ve=({style:e,...t})=>(0,Zo.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Zo.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Zo.jsx)("path",{fillRule:"evenodd",clipRule:"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"})]});var Qa=require("@ethersproject/address"),Xa=require("@ethersproject/providers");var ja=require("@ethersproject/bytes"),za=require("@ethersproject/providers"),Za=require("@ethersproject/strings"),Ka=E(require("eventemitter3"));var Vd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Ba=e=>Vd.includes(e);var Fa=require("libphonenumber-js/min");var Ga=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Ha=e=>(0,Fa.isPossiblePhoneNumber)(String(e),"US"),Va=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},et=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},oi=e=>new Promise(t=>setTimeout(t,e)),qa=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await oi(o);a||i(new Error("Exceeded max attempts before resolving function"))})},Ar=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},qd=(e,t)=>e.toLowerCase()===t.toLowerCase(),ri=(e,t)=>{for(let o of e)if(qd(o,t))return!0;return!1},Sr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Ko=e=>typeof e=="string"?e:"0x"+e.toString(16);var $a=require("@ethersproject/logger");var vo=class extends te{constructor(){super("Wallet timeout");this.type="wallet_error"}},eo=class extends te{constructor(){super("User rejected connection");this.type="wallet_error"}},qe=e=>{if(e instanceof te)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new wo(e);return e.code===$a.ErrorCode.ACTION_REJECTED&&(t.details=Xt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new wo(e):new te("Unknown connector error",e)},ni=class extends Xe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},wo=class extends ni{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(Xt).find(l=>l.eipCode===r.code);this.details=n||Xt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=Xt.E32002_CONNECTION_ALREADY_PENDING:this.details=Xt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=Xt.E32002_WALLET_LOCKED))}},$d={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},jd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},zd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},Xt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...zd,...jd},to={...$d,...Xt};var Zd=12e4,ii=(e=new vo,t=Zd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),$e=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new te(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),ii()]).catch(o=>{throw qe(o)})}},oo=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Lr=class extends Ka.default{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new za.InfuraProvider(n,lt)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new oo(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Co()||!this.address)throw new oo("Disconnected",4900);return(await Ya(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new oo(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=(0,ja.isHexString)(r)?(0,Za.toUtf8String)(r):r;return await Ja(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Ko(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Ko(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(Ba(o.method)){let r=await Co();if(!r||!this.address)throw new oo("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new oo("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await Co();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},Nt=class extends $e{constructor(o){super(o)}},kr=class extends $e{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ee=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
1
+ "use strict";var Od=Object.create;var xr=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var ua=(e,t)=>()=>(e&&(t=e(e=0)),t);var wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yn=(e,t)=>{for(var o in t)xr(e,o,{get:t[o],enumerable:!0})},fa=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&xr(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var E=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},fa(t||!e||!e.__esModule?xr(o,"default",{value:e,enumerable:!0}):o,e)),Qn=e=>fa(xr({},"__esModule",{value:!0}),e);var Gr=wt((Kf,Fr)=>{var ds,ps,us,fs,ms,hs,gs,ys,bs,Ur,ci,vs,ws,Cs,Eo,xs,Es,_s,Ps,Ts,As,Ss,Ls,ks,Br;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof Fr=="object"&&typeof Fr.exports=="object"?e(o(t,o(Fr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};ds=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},ps=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},us=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},fs=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var f=r.length-1;f>=0;f--)(c=r[f])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},ms=function(r,n){return function(i,a){n(i,a,r)}},hs=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},gs=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(b){try{p(a.next(b))}catch(y){c(y)}}function g(b){try{p(a.throw(b))}catch(y){c(y)}}function p(b){b.done?l(b.value):s(b.value).then(f,g)}p((a=a.apply(r,n||[])).next())})},ys=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(p){return function(b){return g([p,b])}}function g(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(b){p=[6,b],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},bs=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Br(n,r,i)},Br=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},Ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ci=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(f){c={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},vs=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ci(arguments[n]));return r},ws=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,f=l.length;c<f;c++,s++)a[s]=l[c];return a},Cs=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},Eo=function(r){return this instanceof Eo?(this.v=r,this):new Eo(r)},xs=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(h){return new Promise(function(A,C){l.push([d,h,A,C])>1||f(d,h)})})}function f(d,h){try{g(a[d](h))}catch(A){y(l[0][3],A)}}function g(d){d.value instanceof Eo?Promise.resolve(d.value.v).then(p,b):y(l[0][2],d)}function p(d){f("next",d)}function b(d){f("throw",d)}function y(d,h){d(h),l.shift(),l.length&&f(l[0][0],l[0][1])}},Es=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:Eo(r[s](c)),done:s==="return"}:l?l(c):c}:l}},_s=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Ur=="function"?Ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(f,g){c=r[l](c),s(f,g,c.done,c.value)})}}function s(l,c,f,g){Promise.resolve(g).then(function(p){l({value:p,done:f})},c)}},Ps=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Ts=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&Br(n,r,i);return o(n,r),n},As=function(r){return r&&r.__esModule?r:{default:r}},Ss=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},Ls=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},ks=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",ds),e("__assign",ps),e("__rest",us),e("__decorate",fs),e("__param",ms),e("__metadata",hs),e("__awaiter",gs),e("__generator",ys),e("__exportStar",bs),e("__createBinding",Br),e("__values",Ur),e("__read",ci),e("__spread",vs),e("__spreadArrays",ws),e("__spreadArray",Cs),e("__await",Eo),e("__asyncGenerator",xs),e("__asyncDelegator",Es),e("__asyncValues",_s),e("__makeTemplateObject",Ps),e("__importStar",Ts),e("__importDefault",As),e("__classPrivateFieldGet",Ss),e("__classPrivateFieldSet",Ls),e("__classPrivateFieldIn",ks)})});var di=wt(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getLocalStorage=j.getLocalStorageOrThrow=j.getCrypto=j.getCryptoOrThrow=j.getLocation=j.getLocationOrThrow=j.getNavigator=j.getNavigatorOrThrow=j.getDocument=j.getDocumentOrThrow=j.getFromWindowOrThrow=j.getFromWindow=void 0;function ro(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}j.getFromWindow=ro;function _o(e){let t=ro(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}j.getFromWindowOrThrow=_o;function Jd(){return _o("document")}j.getDocumentOrThrow=Jd;function Yd(){return ro("document")}j.getDocument=Yd;function Qd(){return _o("navigator")}j.getNavigatorOrThrow=Qd;function Xd(){return ro("navigator")}j.getNavigator=Xd;function e1(){return _o("location")}j.getLocationOrThrow=e1;function t1(){return ro("location")}j.getLocation=t1;function o1(){return _o("crypto")}j.getCryptoOrThrow=o1;function r1(){return ro("crypto")}j.getCrypto=r1;function n1(){return _o("localStorage")}j.getLocalStorageOrThrow=n1;function i1(){return ro("localStorage")}j.getLocalStorage=i1});var Ws=wt(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getWindowMetadata=void 0;var Rs=di();function a1(){let e,t;try{e=Rs.getDocumentOrThrow(),t=Rs.getLocationOrThrow()}catch{return null}function o(){let g=e.getElementsByTagName("link"),p=[];for(let b=0;b<g.length;b++){let y=g[b],d=y.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=y.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let A=t.protocol+"//"+t.host;if(h.indexOf("/")===0)A+=h;else{let C=t.pathname.split("/");C.pop(),A+=C.join("/")+"/"+h}p.push(A)}else if(h.indexOf("//")===0){let A=t.protocol+h;p.push(A)}else p.push(h)}}return p}function r(...g){let p=e.getElementsByTagName("meta");for(let b=0;b<p.length;b++){let y=p[b],d=["itemprop","property","name"].map(h=>y.getAttribute(h)).filter(h=>h?g.includes(h):!1);if(d.length&&d){let h=y.getAttribute("content");if(h)return h}}return""}function n(){let g=r("name","og:site_name","og:title","twitter:title");return g||(g=e.title),g}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}Hr.getWindowMetadata=a1});var Vs={};Yn(Vs,{BotInfo:()=>Us,BrowserInfo:()=>Ns,NodeInfo:()=>Os,ReactNativeInfo:()=>Bs,SearchBotDeviceInfo:()=>Ds,browserName:()=>u1,detect:()=>p1,detectOS:()=>Gs,getNodeVersion:()=>Hs,parseUserAgent:()=>pi});function p1(e){return e?pi(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bs:typeof navigator<"u"?pi(navigator.userAgent):Hs()}function Fs(e){return e!==""&&d1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function u1(e){var t=Fs(e);return t?t[0]:null}function pi(e){var t=Fs(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Us;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Is&&(n=s1(n,f1(Is-n.length))):n=[];var i=n.join("."),a=Gs(e),s=c1.exec(e);return s&&s[1]?new Ds(o,i,a,s[1]):new Ns(o,i,a)}function Gs(e){for(var t=0,o=Ms.length;t<o;t++){var r=Ms[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Hs(){var e=typeof process<"u"&&process.version;return e?new Os(process.version.slice(1)):null}function f1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var s1,Ns,Os,Ds,Us,Bs,l1,c1,Is,d1,Ms,qs=ua(()=>{s1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},Ns=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Os=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ds=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),Us=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Bs=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),l1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,c1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Is=3,d1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",l1]],Ms=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var fi=wt(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.getClientMeta=k.getLocalStorage=k.getLocalStorageOrThrow=k.getCrypto=k.getCryptoOrThrow=k.getLocation=k.getLocationOrThrow=k.getNavigator=k.getNavigatorOrThrow=k.getDocument=k.getDocumentOrThrow=k.getFromWindowOrThrow=k.getFromWindow=k.isBrowser=k.isNode=k.isMobile=k.isIOS=k.isAndroid=k.detectOS=k.detectEnv=void 0;var $s=Gr(),m1=$s.__importStar(Ws()),Ze=$s.__importStar(di()),h1=(qs(),Qn(Vs));function ui(e){return(0,h1.detect)(e)}k.detectEnv=ui;function Vr(){let e=ui();return e&&e.os?e.os:void 0}k.detectOS=Vr;function js(){let e=Vr();return e?e.toLowerCase().includes("android"):!1}k.isAndroid=js;function zs(){let e=Vr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}k.isIOS=zs;function g1(){return Vr()?js()||zs():!1}k.isMobile=g1;function Zs(){let e=ui();return e&&e.name?e.name.toLowerCase()==="node":!1}k.isNode=Zs;function y1(){return!Zs()&&!!(0,k.getNavigator)()}k.isBrowser=y1;k.getFromWindow=Ze.getFromWindow;k.getFromWindowOrThrow=Ze.getFromWindowOrThrow;k.getDocumentOrThrow=Ze.getDocumentOrThrow;k.getDocument=Ze.getDocument;k.getNavigatorOrThrow=Ze.getNavigatorOrThrow;k.getNavigator=Ze.getNavigator;k.getLocationOrThrow=Ze.getLocationOrThrow;k.getLocation=Ze.getLocation;k.getCryptoOrThrow=Ze.getCryptoOrThrow;k.getCrypto=Ze.getCrypto;k.getLocalStorageOrThrow=Ze.getLocalStorageOrThrow;k.getLocalStorage=Ze.getLocalStorage;function b1(){return m1.getWindowMetadata()}k.getClientMeta=b1});var Ks={};Yn(Ks,{safeJsonParse:()=>v1,safeJsonStringify:()=>w1});function v1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function w1(e){return typeof e=="string"?e:JSON.stringify(e)}var Js=ua(()=>{});var mi=wt(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.safeJsonStringify=Po.safeJsonParse=void 0;var C1=Gr(),Ys=C1.__importStar((Js(),Qn(Ks)));Po.safeJsonParse=Ys.safeJsonParse;Po.safeJsonStringify=Ys.safeJsonStringify});var gi=wt(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.removeLocal=Dt.getLocal=Dt.setLocal=void 0;var Qs=mi(),hi=fi();function x1(e,t){let o=(0,Qs.safeJsonStringify)(t),r=(0,hi.getLocalStorage)();r&&r.setItem(e,o)}Dt.setLocal=x1;function E1(e){let t=null,o=null,r=(0,hi.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Qs.safeJsonParse)(o),t}Dt.getLocal=E1;function _1(e){let t=(0,hi.getLocalStorage)();t&&t.removeItem(e)}Dt.removeLocal=_1});var el=wt(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getMobileLinkRegistry=Ae.getMobileRegistryEntry=Ae.saveMobileLinkInfo=Ae.formatIOSMobile=Ae.mobileLinkChoiceKey=void 0;var P1=gi();Ae.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function T1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Ae.formatIOSMobile=T1;function A1(e){let t=e.href.split("?")[0];(0,P1.setLocal)(Ae.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Ae.saveMobileLinkInfo=A1;function Xs(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Ae.getMobileRegistryEntry=Xs;function S1(e,t){let o=e;return t&&(o=t.map(r=>Xs(e,r)).filter(Boolean)),o}Ae.getMobileLinkRegistry=S1});var rl=wt(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.formatMobileRegistry=dt.formatMobileRegistryEntry=dt.getDappRegistryUrl=dt.getWalletRegistryUrl=void 0;var tl="https://registry.walletconnect.com";function L1(){return tl+"/api/v2/wallets"}dt.getWalletRegistryUrl=L1;function k1(){return tl+"/api/v2/dapps"}dt.getDappRegistryUrl=k1;function ol(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}dt.formatMobileRegistryEntry=ol;function R1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>ol(o,t))}dt.formatMobileRegistry=R1});var nl=wt(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var Jo=Gr();Jo.__exportStar(fi(),no);Jo.__exportStar(mi(),no);Jo.__exportStar(gi(),no);Jo.__exportStar(el(),no);Jo.__exportStar(rl(),no)});var W2={};Yn(W2,{AsExternalProvider:()=>Nt,ConnectorManager:()=>To,PrivyClient:()=>So,PrivyProvider:()=>Md,PrivyProxyProvider:()=>$e,VERSION:()=>_r,WalletConnector:()=>Ee,getAccessToken:()=>Co,usePrivy:()=>G});module.exports=Qn(W2);var Rd=require("@ethersproject/providers"),X=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ma=E(require("axios")),Xe=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},yo=class extends Xe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var te=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},le=e=>{if(e instanceof Xe)return e;if(!ma.default.isAxiosError(e))return Fe(e);if(!e.response)return new yo("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new yo(t||"ApiError",e.response.status,o||r,e,n)},Fe=e=>e instanceof Xe?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var ha=()=>"/api/v1/sessions",ga=()=>"/api/v1/sessions/logout",ya=()=>"/api/v1/sessions/fork",ba=()=>"/api/v1/sessions/fork/recover",va=()=>"/api/v1/siwe/init",wa=()=>"/api/v1/siwe/authenticate",Ca=()=>"/api/v1/siwe/link",xa=()=>"/api/v1/passwordless/init",Ea=()=>"/api/v1/passwordless/authenticate",_a=()=>"/api/v1/passwordless/link",Pa=()=>"/api/v1/passwordless_sms/init",Ta=()=>"/api/v1/passwordless_sms/authenticate",Aa=()=>"/api/v1/passwordless_sms/link",Sa=()=>"/api/v1/oauth/init",La=()=>"/api/v1/oauth/authenticate",ka=()=>"/api/v1/oauth/link",Ra=()=>"/api/v1/siwe/unlink",Wa=()=>"/api/v1/passwordless/unlink",Ia=()=>"/api/v1/passwordless_sms/unlink",Ma=()=>"/api/v1/oauth/unlink",Na=()=>"/api/v1/analytics_events";var Yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=Ea(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=_a();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw le(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=xa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw le(o)}}};var It=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=La(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=ka();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw le(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Sa();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw le(o)}}};var Mt=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(wa(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Ca(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw le(t)}}async promptConnect(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new P("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(va(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Qt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Ta(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Aa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw le(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Pa();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw le(o)}}};var pl=require("@ethersproject/address");var Oa="1.25.0";var lt="4df5e2316331463a9130964bd6078dfa",Er="https://auth.privy.io",Da=1e4,Ge=1400,_r=Oa;var bo="privy:token",Pr="privy:refresh_token",zo="privy:session_transfer_token",Tr="privy:connectors",Xn="walletconnect",Ua=3e4,He=1;var ei=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},ti=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Hd(){return typeof window<"u"&&window.localStorage?new ti:new ei}var Y=Hd();var es=E(require("@coinbase/wallet-sdk")),ts=require("@ethersproject/address");var Zo=require("react/jsx-runtime"),Ve=({style:e,...t})=>(0,Zo.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Zo.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Zo.jsx)("path",{fillRule:"evenodd",clipRule:"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"})]});var Qa=require("@ethersproject/address"),Xa=require("@ethersproject/providers");var ja=require("@ethersproject/bytes"),za=require("@ethersproject/providers"),Za=require("@ethersproject/strings"),Ka=E(require("eventemitter3"));var Vd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Ba=e=>Vd.includes(e);var Fa=require("libphonenumber-js/min");var Ga=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Ha=e=>(0,Fa.isPossiblePhoneNumber)(String(e),"US"),Va=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},et=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},oi=e=>new Promise(t=>setTimeout(t,e)),qa=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await oi(o);a||i(new Error("Exceeded max attempts before resolving function"))})},Ar=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},qd=(e,t)=>e.toLowerCase()===t.toLowerCase(),ri=(e,t)=>{for(let o of e)if(qd(o,t))return!0;return!1},Sr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Ko=e=>typeof e=="string"?e:"0x"+e.toString(16);var $a=require("@ethersproject/logger");var vo=class extends te{constructor(){super("Wallet timeout");this.type="wallet_error"}},eo=class extends te{constructor(){super("User rejected connection");this.type="wallet_error"}},qe=e=>{if(e instanceof te)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new wo(e);return e.code===$a.ErrorCode.ACTION_REJECTED&&(t.details=Xt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new wo(e):new te("Unknown connector error",e)},ni=class extends Xe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},wo=class extends ni{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(Xt).find(l=>l.eipCode===r.code);this.details=n||Xt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=Xt.E32002_CONNECTION_ALREADY_PENDING:this.details=Xt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=Xt.E32002_WALLET_LOCKED))}},$d={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},jd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},zd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},Xt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...zd,...jd},to={...$d,...Xt};var Zd=12e4,ii=(e=new vo,t=Zd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),$e=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new te(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),ii()]).catch(o=>{throw qe(o)})}},oo=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Lr=class extends Ka.default{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new za.InfuraProvider(n,lt)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new oo(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Co()||!this.address)throw new oo("Disconnected",4900);return(await Ya(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new oo(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=(0,ja.isHexString)(r)?(0,Za.toUtf8String)(r):r;return await Ja(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Ko(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Ko(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(Ba(o.method)){let r=await Co();if(!r||!this.address)throw new oo("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new oo("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await Co();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},Nt=class extends $e{constructor(o){super(o)}},kr=class extends $e{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ee=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
2
2
  ${o}
3
3
 
4
4
  ${s}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.25.0-beta.2",
3
+ "version": "1.25.0",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",