1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/ManagePlansPanel-Y1oWP1C2.js","assets/js/index-B9O2cfno.js","assets/js/remoteEntry-uboCqDRT.js","assets/js/index-DM2295YJ.js","assets/js/useCheckoutPlan-Bau4Y1CZ.js","assets/js/useSubscriptionCreate-OLYKR3EK.js","assets/js/index-CwMG8eoe.js","assets/js/PlanCard-B9oEs-wt.js","assets/js/Download01Icon-CkcaBhu1.js","assets/js/FolderPlusIcon-YauH7r6L.js","assets/js/GridIcon-DPy6pYc3.js","assets/js/HardDriveIcon-DwM4WZ6h.js","assets/js/ImageIcon-DCfEtqpZ.js","assets/js/Share06Icon-rIhASCAU.js","assets/js/UsersPlusIcon-D7ikAfJ_.js","assets/js/formatCurrency-Ds9JEw6e.js","assets/js/Heading-BWstxz8W.js","assets/js/TabsList-DD0pfAwC.js","assets/js/useControlled-DMkbsAxB.js","assets/js/useCompositeItem-BxtCkF_e.js","assets/js/CompositeRoot-BghrUB8Z.js","assets/js/DirectionContext-CJiZK74l.js","assets/js/Plans-BLORJGoo.js","assets/js/Appbar-CbSVPwFS.js","assets/js/index-P9SMy3w3.js","assets/js/getThemeProps-B8tVaoKo.js","assets/js/SettingsMenu-NWhImQWZ.js","assets/js/index-Dks6jFMG.js","assets/js/Popper-CKZMq35R.js","assets/js/Select-BBMTu6sl.js","assets/js/isMuiElement-ByswdNQJ.js","assets/js/List-C5bK9afY.js","assets/js/useBucket-CR5UEp3u.js","assets/js/useSelectedMedia-BLVwYI-I.js","assets/js/Close-D78lNu8F.js","assets/js/getInitials-DL7R944W.js","assets/js/Stack-Sf5GoIpP.js","assets/js/ListItemText-CKRtU6FZ.js","assets/js/dividerClasses-cApOefCC.js","assets/js/useThemeProps-DMYUNtYJ.js","assets/js/Avatar-BTJ3UjGE.js","assets/js/moment-D_DQNCUI.js","assets/js/CloudDownloadOutlined-Cg5tMevg.js","assets/js/useBucketMediaFavoriteCacheUpdate-BBJ2VF0-.js","assets/js/useDownloadGate-BQMEGnwf.js","assets/js/useProfilePlan-2AaC2fHr.js","assets/js/logger-YHhloPCO.js","assets/js/ShoppingCartOutlined-CMkj9tZs.js","assets/js/ArrowBack-DonIluNH.js","assets/js/Menu-CLoe2S8i.js","assets/js/X-BN8IQ5QI.js","assets/js/PaymentModal-B3enHFLh.js","assets/js/StyledFormAlert-CuxIc--d.js","assets/js/StyledFormDivider-DMPDnPdK.js","assets/js/Divider-Ds-LqyRJ.js","assets/js/Autocomplete-neN2nyEM.js","assets/js/Chip-Cz6LBgjr.js","assets/js/TextField-Cxuy6esU.js","assets/js/Grid-D6nfESib.js","assets/js/Dialog-C1VO68NT.js","assets/js/DialogContent-Cspg_vaK.js","assets/js/CheckCircle-BwStVG4y.js","assets/js/DialogTitle-CtbZieWs.js","assets/js/useLegacyAnalytix-qvGMSx1h.js","assets/js/index--eSQkUPx.js","assets/js/ListItem-e5SPCG9y.js","assets/js/ListItemAvatar-XK29cN0L.js","assets/js/Card-Cf2-mLz8.js","assets/js/CardActions-BXnAWm-V.js","assets/js/Link-jPbx2fgb.js","assets/css/index-D4FIafr-.css"])))=>i.map(i=>d[i]); 2var ta=Object.defineProperty,na=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var sn=Object.getOwnPropertySymbols;var ia=Object.prototype.hasOwnProperty,oa=Object.prototype.propertyIsEnumerable;var Ye=(t,a,n)=>a in t?ta(t,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[a]=n,E=(t,a)=>{for(var n in a||(a={}))ia.call(a,n)&&Ye(t,n,a[n]);if(sn)for(var n of sn(a))oa.call(a,n)&&Ye(t,n,a[n]);return t},N=(t,a)=>na(t,aa(a));var cn=(t,a,n)=>Ye(t,typeof a!="symbol"?a+"":a,n);import{_ as e,a as r,b as re}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{a as _,e as Ee,b as J,c as et,i as ra,m as sa,w as ca}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{d as te}from"./_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{c7 as Ge,i as ve,v as P,c_ as ln,c$ as Ae,j as W,d0 as dn,l as $,ci as je,d1 as la,cL as _e,bT as w,d2 as Ke,d3 as da,d4 as pa,d5 as ma,d6 as pn,d7 as ha,cR as ua,d8 as ga,d9 as ba,w as ya,ct as Dn,cq as he,s as Ce,bN as Ie,bU as B,cT as fa,bY as xa,r as wa,a as Ze,cj as Mn,ck as Nn,da as Ca,bQ as F,db as Rn,dc as Bn,dd as va,cb as ka,cc as Sa,cn as We,bS as ke,ca as Be,cl as mn,bX as Oe,de as ae,co as Un,bZ as Ea,c9 as _a,df as Ta,dg as Aa,dh as Ia,di as zn,dj as La,dk as Fa,c5 as Da,C as Ma,cK as Na,dl as hn}from"./index-B9O2cfno.js";import{f as Ra,_ as Ba,d as Ua}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{S as un,V as za,N as Ga}from"./Layout-S-NwUP9Q.js";import{u as Wa}from"./useAppleLogin-BB9Uc64T.js";import{A as Oa,S as Gn}from"./StyledFormAlert-CuxIc--d.js";import{S as Ue}from"./Switch-Ckbn_YA3.js";import{u as Ha}from"./useBucket-CR5UEp3u.js";import{u as Wn}from"./useProfilePlan-2AaC2fHr.js";import{u as He}from"./index-P9SMy3w3.js";import{a as On,R as $a,b as Va}from"./FilterAndSort-D4es-lv2.js";import{L as Ne}from"./List-C5bK9afY.js";import{L as Me}from"./Autocomplete-neN2nyEM.js";import{L as oe}from"./ListItem-e5SPCG9y.js";import{F as q,C as X}
2from"./FormControlLabel-Czs4VhDI.js";import{D as Xe}from"./Divider-Ds-LqyRJ.js";import{P as Pa,C as Ya}from"./passwordValidator-WQB-wBbJ.js";import{R as ja}from"./RequiredParameter-sNXTeMLJ.js";import{P as Re}from"./PasswordVisibilityAdornment-DqSgn8Hl.js";import{G as I}from"./Grid-D6nfESib.js";import{T as se}from"./TextField-Cxuy6esU.js";import{L as Le,T as Qa,f as qa}from"./MediaShareCreate-79OR0t4d.js";import{c as Ka}from"./countries-DN7txrzE.js";import{F as Za,I as Xa,S as Ja,a as ei,M as ti}from"./Select-BBMTu6sl.js";import{M as ni}from"./Stack-Sf5GoIpP.js";import{S as ai,a as ii}from"./StyledTextField-Bs6qQcIH.js";import{u as oi}from"./useEmailChange-DnmY8WjG.js";import{_ as ri}from"./preload-helper-s0Msbe4-.js";import{e as si,g as gn,S as ci,P as li,s as bn}from"./Plans-BLORJGoo.js";import{u as di}from"./useBucketsByUserId-CEDFMk1Q.js";import{f as pi}from"./format-CKMw7464.js";import{f as ze}from"./formatBytes-jRUNT9z8.js";import{C as $e}from"./Close-D78lNu8F.js";import{l as Je}from"./useSubscriptionCreate-OLYKR3EK.js";import{P as mi}from"./PaymentModal-B3enHFLh.js";import{D as Ve}from"./Dialog-C1VO68NT.js";import{D as Hn}from"./DialogTitle-CtbZieWs.js";import{D as Pe}from"./DialogContent-Cspg_vaK.js";import{D as hi}from"./DialogActions-D9PHF9CH.js";import{A as $n}from"./ArrowBack-DonIluNH.js";import{A as ui}from"./CloudDownloadOutlined-Cg5tMevg.js";import{I as gi}from"./ImageOutlined-ncIk3Ht-.js";import{E as bi}from"./EmailOutlined-yVcZ7gwV.js";import{L as yi}from"./LockOutlined-BhihjHcl.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.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__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./groupsyChrome-CLCFmWEd.js";import"./index-Dks6jFMG.js";import"./Popper-CKZMq35R.js";import"./useSelectedMedia-BLVwYI-I.js";import"./Appbar-CbSVPwFS.js";import"./SettingsMenu-NWhImQWZ.js";import"./getInitials-DL7R944W.js";import"./Avatar-BTJ3UjGE.js";import"./moment-D_DQNCUI.js";import"./useBucketMediaFavoriteCacheUpdate-BBJ2VF0-.js";import"./useDownloadGate-BQMEGnwf.js";import"./logger-YHhloPCO.js";import"./ShoppingCartOutlined-CMkj9tZs.js";import"./Menu-CLoe2S8i.js";import"./AlbumDelete-12m3V2Wy.js";import"./en-US-CcscABQy.js";import"./albumCacheLinks-Cqrf5vaz.js";import"./index-CNeZytPn.js";import"./useBucketMediaUpload-CW736OsH.js";import"./index--eSQkUPx.js";import"./placeholders-BhfK6KrI.js";import"./useAnalytics-BR9_As4i.js";import"./ListItemButton-CvicjC8C.js";import"./ListItemText-CKRtU6FZ.js";import"./Chip-Cz6LBgjr.js";import"./formatDistanceToNow-uO2sKiQN.js";import"./DialogContentText-3_LgfOmt.js";import"./Skeleton-CVzxamYN.js";import"./useCoverImage-Q0Hrs1vF.js";import"./coverImageProcessor-CAPCAp77.js";import"./MediaDetails-BEnwtCci.js";import"./CheckCircleOutline-CeZtT-Cq.js";import"./useBucketMediaMove-BuvKt6ph.js";import"./Link-jPbx2fgb.js";import"./index.esm-DLBLOnGz.js";import"./UpsellModal-CAUY_Vvc.js";import"./useStartPlusCheckout-Cfk75TzO.js";import"./useBucketList-Dcd9NUck.js";import"./CheckCircle-BwStVG4y.js";import"./Videocam-DeL9MjCY.js";import"./BucketCreate-B4a-RI5Z.js";import"./groupCapUpsell-Ckyvb8hl.js";import"./inviteUrl-DDIGNVvr.js";import"./index-CwMG8eoe.js";import"./__vite-browser-external-D7Ct-6yo.js";import"./getThemeProps-B8tVaoKo.js";import"./mediaSortOptions-DtdpbfUc.js";import"./isMuiElement-ByswdNQJ.js";import"./dividerClasses-cApOefCC.js";import"./useThemeProps-DMYUNtYJ.js";import"./groupsy-logo-white-C4_zM7ld.js";import"./X-BN8IQ5QI.js";import"./useLegacyAnalytix-qvGMSx1h.js";import"./ListItemAvatar-XK29cN0L.js";import"./Card-Cf2-mLz8.js";import"./CardActions-BXnAWm-V.js";import"./formatCurrency-Ds9JEw6e.js";import"./StyledFormDivider-DMPDnPdK.js";const fi=Ge(e("path",{d:"M18.6 6.62c-1.44 0-2.8.56-3.77 1.53L12 10.66 10.48 12h.01L7.8 14.39
2c-.64.64-1.49.99-2.4.99-1.87 0-3.39-1.51-3.39-3.38S3.53 8.62 5.4 8.62c.91 0 1.76.35 2.44 1.03l1.13 1 1.51-1.34L9.22 8.2C8.2 7.18 6.84 6.62 5.4 6.62 2.42 6.62 0 9.04 0 12s2.42 5.38 5.4 5.38c1.44 0 2.8-.56 3.77-1.53l2.83-2.5.01.01L13.52 12h-.01l2.69-2.39c.64-.64 1.49-.99 2.4-.99 1.87 0 3.39 1.51 3.39 3.38s-1.52 3.38-3.39 3.38c-.9 0-1.76-.35-2.44-1.03l-1.14-1.01-1.51 1.34 1.27 1.12c1.02 1.01 2.37 1.57 3.82 1.57 2.98 0 5.4-2.41 5.4-5.38s-2.42-5.37-5.4-5.37"})),xi=Ge(e("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"})),wi=Ge([e("circle",{cx:"12",cy:"19",r:"2"},"0"),e("path",{d:"M12 3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2s2-.9 2-2V5c0-1.1-.9-2-2-2"},"1")]),Ci=Ge(e("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 2c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H8v-1.5c0-1.99 4-3 6-3s6 1.01 6 3z"}));class vi extends Error{constructor(n,o="DefaultException"){super(n);cn(this,"code");this.code=o,this.name=this.constructor.name}}const Qe="link_idp";function ki(){const{init:t}=Wa(),{createAlert:a}=ve(),[n,o]=_({}),[s,c]=_(!1),[p,f]=_(!0),g={isFirebaseFacebookIdpEnabled:te("isFirebaseFacebookIdpEnabled"),isFirebaseMicrosoftIdpEnabled:te("isFirebaseMicrosoftIdpEnabled"),isFirebasePaypalIdpEnabled:te("isFirebasePaypalIdpEnabled")},l=Ee(P.filter(ln,i=>{const{featureFlagName:m}=Ae(i);return m?g[m]:!0})),C=async i=>{var v,h;const m=Ae(i);try{const{currentUser:x}=W();if(!x){a("We're experiencing an error, please reload the page and try again.","error");return}if(i===pn.PROVIDER_ID){if(!((h=(v=window.AppleID)==null?void 0:v.auth)!=null&&h.signIn)){a("Apple sign-in is not available. Please try again later.","error");return}const d=await window.AppleID.auth.signIn().catch(O=>{throw $.error("Error during Apple signIn",O),O});if(!d)return;const k=new pn().credential({idToken:d.authorization.id_token});await ha(x,k),o(N(E({},n),{[i]:!0})),a("Successfully linked your Apple account.","success");return}if(ua.isMobile){localStorage.setItem(Qe,i),await ga(x,m.getProvider());return}await ba(x,m.getProvider()),o(N(E({},n),{[i]:!0})),a("Successfully linked your ".concat(P.capitalize(m.name)," account."),"success")}catch(x){a("There was an error linking your ".concat(P.capitalize(m.name)," account. Please try again.")),$.error(x)}},b=async i=>{const{name:m}=Ae(i);try{const{currentUser:v}=W();if(!v)throw new vi("There is an issue with your session, please reload the page and try again.");await ma(v,i);const h=E({},n);delete h[i],o(h),a("Successfully unlinked your ".concat(P.capitalize(m)," account"),"success")}catch(v){const h=v;
2h.code==="DefaultException"?a(h.message,"error"):a("There was an error unlinking your ".concat(P.capitalize(m)," account. Please try again.")),$.error(v)}},u=i=>()=>{if(!W().currentUser){a("An error occurred. Please try again.");return}n[i]?b(i):C(i)},y=Ee(async()=>{var i;try{const m=(i=W().currentUser)==null?void 0:i.email;if(!m)throw new Error("Issue with session. Please try reloading the page and try again.");const v=await dn(W(),m),h=P.intersection(v,l.current);P.filter(ln,d=>{const{featureFlagName:k}=Ae(d);return k?g[k]:!0});const x={};h.forEach(d=>{const k=d;x[k]=!0}),o(x)}catch(m){const v=m;$.error(m),a(v.message,"error")}});return je(()=>{t("link-account")}),je(()=>{var m;const i=(m=W().currentUser)==null?void 0:m.email;if(!i){a("An error occurred loading your account. Please try again.");return}dn(W(),i).then(v=>{const h=P.intersection(v,l.current),x={};h.forEach(d=>{const k=d;x[k]=!0}),f(!1),c(!0),o(x)}).catch(v=>{f(!1),c(!0),a("An error occurred while loading your account."),$.error(v)})}),je(()=>{(async()=>{const m=localStorage.getItem(Qe);if(m)try{await la(W());const{name:v}=Ae(m);a("Successfully linked your ".concat(P.capitalize(v)," account."),"success")}catch(v){a(v.message,"error")}finally{localStorage.setItem(Qe,"")}})().catch($.error).finally(y.current)}),!s&&p?e(_e,{}):r("form",{children:[e(w,{variant:"h6",children:"Social Sign In Options"}),r(Ke,{variant:"standard",severity:"info",children:[e(Oa,{children:"Notice"}),"Toggling an account on will require you to sign in to connect the account to your Photobucket account."]}),r("div",{style:{display:"flex",alignItems:"center"},children:[e(da,{width:64,height:64}),e(Ue,{onChange:u("google.com"),checked:!!n["google.com"],inputProps:{"aria-label":"controlled"}})]}),r("div",{style:{display:"flex",alignItems:"center"},children:[e(pa,{width:64,height:64}),e(Ue,{onChange:u("apple.com"),checked:!!n["apple.com"],inputProps:{"aria-label":"controlled"}})]})]})}function Si(){var x,d,k,O,ne,Y,L,R,U,M,H;const{bucketUser:t}=Ha(),{loading:a,settings:n}=ya(),{mutation:o,loading:s}=Dn(),{isHostingEnabled:c,profile:p}=Wn(),f=!!p,g=He(he.breakpoints.down("sm")),[l,C]=_({showImageTitle:!!(n!=null&&n.showImageTitle),imgLarge:!!((d=(x=t==null?void 0:t.userProfile)==null?void 0:x.linkSettings)!=null&&d.imgLarge),imgThumb:!!((O=(k=t==null?void 0:t.userProfile)==null?void 0:k.linkSettings)!=null&&O.imgThumb),isQuickLinksEnabled:!!((ne=t==null?void 0:t.userProfile)!=null&&ne.isQuickLinksEnabled),directLink:!!((L=(Y=t==null?void 0:t.userProfile)==null?void 0:Y.linkSettings)!=null&&L.directLink),htmlThumb:!!((U=(R=t==null?void 0:t.userProfile)==null?void 0:R.linkSettings)!=null&&U.htmlThumb),htmlLarge:!!((H=(M=t==null?void 0:t.userProfile)==null?void 0:M.linkSettings)!=null&&H.htmlLarge),hostingEnabled:!1}),b=Ce(Ie,{nextFetchPolicy:"cache-and-network"});J(()=>{if(!b.data)return;const S=b.data;C(T=>{var j,z,Q,V,ee,ce,K,ue,ge,le,de,be,ye,ie,pe;return N(E({},T),{showImageTitle:!!((z=(j=S.userProfile)==null?void 0:j.desktopSettings)!=null&&z.showImageTitle),imgLarge:!!((V=(Q=S.userProfile)==null?void 0:Q.linkSettings)!=null&&V.imgLarge),imgThumb:!!((ce=(ee=S.userProfile)==null?void 0:ee.linkSettings)!=null&&ce.imgThumb),isQuickLinksEnabled:!!((K=S.userProfile)!=null&&K.isQuickLinksEnabled),directLink:!!((ge=(ue=S.userProfile)==null?void 0:ue.linkSettings)!=null&&ge.directLink),htmlThumb:!!((de=(le=S.userProfile)==null?void 0:le.linkSettings)!=null&&de.htmlThumb),htmlLarge:!!((ye=(be=S.userProfile)==null?void 0:be.linkSettings)!=null&&ye.htmlLarge),hostingEnabled:!!((pe=(ie=S.userProfile)==null?void 0:ie.hostingSettings)!=null&&pe.enabled)})})},[b.data]);const u=te("isFeatureGatingV2EnabledWeb"),{hostingEnabled:y}=l,i=u?c&&y:c,m=S=>{const T=S.target.name,j=S.target.checked;C(z=>N(E({},z),{[T]:j}))},v=S=>{if(f){if(!c){xa("hosting"),wa("upsellModal");return}C(T=>N(E({},T),{hostingEnabled:S.target.checked}))}},h=S=>{S.preventDefault();const T={data:E({desktopSettings:{showImageTitle:l.showImageTitle},linkSettings:{imgLarge:l.imgLarge,imgThumb:l.imgThumb,directLink:l.directLink,htmlThumb:l.htmlThumb,htmlLarge:l.htmlLarge},isQuickLinksEnabled:l.isQuickLinksEnabled},f?{hostingSettings:{enabled:c&&l.hostingEnabled}}:{})};o({variables:T})};return b.loading||a?e(_e,{}):r("form",{onSubmit:h,children:[r(On,{children:[r(Ne,{children:[r(Me,{children:[e(w,{variant:"h6",style:{color:"black",marginBottom:"5px"},children:"Image Settings"}),e(w,{children:"Show Image Title"})]}),e(oe,{children:e(q,{control:e(X,{checked:!!l.showImageTitle,onChange:m,name:"showImageTitle",color:"primary","data-test":"show-image-title"}),label:"Turn on to show image title on grid"})})]}),u&&r(Ne,{children:[e(Me,{children:e(w,{variant:"h6",style:{color:"black",marginBottom:"5px"},children:"Image Hosting"})}),e(oe,{children:e(q,{control:e(Ue,{checked:y,disabled:!f,onChange:v,name:"hostingEnabled",color:"primary","data-test":"hosting-option"}),label:"Turn on image hosting"})})]}),r(Ne,{children:[e(Me,{children:e(w,{variant:"h6",style:{color:"black",marginBottom:"5px"},children:"My Group Links"})}),e(oe,{children:e(q,{control:e(X,{checked:l.directLink,disabled:!i,onChange:m,name:"directLink",color:"primary","data-test":"direct-link-option"}),label:"Direct Link"})}),e(oe,{children:e(q,{control:e(X,{checked:l.htmlLarge,disabled:!i,onChange:m,name:"htmlLarge",color:"primary","data-test":"html-code-option"}),label:"HTML Code"})}),e(oe,{children:e(q,{control:e(X,{checked:l.htmlThumb,disabled:!i,onChange:m,name:"htmlThumb",color:"primary","data-test":"html-thumb-option"}),label:"HTML Thumb"})}),e(oe,{children:e(q,{control:e(X,{checked:l.imgLarge,disabled:!i,onChange:m,name:"imgLarge",color:"primary","data-test":"image-option"}),label:"IMG"})}),e(oe,{children:e(q,{control:e(X,{checked:l.imgThumb,disabled:!i,onChange:m,name:"imgThumb",color:"primary","data-test":"image-thumb-option"}),label:"IMG Thumb"})}),e(Me,{children:e(w,{children:"Easy Linking Mode"})}),e(oe,{children:e(q,{control:e(X,{checked:l.isQuickLinksEnabled,disabled:!i,onChange:m,name:"isQuickLinksEnabled",color:"primary","data-test":"easy-linking-option"}),label:"Turn on easy linking mode"})})]})]}),e(B,{style:{width:g?"100%":"550px"},color:"primary",variant:"contained",type:"submit","data-test":"submit-ablum-settings-button",disabled:s||!b.data,startIcon:s?e
2(fa,{}):null,children:s?"Saving...":"Save Changes"})]})}function Ei(){const{createAlert:t}=ve(),[a,n]=Ze(Ca,{update:(o,{data:s})=>{s!=null&&s.userNotificationSettingsUpdate&&o.updateQuery({query:Ie},c=>c!=null&&c.userProfile?N(E({},c),{userProfile:N(E({},c.userProfile),{notificationSettings:s.userNotificationSettingsUpdate})}):null)},onError:o=>{if(Mn.is(o)||Nn.is(o)){o.errors.forEach(s=>{t(s.message),$.error("Notification settings update error:",s)});return}$.error("Notification settings update error:",o),t("Failed to update notification preferences. Please try again.")}});return{mutation:a,results:n,loading:n.loading}}function _i(){var C,b;const t=(C=W().currentUser)==null?void 0:C.emailVerified,{data:a,loading:n}=Ce(Ie),{mutation:o,loading:s}=Ei(),[c,p]=_({}),f=(b=a==null?void 0:a.userProfile)==null?void 0:b.notificationSettings,g=et(()=>{var u;return((u=f==null?void 0:f.notification)==null?void 0:u.filter(y=>y.notificationType.email.supportedPlatform.includes("WEB")))||[]},[f]),l=(u,y)=>{if(!f){$.error("Cannot update notifications: settings not loaded");return}const i=!y,{templateName:m}=u,v="".concat(m,"-email");p(x=>N(E({},x),{[v]:i}));const h=f.notification.map(x=>x.templateName===m?{templateName:x.templateName,notificationType:{email:{enabled:i},push:{enabled:x.notificationType.push.enabled}}}:{templateName:x.templateName,notificationType:{email:{enabled:x.notificationType.email.enabled},push:{enabled:x.notificationType.push.enabled}}});o({variables:{data:{notification:h}},onError:()=>{p(x=>{const d=E({},x);return delete d[v],d})},onCompleted:()=>{p(x=>{const d=E({},x);return delete d[v],d})}})};return n?e(_e,{}):!f||g.length===0?r(F,{children:[e(w,{variant:"h5",sx:{mb:2,fontWeight:600},children:"Notification Settings"}),e(Ke,{severity:"info",children:"No notification settings available"})]}):r(F,{children:[e(w,{variant:"h5",sx:{mb:3,fontWeight:600,fontSize:"20px"},children:"Notification Settings"}),!t&&e(Ke,{severity:"warning",sx:{mb:3},children:"Please verify your email address to enable email notifications"}),e(w,{variant:"h6",sx:{mb:1,fontWeight:600,fontSize:"16px"},children:"Notify me when..."}),e(Xe,{sx:{mb:2}}),g.map((u,y)=>{var k;const{templateName:i,notificationType:m}=u,v=u.displayName.replace(/Buckets/g,"Groups").replace(/Bucket/g,"Group"),h="".concat(i,"-email"),x=(k=c[h])!=null?k:m.email.enabled,d=!t||s;return r(F,{sx:{mb:y<g.length-1?3:0},children:[e(w,{variant:"body1",sx:{mb:1,fontSize:"16px"},children:v}),r(F,{sx:{display:"flex",alignItems:"center",gap:3},children:[e(F,{sx:{display:"flex",alignItems:"center",gap:1},children:e(w,{variant:"body2",sx:{fontSize:"16px"},children:"Email Notifications"})}),e(Ue,{checked:x,onChange:()=>l(u,x),color:"primary",disabled:d,"data-testid":"".concat(i,"-email-switch")})]}),y<g.length-1&&e(Xe,{sx:{mt:2}})]},i)})]})}const fe=1,Se=2,yn=3;function Ti(){const{createAlert:t}=ve(),[a,n]=_(fe),[o,s]=_({}),[c,p]=_({}),[f,g]=_({currentPassword:!1,password:!1,confirmPassword:!1}),l=u=>{const y=E({},o),i=u.target.name;y[i]=u.target.value,s(y);const m=E({},c);delete m[i],p(m)},C=u=>{g(y=>N(E({},y),{[u]:!y[u]}))};function b(u){u.preventDefault();const y=W().currentUser;if(a===fe){if(n(Se),!o.currentPassword){p(N(E({},c),{currentPassword:"Current password is required."})),n(fe);return}if(!(y!=null&&y.email)){t("An error occurred. Please logout and try again."),n(fe);return}if(o.password===o.currentPassword){p(N(E({},c),{password:"Your new password cannot be the same as your current password."})),n(fe);return}try{const i=Pa(o.password,o.confirmPassword),m=Rn.credential(y.email,o.currentPassword);Bn(y,m).then(()=>va(y,i)).then(()=>{t("Your password updated.","success"),n(yn)}).catch(v=>{v.code==="auth/wrong-password"?p(N(E({},c),{currentPassword:"Incorrect current password"})):t("An error occurred while updating your password."),n(fe),$.error(v)})}catch(i){i instanceof Ya?p(N(E({},c),{confirmPassword:i.message})):i instanceof ja&&i.parameterName?p(N(E({},c),{[i.parameterName]:i.message})):t("An error occurred validating your password."),n(fe)}}}return a===yn?r("div",{children:[e(w,{variant:"h6",children:"Success!"}),e(w,{children:"Your password updated."})]}):r("form",{onSubmit:b,children:[e(w,{variant:"h6",children:"Update Password"}),e(I,{sx:{mt:2},container:!0,spacing:2,children:e(I,{size:{xs:12,md:5},children:e(se,{disabled:a===Se,type:f.currentPassword?"text":"password",fullWidth:!0,error:!P.isEmpty(c.currentPassword),id:"password-current-password",inputProps:{autoCapitalize:"off"},name:"currentPassword",label:"Current Password",helperText:c.currentPassword,value:o.currentPassword,variant:"outlined",onChange:l,InputProps:{endAdornment:e(Re,{showPassword:f.currentPassword,handleClickShowPassword:()=>C("currentPassword")})}})})}),e(I,{sx:{mt:2},container:!0,spacing:2,children:e(I,{size:{xs:12,md:5},children:e(se,{disabled:a===Se,type:f.password?"text":"password",fullWidth:!0,error:!P.isEmpty(c.password),id:"password-new-password",inputProps:{autoCapitalize:"off"},name:"password",label:"New Password",helperText:c.password,value:o.password,variant:"outlined",onChange:l,InputProps:{endAdornment:e(Re,{showPassword:f.password,handleClickShowPassword:()=>C("password")})}})})}),e(I,{sx:{mt:2},container:!0,spacing:2,children:e(I,{size:{xs:12,md:5},children:e(se,{disabled:a===Se,type:f.confirmPassword?"text":"password",fullWidth:!0,error:!P.isEmpty(c.confirmPassword),id:"password-confirm-password",inputProps:{autoCapitalize:"off"},name:"confirmPassword",label:"Confirm Password",helperText:c.confirmPassword,value:o.confirmPassword,variant:"outlined",onChange:l,InputProps:{endAdornment:e(Re,{showPassword:f.confirmPassword,handleClickShowPassword:()=>C("confirmPassword")})}})})}),e(I,{sx:{mt:1},container:!0,spacing:2,children:r(I,{size:{xs:12,md:3},children:[a===Se&&e(Le,{}),e(B,{disabled:a===Se,fullWidth:!0,id:"password-submit",type:"submit",variant:"contained",children:"Submit"})]})})]})}function Ai(){var d,k,O,ne,Y;const{uid:t,email:a}=W().currentUser||{},n=ka.readFragment({fragment:Sa,fragmentName:"UserProfileFragment",id:"UserProfile:".concat(t)}),[o,s]=_({}),[c,p]=_({}),[f,g]=_({}),l=Ce(Ie,{skip:!W().currentUser,nextFetchPolicy:"cache-and-network"});J(()=>{var T;if(!l.data)return;const{firstName:L,lastName:R,country:U,state:M,usageReason:H,zipCode:S}=(T=l.data.userProfile)!=null?T:{};p({firstName:L,lastName:R,country:U,state:M,zipCode:S}),s(P.omit(H,"__typename"))},[l.data]);const{mutation:C,loading:b}=Dn(),u=te("isGroupsyRebrandEnabled"),y=L=>{const R=E({},c),U=L.target.name;R[U]=L.target.value,p(R);const M=E({},f);delete M[U],delete M.general,g(M)},i=(L,R)=>{const U=E({},c),M=L;U[M]=R,p(U);const H=E({},f);delete H[M],delete H.general,g(H)},m=L=>{L.preventDefault();const R={data:N(E({},c),{usageReason:o})};C({variables:R})},v=L=>{i(L.target.name,L.target.value)},h=L=>{const R=o[L];return()=>s(N(E({},o),{[L]:!R}))};if(l.loading)return e(_e,{});const x=u?"Groupsy":"Photobucket";return r("form",{onSubmit:m,children:[e(w,{children:"Name"}),e(w,{"data-testid":"profile-name",variant:"h6",sx:{mb:2},children:n==null?void 0:n.name}),e(w,{children:"Email"}),e(w,{"data-testid":"profile-email",sx:{color:"#636363",mb:2},variant:"h6",children:a}),e(w,{children:"Username"}),e(w,{"data-testid":"profile-username",sx:{color:"#636363",mb:2},variant:"h6",children:n==null?void 0:n.id}),r(I,{container:!0,spacing:2,children:[e(I,{size:{xs:12,md:5},children:e(se,{disabled:b,fullWidth:!0,id:"profile-first-name","data-testid":"profile-first-name",name:"firstName",label:"First Name",value:(d=c.firstName)!=null?d:"",variant:"outlined",onChange:y,type:"text"})}),e(I,{size:{xs:12,md:5},children:e(se,{disabled:b,fullWidth:!0,id:"profile-last-name","data-testid":"profile-last-name",name:"lastName",label:"Last Name",value:(k=c.lastName)!=null?k:"",variant:"outlined",onChange:y,type:"text"})})]}),r(I,{sx:{mt:4},container:!0,spacing:2,children:[e(I,{size:{xs:12,md:5},children:r(Za,{fullWidth:!0,children:[e(Xa,{id:"location-label",children:"Location"}),e(Ja,{disabled:b,labelId:"location-label",label:"Location",value:(O=c==null?void 0:c.country)!=null?O:"",name:"country",onChange:v,children:Ka.map(L=>e(ni,{value:L.value,children:L.label},L.value))})]})}),e(I,{size:{xs:12,md:3},children:e(se,{disabled:b,fullWidth:!0,id:"profile-state",name:"state",label:"State/Province",value:(ne=c.state)!=null?ne:"",variant:"outlined",onChange:y})}),e(I,{size:{xs:12,md:2},children:e(se,{disabled:b,fullWidth:!0,id:"profile-zip-code",name:"zipCode",label:"Zip Code",value:(Y=c.zipCode)!=null?Y:"",variant:"outlined",onChange:y})})]}),e(I,{sx:{mt:4},container:!0,spacing:2,children:e(I,{size:{xs:12,md:5},children:r(On,{id:"usage-reason-checkboxes",children:[r(ei,{component:"legend",children:["Reason for using ",x]}),e(q,{onChange:h("personal"),control:e(X,{disabled:b,checked:o.personal===!0}
2),label:"Personal"}),e(q,{onChange:h("business"),control:e(X,{disabled:b,checked:o.business===!0}),label:"Business"}),e(q,{onChange:h("storage"),control:e(X,{disabled:b,checked:o.storage===!0}),label:"Storage"}),e(q,{onChange:h("hosting"),control:e(X,{disabled:b,checked:o.hosting===!0}),label:"Hosting"}),e(q,{onChange:h("sharing"),control:e(X,{disabled:b,checked:o.sharing===!0}),label:"Share Images with Family/Friends"})]})})}),e(B,{"data-testid":"profile-submit",sx:{mt:2},variant:"contained",disabled:b,type:"submit",children:"Submit"})]})}const Ii=/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/,Li=t=>Ii.test(t);function fn({goToScreen:t,newEmail:a,setNewEmail:n}){var g;const{createAlert:o}=ve(),[s,c]=_(""),p=l=>{n(l.target.value),c("")};function f(l){l.preventDefault();const C=W().currentUser;if(!C){o("An error occurred. Please logout and try again.");return}const b=a.trim();if(!Li(b)){c("The email you entered is not valid.");return}if(C.email&&b.toLowerCase()===C.email.toLowerCase()){c("This is already your email address.");return}n(b),t("REAUTHENTICATE")}return r("form",{onSubmit:f,children:[e(w,{children:"Current Email"}),e(w,{variant:"h6",children:(g=W().currentUser)==null?void 0:g.email}),e(I,{sx:{mt:2},container:!0,spacing:2,children:r(I,{size:{xs:12,md:5},children:[s&&e(Gn,{title:"Error changing email",body:s}),e(se,{fullWidth:!0,error:!P.isEmpty(s),id:"email-new-email",name:"new-email",label:"New Email",helperText:s,value:a,variant:"outlined",onChange:p})]})}),e(I,{sx:{mt:1},container:!0,spacing:2,children:e(I,{size:{xs:12,md:3},children:e(B,{fullWidth:!0,id:"email-submit",type:"submit",variant:"contained",children:"Submit"})})})]})}function Fi({goToScreen:t,newEmail:a,password:n,setPassword:o}){const{createAlert:s}=ve(),[c,p]=_(""),[f,g]=_(!1),[l,C]=_(!1),{startEmailChange:b}=oi(),u=h=>{o(h.target.value),p("")},y=async()=>{const h=W().currentUser;if(!(h!=null&&h.email))return s("An error occurred. Please logout and try again."),!1;const x=Rn.credential(h.email,n);return await Bn(h,x),!0},i=async()=>{await b(a),t("SUCCESS")};return e("form",{style:{width:"100%"},onSubmit:async h=>{if(h.preventDefault(),f)return;p(""),g(!0);let x;try{x=await y()}catch(d){g(!1),$.error(d),p("The password you entered is incorrect.");return}if(!x){g(!1);return}try{await i()}catch(d){g(!1);const k=d&&typeof d=="object"&&"status"in d?d.status:void 0;if(k===409){t("SUCCESS");return}$.error(d),p(k===400?"Please enter a valid email address.":k===429?"Too many attempts. Please try again later.":"We couldnât start your email change. Please try again.")}},children:e(I,{sx:{mt:2},container:!0,spacing:2,children:r(I,{size:{xs:12,md:5},children:[e(w,{variant:"h4",children:"Reauthenticate to continue"}),e(w,{variant:"h6",sx:{my:2},children:"Continue with password:"}),c&&e(Gn,{title:"Error changing email",body:c}),e(ai,{htmlFor:"password",children:"Password"}),e(ii,{id:"password","data-test":"password",disabled:f,error:!!c,fullWidth:!0,helperText:c,name:"password","data-sr-redact":!0,margin:"dense",onChange:u,required:!0,type:l?"text":"password",InputLabelProps:{shrink:!0},InputProps:{autoCapitalize:"off",endAdornment:e(Re,{showPassword:l,handleClickShowPassword:()=>{C(!l)}})},placeholder:""}),e(B,{type:"submit","data-test":"submit",color:"primary",fullWidth:!0,variant:"contained",disabled:f,sx:{mt:2,py:1.5},children:"Continue"})]})})})}function Di({newEmail:t}){var n;const a=(n=W().currentUser)==null?void 0:n.email;return r("div",{children:[r(w,{variant:"h6",children:["Almost there â confirm the change",a?" from your original email address ".concat(a):""]}),r(w,{sx:{mt:1},children:["To protect your account, we sent a confirmation link to your current original email address on file. Open it to continue changing your email to ",t,"."]}),r(w,{sx:{mt:1},children:["Once confirmed, we'll send a verification link to ",t,". Your account email won't change until you verify the new address."]})]})}const xn=1,wn=2,Cn=3;function Mi(){const[t,a]=_(xn),[n,o]=_(""),[s,c]=_(""),p=f=>{f==="REAUTHENTICATE"&&a(wn),f==="SUCCESS"&&a(Cn)};return t===Cn?e(Di,{newEmail:n}):t===wn?e(Fi,{goToScreen:p,newEmail:n,password:s,setPassword:c}):t===xn?e(fn,{newEmail:n,setNewEmail:o,goToScreen:p}):e(fn,{newEmail:n,setNewEmail:o,goToScreen:p})}const Ni=ke(w)(({theme:t})=>({marginBottom:t.spacing(2),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),Ri=ke(Le)(({theme:t})=>({borderRadius:"4px",height:t.spacing(1),marginBottom:t.spacing(1),marginRight:"2px",flex:1})),Bi=ke(w)(()=>({textAlign:"left"}));function Ui({bucket:t,userProfile:a,color:n,bgColor:o}){var i,m,v,h,x,d;const s=(m=(i=t.counters)==null?void 0:i.totalMedia)!=null?m:0,c=(h=(v=t.counters)==null?void 0:v.totalMediaInTrash)!=null?h:0,p=(d=(x=a==null?void 0:a.plan)==null?void 0:x.bucket_media_limit)!=null?d:50,f=s>=p,g=s+c,l=We(),C=l.palette.customGrey[400],b=l.palette.customGrey[50],u=t.isPlaceholder?C:n,y=t.isPlaceholder?b:o;return r(F,{children:[e(Ni,{variant:"pb.headline.medium",color:t.isPlaceholder?C:"textPrimary",children:t.title}),r(F,{display:"flex",flexDirection:"row",height:"10px",justifyContent:"space-between",children:[e(Ri,{sx:{".MuiLinearProgress-bar":{backgroundColor:"".concat(u," !important")},"&.MuiLinearProgress-root":{backgroundColor:"".concat(y," !important"),opacity:1}},variant:"determinate",value:Math.min(g/p*100,100)}),f&&e(F,{width:"8px",height:"8px",fontSize:"8px",bgcolor:"error.main",borderRadius:"50%",children:e(wi,{fontSize:"inherit",sx:{color:"white"}})})]}),e(Bi,{variant:"pb.label.small",color:t.isPlaceholder?C:n,children:"".concat(g," of ").concat(p," images")})]})}const zi=ke(I)(({theme:t})=>({marginBottom:t.spacing(3),width:"414px"})),Gi=ke(I)(()=>({maxWidth:"120px"})),Wi=ke(F)(({theme:t})=>({maxWidth:"414px",marginBottom:t.spacing(3)}));function Oi({userProfile:t,openChangePlan:a}){const{items:n,loading:o}=di(),s=We(),c=te("usePlansV2"),p=et(()=>n.filter(u=>u.ownerId===(t==null?void 0:t.id)),[t==null?void 0:t.id,n]),f=()=>{window.location.href="https://my.photobucket.com/photobucket-account-deletion-step1"},g=p.some(u=>{var y,i,m;return((y=u.counters)==null?void 0:y.totalMedia)&&u.counters.totalMedia>=((m=(i=t==null?void 0:t.plan)==null?void 0:i.bucket_media_limit)!=null?m:50)}),l=[s.palette.groupsyPink[600],s.palette.customYellow[600],s.palette.customViolet[600]],C=[s.palette.groupsyPink[50],s.palette.customYellow[100],s.palette.customViolet[50]],b=[];for(let u=0;u<3;u+=1)p[u]?b.push(p[u]):b.push({id:"placeholder-".concat(u),title:"Group ".concat(u+1),counters:{totalMedia:0,totalMediaInTrash:0},ownerId:t==null?void 0:t.id,isPlaceholder:!0});return r(F,{children:[e(w,{variant:"pb.title.large",marginBottom:4,children:"You're on a free plan..."}),r(zi,{container:!0,spacing:4,children:[o&&e(Le,{}),b.map((u,y)=>e(Gi,{children:e(Ui,{bucket:u,userProfile:t,color:l[y],bgColor:C[y]})},u.id))]}),g&&e(Wi,{children:e(w,{variant:"pb.label.small",marginBottom:2,children:"You've exceeded your storage for the free plan. Upgrade for unlimited groups and images."})}),r(F,{marginBottom:4,children:[e(w,{variant:"pb.title.large",children:"Free Plan"}),r(I,{container:!0,style:{margin:"20px 0",fontSize:"14px"},children:[e(I,{size:{xs:12,md:4,lg:3},children:r("ul",{style:{margin:0,paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"4px"},children:[e("li",{children:"3 Groups"}),e("li",{children:"50 Videos & Photos per Group"}),e("li",{children:"Search & Organizational Tools"})]})}),e(I,{size:{xs:12,md:4,lg:3},children:r("ul",{style:{margin:0,paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"4px"},children:[e("li",{children:"Image Editor"}),e("li",{children:"WhatsApp & Facebook Transfer Integrations"})]})})]})]}),r(F,{sx:{display:"flex",flexDirection:"row",gap:3}
2,children:[e(B,{color:"error",variant:"outlined",sx:{width:"fit-content"},onClick:f,children:"Delete Account"}),e(B,{"data-testid":"upgrade-or-change-plan",onClick:a,variant:"contained",sx:{width:"fit-content"},children:c?"Upgrade":"Upgrade or Change Plan"})]})]})}const vn=t=>t.includes("already has subscription")?"You already have a subscription. Please contact support if you need assistance.":t;function Hi({isOpen:t,onClose:a,planName:n,billingCycle:o,billingDate:s}){const c=We(),p=Ee(null),[f,g]=_(!1),[l,C]=_({}),[b,u]=_(null),[y,i]=_(null),[m,v]=_(null),[h,x]=_(null),d=te("enableCashApp"),k=Je.useRecurly(),{updatePayment:O,updatePaymentError:ne,updatePaymentLoading:Y}=si(),L=Ee(O),R=!ne&&Y;J(()=>{k&&k.configure(Be.recurlyApiKey)},[k]);const U=ra(H=>{if(p.current){H.preventDefault();try{k.token(p.current,async(S,T)=>{var j;if((j=S==null?void 0:S.details)!=null&&j.length){$.error("[error]",S);const z={};S.details.forEach(Q=>{let V=Q.field,ee=Q.messages.join(", ");["number","month","year","cvv"].includes(V)?(V="card",ee="Please enter your card's expiration date and CVV code."):ee=P.capitalize(ee),z[V]=ee}),C(z)}else T&&(i(mn.CreditCard),u(T))})}catch(S){$.error("[recurly error]",S),C({general:"An error occurred while processing your payment. Please try again."})}}},[k]),M=()=>{g(!1)};return J(()=>{if(f&&m){const S=k.Risk().ThreeDSecure({actionTokenId:m});S.on("error",T=>{C({general:vn("3-D Secure authentication failed. Please try again or use a different payment method.")}),$.error("3DS Error:",T),g(!1),i(null),x(null),u(null)}),S.on("token",T=>{g(!1),i(mn.CreditCard),x(T)}),setTimeout(()=>{const T=document.querySelector("#threeDSecure-container");T&&S.attach(T)},100)}},[f,m,k]),J(()=>{var H;!(b!=null&&b.id)||!y||L.current({token:b.id,threeDSToken:(H=h==null?void 0:h.id)!=null?H:null},S=>{var T;if(Mn.is(S)||Nn.is(S)){const j=S.errors.find(z=>{var Q;return((Q=z.extensions)==null?void 0:Q.code)==="three_d_secure_action_required"});if(!(h!=null&&h.id))if(j){const z=(T=j.extensions)==null?void 0:T.actionTokenId;v(z),g(!0),C({})}else{i(null);const z=S.errors.find(Q=>{var V;return((V=Q.extensions)==null?void 0:V.code)==="FORBIDDEN"});C({general:z?"Failed to update payment. Please try again.":vn(S.message)})}}})},[b==null?void 0:b.id,y,h==null?void 0:h.id]),r(re,{children:[r(Ve,{open:t,onClose:a,maxWidth:"sm",fullWidth:!0,children:[r(Hn,{sx:{textAlign:"left",padding:"16px 24px",position:"relative",display:"flex",alignItems:"center"},children:[e(w,{color:"primary",sx:{fontWeight:"600",fontSize:{xs:"20px",sm:"24px"}},children:"Update Payment Method"}),e(Oe,{"aria-label":"close",onClick:a,sx:{position:"absolute",right:8,color:c.palette.grey[500]},children:e($e,{})})]}),e(Xe,{}),e(Pe,{children:r(F,{sx:{mt:2},children:[e(mi,{enableCashApp:d,hasPendingOrSuccessfulRequest:R,buttonText:"Update Payment Method",handleSubmit:U,formRef:p,errors:l,setErrors:C,setToken:u,setTokenType:i,planName:n,billingCycle:o,cycleIsToggleable:!1,showCoupon:!1}),s&&r(w,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:["This payment method will not be used until your next billing cycle on ",s,"."]})]})})]}),e(ti,{open:f,onClose:M,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(F,{sx:{backgroundColor:"white",padding:"20px",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.2)",display:"inline-grid",minHeight:"90%",width:"500px",overflowY:"auto"},children:e("div",{id:"threeDSecure-container",style:{display:"inline",width:"100%",height:"100%"}})})})]})}function $i({isOpen:t,onClose:a,planName:n,billingCycle:o,billingDate:s}){return e(Je.RecurlyProvider,{publicKey:Be.recurlyApiKey,children:e(Je.Elements,{children:e(Hi,{isOpen:t,onClose:a,planName:n,billingCycle:o,billingDate:s})})})}const kn="linear-gradient(177deg, #7C18FF 0%, #FF2D6B 100%)";function Vi({isOpen:t,onClose:a,userProfile:n,setCancellationReason:o}){const s={"Hard to use":ae.HardToUse,"I only needed Groupsy for a one-time event":ae.TemporaryUseCase,"I only wanted to download my videos and photos":ae.DownloadContent,"Missing features":ae.MissingFeatures,"Price is too high":ae.TooExpensive,"Iâm having technical issues":ae.Technical,"Other / Rather not say":ae.Other},c=Object.entries(s).reduce((d,[k,O])=>N(E({},d),{[O]:k}),{}),[p,f]=_(""),[g,l]=_(""),[C,b]=_(!0),{trackEvent:u}=Un(),y=We(),i=He(y.breakpoints.down("sm")),m=d=>{d.target.value.length<=1e3&&l(d.target.value)},v=()=>{f(""),l(""),b(!0)},h=d=>{v(),a(d)},x=async()=>{var d,k;u("cancel_membership_survey_cancel_continue",{username:n==null?void 0:n.id,plan:(d=n==null?void 0:n.plan)==null?void 0:d.plan_name,recurring:(k=n==null?void 0:n.subscription)==null?void 0:k.recurring}),o(O=>N(E({}
2,O),{createdBy:n.id,comment:g,reason:p,isAllowCommunication:C})),a()};return r(Ve,{open:t,onClose:()=>h(!0),maxWidth:"sm",fullWidth:!0,children:[r(Hn,{sx:{fontSize:i?"1rem":"1.25rem",px:4,pt:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:["We're sorry to see you go ð",e(Oe,{onClick:()=>h(!0),size:"small",children:e($e,{fontSize:"small"})})]}),r(Pe,{sx:{fontSize:i?"1.25rem":"1.5rem",px:4},children:[r(w,{variant:"body2",gutterBottom:!0,sx:{fontSize:i?"0.875rem":"1rem"},children:["Members like you are what make Groupsy amazing. Please take a minute to help us improve or",r("a",{href:"https://support.photobucket.com/hc/en-us",target:"_blank",rel:"noopener noreferrer",style:{color:"#BA09B7",textDecoration:"underline"},children:[" ","contact our engagement team"," "]}),"for help."]}),e(w,{variant:"body2",gutterBottom:!0,sx:{fontSize:i?"0.875rem":"1rem",fontWeight:"bold",mt:2,mb:i?0:2},children:"How did we fall short?"}),e($a,{"data-testid":"reason-radio-group",value:p?c[p]:"",onChange:d=>f(s[d.target.value]),sx:{gap:0},children:Object.keys(s).map((d,k)=>e(q,{value:d,control:e(Va,{"data-testid":"reason-radio-".concat(k),sx:{color:"text.primary","&.Mui-checked":{color:y.palette.groupsy.main},minWidth:i?44:void 0,minHeight:i?44:void 0,transform:i?void 0:"scale(0.8)"}}),label:e(w,{sx:{fontSize:i?"0.75rem":"0.875rem",color:"text.primary"},children:d}),sx:{my:-.5}},d))}),e(se,{placeholder:"Leave comment",inputProps:{"aria-label":"Leave comment"},fullWidth:!0,multiline:!0,rows:3,value:g,onChange:m,sx:{my:2,"& .MuiInputBase-input":{fontSize:i?"0.875rem":"1rem"}}}),e(q,{sx:{fontSize:i?"0.875rem":"1rem"},control:e(X,{sx:{transform:i?"scale(0.8)":"scale(1)",color:"text.primary","&.Mui-checked":{color:y.palette.groupsy.main}},checked:C,onChange:d=>b(d.target.checked)}),label:e(w,{sx:{fontSize:i?"0.875rem":"1rem"},children:"Allow a Groupsy team member to contact me"})})]}),r(hi,{sx:{px:4,pb:3,pt:1},children:[e(B,{"data-testid":"keep-subscription-cancel-modal",onClick:()=>h(!0),sx:{borderRadius:"20px",fontSize:i?"0.75rem":"0.875rem",fontWeight:600,color:"#22222A",backgroundColor:"#F6F0FF",border:"1px solid #EDE0FF",boxShadow:"0px 0px 10px rgba(0, 0, 0, 0.05)","&:hover":{backgroundColor:"#EDE0FF"}},children:"Keep Subscription"}),e(B,{"data-testid":"continue-cancellation-cancel-modal",onClick:x,disabled:!p,sx:{borderRadius:"20px",fontSize:i?"0.75rem":"0.875rem",fontWeight:600,color:"#fff",background:kn,"&:hover":{background:kn,filter:"brightness(0.96)"},"&.Mui-disabled":{background:"#E0E0E0",color:"#FFFFFF"}},children:"Continue to Cancel"})]})]})}const Vn="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='72'%20height='72'%20viewBox='0%200%2072%2072'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon%20/%20alert'%20clip-path='url(%23clip0_0_36)'%3e%3ccircle%20id='Ellipse'%20cx='36'%20cy='36'%20r='36'%20fill='%23EDE0FF'/%3e%3cg%20id='alert-triangle'%3e%3cpath%20id='Vector'%20d='M35.9998%2033V37M35.9998%2041H36.0098M34.6151%2027.8917L26.3902%2042.0983C25.934%2042.8863%2025.7059%2043.2803%2025.7396%2043.6037C25.769%2043.8857%2025.9168%2044.142%2026.1461%2044.3088C26.4091%2044.5%2026.8644%2044.5%2027.7749%2044.5H44.2246C45.1352%2044.5%2045.5904%2044.5%2045.8534%2044.3088C46.0827%2044.142%2046.2305%2043.8857%2046.2599%2043.6037C46.2936%2043.2803%2046.0655%2042.8863%2045.6093%2042.0983L37.3844%2027.8917C36.9299%2027.1065%2036.7026%2026.714%2036.4061%2026.5821C36.1474%2026.4671%2035.8521%2026.4671%2035.5935%2026.5821C35.2969%2026.714%2035.0696%2027.1066%2034.6151%2027.8917Z'%20stroke='url(%23paint0_linear_0_36)'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_0_36'%20x1='25.7363'%20y1='26.4959'%20x2='43.5868'%20y2='46.8475'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%237C18FF'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D6B'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_0_36'%3e%3crect%20width='72'%20height='72'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Sn="linear-gradient(177deg, #7C18FF 0%, #FF2D6B 100%)";function Pi({isOpen:t,onClose:a,confirmCancellation:n,subscriptionEndDate:o}){const s=He(he.breakpoints.down("sm")),c={flex:1,borderRadius:"24px",py:1.5,textTransform:"none",fontWeight:600,fontSize:"1rem",whiteSpace:"nowrap"};return e(Ve,{"data-test":"confirm-cancel-modal",open:t,onClose:()=>a(!0),maxWidth:"sm",fullWidth:!0,children:r(Pe,{sx:{position:"relative",p:{xs:3,sm:4}},children:[e(Oe,{"aria-label":"close",onClick:()=>a(!0),sx:{position:"absolute",right:12,top:12,color:p=>p.palette.grey[500]},children:e($e,{})}),r(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:4,pt:2},children:[e("img",{src:Vn,alt:"",width:72,height:72}),r(F,{children:[e(w,{sx:{fontWeight:700,fontSize:s?"1.5rem":"1.875rem",lineHeight:1.5,color:"#0D0D0D"},children:"Confirm Cancellation"}),r(w,{sx:{fontSize:"1rem",lineHeight:1.5,color:"#0D0D0D",mt:1},children:["Once you confirm cancellation, your subscription will expire on ",o," and your account will be deactivated. You will no longer be able to view or download your account's videos and photos."]})]}),r(F,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:1,width:"100%",maxWidth:448},children:[e(B,{"data-testid":"keep-subscription-cancel-confirm",onClick:()=>a(!0),sx:N(E({},c),{color:"#22222A",backgroundColor:"#F6F0FF",border:"1px solid #EDE0FF",boxShadow:"0px 0px 10px rgba(0, 0, 0, 0.05)","&:hover":{backgroundColor:"#EDE0FF"}}),children:"Keep Subscription"}),e(B,{"data-testid":"confirm-cancellation-cancel-confirm",onClick:n,sx:N(E({},c),{color:"#fff",background:Sn,"&:hover":{background:Sn,filter:"brightness(0.96)"}}),children:"Confirm Cancellation"})]})]})]})})}const En="linear-gradient(177deg, #7C18FF 0%, #FF2D6B 100%)";function Yi({isOpen:t,onClose:a,onContinue:n}){const o=He(he.breakpoints.down("sm")),s=()=>{window.open("https://support.photobucket.com/hc/en-us","_blank"),a(!0)},c={flex:1,borderRadius:"24px",py:1.5,textTransform:"none",fontWeight:600,fontSize:"1rem",whiteSpace:"nowrap"};return e(Ve,{"data-test":"get-help-modal",open:t,onClose:()=>a(!0),maxWidth:"sm",fullWidth:!0,children:r(Pe,{sx:{position:"relative",p:{xs:3,sm:4}},children:[e(Oe,{"aria-label":"close",onClick:()=>a(!0),sx:{position:"absolute",right:12,top:12,color:p=>p.palette.grey[500]},children:e($e,{})}),r(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:4,pt:2},children:[e("img",{src:Vn,alt:"",width:72,height:72}),r(F,{children:[e(w,{sx:{fontWeight:700,fontSize:o?"1.5rem":"1.875rem",lineHeight:1.5,color:"#0D0D0D"},children:"Get help!"}),e(w,{sx:{fontSize:"1rem",lineHeight:1.5,color:"#0D0D0D",mt:1},children:"We're sorry to learn that you're having a frustrating experience. It is our mission to provide all of our customers with an amazing experience. If there's anything we can help with, please contact our Support Team below."})]}),r(F,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:1,width:"100%",maxWidth:448},children:[e(B,{"data-testid":"continue-cancellation-help-modal",onClick:n,sx:N(E({},c),{color:"#22222A",backgroundColor:"#F6F0FF",border:"1px solid #EDE0FF",boxShadow:"0px 0px 10px rgba(0, 0, 0, 0.05)","&:hover":{backgroundColor:"#EDE0FF"}}),children:"Continue to Cancel"}),e(B,{"data-testid":"contact-support-button-help-modal",onClick:s,sx:N(E({},c),{color:"#fff",background:En,"&:hover":{background:En,filter:"brightness(0.96)"}}),children:"Contact Support"})]})]})]})})}function ji({userProfile:t,loading:a,openChangePlan:n,recurlySubscription:o}){var nt,at,it,ot,rt,st,ct,lt,dt,pt,mt,ht,ut,gt,bt,yt,ft,xt,wt,Ct,vt,kt,St,Et,_t,Tt,At,It,
2Lt,Ft,Dt,Mt,Nt,Rt,Bt,Ut,zt,Gt,Wt,Ot,Ht,$t,Vt,Pt,Yt,jt,Qt,qt,Kt,Zt;const{createAlert:s}=ve(),[c,p]=Ea(_a);J(()=>{p.data&&window.open("".concat(Be.appUrl.recurly.editPayment).concat(p.data.subscriptions.hostedLoginToken),"_blank")},[p.data]);const[f]=Ze(Ta),[g]=Ze(Aa),l=Ce(Ia,{skip:!((nt=t==null?void 0:t.subscription)!=null&&nt.id),variables:{subscriptionId:(at=t==null?void 0:t.subscription)==null?void 0:at.id},fetchPolicy:"cache-first"});J(()=>{l.error&&$.error("Error fetching subscription payments:",l.error)},[l.error]);const C=(ot=(it=t==null?void 0:t.plan)==null?void 0:it.storage_limit)!=null?ot:0,b=gn((ct=(st=(rt=o==null?void 0:o.pendingChange)==null?void 0:rt.plan)==null?void 0:st.code)!=null?ct:"no-plan"),u=(lt=t==null?void 0:t.subscription)==null?void 0:lt.isTrial,y=new Date((pt=(dt=t==null?void 0:t.subscription)==null?void 0:dt.trialExpDate)!=null?pt:new Date),i="".concat(y.getMonth()+1,"/").concat(y.getDate(),"/").concat(y.getFullYear()),m=(ut=(ht=(mt=t.subscription)==null?void 0:mt.subscription)==null?void 0:ht.account)!=null?ut:"Free",v=["itunes","apple"].includes(m.toLowerCase()),h=["paypal","paypal_2","vindicia"].includes(m.toLowerCase()),x=["recurly"].includes(m.toLowerCase()),d=(bt=(gt=t==null?void 0:t.subscription)==null?void 0:gt.subscription)==null?void 0:bt.id,O=(wt=(xt=(ft=(yt=Ce(zn,{skip:!d&&!x,variables:{subscriptionId:d}}).data)==null?void 0:yt.subscriptions)==null?void 0:ft.subscription)==null?void 0:xt.recurlySubscription)==null?void 0:wt.currentTermEndsAt,ne=(kt=(vt=(Ct=t==null?void 0:t.subscription)==null?void 0:Ct.planName)==null?void 0:vt.split("-")[0])!=null?kt:"Free",Y=new Date((Et=(St=t==null?void 0:t.subscription)==null?void 0:St.expirationDate)!=null?Et:""),L=Y<new Date,R=u?i:"".concat(Y.getMonth()+1,"/").concat(Y.getDate(),"/").concat(Y.getFullYear());let U;const{trackEvent:M}=Un(),H=te("enabledInAppPaymentUpdate"),S=te("usePlansV2");switch(C){case-1:U=e(fi,{fontSize:"medium",sx:{ml:1,mr:1}});break;case 0:U="No Storage";break;default:U=ze(C);break}const T=(_t=t==null?void 0:t.subscription)==null?void 0:_t.recurring,[j,z]=_(!1),[Q,V]=_(!1),[ee,ce]=_(!1),[K,ue]=_(),[ge,le]=_(!1);J(()=>{K&&(K.reason===ae.HardToUse||K.reason===ae.Technical?z(!0):V(!0))},[K]);const de=gn((At=(Tt=t==null?void 0:t.plan)==null?void 0:Tt.plan_name)!=null?At:"no-plan"),[be,ye]=((Lt=(It=t==null?void 0:t.plan)==null?void 0:It.plan_name)!=null?Lt:"no-plan").split("-"),ie=(Mt=(Dt=(Ft=l.data)==null?void 0:Ft.subscriptions.subscription)==null?void 0:Dt.recurlySubscription)==null?void 0:Mt.total,pe=(()=>{var A;return!((A=t==null?void 0:t.subscription)!=null&&A.isTrial)&&de===ci?"Groups Monthly":de})(),Fe=()=>{var D;const A=(D=t.plan)==null?void 0:D.storage_limit;return A===-1?"Unlimited Storage":A!==null?"".concat(ze(A)," Compression Free Storage"):"Storage limit not set"},tt=et(()=>{var De,Xt,Jt,en,tn,nn,an,on,rn;if(!((en=(Jt=(Xt=(De=l.data)==null?void 0:De.subscriptions)==null?void 0:Xt.payments)==null?void 0:Jt.paymentMethod)!=null&&en.object))return null;const A=l.data.subscriptions.payments.paymentMethod.object,D=R;let G="payment method";A==="credit_card"?G="credit card":A.includes("paypal")?G="PayPal account":A.includes("apple")?G="Apple Pay account":A==="cash_app"&&(G="Cash App account");const me=A==="credit_card"?" ending in ".concat((on=(an=(nn=(tn=l.data)==null?void 0:tn.subscriptions)==null?void 0:nn.payments)==null?void 0:an.paymentMethod)==null?void 0:on.lastFour):"",Te=u?i:D;return b!=="No Plan"?r(re,{children:["Your ",G,me," will be charged on ",e("strong",{children:Te})]}):T?ie?r(re,{children:["Your ",G,me," will be charged ",pi(ie,(rn=o==null?void 0:o.currency)!=null?rn:"USD")," on ",e("strong",{children:Te})]}):null:r(re,{children:["Your ",G," ",me," will end on ",e("strong",{children:Te})]})},[(Ut=(Bt=(Rt=(Nt=l.data)==null?void 0:Nt.subscriptions)==null?void 0:Rt.payments)==null?void 0:Bt.paymentMethod)==null?void 0:Ut.object,(Ot=(Wt=(Gt=(zt=l.data)==null?void 0:zt.subscriptions)==null?void 0:Gt.payments)==null?void 0:Wt.paymentMethod)==null?void 0:Ot.lastFour,u,ie,o==null?void 0:o.currency,R,i,b,T]),Pn=(A=!1)=>{var D,G;A&&M("cancel_membership_survey_cancel_close",{username:t==null?void 0:t.id,plan:(D=t==null?void 0:t.plan)==null?void 0:D.plan_name,recurring:(G=t==null?void 0:t.subscription)==null?void 0:G.recurring}),ce(!1)},Yn=(A=!1)=>{var D,G;A&&M("cancel_membership_get_help_cancel_close",{username:t==null?void 0:t.id,plan:(D=t==null?void 0:t.plan)==null?void 0:D.plan_name,recurring:(G=t==null?void 0:t.subscription)==null?void 0:G.recurring}),z(!1)},jn=()=>{var A,D;M("cancel_membership_get_help_cancel_continue",{username:t==null?void 0:t.id,plan:(A=t==null?void 0:t.plan)==null?void 0:A.plan_name,recurring:(D=t==null?void 0:t.subscription)==null?void 0:D.recurring}),z(!1),setTimeout(()=>V(!0),1e3)},Qn=(A=!1)=>{var D,G;A&&M("cancel_membership_confirm_cancel_close",{username:t==null?void 0:t.id,plan:(D=t==null?void 0:t.plan)==null?void 0:D.plan_name,recurring:(G=t==null?void 0:t.subscription)==null?void 0:G.recurring}),V(!1)},qn=()=>{var A,D;M("cancel_reactivate_membership_clicked",{username:t==null?void 0:t.id,plan:(A=t==null?void 0:t.plan)==null?void 0:A.plan_name,recurring:(D=t==null?void 0:t.subscription)==null?void 0:D.recurring}),d?g({variables:{subscriptionId:d}}).then(()=>{s("Your subscription reactivated successfully.","success")}
2).catch(me=>{s("Failed to reactivate the subscription. Please try again.","error"),$.error("Error reactivating subscription:",me)}):s("We encountered an error trying to reactivate your subscription. Please contact our support team.","error")},Kn=()=>{var A,D,G,me;if(M("cancel_membership_confirm_cancel_clicked",{username:t==null?void 0:t.id,plan:(A=t==null?void 0:t.plan)==null?void 0:A.plan_name,recurring:(D=t==null?void 0:t.subscription)==null?void 0:D.recurring}),d){const Te={subscriptionId:d,input:N(E({},K),{createdBy:(G=t==null?void 0:t.id)!=null?G:"unknown",reason:(me=K==null?void 0:K.reason)!=null?me:ae.Other})};f({variables:Te}).then(()=>{s("Your subscription canceled successfully.","success")}).catch(De=>{s("Failed to cancel the subscription. Please try again.","error"),$.error("Error canceling subscription:",De)})}else s("We encountered an error and are unable to proceed with cancellation. Please contact our support team.","error");V(!1)},Zn=async()=>{if(!d){s("An error occurred loading your profile. Please try again.","error");return}if(H)le(!0);else try{await c({variables:{subscriptionId:d}})}catch(A){$.error("Error fetching hosted login token:",A),s("An error occurred while redirecting to payment. Please try again.","error")}},Xn=()=>{le(!1)},Jn=()=>{window.open(Be.appUrl.paypal,"_blank")},ea=()=>{var A,D;ce(!0),M("cancel_membership_clicked",{variantName:"cancel_membership_clicked",username:t==null?void 0:t.id,plan:(A=t==null?void 0:t.plan)==null?void 0:A.plan_name,recurring:(D=t==null?void 0:t.subscription)==null?void 0:D.recurring})};return r(re,{children:[r("div",{children:[r(w,{variant:"h6",children:[pe," Plan"]}),a&&e(Le,{sx:{mt:3,maxWidth:"200px"}}),C===-1&&e(w,{style:{marginTop:"10px"},children:"Unlimited Storage"}),C===0&&e(w,{sx:{mt:1,fontWeight:600},children:U}),r(I,{container:!0,style:{margin:"20px 0",fontSize:"14px"},children:[e(I,{size:{xs:12,md:4,lg:3},children:r("ul",{style:{margin:0,paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"4px"},children:[((Ht=t.plan)==null?void 0:Ht.plan_name)!=="no-plan"?e("li",{children:Fe()}):e("li",{children:"You have no features associated with your plan."}),(($t=t.plan)==null?void 0:$t.is_sharing_plan)&&e("li",{children:"Unlimited Group & Personal Groups"}),((Vt=t.plan)==null?void 0:Vt.plan_name)!=="no-plan"&&!((Pt=t.plan)!=null&&Pt.is_sharing_plan)&&e("li",{children:"Unlimited Personal Groups"}),((Yt=t.plan)==null?void 0:Yt.is_modify_albums_enabled)&&e("li",{children:"Advanced Album Organization"})]})}),e(I,{size:{xs:12,md:4,lg:3},children:r("ul",{style:{margin:0,paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"4px"},children:[((jt=t.plan)==null?void 0:jt.plan_name)!=="no-plan"&&e("li",{children:"Free Facebook Integration"}),((Qt=t.plan)==null?void 0:Qt.is_image_editor_enabled)&&e("li",{children:"Photo Image Editing"}),((qt=t.plan)==null?void 0:qt.is_video_player_enabled)&&e("li",{children:"Video Playback"})]})})]}),tt&&r(w,{sx:{mt:1,color:"#666"},children:[tt,b!=="No Plan"?r(re,{children:[" ","as the ",e("strong",{children:b}),"."]}):"."]}),h&&e(I,{alignItems:"center",children:e(B,{onClick:Jn,sx:{display:"block",mb:2,p:0},variant:"text",children:"Visit PayPal.com to view or update your payment method"})}),v&&e(w,{style:{paddingTop:10},children:"Your subscription was started via Apple. To update your status or payment method, visit your iCloud subscriptions on your Apple device"}),x&&r(re,{children:[e(B,{"data-testid":"view-or-update-payment-method",onClick:Zn,sx:{display:"block",mb:2,p:0},variant:"text",children:"View or update your payment method"}),r(F,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2},children:[T&&e(B,{color:"error",variant:"outlined","data-testid":"cancel-membership",sx:{width:"fit-content"},onClick:ea,disabled:!!((Kt=t==null?void 0:t.subscription)!=null&&Kt.isCanceled),children:"Cancel Membership"}),!T&&!L&&r(B,{"data-testid":"reactivate-plan",onClick:qn,variant:"contained",sx:{width:"fit-content"},children:["Reactivate ",pe," Plan"]}),T&&e(B,{"data-testid":"upgrade-or-change-plan",onClick:n,variant:"contained",sx:{width:"fit-content"},children:S?"Manage Subscription":"Upgrade or Change Plan"}),((Zt=t==null?void 0:t.subscription)==null?void 0:Zt.isCanceled)&&e(B,{onClick:n,variant:"contained",sx:{width:"fit-content"},children:"Resubscribe"})]})]})]}),e(Vi,{isOpen:ee,onClose:Pn,userProfile:t,setCancellationReason:ue}),e(Yi,{isOpen:j,onClose:Yn,onContinue:jn,currentPlanName:ne,currentTermEndsAt:O}),e(Pi,{isOpen:Q,onClose:Qn,confirmCancellation:Kn,subscriptionEndDate:R}),e($i,{isOpen:ge,onClose:Xn,planName:be,billingCycle:ye,billingDate:u?i:R})]})}var Z=(function(t){return t[t.CHANGE_PLANS=0]="CHANGE_PLANS",t[t.FREEMIUM=1]="FREEMIUM",t[t.PLAN_DETAILS=2]="PLAN_DETAILS",t})({});function Qi({userProfile:t}){var f,g,l;const a=te("useDummyFileSizeValues"),n=((f=t==null?void 0:t.counters)==null?void 0:f.totalSize)||0,o=(l=(g=t==null?void 0:t.plan)==null?void 0:g.storage_limit)!=null?l:0,s=o>
2=0?ze(o):"Unlimited",c=ze(n),p=n/o*100;return o===0||a?null:e(Ne,{sx:{padding:0},children:r(oe,{sx:{padding:0,display:"block"},children:[o>=0&&e(Le,{"aria-label":"Storage: ".concat(c," of ").concat(s),variant:"determinate",value:n>0?Math.max(1,Math.min(p,100)):0,color:"primary",sx:{height:"12px",borderRadius:"8px",opacity:1}}),r(w,{sx:{mt:"8px",fontWeight:600},children:["Storage: ",c," of ",s]})]})})}const qi=ca(()=>ri(()=>import("./ManagePlansPanel-Y1oWP1C2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70])));function Ki(){var L,R,U,M,H,S,T,j,z,Q,V,ee,ce,K,ue,ge,le,de,be,ye,ie;const[t]=Ra(),a=t.get("view")==="plans",[n,o]=_(a?Z.CHANGE_PLANS:Z.PLAN_DETAILS),s=te("usePlansV2"),{loading:c,data:p,refetch:f}=Ce(Ie),g=p==null?void 0:p.userProfile,{isNoPlan:l,isFreemiumUser:C}=Wn(),b=(U=(R=(L=g==null?void 0:g.plan)==null?void 0:L.plan_name.split("-")[0])==null?void 0:R.toLowerCase())!=null?U:void 0,u=(S=(H=(M=g==null?void 0:g.plan)==null?void 0:M.plan_name.split("-")[1])==null?void 0:H.toLowerCase())!=null?S:void 0,y=Ee(f),{createAlert:i}=ve();(T=W().currentUser)!=null&&T.uid||i("An error occurred. Please refresh the page and try again.","error");const v=(j=g==null?void 0:g.subscription)==null?void 0:j.id,h=Ce(zn,{skip:!v,variables:{subscriptionId:v}}),x=(ee=(V=(Q=(z=h.data)==null?void 0:z.subscriptions.subscription)==null?void 0:Q.recurlySubscription)==null?void 0:V.canceledAt)!=null?ee:void 0,d=(de=(le=(ge=(ue=(K=(ce=h.data)==null?void 0:ce.subscriptions.subscription)==null?void 0:K.recurlySubscription)==null?void 0:ue.pendingChange)==null?void 0:ge.plan)==null?void 0:le.code)!=null?de:void 0,k=(ie=(ye=(be=h.data)==null?void 0:be.subscriptions.subscription)==null?void 0:ye.recurlySubscription)!=null?ie:void 0;J(()=>{x!==void 0&&h.refetch()},[x,h,h.refetch]),J(()=>{const pe=P.debounce(y.current,3e3),Fe=()=>{document.visibilityState==="visible"&&pe()};return document.addEventListener("visibilitychange",Fe),()=>{document.removeEventListener("visibilitychange",Fe)}},[]),J(function(){a&&o(Z.CHANGE_PLANS)},[a]),J(()=>{n!==Z.CHANGE_PLANS&&(l?o(Z.CHANGE_PLANS):C&&o(Z.FREEMIUM))},[l,C,n]),J(()=>()=>{La("This is a premium feature\n- unlock for just $10/month"),Fa("Upgrade Now")},[]);const O=l?"Purchase Plan":"",ne=()=>{o(C?Z.FREEMIUM:Z.PLAN_DETAILS)},Y=()=>{o(Z.CHANGE_PLANS)};return g?r(re,{children:[n!==Z.PLAN_DETAILS&&n!==Z.FREEMIUM&&!l&&r(B,{sx:{mb:2,p:0},onClick:ne,variant:"text",children:[e($n,{sx:{mr:1}})," ",e("strong",{children:"Back"})]}),O&&e(w,{sx:{mb:1},children:e("strong",{children:O})}),n===Z.PLAN_DETAILS&&r(re,{children:[e(F,{sx:{width:"460px",maxWidth:"100%",marginBottom:"24px"},children:e(Qi,{userProfile:g})}),e(ji,{userProfile:g,loading:c,openChangePlan:Y,recurlySubscription:k})]}),n===Z.FREEMIUM&&e(Oi,{userProfile:g,openChangePlan:Y}),n===Z.CHANGE_PLANS&&(s?e(sa,{fallback:e(_e,{}),children:e(qi,{userProfile:g,recurlySubscription:k,pendingPlan:d})}):e(li,{plan:b,planCycle:u,changePlan:!0,pendingPlan:d}))]}):e(_e,{})}const xe=ke(qa)({textTransform:"none","&.MuiButtonBase-root":{justifyContent:"left !important",padding:"16px 24px",minHeight:0,maxWidth:"100%"},"&.Mui-selected":{backgroundColor:he.palette.customViolet[50],border:"none"}});function we({children:t=null,value:a,index:n}){return e(F,{role:"tabpanel",hidden:a!==n,id:"simple-tabpanel-".concat(n),"aria-labelledby":"simple-tab-".concat(n),sx:{flex:1},children:a===n&&e(F,{sx:{p:{xs:"16px",md:"32px"}},children:t})})}const _n="membership",Tn="notifications",qe="profile",An="password",In="linked-accounts",Ln="email",Fn="media";function Zi(){var C,b,u;const t=!!Ma(Na),a=Ba(),n=Ua(),o=Ee(1),s=a.hash.replace("#","")||qe,p=!!((C=W().currentUser)!=null&&C.providerData.find(y=>["google.com","apple.com"].includes(y.providerId)))&&((b=W().currentUser)==null?void 0:b.providerData.length)===1,f=te("isWebNotificationsEnabled"),g=(y,i)=>{o.current+=1,n("".concat(a.pathname,"#").concat(i))},l=()=>{n(-o.current)};return!((u=W().currentUser)!=null&&u.emailVerified)&&!t?e(un,{suppressAppBarUnderGroupsyHeader:!0,children:e(hn,{theme:bn,children:e(za,{})})}):e(un,{suppressAppBarUnderGroupsyHeader:!0,children:r(hn,{theme:bn,children:[e(F,{sx:{borderBottom:"1px solid ".concat(he.palette.customGrey[200]),padding:"8px 16px"},children:e(B,{onClick:l,size:"small",sx:{fontSize:{xs:"0.75rem",sm:"0.875rem"},minWidth:0},children:e($n,{})})}),r(F,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},margin:{xs:"0",md:"0 16px 0 0"},maxWidth:he.breakpoints.values.xl},children:[r(Qa,{value:s,onChange:g,"aria-label":"Settings Tabs",allowScrollButtonsMobile:!0,scrollButtons:!1,orientation:"vertical",TabIndicatorProps:{style:{display:"none"}},sx:{borderRight:{xs:"none",md:"1px solid ".concat(he.palette.customGrey[200])},borderBottom:{xs:"1px solid ".concat(he.palette.customGrey[200]),md:"none"},minHeight:{xs:"auto",md:"100vh"}},children:[e(xe,{icon:e(ui,{}),iconPosition:"start",label:"Profile",value:qe}),f&&e(xe,{icon:e(Ga,{}),iconPosition:"start",label:"Notifications",value:Tn}),e(xe,{icon:e(xi,{}),iconPosition:"start",label:"Membership",value:_n}),e(xe,{icon:e(gi,{}),iconPosition:"start",label:"Media",value:Fn}),!p&&e(xe,{icon:e(bi,{}),iconPosition:"start",label:"Email",value:Ln}),e(xe,{icon:e(yi,{}),iconPosition:"start",label:"Password",value:An}),e(xe,{icon:e(Ci,{}
2),iconPosition:"start",label:"Linked Accounts",value:In})]}),e(we,{value:s,index:qe,children:e(Ai,{})}),f&&e(we,{value:s,index:Tn,children:e(_i,{})}),e(we,{value:s,index:_n,children:e(Ki,{})}),e(we,{value:s,index:Fn,children:e(Si,{})}),e(we,{value:s,index:Ln,children:e(Mi,{})}),e(we,{value:s,index:An,children:e(Ti,{})}),e(we,{value:s,index:In,children:e(ki,{})})]})]})})}function as(){return e(Da,{validFirebaseSession:!0,requireTermsAccepted:!0,children:e(Zi,{})})}export{as 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.