PageSourceSearch

https://app.tutorcloud.ai/static/js/8313.b5cf22b6.chunk.js

js tutorcloud.ai collected 2026-10-05 15:57:52 UTC 5,117 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[8313],{48313(e,t,s){s.r(t),s.d(t,{default:()=>u});var n=s(9950),r=s(41413),a=s(22875),i=s(18555),o=s(41225),c=s(81326),l=s(44414);const d="tc_paddle_pending_txn";const u=function(){const e=(0,r.Zp)(),[t]=(0,r.ok)(),[s,u]=(0,n.useState)("processing"),[m,h]=(0,n.useState)(""),f=n.useRef(null);null==f.current&&(f.current=(0,c.i)());const p=n.useCallback(()=>{const e=(t.get("method")||"stripe").toLowerCase();let s=t.get("session_id")||t.get("transaction_id")||"";if(!s&&"paddle"===e)try{s=sessionStorage.getItem(d)||""}catch{s=""}return s.trim()||null},[t]),g=n.useCallback(async()=>{const e=t.get("method")||"stripe",s=p(),n=new URLSearchParams({method:e});s&&n.set("session_id",s),n.set("client_ref",f.current);return(await i.default.get(`/payments/confirm-success?${n.toString()}`)).data},[t,p]),x=n.useCallback(()=>{const e=p(),s=(t.get("method")||"stripe").toLowerCase(),n=new URLSearchParams;e&&n.set("session_id",e),s&&n.set("method",s);const r=n.toString();return r?`/student/onboarding/profile-completion?${r}`:"/student/onboarding/profile-completion"},[p,t]),y=n.useCallback((t,s)=>{if("converted"===t&&s){try{sessionStorage.removeItem(d)}catch{}localStorage.setItem("token",s),localStorage.setItem("role","student");const t=(0,o.$)(s);return null!==t&&void 0!==t&&t.userId,u("success"),setTimeout(()=>{e(x(),{replace:!0})},1500),!0}if("completed"===t){try{sessionStorage.removeItem(d)}catch{}return u("success"),setTimeout(()=>{e(x(),{replace:!0})},1500),!0}return!1},[e,x]);return(0,n.useEffect)(()=>{let e=!1;const s=t.get("method")||"stripe";if(!p())return h("Missing session or transaction ID."),void u("error");const n=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!e)try{const e=await g(),{status:r,access_token:a}=e;if(y(r,a))return;if("no_session"===r)return h("Missing session or transaction ID."),void u("error");if("pending"===r){const e="paddle"===s.toLowerCase();return e&&t<10?void setTimeout(()=>n(t+1),2e3):(h(e?"Payment is still processing. Click \u201cCheck again\u201d in a moment, or refresh the page.":"Payment is still processing. Please wait a moment and refresh, or return to payment to try again."),void u("error"))}h("Payment verification failed."),u("error")}catch(i){var r,a;if(e)return;console.error("\u274c [PaymentSuccess] Payment finalization error:",i),h((null===(r=i.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.detail)||i.message||"Payment verification failed"),u("error")}};return n(),()=>{e=!0}},[e,t,g,y,p]),(0,l.jsx)("div",{className:"student-page-shell flex items-center justify-center px-3 py-4 sm:p-6 w-full min-w-0",children:(0,l.jsxs)("div",{className:"max-w-md w-full min-w-0 bg-[var(--card)] rounded-lg shadow-lg p-4 sm:p-8 text-center",children:["processing"===s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.hW,{className:"student-dash-primary-text text-6xl mx-auto mb-4 animate-spin"}),(0,l.jsx)("h1",{className:"text-2xl font-bold student-dash-text mb-2",children:"Processing Payment"}),(0,l.jsx)("p",{className:"student-dash-text-muted",children:"Please wait while we verify your payment..."})]}),"success"===s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"w-20 h-20 bg-green-500 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,l.jsx)(a.A7C,{className:"text-white text-4xl"})}),(0,l.jsx)("h1",{className:"text-2xl font-bold student-dash-text mb-2",children:"Payment Successful!"}),(0,l.jsx)("p",{className:"student-dash-text-muted",children:"Redirecting to profile setup..."})]}),"error"===s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"w-20 h-20 bg-red-500 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,l.jsx)("span",{className:"text-white text-4xl",children:"\u2715"})}),(0,l.jsx)("h1",{className:"text-2xl font-bold student-dash-text mb-2",children:"Payment Verification Failed"}),(0,l.jsx)("p",{className:"student-dash-text-muted mb-4",children:m}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,l.jsx)("button",{onClick:async()=>{u("processing"),h("");try{const e=await g(),{status:t,access_token:s}=e;if(y(t,s))return;h("pending"===t?"Still processing. Wait a moment and click Check again.":e.detail||"Verification failed."),u("error")}catch(s){var e,t;h((null===(e=s.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||s.message||"Verification failed"),u("error")}},className:"student-dash-btn student-dash-btn-primary font-semibold py-2 px-6 rounded-lg transition-colors",children:"Check again"}),(0,l.jsx)("button",{onClick:()=>e("/student/subscription?source=payment_retry"),className:"bg-[var(--muted)] hover:bg-[var(--switch-background)] student-dash-text font-semibold py-2 px-6 rounded-lg transition-colors",children:"Back to options"})]})]})]})})}},81326(e,t,s){function n(){try{if("undefined"!==typeof crypto&&crypto.randomUUID)return crypto.randomUUID()}catch{}return`tc-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}s.d(t,{i:()=>n})}}]);

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.