1import{_ as H}from"./CPH0xhOW.js";import{_ as X}from"./D-xi1qpD.js";import{_ as J}from"./DUwFHEwz.js";import{M as K,cd as W,bm as d,b7 as Y,x as l,w as f,u as e,v as q,bE as t,bO as a,B as z,b as P,H as j,bo as D,a_ as V,s as N,aX as Z,c5 as ee,aR as te,bc as i}from"./HqA1Igia.js";import{u as ae}from"./BRHZf1yO.js";import{u as oe}from"./Cg61vMxN.js";import{p as se,e as re,u as ne}from"./CuJ3-vUI.js";import{r as G}from"./Bc-IbRQY.js";import"./YPoh9DPD.js";const ie={key:0,class:"absolute inset-0 bg-cover bg-center bg-no-repeat bg-[url('/login-bg.png')]","aria-hidden":""},le={class:"relative z-10 mx-auto flex min-h-screen max-w-[1040px] flex-col gap-6 px-4 py-8 sm:px-6 lg:px-8"},ce={class:"flex items-center justify-between gap-3"},de={key:0,class:"flex flex-grow items-center justify-center"},ue={class:"flex items-center gap-3 text-sm text-[var(--muted)]"},pe={key:1,class:"flex flex-grow items-center justify-center"},ve={class:"w-full max-w-md rounded-2xl border border-[var(--border)] bg-[var(--surface)] p-6 text-center shadow-[var(--shadow)]"},xe={class:"text-sm text-[var(--text)]"},me={class:"mx-auto max-w-xl text-center"},be={class:"inline-flex items-center gap-2 rounded-full border border-[var(--border)] bg-[var(--accent-soft)] px-3.5 py-1.5"},fe={class:"text-[11px] font-bold uppercase tracking-[0.05em] text-[var(--accent)]"},ge={class:"mt-3 text-2xl font-extrabold tracking-tight text-[var(--text)] sm:text-3xl"},_e={class:"mt-2 text-sm text-[var(--muted)]"},he={class:"mx-auto w-full max-w-2xl"},ye={class:"grid flex-grow grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_380px]"},ke={class:"rounded-2xl border border-[var(--accent)] bg-[var(--surface)] p-6 shadow-[var(--glow)] backdrop-blur-xl"},we={class:"flex items-baseline justify-between gap-3"},Ce={class:"text-2xl font-extrabold tracking-tight text-[var(--text)]"},Pe={class:"text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--subtle)]"},je={key:0,class:"mt-3 text-sm leading-relaxed text-[var(--muted)]"},Ve={class:"flex flex-col gap-2.5"},Ne={class:"text-sm leading-snug text-[var(--muted)]"},Te={class:"mt-6 text-xs text-[var(--subtle)]"},Be={class:"flex flex-col gap-3.5"},Le={class:"text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)]"},Ae=["onClick"],qe={class:"flex items-center gap-3"},ze={class:"block text-sm font-bold text-[var(--text)]"},De={class:"block text-[11px] text-[var(--subtle)]"},Ge={key:0,class:"shrink-0 rounded-full bg-[var(--accent)] px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.04em] text-[var(--on-accent)]"},Oe={class:"mt-auto rounded-2xl border border-[var(--border)] bg-[var(--surface)] p-5"},Se={class:"flex items-baseline justify-between gap-3"},Ue={class:"text-sm text-[var(--muted)]"},Ee={class:"text-2xl font-extrabold tracking-tight text-[var(--text)]"},Ie=["disabled"],Me={key:0,class:"mt-3 text-xs text-[var(--status-danger)]"},Re={class:"mt-3 text-center text-[11px] leading-relaxed text-[var(--subtle)]"},et=K({__name:"confirmar",setup(Fe){const{tn:r}=W(),O=ee(),{logout:S}=oe(),T=ne(),{listarPlanos:U,gerarCheckout:E,formatarPeriodicidade:I,formatarValor:M,calcularValorPorMes:R}=ae(),B=d(!0),g=d(!1),y=d(""),p=d(""),c=d(null),v=d(""),x=d(T.obter()),k=N(()=>x.value?.vertical==="growthify");function L(o){const s=O.query[o],b=Array.isArray(s)?s[0]:s;return typeof b=="string"?b.trim():""}const w=N(()=>[...c.value?.periodicidades||[]].filter(o=>o.ativo!==!1).sort((o,s)=>s.ordem-o.ordem)),m=N(()=>w.value.find(o=>o.periodicidade===v.value)||null);function F(o){return(o.componentes||[]).some(s=>s.tipo==="usuario")}async function _(){T.limparPlano(),await Z("/assinatura/planos",{replace:!0})}Y(async()=>{const o=L("plano")||x.value?.plano||"";if(!o){await _();return}try{const s=x.value?se(x.value.vertical):null,u=(await U(s)).find(C=>C.codigo===o)||null;if(!u||F(u)){await _();return}c.value=u;const h=L("periodicidade"),n=re(h)?h:x.value?.periodicidade||"",A=u.periodicidades.some(C=>C.periodicidade===n);v.value=A?n:w.value[0]?.periodicidade||""}catch{y.value="Não consegui carregar seu plano agora."}finally{B.value=!1}});async function Q(){if(!(!c.value||!m.value)){p.value="",g.value=!0;try{const o=await E(c.value.id,m.value.periodicidade);o.checkoutUrl?window.location.href=o.checkoutUrl:p.value="Não consegui abrir o pagamento. Tente de novo."}catch(o){p.value=o?.response?.data?.message||"Não consegui abrir o pagamento. Tente de novo."}finally{g.value=!1}}}async function $(){await S()}return(o,s)=>{const b=H,u=X,h=J;return i(),l("div",{class:V(["min-h-screen relative overflow-hidden bg-[var(--bg)]",k.value?"mkt-funil":"dark"])},[k.value?f("",!0):(i(),l("div",ie)),s[2]||(s[2]=e("div",{class:"absolute inset-0 bg-[var(--bg)]/94","aria-hidden":""},null,-1)),e("div",le,[e("div",ce,[k.value?(i(),q(b,{key:0,size:"sm",assinatura:!1})):(i(),q(u,{key:1,size:"sm",variant:"dark"})),e("button",{type:"button",class:"text-sm font-medium text-[var(--muted)] transition-colors hover:text-[var(--text)]",onClick:$},t(a(r)("Sair")),1)]),B.value?(i(),l("div",de,[e("div",ue,[s[0]||(s[0]=e("span",{class:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"},null,-1)),z(" "+t(a(r)("Carregando seu planoâ¦")),1)])])):y.value?(i(),l("div",pe,[e("div",ve,[e("p",xe,t(y.value),1),e("button",{type:"button",style:{backgroundImage:"var(--brand-gradient)"},class:"mt-4 inline-flex items-center justify-center rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition duration-200 hover:brightness-110",onClick:_},t(a(r)("Ver todos os planos")),1)])])):c.value?(i(),l(P,{key:2},[e("div",me,[e("span",be,[j(a(G),{class:"h-3.5 w-3.5 text-[var(--accent)]"}),e("span",fe,t(a(r)("Plano escolhido na página de vendas")),1)]),e("h1",ge,t(a(r)("Confirme sua assinatura")),1
1),e("p",_e,t(a(r)("Revise o plano e a periodicidade. O pagamento acontece na Stripe.")),1)]),e("div",he,[j(h,{passo:2,"rotulo-passo2":"Confirmação"})]),e("div",ye,[e("div",ke,[e("div",we,[e("h2",Ce,t(c.value.nome),1),e("span",Pe,t(a(r)("código"))+": "+t(c.value.codigo),1)]),c.value.descricao?(i(),l("p",je,t(c.value.descricao),1)):f("",!0),s[1]||(s[1]=e("div",{class:"my-5 h-px bg-[var(--border)]"},null,-1)),e("div",Ve,[(i(!0),l(P,null,D(c.value.funcionalidades,n=>(i(),l("div",{key:n,class:"flex items-start gap-2.5"},[j(a(G),{class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--accent)]"}),e("span",Ne,t(a(te)(n)),1)]))),128))]),e("p",Te,[z(t(a(r)("Quer comparar com os outros planos?"))+" ",1),e("button",{type:"button",class:"font-semibold text-[var(--accent)] hover:opacity-90",onClick:_},t(a(r)("Ver a grade completa")),1)])]),e("div",Be,[e("span",Le,t(a(r)("Periodicidade")),1),(i(!0),l(P,null,D(w.value,n=>(i(),l("button",{key:n.id,type:"button",class:V(["flex items-center justify-between gap-3 rounded-2xl border p-4 text-left transition duration-200",n.periodicidade===v.value?"border-[var(--accent)] bg-[var(--accent-soft)] shadow-[var(--glow)]":"border-[var(--border)] bg-[var(--surface-2)] hover:border-[var(--accent-ring)]"]),onClick:A=>v.value=n.periodicidade},[e("span",qe,[e("span",{class:V(["h-4 w-4 shrink-0 rounded-full border",n.periodicidade===v.value?"border-[5px] border-[var(--accent)]":"border-[var(--border)]"])},null,2),e("span",null,[e("span",ze,t(a(I)(n.periodicidade)),1),e("span",De,t(a(R)(n.valor,n.periodicidade))+" "+t(a(r)("/mês equivalente")),1)])]),n.desconto_percentual?(i(),l("span",Ge," -"+t(n.desconto_percentual)+"% ",1)):f("",!0)],10,Ae))),128)),e("div",Oe,[e("div",Se,[e("span",Ue,t(a(r)("Total hoje")),1),e("span",Ee,t(m.value?a(M)(m.value.valor):"â"),1)]),e("button",{type:"button",disabled:g.value||!m.value,style:{backgroundImage:"var(--brand-gradient)"},class:"mt-4 inline-flex w-full items-center justify-center rounded-xl px-4 py-3 text-sm font-bold text-white transition duration-200 hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:brightness-100",onClick:Q},t(g.value?a(r)("Gerando pagamentoâ¦"):a(r)("Ir para o pagamento seguro")),9,Ie),p.value?(i(),l("p",Me,t(p.value),1)):f("",!0),e("p",Re,t(a(r)("Cancele quando quiser, sem multas ou taxas adicionais.")),1)])])])],64)):f("",!0)])],2)}}});export{et 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.