PageSourceSearch

https://www.skribil.ai/_next/static/chunks/pages/checkout-2b43362b2fae3321.js

js skribil.ai collected 2026-10-05 13:32:29 UTC 9,055 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2222],{57250:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout",function(){return s(44705)}])},83989:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},34016:function(e,t,s){"use strict";s.r(t);var a=s(85893);s(67294);var l=s(41664),r=s.n(l),n=s(83989);t.default=e=>{let{children:t,showCTA:s=!0}=e;return(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100",children:[(0,a.jsx)("header",{className:"bg-white shadow-sm",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("div",{className:"flex justify-between items-center py-4",children:[(0,a.jsx)(r(),{href:"/",className:"text-2xl font-bold text-blue-600",children:"Skribil"}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(r(),{href:"/about",className:"text-gray-600 hover:text-gray-900",children:"About"}),(0,a.jsx)(r(),{href:"/pricing",className:"text-gray-600 hover:text-gray-900",children:"Pricing"})]})]})})}),(0,a.jsx)("main",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:t}),s&&(0,a.jsx)("section",{className:"bg-blue-600 text-white py-16",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto text-center px-4",children:[(0,a.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Transform Your Marketing?"}),(0,a.jsx)("p",{className:"text-xl mb-8 opacity-90",children:"Join thousands of marketers creating better content faster"}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsxs)(r(),{href:"/trial",className:"bg-white text-blue-600 px-8 py-3 rounded-lg font-semibold hover:bg-gray-100 inline-flex items-center justify-center",children:["Start Free Trial ",(0,a.jsx)(n.Z,{className:"ml-2 w-5 h-5"})]})})]})})]})}},44705:function(e,t,s){"use strict";s.r(t);var a=s(85893),l=s(67294),r=s(11163),n=s(2859),i=s(31596),o=s(8267),c=s(86691),d=s(82126),u=s(43832),x=s(15928),m=s(43765),h=s(60641),p=s(83989),b=s(34016),f=s(36197);let y=(0,n.J)("pk_live_51RongPDoFpnm35sXW8MGikMf2RduaBrTEBwfHhPBtb0SWo0JdXwJFAu472xkEuCHGPlU4CzLh41MHpUqKAMzk5aq0013XYKJs7"),g={"pro-monthly":{label:"Monthly Plan",price:"$29/month"},"pro-yearly":{label:"Annual Plan",price:"$25/month, billed annually"},humanizer:{label:"Content Humanizer + Creator",price:"$12/month"}},j=e=>{let{plan:t}=e,s=(0,i.MD)(),n=(0,i.lq)(),b=(0,r.useRouter)(),{applyAuthSession:y}=(0,f.a)(),[j,w]=(0,l.useState)(""),[N,v]=(0,l.useState)(""),[k,C]=(0,l.useState)(""),[S,P]=(0,l.useState)(!1),[_,E]=(0,l.useState)(null),[T,Z]=(0,l.useState)(!1),z=async e=>{if(e.preventDefault(),s&&n&&!T){Z(!0),E(null);try{var a,l,r;let e=await fetch("".concat("https://mcl-backend.vercel.app/api","/auth/checkout/start"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j,email:N,password:k,plan:t})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error((null==t?void 0:t.message)||"Could not start checkout")}let o=await e.json(),c=null==o?void 0:null===(a=o.data)||void 0===a?void 0:a.clientSecret,d=null==o?void 0:null===(l=o.data)||void 0===l?void 0:l.pendingSignupId;if(!c||!d)throw Error("Checkout did not return a client secret");let u=n.getElement(i.NZ);if(!u)throw Error("Card field not initialized");let{error:x,paymentIntent:m}=await s.confirmCardPayment(c,{payment_method:{card:u,billing_details:{name:j,email:N}}});if(x)throw Error(x.message||"Card was declined");if((null==m?void 0:m.status)!=="succeeded")throw Error("Payment did not complete (status: ".concat((null==m?void 0:m.status)||"unknown",")"));let h=await fetch("".concat("https://mcl-backend.vercel.app/api","/auth/checkout/finalize"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pendingSignupId:d})});if(!h.ok){let e=await h.json().catch(()=>({}));throw Error((null==e?void 0:e.message)||"Could not finalize signup")}let p=await h.json();y({token:p.token,refreshToken:p.refreshToken,user:null==p?void 0:null===(r=p.data)||void 0===r?void 0:r.user}),b.push("/"),await new Promise(e=>setTimeout(e,400)),window.location.reload()}catch(e){E((null==e?void 0:e.message)||"Something went wrong")}finally{Z(!1)}}};return(0,a.jsxs)("form",{onSubmit:z,className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Full Name"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(o.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,a.jsx)("input",{id:"name",type:"text",value:j,onChange:e=>w(e.target.value),className:"w-full pl-12 pr-4 py-3 border border-gray-300 rounded-xl shadow-sm focus:ring-blue-500 focus:border-blue-500",required:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(c.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,a.jsx)("input",{id:"email",type:"email",value:N,onChange:e=>v(e.target.value),className:"w-full pl-12 pr-4 py-3 border border-gray-300 rounded-xl shadow-sm focus:ring-blue-500 focus:border-blue-500",required:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(d.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,a.jsx)("input",{id:"password",type:S?"text":"password",value:k,onChange:e=>C(e.target.value),minLength:6,className:"w-full pl-12 pr-12 py-3 border border-gray-300 rounded-xl shadow-sm focus:ring-blue-500 focus:border-blue-500",required:!0}),(0,a.jsx)("button",{type:"button",onClick:()=>P(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:S?(0,a.jsx)(u.Z,{className:"w-5 h-5"}):(0,a.jsx)(x.Z,{className:"w-5 h-5"})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Card Details"}),(0,a.jsx)("div",{className:"px-3 py-3 border border-gray-300 rounded-xl focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500",children:(0,a.jsx)(i.NZ,{options:{style:{base
1:{fontSize:"16px",color:"#1f2937",fontFamily:"system-ui, -apple-system, sans-serif","::placeholder":{color:"#9ca3af"}},invalid:{color:"#dc2626",iconColor:"#dc2626"}}}})})]}),_&&(0,a.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 flex items-center space-x-2",children:[(0,a.jsx)(m.Z,{className:"w-5 h-5 text-red-600 flex-shrink-0"}),(0,a.jsx)("p",{className:"text-red-800 text-sm",children:_})]}),(0,a.jsx)("button",{type:"submit",disabled:!s||T,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed text-white font-semibold py-4 rounded-xl transition text-lg flex items-center justify-center",children:T?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Z,{className:"w-5 h-5 animate-spin mr-2"})," Processing…"]}):(0,a.jsxs)(a.Fragment,{children:["Subscribe — ",g[t].price," ",(0,a.jsx)(p.Z,{className:"ml-2 w-5 h-5"})]})}),(0,a.jsx)("p",{className:"text-center text-xs text-gray-500",children:"Your account is created only after payment succeeds. You can cancel anytime."})]})};t.default=()=>{let e=(0,r.useRouter)(),t=e.query.plan;if(!e.isReady)return(0,a.jsx)(b.default,{showCTA:!1,children:(0,a.jsx)("div",{className:"text-center py-20 text-gray-500",children:"Loading…"})});if(!("pro-monthly"===t||"pro-yearly"===t||"humanizer"===t))return(0,a.jsx)(b.default,{showCTA:!1,children:(0,a.jsxs)("div",{className:"max-w-xl mx-auto text-center space-y-4 py-16",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Pick a plan first"}),(0,a.jsx)("p",{className:"text-gray-600",children:"Head over to pricing and choose the plan you want."}),(0,a.jsxs)("button",{onClick:()=>e.push("/pricing"),className:"inline-flex items-center px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold",children:["See pricing ",(0,a.jsx)(p.Z,{className:"ml-2 w-4 h-4"})]})]})});let s=g[t];return(0,a.jsx)(b.default,{showCTA:!1,children:(0,a.jsxs)("div",{className:"max-w-2xl mx-auto space-y-8",children:[(0,a.jsxs)("div",{className:"text-center space-y-3",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold text-gray-900",children:"Get Started"}),(0,a.jsxs)("p",{className:"text-gray-600",children:["You're subscribing to ",(0,a.jsx)("span",{className:"font-semibold",children:s.label})," — ",s.price]})]}),(0,a.jsx)("div",{className:"bg-white rounded-2xl p-8 shadow-xl border border-gray-100",children:(0,a.jsx)(i.eK,{stripe:y,children:(0,a.jsx)(j,{plan:t})})})]})})}}},function(e){e.O(0,[4836,2888,9774,179],function(){return e(e.s=57250)}),_N_E=e.O()}]);

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.