PageSourceSearch

https://recipefix.app/assets/Account-DfYGuFik.js

js recipefix.app collected 2026-10-02 00:43:14 UTC 42,601 bytes, 9 lines download raw bytes

1import{r as o,j as e,b as tt,L as Q}from"./vendor-react-C-Rhcy9l.js";import{A as Z,P as Ne}from"./AppShell-DLZtuWsT.js";import{u as D,B as i,s as h,c as C,o as ee,i as z,a as st,j as at,aw as rt,Y as nt,h as ae,ax as re,G as L,ay as ke,az as ot,a3 as ne,aA as it,aB as oe,aC as lt,aD as dt,aE as ct}from"./index-Uyq2MISY.js";import{u as ut}from"./useSaveLimit-CAdYK73P.js";import{o as mt,U as Ce,b as pt,v as xt}from"./Navbar-VX_zB2Ux.js";import{D as ft,a as ht,b as bt}from"./dialog-CElMxnZl.js";import{F as gt}from"./limits-Dzy3Zzx1.js";import{L as S,b as ie,a4 as W,a5 as yt,s as de,r as Se,n as Pe,a6 as _e,a7 as Ae,a8 as Re,a9 as Ee,aa as jt,ab as vt,c as wt,a3 as Nt}from"./vendor-icons-DLRaz07-.js";import{B as kt,a as Ct,b as St,c as Pt}from"./bottom-sheet-B9GkhYpz.js";import{p as Oe,a as _t,P as At,S as Rt}from"./pricing-BFvuj6yd.js";import{i as Te}from"./iap-BuRgBJWY.js";import{A as Et}from"./SiteHeaderFrame-D7p_dbGx.js";import{S as Ge}from"./switch-02-XGPF0.js";import{I as Fe}from"./input-Dm-Irctu.js";import{e as Ot,f as Tt,g as Ft}from"./vendor-radix-BbNWnRsY.js";import{r as Lt}from"./recipefix-icon-H8EuKnHi.js";import{ensureSessionForPurchase as zt}from"./iapAuth-D8kGqiTn.js";import{u as Dt}from"./useFoodProfile-D8fG-u1o.js";import{H as Le}from"./HowYouEat-eAZfkDAH.js";import"./vendor-shell-bqSPdd6N.js";import"./Footer-i-0BdJZd.js";import"./seoTitle-B_iRM_id.js";import"./vendor-query-T8ArSuAU.js";import"./vendor-supabase-DqPyHwfE.js";import"./serverNutrition-0oGCVpc2.js";import"./vendor-ui-Bh2wS-nQ.js";import"./localHistoryOwner-CRTJasIC.js";import"./useDialogA11y-B-cDHUW5.js";import"./sheet-XYyCB8K3.js";import"./PlusGate-BlGBRdr8.js";function It(a){return a?new Date(a).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"your renewal date"}const ze=({open:a,onOpenChange:s,renewalDate:r,savedCount:c,planType:l,subscriptionStart:u,onConfirmed:m})=>
1{const[f,p]=o.useState(!1),{toast:N}=D(),P=async()=>{p(!0);try{const{data:j,error:v}=await h.functions.invoke("customer-portal");if(!v&&j?.url){let g=0;u&&(g=Math.floor((Date.now()-new Date(u).getTime())/864e5)),C("billing_portal_opened",{intent:"cancel",plan:l||"unknown",days_as_pro:g}),ee(j.url)}else N({description:"Couldn't open billing portal. Please try again.",variant:"destructive"})}catch{N({description:"Couldn't open billing portal. Please try again.",variant:"destructive"})}finally{p(!1)}};return e.jsx(ft,{open:a,onOpenChange:j=>{f||s(j)},children:e.jsx(ht,{className:"sm:max-w-md destructive-dialog-enter",children:e.jsxs("div",{className:"flex flex-col items-center text-center pt-2",children:[e.jsx(bt,{className:"font-heading text-xl font-semibold text-foreground",children:"Cancel your Plus subscription?"}),e.jsxs("p",{className:"mt-3 font-body text-sm text-muted-foreground leading-relaxed",children:["You'll keep Plus access until ",It(r),". After that you'll have ",gt," free recipe adaptations per month and keep all ",c," saved recipes."]}),e.jsxs("div",{className:"mt-6 flex w-full flex-col gap-2",children:[e.jsx(i,{variant:"hero",className:"w-full rounded-full",onClick:()=>s(!1),children:"Keep My Plus Subscription"}),e.jsx("button",{onClick:P,disabled:f,className:"font-body text-sm text-muted-foreground hover:text-destructive transition-colors py-2",children:f?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),"Opening portal…"]}):"Yes, Cancel"})]})]})})})};function De(a){return a?new Date(a).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"your next renewal"}const Ie=({open:a,onOpenChange:s,renewalDate:r,onConfirmed:c})=>{const[l,u]=o.useState(!1),{toast:m}=D(),f=async()=>{u(!0);try{const{data:p,error:N}=await h.functions.invoke("switch-plan",{body:{new_price_id:Rt.annual}});!N&&p?.success?(C("plan_switched",{from:"monthly",to:"annual"}),m({description:`Switching to annual on ${De(r)}. We'll email you a confirmation.`}),c(),s(!1)):m({description:p?.error||"Couldn't switch plan. Please try again.",variant:"destructive"})}catch{m({description:"Couldn't switch plan. Please try again.",variant:"destructive"})}finally{u(!1)}};return e.jsx(kt,{open:a,onOpenChange:p=>{l||s(p)},preventClose:l,children:e.jsxs("div",{className:"flex flex-col items-center text-center px-6 pt-4 pb-6",children:[e.jsx(Ct,{className:"font-heading text-xl font-semibold text-foreground",children:"Switch to annual billing?"}),e.jsx(St,{children:Te()||z()?e.jsx("p",{className:"mt-3 font-body text-sm text-muted-foreground leading-relaxed",children:"You can change your plan in your Ap
1ple subscription settings."}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"mt-3 font-body text-sm text-muted-foreground leading-relaxed",children:["Your plan will change to ",Oe("annual")," on ",De(r),". No charge today."]}),e.jsxs("p",{className:"mt-2 font-body text-xs text-muted-foreground",children:["Save ",_t(),"%. ",Oe("annual")," instead of $",(At.monthly.amount*12).toFixed(2)]})]})}),e.jsx(Pt,{className:"w-full",children:Te()||z()?e.jsxs("div",{className:"mt-6 flex w-full gap-3",children:[e.jsx(i,{variant:"outline",className:"flex-1 rounded-full",onClick:()=>s(!1),children:"Cancel"}),e.jsx(i,{variant:"hero",className:"flex-1 rounded-full",onClick:()=>{mt(),s(!1)},children:"Manage Subscription"})]}):e.jsxs("div",{className:"mt-6 flex w-full gap-3",children:[e.jsx(i,{variant:"outline",className:"flex-1 rounded-full",onClick:()=>s(!1),disabled:l,children:"Cancel"}),e.jsx(i,{variant:"hero",className:"flex-1 rounded-full",onClick:f,disabled:l,children:l?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),"Switching…"]}):"Confirm Switch"})]})})]})})},Ue=Ot,Me=Tt,Ye=Ft,ce=o.forwardRef(({className:a="",...s},r)=>e.jsx("input",{ref:r,type:"password",...s,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-body text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 "+a}));ce.displayName="PasswordInput";function _(a){return a?new Date(a).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"-"}const $e=({provider:a})=>{const[s,r]=o.useState(""),[c,l]=o.useState(""),[u,m]=o.useState(!1),[f,p]=o.use
1State(""),[N,P]=o.useState(!1),{toast:j}=D(),v=async g=>{if(g.preventDefault(),p(""),P(!1),s.length<8){p("Password must be at least 8 characters");return}if(s!==c){p("Passwords don't match");return}m(!0);try{const{error:k}=await h.auth.updateUser({password:s});if(k)throw k;P(!0),r(""),l(""),j({description:"Password set ✓ You can now sign in with email + password on any device.",duration:5e3})}catch(k){p(k.message||"Failed to set password")}finally{m(!1)}};return N?e.jsxs("div",{className:"mt-2 rounded-lg bg-primary/5 border border-primary/20 p-4",children:[e.jsx("p",{className:"font-body text-sm text-foreground font-medium",children:"Password set successfully"}),e.jsx("p",{className:"mt-1 font-body text-xs text-muted-foreground",children:"You can now sign in with your email and this password on any device, including the iOS app."})]}):e.jsxs("form",{onSubmit:v,className:"mt-3 flex flex-col gap-3",children:[e.jsx("p",{className:"font-body text-xs text-muted-foreground",children:"Set a password so you can also sign in with email + password · useful for signing in on the iOS app."}),e.jsx(ce,{value:s,onChange:g=>r(g.target.value),placeholder:"New password (min 8 characters)",required:!0,minLength:8}),e.jsx(ce,{value:c,onChange:g=>l(g.target.value),placeholder:"Confirm password",required:!0,minLength:8}),f&&e.jsx("p",{className:"font-body text-xs text-destructive",children:f}),e.jsx(i,{type:"submit",variant:"outline",size:"sm",className:"rounded-full w-fit",disabled:u,children:u?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),"Setting password…"]}):"Set Password"})]})},le=({children:a})=>e.jsx("div",{className:"overflow-hidden rounded-2xl border border-border bg-card shadow-[var(--shadow-card)] divide-y divide-border",children:a}),A=({icon:a,label:s,onClick:r,destructive:c,loading:l,trailing:u})=>e.jsxs("button",{type:"button",onClick:r,disabled:l,className:"flex w-full items-center gap-3 px-4 py-3 min-h-[48px] text-left transition-colors active:bg-muted/60 hover:bg-muted/40 disabled:opacity-60",children:[e.jsx(a,{size:18,className:c?"text-destructive":"text-primary-readable"}),e.jsx("span",{className:`flex-1 font-body text-[15px] ${c?"text-destructive":"text-foreground"}`,children:s}),l?e.jsx(S,{size:16,className:"animate-spin text-muted-foreground"}):u??e.jsx(de,{size:16,className:"text-muted-foreground/50"})]}),Be=({user:a,embedded:s=!1})=>{const{toast:r}
1=D(),[c,l]=o.useState(""),[u,m]=o.useState(!1),[f,p]=o.useState(!1),[N,P]=o.useState(!1),[j,v]=o.useState(""),[g,k]=o.useState(!1);o.useEffect(()=>{a?.id&&h.from("profiles").select("first_name").eq("user_id",a.id).maybeSingle().then(({data:b})=>{l(b?.first_name??""),m(!0)})},[a?.id]);const V=async()=>{if(!a?.id)return;p(!0);const{error:b}=await h.from("profiles").update({first_name:c.trim()||null,updated_at:new Date().toISOString()}).eq("user_id",a.id);p(!1),r({description:b?"Couldn't save your name. Try again.":"Name saved.",variant:b?"destructive":void 0})},te=async()=>{const b=j.trim();if(!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(b)){r({description:"Enter a valid email address.",variant:"destructive"});return}k(!0);const{data:$,error:B}=await h.functions.invoke("update-email",{body:{email:b}});if(k(!1),B||$?.error){let O=typeof $?.error=="string"?$.error:"";if(!O&&B)try{const E=B.context;E&&typeof E.json=="function"&&(O=(await E.json())?.error??"")}catch{}r({description:O||"Couldn't change your email. Try again.",variant:"destructive"})}else P(!1),v(""),h.auth.refreshSession().catch(()=>{}),r({description:`Email updated to ${b} ✓`,duration:5e3})};return e.jsxs("div",{className:s?"":"mt-4 rounded-xl border border-border bg-card p-5 md:p-6",children:[s?null:e.jsx("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"Profile"}),e.jsxs("div",{className:s?"":"mt-3",children:[e.jsx("label",{className:"font-body text-xs text-muted-foreground",children:"First name"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx(Fe,{value:c,onChange:b=>l(b.target.value.slice(0,60)),placeholder:u?"Add your name":"Loading…",className:"max-w-[240px] font-body text-sm"}),e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:V,disabled:f||!u,children:f?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):"Save"})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{className:"font-body text-xs text-muted-foreground",children:"Email"}),e.jsx("p",{className:"mt-0.5 font-body text-sm text-foreground",children:a?.email}),N?e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx(Fe,{type:"email",value:j,onChange:b=>v(b.target.value),placeholder:"[email protected]",className:"max-w-[240px] font-body text-sm"}),e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:te,disabled:g,children:g?e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"}):"Update email"}),e.jsx("button",{className:"font-body text-xs text-muted-foreground hover:text-foreground",onClick:()=>P(!1),children:"Cancel"})]}):e.jsx("button",{className:"mt-1 font-body text-sm text-primary-readable hover:underline",onClick:()=>P(!0),children:"Change email"})]})]})},qe=({userId:a})=>{const{toast:s}=D(),[r,c]=o.useState(null),l=async()=>{if(!a)return;const{data:m}=await h.from("push_tokens").select("token").limit(1);c((m??[]).length>0)};o.useEffect(()=>{l()},[a]);const u=async m=>{if(m){if(localStorage.setItem("rf-push-asked","1"),!ct()){s({description:"Notifications are available in the iOS app.",variant:"destructive"});return}s({description:"If prompted, tap Allow. If you previously declined, enable notifications in iOS Settings → RecipeFix.",duration:6e3}),setTimeout(l,3e3)}else{if(!a)return;const{error:f}=await h.from("push_tokens").delete().eq("user_id",a).neq("token","");if(f){C("push_optout_failed"),s({description:"Couldn't turn notifications off just now. Please try again.",variant:"destructive"});return}c(!1),C("push_optout"),s({description:"Push notifications turned off for this account."})}};return r!==!0?null:e.jsxs("div",{className:"mt-4 rounded-xl border border-border bg-card p-5 md:p-6",children:[e.jsx("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"Push channel"}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3",children:[e.jsx("p",{className:"font-body text-sm text-muted-foreground",children:"This account has a registered push device. Turn it off here anytime. Cook timer alerts are controlled by iOS when you use a timer."}),e.jsx(Ge,{checked:!!r,disabled:r===null,onCheckedChange:u,"aria-label":"Push notifications"})]})]})},He=({userId:a,embedded:s=!1}
1)=>{const{toast:r}=D(),[c,l]=o.useState(null);o.useEffect(()=>{a&&h.from("profiles").select("marketing_emails_opt_in").eq("user_id",a).maybeSingle().then(({data:m})=>l(m?.marketing_emails_opt_in??!1))},[a]);const u=async m=>{if(!a)return;l(m);const{error:f}=await h.from("profiles").update({marketing_emails_opt_in:m,updated_at:new Date().toISOString()}).eq("user_id",a);f&&(l(!m),r({description:"Couldn't update your email preferences.",variant:"destructive"}))};return e.jsxs("div",{className:s?"flex min-h-[58px] items-center justify-between gap-4 px-4 py-3":"mt-4 rounded-xl border border-border bg-card p-5 md:p-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:s?"block font-body text-[14px] font-medium text-foreground":"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:s?"Recipe ideas & updates":"Email Preferences"}),e.jsx("p",{className:s?"mt-0.5 font-body text-[11.5px] leading-snug text-muted-foreground":"mt-2 font-body text-sm text-muted-foreground",children:"Account and billing emails always arrive."})]}),e.jsx(Ge,{checked:!!c,disabled:c===null,onCheckedChange:u,"aria-label":"Marketing emails"})]})},bs=()=>{const a=tt(),{toast:s}=D(),{user:r,isLoading:c}=st(),[l,u]=o.useState(!1),[m,f]=o.useState("new"),[p,N]=o.useState(!1),[P,j]=o.useState(!1),[v,g]=o.useState(!1),[k,V]=o.useState(!1),[te,b]=o.useState(!1),[$,B]=o.useState("signin"),[O,E]=o.useState(!1),I=at(),U=Dt(),[ue,K]=o.useState(!1),me=(()=>{if(!U.isLoaded)return"Loading…";const n=U.profile;if(!n)return"Add diets, goals, targets or foods to avoid";const d=[n.diets.length>0?n.diets.slice(0,3).join(" · "):null,n.objectives.length>0?n.objectives.join(" · "):null,rt(n.targets),n.exclusions.length>0?`avoiding ${n.exclusions.slice(0,2).join(", ")}`:null].filter(Boolean);return d.length>0?d.join(" · "):"Add diets, goals, targets or foods to avoid"})(),[q,pe]=o.useState(null),[We,xe]=o.useState(!1),[Ut,Mt]=o.useState(!1),[fe,he]=o.useState(null);o.useEffect(()=>{document.title="Account · RecipeFix"},[]);const t=nt(r),H=ut(r,t.isPro),be=t.isAdmin;o.useEffect(()=>{if(!r||I)return;(async()=>{const{data:d}=await h.from("referrals").select("referral_code, total_uses, reward_applied, referred_email, status, referred_adaptations_count").eq("referrer_user_id",r.id);if(d&&d.length>0){const y=d[0].referral_code;pe(y);const T=d.reduce((R,et)=>R+(et.total_uses||0),0),F=d.filter(R=>R.reward_applied).length,se=d.filter(R=>R.referred_email);he({totalUses:T,rewardsEarned:F,referrals:se.map(R=>({referred_email:R.referred_email,status:R.status,reward_applied:R.reward_applied,referred_adaptations_count:R.referred_adaptations_count||0}))})}else if(t.isPro){const y=Array.from(crypto.getRandomValues(new Uint8Array(4))).map(F=>F.toString(36).padStart(2,"0")).join("").slice(0,8).toUpperCase(),{error:T}=await h.from("referrals").insert({referrer_user_id:r.id,referrer_email:r.email||"",referral_code:y});T||(pe(y),he({totalUses:0,rewardsEarned:0,referrals:[]}))}})()},[r,t.isPro,I]);const G=q?`https://recipefix.app/?ref=${q}`:"",Ve=async()=>{if(G)try{await navigator.clipboard.writeText(G),xe(!0),C("referral_link_copied"),setTimeout(()=>xe(!1),2e3)}catch{C("referral_link_copy_failed"),s({description:"Couldn't copy automatically — select the link above and copy it.",variant:"destructive"})}},Ke=q?encodeURIComponent(`Hey! I've been using RecipeFix to adapt recipes for my diet and it's genuinely great. Use my link to sign up and you'll get 7 days of Plus free · just create your account and adapt one recipe to unlock it:
2
3${G}`):"",Je=encodeURIComponent("7 days of RecipeFix Plus · on me"),Xe=q?encodeURIComponent(`Hey,
4
5I've been using RecipeFix to adapt recipes for dietary restrictions · it rewrites the whole recipe including instructions in seconds.
6
7Use my link to sign up and you'll get 7 days of Plus completely free. Just create your account and adapt one recipe:
8
9${G}`):"",J=async()=>{if(L()||z()){window.location.href=re;return}g(!0);try{const{data:n,error:d}=await h.functions.invoke("customer-portal");!d&&n?.url?ee(n.url):s({description:"Couldn't open billing portal. Please try again.",variant:"destructive"})}catch{s({description:"Couldn't open billing portal. Please try again.",variant:"destructive"})}finally{g(!1)}},M=()=>{const n=lt({inIosApp:L()||z(),subscriptionSource:t.billingAuthority});n.kind==="apple"?window.location.href=re:n.kind==="web-copy"?s({description:n.message,duration:7e3}):J()},X=async n=>{if(C("upgrade_clicked",{plan:n}),L()||z()){a("/pricing");return}try{const{data:d,error:y}=await h.functions.invoke("create-checkout-session",{body:{plan:n}});!y&&d?.url?ee(d.url):s({description:"Couldn't open checkout. Please try again.",variant:"destructive"})}catch{s({description:"Couldn't open checkout. Please try again.",variant:"destructive"})}},ge=async()=>
9{if(C("apple_restore_clicked",{reason:t.requiresRestore?"ownership_verification":"manual"}),L()){E(!0),s({description:"Restoring purchases…"});let n=!1;const d=F=>{n||(n=!0,window.clearTimeout(T),window.removeEventListener("iap-restore-result",y),E(!1),F&&(oe(),t.refresh()))},y=F=>{const se=F.detail?.verified===!0;d(se)},T=window.setTimeout(()=>{n||(n=!0,window.removeEventListener("iap-restore-result",y),E(!1),s({description:"Restore timed out. Please try again.",variant:"destructive"}))},3e4);window.addEventListener("iap-restore-result",y,{once:!0}),ke();return}if(z()){E(!0),s({description:"Restoring purchases…"});try{const n=await pt();for(const d of n)if((await xt(d.transactionID,d.productID)).success){oe(),await t.refresh(),s({description:"Purchases restored! 🎉"});return}s({description:"No active purchases found."})}catch{s({description:"Couldn't restore. Try again.",variant:"destructive"})}finally{E(!1)}return}s({description:"Restore Purchases is available in RecipeFix on iPhone. Open Account there and tap Restore Purchases.",duration:6500})},ye=async()=>{oe(),await h.auth.signOut(),dt()},je=async()=>{V(!0);try{const{data:n,error:d}=await h.functions.invoke("cancel-trial");!d&&n?.success?(s({description:"Free trial cancelled. You're back on the free plan."}),C("trial_cancelled"),t.refresh()):s({description:d?.message||n?.error||"Couldn't cancel trial. Please try again.",variant:"destructive"})}catch{s({description:"Couldn't cancel trial. Please try again.",variant:"destructive"})}finally{V(!1)}},ve=(n="signin")=>{B(n),b(!0)};if(c)return e.jsx(Z,{title:"Account · RecipeFix",width:"reading",children:e.jsx("div",{"aria-busy":"true"})});const we=r?ae(r):!1;if(!r||we){const n=we&&t.isPro;return e.jsxs(Z,{title:"Account · RecipeFix",width:"reading",children:[!I&&e.jsx(Ne,{title:"Account"}),e.jsxs("div",{className:"flex flex-col items-center rounded-2xl border border-border bg-card px-6 py-8 text-center shadow-[var(--shadow-card)]",children:[e.jsx("img",{src:Lt,alt:"","aria-hidden":"true",className:"mb-4 h-14 w-14 rounded-2xl shadow-[var(--shadow-card)]"}),n?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full bg-primary/15 px-4 py-1.5 font-body text-sm font-semibold text-primary-readable",children:[e.jsx(ie,{size:14})," RecipeFix Plus · Active"]}),e.jsx("p",{className:"mt-2 font-body text-sm text-muted-foreground text-center max-w-[280px]",children:"Subscription managed via Apple ID"}),e.jsx(i,{variant:"outline",className:"mt-4 rounded-full border-primary text-primary-readable hover:bg-primary/5",onClick:()=>ee(re),children:"Manage Subscription →"}),e.jsx("p",{className:"mt-4 font-body text-sm text-muted-foreground text-center max-w-[280px]",children:"Create a free account to sync your recipes across all your devices."})]}):e.jsx("p",{className:"mt-3 font-body text-sm leading-relaxed text-muted-foreground text-center max-w-[300px]",children:"Save recipes to your cookbook, sync across devices, and keep your 5 free adaptations every month."}),e.jsxs("div",{className:"mt-6 flex flex-col items-center gap-3 w-full max-w-[260px]",children:[e.jsx(i,{variant:"hero",size:"lg",className:"w-full rounded-full h-[52px] text-base",onClick:()=>ve("signup"),children:"Create Account"}),e.jsx(i,{variant:"outline",size:"lg",className:"w-full rounded-full h-[52px] text-base",onClick:()=>ve("signin"),children:"Sign In"}),L()&&e.jsxs("button",{className:"mt-2 flex items-center gap-1.5 font-body text-[13px] text-muted-foreground hover:underline",onClick:async()=>{await zt(),ke(),s({title:"Checking for purchases…",description:"Please wait."})},children:[e.jsx(W,{size:12}),"Restore Purchases"]})]})]}),e.jsx(Et,{open:te,onOpenChange:b,defaultTab:$,context:"navbar"})]})}const x=t.subscriptionStatus;t.planType;const w=it({isPro:t.isPro,billingAuthority:t.billingAuthority,planType:t.planType,cancelAtPeriodEnd:t.cancelAtPeriodEnd,renewalDate:t.renew
9alDate,subscriptionEnd:t.subscriptionEnd,grantedUntil:t.grantedUntil}),Y=ot(w.line,_),Qe=()=>{switch(x){case"active":return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-green-100 dark:bg-green-900/20 px-3 py-1 font-body text-xs font-medium text-green-700 dark:text-green-300",children:[e.jsx(ie,{size:14})," Active"]});case"cancelled":return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-amber-100 dark:bg-amber-900/20 px-3 py-1 font-body text-xs font-medium text-amber-700 dark:text-amber-300",children:[e.jsx(vt,{size:14})," Cancels ",_(t.subscriptionEnd)]});case"trialing":return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-3 py-1 font-body text-xs font-medium text-primary-readable",children:[e.jsx(ie,{size:14})," Free Trial"]});case"past_due":return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-red-100 dark:bg-red-900/20 px-3 py-1 font-body text-xs font-medium text-red-700 dark:text-red-300",children:[e.jsx(jt,{size:14})," Payment Failed"]});default:return null}},Ze=()=>e.jsxs("div",{className:"mt-4 rounded-xl p-4 md:p-5 bg-primary/5 dark:bg-primary/10 border border-primary/20",style:{borderRadius:12},children:[e.jsx("span",{className:"font-heading text-base font-bold text-foreground",children:"Refer a Friend"}),e.jsx("p",{className:"mt-1 font-body text-[13px] text-muted-foreground",children:"Give a friend their first month free. Get a free month every time they subscribe."}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx("input",{type:"text",readOnly:!0,value:G,className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 font-body text-base md:text-sm text-foreground select-all","aria-label":"Your referral link",onClick:n=>n.target.select()}),e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full gap-1.5 shrink-0",onClick:Ve,children:We?e.jsxs(e.Fragment,{children:[e.jsx(wt,{size:14}),"Copied! ✓"]}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{size:14}),"Copy Link"]})})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-6",children:[e.jsxs("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:["Friends referred: ",e.jsx("span",{className:"text-foreground",children:fe?.totalUses??0})]}),e.jsxs("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:["Free months earned: ",e.jsx("span",{className:"text-foreground",children:fe?.rewardsEarned??0})]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[e.jsx("a",{href:`https://wa.me/?text=${Ke}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>C("referral_share_opened",{method:"whatsapp"}),className:"inline-flex items-center justify-center h-11 w-11 rounded-full border border-border transition-colors hover:bg-secondary","aria-label":"Share via WhatsApp",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",className:"text-foreground",children:e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),e.jsx("a",{href:`mailto:?subject=${Je}&body=${Xe}`,onClick:()=>C("referral_share_opened",{method:"email"}),className:"inline-flex items-center justify-center h-11 w-11 rounded-full border border-border transition-colors hover:bg-secondary","aria-label":"Share via Email",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-foreground",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]})})]})]});return I?(t.planType,e.jsxs(Z,{title:"Account · RecipeFix",width:"reading",children:[e.jsxs("div",{children:[t.requiresRestore?e.jsx("div",{className:"mb-4 rounded-2xl border border-amber-300/60 bg-amber-50/70 p-4 dark:border-amber-700/50 dark:bg-amber-950/20",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{size:18,className:"mt-0.5 shrink-0 text-amber-700 dark:text-amber-300"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-body text-sm font-semibold text-foreground",children:"Verify your Ap
9p Store purchase"}),e.jsx("p",{className:"mt-1 font-body text-xs leading-relaxed text-muted-foreground",children:"RecipeFix found an older App Store purchase that was linked to more than one legacy RecipeFix account. Restore it on the account you want to keep. This will not charge you again."}),e.jsxs(i,{variant:"outline",size:"sm",className:"mt-3 rounded-full border-amber-400/70 bg-background",disabled:O,onClick:ge,children:[O?e.jsx(S,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):e.jsx(W,{className:"mr-2 h-3.5 w-3.5"}),"Restore Purchases"]})]})]})}):null,e.jsx(Be,{user:r}),e.jsx("div",{className:"mt-4 rounded-xl bg-primary/5 p-5 border border-border border-l-[3px] border-l-primary",children:t.loading?e.jsxs("div",{className:"space-y-3",children:[e.jsx(ne,{className:"h-5 w-32 rounded"}),e.jsx(ne,{className:"h-4 w-48 rounded"}),e.jsx(ne,{className:"h-9 w-40 rounded-full"})]}):t.isPro?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(yt,{size:20,className:"text-primary-readable"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/15 px-3 py-1 font-body text-sm font-semibold text-primary-readable",children:["✓ Plus Plan · ",x==="trialing"?"Free Trial":x==="cancelled"?`Until ${_(t.subscriptionEnd)}`:"Active"]})]}),x==="active"&&(Y||w.manage)&&e.jsxs("div",{className:"mt-4 space-y-3",children:[Y?e.jsx("p",{className:"font-body text-sm text-muted-foreground",children:Y}):null,w.manage?e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:M,children:"Manage Subscription"})}):null,w.cancel?e.jsx("button",{onClick:M,className:"font-body text-[13px] hover:underline transition-colors",style:{color:"hsl(var(--muted-foreground))"},children:"Cancel Subscription"}):null]}),x==="trialing"&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 px-4 py-3",children:e.jsxs("p",{className:"font-body text-sm text-foreground",children:["Your 7-day free trial ends ",_(t.trialEnd),". You won't be charged until then."]})}),e.jsx("button",{onClick:je,disabled:k,className:"font-body text-xs text-muted-foreground hover:text-destructive transition-colors",children:k?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-3 w-3 animate-spin"}),"Cancelling…"]}):"Cancel Free Trial"})]}),x==="cancelled"&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 px-4 py-3",children:e.jsxs("p",{className:"font-body text-sm text-amber-800 dark:text-amber-200",children:["Your Plus access continues until ",_(t.subscriptionEnd),". After that you'll return to the free plan."]})}),e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full",onClick:M,children:"Resubscribe via Apple"})]}),x==="past_due"&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700 px-4 py-3",children:e.jsx("p",{className:"font-body text-sm text-red-800 dark:text-red-200",children:"Your last payment failed. Manage your subscription to restore Plus access."})}),e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full",onClick:M,children:"Manage Subscription"})]})]}):x==="expired"?e.jsxs("div",{children:[e.jsx("p",{className:"font-heading text-lg font-semibold text-foreground",children:"Free Plan"}),e.jsxs("p",{className:"mt-1 font-body text-sm text-muted-foreground",children:["Your Plus plan ended on ",_(t.subscriptionEnd),"."]}),e.jsx(i,{variant:"hero",size:"sm",className:"mt-3 rounded-full",onClick:M,children:"Resubscribe via Apple"})]}):e.jsxs("div",{children:[e.jsx("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"Free Plan"}),e.jsx(i,{variant:"hero",className:"mt-3 w-full rounded-full h-[48px] bg-primary",onClick:()=>a("/pricing"),children:"Upgrade to Plus"})]})}),r&&!ae(r)&&e.jsxs("button",{type:"button",onClick:()=>
9K(!0),className:"group mt-4 flex w-full items-center gap-4 rounded-2xl border border-border bg-card p-5 text-left shadow-[var(--shadow-card)] transition-colors hover:border-primary/30","aria-label":"Edit how you eat",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"How you eat"}),e.jsx("span",{className:"mt-1.5 block line-clamp-2 font-body text-[13.5px] leading-relaxed text-foreground",children:me})]}),e.jsx(de,{size:17,className:"shrink-0 text-muted-foreground/60 transition-transform group-hover:translate-x-0.5"})]}),e.jsx(Le,{open:ue,onOpenChange:K,initial:U.profile,onSave:U.completeOnboarding,from:"account"}),e.jsx(qe,{userId:r?.id}),e.jsx("div",{className:"mt-5",children:e.jsxs(le,{children:[e.jsx(He,{userId:r?.id,embedded:!0}),be&&e.jsx(A,{icon:Se,label:"Admin Dashboard",onClick:()=>a("/admin")}),e.jsx(A,{icon:Pe,label:"How it Works",onClick:()=>a("/?home")}),e.jsx(A,{icon:_e,label:"Share Feedback",onClick:()=>a("/feedback")}),e.jsx(A,{icon:Ae,label:"Contact Support",onClick:()=>{window.location.href="mailto:[email protected]?subject=RecipeFix%20Support"}})]})}),e.jsx("div",{className:"mt-4",children:e.jsxs(le,{children:[e.jsx(A,{icon:W,label:"Restore Purchases",loading:O,onClick:ge}),e.jsx(A,{icon:Re,label:"Sign Out",onClick:ye})]})}),e.jsxs("div",{className:"mt-6 flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"flex items-center justify-center gap-3 font-body text-xs text-muted-foreground",children:[e.jsx(Q,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy Policy"}),e.jsx("span",{children:"·"}),e.jsx(Q,{to:"/terms",className:"hover:text-foreground transition-colors",children:"Terms of Service"})]}),e.jsx(Q,{to:"/delete-account",className:"font-body text-sm text-destructive hover:underline transition-colors",children:"Delete Account"})]})]}),e.jsx(Ce,{open:l,onOpenChange:u,isSignedIn:!!r,context:x==="expired"?"lapsed":x==="cancelled"?"cancelled":"new",savedCount:H.savedCount}
9),e.jsx(ze,{open:p,onOpenChange:N,renewalDate:t.renewalDate||t.subscriptionEnd,savedCount:H.savedCount,planType:t.planType,subscriptionStart:t.subscriptionStart,onConfirmed:()=>{t.refresh(),s({description:`Subscription cancelled. You have Plus access until ${_(t.renewalDate||t.subscriptionEnd)}.`})}}),e.jsx(Ie,{open:P,onOpenChange:j,renewalDate:t.renewalDate||t.subscriptionEnd,onConfirmed:()=>{t.refresh()}})]})):e.jsxs(Z,{title:"Account · RecipeFix",width:"reading",children:[!I&&e.jsx(Ne,{title:"Account"}),e.jsxs("div",{children:[t.requiresRestore?e.jsx("div",{className:"mb-5 rounded-2xl border border-amber-300/60 bg-amber-50/70 p-4 dark:border-amber-700/50 dark:bg-amber-950/20",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{size:18,className:"mt-0.5 shrink-0 text-amber-700 dark:text-amber-300"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-body text-sm font-semibold text-foreground",children:"Verify your App Store purchase"}),e.jsx("p",{className:"mt-1 font-body text-xs leading-relaxed text-muted-foreground",children:"This older App Store purchase needs a fresh StoreKit restore before RecipeFix can safely attach it to this account. Open RecipeFix on your iPhone → Account → Restore Purchases. You will not be charged again."})]})]})}):null,e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 md:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"Plan"}),Qe()]}),e.jsx("p",{className:"mt-2 font-heading text-lg font-semibold text-foreground",children:t.isPro?"RecipeFix Plus":"Free"}),x==="active"&&t.isPro&&(Y||w.manage)&&e.jsxs("div",{className:"mt-4 space-y-3",children:[Y?e.jsx("p",{className:"font-body text-sm text-muted-foreground",children:Y}):null,w.updatePaymentMethod||w.switchToAnnual||w.manage==="apple"?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.updatePaymentMethod?e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:J,disabled:v,children:v?e.jsx(S,{className:"h-4 w-4 animate-spin"}):"Update Payment Method"}):null,w.manage==="apple"?e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:M,children:"Manage Subscription"}):null,w.switchToAnnual?e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full border-primary text-primary-readable hover:bg-primary/5",onClick:()=>j(!0),children:"Switch to Annual"}):null]}):null,w.cancel&&w.manage==="stripe"?e.jsx("button",{onClick:()=>{C("cancel_confirmation_shown"),N(!0)},className:"font-body text-[13px] hover:underline transition-colors",style:{color:"hsl(var(--muted-foreground))"},children:"Cancel Subscription"}):null]}),x==="trialing"&&t.isPro&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 px-4 py-3",children:e.jsxs("p",{className:"font-body text-sm text-foreground",children:["Your 7-day free trial ends ",_(t.trialEnd),". You won't be charged until then."]})}),e.jsx("button",{onClick:je,disabled:k,className:"font-body text-xs text-muted-foreground hover:text-destructive transition-colors",children:k?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-3 w-3 animate-spin"}),"Cancelling…"]}):"Cancel Free Trial"})]}),x==="cancelled"&&t.isPro&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 px-4 py-3",children:e.jsxs("p",{className:"font-body text-sm text-amber-800 dark:text-amber-200",children:["Your Plus access continues until ",_(t.subscriptionEnd),". After that you'll return to the free plan."]})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full",onClick:()=>X(t.planType==="annual"?"annual":"monthly"),children:"Keep Plus, Resubscribe"}),e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:J,disabled:v,children:v?e.jsx(S,{className:"h-4 w-4 animate-spin"}):"Update Payment Method"})]})]}),x==="past_due"&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700 px-4 py-3",children:e.jsx("p",{className:"font-body text-sm text-red-800 dark:text-red-200",children:"Your last payment failed. Update your payment method to restore Plus access."})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full",onClick:J,disabled:v,children:v?e.jsx(S,{className:"h-4 w-4 animate-spin"}):"Update Payment Method"}),e.jsx(i,{variant:"outline",size:"sm",className:"rounded-full",onClick:()=>X("monthly"),children:"Resubscribe"})]})]}),x==="expired"&&!t.isPro&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-muted px-4 py-3",children:e.jsxs("p",{className:"font-body text-sm text-muted-foreground",children:["Your Plus plan ended on ",_(t.subscriptionEnd),". You have ",H.savedCount," saved recipes."]})}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full w-fit",onClick:()=>X("monthly"),children:"Renew Plus, $3.99/month"}),e.jsx("button",{onClick:()=>X("annual"),className:"font-body text-xs text-primary-readable hover:underline",children:"or save with Annual · $27.99/year"})]})]}),x==="none"&&!t.isPro&&e.jsx("div",{className:"mt-4",children:e.jsx(i,{variant:"hero",size:"sm",className:"rounded-full",onClick:()=>a("/pricing"),children:"See Plus"})})]}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-border bg-card p-5 shadow-[var(--shadow-card)] md:p-6",children:[e.jsx("span",{className:"font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"Profile & security"}),e.jsx("div",{className:"mt-4",children:e.jsx(Be,{user:r,embedded:!0})}),!L()&&(()=>{const n=r?.app_metadata?.provider,d=r?.app_metadata?.providers||[],y=n==="apple"||n==="google",T=y&&!d.includes("email");return y||T?e.jsx(Ue,{children:e.jsxs("div",{className:"mt-5 border-t border-border pt-4",children:[e.jsxs("p",{className:"font-body text-[12px] text-muted-foreground",children:["Signed in with ",n==="apple"?"Apple":"Google"]}),e.jsxs(Me,{className:"mt-1.5 flex items-center gap-1.5 font-body text-[13px] font-medium text-primary-readable hover:underline",children:[e.jsx(Ee,{size:13}),"Set a password for email sign-in"]}),e.jsx(Ye,{children:e.jsx($e,{provider:n})})]})}):e.jsx(Ue,{children:e.jsxs("div",{className:"mt-5 border-t border-border pt-4",children:[e.jsxs(Me,{className:"flex items-center gap-1.5 font-body text-[13px] font-medium text-primary-readable hover:underline",children:[e.jsx(Ee,{size:13}),"Set or change password"]}),e.jsx(Ye,{children:e.jsx($e,{provider:"email"})})]})})})()]}),r&&!ae(r)&&e.jsxs("button",{type:"button",onClick:()=>
9K(!0),className:"group mt-4 flex w-full items-center gap-4 rounded-2xl border border-border bg-card p-5 text-left shadow-[var(--shadow-card)] transition-colors hover:border-primary/30 md:p-6","aria-label":"Edit how you eat",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-body text-[11px] font-semibold uppercase tracking-label text-muted-foreground",children:"How you eat"}),e.jsx("span",{className:"mt-1.5 block line-clamp-2 font-body text-[13.5px] leading-relaxed text-foreground",children:me})]}),e.jsx(de,{size:17,className:"shrink-0 text-muted-foreground/60 transition-transform group-hover:translate-x-0.5"})]}),e.jsx(Le,{open:ue,onOpenChange:K,initial:U.profile,onSave:U.completeOnboarding,from:"account"}),(L()||z())&&e.jsx(qe,{userId:r?.id}),!I&&t.isPro&&q?e.jsx(Ze,{}):null,e.jsx("div",{className:"mt-4",children:e.jsxs(le,{children:[e.jsx(He,{userId:r?.id,embedded:!0}),be?e.jsx(A,{icon:Se,label:"Admin Dashboard",onClick:()=>a("/admin")}):null,e.jsx(A,{icon:Pe,label:"How it Works",onClick:()=>a("/?home")}),e.jsx(A,{icon:_e,label:"Share Feedback",onClick:()=>a("/feedback")}),e.jsx(A,{icon:Ae,label:"Contact Support",onClick:()=>{window.location.href="mailto:[email protected]?subject=RecipeFix%20Support"}}),e.jsx(A,{icon:Re,label:"Sign Out",onClick:ye})]})}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx(Q,{to:"/delete-account",className:"font-body text-[13px] text-destructive/80 transition-colors hover:text-destructive hover:underline",children:"Delete Account"})})]}),e.jsx(Ce,{open:l,onOpenChange:u,isSignedIn:!!r,context:x==="expired"?"lapsed":x==="cancelled"?"cancelled":"new",savedCount:H.savedCount}
9),e.jsx(ze,{open:p,onOpenChange:N,renewalDate:t.renewalDate||t.subscriptionEnd,savedCount:H.savedCount,planType:t.planType,subscriptionStart:t.subscriptionStart,onConfirmed:()=>{t.refresh(),s({description:`Subscription cancelled. You have Plus access until ${_(t.renewalDate||t.subscriptionEnd)}.`})}}),e.jsx(Ie,{open:P,onOpenChange:j,renewalDate:t.renewalDate||t.subscriptionEnd,onConfirmed:()=>{t.refresh()}})]})};export{bs 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.