1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DW0dqk9c.js","./5iPJ5zAh.js","./entry.HMDYej-T.css"])))=>i.map(i=>d[i]); 2import{d as te,A as oe,u as se,y as ae,aq as ie,a1 as ne,f as a,g as e,t as l,e as t,h as m,p as A,q as u,m as U,ar as N,j as B,M,a3 as le,B as Y,x as q,l as E,r as v,_ as L,i as re,c as F,o as s,Q as ce,N as de,v as ue}from"./5iPJ5zAh.js";import{a as pe,u as me}from"./DyNsYqMr.js";import{u as ve}from"./gt3UL5cZ.js";const _e={class:"payment-page"},ye={class:"container"},he={class:"header-section"},fe={class:"subtitle"},be={key:0,class:"loading-container"},ge={class:"loading-spinner"},ke={key:1,class:"error-container"},we={class:"error-content"},Ce={class:"error-text"},Te={class:"error-actions"},Pe={key:0,class:"trial-success-overlay"},xe={class:"trial-activated-card"},Ae={class:"trial-activated-content"},Ee={class:"success-animation"},Re={key:2,class:"payment-content"},Se={class:"left-column"},Ie={class:"details-card"},De={class:"details-grid"},Ve={class:"detail-row"},Ue={class:"detail-value"},Ne={key:0,class:"detail-row"},Be={class:"detail-value"},Me={key:1,class:"detail-row"},Ye={class:"detail-value"},qe={class:"detail-row"},Le={class:"detail-value"},Fe={key:2,class:"detail-row"},He={class:"detail-value"},Oe={key:3,class:"detail-row description-row"},Ke={class:"description-text"},$e={class:"right-column"},je={class:"total-label"},ze={class:"total-amount-wrapper"},Ge={key:0,class:"total-amount total-free"},Qe={key:1,class:"total-amount"},Je={key:2,class:"trial-badge"},We={key:0,class:"promo-code-section"},Xe={class:"promo-code-header-main"},Ze={class:"promo-code-titles"},et={class:"promo-title"},tt={key:0,class:"promo-hint"},ot={key:0,class:"promo-code-body"},st={key:0,class:"promo-input-row"},at=["disabled"],it=["disabled"],nt={key:1},lt={key:1,class:"promo-applied"},rt={class:"promo-applied-info"},ct={class:"promo-applied-details"},dt={class:"promo-code-text"},ut={class:"promo-credits"},pt={key:2,class:"promo-error"},mt={key:3,class:"promo-warning"},vt={class:"terms-checkbox-section"},_t={class:"terms-checkbox-label"},yt={class:"terms-checkbox-text"},ht={class:"actions-container"},ft={class:"secondary-actions"},bt=["disabled"],gt=["disabled"],kt=["disabled"],wt=["disabled"],Ct={class:"info-header"},Tt={class:"info-title"},Pt={key:0,class:"info-list"},xt={key:1,class:"info-list"},At=te({__name:"index",setup(Et){const P=oe(),{user:H}=se(),{validateCode:I,redeemCode:O}=pe(),d=me(),w=v(!0),C=v(!1),_=v(null),h=v(null),f=v(null),D=v(""),R=v(""),b=v(!1),y=v(""),c=v(null),T=v(!1),g=v(!1),S=v(!1),k=v(!0),r=F(()=>c.value?.valid&&!c.value?.already_redeemed_by_account),K=F(()=>{const i=f.value?.trial_info;return i?i.can_redeem_more_trials===!0:!0}),$=()=>{r.value||(k.value=!k.value)},j=()=>{y.value="",c.value=null,k.value=!0,d.clearTrial()};ae(async()=>{try{const i=H.value?.account_id;if(!i){_.value="Account information not found",w.value=!1;return}const o=typeof i=="string"?parseInt(i,10):i;if(isNaN(o)){_.value="Invalid account ID",w.value=!1;return}const{getByAccountId:n}=ie(),p=await n(o);if(f.value=p,p.subscription_status!=="pending_payment"){_.value="Subscription is no longer pending payment",w.value=!1;return}p.plan_info&&(D.value=p.plan_info.display_name||p.plan_info.plan_identifier),p.account&&(R.value=p.account.name);const{getCheckoutSessionData:Z}=ve(),ee=await Z(p.id);if(h.value=ee,d.hydrate(),d.trialCode&&d.validationResult?.valid&&!d.validationResult?.already_redeemed_by_account)y.value=d.trialCode,c.value=d.validationResult,k.value=!0;else if(d.trialCode){const x=await I(d.trialCode);x?.valid&&!x?.already_redeemed_by_account?(y.value=d.trialCode,c.value=x,k.value=!0,d.setTrial(d.trialCode,x,"qr")):d.clearTrial()}}catch(i){console.error("Error loading payment data:",i),_.value="Error loading payment information. Please try again."}finally{w.value=!1}});const z=async()=>{if(!h.value?.checkout_url){_.value="Payment URL not found";return}if(!b.value){_.value="Please accept the Terms and Conditions to proceed";return}try{const i=new Date().toISOString();console.log("â Terms and Conditions accepted at:",i);const{acceptTermsAndConditions:o}=await L(async()=>{const{acceptTermsAndConditions:n}=await import("./DW0dqk9c.js");return{acceptTermsAndConditions:n}},__vite__mapDeps([0,1,2]),import.meta.url);await o(),C.value=!0,typeof window<"u"&&(window.location.href=h.value.checkout_url)}catch(i){console.error("Error accepting terms:",i),_.value="Error accepting terms. Please try again."}},G=()=>{w.value=!0,_.value=null,typeof window<"u"&&window.location.reload()},Q=()=>{P.push("/")},J=()=>{P.push("/")},W=()=>{P.push({path:"/choose-plan",query:{from:"payment"}})},V=async()=>
2{if(y.value.trim())try{T.value=!0,c.value=null;const i=await I(y.value.trim().toUpperCase());i?c.value=i:c.value={valid:!1,message:"Error validating the code. Please try again."}}catch(i){console.error("Error validating trial code:",i),c.value={valid:!1,message:"Error validating the code. Please try again."}}finally{T.value=!1}},X=async()=>{if(!(!y.value.trim()||!c.value?.valid)){if(!b.value){_.value="Please accept the Terms and Conditions to proceed";return}try{g.value=!0;const i=new Date().toISOString();console.log("â
Terms and Conditions accepted at:",i);const{acceptTermsAndConditions:o}=await L(async()=>{const{acceptTermsAndConditions:p}=await import("./DW0dqk9c.js");return{acceptTermsAndConditions:p}},__vite__mapDeps([0,1,2]),import.meta.url);await o(),await O(y.value.trim().toUpperCase())?(d.clearTrial(),typeof window<"u"&&localStorage.removeItem("trial-promotion"),S.value=!0,setTimeout(()=>{P.push("/")},2e3)):(d.clearTrial(),_.value="Error activating the trial. Please try again.")}catch(i){console.error("Error activating trial:",i),d.clearTrial(),_.value="Error activating the trial. Please try again."}finally{g.value=!1}}};return ne(()=>({title:r.value?"Activate Free Trial":"Confirm Payment"})),(i,o)=>{const n=re;return s(),a("div",_e,[e("div",ye,[e("div",he,[o[4]||(o[4]=e("div",{class:"icon-wrapper"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"header-icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})])],-1)),e("h2",null,l(t(r)?"Activate Free Trial":"Confirm Payment"),1),e("p",fe,l(t(r)?"Review your subscription and activate your trialâno payment required.":"Review your subscription details before proceeding to secure payment"),1)]),t(w)?(s(),a("div",be,[e("div",ge,[m(n,{name:"i-heroicons-arrow-path",class:"spinner-icon"})]),o[5]||(o[5]=e("p",{class:"loading-text"},"Preparing payment information...",-1))])):t(_)?(s(),a("div",ke,[e("div",we,[m(n,{name:"i-heroicons-exclamation-triangle",class:"error-icon"}),o[7]||(o[7]=e("h3",{class:"error-title"},"Error loading information",-1)),e("p",Ce,l(t(_)),1),e("div",Te,[e("button",{class:"retry-btn",onClick:G},[m(n,{name:"i-heroicons-arrow-path"}),o[6]||(o[6]=A(" Retry ",-1))]),e("button",{class:"secondary-btn",onClick:J}," Go to Home ")])])])):u("",!0),m(N,{name:"fade-slide"},{default:U(()=>[t(S)?(s(),a("div",Pe,[e("div",xe,[e("div",Ae,[e("div",Ee,[m(n,{name:"i-heroicons-check-circle",class:"success-icon"})]),o[8]||(o[8]=e("h3",{class:"success-title"},"Trial activated successfully!",-1)),o[9]||(o[9]=e("p",{class:"success-message"},"Redirecting to the dashboard...",-1))])])])):u("",!0)]),_:1}),t(h)&&t(f)&&!t(S)?(s(),a("div",Re,[e("div",Se,[e("div",Ie,[o[16]||(o[16]=e("h3",{class:"card-title"},"Subscription Details",-1)),e("div",De,[e("div",Ve,[o[10]||(o[10]=e("span",{class:"detail-label"},"Plan:",-1)),e("span",Ue,l(t(D)),1)]),t(f).plan_info?.monthly_credits?(s(),a("div",Ne,[o[11]||(o[11]=e("span",{class:"detail-label"},"Monthly Credits:",-1)),e("span",Be,l(t(f).plan_info.monthly_credits.toLocaleString()),1)])):u("",!0),t(h).amount_usd?(s(),a("div",Me,[o[12]||(o[12]=e("span",{class:"detail-label"},"Amount:",-1)),e("span",Ye,"$"+l(t(h).amount_usd)+" USD",1)])):u("",!0),e("div",qe,[o[13]||(o[13]=e("span",{class:"detail-label"},"Currency:",-1)),e("span",Le,l(t(h).currency?.toUpperCase()),1)]),o[15]||(o[15]=e("div",{class:"detail-row"},[e("span",{class:"detail-label"},"Status:"),e("span",{class:"status-badge"}," Pending Payment ")],-1)),t(R)?(s(),a("div",Fe,[o[14]||(o[14]=e("span",{class:"detail-label"},"Company:",-1)),e("span",He,l(t(R)),1)])):u("",!0),t(f).plan_info?.description?(s(),a("div",Oe,[e("p",Ke,l(t(f).plan_info.description),1)])):u("",!0)])])]),e("div",$e,[e("div",{class:B(["total-card",{"total-card-free":t(r)}])},[e("span",je,l(t(r)?"Total:":"Total to pay:"),1),e("div",ze,[t(r)?(s(),a("span",Ge,"FREE")):(s(),a("span",Qe,"$"+l(t(h).amount_usd)+" USD",1)),t(r)?(s(),a("span",Je,[m(n,{name:"i-heroicons-gift",class:"trial-badge-icon"}),o[17]||(o[17]=A(" Trial Code Applied ",-1))])):u("",!0)])],2),t(K)?(s(),a("div",We,[e("div",{class:"promo-code-header",onClick:$},[e("div",Xe,[m(n,{name:"i-heroicons-ticket",class:"promo-icon"}
2),e("div",Ze,[e("span",et,l(t(r)?"Trial code applied":"Have a trial code?"),1),t(r)?u("",!0):(s(),a("span",tt," Enter your code below for a free trial (no charge during the trial). "))])]),m(n,{name:t(k)||t(r)?"i-heroicons-chevron-up":"i-heroicons-chevron-down",class:"promo-chevron"},null,8,["name"])]),m(N,{name:"slide-down"},{default:U(()=>[t(k)||t(r)?(s(),a("div",ot,[t(r)?u("",!0):(s(),a("div",st,[M(e("input",{"onUpdate:modelValue":o[0]||(o[0]=p=>Y(y)?y.value=p:null),type:"text",placeholder:"Enter code",class:"promo-input",disabled:t(T),onKeyup:ce(V,["enter"])},null,40,at),[[de,t(y)]]),e("button",{class:"promo-apply-btn",disabled:!t(y).trim()||t(T),onClick:V},[t(T)?(s(),E(n,{key:0,name:"i-heroicons-arrow-path",class:"btn-spinner"})):(s(),a("span",nt,"Apply"))],8,it)])),t(r)?(s(),a("div",lt,[e("div",rt,[m(n,{name:"i-heroicons-check-circle",class:"promo-success-icon"}),e("div",ct,[e("span",dt,l(t(y).toUpperCase()),1),e("span",ut,l(t(c).credits_amount)+" credits",1)])]),e("button",{class:"promo-remove-btn",onClick:j},[m(n,{name:"i-heroicons-x-mark"})])])):u("",!0),t(c)&&!t(c).valid?(s(),a("div",pt,[m(n,{name:"i-heroicons-exclamation-circle",class:"promo-error-icon"}),e("span",null,l(t(c).message),1)])):u("",!0),t(c)?.valid&&t(c)?.already_redeemed_by_account?(s(),a("div",mt,[m(n,{name:"i-heroicons-exclamation-triangle",class:"promo-warning-icon"}),o[18]||(o[18]=e("span",null,"This code has already been used on your account.",-1))])):u("",!0)])):u("",!0)]),_:1})])):u("",!0),e("div",vt,[e("label",_t,[M(e("input",{"onUpdate:modelValue":o[1]||(o[1]=p=>Y(b)?b.value=p:null),type:"checkbox",class:"terms-checkbox-input"},null,512),[[le,t(b)]]),e("span",yt,[o[19]||(o[19]=A(" I have read and agree to the ",-1)),e("a",{href:"https://prospectsinmotion.com/terms-of-use/",target:"_blank",rel:"noopener noreferrer",class:"terms-link",onClick:o[2]||(o[2]=q(()=>{},["stop"]))}," Terms of Use "),o[20]||(o[20]=A(" and ",-1)),e("a",{href:"https://prospectsinmotion.com/privacy/",target:"_blank",rel:"noopener noreferrer",class:"terms-link",onClick:o[3]||(o[3]=q(()=>{},["stop"]))}," Privacy Policy ")])])]),e("div",ht,[e("div",ft,[e("button",{class:"secondary-btn",disabled:t(C)||t(g),onClick:Q}," Cancel ",8,bt),e("button",{type:"button",class:"secondary-btn",disabled:t(C)||t(g),onClick:W}," Change plan ",8,gt)]),t(r)?(s(),a("button",{key:0,class:"primary-btn trial-btn",disabled:!t(b)||t(g),onClick:X},[t(g)?(s(),E(n,{key:0,name:"i-heroicons-arrow-path",class:"btn-spinner"})):(s(),E(n,{key:1,name:"i-heroicons-sparkles",class:"btn-icon"})),e("span",null,l(t(g)?"Activating Trial...":"Activate Free Trial"),1)],8,kt)):(s(),a("button",{key:1,class:"primary-btn",disabled:!t(h)?.checkout_url||t(C)||!t(b),onClick:z},[t(C)?u("",!0):(s(),E(n,{key:0,name:"i-heroicons-lock-closed",class:"btn-icon"})),e("span",null,l(t(C)?"Redirecting...":"Proceed to Secure Payment"),1)],8,wt))]),e("div",{class:B(["info-card",{"info-card-trial":t(r)}])},[e("div",Ct,[m(n,{name:"i-heroicons-information-circle",class:"info-icon"}),e("p",Tt,l(t(r)?"Trial information:":"Important information:"),1)]),t(r)?(s(),a("ul",Pt,[o[21]||(o[21]=e("li",null,"Your trial will be activated immediately",-1)),e("li",null,"You will receive "+l(t(c)?.credits_amount)+" credits to test the platform",1),o[22]||(o[22]=e("li",null,"No payment required for the trial period",-1)),o[23]||(o[23]=e("li",null,"You can upgrade to a paid plan anytime",-1))])):(s(),a("ul",xt,[...o[24]||(o[24]=[e("li",null,"You will be redirected to Stripe to complete the payment securely",-1),e("li",null,"Your subscription will be activated automatically upon payment confirmation",-1),e("li",null,"You will receive a confirmation email once completed",-1),e("li",null,"You can cancel anytime from your dashboard",-1)])]))],2)])])):u("",!0)])])}}}),Dt=ue(At,[["__scopeId","data-v-e0703bd5"]]);export{Dt 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.