1import{u,e as f,f as c,j as e,g as d,B as t,S as m,C as j,M as b,d as v,i,Z as y,a as N,U as p,b as w,w as C}from"./index-CAQ9C6-z.js";import{D as k}from"./dollar-sign-Bkqe7NdJ.js";import{f as S}from"./format-DECx0Hkk.js";import{S as L}from"./square-pen-BNHSH3rb.js";import{T as M}from"./trophy-Cwox1cum.js";import"./en-US-K2-Byqu-.js";import"./differenceInCalendarDays-BvXbP6kq.js";function E(){const{isAuthenticated:n,isLoading:x}=u(),[,r]=f(),{data:l,isLoading:g}=c({queryKey:["/api/my-campaigns"],enabled:n}),{data:o}=c({queryKey:["/api/campaign-applications"],enabled:n}),h=a=>(o==null?void 0:o.filter(s=>s.opportunityId===a).length)||0;return x||g?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{className:"h-9 w-72"}),e.jsx(d,{className:"h-5 w-80"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3].map(a=>e.jsx(d,{className:"h-64"},a))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 festival-gradient opacity-10 blur-3xl"}),e.jsxs("div",{className:"relative flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold font-heading tracking-tight text-foreground",children:"Sponsorship Campaigns"}),e.jsx("p",{className:"mt-1 text-base text-muted-foreground",children:"Manage your festival partnership opportunities"})]}),e.jsxs(t,{onClick:()=>r("/campaigns/create"),className:"gap-2 bg-gradient-to-r from-primary to-accent hover:from-primary hover:to-accent text-primary-foreground festival-glow","data-testid":"button-create-campaign",children:[e.jsx(m,{className:"w-5 h-5"}),"Create Sponsorship"]})]})]}),l&&l.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:l.map(a=>{const s=h(a.id);return e.jsxs(j,{className:"relative overflow-hidden bg-gradient-to-br from-card via-card to-primary/5 border-2 border-primary/20 hover:border-primary/40 transition-all duration-300 card-glow group","data-testid":`card-campaign-${a.id}`,children:[a.imageUrl?e.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-t-lg bg-gradient-to-br from-primary/20 to-accent/20",children:[e.jsx("img",{src:a.imageUrl,alt:a.title,loading:"lazy",decoding:"async",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/30 via-transparent to-transparent"})]}):e.jsxs("div",{className:"relative aspect-video w-full rounded-t-lg bg-gradient-to-br from-primary/10 to-accent/10 flex items-center justify-center",children:[e.jsx(b,{className:"w-16 h-16 text-primary/30"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/30 via-transparent to-transparent"})]}),e.jsxs(v,{className:"gap-2 space-y-0 relative",children:[e.jsx("h3",{className:"text-xl font-bold font-heading line-clamp-2 text-foreground",children:a.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[e.jsx(i,{variant:"outline",className:"border-primary/30 bg-primary/10",children:a.category.replace("_"," ")}),a.isActive?e.jsxs(i,{className:"bg-green-600 dark:bg-green-500 text-white border-0 animate-pulse",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),"LIVE"]}):e.jsx(i,{variant:"secondary",className:"opacity-60",children:"Inactive"})]})]}),e.jsxs(N,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gradient-to-r from-primary/5 to-accent/5 rounded-lg border border-primary/10",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(p,{className:"w-4 h-4 text-primary"}),e.jsxs("span",{className:"font-semibold",children:[s," Creators Applied"]})]}),s>0&&e.jsx(i,{className:"text-xs bg-red-600 dark:bg-red-500 text-white border-0",children:"HOT"})]}),a.budget&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Investment"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(k,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"font-bold text-lg text-primary",children:a.budget.toLocaleStr
1ing()})]})]}),a.deadline&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(w,{className:"w-4 h-4"}),e.jsxs("span",{children:["Closes ",S(new Date(a.deadline),"MMM d, yyyy")]})]})]}),e.jsxs(C,{className:"gap-2",children:[e.jsxs(t,{variant:"outline",className:"flex-1 border-primary/30 hover:border-primary/50 hover:bg-primary/10",onClick:()=>r(`/campaigns/${a.id}/edit`),"data-testid":`button-edit-${a.id}`,children:[e.jsx(L,{className:"w-4 h-4 mr-1"}),"Edit"]}),e.jsxs(t,{variant:"outline",className:"flex-1 border-primary/30 hover:border-primary/50 hover:bg-primary/10",onClick:()=>r(`/campaigns/${a.id}/applications`),"data-testid":`button-view-applications-${a.id}`,children:["Review Creators",e.jsx(p,{className:"w-4 h-4 ml-2"})]})]})]},a.id)})}):e.jsxs("div",{className:"text-center py-16 bg-gradient-to-br from-card via-primary/5 to-card rounded-2xl border-2 border-primary/20",children:[e.jsx("div",{className:"mb-6",children:e.jsx("div",{className:"w-24 h-24 mx-auto bg-gradient-to-br from-primary/20 to-accent/20 rounded-full flex items-center justify-center",children:e.jsx(M,{className:"w-12 h-12 text-primary"})})}),e.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"No sponsorship campaigns yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Create your first festival partnership opportunity"}),e.jsxs(t,{onClick:()=>r("/campaigns/create"),className:"gap-2 bg-gradient-to-r from-primary to-accent hover:from-primary hover:to-accent text-primary-foreground festival-glow",children:[e.jsx(m,{className:"w-4 h-4"}),"Create Your First Sponsorship"]})]})]})}export{E 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.