1import{r as t,j as e}from"./vendor_radix-OWD_HMmK.js";import{z as y,Q as j,u as v,h as k,p as d,T as S,U as P,e as A,V as C,A as U,L as E}from"./main-CquGK1_H.js";import{A as F}from"./arrow-right-CVOM5MIr.js";import"./vendor_contentful-DwpTcoAT.js";import"./vendor_better-auth-BfOIe3d_.js";import"./vendor_swiper-CtacudXp.js";import"./vendor_gsap-DGRpJ0tQ.js";const B=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],I=y("ShieldCheck",B),L={basic:["Access to a few models","Kling 3.0 & Kling 3.0 Omni","Nano Banana Pro"],pro:["Access to a few models","Access to all features","Unlimited Image generations","Unlimited Nano Banana"],ultimate:["Access to all models","Access to all features","Unlimited Image generations","Unlimited Nano Banana, FLUX.2 Flex, Seedream 4.5","Unlimited Nano Banana Pro"],creator:["Access to all models","Access to all features","Early access to advanced AI features","One more Unlimited Model","Unlimited Image generations","Unlimited Nano Banana, FLUX.2 Flex, Seedream 4.5","Unlimited Nano Banana Pro","Unlimited Seedance 1.5 Pro"]};function z(){const a=j.useSearch(),n=v(),x=t.useRef(!1),m=t.useRef(!1),u=t.useRef(!1),s=k(),p=t.useMemo(()=>"black_friday"in a&&typeof a.black_friday=="string"?a.black_friday:void 0,[a]),l=t.useMemo(()=>"buyCoins"in a&&a.buyCoins==="1",[a]);t.useEffect(()=>{p===void 0||x.current||(d("ModalDesktopPaywall",{locked:!1}),x.current=!0,n({search:r=>({...r,black_friday:void 0}),replace:!0}))},[n,p]);const i=s.data?.user?.subscriptionSlug??"free";if(t.useEffect(()=>{!l||m.current||!s.data||i==="free"||(d("AllCoinsModal"),m.current=!0,n({search:r=>({...r,buyCoins:void 0}),replace:!0}))},[l,n,i,s.data]),t.useEffect(()=>{if(!s.isPending&&!s.data){if(l){if(u.current)return;d("SignInModal",{blocking:!0}),u.current=!0;return}n({to:"/pricing",replace:!0})}},[n,s.isPending,s.data,l]),s.isPending||!s.data)return e.jsx("div",{children:"Loading..."});i==="free"&&n({to:"/pricing"});const b=s.data?.user?.subscriptionName??"Free",h=s.data?.user?.subscriptionPeriod??"",f=L[i.replace(/-ab$/,"")]??[],w=i!=="free",c=s.data?.user?.cancelAtPeriodEnd??!1,g=s.data?.user?.currentPeriodEnd?new Date(s.data.user.currentPeriodEnd):null,{isPastDue:N,url:o}=S();return e.jsxs("div",{className:"mx-auto w-full min-h-full flex flex-col items-center gap-8 max-w-[600px] px-4 py-10 md:py-16",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white",children:"Your Subscription"}),e.jsx("p",{className:"text-white/50 text-sm",children:"Manage your plan and billing"})]}),N&&e.jsxs("a",{href:o??"#",target:"_blank",rel:"noopener noreferrer","aria-disabled":!o,className:A("w-full px-3 py-3 bg-gray-800 rounded-xl flex items-center gap-3 cursor-pointer hover:bg-gray-700 transition-colors",!o&&"opacity-50 pointer-events-none"),children:[e.jsx(P,{className:"w-5 h-5 text-pink-primary shrink-0"}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("span",{className:"text-sm font-semibold leading-tight text-white",children:"Payment failed"}),e.jsx("span",{className:"text-xs text-white/60 leading-tight mt-0.5",children:"Retry now to restore access"})]}),e.jsx("div",{className:"ml-auto h-6 px-2 rounded-md bg-pink-primary flex items-center",children:e.jsx("span",{className:"text-[10px] font-bold text-white uppercase tracking-wide",children:"Retry payment"})})]}),e.jsxs("div",{className:"w-full relative overflow-hidden rounded-2xl",children:[e.jsx("div",{className:"absolute inset-0 rounded-2xl p-[1px]",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.5) 0%, rgba(255,255,255,0.1) 50%, rgba(168,85,247,0.4) 100%)"}}),e.jsxs("div",{className:"relative rounded-2xl p-6 md:p-8",style:{background:"linear-gradient(180deg, rgba(236,72,153,0.08) 0%, rgba(15,17,19,0.98) 100%), #0F1113"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl",style:{background:"linear-gradient(135deg, #ec4899 0%, #f43f5e 100%)",boxShadow:"0 0 24px rgba(236,72,153,0.3)"},children:e.jsx(C,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:b}),h&&e.jsxs("p",{className:"text-sm text-white/40",children:["Billed ",h]})]})]}),e.jsx("span",{className:"px-3 py-1.5 rounded-full text-xs font-bold uppercase tracking-wide text-white",style:{background:c?"#f59e0b":"#FF007A",boxShadow:c?"0 0 16px rgba(245,158,11,0.25)":"0 0 16px rgba(255,0,122,0.25)"},children:c?"Canceling":"Active"})]}),f.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-white/30",children:"Your plan includes"}),e.jsx("div",{className:"grid gap-2.5",children:f.map(r=>e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-white/10 mt-px",children:e.jsx(U,{className:"h-3 w-3 text-white"})}),e.jsx("span",{className:"text-sm text-white/70 leading-5",children:r})]},r))})]})]})]}
1),e.jsxs(E,{to:"/pricing",className:"w-full h-14 rounded-2xl text-base font-bold text-white flex items-center justify-center gap-2.5 transition hover:opacity-90",style:{background:"linear-gradient(135deg, #ec4899 0%, #f43f5e 100%)",boxShadow:"0 6px 24px rgba(236,72,153,0.35), inset 0 -3px rgba(0,0,0,0.2)"},children:["Change Plan",e.jsx(F,{className:"h-5 w-5"})]}),w&&!s.data.user.appUserId&&e.jsx("div",{className:"w-full rounded-2xl border border-white/[0.06] p-5 flex flex-col sm:flex-row sm:items-center gap-4",style:{background:"rgba(255,255,255,0.02)"},children:c&&g?e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-semibold text-white",children:"Subscription ending"}),e.jsxs("p",{className:"text-xs text-white/40",children:["Your subscription will be canceled on"," ",g.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),". You'll keep access until then."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-semibold text-white",children:"Cancel subscription"}),e.jsx("p",{className:"text-xs text-white/40",children:"Switch back to the Free tier."})]}),e.jsx("button",{type:"button",onClick:()=>d("SetDefaultSubscription"),className:"shrink-0 h-10 px-5 rounded-xl text-sm font-medium text-red-400 border border-red-400/20 bg-red-400/5 transition hover:bg-red-400/10 cursor-pointer",children:"Cancel"})]})}),e.jsxs("div",{className:"flex items-center gap-2 text-white/25 text-xs",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx("span",{children:"Payments secured with SSL/TLS encryption"})]})]})}export{z as component};
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.