@privy-io/react-auth 1.19.0-beta.8 → 1.19.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 cl=Object.create;var uo=Object.defineProperty;var dl=Object.getOwnPropertyDescriptor;var pl=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,fl=Object.prototype.hasOwnProperty;var Ln=(e,t)=>()=>(e&&(t=e(e=0)),t);var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sn=(e,t)=>{for(var o in t)uo(e,o,{get:t[o],enumerable:!0})},Pn=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pl(t))!fl.call(e,n)&&n!==o&&uo(e,n,{get:()=>t[n],enumerable:!(r=dl(t,n))||r.enumerable});return e};var ml=(e,t,o)=>(o=e!=null?cl(ul(e)):{},Pn(t||!e||!e.__esModule?uo(o,"default",{value:e,enumerable:!0}):o,e)),An=e=>Pn(uo({},"__esModule",{value:!0}),e);var _o=Te((g2,xo)=>{var di,pi,ui,fi,mi,hi,gi,bi,yi,Co,xr,vi,wi,Ci,yt,Ei,xi,_i,Li,Si,Pi,Ai,ki,Ti,Eo;(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 xo=="object"&&typeof xo.exports=="object"?e(o(t,o(xo.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])};di=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)},pi=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},ui=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},fi=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(d=r[h])&&(l=(s<3?d(l):s>3?d(n,i,l):d(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},mi=function(r,n){return function(i,a){n(i,a,r)}},hi=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},gi=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function h(g){try{p(a.next(g))}catch(b){d(b)}}function m(g){try{p(a.throw(g))}catch(b){d(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},bi=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,d;return d={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function h(p){return function(g){return m([p,g])}}function m(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(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},yi=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Eo(n,r,i)},Eo=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]},Co=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.")},xr=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],d;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){d={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(d)throw d.error}}return l},vi=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(xr(arguments[n]));return r},wi=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],d=0,h=l.length;d<h;d++,s++)a[s]=l[d];return a},Ci=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))},yt=function(r){return this instanceof yt?(this.v=r,this):new yt(r)},Ei=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={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(c){a[c]&&(s[c]=function(y){return new Promise(function(v,W){l.push([c,y,v,W])>1||h(c,y)})})}function h(c,y){try{m(a[c](y))}catch(v){b(l[0][3],v)}}function m(c){c.value instanceof yt?Promise.resolve(c.value.v).then(p,g):b(l[0][2],c)}function p(c){h("next",c)}function g(c){h("throw",c)}function b(c,y){c(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},xi=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(d){return(i=!i)?{value:yt(r[s](d)),done:s==="return"}:l?l(d):d}:l}},_i=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 Co=="function"?Co(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(d){return new Promise(function(h,m){d=r[l](d),s(h,m,d.done,d.value)})}}function s(l,d,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},d)}},Li=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};Si=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)&&Eo(n,r,i);return o(n,r),n},Pi=function(r){return r&&r.__esModule?r:{default:r}},Ai=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)},ki=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},Ti=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",di),e("__assign",pi),e("__rest",ui),e("__decorate",fi),e("__param",mi),e("__metadata",hi),e("__awaiter",gi),e("__generator",bi),e("__exportStar",yi),e("__createBinding",Eo),e("__values",Co),e("__read",xr),e("__spread",vi),e("__spreadArrays",wi),e("__spreadArray",Ci),e("__await",yt),e("__asyncGenerator",Ei),e("__asyncDelegator",xi),e("__asyncValues",_i),e("__makeTemplateObject",Li),e("__importStar",Si),e("__importDefault",Pi),e("__classPrivateFieldGet",Ai),e("__classPrivateFieldSet",ki),e("__classPrivateFieldIn",Ti)})});var _r=Te(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.getLocalStorage=M.getLocalStorageOrThrow=M.getCrypto=M.getCryptoOrThrow=M.getLocation=M.getLocationOrThrow=M.getNavigator=M.getNavigatorOrThrow=M.getDocument=M.getDocumentOrThrow=M.getFromWindowOrThrow=M.getFromWindow=void 0;function Xe(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}M.getFromWindow=Xe;function vt(e){let t=Xe(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}M.getFromWindowOrThrow=vt;function Fl(){return vt("document")}M.getDocumentOrThrow=Fl;function Gl(){return Xe("document")}M.getDocument=Gl;function Hl(){return vt("navigator")}M.getNavigatorOrThrow=Hl;function Vl(){return Xe("navigator")}M.getNavigator=Vl;function jl(){return vt("location")}M.getLocationOrThrow=jl;function $l(){return Xe("location")}M.getLocation=$l;function zl(){return vt("crypto")}M.getCryptoOrThrow=zl;function ql(){return Xe("crypto")}M.getCrypto=ql;function Zl(){return vt("localStorage")}M.getLocalStorageOrThrow=Zl;function Kl(){return Xe("localStorage")}M.getLocalStorage=Kl});var Ri=Te(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.getWindowMetadata=void 0;var Wi=_r();function Jl(){let e,t;try{e=Wi.getDocumentOrThrow(),t=Wi.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],c=b.getAttribute("rel");if(c&&c.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(y.indexOf("/")===0)v+=y;else{let W=t.pathname.split("/");W.pop(),v+=W.join("/")+"/"+y}p.push(v)}else if(y.indexOf("//")===0){let v=t.protocol+y;p.push(v)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],c=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(c.length&&c){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,d=o();return{description:s,url:l,icons:d,name:a}}Lo.getWindowMetadata=Jl});var Vi={};Sn(Vi,{BotInfo:()=>Ui,BrowserInfo:()=>Oi,NodeInfo:()=>Ni,ReactNativeInfo:()=>Bi,SearchBotDeviceInfo:()=>Di,browserName:()=>oc,detect:()=>tc,detectOS:()=>Gi,getNodeVersion:()=>Hi,parseUserAgent:()=>Lr});function tc(e){return e?Lr(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bi:typeof navigator<"u"?Lr(navigator.userAgent):Hi()}function Fi(e){return e!==""&&ec.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 oc(e){var t=Fi(e);return t?t[0]:null}function Lr(e){var t=Fi(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ui;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Ii&&(n=Yl(n,rc(Ii-n.length))):n=[];var i=n.join("."),a=Gi(e),s=Ql.exec(e);return s&&s[1]?new Di(o,i,a,s[1]):new Oi(o,i,a)}function Gi(e){for(var t=0,o=Mi.length;t<o;t++){var r=Mi[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Hi(){var e=typeof process<"u"&&process.version;return e?new Ni(process.version.slice(1)):null}function rc(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Yl,Oi,Ni,Di,Ui,Bi,Xl,Ql,Ii,ec,Mi,ji=Ln(()=>{Yl=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},Oi=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ni=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Di=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}(),Ui=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Bi=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Xl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ql=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Ii=3,ec=[["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",Xl]],Mi=[["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 Pr=Te(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.getClientMeta=x.getLocalStorage=x.getLocalStorageOrThrow=x.getCrypto=x.getCryptoOrThrow=x.getLocation=x.getLocationOrThrow=x.getNavigator=x.getNavigatorOrThrow=x.getDocument=x.getDocumentOrThrow=x.getFromWindowOrThrow=x.getFromWindow=x.isBrowser=x.isNode=x.isMobile=x.isIOS=x.isAndroid=x.detectOS=x.detectEnv=void 0;var $i=_o(),nc=$i.__importStar(Ri()),ye=$i.__importStar(_r()),ic=(ji(),An(Vi));function Sr(e){return(0,ic.detect)(e)}x.detectEnv=Sr;function So(){let e=Sr();return e&&e.os?e.os:void 0}x.detectOS=So;function zi(){let e=So();return e?e.toLowerCase().includes("android"):!1}x.isAndroid=zi;function qi(){let e=So();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}x.isIOS=qi;function ac(){return So()?zi()||qi():!1}x.isMobile=ac;function Zi(){let e=Sr();return e&&e.name?e.name.toLowerCase()==="node":!1}x.isNode=Zi;function sc(){return!Zi()&&!!(0,x.getNavigator)()}x.isBrowser=sc;x.getFromWindow=ye.getFromWindow;x.getFromWindowOrThrow=ye.getFromWindowOrThrow;x.getDocumentOrThrow=ye.getDocumentOrThrow;x.getDocument=ye.getDocument;x.getNavigatorOrThrow=ye.getNavigatorOrThrow;x.getNavigator=ye.getNavigator;x.getLocationOrThrow=ye.getLocationOrThrow;x.getLocation=ye.getLocation;x.getCryptoOrThrow=ye.getCryptoOrThrow;x.getCrypto=ye.getCrypto;x.getLocalStorageOrThrow=ye.getLocalStorageOrThrow;x.getLocalStorage=ye.getLocalStorage;function lc(){return nc.getWindowMetadata()}x.getClientMeta=lc});var Ki={};Sn(Ki,{safeJsonParse:()=>cc,safeJsonStringify:()=>dc});function cc(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 dc(e){return typeof e=="string"?e:JSON.stringify(e)}var Ji=Ln(()=>{});var Ar=Te(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.safeJsonStringify=wt.safeJsonParse=void 0;var pc=_o(),Yi=pc.__importStar((Ji(),An(Ki)));wt.safeJsonParse=Yi.safeJsonParse;wt.safeJsonStringify=Yi.safeJsonStringify});var Tr=Te(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.removeLocal=Ue.getLocal=Ue.setLocal=void 0;var Xi=Ar(),kr=Pr();function uc(e,t){let o=(0,Xi.safeJsonStringify)(t),r=(0,kr.getLocalStorage)();r&&r.setItem(e,o)}Ue.setLocal=uc;function fc(e){let t=null,o=null,r=(0,kr.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Xi.safeJsonParse)(o),t}Ue.getLocal=fc;function mc(e){let t=(0,kr.getLocalStorage)();t&&t.removeItem(e)}Ue.removeLocal=mc});var ea=Te(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.getMobileLinkRegistry=se.getMobileRegistryEntry=se.saveMobileLinkInfo=se.formatIOSMobile=se.mobileLinkChoiceKey=void 0;var hc=Tr();se.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function gc(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}se.formatIOSMobile=gc;function bc(e){let t=e.href.split("?")[0];(0,hc.setLocal)(se.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}se.saveMobileLinkInfo=bc;function Qi(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}se.getMobileRegistryEntry=Qi;function yc(e,t){let o=e;return t&&(o=t.map(r=>Qi(e,r)).filter(Boolean)),o}se.getMobileLinkRegistry=yc});var ra=Te(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.formatMobileRegistry=Le.formatMobileRegistryEntry=Le.getDappRegistryUrl=Le.getWalletRegistryUrl=void 0;var ta="https://registry.walletconnect.com";function vc(){return ta+"/api/v2/wallets"}Le.getWalletRegistryUrl=vc;function wc(){return ta+"/api/v2/dapps"}Le.getDappRegistryUrl=wc;function oa(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||""}}Le.formatMobileRegistryEntry=oa;function Cc(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>oa(o,t))}Le.formatMobileRegistry=Cc});var na=Te(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var $t=_o();$t.__exportStar(Pr(),Qe);$t.__exportStar(Ar(),Qe);$t.__exportStar(Tr(),Qe);$t.__exportStar(ea(),Qe);$t.__exportStar(ra(),Qe)});import{Web3Provider as Zp}from"@ethersproject/providers";import{useEffect as xn,useState as Q}from"react";var E=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import hl from"axios";var we=class extends Error{constructor(o,r){super(o);r instanceof Error&&(this.cause=r)}toString(){return`${this.type}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},dt=class extends we{constructor(o,r,n,i){super(n,i);this.type=o;this.status=r}},w=class extends we{constructor(o,r){super(o,r);this.type="client_error"}};var q=class extends we{constructor(o,r){super(o,r);this.type="connector_error"}},Z=e=>{if(e instanceof we)return e;if(!hl.isAxiosError(e))return he(e);if(!e.response)return new dt("api_error",null,e.message,e);let{type:t,message:o,error:r}=e.response.data;return new dt(t||"ApiError",e.response.status,o||r,e)},he=e=>e instanceof we?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var kn=()=>"/api/v1/sessions",Tn=()=>"/api/v1/sessions/logout",Wn=()=>"/api/v1/sessions/fork",Rn=()=>"/api/v1/sessions/fork/recover",In=()=>"/api/v1/siwe/init",Mn=()=>"/api/v1/siwe/authenticate",On=()=>"/api/v1/siwe/link",Nn=()=>"/api/v1/passwordless/init",Dn=()=>"/api/v1/passwordless/authenticate",Un=()=>"/api/v1/passwordless/link",Bn=()=>"/api/v1/passwordless_sms/init",Fn=()=>"/api/v1/passwordless_sms/authenticate",Gn=()=>"/api/v1/passwordless_sms/link",Hn=()=>"/api/v1/oauth/init",Vn=()=>"/api/v1/oauth/authenticate",jn=()=>"/api/v1/oauth/link",$n=()=>"/api/v1/siwe/unlink",zn=()=>"/api/v1/passwordless/unlink",qn=()=>"/api/v1/passwordless_sms/unlink",Zn=()=>"/api/v1/oauth/unlink";var Ht=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=Dn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=Un();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Z(t)}}async sendCodeEmail(t){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{let o=Nn();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Z(o)}}};var pt=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 w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");try{let t=Vn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");try{let t=jn();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Z(t)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initialzing OAuth authentication.");try{let t=Hn();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw Z(t)}}};var ut=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 w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Mn(),{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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(On(),{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 Z(t)}}async promptConnect(){if(!this.api)throw new w("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 w("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 w("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 w("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(In(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Vt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=Fn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=Gn();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Z(t)}}async sendSmsCode(t){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{let o=Bn();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Z(o)}}};import{getAddress as xc}from"@ethersproject/address";var Kn="1.19.0-beta.8";var Jn="https://api.privy.io/v0",fr=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",fo="4df5e2316331463a9130964bd6078dfa",Yn=1e4,ge=1400,mr=Kn;var ft="privy:token",mo="privy:refresh_token",jt="privy:session_transfer_token",ho="privy:connectors",hr="walletconnect",Xn=3e4;var gr=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)}},br=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 bl(){return typeof window<"u"&&window.localStorage?new br:new gr}var U=bl();import Sl from"@coinbase/wallet-sdk";import{getAddress as Pl}from"@ethersproject/address";import{jsx as Qn,jsxs as yl}from"react/jsx-runtime";var be=({style:e,...t})=>yl("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:[Qn("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Qn("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 _l}from"@ethersproject/address";import{Web3Provider as Ll}from"@ethersproject/providers";import{ErrorCode as vl}from"@ethersproject/logger";var mt=class extends q{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ze=class extends q{constructor(){super("User rejected connection");this.type="wallet_error"}},xe=e=>{if(e instanceof q)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new ht(e);return e.code===vl.ACTION_REJECTED&&(t.details=qe.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new ht(e):new q("Unknown connector error",e)},yr=class extends we{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},ht=class extends yr{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(qe).find(l=>l.eipCode===r.code);this.details=n||qe.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=qe.E32002_CONNECTION_ALREADY_PENDING:this.details=qe.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=qe.E32002_WALLET_LOCKED))}},wl={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}},Cl={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}},El={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}},qe={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...El,...Cl},Ke={...wl,...qe};var xl=12e4,vr=(e=new mt,t=xl)=>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 q(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),vr()]).catch(o=>{throw xe(o)})}},Je=class extends _e{constructor(o){super(o)}},go=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 We=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 cl=Object.create;var uo=Object.defineProperty;var dl=Object.getOwnPropertyDescriptor;var pl=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,fl=Object.prototype.hasOwnProperty;var Ln=(e,t)=>()=>(e&&(t=e(e=0)),t);var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sn=(e,t)=>{for(var o in t)uo(e,o,{get:t[o],enumerable:!0})},Pn=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pl(t))!fl.call(e,n)&&n!==o&&uo(e,n,{get:()=>t[n],enumerable:!(r=dl(t,n))||r.enumerable});return e};var ml=(e,t,o)=>(o=e!=null?cl(ul(e)):{},Pn(t||!e||!e.__esModule?uo(o,"default",{value:e,enumerable:!0}):o,e)),An=e=>Pn(uo({},"__esModule",{value:!0}),e);var _o=Te((g2,xo)=>{var di,pi,ui,fi,mi,hi,gi,bi,yi,Co,xr,vi,wi,Ci,yt,Ei,xi,_i,Li,Si,Pi,Ai,ki,Ti,Eo;(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 xo=="object"&&typeof xo.exports=="object"?e(o(t,o(xo.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])};di=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)},pi=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},ui=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},fi=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(d=r[h])&&(l=(s<3?d(l):s>3?d(n,i,l):d(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},mi=function(r,n){return function(i,a){n(i,a,r)}},hi=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},gi=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function h(g){try{p(a.next(g))}catch(b){d(b)}}function m(g){try{p(a.throw(g))}catch(b){d(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},bi=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,d;return d={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function h(p){return function(g){return m([p,g])}}function m(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(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},yi=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Eo(n,r,i)},Eo=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]},Co=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.")},xr=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],d;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){d={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(d)throw d.error}}return l},vi=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(xr(arguments[n]));return r},wi=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],d=0,h=l.length;d<h;d++,s++)a[s]=l[d];return a},Ci=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))},yt=function(r){return this instanceof yt?(this.v=r,this):new yt(r)},Ei=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={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(c){a[c]&&(s[c]=function(y){return new Promise(function(v,W){l.push([c,y,v,W])>1||h(c,y)})})}function h(c,y){try{m(a[c](y))}catch(v){b(l[0][3],v)}}function m(c){c.value instanceof yt?Promise.resolve(c.value.v).then(p,g):b(l[0][2],c)}function p(c){h("next",c)}function g(c){h("throw",c)}function b(c,y){c(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},xi=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(d){return(i=!i)?{value:yt(r[s](d)),done:s==="return"}:l?l(d):d}:l}},_i=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 Co=="function"?Co(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(d){return new Promise(function(h,m){d=r[l](d),s(h,m,d.done,d.value)})}}function s(l,d,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},d)}},Li=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};Si=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)&&Eo(n,r,i);return o(n,r),n},Pi=function(r){return r&&r.__esModule?r:{default:r}},Ai=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)},ki=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},Ti=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",di),e("__assign",pi),e("__rest",ui),e("__decorate",fi),e("__param",mi),e("__metadata",hi),e("__awaiter",gi),e("__generator",bi),e("__exportStar",yi),e("__createBinding",Eo),e("__values",Co),e("__read",xr),e("__spread",vi),e("__spreadArrays",wi),e("__spreadArray",Ci),e("__await",yt),e("__asyncGenerator",Ei),e("__asyncDelegator",xi),e("__asyncValues",_i),e("__makeTemplateObject",Li),e("__importStar",Si),e("__importDefault",Pi),e("__classPrivateFieldGet",Ai),e("__classPrivateFieldSet",ki),e("__classPrivateFieldIn",Ti)})});var _r=Te(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.getLocalStorage=M.getLocalStorageOrThrow=M.getCrypto=M.getCryptoOrThrow=M.getLocation=M.getLocationOrThrow=M.getNavigator=M.getNavigatorOrThrow=M.getDocument=M.getDocumentOrThrow=M.getFromWindowOrThrow=M.getFromWindow=void 0;function Xe(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}M.getFromWindow=Xe;function vt(e){let t=Xe(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}M.getFromWindowOrThrow=vt;function Fl(){return vt("document")}M.getDocumentOrThrow=Fl;function Gl(){return Xe("document")}M.getDocument=Gl;function Hl(){return vt("navigator")}M.getNavigatorOrThrow=Hl;function Vl(){return Xe("navigator")}M.getNavigator=Vl;function jl(){return vt("location")}M.getLocationOrThrow=jl;function $l(){return Xe("location")}M.getLocation=$l;function zl(){return vt("crypto")}M.getCryptoOrThrow=zl;function ql(){return Xe("crypto")}M.getCrypto=ql;function Zl(){return vt("localStorage")}M.getLocalStorageOrThrow=Zl;function Kl(){return Xe("localStorage")}M.getLocalStorage=Kl});var Ri=Te(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.getWindowMetadata=void 0;var Wi=_r();function Jl(){let e,t;try{e=Wi.getDocumentOrThrow(),t=Wi.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],c=b.getAttribute("rel");if(c&&c.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(y.indexOf("/")===0)v+=y;else{let W=t.pathname.split("/");W.pop(),v+=W.join("/")+"/"+y}p.push(v)}else if(y.indexOf("//")===0){let v=t.protocol+y;p.push(v)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],c=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(c.length&&c){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,d=o();return{description:s,url:l,icons:d,name:a}}Lo.getWindowMetadata=Jl});var Vi={};Sn(Vi,{BotInfo:()=>Ui,BrowserInfo:()=>Oi,NodeInfo:()=>Ni,ReactNativeInfo:()=>Bi,SearchBotDeviceInfo:()=>Di,browserName:()=>oc,detect:()=>tc,detectOS:()=>Gi,getNodeVersion:()=>Hi,parseUserAgent:()=>Lr});function tc(e){return e?Lr(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bi:typeof navigator<"u"?Lr(navigator.userAgent):Hi()}function Fi(e){return e!==""&&ec.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 oc(e){var t=Fi(e);return t?t[0]:null}function Lr(e){var t=Fi(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ui;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Ii&&(n=Yl(n,rc(Ii-n.length))):n=[];var i=n.join("."),a=Gi(e),s=Ql.exec(e);return s&&s[1]?new Di(o,i,a,s[1]):new Oi(o,i,a)}function Gi(e){for(var t=0,o=Mi.length;t<o;t++){var r=Mi[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Hi(){var e=typeof process<"u"&&process.version;return e?new Ni(process.version.slice(1)):null}function rc(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Yl,Oi,Ni,Di,Ui,Bi,Xl,Ql,Ii,ec,Mi,ji=Ln(()=>{Yl=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},Oi=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ni=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Di=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}(),Ui=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Bi=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Xl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ql=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Ii=3,ec=[["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",Xl]],Mi=[["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 Pr=Te(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.getClientMeta=x.getLocalStorage=x.getLocalStorageOrThrow=x.getCrypto=x.getCryptoOrThrow=x.getLocation=x.getLocationOrThrow=x.getNavigator=x.getNavigatorOrThrow=x.getDocument=x.getDocumentOrThrow=x.getFromWindowOrThrow=x.getFromWindow=x.isBrowser=x.isNode=x.isMobile=x.isIOS=x.isAndroid=x.detectOS=x.detectEnv=void 0;var $i=_o(),nc=$i.__importStar(Ri()),ye=$i.__importStar(_r()),ic=(ji(),An(Vi));function Sr(e){return(0,ic.detect)(e)}x.detectEnv=Sr;function So(){let e=Sr();return e&&e.os?e.os:void 0}x.detectOS=So;function zi(){let e=So();return e?e.toLowerCase().includes("android"):!1}x.isAndroid=zi;function qi(){let e=So();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}x.isIOS=qi;function ac(){return So()?zi()||qi():!1}x.isMobile=ac;function Zi(){let e=Sr();return e&&e.name?e.name.toLowerCase()==="node":!1}x.isNode=Zi;function sc(){return!Zi()&&!!(0,x.getNavigator)()}x.isBrowser=sc;x.getFromWindow=ye.getFromWindow;x.getFromWindowOrThrow=ye.getFromWindowOrThrow;x.getDocumentOrThrow=ye.getDocumentOrThrow;x.getDocument=ye.getDocument;x.getNavigatorOrThrow=ye.getNavigatorOrThrow;x.getNavigator=ye.getNavigator;x.getLocationOrThrow=ye.getLocationOrThrow;x.getLocation=ye.getLocation;x.getCryptoOrThrow=ye.getCryptoOrThrow;x.getCrypto=ye.getCrypto;x.getLocalStorageOrThrow=ye.getLocalStorageOrThrow;x.getLocalStorage=ye.getLocalStorage;function lc(){return nc.getWindowMetadata()}x.getClientMeta=lc});var Ki={};Sn(Ki,{safeJsonParse:()=>cc,safeJsonStringify:()=>dc});function cc(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 dc(e){return typeof e=="string"?e:JSON.stringify(e)}var Ji=Ln(()=>{});var Ar=Te(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.safeJsonStringify=wt.safeJsonParse=void 0;var pc=_o(),Yi=pc.__importStar((Ji(),An(Ki)));wt.safeJsonParse=Yi.safeJsonParse;wt.safeJsonStringify=Yi.safeJsonStringify});var Tr=Te(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.removeLocal=Ue.getLocal=Ue.setLocal=void 0;var Xi=Ar(),kr=Pr();function uc(e,t){let o=(0,Xi.safeJsonStringify)(t),r=(0,kr.getLocalStorage)();r&&r.setItem(e,o)}Ue.setLocal=uc;function fc(e){let t=null,o=null,r=(0,kr.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Xi.safeJsonParse)(o),t}Ue.getLocal=fc;function mc(e){let t=(0,kr.getLocalStorage)();t&&t.removeItem(e)}Ue.removeLocal=mc});var ea=Te(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.getMobileLinkRegistry=se.getMobileRegistryEntry=se.saveMobileLinkInfo=se.formatIOSMobile=se.mobileLinkChoiceKey=void 0;var hc=Tr();se.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function gc(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}se.formatIOSMobile=gc;function bc(e){let t=e.href.split("?")[0];(0,hc.setLocal)(se.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}se.saveMobileLinkInfo=bc;function Qi(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}se.getMobileRegistryEntry=Qi;function yc(e,t){let o=e;return t&&(o=t.map(r=>Qi(e,r)).filter(Boolean)),o}se.getMobileLinkRegistry=yc});var ra=Te(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.formatMobileRegistry=Le.formatMobileRegistryEntry=Le.getDappRegistryUrl=Le.getWalletRegistryUrl=void 0;var ta="https://registry.walletconnect.com";function vc(){return ta+"/api/v2/wallets"}Le.getWalletRegistryUrl=vc;function wc(){return ta+"/api/v2/dapps"}Le.getDappRegistryUrl=wc;function oa(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||""}}Le.formatMobileRegistryEntry=oa;function Cc(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>oa(o,t))}Le.formatMobileRegistry=Cc});var na=Te(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var $t=_o();$t.__exportStar(Pr(),Qe);$t.__exportStar(Ar(),Qe);$t.__exportStar(Tr(),Qe);$t.__exportStar(ea(),Qe);$t.__exportStar(ra(),Qe)});import{Web3Provider as Zp}from"@ethersproject/providers";import{useEffect as xn,useState as Q}from"react";var E=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import hl from"axios";var we=class extends Error{constructor(o,r){super(o);r instanceof Error&&(this.cause=r)}toString(){return`${this.type}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},dt=class extends we{constructor(o,r,n,i){super(n,i);this.type=o;this.status=r}},w=class extends we{constructor(o,r){super(o,r);this.type="client_error"}};var q=class extends we{constructor(o,r){super(o,r);this.type="connector_error"}},Z=e=>{if(e instanceof we)return e;if(!hl.isAxiosError(e))return he(e);if(!e.response)return new dt("api_error",null,e.message,e);let{type:t,message:o,error:r}=e.response.data;return new dt(t||"ApiError",e.response.status,o||r,e)},he=e=>e instanceof we?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var kn=()=>"/api/v1/sessions",Tn=()=>"/api/v1/sessions/logout",Wn=()=>"/api/v1/sessions/fork",Rn=()=>"/api/v1/sessions/fork/recover",In=()=>"/api/v1/siwe/init",Mn=()=>"/api/v1/siwe/authenticate",On=()=>"/api/v1/siwe/link",Nn=()=>"/api/v1/passwordless/init",Dn=()=>"/api/v1/passwordless/authenticate",Un=()=>"/api/v1/passwordless/link",Bn=()=>"/api/v1/passwordless_sms/init",Fn=()=>"/api/v1/passwordless_sms/authenticate",Gn=()=>"/api/v1/passwordless_sms/link",Hn=()=>"/api/v1/oauth/init",Vn=()=>"/api/v1/oauth/authenticate",jn=()=>"/api/v1/oauth/link",$n=()=>"/api/v1/siwe/unlink",zn=()=>"/api/v1/passwordless/unlink",qn=()=>"/api/v1/passwordless_sms/unlink",Zn=()=>"/api/v1/oauth/unlink";var Ht=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=Dn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=Un();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Z(t)}}async sendCodeEmail(t){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{let o=Nn();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Z(o)}}};var pt=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 w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");try{let t=Vn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");try{let t=jn();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Z(t)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initialzing OAuth authentication.");try{let t=Hn();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw Z(t)}}};var ut=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 w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Mn(),{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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(On(),{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 Z(t)}}async promptConnect(){if(!this.api)throw new w("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 w("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 w("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 w("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(In(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Vt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=Fn(),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 Z(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=Gn();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Z(t)}}async sendSmsCode(t){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{let o=Bn();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Z(o)}}};import{getAddress as xc}from"@ethersproject/address";var Kn="1.19.0";var Jn="https://api.privy.io/v0",fr=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",fo="4df5e2316331463a9130964bd6078dfa",Yn=1e4,ge=1400,mr=Kn;var ft="privy:token",mo="privy:refresh_token",jt="privy:session_transfer_token",ho="privy:connectors",hr="walletconnect",Xn=3e4;var gr=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)}},br=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 bl(){return typeof window<"u"&&window.localStorage?new br:new gr}var U=bl();import Sl from"@coinbase/wallet-sdk";import{getAddress as Pl}from"@ethersproject/address";import{jsx as Qn,jsxs as yl}from"react/jsx-runtime";var be=({style:e,...t})=>yl("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:[Qn("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Qn("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 _l}from"@ethersproject/address";import{Web3Provider as Ll}from"@ethersproject/providers";import{ErrorCode as vl}from"@ethersproject/logger";var mt=class extends q{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ze=class extends q{constructor(){super("User rejected connection");this.type="wallet_error"}},xe=e=>{if(e instanceof q)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new ht(e);return e.code===vl.ACTION_REJECTED&&(t.details=qe.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new ht(e):new q("Unknown connector error",e)},yr=class extends we{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},ht=class extends yr{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(qe).find(l=>l.eipCode===r.code);this.details=n||qe.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=qe.E32002_CONNECTION_ALREADY_PENDING:this.details=qe.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=qe.E32002_WALLET_LOCKED))}},wl={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}},Cl={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}},El={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}},qe={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...El,...Cl},Ke={...wl,...qe};var xl=12e4,vr=(e=new mt,t=xl)=>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 q(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),vr()]).catch(o=>{throw xe(o)})}},Je=class extends _e{constructor(o){super(o)}},go=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 We=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}
@@ -132,7 +132,7 @@ Resources:
132
132
  border-radius: var(--privy-border-radius-sm);
133
133
  min-width: 144px;
134
134
  opacity: ${e=>e.invisible?"0":"1"};
135
- transition: opacity 200ms ease, background-color 200ms ease;
135
+ transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
136
136
  user-select: none;
137
137
 
138
138
  ${e=>e.invisible&&fa`
@@ -450,7 +450,7 @@ Resources:
450
450
  word-break: break-all;
451
451
  `;import{useEffect as nd,useState as id}from"react";import ad from"styled-components";import{isMobile as rd}from"react-device-detect";var Na=e=>{let t=new URL(window.location.href);if(!Ct()&&rd)return`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(`${t.href.replace(/\/$/g,"")}?privy_wallet_client=coinbase_wallet${e?`&privy_token=${e}`:""}`)}`};import{Fragment as ld,jsx as rt,jsxs as Da}from"react/jsx-runtime";var Ua=()=>{let{forkSession:e,ready:t,authenticated:o}=B(),{closePrivyModal:r}=T(),[n,i]=id("");nd(()=>{t&&o&&e().then(l=>i(l))},[o,t]);let a=Na(n),s={title:"Redirecting to Coinbase Wallet",description:"We'll take you to the Coinbase Wallet app to continue your login experience.",footnote:""};return t&&o&&(s.description="For the best experience, we'll automatically log you into the Coinbase Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),Da(ld,{children:[rt(S,{},"header"),rt(Uo,{title:s.title,description:s.description}),Da(Pe,{children:[rt(sd,{children:rt(be,{style:{width:"72px",height:"72px"}})}),rt(ma,{href:a,onClick:()=>{r()},loading:t&&o&&!n,children:"Continue"}),s.footnote?rt("p",{children:s.footnote}):null]}),rt(F,{protectedByPrivy:!0})]})},sd=ad(Oo)`
452
452
  margin: 16px auto;
453
- `;import{useEffect as qr,useState as Xt}from"react";import{isMobile as Ba}from"react-device-detect";import Zr from"styled-components";import{Fragment as Ga,jsx as re,jsxs as Go}from"react/jsx-runtime";var Fo=2,Ho={metamask:{name:"MetaMask",component:Ce},coinbase_wallet:{name:"Coinbase Wallet",component:be},wallet_connect:{name:"WalletConnect",component:bt}},cd=e=>(e==null?void 0:e.status)===422?Ke.ERROR_USER_EXISTS:e instanceof ht&&!e.details.default?e.details:e instanceof mt?Ke.ERROR_TIMED_OUT:e instanceof Ze?Ke.ERROR_USER_REJECTED_CONNECTION:Ke.ERROR_WALLET_CONNECTION,Fa=()=>{var V,fe,ie;let[e,t]=Xt(!1),[o,r]=Xt(!1),[n,i]=Xt(void 0),{navigate:a,navigateBack:s}=C(),{getAuthFlow:l,walletConnectionStatus:d,closePrivyModal:h,loginWithWallet:m}=T(),{walletConnectors:p}=B(),[g,b]=Xt(0),{user:c}=B(),[y]=Xt((c==null?void 0:c.linkedAccounts.length)||0),v=l(),W=Ba&&(v==null?void 0:v.meta.walletType)==="wallet_connect"||Ba&&(v==null?void 0:v.meta.walletType)==="coinbase_wallet",P=d==null?void 0:d.connected;qr(()=>{!v||W||!P||(r(!0),i(void 0),I().catch(G=>console.warn("Auto-prompted signature failed",G)).finally(()=>r(!1)))},[g,P]),qr(()=>{if(c&&e){let G=setTimeout(h,ge);return()=>clearTimeout(G)}},[c,e]);let R=G=>{if((G==null?void 0:G.status)===401&&(G==null?void 0:G.message)==="User is not allowed to login to this app."){a("ALLOWLIST_REJECTION_SCREEN");return}i(cd(G))};async function I(){try{await m(),t(!0)}catch(G){R(G)}finally{r(!1)}}qr(()=>{d!=null&&d.connectError&&R(d==null?void 0:d.connectError)},[d]);let $=(v==null?void 0:v.meta.walletType)||"metamask",pe=((V=v==null?void 0:v.meta)==null?void 0:V.walletName)||Ho[$].name,ne=((fe=v==null?void 0:v.meta)==null?void 0:fe.walletIcon)||Ho[$].component,ue=e?`Successfully connected with ${pe}`:n?n.message:P?"Sign to verify":`Waiting for ${pe}`,H="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let G=(c==null?void 0:c.linkedAccounts.length)||0;y===G?H="Wallet was already linked.":H="You\u2019re good to go!"}else g>=Fo&&n?H="Unable to connect wallet":n?H=n.detail:P&&W?H="Sign the message in your wallet to verify it belongs to you.":$==="metamask"?H="For the best experience, connect only one wallet at a time.":$==="wallet_connect"?H="Open your mobile wallet app to continue":$==="coinbase_wallet"&&(Ct()||(Nr(c)?H="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":H="Open the Coinbase app on your phone to continue."));let D=(ie=p==null?void 0:p.walletConnectors)==null?void 0:ie.find(G=>G.walletType==="coinbase_wallet"),N=$==="coinbase_wallet"&&(Nr(c)||n===Ke.ERROR_USER_EXISTS);return Go(Ga,{children:[re(S,{backFn:s}),Go(dd,{children:[re(Kr,{walletLogo:ne,success:e,fail:!!n}),Go(pd,{children:[re("h3",{children:ue}),re("p",{children:H})]}),re(ga,{children:N?re(le,{onClick:()=>D&&(D==null?void 0:D.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ke.ERROR_USER_EXISTS?re(le,{onClick:s,children:"Use a different wallet"}):P&&!e&&W?re(le,{onClick:()=>{r(!0),I()},disabled:o,children:"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&g<Fo?re(le,{onClick:()=>{b(g+1),i(void 0),d==null||d.connectRetry()},invisible:e||!(n!=null&&n.retryable)||g>=Fo,disabled:!e&&(!(n!=null&&n.retryable)||g>=Fo),children:"Retry"}):null})]})]})},dd=Zr.div`
453
+ `;import{useEffect as qr,useState as Xt}from"react";import{isMobile as Ba}from"react-device-detect";import Zr from"styled-components";import{Fragment as Ga,jsx as re,jsxs as Go}from"react/jsx-runtime";var Fo=2,Ho={metamask:{name:"MetaMask",component:Ce},coinbase_wallet:{name:"Coinbase Wallet",component:be},wallet_connect:{name:"WalletConnect",component:bt}},cd=e=>(e==null?void 0:e.status)===422?Ke.ERROR_USER_EXISTS:e instanceof ht&&!e.details.default?e.details:e instanceof mt?Ke.ERROR_TIMED_OUT:e instanceof Ze?Ke.ERROR_USER_REJECTED_CONNECTION:Ke.ERROR_WALLET_CONNECTION,Fa=()=>{var V,fe,ie;let[e,t]=Xt(!1),[o,r]=Xt(!1),[n,i]=Xt(void 0),{navigate:a,navigateBack:s}=C(),{getAuthFlow:l,walletConnectionStatus:d,closePrivyModal:h,loginWithWallet:m}=T(),{walletConnectors:p}=B(),[g,b]=Xt(0),{user:c}=B(),[y]=Xt((c==null?void 0:c.linkedAccounts.length)||0),v=l(),W=Ba&&(v==null?void 0:v.meta.walletType)==="wallet_connect"||Ba&&(v==null?void 0:v.meta.walletType)==="coinbase_wallet",P=d==null?void 0:d.connected;qr(()=>{!v||W||!P||(r(!0),i(void 0),I().catch(G=>console.warn("Auto-prompted signature failed",G)).finally(()=>r(!1)))},[g,P]),qr(()=>{if(c&&e){let G=setTimeout(h,ge);return()=>clearTimeout(G)}},[c,e]);let R=G=>{if((G==null?void 0:G.status)===401&&(G==null?void 0:G.message)==="User is not allowed to login to this app."){a("ALLOWLIST_REJECTION_SCREEN");return}i(cd(G))};async function I(){try{await m(),t(!0)}catch(G){R(G)}finally{r(!1)}}qr(()=>{d!=null&&d.connectError&&R(d==null?void 0:d.connectError)},[d]);let $=(v==null?void 0:v.meta.walletType)||"metamask",pe=((V=v==null?void 0:v.meta)==null?void 0:V.walletName)||Ho[$].name,ne=((fe=v==null?void 0:v.meta)==null?void 0:fe.walletIcon)||Ho[$].component,ue=e?`Successfully connected with ${pe}`:n?n.message:P?"Sign to verify":`Waiting for ${pe}`,H="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let G=(c==null?void 0:c.linkedAccounts.length)||0;y===G?H="Wallet was already linked.":H="You\u2019re good to go!"}else g>=Fo&&n?H="Unable to connect wallet":n?H=n.detail:P&&W?H="Sign the message in your wallet to verify it belongs to you.":$==="metamask"?H="For the best experience, connect only one wallet at a time.":$==="wallet_connect"?H="Open your mobile wallet app to continue":$==="coinbase_wallet"&&(Ct()||(Nr(c)?H="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":H="Open the Coinbase app on your phone to continue."));let D=(ie=p==null?void 0:p.walletConnectors)==null?void 0:ie.find(G=>G.walletType==="coinbase_wallet"),N=$==="coinbase_wallet"&&(Nr(c)||n===Ke.ERROR_USER_EXISTS);return Go(Ga,{children:[re(S,{backFn:s}),Go(dd,{children:[re(Kr,{walletLogo:ne,success:e,fail:!!n}),Go(pd,{children:[re("h3",{children:ue}),re("p",{children:H})]}),re(ga,{children:N?re(le,{onClick:()=>D&&(D==null?void 0:D.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ke.ERROR_USER_EXISTS?re(le,{onClick:s,children:"Use a different wallet"}):P&&!e&&W?re(le,{onClick:()=>{r(!0),I()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&g<Fo?re(le,{onClick:()=>{b(g+1),i(void 0),d==null||d.connectRetry()},invisible:e||!(n!=null&&n.retryable)||g>=Fo,disabled:!e&&(!(n!=null&&n.retryable)||g>=Fo),children:"Retry"}):null})]})]})},dd=Zr.div`
454
454
  display: flex;
455
455
  flex-direction: column;
456
456
  align-items: center;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ul=Object.create;var Ao=Object.defineProperty;var fl=Object.getOwnPropertyDescriptor;var ml=Object.getOwnPropertyNames;var hl=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty;var Bn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ir=(e,t)=>{for(var o in t)Ao(e,o,{get:t[o],enumerable:!0})},Fn=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ml(t))!gl.call(e,n)&&n!==o&&Ao(e,n,{get:()=>t[n],enumerable:!(r=fl(t,n))||r.enumerable});return e};var L=(e,t,o)=>(o=e!=null?ul(hl(e)):{},Fn(t||!e||!e.__esModule?Ao(o,"default",{value:e,enumerable:!0}):o,e)),Mr=e=>Fn(Ao({},"__esModule",{value:!0}),e);var Ho=Qe((yp,Go)=>{var ki,Ti,Wi,Ri,Ii,Mi,Oi,Ni,Di,Bo,jr,Ui,Bi,Fi,Ft,Gi,Hi,Vi,ji,$i,zi,qi,Zi,Ki,Fo;(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 Go=="object"&&typeof Go.exports=="object"?e(o(t,o(Go.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])};ki=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)},Ti=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},Wi=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},Ri=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(d=r[h])&&(l=(s<3?d(l):s>3?d(n,i,l):d(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Ii=function(r,n){return function(i,a){n(i,a,r)}},Mi=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Oi=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function h(g){try{p(a.next(g))}catch(b){d(b)}}function m(g){try{p(a.throw(g))}catch(b){d(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},Ni=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,d;return d={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function h(p){return function(g){return m([p,g])}}function m(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(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Di=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Fo(n,r,i)},Fo=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]},Bo=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.")},jr=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],d;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){d={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(d)throw d.error}}return l},Ui=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(jr(arguments[n]));return r},Bi=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],d=0,h=l.length;d<h;d++,s++)a[s]=l[d];return a},Fi=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))},Ft=function(r){return this instanceof Ft?(this.v=r,this):new Ft(r)},Gi=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={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(c){a[c]&&(s[c]=function(v){return new Promise(function(C,I){l.push([c,v,C,I])>1||h(c,v)})})}function h(c,v){try{m(a[c](v))}catch(C){b(l[0][3],C)}}function m(c){c.value instanceof Ft?Promise.resolve(c.value.v).then(p,g):b(l[0][2],c)}function p(c){h("next",c)}function g(c){h("throw",c)}function b(c,v){c(v),l.shift(),l.length&&h(l[0][0],l[0][1])}},Hi=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(d){return(i=!i)?{value:Ft(r[s](d)),done:s==="return"}:l?l(d):d}:l}},Vi=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 Bo=="function"?Bo(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(d){return new Promise(function(h,m){d=r[l](d),s(h,m,d.done,d.value)})}}function s(l,d,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},d)}},ji=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};$i=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)&&Fo(n,r,i);return o(n,r),n},zi=function(r){return r&&r.__esModule?r:{default:r}},qi=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)},Zi=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},Ki=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",ki),e("__assign",Ti),e("__rest",Wi),e("__decorate",Ri),e("__param",Ii),e("__metadata",Mi),e("__awaiter",Oi),e("__generator",Ni),e("__exportStar",Di),e("__createBinding",Fo),e("__values",Bo),e("__read",jr),e("__spread",Ui),e("__spreadArrays",Bi),e("__spreadArray",Fi),e("__await",Ft),e("__asyncGenerator",Gi),e("__asyncDelegator",Hi),e("__asyncValues",Vi),e("__makeTemplateObject",ji),e("__importStar",$i),e("__importDefault",zi),e("__classPrivateFieldGet",qi),e("__classPrivateFieldSet",Zi),e("__classPrivateFieldIn",Ki)})});var $r=Qe(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.getLocalStorage=D.getLocalStorageOrThrow=D.getCrypto=D.getCryptoOrThrow=D.getLocation=D.getLocationOrThrow=D.getNavigator=D.getNavigatorOrThrow=D.getDocument=D.getDocumentOrThrow=D.getFromWindowOrThrow=D.getFromWindow=void 0;function xt(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}D.getFromWindow=xt;function Gt(e){let t=xt(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}D.getFromWindowOrThrow=Gt;function Ll(){return Gt("document")}D.getDocumentOrThrow=Ll;function Sl(){return xt("document")}D.getDocument=Sl;function Pl(){return Gt("navigator")}D.getNavigatorOrThrow=Pl;function Al(){return xt("navigator")}D.getNavigator=Al;function kl(){return Gt("location")}D.getLocationOrThrow=kl;function Tl(){return xt("location")}D.getLocation=Tl;function Wl(){return Gt("crypto")}D.getCryptoOrThrow=Wl;function Rl(){return xt("crypto")}D.getCrypto=Rl;function Il(){return Gt("localStorage")}D.getLocalStorageOrThrow=Il;function Ml(){return xt("localStorage")}D.getLocalStorage=Ml});var Yi=Qe(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.getWindowMetadata=void 0;var Ji=$r();function Ol(){let e,t;try{e=Ji.getDocumentOrThrow(),t=Ji.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],c=b.getAttribute("rel");if(c&&c.toLowerCase().indexOf("icon")>-1){let v=b.getAttribute("href");if(v)if(v.toLowerCase().indexOf("https:")===-1&&v.toLowerCase().indexOf("http:")===-1&&v.indexOf("//")!==0){let C=t.protocol+"//"+t.host;if(v.indexOf("/")===0)C+=v;else{let I=t.pathname.split("/");I.pop(),C+=I.join("/")+"/"+v}p.push(C)}else if(v.indexOf("//")===0){let C=t.protocol+v;p.push(C)}else p.push(v)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],c=["itemprop","property","name"].map(v=>b.getAttribute(v)).filter(v=>v?m.includes(v):!1);if(c.length&&c){let v=b.getAttribute("content");if(v)return v}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,d=o();return{description:s,url:l,icons:d,name:a}}Vo.getWindowMetadata=Ol});var la={};Ir(la,{BotInfo:()=>ra,BrowserInfo:()=>ea,NodeInfo:()=>ta,ReactNativeInfo:()=>na,SearchBotDeviceInfo:()=>oa,browserName:()=>Gl,detect:()=>Fl,detectOS:()=>aa,getNodeVersion:()=>sa,parseUserAgent:()=>zr});function Fl(e){return e?zr(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new na:typeof navigator<"u"?zr(navigator.userAgent):sa()}function ia(e){return e!==""&&Bl.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 Gl(e){var t=ia(e);return t?t[0]:null}function zr(e){var t=ia(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new ra;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Xi&&(n=Nl(n,Hl(Xi-n.length))):n=[];var i=n.join("."),a=aa(e),s=Ul.exec(e);return s&&s[1]?new oa(o,i,a,s[1]):new ea(o,i,a)}function aa(e){for(var t=0,o=Qi.length;t<o;t++){var r=Qi[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function sa(){var e=typeof process<"u"&&process.version;return e?new ta(process.version.slice(1)):null}function Hl(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Nl,ea,ta,oa,ra,na,Dl,Ul,Xi,Bl,Qi,ca=Bn(()=>{Nl=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},ea=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ta=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),oa=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}(),ra=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),na=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Dl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ul=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xi=3,Bl=[["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",Dl]],Qi=[["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 Zr=Qe(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 da=Ho(),Vl=da.__importStar(Yi()),Te=da.__importStar($r()),jl=(ca(),Mr(la));function qr(e){return(0,jl.detect)(e)}S.detectEnv=qr;function jo(){let e=qr();return e&&e.os?e.os:void 0}S.detectOS=jo;function pa(){let e=jo();return e?e.toLowerCase().includes("android"):!1}S.isAndroid=pa;function ua(){let e=jo();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}S.isIOS=ua;function $l(){return jo()?pa()||ua():!1}S.isMobile=$l;function fa(){let e=qr();return e&&e.name?e.name.toLowerCase()==="node":!1}S.isNode=fa;function zl(){return!fa()&&!!(0,S.getNavigator)()}S.isBrowser=zl;S.getFromWindow=Te.getFromWindow;S.getFromWindowOrThrow=Te.getFromWindowOrThrow;S.getDocumentOrThrow=Te.getDocumentOrThrow;S.getDocument=Te.getDocument;S.getNavigatorOrThrow=Te.getNavigatorOrThrow;S.getNavigator=Te.getNavigator;S.getLocationOrThrow=Te.getLocationOrThrow;S.getLocation=Te.getLocation;S.getCryptoOrThrow=Te.getCryptoOrThrow;S.getCrypto=Te.getCrypto;S.getLocalStorageOrThrow=Te.getLocalStorageOrThrow;S.getLocalStorage=Te.getLocalStorage;function ql(){return Vl.getWindowMetadata()}S.getClientMeta=ql});var ma={};Ir(ma,{safeJsonParse:()=>Zl,safeJsonStringify:()=>Kl});function Zl(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 Kl(e){return typeof e=="string"?e:JSON.stringify(e)}var ha=Bn(()=>{});var Kr=Qe(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.safeJsonStringify=Ht.safeJsonParse=void 0;var Jl=Ho(),ga=Jl.__importStar((ha(),Mr(ma)));Ht.safeJsonParse=ga.safeJsonParse;Ht.safeJsonStringify=ga.safeJsonStringify});var Yr=Qe(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.removeLocal=at.getLocal=at.setLocal=void 0;var ba=Kr(),Jr=Zr();function Yl(e,t){let o=(0,ba.safeJsonStringify)(t),r=(0,Jr.getLocalStorage)();r&&r.setItem(e,o)}at.setLocal=Yl;function Xl(e){let t=null,o=null,r=(0,Jr.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,ba.safeJsonParse)(o),t}at.getLocal=Xl;function Ql(e){let t=(0,Jr.getLocalStorage)();t&&t.removeItem(e)}at.removeLocal=Ql});var va=Qe(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.getMobileLinkRegistry=he.getMobileRegistryEntry=he.saveMobileLinkInfo=he.formatIOSMobile=he.mobileLinkChoiceKey=void 0;var ec=Yr();he.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function tc(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}he.formatIOSMobile=tc;function oc(e){let t=e.href.split("?")[0];(0,ec.setLocal)(he.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}he.saveMobileLinkInfo=oc;function ya(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}he.getMobileRegistryEntry=ya;function rc(e,t){let o=e;return t&&(o=t.map(r=>ya(e,r)).filter(Boolean)),o}he.getMobileLinkRegistry=rc});var Ea=Qe(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.formatMobileRegistry=qe.formatMobileRegistryEntry=qe.getDappRegistryUrl=qe.getWalletRegistryUrl=void 0;var wa="https://registry.walletconnect.com";function nc(){return wa+"/api/v2/wallets"}qe.getWalletRegistryUrl=nc;function ic(){return wa+"/api/v2/dapps"}qe.getDappRegistryUrl=ic;function Ca(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||""}}qe.formatMobileRegistryEntry=Ca;function ac(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ca(o,t))}qe.formatMobileRegistry=ac});var xa=Qe(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var mo=Ho();mo.__exportStar(Zr(),_t);mo.__exportStar(Kr(),_t);mo.__exportStar(Yr(),_t);mo.__exportStar(va(),_t);mo.__exportStar(Ea(),_t)});var y1={};Ir(y1,{AsExternalProvider:()=>it,ConnectorManager:()=>Vt,PrivyClient:()=>$t,PrivyProvider:()=>sl,PrivyProxyProvider:()=>Ne,VERSION:()=>To,WalletConnector:()=>ze,getAccessToken:()=>al,usePrivy:()=>H});module.exports=Mr(y1);var il=require("@ethersproject/providers"),Y=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Gn=L(require("axios")),Oe=class extends Error{constructor(o,r){super(o);r instanceof Error&&(this.cause=r)}toString(){return`${this.type}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},It=class extends Oe{constructor(o,r,n,i){super(n,i);this.type=o;this.status=r}},E=class extends Oe{constructor(o,r){super(o,r);this.type="client_error"}};var ee=class extends Oe{constructor(o,r){super(o,r);this.type="connector_error"}},te=e=>{if(e instanceof Oe)return e;if(!Gn.default.isAxiosError(e))return Pe(e);if(!e.response)return new It("api_error",null,e.message,e);let{type:t,message:o,error:r}=e.response.data;return new It(t||"ApiError",e.response.status,o||r,e)},Pe=e=>e instanceof Oe?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var Hn=()=>"/api/v1/sessions",Vn=()=>"/api/v1/sessions/logout",jn=()=>"/api/v1/sessions/fork",$n=()=>"/api/v1/sessions/fork/recover",zn=()=>"/api/v1/siwe/init",qn=()=>"/api/v1/siwe/authenticate",Zn=()=>"/api/v1/siwe/link",Kn=()=>"/api/v1/passwordless/init",Jn=()=>"/api/v1/passwordless/authenticate",Yn=()=>"/api/v1/passwordless/link",Xn=()=>"/api/v1/passwordless_sms/init",Qn=()=>"/api/v1/passwordless_sms/authenticate",ei=()=>"/api/v1/passwordless_sms/link",ti=()=>"/api/v1/oauth/init",oi=()=>"/api/v1/oauth/authenticate",ri=()=>"/api/v1/oauth/link",ni=()=>"/api/v1/siwe/unlink",ii=()=>"/api/v1/passwordless/unlink",ai=()=>"/api/v1/passwordless_sms/unlink",si=()=>"/api/v1/oauth/unlink";var co=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=Jn(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=Yn();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw te(t)}}async sendCodeEmail(t){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new E("Email must be set when initialzing authentication.");try{let o=Kn();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw te(o)}}};var Mt=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 E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");try{let t=oi(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");try{let t=ri();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw te(t)}}async getAuthorizationUrl(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.provider)throw new E("Provider must be set when initialzing OAuth authentication.");try{let t=ti();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw te(t)}}};var Ot=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 E("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(qn(),{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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Zn(),{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 te(t)}}async promptConnect(){if(!this.api)throw new E("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 E("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 E("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 E("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(zn(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var po=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=Qn(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=ei();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw te(t)}}async sendSmsCode(t){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new E("phone nNumber must be set when initialzing authentication.");try{let o=Xn();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw te(o)}}};var Ta=require("@ethersproject/address");var li="1.19.0-beta.8";var ci="https://api.privy.io/v0",Or=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",ko="4df5e2316331463a9130964bd6078dfa",di=1e4,Ae=1400,To=li;var Nt="privy:token",Wo="privy:refresh_token",uo="privy:session_transfer_token",Ro="privy:connectors",Nr="walletconnect",pi=3e4;var Dr=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)}},Ur=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 yl(){return typeof window<"u"&&window.localStorage?new Ur:new Dr}var j=yl();var hi=L(require("@coinbase/wallet-sdk")),gi=require("@ethersproject/address");var fo=require("react/jsx-runtime"),ke=({style:e,...t})=>(0,fo.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,fo.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,fo.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 fi=require("@ethersproject/address"),mi=require("@ethersproject/providers");var ui=require("@ethersproject/logger");var Dt=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},wt=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},$e=e=>{if(e instanceof ee)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ut(e);return e.code===ui.ErrorCode.ACTION_REJECTED&&(t.details=vt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ut(e):new ee("Unknown connector error",e)},Br=class extends Oe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ut=class extends Br{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(vt).find(l=>l.eipCode===r.code);this.details=n||vt.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=vt.E32002_CONNECTION_ALREADY_PENDING:this.details=vt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=vt.E32002_WALLET_LOCKED))}},vl={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}},wl={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}},Cl={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}},vt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Cl,...wl},Ct={...vl,...vt};var El=12e4,Fr=(e=new Dt,t=El)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ne=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 ee(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Fr()]).catch(o=>{throw $e(o)})}},it=class extends Ne{constructor(o){super(o)}},Io=class extends Ne{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var ze=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 ul=Object.create;var Ao=Object.defineProperty;var fl=Object.getOwnPropertyDescriptor;var ml=Object.getOwnPropertyNames;var hl=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty;var Bn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ir=(e,t)=>{for(var o in t)Ao(e,o,{get:t[o],enumerable:!0})},Fn=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ml(t))!gl.call(e,n)&&n!==o&&Ao(e,n,{get:()=>t[n],enumerable:!(r=fl(t,n))||r.enumerable});return e};var L=(e,t,o)=>(o=e!=null?ul(hl(e)):{},Fn(t||!e||!e.__esModule?Ao(o,"default",{value:e,enumerable:!0}):o,e)),Mr=e=>Fn(Ao({},"__esModule",{value:!0}),e);var Ho=Qe((yp,Go)=>{var ki,Ti,Wi,Ri,Ii,Mi,Oi,Ni,Di,Bo,jr,Ui,Bi,Fi,Ft,Gi,Hi,Vi,ji,$i,zi,qi,Zi,Ki,Fo;(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 Go=="object"&&typeof Go.exports=="object"?e(o(t,o(Go.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])};ki=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)},Ti=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},Wi=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},Ri=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(d=r[h])&&(l=(s<3?d(l):s>3?d(n,i,l):d(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Ii=function(r,n){return function(i,a){n(i,a,r)}},Mi=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Oi=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function h(g){try{p(a.next(g))}catch(b){d(b)}}function m(g){try{p(a.throw(g))}catch(b){d(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},Ni=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,d;return d={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function h(p){return function(g){return m([p,g])}}function m(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(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Di=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Fo(n,r,i)},Fo=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]},Bo=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.")},jr=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],d;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){d={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(d)throw d.error}}return l},Ui=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(jr(arguments[n]));return r},Bi=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],d=0,h=l.length;d<h;d++,s++)a[s]=l[d];return a},Fi=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))},Ft=function(r){return this instanceof Ft?(this.v=r,this):new Ft(r)},Gi=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={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(c){a[c]&&(s[c]=function(v){return new Promise(function(C,I){l.push([c,v,C,I])>1||h(c,v)})})}function h(c,v){try{m(a[c](v))}catch(C){b(l[0][3],C)}}function m(c){c.value instanceof Ft?Promise.resolve(c.value.v).then(p,g):b(l[0][2],c)}function p(c){h("next",c)}function g(c){h("throw",c)}function b(c,v){c(v),l.shift(),l.length&&h(l[0][0],l[0][1])}},Hi=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(d){return(i=!i)?{value:Ft(r[s](d)),done:s==="return"}:l?l(d):d}:l}},Vi=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 Bo=="function"?Bo(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(d){return new Promise(function(h,m){d=r[l](d),s(h,m,d.done,d.value)})}}function s(l,d,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},d)}},ji=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};$i=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)&&Fo(n,r,i);return o(n,r),n},zi=function(r){return r&&r.__esModule?r:{default:r}},qi=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)},Zi=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},Ki=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",ki),e("__assign",Ti),e("__rest",Wi),e("__decorate",Ri),e("__param",Ii),e("__metadata",Mi),e("__awaiter",Oi),e("__generator",Ni),e("__exportStar",Di),e("__createBinding",Fo),e("__values",Bo),e("__read",jr),e("__spread",Ui),e("__spreadArrays",Bi),e("__spreadArray",Fi),e("__await",Ft),e("__asyncGenerator",Gi),e("__asyncDelegator",Hi),e("__asyncValues",Vi),e("__makeTemplateObject",ji),e("__importStar",$i),e("__importDefault",zi),e("__classPrivateFieldGet",qi),e("__classPrivateFieldSet",Zi),e("__classPrivateFieldIn",Ki)})});var $r=Qe(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.getLocalStorage=D.getLocalStorageOrThrow=D.getCrypto=D.getCryptoOrThrow=D.getLocation=D.getLocationOrThrow=D.getNavigator=D.getNavigatorOrThrow=D.getDocument=D.getDocumentOrThrow=D.getFromWindowOrThrow=D.getFromWindow=void 0;function xt(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}D.getFromWindow=xt;function Gt(e){let t=xt(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}D.getFromWindowOrThrow=Gt;function Ll(){return Gt("document")}D.getDocumentOrThrow=Ll;function Sl(){return xt("document")}D.getDocument=Sl;function Pl(){return Gt("navigator")}D.getNavigatorOrThrow=Pl;function Al(){return xt("navigator")}D.getNavigator=Al;function kl(){return Gt("location")}D.getLocationOrThrow=kl;function Tl(){return xt("location")}D.getLocation=Tl;function Wl(){return Gt("crypto")}D.getCryptoOrThrow=Wl;function Rl(){return xt("crypto")}D.getCrypto=Rl;function Il(){return Gt("localStorage")}D.getLocalStorageOrThrow=Il;function Ml(){return xt("localStorage")}D.getLocalStorage=Ml});var Yi=Qe(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.getWindowMetadata=void 0;var Ji=$r();function Ol(){let e,t;try{e=Ji.getDocumentOrThrow(),t=Ji.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],c=b.getAttribute("rel");if(c&&c.toLowerCase().indexOf("icon")>-1){let v=b.getAttribute("href");if(v)if(v.toLowerCase().indexOf("https:")===-1&&v.toLowerCase().indexOf("http:")===-1&&v.indexOf("//")!==0){let C=t.protocol+"//"+t.host;if(v.indexOf("/")===0)C+=v;else{let I=t.pathname.split("/");I.pop(),C+=I.join("/")+"/"+v}p.push(C)}else if(v.indexOf("//")===0){let C=t.protocol+v;p.push(C)}else p.push(v)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],c=["itemprop","property","name"].map(v=>b.getAttribute(v)).filter(v=>v?m.includes(v):!1);if(c.length&&c){let v=b.getAttribute("content");if(v)return v}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,d=o();return{description:s,url:l,icons:d,name:a}}Vo.getWindowMetadata=Ol});var la={};Ir(la,{BotInfo:()=>ra,BrowserInfo:()=>ea,NodeInfo:()=>ta,ReactNativeInfo:()=>na,SearchBotDeviceInfo:()=>oa,browserName:()=>Gl,detect:()=>Fl,detectOS:()=>aa,getNodeVersion:()=>sa,parseUserAgent:()=>zr});function Fl(e){return e?zr(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new na:typeof navigator<"u"?zr(navigator.userAgent):sa()}function ia(e){return e!==""&&Bl.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 Gl(e){var t=ia(e);return t?t[0]:null}function zr(e){var t=ia(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new ra;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Xi&&(n=Nl(n,Hl(Xi-n.length))):n=[];var i=n.join("."),a=aa(e),s=Ul.exec(e);return s&&s[1]?new oa(o,i,a,s[1]):new ea(o,i,a)}function aa(e){for(var t=0,o=Qi.length;t<o;t++){var r=Qi[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function sa(){var e=typeof process<"u"&&process.version;return e?new ta(process.version.slice(1)):null}function Hl(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Nl,ea,ta,oa,ra,na,Dl,Ul,Xi,Bl,Qi,ca=Bn(()=>{Nl=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},ea=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ta=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),oa=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}(),ra=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),na=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Dl=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ul=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xi=3,Bl=[["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",Dl]],Qi=[["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 Zr=Qe(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 da=Ho(),Vl=da.__importStar(Yi()),Te=da.__importStar($r()),jl=(ca(),Mr(la));function qr(e){return(0,jl.detect)(e)}S.detectEnv=qr;function jo(){let e=qr();return e&&e.os?e.os:void 0}S.detectOS=jo;function pa(){let e=jo();return e?e.toLowerCase().includes("android"):!1}S.isAndroid=pa;function ua(){let e=jo();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}S.isIOS=ua;function $l(){return jo()?pa()||ua():!1}S.isMobile=$l;function fa(){let e=qr();return e&&e.name?e.name.toLowerCase()==="node":!1}S.isNode=fa;function zl(){return!fa()&&!!(0,S.getNavigator)()}S.isBrowser=zl;S.getFromWindow=Te.getFromWindow;S.getFromWindowOrThrow=Te.getFromWindowOrThrow;S.getDocumentOrThrow=Te.getDocumentOrThrow;S.getDocument=Te.getDocument;S.getNavigatorOrThrow=Te.getNavigatorOrThrow;S.getNavigator=Te.getNavigator;S.getLocationOrThrow=Te.getLocationOrThrow;S.getLocation=Te.getLocation;S.getCryptoOrThrow=Te.getCryptoOrThrow;S.getCrypto=Te.getCrypto;S.getLocalStorageOrThrow=Te.getLocalStorageOrThrow;S.getLocalStorage=Te.getLocalStorage;function ql(){return Vl.getWindowMetadata()}S.getClientMeta=ql});var ma={};Ir(ma,{safeJsonParse:()=>Zl,safeJsonStringify:()=>Kl});function Zl(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 Kl(e){return typeof e=="string"?e:JSON.stringify(e)}var ha=Bn(()=>{});var Kr=Qe(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.safeJsonStringify=Ht.safeJsonParse=void 0;var Jl=Ho(),ga=Jl.__importStar((ha(),Mr(ma)));Ht.safeJsonParse=ga.safeJsonParse;Ht.safeJsonStringify=ga.safeJsonStringify});var Yr=Qe(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.removeLocal=at.getLocal=at.setLocal=void 0;var ba=Kr(),Jr=Zr();function Yl(e,t){let o=(0,ba.safeJsonStringify)(t),r=(0,Jr.getLocalStorage)();r&&r.setItem(e,o)}at.setLocal=Yl;function Xl(e){let t=null,o=null,r=(0,Jr.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,ba.safeJsonParse)(o),t}at.getLocal=Xl;function Ql(e){let t=(0,Jr.getLocalStorage)();t&&t.removeItem(e)}at.removeLocal=Ql});var va=Qe(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.getMobileLinkRegistry=he.getMobileRegistryEntry=he.saveMobileLinkInfo=he.formatIOSMobile=he.mobileLinkChoiceKey=void 0;var ec=Yr();he.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function tc(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}he.formatIOSMobile=tc;function oc(e){let t=e.href.split("?")[0];(0,ec.setLocal)(he.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}he.saveMobileLinkInfo=oc;function ya(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}he.getMobileRegistryEntry=ya;function rc(e,t){let o=e;return t&&(o=t.map(r=>ya(e,r)).filter(Boolean)),o}he.getMobileLinkRegistry=rc});var Ea=Qe(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.formatMobileRegistry=qe.formatMobileRegistryEntry=qe.getDappRegistryUrl=qe.getWalletRegistryUrl=void 0;var wa="https://registry.walletconnect.com";function nc(){return wa+"/api/v2/wallets"}qe.getWalletRegistryUrl=nc;function ic(){return wa+"/api/v2/dapps"}qe.getDappRegistryUrl=ic;function Ca(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||""}}qe.formatMobileRegistryEntry=Ca;function ac(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ca(o,t))}qe.formatMobileRegistry=ac});var xa=Qe(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var mo=Ho();mo.__exportStar(Zr(),_t);mo.__exportStar(Kr(),_t);mo.__exportStar(Yr(),_t);mo.__exportStar(va(),_t);mo.__exportStar(Ea(),_t)});var y1={};Ir(y1,{AsExternalProvider:()=>it,ConnectorManager:()=>Vt,PrivyClient:()=>$t,PrivyProvider:()=>sl,PrivyProxyProvider:()=>Ne,VERSION:()=>To,WalletConnector:()=>ze,getAccessToken:()=>al,usePrivy:()=>H});module.exports=Mr(y1);var il=require("@ethersproject/providers"),Y=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Gn=L(require("axios")),Oe=class extends Error{constructor(o,r){super(o);r instanceof Error&&(this.cause=r)}toString(){return`${this.type}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},It=class extends Oe{constructor(o,r,n,i){super(n,i);this.type=o;this.status=r}},E=class extends Oe{constructor(o,r){super(o,r);this.type="client_error"}};var ee=class extends Oe{constructor(o,r){super(o,r);this.type="connector_error"}},te=e=>{if(e instanceof Oe)return e;if(!Gn.default.isAxiosError(e))return Pe(e);if(!e.response)return new It("api_error",null,e.message,e);let{type:t,message:o,error:r}=e.response.data;return new It(t||"ApiError",e.response.status,o||r,e)},Pe=e=>e instanceof Oe?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var Hn=()=>"/api/v1/sessions",Vn=()=>"/api/v1/sessions/logout",jn=()=>"/api/v1/sessions/fork",$n=()=>"/api/v1/sessions/fork/recover",zn=()=>"/api/v1/siwe/init",qn=()=>"/api/v1/siwe/authenticate",Zn=()=>"/api/v1/siwe/link",Kn=()=>"/api/v1/passwordless/init",Jn=()=>"/api/v1/passwordless/authenticate",Yn=()=>"/api/v1/passwordless/link",Xn=()=>"/api/v1/passwordless_sms/init",Qn=()=>"/api/v1/passwordless_sms/authenticate",ei=()=>"/api/v1/passwordless_sms/link",ti=()=>"/api/v1/oauth/init",oi=()=>"/api/v1/oauth/authenticate",ri=()=>"/api/v1/oauth/link",ni=()=>"/api/v1/siwe/unlink",ii=()=>"/api/v1/passwordless/unlink",ai=()=>"/api/v1/passwordless_sms/unlink",si=()=>"/api/v1/oauth/unlink";var co=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=Jn(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=Yn();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw te(t)}}async sendCodeEmail(t){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new E("Email must be set when initialzing authentication.");try{let o=Kn();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw te(o)}}};var Mt=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 E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");try{let t=oi(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");try{let t=ri();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw te(t)}}async getAuthorizationUrl(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.provider)throw new E("Provider must be set when initialzing OAuth authentication.");try{let t=ti();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw te(t)}}};var Ot=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 E("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(qn(),{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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Zn(),{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 te(t)}}async promptConnect(){if(!this.api)throw new E("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 E("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 E("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 E("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(zn(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var po=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=Qn(),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 te(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=ei();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw te(t)}}async sendSmsCode(t){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new E("phone nNumber must be set when initialzing authentication.");try{let o=Xn();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw te(o)}}};var Ta=require("@ethersproject/address");var li="1.19.0";var ci="https://api.privy.io/v0",Or=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",ko="4df5e2316331463a9130964bd6078dfa",di=1e4,Ae=1400,To=li;var Nt="privy:token",Wo="privy:refresh_token",uo="privy:session_transfer_token",Ro="privy:connectors",Nr="walletconnect",pi=3e4;var Dr=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)}},Ur=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 yl(){return typeof window<"u"&&window.localStorage?new Ur:new Dr}var j=yl();var hi=L(require("@coinbase/wallet-sdk")),gi=require("@ethersproject/address");var fo=require("react/jsx-runtime"),ke=({style:e,...t})=>(0,fo.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,fo.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,fo.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 fi=require("@ethersproject/address"),mi=require("@ethersproject/providers");var ui=require("@ethersproject/logger");var Dt=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},wt=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},$e=e=>{if(e instanceof ee)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ut(e);return e.code===ui.ErrorCode.ACTION_REJECTED&&(t.details=vt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ut(e):new ee("Unknown connector error",e)},Br=class extends Oe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ut=class extends Br{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(vt).find(l=>l.eipCode===r.code);this.details=n||vt.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=vt.E32002_CONNECTION_ALREADY_PENDING:this.details=vt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=vt.E32002_WALLET_LOCKED))}},vl={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}},wl={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}},Cl={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}},vt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Cl,...wl},Ct={...vl,...vt};var El=12e4,Fr=(e=new Dt,t=El)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ne=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 ee(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Fr()]).catch(o=>{throw $e(o)})}},it=class extends Ne{constructor(o){super(o)}},Io=class extends Ne{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var ze=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}
@@ -132,7 +132,7 @@ Resources:
132
132
  border-radius: var(--privy-border-radius-sm);
133
133
  min-width: 144px;
134
134
  opacity: ${e=>e.invisible?"0":"1"};
135
- transition: opacity 200ms ease, background-color 200ms ease;
135
+ transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
136
136
  user-select: none;
137
137
 
138
138
  ${e=>e.invisible&&dt.css`
@@ -450,7 +450,7 @@ Resources:
450
450
  word-break: break-all;
451
451
  `;var ar=require("react"),Ja=L(require("styled-components"));var Za=require("react-device-detect");var Ka=e=>{let t=new URL(window.location.href);if(!jt()&&Za.isMobile)return`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(`${t.href.replace(/\/$/g,"")}?privy_wallet_client=coinbase_wallet${e?`&privy_token=${e}`:""}`)}`};var be=require("react/jsx-runtime"),Ya=()=>{let{forkSession:e,ready:t,authenticated:o}=H(),{closePrivyModal:r}=W(),[n,i]=(0,ar.useState)("");(0,ar.useEffect)(()=>{t&&o&&e().then(l=>i(l))},[o,t]);let a=Ka(n),s={title:"Redirecting to Coinbase Wallet",description:"We'll take you to the Coinbase Wallet app to continue your login experience.",footnote:""};return t&&o&&(s.description="For the best experience, we'll automatically log you into the Coinbase Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(A,{},"header"),(0,be.jsx)(ir,{title:s.title,description:s.description}),(0,be.jsxs)(Ke,{children:[(0,be.jsx)(Ac,{children:(0,be.jsx)(ke,{style:{width:"72px",height:"72px"}})}),(0,be.jsx)(Ia,{href:a,onClick:()=>{r()},loading:t&&o&&!n,children:"Continue"}),s.footnote?(0,be.jsx)("p",{children:s.footnote}):null]}),(0,be.jsx)($,{protectedByPrivy:!0})]})},Ac=(0,Ja.default)(rr)`
452
452
  margin: 16px auto;
453
- `;var Je=require("react"),hn=require("react-device-detect"),cr=L(require("styled-components"));var V=require("react/jsx-runtime"),sr=2,lr={metamask:{name:"MetaMask",component:De},coinbase_wallet:{name:"Coinbase Wallet",component:ke},wallet_connect:{name:"WalletConnect",component:Bt}},kc=e=>(e==null?void 0:e.status)===422?Ct.ERROR_USER_EXISTS:e instanceof Ut&&!e.details.default?e.details:e instanceof Dt?Ct.ERROR_TIMED_OUT:e instanceof wt?Ct.ERROR_USER_REJECTED_CONNECTION:Ct.ERROR_WALLET_CONNECTION,Xa=()=>{var Z,Le,me;let[e,t]=(0,Je.useState)(!1),[o,r]=(0,Je.useState)(!1),[n,i]=(0,Je.useState)(void 0),{navigate:a,navigateBack:s}=x(),{getAuthFlow:l,walletConnectionStatus:d,closePrivyModal:h,loginWithWallet:m}=W(),{walletConnectors:p}=H(),[g,b]=(0,Je.useState)(0),{user:c}=H(),[v]=(0,Je.useState)((c==null?void 0:c.linkedAccounts.length)||0),C=l(),I=hn.isMobile&&(C==null?void 0:C.meta.walletType)==="wallet_connect"||hn.isMobile&&(C==null?void 0:C.meta.walletType)==="coinbase_wallet",k=d==null?void 0:d.connected;(0,Je.useEffect)(()=>{!C||I||!k||(r(!0),i(void 0),N().catch(z=>console.warn("Auto-prompted signature failed",z)).finally(()=>r(!1)))},[g,k]),(0,Je.useEffect)(()=>{if(c&&e){let z=setTimeout(h,Ae);return()=>clearTimeout(z)}},[c,e]);let O=z=>{if((z==null?void 0:z.status)===401&&(z==null?void 0:z.message)==="User is not allowed to login to this app."){a("ALLOWLIST_REJECTION_SCREEN");return}i(kc(z))};async function N(){try{await m(),t(!0)}catch(z){O(z)}finally{r(!1)}}(0,Je.useEffect)(()=>{d!=null&&d.connectError&&O(d==null?void 0:d.connectError)},[d]);let X=(C==null?void 0:C.meta.walletType)||"metamask",xe=((Z=C==null?void 0:C.meta)==null?void 0:Z.walletName)||lr[X].name,fe=((Le=C==null?void 0:C.meta)==null?void 0:Le.walletIcon)||lr[X].component,_e=e?`Successfully connected with ${xe}`:n?n.message:k?"Sign to verify":`Waiting for ${xe}`,q="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let z=(c==null?void 0:c.linkedAccounts.length)||0;v===z?q="Wallet was already linked.":q="You\u2019re good to go!"}else g>=sr&&n?q="Unable to connect wallet":n?q=n.detail:k&&I?q="Sign the message in your wallet to verify it belongs to you.":X==="metamask"?q="For the best experience, connect only one wallet at a time.":X==="wallet_connect"?q="Open your mobile wallet app to continue":X==="coinbase_wallet"&&(jt()||(rn(c)?q="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":q="Open the Coinbase app on your phone to continue."));let G=(me=p==null?void 0:p.walletConnectors)==null?void 0:me.find(z=>z.walletType==="coinbase_wallet"),F=X==="coinbase_wallet"&&(rn(c)||n===Ct.ERROR_USER_EXISTS);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(A,{backFn:s}),(0,V.jsxs)(Tc,{children:[(0,V.jsx)(gn,{walletLogo:fe,success:e,fail:!!n}),(0,V.jsxs)(Wc,{children:[(0,V.jsx)("h3",{children:_e}),(0,V.jsx)("p",{children:q})]}),(0,V.jsx)(Oa,{children:F?(0,V.jsx)(ge,{onClick:()=>G&&(G==null?void 0:G.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ct.ERROR_USER_EXISTS?(0,V.jsx)(ge,{onClick:s,children:"Use a different wallet"}):k&&!e&&I?(0,V.jsx)(ge,{onClick:()=>{r(!0),N()},disabled:o,children:"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&g<sr?(0,V.jsx)(ge,{onClick:()=>{b(g+1),i(void 0),d==null||d.connectRetry()},invisible:e||!(n!=null&&n.retryable)||g>=sr,disabled:!e&&(!(n!=null&&n.retryable)||g>=sr),children:"Retry"}):null})]})]})},Tc=cr.default.div`
453
+ `;var Je=require("react"),hn=require("react-device-detect"),cr=L(require("styled-components"));var V=require("react/jsx-runtime"),sr=2,lr={metamask:{name:"MetaMask",component:De},coinbase_wallet:{name:"Coinbase Wallet",component:ke},wallet_connect:{name:"WalletConnect",component:Bt}},kc=e=>(e==null?void 0:e.status)===422?Ct.ERROR_USER_EXISTS:e instanceof Ut&&!e.details.default?e.details:e instanceof Dt?Ct.ERROR_TIMED_OUT:e instanceof wt?Ct.ERROR_USER_REJECTED_CONNECTION:Ct.ERROR_WALLET_CONNECTION,Xa=()=>{var Z,Le,me;let[e,t]=(0,Je.useState)(!1),[o,r]=(0,Je.useState)(!1),[n,i]=(0,Je.useState)(void 0),{navigate:a,navigateBack:s}=x(),{getAuthFlow:l,walletConnectionStatus:d,closePrivyModal:h,loginWithWallet:m}=W(),{walletConnectors:p}=H(),[g,b]=(0,Je.useState)(0),{user:c}=H(),[v]=(0,Je.useState)((c==null?void 0:c.linkedAccounts.length)||0),C=l(),I=hn.isMobile&&(C==null?void 0:C.meta.walletType)==="wallet_connect"||hn.isMobile&&(C==null?void 0:C.meta.walletType)==="coinbase_wallet",k=d==null?void 0:d.connected;(0,Je.useEffect)(()=>{!C||I||!k||(r(!0),i(void 0),N().catch(z=>console.warn("Auto-prompted signature failed",z)).finally(()=>r(!1)))},[g,k]),(0,Je.useEffect)(()=>{if(c&&e){let z=setTimeout(h,Ae);return()=>clearTimeout(z)}},[c,e]);let O=z=>{if((z==null?void 0:z.status)===401&&(z==null?void 0:z.message)==="User is not allowed to login to this app."){a("ALLOWLIST_REJECTION_SCREEN");return}i(kc(z))};async function N(){try{await m(),t(!0)}catch(z){O(z)}finally{r(!1)}}(0,Je.useEffect)(()=>{d!=null&&d.connectError&&O(d==null?void 0:d.connectError)},[d]);let X=(C==null?void 0:C.meta.walletType)||"metamask",xe=((Z=C==null?void 0:C.meta)==null?void 0:Z.walletName)||lr[X].name,fe=((Le=C==null?void 0:C.meta)==null?void 0:Le.walletIcon)||lr[X].component,_e=e?`Successfully connected with ${xe}`:n?n.message:k?"Sign to verify":`Waiting for ${xe}`,q="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let z=(c==null?void 0:c.linkedAccounts.length)||0;v===z?q="Wallet was already linked.":q="You\u2019re good to go!"}else g>=sr&&n?q="Unable to connect wallet":n?q=n.detail:k&&I?q="Sign the message in your wallet to verify it belongs to you.":X==="metamask"?q="For the best experience, connect only one wallet at a time.":X==="wallet_connect"?q="Open your mobile wallet app to continue":X==="coinbase_wallet"&&(jt()||(rn(c)?q="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":q="Open the Coinbase app on your phone to continue."));let G=(me=p==null?void 0:p.walletConnectors)==null?void 0:me.find(z=>z.walletType==="coinbase_wallet"),F=X==="coinbase_wallet"&&(rn(c)||n===Ct.ERROR_USER_EXISTS);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(A,{backFn:s}),(0,V.jsxs)(Tc,{children:[(0,V.jsx)(gn,{walletLogo:fe,success:e,fail:!!n}),(0,V.jsxs)(Wc,{children:[(0,V.jsx)("h3",{children:_e}),(0,V.jsx)("p",{children:q})]}),(0,V.jsx)(Oa,{children:F?(0,V.jsx)(ge,{onClick:()=>G&&(G==null?void 0:G.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ct.ERROR_USER_EXISTS?(0,V.jsx)(ge,{onClick:s,children:"Use a different wallet"}):k&&!e&&I?(0,V.jsx)(ge,{onClick:()=>{r(!0),N()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&g<sr?(0,V.jsx)(ge,{onClick:()=>{b(g+1),i(void 0),d==null||d.connectRetry()},invisible:e||!(n!=null&&n.retryable)||g>=sr,disabled:!e&&(!(n!=null&&n.retryable)||g>=sr),children:"Retry"}):null})]})]})},Tc=cr.default.div`
454
454
  display: flex;
455
455
  flex-direction: column;
456
456
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.19.0-beta.8",
3
+ "version": "1.19.0",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",