vendor: 4,086 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3431],{2098:(e,t,n)=>{n.d(t,{$:()=>F});var i=n(7128),l=n(71060),r=n(63620),a=n(94582),o=n(51400),s=n(56849),c=n(90416),u=n(49752),d=n(68846),h=n(97481),p=n(85957),g=n(14299);let m=(0,g.jx)({animation:`${p.I0} 0.15s ease-in`});var x=n(53905),f=n(25519),y=Object.defineProperty,v=Object.defineProperties,j=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&E(e,n,t[n]);if(w)for(var n of w(t))b.call(t,n)&&E(e,n,t[n]);return e},S=(e,t)=>v(e,j(t)),I=(e,t)=>{var n={};for(var i in e)k.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&w)for(var i of w(e))0>t.indexOf(i)&&b.call(e,i)&&(n[i]=e[i]);return n},W=l.createContext({}),A=l.forwardRef((e,t)=>{var n,i,r,a,o,{value:s,onChange:c,maxLength:u,textAlign:d="left",pattern:h,placeholder:p,inputMode:g="numeric",onComplete:m,pushPasswordManagerStrategy:x="increase-width",pasteTransformer:f,containerClassName:y,noScriptCSSFallback:v=T,render:j,children:w}=e,k=I(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[b,E]=l.useState("string"==typeof k.defaultValue?k.defaultValue:""),A=null!=s?s:b,M=function(e){let t=l.useRef();return l.useEffect(()=>{t.current=e}),t.current}(A),R=l.useCallback(e=>{null==c||c(e),E(e)},[c]),L=l.useMemo(()=>h?"string"==typeof h?new RegExp(h):h:null,[h]),O=l.useRef(null),_=l.useRef(null),B=l.useRef({value:A,onChange:R,isIOS:"undefined"!=typeof window&&(null==(i=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:i.call(n,"-webkit-touch-callout","none"))}),z=l.useRef({prev:[null==(r=O.current)?void 0:r.selectionStart,null==(a=O.current)?void 0:a.selectionEnd,null==(o=O.current)?void 0:o.selectionDirection]});l.useImperativeHandle(t,()=>O.current,[]),l.useEffect(()=>{let e=O.current,t=_.current;if(!e||!t)return;function n(){if(document.activeElement!==e){G(null),Q(null);return}let t=e.selectionStart,n=e.selectionEnd,i=e.selectionDirection,l=e.maxLength,r=e.value,a=z.current.prev,o=-1,s=-1,c;if(0!==r.length&&null!==t&&null!==n){let e=t===n,i=t===r.length&&r.length<l;if(e&&!i){if(0===t)o=0,s=1,c="forward";else if(t===l)o=t-1,s=t,c="backward";else if(l>1&&r.length>1){let e=0;if(null!==a[0]&&null!==a[1]){c=t<a[1]?"backward":"forward";let n=a[0]===a[1]&&a[0]<l;"backward"!==c||n||(e=-1)}o=e+t,s=e+t+1}}-1!==o&&-1!==s&&o!==s&&O.current.setSelectionRange(o,s,c)}let u=-1!==o?o:t,d=-1!==s?s:n,h=null!=c?c:i;G(u),Q(d),z.current.prev=[u,d,h]}if(B.current.value!==e.value&&B.current.onChange(e.value),z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{capture:!0}),n(),document.activeElement===e&&F(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";P(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),P(e.sheet,`[data-input-otp]:autofill { ${t} }`),P(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),P(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),P(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let i=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};i();let l=new ResizeObserver(i);return l.observe(e),()=>
1{document.removeEventListener("selectionchange",n,{capture:!0}),l.disconnect()}},[]);let[D,H]=l.useState(!1),[$,F]=l.useState(!1),[N,G]=l.useState(null),[U,Q]=l.useState(null);l.useEffect(()=>{!function(e){setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)}(()=>{var e,t,n,i;null==(e=O.current)||e.dispatchEvent(new Event("input"));let l=null==(t=O.current)?void 0:t.selectionStart,r=null==(n=O.current)?void 0:n.selectionEnd,a=null==(i=O.current)?void 0:i.selectionDirection;null!==l&&null!==r&&(G(l),Q(r),z.current.prev=[l,r,a])})},[A,$]),l.useEffect(()=>{void 0!==M&&A!==M&&M.length<u&&A.length===u&&(null==m||m(A))},[u,m,M,A]);let Y=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:i}){let[r,a]=l.useState(!1),[o,s]=l.useState(!1),[c,u]=l.useState(!1),d=l.useMemo(()=>"none"!==n&&("increase-width"===n||"experimental-no-flickering"===n)&&r&&o,[r,o,n]),h=l.useCallback(()=>{let i=e.current,l=t.current;if(!i||!l||c||"none"===n)return;let r=i.getBoundingClientRect().left+i.offsetWidth,o=i.getBoundingClientRect().top+i.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(r-18,o)===i||(a(!0),u(!0))},[e,t,c,n]);return l.useEffect(()=>{let t=e.current;if(!t||"none"===n)return;function i(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}i();let l=setInterval(i,1e3);return()=>{clearInterval(l)}},[e,n]),l.useEffect(()=>{let e=i||document.activeElement===t.current;if("none"===n||!e)return;let l=setTimeout(h,0),r=setTimeout(h,2e3),a=setTimeout(h,5e3),o=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(l),clearTimeout(r),clearTimeout(a),clearTimeout(o)}},[t,i,n,h]),{hasPWMBadge:r,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:_,inputRef:O,pushPasswordManagerStrategy:x,isFocused:$}),V=l.useCallback(e=>{let t=e.currentTarget.value.slice(0,u);if(t.length>0&&L&&!L.test(t))return void e.preventDefault();"string"==typeof M&&t.length<M.length&&document.dispatchEvent(new Event("selectionchange")),R(t)},[u,R,M,L]),K=l.useCallback(()=>{var e;if(O.current){let t=Math.min(O.current.value.length,u-1),n=O.current.value.length;null==(e=O.current)||e.setSelectionRange(t,n),G(t),Q(n)}F(!0)},[u]),q=l.useCallback(e=>{var t,n;let i=O.current;if(!f&&(!B.current.isIOS||!e.clipboardData||!i))return;let l=e.clipboardData.getData("text/plain"),r=f?f(l):l;e.preventDefault();let a=null==(t=O.current)?void 0:t.selectionStart,o=null==(n=O.current)?void 0:n.selectionEnd,s=(a!==o?A.slice(0,a)+r+A.slice(o):A.slice(0,a)+r+A.slice(a)).slice(0,u);if(s.length>0&&L&&!L.test(s))return;i.value=s,R(s);let c=Math.min(s.length,u-1),d=s.length;i.setSelectionRange(c,d),G(c),Q(d)},[u,R,L,A]),Z=l.useMemo(()=>({position:"relative",cursor:k.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[k.disabled]),J=l.useMemo(()=>({position:"absolute",inset:0,width:Y.willPushPWMBadge?`calc(100% + ${Y.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:Y.willPushPWMBadge?`inset(0 ${Y.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:d,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[Y.PWM_BADGE_SPACE_WIDTH,Y.willPushPWMBadge,d]),X=l.useMemo(()=>l.createElement("input",S(C({autoComplete:k.autoComplete||"one-time-code"},k),{"data-input-otp":!0,"data-input-otp-placeholder-shown":0===A.length||void 0,"data-input-otp-mss":N,"data-input-otp-mse":U,inputMode:g,pattern:null==L?void 0:L.source,"aria-placeholder":p,style:J,maxLength:u,value:A,ref:O,onPaste:e=>{var t;q(e),null==(t=k.onPaste)||t.call(k,e)},onChange:V,onMouseOver:e=>{var t;H(!0),null==(t=k.onMouseOver)||t.call(k,e)},onMouseLeave:e=>{var t;H(!1),null==(t=k.onMouseLeave)||t.call(k,e)},onFocus:e=>{var t;K(),null==(t=k.onFocus)||t.call(k,e)},onBlur:e=>{var t;F(!1),null==(t=k.onBlur)||t.call(k,e)}})),[V,K,q,g,J,u,U,N,k,null==L?void 0:L.source,A]),ee=l.useMemo(()=>({slots:Array.from({length:u}).map((e,t)=>{var n;let i=$&&null!==N&&null!==U&&(N===U&&t===N||t>=N&&t<U),l=void 0!==A[t]?A[t]:null;return{char:l,placeholderChar:void 0!==A[0]?null:null!=(n=null==p?void 0:p[t])?n:null,isActive:i,hasFakeCaret:i&&null===l}}),isFocused:$,isHovering:!k.disabled&&D}),[$,D,u,U,N,k.disabled,A]),et=l.useMemo(()=>j?j(ee):l.createElement(W.Provider,{value:ee},w),[w,ee,j]);return l.createElement(l.Fragment,null,null!==v&&l.createElement("noscript",null,l.createElement("style",null,v)),l.createElement("div",{ref:_,"data-input-otp-container":!0,style:Z,className:y},et,l.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},X)))});function P(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}A.displayName="Input";var T=` 2[data-input-otp] { 3 --nojs-bg: white !important; 4 --nojs-fg: black !important; 5 6 background-color: var(--nojs-bg) !important; 7 color: var(--nojs-fg) !important; 8 caret-color: var(--nojs-fg) !important; 9 letter-spacing: .25em !important; 10 text-align: center !important; 11 border: 1px solid var(--nojs-fg) !important; 12 border-radius: 4px !important; 13 width: 100% !important; 14} 15@media (prefers-color-scheme: dark) { 16 [data-input-otp] { 17 --nojs-bg: black !important; 18 --nojs-fg: white !important; 19 } 20}`;function M(){let e=(0,x._)(["\n 0%, 100% {\n opacity: 0;\n },\n 50% {\n opacity: 1;\n }\n "]);return M=function(){return e},e}function R(e){return(0,i.jsx)(L,{children:(0,i.jsx)(A,{maxLength:6,onChange:t=>{e.setValue(t)},onComplete:()=>{e.onEnter()},render:t=>{let{slots:n}=t;return(0,i.jsx)(d.mc,{center:"both",flex:"row",gap:"xs",children:n.map((t,n)=>(0,i.jsx)(O,{...t,isInvalid:e.isInvalid},n))})},value:e.value})})}let L=(0,g.jx)({"& input":{maxWidth:"100%"}});function O(e){return(0,i.jsxs)(z,{"data-active":e.isActive,"data-error":e.isInvalid,children:[null!==e.char&&(0,i.jsx)("div",{children:e.char}),e.hasFakeCaret&&(0,i.jsx)(B,{})]})}let _=(0,f.i7)(M()),B=(0,g.jx)(e=>({"&::before":{backgroundColor:(0,s.QP)().colors.primaryText,content:"''",display:"block",height:"1em",width:"1.5px"},alignItems:"center",animation:"".concat(_," 1s infinite"),display:"flex",inset:0,justifyContent:"center",pointerEvents:"none",position:"absolute"})),z=(0,g.jx)(e=>{let t=(0,s.QP)();return{"&[data-active='true']":{borderColor:t.colors.accentText},"&[data-error='true']":{borderColor:t.colors.danger}
20,alignItems:"center",border:"2px solid ".concat(t.colors.borderColor),borderRadius:c.r8.lg,boxSizing:"border-box",color:t.colors.primaryText,display:"flex",fontSize:c.J.md,height:"40px",justifyContent:"center",padding:c.YK.xs,position:"relative",textAlign:"center",transition:"color 200ms ease",width:"40px"}});var D=n(62564),H=n(16537),$=n(81499);function F(e){var t;let{wallet:n,done:s,goBack:c,userInfo:p}=e,g="wide"===e.size,x=e.locale,[f,y]=(0,l.useState)(""),[v,j]=(0,l.useState)("idle"),[w,k]=(0,l.useState)(),[b,E]=(0,l.useState)("sending"),[C,S]=(0,l.useState)(0),I=(0,a.Y)(n)?{id:n.id,partnerId:null==(t=n.getConfig())?void 0:t.partnerId}:void 0,[W]=(0,l.useState)("base"),A=(0,l.useCallback)(async()=>{y(""),j("idle"),E("sending");try{if("email"in p)await (0,o.je)({client:e.client,ecosystem:I,email:p.email,strategy:"email"}),E("sent"),S(60);else if("phone"in p)await (0,o.je)({client:e.client,ecosystem:I,phoneNumber:p.phone,strategy:"phone"}),E("sent"),S(60);else throw Error("Invalid userInfo")}catch(e){console.error(e),j("idle"),E("error")}},[e.client,p,I]);async function P(t){if("email"in p)await n.connect({chain:e.chain,client:e.client,email:p.email,strategy:"email",verificationCode:t}),await (0,u.OM)("email",r.n);else if("phone"in p)await n.connect({chain:e.chain,client:e.client,phoneNumber:p.phone,strategy:"phone",verificationCode:t}),await (0,u.OM)("phone",r.n);else throw Error("Invalid userInfo")}async function T(t){"email"in p?await (0,o.oO)({client:e.client,ecosystem:I,email:p.email,strategy:"email",verificationCode:t}):"phone"in p&&await (0,o.oO)({client:e.client,ecosystem:I,phoneNumber:p.phone,strategy:"phone",verificationCode:t})}let M=async t=>{if(6===t.length){j("verifying");try{e.isLinking?await T(t):await P(t),s(),j("valid")}catch(e){var n;e instanceof Error&&(null==e||null==(n=e.message)?void 0:n.includes("PAYMENT_METHOD_REQUIRED"))?j("payment_required"):e instanceof Error&&(e.message.toLowerCase().includes("link")||e.message.toLowerCase().includes("profile"))?(j("linking_error"),k(e.message)):j("invalid"),console.error("Authentication Error",e)}}},L=(0,l.useRef)(!1);return((0,l.useEffect)(()=>{L.current||(L.current=!0,A())},[A]),(0,l.useEffect)(()=>{if(C<=0)return;let e=setInterval(()=>{S(t=>t<=1?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}
20,[C]),"base"===W)?(0,i.jsxs)(d.mc,{animate:"fadein",flex:"column",fullHeight:!0,children:[(0,i.jsx)(d.mc,{p:"lg",children:(0,i.jsx)(d.rQ,{onBack:c,title:x.signIn})}),(0,i.jsx)(d.mc,{center:"y",expand:!0,flex:"column",children:(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault()},children:[(0,i.jsxs)(d.mc,{center:"x",flex:"column",px:"lg",children:[!g&&(0,i.jsx)(D.h,{y:"xl"}),(0,i.jsx)($.E,{children:x.emailLoginScreen.enterCodeSendTo}),(0,i.jsx)(D.h,{y:"sm"}),(0,i.jsx)($.E,{color:"primaryText",children:"email"in p?p.email:p.phone}),(0,i.jsx)(D.h,{y:"xl"})]}),(0,i.jsx)(R,{digits:6,isInvalid:"invalid"===v,onEnter:()=>{M(f)},setValue:e=>{y(e),j("idle")},value:f}),"invalid"===v&&(0,i.jsxs)(m,{children:[(0,i.jsx)(D.h,{y:"md"}),(0,i.jsx)($.E,{center:!0,color:"danger",size:"sm",children:x.emailLoginScreen.invalidCode})]}),"linking_error"===v&&(0,i.jsxs)(m,{children:[(0,i.jsx)(D.h,{y:"md"}),(0,i.jsx)($.E,{center:!0,color:"danger",size:"sm",children:w||"Failed to verify code"})]}),"payment_required"===v&&(0,i.jsxs)(m,{children:[(0,i.jsx)(D.h,{y:"md"}),(0,i.jsx)($.E,{center:!0,color:"danger",size:"sm",children:x.maxAccountsExceeded})]}),(0,i.jsx)(D.h,{y:"xl"}),(0,i.jsx)(d.mc,{px:g?"xxl":"lg",children:"verifying"===v?(0,i.jsx)(d.mc,{animate:"fadein",center:"x",flex:"row",children:(0,i.jsx)(H.y,{color:"accentText",size:"lg"})}):(0,i.jsx)(d.mc,{animate:"fadein",children:(0,i.jsx)(h.$n,{onClick:()=>M(f),style:{width:"100%"},type:"submit",variant:"accent",children:x.emailLoginScreen.verify})},"btn-container")}),(0,i.jsx)(D.h,{y:"xl"}),!g&&(0,i.jsx)(d.N1,{}),(0,i.jsxs)(d.mc,{gap:"xs",p:g?void 0:"lg",children:["error"===b&&(0,i.jsx)($.E,{center:!0,color:"danger",size:"sm",children:x.emailLoginScreen.failedToSendCode}),"sending"===b&&(0,i.jsxs)(d.mc,{center:"both",flex:"row",gap:"xs",style:{textAlign:"center"},children:[(0,i.jsx)($.E,{size:"sm",children:x.emailLoginScreen.sendingCode}),(0,i.jsx)(H.y,{color:"secondaryText",size:"xs"})]}),"sending"!==b&&(0,i.jsx)(N,{onClick:0===C?A:void 0,style:{cursor:C>0?"default":"pointer",opacity:C>0?.5:1},type:"button",children:C>0?"Resend code in ".concat(C," seconds"):x.emailLoginScreen.resendCode})]})]})})]}):null}let N=(0,g.OV)(e=>{let t=(0,s.QP)();return{"&:hover":{color:t.colors.primaryText},all:"unset",color:t.colors.accentText,cursor:"pointer",fontSize:c.J.sm,fontWeight:500,textAlign:"center",width:"100%"}})},15910:(e,t,n)=>{n.d(t,{G:()=>s});var i=n(7128),l=n(68846),r=n(62564),a=n(16537),o=n(81499);function s(e){return(0,i.jsxs)(l.mc,{animate:"fadein",children:[(0,i.jsx)(r.h,{y:"xxl"}),(0,i.jsxs)(l.mc,{center:"x",flex:"row",style:{position:"relative"},children:[(0,i.jsx)(a.y,{color:"accentText",size:"4xl"}),(0,i.jsx)(l.mc,{color:"accentText",style:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"},children:e.icon})]}),(0,i.jsx)(r.h,{y:"xl"}),(0,i.jsx)(o.E,{center:!0,color:"primaryText",size:"lg",children:e.title}),(0,i.jsx)(r.h,{y:"md"}
20),(0,i.jsx)(o.E,{center:!0,multiline:!0,children:e.subtitle}),(0,i.jsx)(r.h,{y:"xxl"}),(0,i.jsx)(r.h,{y:"xxl"})]})}},25739:(e,t,n)=>{n.d(t,{t:()=>r});var i=n(48801);let l=new Map;class r{constructor({storage:e,clientId:t,ecosystem:n}){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storage=e,this.key=a(t,n?.id),this.ecosystem=n}async getItem(e){return this.storage?this.storage.getItem(e):l.get(e)??null}async setItem(e,t){if(this.storage)return this.storage.setItem(e,t);l.set(e,t)}async removeItem(e){let t=await this.getItem(e);return!!this.storage&&!!t&&(this.storage.removeItem(e),!0)}async getWalletConnectSessions(){return this.getItem((0,i.BG)(this.key))}async saveWalletConnectSessions(e){await this.setItem((0,i.BG)(this.key),e)}async savePasskeyCredentialId(e){await this.setItem((0,i.RI)(this.key),e)}async getPasskeyCredentialId(){return this.getItem((0,i.RI)(this.key))}async saveAuthCookie(e){await this.setItem((0,i.HM)(this.key),e)}async getAuthCookie(){return this.getItem((0,i.HM)(this.key))}async removeAuthCookie(){return this.removeItem((0,i.HM)(this.key))}async saveDeviceShare(e,t){await this.saveWalletUserId(t),await this.setItem((0,i.Zo)(this.key,t),e)}async getDeviceShare(){let e=await this.getWalletUserId();return e?this.getItem((0,i.Zo)(this.key,e)):null}async removeDeviceShare(){let e=await this.getWalletUserId();return!!e&&this.removeItem((0,i.Zo)(this.key,e))}async getWalletUserId(){return this.getItem((0,i._p)(this.key))}async saveWalletUserId(e){await this.setItem((0,i._p)(this.key),e)}async removeWalletUserId(){return this.removeItem((0,i._p)(this.key))}async getGuestSessionId(){return this.getItem((0,i.a0)(this.key))}async saveGuestSessionId(e){await this.setItem((0,i.a0)(this.key),e)}}let a=(e,t)=>`${e}${t?`-${t}`:""}`}
20,45614:(e,t,n)=>{n.d(t,{_:()=>p});var i=n(7128),l=n(71060),r=n(63620),a=n(94582),o=n(49752),s=n(68846),c=n(97481),u=n(62564),d=n(16537),h=n(81499);function p(e){var t;let n=e.locale,p=n.socialLoginScreen,[g,m]=(0,l.useState)(void 0),{done:x,wallet:f}=e,[y,v]=(0,l.useState)("connecting"),j=async()=>{var t,i;let l={client:e.client,ecosystem:(0,a.Y)(f)?{id:f.id,partnerId:null==(t=f.getConfig())?void 0:t.partnerId}:void 0,strategy:"guest"};try{await f.connect(l),await (0,o.OM)("guest",r.n),v("connected"),x()}catch(e){v("error"),e instanceof Error&&(null==e||null==(i=e.message)?void 0:i.includes("PAYMENT_METHOD_REQUIRED"))&&m(n.maxAccountsExceeded),console.error("Error generating guest account",e)}},w=null==(t=e.state)?void 0:t.guestLogin,k=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{!k.current&&w&&(k.current=!0,v("connecting"),w.connectionPromise.then(()=>{x(),v("connected")}).catch(e=>{m(e.message),v("error")}))},[x,w]),(0,i.jsx)(s.mc,{animate:"fadein",flex:"column",fullHeight:!0,children:(0,i.jsxs)(s.mc,{expand:!0,flex:"column",p:"lg",style:{paddingBottom:0},children:[e.goBack&&(0,i.jsx)(s.rQ,{onBack:e.goBack,title:p.title}),"compact"===e.size?(0,i.jsx)(u.h,{y:"xl"}):null,(0,i.jsxs)(s.mc,{center:"both",expand:!0,flex:"column",style:{minHeight:"250px",textAlign:"center"},children:["error"!==y&&(0,i.jsxs)(s.mc,{animate:"fadein",children:[(0,i.jsx)(h.E,{center:!0,color:"primaryText",multiline:!0,style:{maxWidth:"250px"},children:"Generating your guest account"}),(0,i.jsx)(u.h,{y:"xl"}),(0,i.jsx)(s.mc,{center:"x",flex:"row",children:(0,i.jsx)(d.y,{color:"accentText",size:"lg"})}),(0,i.jsx)(u.h,{y:"xxl"})]}),"error"===y&&(0,i.jsxs)(s.mc,{animate:"fadein",children:[g?(0,i.jsx)(h.E,{center:!0,color:"danger",children:g}):(0,i.jsx)(h.E,{color:"danger",children:p.failed}),(0,i.jsx)(u.h,{y:"lg"}),(0,i.jsx)(c.$n,{onClick:j,variant:"primary",children:p.retry}),(0,i.jsx)(u.h,{y:"xxl"})]})]})]})})}},48801:(e,t,n)=>{n.d(t,{BG:()=>s,CW:()=>i,HM:()=>r,RI:()=>a,Zo:()=>o,_p:()=>l,a0:()=>c});let i="/sdk/2022-08-12/embedded-wallet",l=e=>`thirdwebEwsWalletUserId-${e}`,r=e=>`walletToken-${e}`,a=e=>`passkey-credential-id-${e}`,o=(e,t)=>`a-${e}-${t}`,s=e=>`walletConnectSessions-${e}`,c=e=>`thirdweb_guest_session_id_${e}`},56836:(e,t,n)=>{n.d(t,{W:()=>u});var i=n(7128),l=n(90416),r=n(64651),a=n(68846),o=n(97481),s=n(62564),c=n(81499);function u(e){return(0,i.jsxs)(a.mc,{animate:"fadein",children:[(0,i.jsx)(s.h,{y:"xxl"}),(0,i.jsx)(a.mc,{center:"x",flex:"row",children:(0,i.jsx)(r.g,{size:l.RK["3xl"]})}),(0,i.jsx)(s.h,{y:"lg"}),(0,i.jsx)(c.E,{center:!0,color:"primaryText",size:"md",children:e.title}),(0,i.jsx)(s.h,{y:"xl"}),(0,i.jsx)(s.h,{y:"xxl"}),(0,i.jsx)(o.$n,{fullWidth:!0,onClick:e.onTryAgain,variant:"accent",children:"Try Again"})]})}},58837:(e,t,n)=>{n.d(t,{R:()=>f});var i=n(7128),l=n(71060),r=n(63620),a=n(94582),o=n(51400),s=n(13740),c=n(56849),u=n(49752),d=n(68846),h=n(97481),p=n(62564),g=n(16537),m=n(81499),x=n(45400);function f(e){var t,n;let f=e.locale,y=f.socialLoginScreen,v=(0,c.QP)(),j=(0,a.Y)(e.wallet)?{id:e.wallet.id,partnerId:null==(t=e.wallet.getConfig())?void 0:t.partnerId}:void 0,[w,k]=(0,l.useState)(void 0),{done:b,wallet:E}=e,[C,S]=(0,l.useState)("connecting"),I=async()=>{var t,n,i,l,a;let c=E.getConfig(),d=c&&"auth"in c&&null!=(n=null==c||null==(t=c.auth)?void 0:t.mode)?n:"popup";if(c&&"auth"in c&&"popup"!==d&&!e.isLinking)return(0,s.N)({authOption:e.socialAuth,client:e.client,ecosystem:j,mode:null==c||null==(i=c.auth)?void 0:i.mode,redirectUrl:null==c||null==(l=c.auth)?void 0:l.redirectUrl});try{let t=(0,x.C)({authOption:e.socialAuth,client:e.client,ecosystem:j,themeObj:v});if(!t)throw Error("Failed to open ".concat(e.socialAuth," login window"));S("connecting"),e.isLinking?await (0,o.oO)({client:e.client,closeOpenedWindow:e=>{e.close()},ecosystem:j,openedWindow:t,strategy:e.socialAuth}).catch(e=>{throw k(e.message),e}):await E.connect({chain:e.chain,client:e.client,closeOpenedWindow:e=>{e.close()},openedWindow:t,strategy:e.socialAuth}),await (0,u.OM)(e.socialAuth,r.n),S("connected"),b()}catch(t){S("error"),t instanceof Error&&(null==t||null==(a=t.message)?void 0:a.includes("PAYMENT_METHOD_REQUIRED"))&&k(f.maxAccountsExceeded),console.error("Error signing in with ".concat(e.socialAuth),t)}},W=null==(n=e.state)?void 0:n.socialLogin,A=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{!A.current&&W&&(A.current=!0,S("connecting"),W.connectionPromise.then(()=>{b(),S("connected")}
20).catch(e=>{k(e.message),S("error")}))},[b,W]),(0,i.jsx)(d.mc,{animate:"fadein",flex:"column",fullHeight:!0,children:(0,i.jsxs)(d.mc,{expand:!0,flex:"column",p:"lg",style:{paddingBottom:0},children:[e.goBack&&(0,i.jsx)(d.rQ,{onBack:e.goBack,title:e.isLinking?e.connectLocale.manageWallet.linkProfile:y.title}),"compact"===e.size?(0,i.jsx)(p.h,{y:"xl"}):null,(0,i.jsxs)(d.mc,{center:"both",expand:!0,flex:"column",style:{minHeight:"250px",textAlign:"center"},children:["error"!==C&&(0,i.jsxs)(d.mc,{animate:"fadein",children:[(0,i.jsx)(m.E,{center:!0,color:"primaryText",multiline:!0,style:{maxWidth:"250px"},children:y.instruction}),(0,i.jsx)(p.h,{y:"xl"}),(0,i.jsx)(d.mc,{center:"x",flex:"row",children:(0,i.jsx)(g.y,{color:"accentText",size:"lg"})}),(0,i.jsx)(p.h,{y:"xxl"})]}),"error"===C&&(0,i.jsxs)(d.mc,{animate:"fadein",children:[w?(0,i.jsx)(m.E,{center:!0,color:"danger",children:w}):(0,i.jsx)(m.E,{color:"danger",children:y.failed}),(0,i.jsx)(p.h,{y:"lg"}),(0,i.jsx)(h.$n,{onClick:I,variant:"primary",children:y.retry}),(0,i.jsx)(p.h,{y:"xxl"})]})]})]})})}},64758:(e,t,n)=>{n.d(t,{C:()=>v});var i=n(7128),l=n(71060),r=n(12495),a=n(15253),o=n(94582),s=n(51400),c=n(90416),u=n(12608),d=n(10633),h=n(94491),p=n(68846),g=n(62564),m=n(88006),x=n(56836),f=n(1617),y=n(15910);function v(e){let{wallet:t,done:n}=e,v=(0,u.S4)("useAddConnectedWallet").addConnectedWallet,j=(0,l.useRef)(void 0),[w,k]=(0,l.useState)("selecting"),[b,E]=(0,l.useState)(),[C,S]=(0,l.useState)(!1),I=(0,o.Y)(t)?{id:t.id,partnerId:t.getConfig()?.partnerId}:void 0,W=()=>{k("selecting"),j.current=void 0,e.onBack()};async function A(i){k("loading"),E(void 0),j.current=i;try{e.isLinking?await (0,s.oO)({chain:e.chain||t.getChain()||(0,r.xH)(1),client:e.client,ecosystem:I,strategy:"wallet",wallet:i}):await t.connect({chain:e.chain||i.getChain()||(0,r.xH)(1),client:e.client,strategy:"wallet",wallet:i}),v(i),n()}catch(e){E(e instanceof Error?e.message:"Unknown error"),k("error")}}return j.current?(0,i.jsxs)(p.mc,{animate:"fadein",flex:"column",fullHeight:!0,children:[(0,i.jsx)(p.mc,{p:"lg",children:(0,i.jsx)(p.rQ,{onBack:W,title:e.isLinking?e.inAppLocale.linkWallet:e.inAppLocale.signInWithWallet})}),(0,i.jsx)(p.mc,{center:"y",expand:!0,flex:"column",px:"wide"===e.size?"xxl":"lg",children:(0,i.jsx)("div",{children:"error"===w?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.W,{onTryAgain:()=>{if(!j.current)throw Error("Failed to connect to unknown wallet");A(j.current)},title:b||"Failed to Login"}),(0,i.jsx)(g.h,{y:"lg"})]}):(0,i.jsx)(y.G,{icon:(0,i.jsx)(m.j,{client:e.client,id:j.current.id??"",size:c.RK.xl}),subtitle:"A pop-up prompt will appear to sign-in and verify your wallet",title:"Sign in with your wallet"})})})]}):C?(0,i.jsx)(l.Suspense,{fallback:(0,i.jsx)(f.x,{}),children:(0,i.jsx)(d.default,{client:e.client,connectLocale:e.locale,disableSelectionDataReset:!0,onBack:()=>S(!1),onSelect:async e=>{A(e),S(!1)},recommendedWallets:void 0,size:e.size,specifiedWallets:[]})}):(0,i.jsx)(h.d,{chain:t.getChain(),chains:[],client:e.client,connectLocale:e.locale,disableSelectionDataReset:!0,done:()=>{},goBack:W,hideHeader:!1,meta:e.meta||{},modalHeader:{onBack:W,title:e.isLinking?e.inAppLocale.linkWallet:e.inAppLocale.signInWithWallet},onShowAll:()=>{S(!0)},recommendedWallets:void 0,selectWallet:async e=>{A(e)},setModalVisibility:()=>{},showAllWallets:!0,size:e.size,title:e.locale.connectAWallet,walletConnect:e.walletConnect,walletIdsToHide:["inApp"],wallets:(0,a.E)()})}},91618:(e,t,n)=>{n.d(t,{a:()=>y});var i=n(7128),l=n(71060),r=n(63620),a=n(94582),o=n(51400),s=n(79377),c=n(90416),u=n(49752),d=n(38077),h=n(68846),p=n(97481),g=n(62564),m=n(56836),x=n(1617),f=n(15910);function y(e){let{wallet:t,done:n,client:r,chain:o,size:c,locale:u}=e,[d,p]=(0,l.useState)("loading"),m=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{m.current||(m.current=!0,(0,s.A)(r,(0,a.Y)(t.id)?t.id:void 0).then(e=>{e?p("login"):p("select")}).catch(()=>{p("select")}))},[r,t.id]),(0,i.jsxs)(h.mc,{animate:"fadein",flex:"column",fullHeight:!0,children:[(0,i.jsx)(h.mc,{p:"lg",children:(0,i.jsx)(h.rQ,{onBack:e.onBack,title:e.isLinking?u.passkeys.linkPasskey:u.passkeys.title})}),(0,i.jsx)(h.mc,{center:"y",expand:!0,flex:"column",px:"wide"===c?"xxl":"lg",children:(0,i.jsxs)("div",{children:["loading"===d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.x,{}),(0,i.jsx)(g.h,{y:"xxl"})]}),"select"===d&&(0,i.jsx)(w,{onSignin:()=>{p("login")},onSignup:()=>{p("signup")}}),"login"===d&&(0,i.jsx)(v,{chain:o,client:r,done:n,isLinking:e.isLinking,onCreate:()=>{p("signup")},wallet:t}),"signup"===d&&(0,i.jsx)(j,{chain:o,client:r,done:n,isLinking:e.isLinking,wallet:t})]})})]})}function v(e){let{wallet:t,done:n,client:a,chain:s}=e,[h,x]=(0,l.useState)("loading"),[y,v]=(0,l.useState)();async function j(){x("loading");try{e.isLinking?await (0,o.oO)({client:a,strategy:"passkey",type:"sign-in"}).catch(e=>
20{throw v(e.message),e}):(await t.connect({chain:s,client:a,strategy:"passkey",type:"sign-in"}),await (0,u.OM)("passkey",r.n)),n()}catch(e){console.error("Failed to login with passkey",e),x("error")}}let w=(0,l.useRef)(!1);return((0,l.useEffect)(()=>{w.current||(w.current=!0,j())}),"loading"===h)?(0,i.jsx)(f.G,{icon:(0,i.jsx)(d.C,{size:c.RK.xxl}),subtitle:"A pop-up prompt will appear to sign-in and verify your passkey",title:"Requesting Passkey"}):"error"===h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.W,{onTryAgain:j,title:y||"Failed to Login"}),(0,i.jsx)(g.h,{y:"sm"}),(0,i.jsx)(p.$n,{fullWidth:!0,onClick:e.onCreate,variant:"outline",children:"Create a new Passkey"}),(0,i.jsx)(g.h,{y:"lg"})]}):null}function j(e){let{wallet:t,done:n,client:s,chain:h}=e,[p,x]=(0,l.useState)(),[y,v]=(0,l.useState)("loading"),j=(0,a.Y)(t)?{id:t.id,partnerId:t.getConfig()?.partnerId}:void 0;async function w(){v("loading");try{e.isLinking?await (0,o.oO)({client:s,ecosystem:j,strategy:"passkey",type:"sign-up"}):(await t.connect({chain:h,client:s,strategy:"passkey",type:"sign-up"}),await (0,u.OM)("passkey",r.n)),n()}catch(e){console.error(e),e instanceof Error&&x(`Error creating passkey: ${e.message}`),v("error")}}let k=(0,l.useRef)(!1);return((0,l.useEffect)(()=>{k.current||(k.current=!0,w())}),"loading"===y)?(0,i.jsx)(f.G,{icon:(0,i.jsx)(d.C,{size:c.RK.xxl}),subtitle:"A pop-up prompt will appear to sign-in and verify your passkey",title:"Creating Passkey"}):"error"===y?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.W,{onTryAgain:w,title:p||"Failed to create passkey"}),(0,i.jsx)(g.h,{y:"lg"})]}):null}function w(e){return(0,i.jsxs)(h.mc,{children:[(0,i.jsx)(g.h,{y:"xxl"}),(0,i.jsx)(h.mc,{center:"x",color:"accentText",flex:"row",children:(0,i.jsx)(d.C,{size:c.RK["4xl"]})}),(0,i.jsx)(g.h,{y:"xl"}),(0,i.jsx)(g.h,{y:"xxl"}),(0,i.jsx)(p.$n,{fullWidth:!0,onClick:e.onSignup,variant:"accent",children:"Create a Passkey"}),(0,i.jsx)(g.h,{y:"sm"}),(0,i.jsx)(p.$n,{fullWidth:!0,onClick:e.onSignin,variant:"outline",children:"I have a Passkey"}),(0,i.jsx)(g.h,{y:"lg"})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.