PageSourceSearch

https://axye.com.br/assets/Explore-7pveB8Mv.js

js axye.com.br collected 2026-10-09 04:48:47 UTC 16,710 bytes, 1 lines download raw bytes

1import{m as U,L as Z,Y as W,r as c,u as ee,Z as se,D as re,_ as ae,$ as te,j as e,I as ne,T as ie,a0 as oe,a1 as de,X as le,N as z,a2 as ce,a3 as me,V as _,a4 as ue,a5 as xe,o as B,A as ge,f as pe,g as fe,a6 as he,a7 as be,K as je,a8 as ve,F as ye,a9 as O,d as Ne,aa as we,e as _e,ab as Pe,ac as Se,ad as F,U as T,i as R,ae as I}from"./index-B29x19vy.js";import{d as J}from"./auth-aurora-bg-CZE0HRa4.js";import{U as Ce}from"./user-x-BrUm7qJI.js";const K=U(Z),j=24,ke=["Mercado Hot","Dropshipping","E-commerce","Tráfego Pago","Tráfego Orgânico","Social Media","Infoprodutos","PLR","Afiliados","CPA Marketing","Lançamentos","Perpétuo","Copywriting","Funis de Venda","Automação","Inteligência Artificial","SaaS","Programação","No-code / Low-code","Criptomoedas","Apostas","Mercado Financeiro","Arbitragem","Encapsulados","Apps Mobile","Growth Hacking","YouTube Automation","Dark Market","Agências"];function Ae(s,o=300){const[i,t]=c.useState(s);return c.useEffect(()=>{const n=setTimeout(()=>t(s),o);return()=>clearTimeout(n)},[s,o]),i}function Fe(s){return O({queryKey:["explore-communities",s.search,s.category??null,s.sort,s.userId??"anon"],initialPageParam:0,queryFn:async({pageParam:o})=>{const i=o*j,t=i+j-1;let n=I.from("communities").select("*").range(i,t);s.sort==="members"?n=n.order("members_count",{ascending:!1}):n=n.order("created_at",{ascending:!1}),s.search&&(n=n.ilike("name",`%${s.search}%`)),s.category&&(n=n.eq("category",s.category));const{data:a,error:m}=await n;if(m)throw m;let d=a??[];if(s.userId&&d.length){const b=d.map(u=>u.id),{data:N}=await I.from("community_members").select("community_id, status").eq("user_id",s.userId).in("community_id",b),v=new Map((N??[]).map(u=>[u.community_id,u.status]));d=d.map(u=>({...u,joined:v.get(u.id)==="approved",memberStatus:v.get(u.id)??null}))}return d},getNextPageParam:(o,i)=>o.length<j?void 0:i.length})}function Ie(s){const o=s.excludeIds.slice().sort().join(",");return O({queryKey:["explore-profiles",s.search,s.sort,s.minLevel,o],initialPageParam:0,queryFn:async({pageParam:i})=>{const t=i*j,n=t+j-1;let a=I.from("profiles").select("id, account_id, avatar_url, badge, banner_position, banner_url, bio, created_at, display_name, last_active_date, last_seen, level, member_since, points, streak_days, updated_at, username, username_changed_at, xp, xp_to_next").range(t,n);s.sort==="top"?a=a.order("points",{ascending:!1}):s.sort==="level"?a=a.order("level",{ascending:!1}).order("points",{ascending:!1}):a=a.order("created_at",{ascending:!1}),s.search&&(a=a.or(`display_name.ilike.%${s.search}%,username.ilike.%${s.search}%`)),s.minLevel>1&&(a=a.gte("level",s.minLevel)),s.excludeIds.length&&(a=a.not("id","in",`(${s.excludeIds.join(",")})`));const{data:m,error:d}=await a;if(d)throw d;return m??[]},getNextPageParam:(i,t)=>i.length<j?void 0:t.length})}const Re=()=>{const[s,o]=W(),i=s.get("tab")==="pessoas"?"pessoas":"comunidades",[t,n]=c.useState(i);c.useEffect(()=>{const r=s.get("tab");(r==="pessoas"||r==="comunidades")&&n(r)},[s]);const[a,m]=c.useState(""),d=Ae(a,350),[b,N]=c.useState(void 0),[v,u]=c.useState("members"),[P,Q]=c.useState("top"),[M,G]=c.useState(1),{user:x}=ee(),S=se(),C=re(),L=ae(),{data:y}=te(),H=c.useMemo(()=>Array.from(y instanceof Set?y:new Set(Array.isArray(y)?y:[])),[y]),f=Fe({search:d,category:b,sort:v,userId:x==null?void 0:x.id}),h=Ie({search:d,sort:P,minLevel:M,excludeIds:H}),$=c.useMemo(()=>{var r;return((r=f.data)==null?void 0:r.pages.flat())??[]},[f.data]),q=c.useMemo(()=>{var r;return((r=h.data)==null?void 0:r.pages.flat())??[]},[h.data]),V=c.useCallback(r=>{if(!x){S("/auth");return}const l=r.joined||r.memberStatus==="pending",k=!l&&!r.is_private,X=l?null:r.is_private?"pending":"approved",Y=l?-1:r.is_private?0:1;C.setQueriesData({queryKey:["explore-communities"]},g=>g&&{...g,pages:g.pages.map(A=>A.map(p=>p.id===r.id?{...p,joined:k,memberStatus:X,members_count:Math.max(0,(p.members_count??0)+Y)}:p))}),L.mutate({communityId:r.id,joined:l,isPrivate:r.is_private},{onError:()=>{C.setQueriesData({queryKey:["explore-communities"]},g=>g&&{...g,pages:g.pages.map(A=>A.map(p=>p.id===r.id?{...p,joined:r.joined,memberStatus:r.memberStatus,members_count:r.members_count}:p))})}})},[x,S,C,L]),w=c.useRef(null),E=c.useCallback(r=>{const l=t==="comunidades"?f:h;l.isFetchingNextPage||(w.current&&w.current.disconnect(),w.current=ne
1w IntersectionObserver(k=>{k[0].isIntersecting&&l.hasNextPage&&l.fetchNextPage()},{rootMargin:"600px"}),r&&w.current.observe(r))},[t,f,h]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(ne,{title:"Explorar",description:"Descubra novas comunidades, criadores e perfis ativos na axye."}),e.jsx(ie,{}),e.jsx("main",{className:"w-[95%] lg:w-[90%] xl:w-[80%] mx-auto px-0 py-6",children:e.jsxs(U.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Explorar"}),x&&e.jsxs("button",{onClick:()=>S("/criar-comunidade"),className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors",children:[e.jsx(oe,{className:"h-4 w-4"}),"Criar Comunidade"]})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{value:a,onChange:r=>m(r.target.value),placeholder:"Buscar comunidades ou pessoas...","aria-label":"Buscar comunidades e pessoas",className:"w-full bg-card border border-border rounded-xl pl-10 pr-10 py-2.5 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30"}),a&&e.jsx("button",{"aria-label":"Limpar busca",onClick:()=>m(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:e.jsx(le,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["comunidades","pessoas"].map(r=>e.jsxs("button",{onClick:()=>{n(r),o(r==="comunidades"?{}:{tab:r},{replace:!0})},className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors capitalize ${t===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[r==="comunidades"?e.jsx(z,{className:"inline h-4 w-4 mr-1.5"}):e.jsx(ce,{className:"inline h-4 w-4 mr-1.5"}),r]},r))}),t==="comunidades"?e.jsxs("div",{className:"mb-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1 scrollbar-hide",children:[e.jsx("button",{onClick:()=>N(void 0),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-medium transition-colors ${b?"bg-card border border-border text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"}`,children:"Todas"}),ke.map(r=>e.jsx("button",{onClick:()=>N(b===r?void 0:r),className:`shrink-0 px-3 py-1.5 rounded-full text-xs font-medium transition-colors whitespace-nowrap ${b===r?"bg-primary text-primary-foreground":"bg-card border border-border text-muted-foreground hover:text-foreground"}`,children:r},r))]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Ordenar:"}),[["members","Mais membros"],["recent","Recentes"]].map(([r,l])=>e.jsx("button",{onClick:()=>u(r),className:`px-3 py-1 rounded-md font-medium transition-colors ${v===r?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground"}`,children:l},r))]})]}):e.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs flex-wrap",children:[e.jsx("span",{className:"text-muted-foreground",children:"Ordenar:"}),[["top","Top XP"],["level","Maior nível"],["recent","Novos"]].map(([r,l])=>e.jsx("button",{onClick:()=>Q(r),className:`px-3 py-1 rounded-md font-medium transition-colors ${P===r?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground"}`,children:l},r)),e.jsx("div",{className:"h-4 w-px bg-border mx-1"}),e.jsx("span",{className:"text-muted-foreground",children:"Nível mín:"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:M,onChange:r=>G(Number(r.target.value)),className:"appearance-none pl-3 pr-7 py-1 rounded-md bg-card border border-border text-foreground font-medium text-xs outline-none focus:ring-2 focus:ring-primary/30",children:[1,5,10,20,50].map(r=>e.jsx("option",{value:r,children:r===1?"Qualquer":`≥ ${r}`},r))}),e.jsx(me,{className:"absolute right-1.5 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"})]})]}),t==="comunidades"?f.isLoading?e.jsx(D,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:$.map((r,l)=>e.jsx(Me,{c:r,index:l,showJoin:!!x,onJoin:()=>V(r)},r.id))}
1),$.length===0&&!f.isFetching&&e.jsx("p",{className:"text-muted-foreground text-sm text-center py-12",children:"Nenhuma comunidade encontrada."}),e.jsx("div",{ref:E,className:"h-1"}),f.isFetchingNextPage&&e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(_,{className:"h-5 w-5 animate-spin text-primary"})})]}):h.isLoading?e.jsx(D,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:q.map((r,l)=>e.jsx($e,{u:r,index:l,rank:P==="top"?l+1:void 0,currentUserId:x==null?void 0:x.id},r.id))}),q.length===0&&!h.isFetching&&e.jsx("p",{className:"text-muted-foreground text-sm text-center py-12",children:"Nenhum usuário encontrado."}),e.jsx("div",{ref:E,className:"h-1"}),h.isFetchingNextPage&&e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(_,{className:"h-5 w-5 animate-spin text-primary"})})]})]})})]})};function D(){return e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((s,o)=>e.jsx("div",{className:"h-[300px] rounded-2xl bg-card border border-border animate-pulse"},o))})}function Me({c:s,index:o,showJoin:i,onJoin:t}){const n=s.memberStatus==="pending",a=s.joined;return e.jsxs(K,{to:`/comunidade/${s.slug||s.id}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:Math.min(o*.02,.2)},className:"group relative h-full rounded-2xl bg-card border border-border hover:border-primary/40 transition-colors overflow-hidden block",children:[e.jsxs("div",{className:"relative h-28 w-full overflow-hidden bg-muted",children:[e.jsx("img",{src:s.cover_url||J,alt:"",className:"w-full h-full object-cover",style:{objectPosition:`center ${s.cover_position??50}%`},loading:"lazy"}),s.is_private&&e.jsx("span",{className:"absolute top-3 right-3 px-2 py-0.5 rounded-md text-[10px] font-medium bg-background/80 text-foreground border border-border",children:"🔒 Privada"})]}),e.jsxs("div",{className:"relative flex min-h-[15rem] flex-col px-5 pb-5 -mt-8",children:[e.jsx("div",{className:"mb-3 w-fit self-start rounded-xl bg-card p-1 border border-border",children:e.jsx("div",{className:"rounded-lg overflow-hidden",children:e.jsx(ue,{iconUrl:s.icon_url,emoji:s.icon,name:s.name,size:"lg"})})}),e.jsxs("div",{className:"space-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-base font-semibold tracking-tight text-foreground group-hover:text-primary transition-colors line-clamp-1",children:s.name}),s.category&&e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground bg-muted px-2 py-0.5 rounded",children:s.category})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:s.description})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(z,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"font-medium text-foreground",children:(s.members_count??0).toLocaleString("pt-BR")}),e.jsx("span",{children:"membros"})]}),i&&e.jsx("button",{onClick:m=>{m.preventDefault(),m.stopPropagation(),t()},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${a?"bg-muted text-foreground hover:bg-muted/70":n?"bg-muted text-muted-foreground hover:bg-muted/70":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:a?e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3.5 w-3.5"})," Participando"]}):n?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"h-3.5 w-3.5"})," Pendente"]}):"Participar"})]})]})]})}function Le({userId:s}){const{data:o}=Ne(s),{data:i}=we(s),t=_e(),n=Pe(),a=Se(),m=t.isPending||n.isPending||a.isPending;return e.jsxs("div",{className:"flex items-center gap-2 pt-3 border-t border-border",children:[e.jsxs(F,{type:"button",size:"sm",variant:o?"secondary":"default",disabled:m,onClick:d=>{d.preventDefault(),d.stopPropagation(),t.mutate({targetId:s,isFollowing:o??!1})},className:"h-8 flex-1 rounded-lg text-xs",children:[t.isPending?e.jsx(_,{className:"animate-spin"}):o?e.jsx(T,{}):e.jsx(R,{}),o?"Seguindo":"Seguir"]}),i==="none"&&e.jsxs(F,{type:"button",size:"sm",variant:"outline",disabled:m,onClick:d=>{d.preventDefault(),d.stopPropagation(),n.mutate(s)},className:"h-8 flex-1 rounded-lg text-xs",children:[n.isPending?e.jsx(_,{className:"animate-spin"}):e.jsx(R,{}),"Adicionar"]}),i==="pending_sent"&&e.jsxs(F,{type:"button",size:"sm",variant:"outline",disabled:m,onClick:d=>{d.preventDefault(),d.stopPropagation(),a.mutate(s)},className:"h-8 flex-1 rounded-lg text-xs text-muted-foreground",children:[e.jsx(Ce,{})," Pendente"]}),i==="pending_received"&&e.jsxs("span",{className:"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-lg border border-border bg-muted px-3 text-xs font-medium text-muted-foreground",children:[e.jsx(B,{className:"h-4 w-4"})," Recebida"]}),i==="accepted"&&e.jsxs("span",{className:"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-3 text-xs font-medium text-primary",children:[e.jsx(T,{className:"h-4 w-4"})," Amigos"]})]})}function $e({u:s,index:o,rank:i,currentUserId:t}){const n=(s.display_name??"").split(" ").map(a=>a[0]).join("").slice(0,2);return e.jsxs(K,{to:`/perfil/${s.username}`,initial:{opacity:0,y:8}
1,animate:{opacity:1,y:0},transition:{delay:Math.min(o*.02,.2)},className:"group relative rounded-2xl bg-card border border-border hover:border-primary/40 transition-colors overflow-hidden block",children:[e.jsxs("div",{className:"relative h-24 w-full overflow-hidden bg-muted",children:[e.jsx("img",{src:s.banner_url||s.ln||J,alt:"",className:"w-full h-full object-cover",style:{objectPosition:`center ${s.banner_position??50}%`},loading:"lazy"}),i!==void 0&&i<=100&&e.jsxs("span",{className:"absolute top-3 right-3 px-2 py-0.5 rounded-md text-[10px] font-semibold bg-background/80 text-foreground border border-border",children:["#",i]})]}),e.jsxs("div",{className:"relative px-5 pb-5 -mt-8",children:[e.jsxs(ge,{className:"h-16 w-16 rounded-full ring-4 ring-card bg-card mb-3",children:[s.avatar_url&&e.jsx(pe,{src:s.avatar_url,className:"rounded-full"}),e.jsx(fe,{className:"rounded-full bg-muted text-foreground font-semibold",children:n})]}),e.jsxs("div",{className:"mb-4 min-h-[5.5rem] space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("h3",{className:"text-base font-semibold tracking-tight text-foreground group-hover:text-primary transition-colors line-clamp-1",children:s.display_name}),e.jsx(he,{userId:s.id,level:s.level,size:"sm"}),e.jsx(be,{userId:s.id})]}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",s.username]}),s.bio&&e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2 pt-1.5",children:s.bio})]}),e.jsxs("div",{className:`mt-auto flex items-center gap-4 pt-3 text-xs ${t&&t!==s.id?"":"border-t border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(je,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"font-medium text-foreground",children:(s.points??0).toLocaleString("pt-BR")}),e.jsx("span",{className:"text-muted-foreground",children:"pts"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ve,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsxs("span",{className:"font-medium text-foreground",children:["Nv. ",s.level]})]}),(s.streak_days??0)>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ye,{className:"h-3.5 w-3.5 text-orange-500"}),e.jsxs("span",{className:"font-medium text-foreground",children:[s.streak_days,"d"]})]})]}),t&&t!==s.id&&e.jsx(Le,{userId:s.id})]})]})}export{Re 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.