1import{j as e,L as d}from"./vendor-react-DIA7vK4g.js";import{E as G}from"./EmployeeParceiroLayout-C-RGM9D8.js";import{aX as P,z as _,cv as h,R as T,bc as f,bI as I,bJ as L,bK as M,af as z,a3 as S,e as B,bF as v,H as y,a$ as H,ax as $,b5 as V,at as D}from"./index-DtUVjOr4.js";import{S as o}from"./StatsCard-BOwc7peS.js";import{C as n}from"./clock-x8uDBefL.js";import{G as x,b as p,c as w,a as N}from"./GlowCard-eEGJc4nM.js";import{T as j}from"./trophy-BCwqMM8W.js";import{A as F}from"./award-DEp8WKtM.js";import{G as m}from"./GlowButton-DmpRcAFP.js";import{u as k}from"./useEmployeeReferrals-1CemtFY2.js";import{p as O,H as U}from"./vendor-utils-DWHjTIse.js";import{T as X,a as q,b as C,c as R}from"./tabs-Btg5k50n.js";import{u as J}from"./useIsEmployee-Cwr-rJfu.js";import{u as K}from"./useEmployeeRanking-Bvjaz9Kg.js";import"./vendor-docs-BA9xu9ak.js";import"./parceiro-pontua-simbolo-BHn6Fgkh.js";import"./scroll-area-DFJSP9HM.js";import"./asArray-CTPHXM1A.js";import"./BlurBackground-ClCPgGtR.js";import"./parceiro-pontua-principal-Gg013pNI.js";import"./log-out-CMftDkmm.js";import"./vendor-supabase-_bOAMmkC.js";function Q({stats:s}){return e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(o,{title:"Total de Indicações",value:(s==null?void 0:s.total)||0,icon:P,iconColor:"red"}),e.jsx(o,{title:"Ganhas",value:(s==null?void 0:s.ganhas)||0,icon:_,iconColor:"green"}),e.jsx(o,{title:"Comissão Provisionada",value:h((s==null?void 0:s.comissaoProvisionada)||0),icon:n,iconColor:"gold"}),e.jsx(o,{title:"Comissão Liberada",value:h((s==null?void 0:s.comissaoLiberada)||0),icon:T,iconColor:"green"})]})}function W({ranking:s,currentUserId:l,periodLabel:c}){const i=a=>{switch(a){case 1:return e.jsx(j,{className:"h-5 w-5 text-[hsl(43,96%,56%)]"});case 2:return e.jsx(z,{className:"h-5 w-5 text-white/60"});case 3:return e.jsx(F,{className:"h-5 w-5 text-[hsl(25,95%,53%)]"});default:return e.jsx("span",{className:"w-5 h-5 flex items-center justify-center text-white/40 font-medium",children:a})}},t=a=>{switch(a){case 1:return"bg-gradient-to-r from-[hsla(43,96%,56%,0.15)] to-transparent border-[hsla(43,96%,56%,0.3)]";case 2:return"bg-gradient-to-r from-white/5 to-transparent border-white/20";case 3:return"bg-gradient-to-r from-[hsla(25,95%,53%,0.15)] to-transparent border-[hsla(25,95%,53%,0.3)]";default:return"bg-white/5 border-white/10"}};return e.jsxs(x,{children:[e.jsxs(p,{children:[e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(j,{className:"h-5 w-5 text-[hsl(43,96%,56%)]"}),"Ranking do Trimestre"]}),c&&e.jsx("p",{className:"text-xs text-white/50 mt-1",children:c})]}),e.jsx(N,{className:"space-y-3",children:s.length===0?e.jsx("p",{className:"text-white/50 text-center py-4",children:"Nenhuma indicação ainda neste trimestre"}):s.slice(0,10).map(a=>{var r;return e.jsxs("div",{className:f("flex items-center gap-3 p-3 rounded-xl border transition-all",t(a.ranking),a.employee_id===l&&"ring-2 ring-[hsl(1,100%,50%)]/50"),children:[e.jsx("div",{className:"flex-shrink-0",children:i(a.ranking)}),e.jsxs(I,{className:"h-8 w-8",children:[e.jsx(L,{src:a.avatar_url||void 0}),e.jsx(M,{className:"bg-[hsl(222,47%,20%)] text-white text-xs",children:((r=a.employee_name)==null?void 0:r.charAt(0))||"U"})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:f("text-sm font-medium truncate",a.employee_id===l?"text-[hsl(1,100%,70%)]":"text-white"),children:[a.employee_name,a.employee_id===l&&" (você)"]})}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sm font-bold text-white",children:a.converted_referrals}),e.jsx("p",{className:"text-xs text-white/50",children:"conversões"})]})]},a.employee_id)})})]})}function Y(){const{referrals:s,isLoading:l}=k(),c=t=>{const r={nova:{label:"Nova",className:"bg-white/10 text-white/70 border-white/20",icon:e.jsx(n,{className:"h-3 w-3"})},em_analise:{label:"Em Análise",className:"bg-[hsla(43,96%,56%,0.1)] text-[hsl(43,96%,56%)] border-[hsla(43,96%,56%,0.3)]",icon:e.jsx(n,{className:"h-3 w-3"})},contato_realizado:{label:"Contato Realizado",className:"bg-[hsla(43,96%,56%,0.1)] text-[hsl(43,96%,56%)] border-[hsla(43,96%,56%,0.3)]",icon:e.jsx(n,{className:"h-3 w-3"})},em_negociacao:{label:"Em Negociação",className:"bg-[hsla(222,100%,70%,0.1)] text-[hsl(222,100%,70%)] border-[hsla(222,100%,70%,0.3)]",icon:e.jsx(n,{className:"h-3 w-3"})},cancelada:{label:"Cancelada",className:"bg-[hsla(1,100%,50%,0.1)] text-[hsl(1,100%,60%)] border-[hsla(1,100%,50%,0.3)]",icon:e.jsx(y,{className:"h-3 w-3"})},convertida:{label:"Convertida",className:"bg-[hsla(142,71%,45%,0.1)] text-[hsl(142,71%,45%)] border-[hsla(142,71%,45%,0.3)]",icon:e.jsx(_,{className:"h-3 w-3"})}
1,nao_convertida:{label:"Não Convertida",className:"bg-[hsla(1,100%,50%,0.1)] text-[hsl(1,100%,60%)] border-[hsla(1,100%,50%,0.3)]",icon:e.jsx(y,{className:"h-3 w-3"})}}[t]||{label:t,className:"bg-white/10 text-white/70 border-white/20",icon:null};return e.jsxs(v,{variant:"outline",className:`gap-1 ${r.className}`,children:[r.icon,r.label]})},i=s.slice(0,5);return e.jsxs(x,{children:[e.jsxs(p,{className:"flex flex-row items-center justify-between",children:[e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-5 w-5 text-[hsl(1,100%,50%)]"}),"Indicações Recentes"]}),e.jsx(d,{to:"/parceiro-pontua/colaborador/historico",children:e.jsxs(m,{variant:"ghost",size:"sm",children:["Ver todas",e.jsx(B,{className:"h-4 w-4 ml-2"})]})})]}),e.jsx(N,{children:l?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(t=>e.jsx("div",{className:"h-16 bg-white/5 rounded-xl animate-pulse"},t))}):i.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-white/50 mb-4",children:"Você ainda não fez nenhuma indicação"}),e.jsx(d,{to:"/parceiro-pontua/colaborador/nova-indicacao",children:e.jsx(m,{children:"Fazer primeira indicação"})})]}):e.jsx("div",{className:"space-y-3",children:i.map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-white truncate",children:t.company_name||t.contact_name}),e.jsx(v,{variant:"outline",className:"text-xs border-white/20 text-white/60",children:t.referral_type==="nova"?"Novo":"Migração"})]}),e.jsx("p",{className:"text-xs text-white/50 mt-1",children:O(new Date(t.created_at),"dd 'de' MMM, yyyy",{locale:U})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.commission_value&&t.status==="convertida"&&e.jsx("span",{className:"text-sm font-bold text-[hsl(142,71%,45%)]",children:h(t.commission_value)}),c(t.status)]})]},t.id))})})]})}function Z(){return e.jsxs(x,{children:[e.jsx(p,{children:e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(T,{className:"h-5 w-5 text-[hsl(142,71%,45%)]"}),"Tabela de Comissões"]})}),e.jsx(N,{children:e.jsxs(X,{defaultValue:"nova",className:"w-full",children:[e.jsxs(q,{className:"grid w-full grid-cols-2 bg-white/5 border border-white/10",children:[e.jsxs(C,{value:"nova",className:"data-[state=active]:bg-[hsl(1,100%,50%)] data-[state=active]:text-white text-white/60",children:[e.jsx(H,{className:"h-4 w-4 mr-2"}),"Novo"]}),e.jsxs(C,{value:"migracao",className:"data-[state=active]:bg-[hsl(1,100%,50%)] data-[state=active]:text-white text-white/60",children:[e.jsx($,{className:"h-4 w-4 mr-2"}),"Migração Ponto Remoto"]})]}),e.jsxs(R,{value:"nova",className:"mt-4 space-y-2",children:[e.jsxs("div",{className:"p-3 rounded-xl bg-white/5 border border-white/10 flex justify-between items-center",children:[e.jsx("span",{className:"text-white/70",children:"Até R$ 300,00"}),e.jsx("span",{className:"font-bold text-[hsl(142,71%,45%)]",children:"R$ 180,00"})]}),e.jsxs("div",{className:"p-3 rounded-xl bg-white/5 border border-white/10 flex justify-between items-center",children:[e.jsx("span",{className:"text-white/70",children:"R$ 300,01 a R$ 499,00"}),e.jsx("span",{className:"font-bold text-[hsl(142,71%,45%)]",children:"R$ 300,00"})]}),e.jsxs("div",{className:"p-3 rounded-xl bg-[hsla(1,100%,50%,0.1)] border border-[hsla(1,100%,50%,0.3)] flex justify-between items-center",children:[e.jsx("span",{className:"text-white",children:"Acima de R$ 500,00"}),e.jsx("span",{className:"font-bold text-[hsl(1,100%,60%)]",children:"R$ 380,00"})]})]}),e.jsxs(R,{value:"migracao",className:"mt-4 space-y-2",children:[e.jsxs("div",{className:"p-3 rounded-xl bg-white/5 border border-white/10 flex justify-between items-center",children:[e.jsx("span",{className:"text-white/70",children:"Até 5 migrações"}),e.jsx("span",{className:"font-bold text-[hsl(222,100%,70%)]",children:"R$ 20,00/cada"})]}),e.jsxs("div",{className:"p-3 rounded-xl bg-white/5 border border-white/10 flex justify-between items-center",children:[e.jsx("span",{className:"text-white/70",children:"6 a 10 migrações"}),e.jsx("span",{className:"font-bold text-[hsl(222,100%,70%)]",children:"R$ 22,00/cada"})]}),e.jsxs("div",{className:"p-3 rounded-xl bg-white/5 border border-white/10 flex justify-between items-center",children:[e.jsx("span",{className:"text-white/70",children:"11 a 20 migrações"}),e.jsx("span",{className:"font-bold text-[hsl(222,100%,70%)]",children:"R$ 25,00/cada"})]}),e.jsxs("div",{className:"p-3 rounded-xl bg-[hsla(1,100%,50%,0.1)] border border-[hsla(1,100%,50%,0.3)] flex justify-between items-center",children:[e.jsx("span",{className:"text-white",children:"Acima de 20"}),e.jsx("span",{className:"font-bold text-[hsl(1,100%,60%)]",children:"R$ 28,00/cada"})]})]})]})})]})}function ve(){var u,g;const{profile:s}=J(),{user:l}=V(),{stats:c}
1=k(),{data:i,periodLabel:t}=K(),a=i==null?void 0:i.find(E=>E.employee_id===(s==null?void 0:s.id)),b=((s==null?void 0:s.fullName)||((u=l==null?void 0:l.user_metadata)==null?void 0:u.full_name)||((g=l==null?void 0:l.user_metadata)==null?void 0:g.name)||"").trim().split(/\s+/)[0]||"",A=b?`Olá, ${b}! ð`:"Olá! ð";return e.jsx(G,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:A}),e.jsx("p",{className:"text-white/60 mt-1",children:"Indique clientes e ajude a Pontua crescer. Você também cresce!"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full sm:w-auto",children:[e.jsx(d,{to:"/parceiro-pontua/colaborador/nova-indicacao",className:"w-full sm:w-auto",children:e.jsxs(m,{className:"w-full sm:w-auto",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Nova Indicação"]})}),e.jsx(d,{to:"/parceiro-pontua/colaborador/migracao",className:"w-full sm:w-auto",children:e.jsxs(m,{className:"w-full sm:w-auto",children:[e.jsx($,{className:"h-4 w-4 mr-2"}),"Migração Ponto Remoto"]})})]})]}),a&&e.jsx(x,{variant:"gold",className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{className:"h-8 w-8 text-[hsl(43,96%,56%)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-white/70",children:"Sua posição no ranking deste trimestre"}),e.jsxs("p",{className:"text-3xl font-bold text-white",children:["#",a.ranking]})]}),e.jsxs("div",{className:"ml-auto text-right",children:[e.jsx("p",{className:"text-sm text-white/70",children:"Conversões"}),e.jsx("p",{className:"text-2xl font-bold text-[hsl(43,96%,56%)]",children:a.converted_referrals})]})]})}),e.jsx(Q,{stats:c}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsx(W,{ranking:i||[],currentUserId:s==null?void 0:s.id,periodLabel:t}),e.jsx(Z,{})]}),e.jsx(Y,{})]})})}export{ve 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.