import{j as e}from"./vendor-radix-DNp60FuA.js";import{r as d,L as q}from"./vendor-react-DL0tRKZA.js";import{s as W,k as $,$ as C,B as F,a0 as R,X as T,N as H}from"./index-DyYtMrmN.js";import{f as O,a as Q,g as K}from"./index-CBP-sTs2.js";import{u as G}from"./vendor-query-CKQAY9LX.js";import{S as y}from"./skeleton-JkyDLADH.js";import{C as U}from"./CompanyLogo-COTywlkX.js";import{P as V}from"./PublicPagination-BEZ0OQp_.js";import{D as X,a as Y,b as Z,c as ee,d as S,e as se}from"./dropdown-menu-yj2nAZnD.js";import{u as ae}from"./useIndustries-T55ruZ5j.js";import{S as B}from"./search-C1f5IQll.js";import{B as re}from"./building-2-CDsru1HD.js";import{F as oe}from"./filter-DgJl7-E0.js";import{a as te,b as le}from"./ab02-D_FOufr2.js";import ne from"./Footer-DRUZJt2_.js";import{E as ie}from"./Explore-job-CN64waiT.js";import{H as de}from"./HeroSection-ScWndVAI.js";import{F as ce}from"./FAQAccordion-v4we56-Q.js";import"./vendor-supabase-B4f4CcZD.js";import"./vendor-charts-CPng-d0O.js";import"./whatsapp-bfrw3Kdz.js";import"./index-BXV3Jf6T.js";import"./chevron-right-BRHR7U8q.js";import"./check-DILptOyH.js";import"./circle-BH0U7SPo.js";import"./index-2qSVHfop.js";import"./use-mobile-DG-UVPpq.js";import"./brain-D6EzJYto.js";import"./handshake-Bbai7pkW.js";import"./cpu-DQQ2pOpR.js";import"./BreadcrumbWrapper-BvjYrzZr.js";import"./useFAQs-D2vCvhTY.js";import"./accordion-ldaM9Zr2.js";import"./index-QYM6e06U.js";import"./chevron-down-3Nc6S7tQ.js";const me=async a=>{console.log("🔍 Fetching public companies (verified only)");let m=W.from("companies").select(`
id,
name,
description,
logo_url,
banner_url,
website,
industry,
headquarters,
founded_year,
company_size,
total_jobs,
is_verified,
created_at,
updated_at
`).eq("status","verified").eq("is_verified",!0).order("total_jobs",{ascending:!1});const{data:c,error:u}=await m;if(u)throw console.error("❌ Error fetching public companies:",u),u;return console.log("✅ Fetched public companies:",(c==null?void 0:c.length)||0,"total"),c||[]};function ue(a){return G({queryKey:["public-companies",a],queryFn:()=>me(),staleTime:5*60*1e3,refetchOnWindowFocus:!1})}function he({filters:a}){const[m,c]=d.useState(1),u=12,{data:h,isLoading:v}=ue(),i=d.useMemo(()=>{if(!h)return[];let r=[...h];if(a!=null&&a.search){const t=a.search.toLowerCase();r=r.filter(o=>{var n,x;return((n=o.name)==null?void 0:n.toLowerCase().includes(t))||((x=o.description)==null?void 0:x.toLowerCase().includes(t))})}if(a!=null&&a.industry&&(r=r.filter(t=>{var o;return(o=t.industry)==null?void 0:o.toLowerCase().includes(a.industry.toLowerCase())})),a!=null&&a.companySize&&(r=r.filter(t=>{var n;const o=(n=t.company_size)==null?void 0:n.toLowerCase();return o==null?void 0:o.includes(a.companySize.toLowerCase())})),a!=null&&a.location){const t=a.location.toLowerCase();r=r.filter(o=>{var n;return(n=o.headquarters)==null?void 0:n.toLowerCase().includes(t)})}if(a!=null&&a.jobCount){const t=parseInt(a.jobCount);r=r.filter(o=>(o.total_jobs||0)>=t)}if(a!=null&&a.sortBy)switch(a.sortBy){case"jobs":r.sort((t,o)=>(o.total_jobs||0)-(t.total_jobs||0));break;case"newest":r.sort((t,o)=>new Date(o.created_at||"").getTime()-new Date(t.created_at||"").getTime());break;case"name":default:r.sort((t,o)=>(t.name||"").localeCompare(o.name||""));break}else r.sort((t,o)=>(o.total_jobs||0)-(t.total_jobs||0));return r},[h,a]),j=Math.ceil(((i==null?void 0:i.length)||0)/u),p=(m-1)*u,b=(i==null?void 0:i.slice(p,p+u))||[];return d.useMemo(()=>{c(1)},[a]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"container",children:[!v&&e.jsx("div",{className:"mb-6",children:e.jsxs("p",{className:"text-gray-600 dark:text-gray-400",children:["Showing ",b.length," of ",i.length," companies",(a==null?void 0:a.search)&&` for "${a.search}"`]})}),e.jsx("div",{className:"grid lg:grid-cols-4 md:grid-cols-2 grid-cols-1 gap-[30px]",children:v?Array(12).fill(0).map((r,t)=>e.jsxs("div",{className:"group relative p-6 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700 mt-6",children:[e.jsx("div",{className:"size-14 flex items-center justify-center bg-white dark:bg-slate-900 shadow-md shadow-gray-200 dark:shadow-gray-700 rounded-md relative -mt-12",children:e.jsx(y,{className:"size-8 rounded"})}),e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx(y,{className:"h-6 w-32"}),e.jsx(y,{className:"h-4 w-full"}),e.jsx(y,{className:"h-4 w-3/4"})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700 flex justify-between",children:[e.jsx(y,{className:"h-4 w-20"}),e.jsx(y,{className:"h-4 w-16"})]})]},t)):b.map(r=>e.jsxs(q,{to:`/employer-detail/${r.id}`,className:"group relative z-0 flex flex-col h-full p-6 rounded-lg bg-white/5 backdrop-blur-sm mt-6 border border-white/10 before:content-[''] before:absolute before:top-0 before:left-0 before:right-0 before:h-1 before:bg-primary/50 before:rounded-t-lg before:z-0 before:pointer-events-none hover:bg-white/10 hover:border-primary/50 hover:shadow-[0_0_30px_rgba(168,85,247,0.25)] hover:-translate-y-1 transition-all duration-300 cursor-pointer active:scale-[0.98]",children:[e.jsx("div",{className:"size-20 flex items-center justify-center bg-black/50 backdrop-blur-xl bg-gradient-to-br from-primary/20 to-white/10 shadow-lg shadow-primary/10 rounded-lg relative -mt-10 z-20 border border-white/10",children:e.jsx(U,{logoUrl:r.logo_url,companyName:r.name,className:"size-12"})}),e.jsxs("div",{className:"mt-4 flex-1 flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-xl font-bold hover:text-emerald-600 transition-colors",children:r.name}),r.is_verified&&e.jsx(O,{className:"size-5 text-emerald-600 flex-shrink-0"})]}),e.jsx("p",{className:"text-slate-400 line-clamp-2 flex-1",children:r.description||"Leading company in their industry"}),r.industry&&e.jsx($,{variant:"secondary",className:"w-fit text-xs",children:r.industry})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-gray-700 flex justify-between items-center",children:[e.jsxs("span",{className:"text-slate-400 flex items-center text-sm",children:[e.jsx(Q,{className:"me-1"}),r.headquarters||"Global"]}),e.jsxs("span",{className:"bg-emerald-100 dark:bg-emerald-900/30 px-3 py-1 rounded-full text-sm font-semibold text-emerald-600 whitespace-nowrap",children:[r.total_jobs||0," Job",r.total_jobs!==1?"s":""]})]}),e.jsx("div",{className:"absolute bottom-4 right-4 opacity-0 group-hover:opacity-100 transform translate-x-2 group-hover:translate-x-0 transition-all duration-300",children:e.jsx(K,{className:"size-5 text-emerald-600"})})]},r.id))}),e.jsx(V,{currentPage:m,totalPages:j,onPageChange:c})]})})}const P=[{value:"",label:"All Sizes"},{value:"startup",label:"Startup (1-10)"},{value:"small",label:"Small (11-50)"},{value:"medium",label:"Medium (51-200)"},{value:"large",label:"Large (201-1000)"},{value:"enterprise",label:"Enterprise (1000+)"}],E=[{value:"",label:"All Companies"},{value:"1",label:"1+ Jobs"},{value:"5",label:"5+ Jobs"},{value:"10",label:"10+ Jobs"},{value:"20",label:"20+ Jobs"}],M=[{value:"name",label:"Company Name"},{value:"jobs",label:"Job Count"},{value:"newest",label:"Newest First"}],pe=({onSearch:a,className:m=""})=>{const{data:c,isLoading:u}=ae(),[h,v]=d.useState(""),[i,j]=d.useState(""),[p,b]=d.useState(""),[r,t]=d.useState(""),[o,n]=d.useState(""),[x,k]=d.useState("name"),[L,_]=d.useState([]),z=d.useMemo(()=>{const s=[{value:"",label:"All Industries"}];return c?[...s,...c.map(l=>({value:l.value,label:l.name}))]:s},[c]),f={control:s=>({...s,height:"40px",minHeight:"40px",border:"none",borderRadius:"6px",backgroundColor:"transparent",boxShadow:"none","&:hover":{border:"none"}}),valueContainer:s=>({...s,paddingLeft:"0"}),input:s=>({...s,color:"hsl(0, 0%, 98%)"}),placeholder:s=>({...s,color:"hsl(260, 10%, 50%)"}),singleValue:s=>({...s,color:"hsl(0, 0%, 98%)"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:s=>({...s,color:"hsl(260, 10%, 50%)","&:hover":{color:"hsl(270, 100%, 65%)"}}),menuPortal:s=>({...s,zIndex:9999}),menu:s=>({...s,zIndex:9999,backgroundColor:"hsl(260, 25%, 10%)",border:"1px solid hsl(260, 20%, 20%)",borderRadius:"12px",boxShadow:"0 10px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.1)",overflow:"hidden"}),menuList:s=>({...s,padding:"8px"}),option:(s,l)=>({...s,backgroundColor:l.isSelected?"hsl(270, 100%, 65%)":l.isFocused?"hsla(270, 100%, 65%, 0.2)":"transparent",color:l.isSelected?"hsl(0, 0%, 100%)":"hsl(0, 0%, 90%)",borderRadius:"8px",padding:"10px 12px",cursor:"pointer","&:active":{backgroundColor:"hsla(270, 100%, 65%, 0.3)"}})},g=()=>{var N,J,A;a({search:h,industry:i,companySize:p,location:r,jobCount:o,sortBy:x});const l=[];h&&l.push(`Search: ${h}`),i&&l.push(`Industry: ${(N=z.find(w=>w.value===i))==null?void 0:N.label}`),p&&l.push(`Size: ${(J=P.find(w=>w.value===p))==null?void 0:J.label}`),r&&l.push(`Location: ${r}`),o&&l.push(`Min Jobs: ${o}+`),x!=="name"&&l.push(`Sort: ${(A=M.find(w=>w.value===x))==null?void 0:A.label}`),_(l)},I=()=>{v(""),j(""),b(""),t(""),n(""),k("name"),_([]),a({search:"",industry:"",companySize:"",location:"",jobCount:"",sortBy:"name"})},D=s=>{s.startsWith("Search:")&&v(""),s.startsWith("Industry:")&&j(""),s.startsWith("Size:")&&b(""),s.startsWith("Location:")&&t(""),s.startsWith("Min Jobs:")&&n(""),s.startsWith("Sort:")&&k("name");const l=L.filter(N=>N!==s);_(l),setTimeout(g,0)};return e.jsxs("div",{className:`bg-black/40 backdrop-blur-xl border border-white/10 shadow-[0_0_30px_rgba(168,85,247,0.15)] rounded-xl p-4 ${m}`,children:[e.jsxs("div",{className:"grid lg:grid-cols-5 md:grid-cols-3 grid-cols-1 gap-4 mb-4",children:[e.jsxs("div",{className:"lg:col-span-2 relative",children:[e.jsx(B,{className:"absolute top-1/2 -translate-y-1/2 left-3 z-10 text-primary text-lg"}),e.jsx("input",{type:"text",value:h,onChange:s=>v(s.target.value),onKeyPress:s=>s.key==="Enter"&&g(),className:"w-full h-10 pl-10 pr-4 bg-white/5 border border-white/10 rounded-md text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary",placeholder:"Search companies..."})]}),e.jsxs("div",{className:"relative px-3 bg-white/5 border border-white/10 rounded-md",children:[e.jsx(re,{className:"absolute top-1/2 -translate-y-1/2 left-3 z-10 text-primary text-lg"}),e.jsx(C,{value:z.find(s=>s.value===i),onChange:s=>j((s==null?void 0:s.value)||""),options:z,styles:f,placeholder:"Industry",className:"pl-8",menuPortalTarget:document.body})]}),e.jsx("div",{className:"px-3 bg-white/5 border border-white/10 rounded-md",children:e.jsx(C,{value:P.find(s=>s.value===p),onChange:s=>b((s==null?void 0:s.value)||""),options:P,styles:f,placeholder:"Company Size",menuPortalTarget:document.body})}),e.jsxs(F,{onClick:g,className:"h-10 bg-primary hover:bg-primary/90 text-primary-foreground",children:[e.jsx(B,{className:"h-4 w-4 mr-2"}),"Search"]})]}),e.jsxs("div",{className:"grid lg:grid-cols-5 md:grid-cols-3 grid-cols-1 gap-4 mb-4",children:[e.jsxs("div",{className:"lg:col-span-2 relative",children:[e.jsx(R,{className:"absolute top-1/2 -translate-y-1/2 left-3 z-10 text-primary text-lg"}),e.jsx("input",{type:"text",value:r,onChange:s=>t(s.target.value),onKeyPress:s=>s.key==="Enter"&&g(),className:"w-full h-10 pl-10 pr-4 bg-white/5 border border-white/10 rounded-md text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary",placeholder:"Location (e.g., New York, USA)"})]}),e.jsx("div",{className:"px-3 bg-white/5 border border-white/10 rounded-md",children:e.jsx(C,{value:M.find(s=>s.value===x),onChange:s=>k((s==null?void 0:s.value)||"name"),options:M,styles:f,placeholder:"Sort By",menuPortalTarget:document.body})}),e.jsx("div",{className:"px-3 bg-white/5 border border-white/10 rounded-md",children:e.jsx(C,{value:E.find(s=>s.value===o),onChange:s=>n((s==null?void 0:s.value)||""),options:E,styles:f,placeholder:"Min Jobs",menuPortalTarget:document.body})}),e.jsx("div",{children:e.jsxs(X,{children:[e.jsx(Y,{asChild:!0,children:e.jsxs(F,{variant:"outline",className:"h-10 w-full border-white/10 bg-white/5 hover:bg-white/10 text-foreground",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),"More Filters"]})}),e.jsxs(Z,{className:"w-56 bg-card border-white/10",children:[e.jsx(ee,{children:"Quick Filters"}),e.jsx(S,{onClick:()=>{n("5"),g()},children:"Companies with 5+ Jobs"}),e.jsx(S,{onClick:()=>{j("technology"),g()},children:"Technology Companies"}),e.jsx(S,{onClick:()=>{b("large"),g()},children:"Large Companies"}),e.jsx(se,{}),e.jsx(S,{onClick:I,children:"Clear All Filters"})]})]})})]}),L.length>0&&e.jsxs("div",{className:"flex items-center flex-wrap gap-2 pt-2 border-t border-white/10",children:[e.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:"Active filters:"}),L.map((s,l)=>e.jsxs($,{variant:"secondary",className:"flex items-center space-x-1 bg-white/10 text-foreground",children:[e.jsx("span",{className:"text-xs",children:s}),e.jsx(T,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>D(s)})]},l)),e.jsx(F,{variant:"ghost",size:"sm",onClick:I,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]})]})};function Ve(){const[a,m]=d.useState({search:"",industry:"",companySize:"",location:"",jobCount:"",sortBy:"name"});return e.jsxs(e.Fragment,{children:[e.jsx(H,{navClass:"!justify-end nav-light"}),e.jsx(de,{title:"Employers / Companies",description:"Discover top companies and explore their latest job opportunities",breadcrumbItems:[{label:"Home",href:"/"},{label:"Jobs",href:"/job-list"},{label:"Employers"}],variant:"emerald"}),e.jsxs("section",{className:"relative md:py-24 py-16",children:[e.jsx("div",{className:"container mb-8",children:e.jsx(pe,{onSearch:m})}),e.jsx(he,{filters:a}),e.jsx("div",{className:"container md:mt-24 md:pb-16 mt-16",children:e.jsxs("div",{className:"grid md:grid-cols-12 grid-cols-1 items-center gap-[30px]",children:[e.jsx("div",{className:"lg:col-span-5 md:col-span-6",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"relative",children:e.jsx("img",{src:te,className:"lg:w-[400px] w-[280px] rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700",alt:""})}),e.jsx("div",{className:"absolute md:-end-5 end-0 -bottom-16",children:e.jsx("img",{src:le,className:"lg:w-[280px] w-[200px] border-8 border-white dark:border-slate-900 rounded-md shadow-sm shadow-gray-200 dark:shadow-gray-700",alt:""})})]})}),e.jsx("div",{className:"lg:col-span-7 md:col-span-6 mt-14 md:mt-0",children:e.jsx("div",{className:"lg:ms-5",children:e.jsx(ce,{category:"Hunters",title:"Frequently Asked Questions",description:"Search all the open positions on the web. Get your own personalized salary estimate. Read reviews on over 30000+ companies worldwide."})})})]})}),e.jsx(ie,{})]}),e.jsx(ne,{})]})}export{Ve as default};