1"use strict";(self.webpackChunklanding_v3=self.webpackChunklanding_v3||[]).push([[8485],{58485(e,a,l){l.d(a,{LinkEmailModal:()=>g});var s=l(5544),i=l(46676),n=l(48738),t=l.n(n),o=l(9950),d=l(8881),r=l(90210);const m="LinkEmailModal_modal__c83jO",c="LinkEmailModal_modalInner__xEBEg",u="LinkEmailModal_modalInnerOpened__KN0fg",_="LinkEmailModal_close__2fJ7W",k="LinkEmailModal_title__gcwCW",h="LinkEmailModal_form__n9r4m",v="LinkEmailModal_errorBox__u-3DG",p="LinkEmailModal_input__Q9qUm",E="LinkEmailModal_submit__E8BbE";var x=l(44414);const b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,f=()=>(0,x.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,x.jsx)("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),g=e=>{let a=e.opened,l=e.onClose,n=e.onSuccess;const g=(0,o.useState)(""),L=(0,s.A)(g,2),j=L[0],C=L[1],M=(0,o.useState)(""),y=(0,s.A)(M,2),w=y[0],N=y[1],S=(0,o.useState)(""),A=(0,s.A)(S,2),B=A[0],q=A[1],W=(0,o.useState)(!1),D=(0,s.A)(W,2),I=D[0],O=D[1];(0,o.useEffect)(()=>{a||(C(""),N(""),q(""),O(!1))},[a]);const P=()=>{I||l()};return(0,x.jsx)(i.A,{open:a,onClose:P,className:m,children:(0,x.jsxs)("div",{className:t()(c,{[u]:a}),children:[(0,x.jsx)("button",{type:"button",className:_,onClick:P,"aria-label":"Close",children:(0,x.jsx)(f,{})}),(0,x.jsxs)("h2",{className:k,children:["Link your ",(0,x.jsx)("br",{})," email address"]}),(0,x.jsxs)("form",{className:h,onSubmit:async e=>{e.preventDefault();const a=j.trim(),s=w.trim();if(b.test(a))if(a===s){q(""),O(!0);try{const e=await r.d.updateEmail(a);await(null===n||void 0===n?void 0:n({email:a,link:e.link})),(0,d.M8)("Your email address has been linked successfully. Your access details have been sent to ".concat(a,"."),{variant:"success"}),l()}catch(t){var i;const e=null===t||void 0===t||null===(i=t.message)||void 0===i?void 0:i.trim();q(e||"Failed to link your email address. Please try again.")}finally{O(!1)}}else q("Email addresses do not match.");else q("Please enter a valid email address.")},children:[B&&(0,x.jsx)("div",{className:v,children:B}),(0,x.jsx)("input",{type:"email",className:p,value:j,onChange:e=>{C(e.target.value),B&&q("")},placeholder:"Email address",disabled:I,autoComplete:"email",required:!0}),(0,x.jsx)("input",{type:"email",className:p,value:w,onChange:e=>{N(e.target.value),B&&q("")},placeholder:"Confirm email address",disabled:I,autoComplete:"email",required:!0}),(0,x.jsx)("button",{type:"submit",className:E,disabled:I||!j||!w,children:I?"Linking\u2026":"Link email"})]})]})})}}}]);
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.