1var j=Object.defineProperty;var F=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var U=(r,a,t)=>a in r?j(r,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[a]=t,E=(r,a)=>{for(var t in a||(a={}))M.call(a,t)&&U(r,t,a[t]);if(F)for(var t of F(a))H.call(a,t)&&U(r,t,a[t]);return r};import{_ as e,a as i,b as $}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{a as d,e as D,b as G}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{_ as A,d as z}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import J from"./ForgotPassword-CRSGmHcp.js";import K from"./RecoverAccount-DeHEYoiA.js";import Z from"./LoginWithEmailLink-CSdnTusL.js";import Q from"./ResetPassword-CaE8bcFo.js";import{V as O}from"./ViewTitle-DJBm7y23.js";import{I as X,l as ee,j as Y}from"./index-B9O2cfno.js";import{F as V,A as N,P as B,b as W}from"./AuthForm-CR8C_1hj.js";import{P as te,C as re}from"./passwordValidator-WQB-wBbJ.js";import{R as ae}from"./RequiredParameter-sNXTeMLJ.js";import{u as se}from"./useCreateBillingEvent-BwAt8mcV.js";import{u as ne}from"./useAccountRecoveryVerify-FZs4PE3P.js";import{u as ie}from"./useEmailChange-DnmY8WjG.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./types-BY9I4-Vb.js";import"./useEmailActionForm-BZUa8Qlv.js";import"./index.esm-CuP3mDAg.js";import"./index-CwMG8eoe.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import"./input-Chbnfqnc.js";import"./useControlled-DMkbsAxB.js";import"./useRegisterFieldControl-8-icw_H_.js";import"./GradientOutlineButton-CQz8rFt9.js";import"./index--eSQkUPx.js";import"./useLegacyAnalytix-qvGMSx1h.js";const oe='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 18.2576 18.2576" fill="none"><path d="M5.37879 9.12879L7.87879 11.6288L12.8788 6.62879M17.4621 9.12879C17.4621 13.7312 13.7312 17.4621 9.12879 17.4621C4.52641 17.4621 0.795455 13.7312 0.795455 9.12879C0.795455 4.52641 4.52641 0.795455 9.12879 0.795455C13.7312 0.795455 17.4621 4.52641 17.4621 9.12879Z" stroke="#2CBA7C" stroke-width="1.59091" stroke-linecap="round" stroke-linejoin="round"/></svg>';function le(r){return e(X,E({svg:oe},r))}function ce(){const[r,a]=d({password:"",confirmPassword:""}),[t,s]=d({}),[u,c]=d(!1),[x,y]=d(!1),[w,m]=d(null),[v,C]=d(null),h=A(),k=new URLSearchParams(h.search),g=k.get("requestId"),f=k.get("token"),{loading:p,verifyAndSetPassword:S}=ne(),{createBillingEvent:I}=se();return{fields:r,errors:t,isSubmitting:u,isSuccess:x,errorStatus:w,verifiedEmail:v,requestId:g,token:f,loading:p,handleChange:l=>{const o=E({},r),b=l.target.name;o[b]=l.target.value,a(o);const P=E({},t);delete P[b],delete P.general,s(P)},handleSubmit:async l=>{if(l==null||l.preventDefault(),!(!g||!f))try{s({}),m(null);const o=te(r.password,r.confirmPassword,void 0,void 0);c(!0);const b=await S(g,f,o);b.updatedEmail&&C(b.updatedEmail),I({action:"account_recovery_successful"}).catch(P=>{ee.error("Failed to log account_recovery_successful event:",P)}),y(!0)}catch(o){if(c(!1),o instanceof ae)s({[o.parameterName]:o.message});else if(o instanceof re)s({password:o.message,confirmPassword:o.message});else if(o&&typeof o=="object"&&"status"in o){const b=o;switch(m(b.status),b.status){case 400:s({general:"Invalid request. Please check your password meets requirements."});break;case 401:s({general:"Invalid verification link. Please request a new account recovery email."});break;case 404:s({general:"Recovery request not found. Please request a new account recovery email."});break;case 410:s({general:"This link has expired or already been used. Please request a new account recovery email."});break;case 500:s({general:"We encountered an error. Please try again later or contact support."});break;default:s({general:"Verification failed. Please try again."})}}else s({general:"An unexpected error occurred. Please try again."})}}}}function _(){return e(W,{"data-test":"return-to-login",to:"/auth/login",children:"Back to Sign In"})}function de(){const r=z(),{fields:a,errors:t,isSubmitting:s,isSuccess:u,errorStatus:c,verifiedEmail:x,requestId:y,token:w,loading:m,handleChange:v,handleSubmit:C}=ce(),[h,k]=d(!1);if(!y||!w)return i("div",{className:"flex flex-col gap-24 text-center",children:[i("div",{className:"flex flex-col gap-8",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:"Invalid Verification Link"}),e("p",{className:"text-muted-foreground text-base",children:"This verification link is invali
1d. Please check your email and try again, or request a new verification email."})]}),i(V,{variant:"error",children:[e("span",{className:"font-semibold",children:"Invalid Link"}),e("br",{}),"Missing required parameters in verification link."]}),e(N,{"data-test":"request-new-link",onClick:()=>r("/auth/identify"),children:"Request New Verification Email"}),e(_,{})]});if(c===401||c===404||c===410){let f="Verification Failed",p=t.general||"An error occurred during verification.";return c===401?(f="Invalid Verification Link",p="Invalid verification link. Please request a new account recovery email."):c===404?(f="Recovery Request Not Found",p="Recovery request not found. Please request a new account recovery email."):c===410&&(f="Link Expired or Used",p="This link has expired or already been used. Please request a new account recovery email."),i("div",{className:"flex flex-col gap-24 text-center",children:[i("div",{className:"flex flex-col gap-8",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:f}),e("p",{className:"text-muted-foreground text-base",children:p})]}),e(N,{"data-test":"error-action-button",onClick:()=>r("/auth/identify"),children:"Request New Verification Email"}),e(_,{})]})}if(u)return i("div",{className:"flex flex-col gap-24 text-center",children:[e("div",{className:"flex justify-center",children:e(le,{size:"xxxlarge",className:"text-success-400","aria-label":"Success"})}),i("div",{className:"flex flex-col gap-8",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:"You're all set!"}),e("p",{className:"text-muted-foreground text-base",children:"Your password has been updated. You can now sign in using:"}),x&&i("p",{className:"text-foreground text-base font-medium",children:["(",x,")"]})]}),e(N,{"data-test":"continue-to-login",onClick:()=>r("/auth/login"),children:"Continue to login"})]});const g=s||m;return i("div",{className:"flex flex-col gap-24",children:[e(O,{title:"Account Recovery"}),i("div",{className:"flex flex-col gap-8",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:"Complete your account recovery"}),e("p",{className:"text-muted-foreground text-base",children:"Your email has been verified. Create a new password below to complete your account recovery and regain access."})]}),t.general&&i(V,{variant:"error",children:[e("span",{className:"font-semibold",children:"Failed to verify and set password"}),e("br",{}),t.general]}),i("form",{onSubmit:C,className:"flex flex-col gap-16",children:[e(B,{label:"New Password","data-test":"password",id:"password",name:"password","data-sr-redact":!0,required:!0,autoCapitalize:"off",disabled:g,error:t.password,onChange:v,value:a.password||"",visible:h,onVisibleChange:k}),e(B,{label:"Confirm New Password","data-test":"confirmPassword",id:"confirmPassword",name:"confirmPassword","data-sr-redact":!0,required:!0,autoCapitalize:"off",disabled:g,error:t.confirmPassword,onChange:v,value:a.confirmPassword||"",visible:h,onVisibleChange:k}),e(N,{"data-test":"submit",type:"submit",disabled:g,children:g?"Resetting password...":"Reset Password"})]}),e("div",{className:"text-center",children:e(_,{})})]})}const R="_pb_emailChangeResume",ue="/auth/email-action",me={0:{title:"Email Change Failed",message:"Network error. Please check your connection and try again.",terminal:!1},400:{title:"Email Change Failed",message:"Invalid request. Please try again.",terminal:!1},401:{title:"Invalid Link",message:"This link is invalid. Please start the email change again from your account settings.",terminal:!0},404:{title:"Request Not Found",message:"We couldn't find this email change request for your account. If you have more than one Photobucket account, sign in with the one you started the change from.",terminal:!0},409:{title:"Address Unavailable",message:"That email address was just claimed by another account. Please start the change again with a different address.",terminal:!0},410:{title:"Link Expired or Used",message:"This link has expired or already been used. Please start the email change again from your account settings.",terminal:!0},500:{title:"Email Change Failed",message:"We encountered an error. Please try again later or contact support.",terminal:!1}},fe={title:"Email Change Failed",message:"Something went wrong. Please try again.",terminal:!1},q=r=>{var a;return(a=me[r])!=null?a:fe};function ge(r){const a=new URLSearchParams(r),t=a.get("step");return{step:t==="authorize"||t==="verify"?t:null,requestId:a.get("requestId"),token:a.get("token")}}function he(){const r=z(),a=A(),[{step:t,requestId:s,token:u}]=d(()=>{const n=ge(a.search);if(n.step&&n.requestId&&n.token)return n;try{const l=sessionStorage.getItem(R);if(l){const o=JSON.parse(l);return{step:o.step,requestId:o.requestId,token:o.token}}}catch(l){}return n}),[c,x]=d(!1),[y,w]=d(null),[m,v]=d(null),[C,h]=d(null),{loading:k,submitEmailChangeStep:g}=ie(),f=D(!1),p=()=>{t&&s&&u&&sessionStorage.setItem(R,JSON.stringify({step:t,requestId:s,token:u}));const n="".concat(ue,"?mode=emailChange").concat(t?"&step=".concat(t):"");r("/auth/login?returnUrl=".concat(encodeURIComponent(n)),{replace:!0})},S=async()=>
1{if(!(!t||!s||!u)){h(null),v(null);try{const n=await g(t,s,u),l=t==="authorize"?"PENDING_NEW_VERIFY":"SUCCESS";if(n.status!==l){h("Something went wrong. Please try again.");return}n.updatedEmail&&w(n.updatedEmail),x(!0)}catch(n){if(n&&typeof n=="object"&&"status"in n){const l=n;if(l.isAuthError){p();return}v(l.status),h(q(l.status).message)}else h("An unexpected error occurred. Please try again.")}}};G(()=>{let n=!1;return t&&s&&u&&!f.current&&(f.current=!0,(async()=>{if(await Y().authStateReady(),!n){if(!Y().currentUser){p();return}sessionStorage.removeItem(R),a.search&&r(a.pathname,{replace:!0}),await S()}})()),()=>{n=!0}},[]);const I=!t||!s||!u,T=m!==null&&q(m).terminal?{title:q(m).title,message:C}:null;return{step:t,isInvalidLink:I,terminalError:T,isSuccess:c,updatedEmail:y,generalError:C,loading:k,handleSubmit:S,onContinue:()=>r("/auth/logout")}}const pe={authorize:{title:"Confirm Email Change",header:"Confirm your email change",subheader:"You asked to change the email address on your Photobucket account. We're confirming your request and sending a verification link to your new email address.",busy:"Confirming...",successHeader:"Check your new email",successSubheader:"We've sent a verification link to your new email address. Open it to finish changing your email."},verify:{title:"Verify New Email",header:"Verify your new email",subheader:"Confirming this is your new email address to finish updating your Photobucket account.",busy:"Verifying...",successHeader:"Your email has been updated",successSubheader:"Your account email address has been changed. You can now sign in with your new email address."}};function L(){return e(W,{to:"/auth/login","data-test":"return-to-login",className:"font-display w-full text-center text-base",children:"Back to Sign In"})}function xe(){return i("div",{className:"flex flex-col items-center gap-24 text-center",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:"Invalid Link"}),e("p",{className:"text-muted-foreground text-base",children:"This email change link is invalid or incomplete. Please open the most recent link from your email, or start the change again from your account settings."}),e(L,{})]})}function be({title:r,message:a}){return i("div",{className:"flex flex-col items-center gap-24 text-center",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:r}),e("p",{className:"text-muted-foreground text-base",children:a}),e(L,{})]})}function ye({step:r,copy:a,updatedEmail:t,onContinue:s}){return i("div",{className:"flex flex-col items-center gap-24 text-center",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:a.successHeader}),e("p",{className:"text-muted-foreground text-base",children:a.successSubheader}),t&&i("p",{className:"text-foreground text-base font-medium",children:["(",t,")"]}),r==="verify"&&e(N,{type:"button","data-test":"continue-to-login",onClick:s,children:"Continue to login"})]})}function we({copy:r,generalError:a,loading:t,onSubmit:s}){return i("div",{className:"flex flex-col items-center gap-24 text-center",children:[e(O,{title:r.title}),e("h1",{className:"font-display text-foreground text-4xl font-bold",children:r.header}),e("p",{className:"text-muted-foreground text-base",children:r.subheader}),a?i($,{children:[i(V,{variant:"error",className:"w-full text-left",children:[e("span",{className:"font-semibold",children:"Something went wrong"}),e("br",{}),a]}),e(N,{type:"button","data-test":"submit",disabled:t,onClick:s,children:t?r.busy:"Try again"})]}):i("div",{"data-test":"processing",className:"flex flex-col items-center gap-16",children:[e("span",{className:"border-brand-500 size-32 animate-spin rounded-full border-2 border-t-transparent mx-auto",role:"status","aria-label":"Loading"}),e("p",{className:"text-muted-foreground text-base",children:r.busy})]}),e(L,{})]})}function ve(){const{step:r,isInvalidLink:a,terminalError:t,isSuccess:s,updatedEmail:u,generalError:c,loading:x,handleSubmit:y,onContinue:w}=he();if(a||!r)return e(xe,{});if(t)return e(be,{title:t.title,message:t.message});const m=pe[r];return s?e(ye,{step:r,copy:m,updatedEmail:u,onContinue:w}):e(we,{copy:m,generalError:c,loading:x,onSubmit:y})}
1function at(){const r=A(),[a]=d(()=>new URLSearchParams(r.search).get("mode"));switch(a){case"resetPassword":return e(Q,{});case"recoverAccount":return e(K,{});case"accountRecovery":return e(de,{});case"emailChange":return e(ve,{});case"verifyEmail":return e(J,{});default:return e(Z,{})}}export{at as default};
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.