1import{d as J,q as K,N as Q,v as U,o as l,c as n,a as e,b as u,w as V,j as W,_ as X,l as o,e as m,t as c,F as _,h as S,n as i,k as B,r as g,A as w,b1 as Y}from"./SyGe6PDx.js";const Z={class:"min-h-screen bg-gray-50"},ee={class:"sticky top-0 z-20 border-b border-gray-100 bg-white"},te={class:"mx-auto flex max-w-xl items-center justify-between px-4 py-4"},se={class:"mx-auto max-w-xl space-y-5 px-4 py-5"},oe={key:0,class:"flex items-center gap-3 rounded-2xl border border-amber-200 bg-linear-to-r from-amber-50 to-rose-50 p-4"},ae={class:"flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl bg-linear-to-br from-amber-400 to-rose-400 shadow-[0_4px_14px_rgba(251,191,36,0.4)]"},re={class:"min-w-0 flex-1"},le={class:"text-base font-bold text-gray-900"},ne={class:"text-xs font-medium text-gray-500"},ie={key:1,class:"flex items-center gap-3 rounded-2xl border border-gray-200 bg-white p-4"},de={class:"flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl bg-gray-100"},ce={class:"min-w-0 flex-1"},ue={class:"mt-0.5 text-xs text-gray-500"},me={key:2,class:"flex justify-center py-12"},xe={class:"grid grid-cols-2 gap-3"},be=["onClick"],ge={class:"text-sm font-bold text-gray-900"},pe={class:"grid grid-cols-3 gap-3"},ye=["onClick"],fe={key:0,class:"absolute -top-2.5 right-2 rounded-full bg-emerald-600 px-2.5 py-0.5 text-[10px] font-bold text-white shadow-sm"},he={class:"text-sm font-bold text-gray-900"},ve={class:"mt-1 text-gray-900"},_e={class:"text-xl font-black"},we={key:3,class:"mt-0.5 text-[10px] font-medium text-gray-400 line-through"},ke={class:"grid grid-cols-1 gap-y-3 sm:grid-cols-2 sm:gap-x-4"},Pe={class:"text-sm text-gray-700"},Se=["disabled"],Ne={class:"flex flex-wrap items-center justify-center gap-x-3 gap-y-2"},ze={class:"flex items-center gap-1.5 text-xs font-medium text-gray-500"},Ce={class:"flex flex-wrap items-center justify-center gap-6"},Me={class:"rounded-2xl border border-gray-200 bg-white p-4"},je={class:"space-y-1.5 text-xs leading-relaxed text-gray-600"},Be={class:"flex items-start gap-2"},Re={class:"flex items-start gap-2"},$e={class:"flex items-start gap-2"},Ee=J({__name:"index",setup(Ie){const N=K(),b=g(0),z=g(!0),R=g([]),$=g([]),x=g("premium"),p=g(null),y=g(!1),q=["premium","elite"],C={premium:{label:"Premium",icon:"solar:fire-bold",benefits:["Sem limite de cliques por dia","Anúncio acima dos gratuitos","Card maior com slider","Moderação (até 24h)","1 story por dia","Troca de cidade livremente"]},elite:{label:"Elite",icon:"solar:crown-bold",benefits:["Anúncios no topo","Sem limite de cliques por dia","Personalização do card","Moderação prioritária","4 stories por dia",'Badge "Elite" no perfil']}},M={premium:{solid:"bg-rose-600 border-rose-600 text-white",solidHover:"hover:bg-rose-700",badge:"bg-rose-600",toggle:"border-rose-600 bg-rose-600 text-white",toggleIcon:"text-white",text:"text-rose-600",textSoft:"text-rose-500",check:"text-rose-500",borderSel:"border-rose-500",bgSel:"bg-rose-50/60",ring:"border-rose-500",dot:"bg-rose-500",hoverBorder:"hover:border-rose-200",box:"border-rose-100 bg-rose-50/50"},elite:{solid:"bg-gray-900 border-gray-900 text-white",solidHover:"hover:bg-black",badge:"bg-gray-900",toggle:"border-gray-900 bg-gray-900 text-white",toggleIcon:"text-yellow-300",text:"text-gray-900",textSoft:"text-gray-600",check:"text-gray-800",borderSel:"border-gray-900",bgSel:"bg-gray-50",ring:"border-gray-900",dot:"bg-gray-900",hoverBorder:"hover:border-gray-300",box:"border-gray-200 bg-gray-50"}},T=[{name:"Pix",icon:"simple-icons:pix",color:"text-[#32BCAD]"},{name:"Visa",icon:"logos:visa",color:""},{name:"Mastercard",icon:"logos:mastercard",color:""},{name:"Elo",icon:"logos:elo",color:""}],d=w(()=>M[x.value]),k=w(()=>C[x.value]),f=w(()=>x.value==="elite"?$.value:R.value),P=w(()=>f.value.find(a=>a.id===p.value)),H=w(()=>Number(f.value[0]?.days||0));function I(){const a=f.value,t=a[Math.floor(a.length/2)]||a[0];p.value=t?.id??null}Q(x,I),U(async()=>{await Promise.allSettled([D(),L()])});async function D(){try{const a=await N("/profile/credits/summary");b.value=Number(a?.balance||0)}catch{b.value=0}}async function L(){z.value=!0;try{const[a,t]=await Promise.allSettled([N("/app/plans/premium"),N("/app/plans/elite")]);R.value=a.status==="fulfilled"?a.value.plans||[]:[],$.value=t.status==="fulfilled"?t.value.plans||[]:[],I()}finally{z.value=!1}}
1function h(a){if(!a)return 0;const t=Number(a?.value||0);return!t||b.value<=0?0:Math.min(b.value,Math.floor(t*.5))}function A(a){return a?Math.max(0,Number(a?.value||0)-h(a)):0}function j(a){const t=Number(f.value[0]?.value||0),r=Number(f.value[0]?.days||0);return!t||!r||Number(a?.days)<=r?0:t/r*Number(a.days)}function E(a){const t=j(a);return t?Math.max(0,Math.round((1-Number(a.value)/t)*100)):0}function v(a){return Number(a||0).toFixed(2).replace(".",",")}async function O(){const a=P.value;if(!(!a||y.value)){y.value=!0;try{await Y({path:"/checkout",query:{planId:a.id,type:x.value,days:a.days,credits:h(a)||void 0}})}finally{y.value=!1}}}return(a,t)=>{const r=W,F=X;return l(),n("div",Z,[e("header",ee,[e("div",te,[u(F,{to:"/profile",class:"flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 transition hover:bg-gray-200"},{default:V(()=>[u(r,{name:"solar:arrow-left-linear",size:"20",class:"text-gray-700"})]),_:1}),t[0]||(t[0]=e("p",{class:"text-base font-semibold text-gray-900"},"Escolha seu plano",-1)),t[1]||(t[1]=e("div",{class:"w-10"},null,-1))])]),e("main",se,[o(b)>0?(l(),n("section",oe,[e("div",ae,[u(r,{name:"solar:wallet-money-bold",size:"22",class:"text-white"})]),e("div",re,[t[2]||(t[2]=e("p",{class:"text-[11px] font-semibold uppercase tracking-widest text-amber-700"},"Seu saldo",-1)),e("p",le,[m(c(o(b).toLocaleString("pt-BR"))+" créditos ",1),e("span",ne,"(R$ "+c(v(o(b)))+")",1)]),t[3]||(t[3]=e("p",{class:"mt-0.5 text-[11px] text-gray-500"}," Aplicado automaticamente · até 50% de desconto no plano ",-1))])])):(l(),n("section",ie,[e("div",de,[u(r,{name:"solar:wallet-linear",size:"22",class:"text-gray-400"})]),e("div",ce,[t[6]||(t[6]=e("p",{class:"text-sm font-semibold text-gray-900"},"Você ainda não tem créditos",-1)),e("p",ue,[u(F,{to:"/profile/creditos",class:"font-medium text-amaranth-600 hover:underline"},{default:V(()=>[...t[4]||(t[4]=[m(" Indique amigas ",-1)])]),_:1}),t[5]||(t[5]=m(" pra ganhar desconto nos planos. ",-1))])])])),o(z)?(l(),n("div",me,[u(r,{name:"svg-spinners:ring-resize",size:"28",class:"text-gray-400"})])):(l(),n(_,{key:3},[e("div",xe,[(l(),n(_,null,S(q,s=>e("button",{key:s,type:"button",class:i(["flex items-center justify-center gap-2 rounded-2xl border-2 py-3.5 text-base font-bold transition",o(x)===s?M[s].toggle+" shadow-sm":"border-gray-200 bg-white text-gray-800 hover:border-gray-300"]),onClick:G=>x.value=s},[u(r,{name:C[s].icon,size:"20",class:i(o(x)===s?M[s].toggleIcon:"text-gray-400")},null,8,["name","class"]),m(" "+c(C[s].label),1)],10,be)),64))]),e("p",ge,[t[7]||(t[7]=m(" Escolha o perÃodo do seu plano ",-1)),e("span",{class:i(o(d).text)},c(o(k).label),3)]),e("div",pe,[(l(!0),n(_,null,S(o(f),s=>(l(),n("button",{key:s.id,type:"button",class:i(["relative flex flex-col items-center rounded-2xl border-2 px-2 py-4 text-center transition",o(p)===s.id?o(d).borderSel+" "+o(d).bgSel+" shadow-md":"border-gray-200 bg-white "+o(d).hoverBorder]),onClick:G=>p.value=s.id},[h(s)>0?(l(),n("span",fe," â R$ "+c(v(h(s))),1)):s.days===o(H)?(l(),n("span",{key:1,class:i(["absolute -top-2.5 right-2 rounded-full px-2.5 py-0.5 text-[10px] font-bold text-white shadow-sm",o(d).badge])}," + Popular ",2)):E(s)>0?(l(),n("span",{key:2,class:i(["absolute -top-2.5 right-2 rounded-full px-2.5 py-0.5 text-[10px] font-bold text-white shadow-sm",o(d).badge])}," -"+c(E(s))+"% ",3)):B("",!0),e("span",{class:i(["mb-2.5 flex h-5 w-5 items-center justify-center rounded-full border-2 transition",o(p)===s.id?o(d).ring:"border-gray-300"])},[o(p)===s.id?(l(),n("span",{key:0,class:i(["h-2.5 w-2.5 rounded-full",o(d).dot])},null,2)):B("",!0)],2),e("span",he,c(s.days)+" dias",1),e("span",ve,[t[8]||(t[8]=e("span",{class:"align-top text-[11px] font-medium"},"R$",-1)),e("span",_e,c(v(A(s))),1)]),h(s)>0||j(s)?(l(),n("span",we," R$ "+c(v(h(s)>0?s.value:j(s))),1)):B("",!0),e("span",{class:i(["mt-1 text-[10px] font-semibold",o(d).textSoft])}," R$ "+c(v(s.value/s.days))+"/dia ",3)],10,ye))),128))]),e("div",{class:i(["rounded-2xl border p-5",o(d).box])},[e("p",{class:i(["mb-4 text-sm font-bold",o(d).text])}," Com o "+c(o(k).label)+" você tem: ",3),e("div",ke,[(l(!0),n(_,null,S(o(k).benef
1its,s=>(l(),n("div",{key:s,class:"flex items-center gap-2.5"},[u(r,{name:"solar:check-circle-bold",size:"18",class:i(["shrink-0",o(d).check])},null,8,["class"]),e("span",Pe,c(s),1)]))),128))])],2),e("button",{type:"button",disabled:!o(P)||o(y),class:i(["flex w-full items-center justify-center gap-2 rounded-2xl py-4 text-base font-bold transition active:scale-[0.99] disabled:opacity-60",o(d).solid+" "+o(d).solidHover]),onClick:O},[u(r,{name:o(y)?"eos-icons:bubble-loading":"solar:lock-keyhole-bold",size:"20",class:i(o(y)?"animate-spin":"")},null,8,["name","class"]),m(" Assinar "+c(o(k).label)+" "+c(o(P)?.days)+" dias · R$ "+c(v(A(o(P)))),1)],10,Se),e("div",Ne,[e("div",ze,[u(r,{name:"solar:shield-check-bold",size:"15",class:i(o(d).check)},null,8,["class"]),t[9]||(t[9]=m(" Pagamento 100% seguro ",-1))]),t[10]||(t[10]=e("span",{class:"hidden h-4 w-px bg-gray-200 sm:block"},null,-1)),e("div",Ce,[(l(),n(_,null,S(T,s=>u(r,{key:s.name,name:s.icon,mode:"svg","aria-label":s.name,class:i(["h-3.5 w-auto",s.color])},null,8,["name","aria-label","class"])),64))])]),e("section",Me,[t[14]||(t[14]=e("p",{class:"mb-2 text-sm font-semibold text-gray-900"},"Como funciona o desconto?",-1)),e("ul",je,[e("li",Be,[u(r,{name:"solar:check-circle-bold",size:"14",class:"mt-0.5 shrink-0 text-emerald-500"}),t[11]||(t[11]=e("span",null,[m("Cada crédito vale "),e("strong",null,"R$ 1,00"),m(" de desconto")],-1))]),e("li",Re,[u(r,{name:"solar:check-circle-bold",size:"14",class:"mt-0.5 shrink-0 text-emerald-500"}),t[12]||(t[12]=e("span",null,"O desconto é aplicado automaticamente na compra",-1))]),e("li",$e,[u(r,{name:"solar:check-circle-bold",size:"14",class:"mt-0.5 shrink-0 text-emerald-500"}),t[13]||(t[13]=e("span",null,[m("Máximo de "),e("strong",null,"50%"),m(" do valor do plano em créditos por compra")],-1))])])])],64))])])}}});export{Ee 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.