1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7117],{7117:function(e,t,a){a.d(t,{Z:function(){return g}});var r=a(85893),s=a(67294),n=a(24942),l=a(31767),i=a(91594),o=a(80172),d=a(25086),c=a(67694),m=a(51846),u=a(40645),p=a.n(u),x=a(49240);function h(e){let{size:t=20,className:a=""}=e;return(0,r.jsxs)("div",{style:{width:t,height:t},className:"jsx-4b7c22f7418a7024 "+"inline-flex items-center justify-center ".concat(a),children:[(0,r.jsxs)("div",{style:{width:t,height:t},className:"jsx-4b7c22f7418a7024 relative",children:[(0,r.jsx)("div",{style:{borderRadius:"9999px",boxShadow:"inset 0 0 0 2px rgba(255,69,0,0.1)"},className:"jsx-4b7c22f7418a7024 absolute inset-0 animate-spin-slow",children:(0,r.jsxs)("svg",{viewBox:"0 0 50 50",className:"jsx-4b7c22f7418a7024 w-full h-full text-transparent",children:[(0,r.jsx)("circle",{cx:"25",cy:"25",r:"20",stroke:"rgba(255,69,0,0.15)",strokeWidth:"6",fill:"none",className:"jsx-4b7c22f7418a7024"}),(0,r.jsx)("path",{d:"M47 25a22 22 0 00-9.7-18",stroke:"url(#csG)",strokeWidth:"6",strokeLinecap:"round",fill:"none",className:"jsx-4b7c22f7418a7024"}),(0,r.jsx)("defs",{className:"jsx-4b7c22f7418a7024",children:(0,r.jsxs)("linearGradient",{id:"csG",x1:"0%",x2:"100%",y1:"0%",y2:"0%",className:"jsx-4b7c22f7418a7024",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"#FF4500",className:"jsx-4b7c22f7418a7024"}),(0,r.jsx)("stop",{offset:"100%",stopColor:"#CC3700",className:"jsx-4b7c22f7418a7024"})]})})]})}),(0,r.jsx)("div",{style:{width:t-6,height:t-6,left:3,top:3},className:"jsx-4b7c22f7418a7024 absolute flex items-center justify-center rounded-full bg-white dark:bg-[#272729] shadow-sm",children:(0,r.jsx)(x.Z,{className:"w-3/4 h-3/4",fill:"#FF4500"})})]}),(0,r.jsx)(p(),{id:"4b7c22f7418a7024",children:".animate-spin-slow.jsx-4b7c22f7418a7024{-webkit-animation:spin 1.2s linear infinite;-moz-animation:spin 1.2s linear infinite;-o-animation:spin 1.2s linear infinite;animation:spin 1.2s linear infinite}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{from{-moz-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{from{-o-transform:rotate(0deg);transform:rotate(0deg)}to{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{from{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]})}let f=(0,m.MR)();function g(e){let{isOpen:t,onClose:a,currentPlan:u="free",resumesUsed:p=0,resumesLimit:x=3,initialCouponCode:g=""}=e,{theme:y}=(0,c.F)(),[b,j]=(0,s.useState)(null),[w,v]=(0,s.useState)(null),[N,k]=(0,s.useState)(null),[C,P]=(0,s.useState)(!1),[F,S]=(0,s.useState)(""),[T,D]=(0,s.use
1State)(null),[E,I]=(0,s.useState)(!1),[_,R]=(0,s.useState)("pro");(0,s.useEffect)(()=>{if(!t)return;j(null),v(null),k(null),P(!1);let e=String(g||"").trim().toUpperCase().replace(/\s+/g,"");S(e),D(null),e.length>=3&&(R("pro"),A("pro",e))},[t,g]);let A=async(e,t)=>{let a=String(null!=t?t:F).trim().toUpperCase().replace(/\s+/g,"");if(!a)return D(null),null;if(a.length<3)return v("Coupon code must be at least 3 characters"),null;I(!0),v(null);try{let t=await fetch("/api/stripe/validate-coupon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,plan:e})}),r=await t.json();if(r.valid)return D({code:r.code,discountLabel:r.discountLabel,message:r.message,applyInUpgradeModalOnly:!!r.applyInUpgradeModalOnly}),r.code;return D(null),v(r.error||"Invalid coupon code"),null}catch(e){return D(null),v("Could not validate coupon. Please try again."),null}finally{I(!1)}};(0,s.useEffect)(()=>{if(!t)return;j(null),v(null),k(null),P(!1);let e=String(g||"").trim().toUpperCase().replace(/\s+/g,"");S(e),D(null),e.length>=3&&(R("pro"),A("pro",e))},[t,g]);let U=(e,t)=>{let a={plan:e},r=t||(null==T?void 0:T.code);return r&&(a.couponCode=r),a},O=e=>{let t=(0,m.B7)(e);return(null==t?void 0:t.stripePriceId)||void 0},L=async e=>{if("free"===e){a();return}if(e===u){v("You are already on this plan"),setTimeout(()=>v(null),3e3);return}j(e),P(!0),v(null);try{let t=O(e);!t||t.includes("REPLACE")||t.startsWith("price_");let a=(null==T?void 0:T.code)||null;if(F.trim()&&!a&&!(a=await A(e))){j(null),P(!1);return}let r=await fetch("/api/stripe/create-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U(e,a))});if(202===r.status){let t=r.headers.get("Retry-After"),s=(t?Number(t):3)*1e3;await new Promise(e=>setTimeout(e,s));let n=await fetch("/api/stripe/create-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U(e,a))});if(n.ok){let e=await n.json();if(e.url){sessionStorage.setItem("checkout_initiated",Date.now().toString()),window.location.href=e.url;return}}}if(429===r.status){let e=r.headers.get("Retry-After"),t=e?Number(e):5;v("Too many requests â please wait a few seconds and try again."),k(null),j(null),setTimeout(()=>{P(!1)},1e3*(t||5));return}let s=await r.json();if(r.ok&&s.url){sessionStorage.setItem("checkout_initiated",Date.now().toString()),window.location.href=s.url;return}console.error("Checkout failed:",s),v(s.error||s.message||"Failed to start checkout. Please try again."),j(null),P(!1)}catch(e){console.error("Upgrade error:",e),k(null),v("An error occurred. Please try again."),j(null),P(!1)}};return(0,r.jsx)(n.u,{appear:!0,show:t,as:s.Fragment,children:(0,r.jsxs)(l.Vq,{as:"div",className:"relative z-50",onClose:a,children:[(0,r.jsx)(n.u.Child,{as:s.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 "})}),(0,r.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,r.jsx)(n.u.Child,{as:s.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-150",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,r.jsxs)(l.Vq.Panel,{className:"w-full max-w-4xl transform overflow-hidden rounded-2xl shadow-2xl transition-all ".concat("dark"===y?"bg-[#1A1A1B] border border-[#343536]":"bg-white"),children:[(0,r.jsxs)("div",{className:"relative px-6 py-4 border-b ".concat("dark"===y?"bg-gradient-to-r from-[#E03D00]/20 via-[#CC3700]/20 to-[#E03D00]/20 border-[#343536]":"bg-gradient-to-r from-blue-50 to-[#FFF5F2] border-gray-200"),children:[(0,r.jsx)("button",{onClick:a,className:"absolute top-4 right-4 transition-colors ".concat("dark"===y?"text-[#818384] hover:text-white":"text-gray-400 hover:text-gray-600"),children:(0,r.jsx)(i.Z,{className:"w-5 h-5"})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg ".concat("dark"===y?"bg-gradient-to-br from-[#FF4500] to-blue-600":"bg-gradient-to-br from-blue-500 to-[#E03D00]"),children:(0,r.jsx)(o.Z,{className:"w-5 h-5 text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-bold ".concat("dark"===y?"text-white":"text-gray-900"),children:"Choose Your Plan"}),(0,r.jsx)("p",{className:"text-xs ".concat("dark"===y?"text-[#818384]":"text-gray-600"),children:-1===x?"Unlimited resumes":p>=x?"Unlock unlimited resumes":"".concat(Math.max(0,x-p)," free ").concat(1===Math.max(1,x-p)?"resume":"resumes"," left")})]})]})]}),w&&(0,r.jsx)("div",{className:"mx-6 mt-4 p-3 rounded-lg border ".concat("dark"===y?"bg-red-900/20 border-red-800 text-red-300":"bg-red-50 border-red-200 text-red-800"),children:(0,r.jsx)("p",{className:"text-sm font-medium",children:w})}),(0,r.jsxs)("div",{className:"mx-6 mt-4 p-4 rounded-lg border ".concat("dark"===y?"bg-[#272729]/50 border-[#343536]":"bg-gray-50 border-gray-200"),children:[(0,r.jsx)("p",{className:"text-xs font-semibold mb-2 ".concat("dark"===y?"text-[#D7DADC]":"text-gray-700"),children:"Have a coupon code? Apply here before checkout"}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,r.jsx)("input",{type:"text",value:F,onChange:e=>{S(e.target.value.toUpperCase()),D(null)},placeholder:"e.g. LAUNCH20",className:"flex-1 px-3 py-2 rounded-lg text-sm border ".concat("dark"===y?"bg-[#1A1A1B] border-[#343536] text-white placeholder-[#818384]":"bg-white border-gray-300 text-gray-900"),disabled:C}
1),(0,r.jsxs)("select",{value:_,onChange:e=>R(e.target.value),className:"px-2 py-2 rounded-lg text-sm border ".concat("dark"===y?"bg-[#1A1A1B] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900"),disabled:C,children:[(0,r.jsx)("option",{value:"pro",children:"Pro"}),(0,r.jsx)("option",{value:"enterprise",children:"Enterprise"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>A(_),disabled:E||!F.trim()||C,className:"px-4 py-2 rounded-lg text-sm font-semibold bg-[#FF4500] text-white hover:bg-[#E03D00] disabled:opacity-50",children:E?"Checkingâ¦":"Apply"})]}),T&&(0,r.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,r.jsxs)("p",{className:"text-xs font-medium ".concat("dark"===y?"text-emerald-400":"text-emerald-700"),children:["â ",T.code,": ",T.discountLabel," â will be applied when you click Upgrade"]}),(0,r.jsx)("p",{className:"text-xs ".concat("dark"===y?"text-[#818384]":"text-gray-600"),children:"Click Upgrade on your plan below â your discount is included automatically. Do not re-enter this code on the Stripe payment page."})]}),(0,r.jsx)("p",{className:"mt-2 text-[10px] ".concat("dark"===y?"text-[#818384]":"text-gray-500"),children:"1. Enter code â 2. Apply â 3. Upgrade. The payment page will show your discounted total."})]}),(0,r.jsxs)("div",{className:"p-4 sm:p-6",children:[(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:f.map(e=>{let t=e.id===u,a=b===e.id;return(0,r.jsxs)("div",{className:"relative rounded-xl border-2 p-4 transition-all ".concat(e.popular?"dark"===y?"border-[#FF4500] shadow-lg shadow-[#FF4500]/15":"border-blue-500 shadow-lg shadow-blue-500/10":"dark"===y?"border-[#343536] hover:border-[#343536]":"border-gray-200 hover:border-gray-300"," ").concat(t?"dark"===y?"bg-[#272729]":"bg-blue-50/50":"dark"===y?"bg-[#272729]/20":"bg-white"),children:[e.popular&&(0,r.jsx)("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2",children:(0,r.jsx)("span",{className:"px-3 py-0.5 rounded-full text-[10px] font-bold ".concat("bg-[#FF4500] text-white"),children:"POPULAR"})}),t&&(0,r.jsx)("div",{className:"absolute top-2 right-2",children:(0,r.jsx)(d.Z,{className:"w-4 h-4 text-green-500"})}),(0,r.jsxs)("div",{className:"text-center mb-3",children:[(0,r.jsx)("h3",{className:"text-lg font-bold mb-1 ".concat("dark"===y?"text-white":"text-gray-900"),children:e.name}),(0,r.jsx)("p",{className:"text-xs mb-2 ".concat("dark"===y?"text-[#818384]":"text-gray-500"),children:e.description}),0===e.price?(0,r.jsx)("div",{className:"text-3xl font-bold ".concat("dark"===y?"text-white":"text-gray-900"),children:"Free"}):(0,r.jsxs)("div",{className:"flex items-baseline justify-center gap-1",children:[(0,r.jsx)("span",{className:"text-3xl font-bold ".concat("dark"===y?"text-white":"text-gray-900"),children:e.priceDisplay||"$".concat(e.price)}),(0,r.jsx)("span",{className:"text-xs ".concat("dark"===y?"text-[#818384]":"text-gray-600"),children:"/mo"})]})]}),(0,r.jsx)("button",{onClick:()=>L(e.id),disabled:t||null!==b||C,"aria-disabled":t||null!==b||C,className:"w-full py-2 px-4 rounded-full font-semibold text-sm mb-3 transition-all flex items-center justify-center gap-2 ".concat(t?"dark"===y?"bg-[#343536] text-[#818384] cursor-not-allowed":"bg-gray-200 text-gray-400 cursor-not-allowed":a?"opacity-70 cursor-wait bg-[#FF4500] text-white":null!==b?"opacity-50 cursor-not-allowed bg-[#343536] text-[#818384]":e.popular?"bg-[#FF4500] text-white hover:shadow-lg":"dark"===y?"bg-[#343536] text-white hover:bg-[#343536]":"bg-gray-900 text-white hover:bg-gray-800"),children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h,{size:18}),(0,r.jsx)("span",{className:"ml-2",children:"Processing..."})]}):C&&b===e.id?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h,{size:18}),(0,r.jsx)("span",{className:"ml-2",children:"Redirecting..."})]}):t?"Current Plan":0===e.price?"Free Plan":"Upgrade Now"}),(0,r.jsx)("div",{className:"space-y-1.5",children:e.benefits.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)(d.Z,{className:"w-3.5 h-3.5 text-green-500 flex-shrink-0 mt-0.5"}),(0,r.jsx)("span",{className:"text-xs ".concat("dark"===y?"text-[#D7DADC]":"text-gray-600"),children:e})]},t))})]},e.id)})}),(0,r.jsx)("div",{className:"mt-4 pt-4 border-t flex justify-center ".concat("dark"===y?"border-[#343536]":"border-gray-200"),children:(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm ".concat("dark"===y?"text-[#818384]":"text-gray-600"),children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-green-500",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),(0,r.jsx)("span",{className:"font-medium",children:"Secure â Stripe-verified checkout"})]})})]})]})})})})]})})}},51846:function(e,t,a){a.d(t,{B7:function(){return i},MR:function(){return l},T0:function(){return s},Wr:function(){return n}});var r=a(34155);let s=[{id:"free",name:"Free",description:"Perfect for trying out our AI resume builder",price:{monthly:0,yearly:0,monthlyDisplay:"$0",yearlyDisplay:""},stripePriceIds:{monthly:"",yearly:""},features:[{name:"3 resumes",included:!0},{name:"Basic templates",included:!0},{name:"PDF downloads",included:!0}],limits:{resumeGenerations:3,templates:["ats-professional","ats-modern","ats-minimalist"],downloads:["pdf"]},cta:"Get Started Free"},{id:"pro",name:"Pro",description:"Best for job seekers who want unlimited resumes",price:{monthly:19.99,yearly:0,monthlyDisplay:"$19.99",yearlyDisplay:""},stripePriceIds:{monthly:r.env.NEXT_PUBLIC_STRIPE_PRICE_ID_PRO_MONTHLY||"",yearly:""},features:[{name:"Single user account",included:!0},{name:"Unlimited resume generations",included:!0},{name:"All premium templates",included:!0},{name:"PDF + Word downloads",included:!0},{name:"AI-powered resume analysis",included:!0},{name:"H1B visa job listings",included:!0},{name:"Priority support (email & chat)",included:!0}],limits:{resumeGenerations:-1,templates:["ats-professional","ats-modern","ats-minimalist","ats-executive","ats-technical","ats-creative"],downloads:["pdf","word"]},popular:!0,cta:"Start Pro Trial"},{id:"enterprise",name:"Enterprise",description:"For teams and recruitment agencies",price:{monthly:29.99,yearly:0,monthlyDisplay:"$29.99",
1yearlyDisplay:""},stripePriceIds:{monthly:r.env.NEXT_PUBLIC_STRIPE_PRICE_ID_ENTERPRISE_MONTHLY||"",yearly:""},features:[{name:"All Pro features",included:!0},{name:"3 team seats",included:!0},{name:"Collaborative team workspace",included:!0},{name:"Shared team templates",included:!0},{name:"Unlimited H1B visa job access",included:!0},{name:"Admin & billing dashboard",included:!0},{name:"Dedicated account support",included:!0}],limits:{resumeGenerations:-1,templates:["ats-professional","ats-modern","ats-minimalist","ats-executive","ats-technical","ats-creative"],downloads:["pdf","word"]},cta:"Contact Sales"}],n=e=>{let t=s.find(t=>t.id===e);return(null==t?void 0:t.price.monthly)||0};r.env.STRIPE_PRICE_ID_PRO_MONTHLY,r.env.STRIPE_PRICE_ID_ENTERPRISE_MONTHLY;let l=()=>s.map(e=>{var t;return{id:e.id,name:"enterprise"===e.id?"Team":e.name,description:e.description,price:e.price.monthly,priceDisplay:e.price.monthlyDisplay||"$".concat(e.price.monthly),popular:!!e.popular,benefits:e.features.filter(e=>e.included).map(e=>e.name),stripePriceId:(null===(t=e.stripePriceIds)||void 0===t?void 0:t.monthly)||""}}),i=e=>l().find(t=>t.id===e)}}]);
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.