import{j as e}from"./vendor-ui-CUslpDkL.js";import{r as x,L as p}from"./vendor-react-Dg0Tra3e.js";import{u as d}from"./vendor-query-CN1EccJz.js";import{u as h,n as f,R as g,C as j,s as l}from"./index-CJqEbhJN.js";import{C as w,a as y}from"./card-BSxrPlO5.js";import{B as N}from"./badge-But4vkun.js";import{I as b}from"./input-BddqDKi_.js";import{S as v}from"./search-RJS4XthK.js";import{F as C}from"./film-B3I-fyoz.js";import"./vendor-supabase-yzuDJZPy.js";import"./vendor-motion-CiNtJfg1.js";const I=()=>{const{t:r}=h(),[a,m]=x.useState(""),{data:i,isLoading:c}=d({queryKey:["studios"],queryFn:async()=>{const{data:t,error:s}=await l.from("studios").select("*").order("name");if(s)throw s;return t}}),{data:u}=d({queryKey:["studio-counts"],queryFn:async()=>{const{data:t,error:s}=await l.from("show_studios").select("studio_id");if(s)throw s;const o={};for(const n of t||[])o[n.studio_id]=(o[n.studio_id]||0)+1;return o}});return e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx("title",{children:"Anime Studios - Production Companies | What-Anime"}),e.jsx("meta",{name:"description",content:"Explore anime by studio. Browse works from MAPPA, ufotable, Kyoto Animation, Studio Ghibli, and 20+ other animation studios."}),e.jsx("link",{rel:"canonical",href:"https://www.what-anime.com/studios"}),e.jsx("meta",{property:"og:title",content:"Anime Studios - Production Companies"}),e.jsx("meta",{property:"og:description",content:"Explore anime by studio. Browse works from top animation studios."}),e.jsx("meta",{property:"og:url",content:"https://www.what-anime.com/studios"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage",name:"Anime Studios",description:"Browse anime by studio",url:"https://www.what-anime.com/studios",numberOfItems:i?.length||0})})]}),e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:r("studios.title")}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:r("studios.description")}),e.jsxs("div",{className:"max-w-md mx-auto relative",children:[e.jsx(v,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(b,{type:"text",placeholder:r("studios.searchPlaceholder"),value:a,onChange:t=>m(t.target.value),className:"pl-10"})]})]}),c?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[...Array(12)].map((t,s)=>e.jsx("div",{className:"h-48 bg-muted rounded-xl animate-pulse"},s))}):e.jsx(e.Fragment,{children:(()=>{const t=i?.filter(s=>s.name.toLowerCase().includes(a.toLowerCase())||s.description?.toLowerCase().includes(a.toLowerCase()));return e.jsx(e.Fragment,{children:t&&t.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(s=>{const o=u?.[s.id]||0;return e.jsx(p,{to:`/studio/${s.slug}`,className:"group",children:e.jsx(w,{className:"h-full overflow-hidden border-0 bg-card/50 hover:bg-card transition-all duration-300 hover:scale-[1.02] hover:shadow-xl hover:shadow-primary/10",children:e.jsxs(y,{className:"p-6 h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center group-hover:bg-primary/20 transition-colors",children:e.jsx(g,{className:"w-7 h-7 text-primary"})}),s.is_animation_studio&&e.jsx(N,{variant:"secondary",className:"text-xs",children:r("studios.animationStudio")})]}),e.jsx("h2",{className:"text-xl font-bold mb-2 group-hover:text-primary transition-colors",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 flex-1 mb-4",children:r(`studios.descriptions.${s.name}`,{defaultValue:""})||s.description||`${r("studios.exploreAnimeBy")} ${s.name}`}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.founded_year&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(j,{className:"w-4 h-4"}),r("studios.founded")," ",s.founded_year]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(C,{className:"w-4 h-4"}),o," ",r("studios.anime")]})]})]})})},s.id)})}):e.jsx("div",{className:"text-center py-20 text-muted-foreground",children:r("studios.noStudiosFound")})})})()})]})]})};export{I as default};