PageSourceSearch

https://socialbrilliance.ai/assets/PaymentSuccess-6srxD59u.js

js socialbrilliance.ai collected 2026-10-05 15:07:49 UTC 7,119 bytes, 1 lines download raw bytes

1import{p as U,aa as Y,v as F,w as B,r as a,aK as D,s as L,t as j,aL as I,E as N,j as e,L as M,S as k,F as O,aM as S,at as z,B as t,A as d,Z as G,H as K,aN as _,D as b}from"./index-BRZCj0Re.js";import{d as V}from"./work-context-CpdKjtVO.js";import{l as Z}from"./composer-asset-B2yJNrEH.js";import{C as H}from"./circle-check-BQ6NcKx6.js";import{D as q}from"./download-JWLnTCSD.js";function ee(){const n=U(),[u]=Y(),p=u.get("session_id"),{user:x,loading:T}=F(),{isPremium:h,subscribed:J,founding:w,loading:g}=B(),[f,y]=a.useState(0),C=a.useRef(!1),P=a.useRef(!1),[o]=a.useState(()=>D()),[s,E]=a.useState(null);a.useEffect(()=>{!p||C.current||(C.current=!0,L.functions.invoke("verify-checkout",{body:{sessionId:p}}).then(({data:r,error:l})=>{if(l){console.error("verify-checkout error:",l);return}r&&E(r)}))},[p]),a.useEffect(()=>{if(!(s!=null&&s.isReportPurchase)||!s.reportAccessUrl)return;const r=setTimeout(()=>{window.location.href=s.reportAccessUrl},1200);return()=>clearTimeout(r)},[s==null?void 0:s.isReportPurchase,s==null?void 0:s.reportAccessUrl]),a.useEffect(()=>{b()},[]),a.useEffect(()=>{P.current||!(s!=null&&s.paid)||(P.current=!0,j(N.PAYMENT_SUCCESS,{plan:s.planName??null,is_report_purchase:!!s.isReportPurchase,has_return_context:!!o,...I()}))},[s,o]),a.useEffect(()=>{if(s!=null&&s.isReportPurchase||g||h||f>=5)return;const r=setTimeout(()=>{b(),y(l=>l+1)},3e3);return()=>clearTimeout(r)},[g,h,f,s==null?void 0:s.isReportPurchase]);const c=!!(s!=null&&s.isReportPurchase),i=c?!!(s!=null&&s.paid):h||(s==null?void 0:s.paid);if(T||g)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4 animate-in fade-in duration-500",children:[e.jsx(M,{className:"w-10 h-10 text-primary animate-spin mx-auto"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Confirming your payment…"})]})});const A=(x==null?void 0:x.email)||(s==null?void 0:s.email),v=c?(s==null?void 0:s.planName)||"Full Report Access":(s==null?void 0:s.planName)||(w?"Founding Member":"Premium Subscriber");return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"max-w-lg w-full space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700",children:[e.jsx("div",{className:"flex justify-center",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(H,{className:"w-14 h-14 text-primary"})}),e.jsx("div",{className:"absolute -top-1 -right-1 w-8 h-8 rounded-full bg-accent flex items-center justify-center animate-bounce",children:e.jsx(k,{className:"w-4 h-4 text-accent-foreground"})})]})}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:i?c?"Report Access Ready 🎉":"You're All Set! 🎉":"Processing Payment…"}),e.jsx("p",{className:"text-muted-foreground",children:i?c?"Your private report link is active. Redirecting you now.":"Your premium access is now active. All features are unlocked.":"Your payment is being confirmed. This may take a moment."})]}),i&&e.jsxs("div",{className:"rounded-xl border-2 border-primary/30 bg-card p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:c?e.jsx(O,{className:"w-5 h-5 text-primary"}):w?e.jsx(S,{className:"w-5 h-5 text-primary"}):e.jsx(z,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground",children:v}),A&&e.jsx("p",{className:"text-xs text-muted-foreground",children:A})]}),e.jsx("div",{className:"ml-auto",children:e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-3 py-1 text-xs font-semibold text-primary",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-pulse"}),"Active"]})})]}),e.jsx("div",{className:"h-px bg-border"}),c?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your secure report link has been emailed to you and is ready now."}),s!=null&&s.reportAccessUrl?e.jsxs(t,{className:"w-full gap-2",onClick:()=>window.location.href=s.reportAccessUrl,children:["Open Private Report ",e.jsx(d,{className:"w-4 h-4"})]}
1):null,s!=null&&s.reportPdfUrl?e.jsxs(t,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(s.reportPdfUrl,"_blank","noopener,noreferrer"),children:[e.jsx(q,{className:"w-4 h-4"})," Download PDF"]}):null]}):e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(m,{icon:k,label:"Unlimited AI Posts"}),e.jsx(m,{icon:G,label:"All Premium Tools"}),e.jsx(m,{icon:S,label:"Brand intelligence & Strategy"}),e.jsx(m,{icon:K,label:"Content Calendar"})]})]}),!i&&f>=5&&e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Payment confirmation is taking longer than expected. Don't worry — your access will activate shortly."}),e.jsx(t,{variant:"outline",size:"sm",onClick:()=>{b(),y(0)},children:"Check Again"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:c?e.jsxs(e.Fragment,{children:[e.jsxs(t,{onClick:()=>(s==null?void 0:s.reportAccessUrl)&&(window.location.href=s.reportAccessUrl),className:"w-full gap-2 bg-primary text-primary-foreground",size:"lg",disabled:!(s!=null&&s.reportAccessUrl),children:["Open Full Report ",e.jsx(d,{className:"w-4 h-4"})]}),e.jsx(t,{variant:"outline",onClick:()=>n("/annual-report-2026"),className:"w-full",children:"Back to Report Overview"})]}):e.jsxs(e.Fragment,{children:[o?e.jsxs(t,{onClick:()=>{if(j(N.POST_PAYMENT_STRATEGY_CTA_CLICK,{source:"payment_success",has_return_context:!0,destination:"return_context"}),_(),o.includes("autostart=1")){const r=Z();r&&V(r)}n(o)},className:"w-full gap-2 bg-primary text-primary-foreground",size:"lg",children:["Continue your analysis ",e.jsx(d,{className:"w-4 h-4"})]}):e.jsxs(t,{onClick:()=>{j(N.POST_PAYMENT_STRATEGY_CTA_CLICK,{source:"payment_success",has_return_context:!1,destination:"strategy"}),n("/strategy?source=payment-success")},className:"w-full gap-2 bg-primary text-primary-foreground",size:"lg",children:["Run your first Pro Signal Audit ",e.jsx(d,{className:"w-4 h-4"})]}),!o&&e.jsx(t,{variant:"outline",onClick:()=>n("/composer"),className:"w-full",children:"Improve a post in Composer"}),e.jsx(t,{variant:"ghost",onClick:()=>{_(),n("/dashboard")},className:"w-full",children:"Go to Dashboard"})]})}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Need help? Reach out to support — we're here for you."})]})})}function m({icon:n,label:u}){return e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-secondary/50 px-3 py-2",children:[e.jsx(n,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("span",{className:"text-xs font-medium text-foreground",children:u})]})}export{ee 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.