PageSourceSearch

https://notestream.ai/assets/PaymentSuccess-BpD0dX6c.js

js notestream.ai collected 2026-10-05 15:41:09 UTC 3,894 bytes, 1 lines download raw bytes

1import{bL as f,d as j,r as m,j as e,K as y,R as w,c4 as v,L as N,c5 as i,c6 as n,cm as P,ay as k,bV as C,az as S,ar as _,U as E,B as F,i as h}from"./index-Rw18IswJ.js";function I(){const[c]=f(),g=j(),[t,r]=m.useState("loading"),[o,a]=m.useState("");return m.useEffect(()=>{const l=c.get("session_id"),x=c.get("setup")==="true",u=c.get("type")==="subscription",p=c.get("threshold"),b=c.get("amount");if(!l){r("error"),a("No session ID provided");return}(async()=>{try{if(x){const{data:s,error:d}=await h.functions.invoke("verify-auto-reload-setup",{body:{session_id:l,threshold:p||"200",amount:b||"1000"}});if(d)throw new Error(d.message);if(s.success)r("setup_success"),a("Auto-reload has been enabled. Your card will be charged automatically when credits run low.");else throw new Error(s.error||"Setup verification failed")}else{const{data:s,error:d}=await h.functions.invoke("verify-credit-purchase",{body:{session_id:l,type:u?"subscription":void 0}});if(d)throw new Error(d.message);if(u&&s.success)r("subscription_success"),a(s.message||"Pro subscription activated! You now have 30 daily credits.");else if(s.already_processed)r("already_processed"),a("Your credits have already been added to your account.");else if(s.success)r("success"),a("10 credits have been added to your account!");else throw new Error(s.error||"Verification failed")}}catch(s){u?(r("subscription_success"),a("Payment received! Your Pro plan is being activated — credits will appear in a moment.")):x?(r("error"),a(s instanceof Error?s.message:"Failed to verify")):(r("success"),a("Payment received! Your credits will appear in a moment."))}})()},[c]),e.jsxs("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:[e.jsxs(y,{children:[e.jsx("title",{children:"Payment Successful | NoteStreamAI"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),e.jsxs(w,{className:"w-full max-w-md",children:[e.jsxs(v,{className:"text-center",children:[t==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4",children:e.jsx(N,{className:"h-12 w-12 text-primary animate-spin"})}),e.jsx(i,{children:"Processing"}),e.jsx(n,{children:"Please wait while we verify..."})]}),t==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 p-3 rounded-full bg-green-100 dark:bg-green-900/30",children:e.jsx(P,{className:"h-12 w-12 text-green-600 dark:text-green-400"})}),e.jsx(i,{className:"text-green-600 dark:text-green-400",children:"Payment Successful!"}),e.jsx(n,{children:o})]}),t==="subscription_success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 p-3 rounded-full bg-primary/10",children:e.jsx(k,{className:"h-12 w-12 text-primary"})}),e.jsx(i,{className:"text-primary",children:"Welcome to Pro!"}),e.jsx(n,{children:o})]}),t==="setup_success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 p-3 rounded-full bg-green-100 dark:bg-green-900/30",children:e.jsx(C,{className:"h-12 w-12 text-green-600 dark:text-green-400"})}),e.jsx(i,{className:"text-green-600 dark:text-green-400",children:"Auto-Reload Enabled!"}),e.jsx(n,{children:o})]}),t==="already_processed"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 p-3 rounded-full bg-blue-100 dark:bg-blue-900/30",children:e.jsx(S,{className:"h-12 w-12 text-blue-600 dark:text-blue-400"})}),e.jsx(i,{className:"text-blue-600 dark:text-blue-400",children:"Already Processed"}),e.jsx(n,{children:o})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 p-3 rounded-full bg-destructive/10",children:e.jsx(_,{className:"h-12 w-12 text-destructive"})}),e.jsx(i,{className:"text-destructive",children:"Issue Detected"}),e.jsx(n,{children:o})]})]}),e.jsx(E,{className:"text-center",children:t!=="loading"&&e.jsx(F,{onClick:()=>g("/"),className:"w-full",children:"Go to App"})})]})]})}export{I 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.