1import{u as F,R as i,j as e}from"./LaravelTranslationContext-Z5orulYN.js";import{H as P,N as _,F as B}from"./FooterSection-ZsbcgFna.js";import{C as E,a as $}from"./card-rkeDLvCO.js";import{B as L}from"./badge-C1XazNs3.js";import{m as g,B as M}from"./createLucideIcon-wiHDCCZZ.js";import{I}from"./ImageWithFallback-BpHwV6oN.js";import{F as R}from"./FloatingActions-B11mfcI7.js";import{E as z}from"./external-link-DD6t60gy.js";import{C as A}from"./calendar-DLskpEMl.js";import"./app-C7m2Ar8R.js";import"./index-DZ_Kha3d.js";/* empty css */function Y({menuItems:o=[],links:p={},auth:n=null}){const{t}=F(),v=!!(n&&n.user),[w,h]=i.useState([]),[r,d]=i.useState(1),[c,N]=i.useState(9),[H,u]=i.useState(!1),[l,f]=i.useState(1),[C,y]=i.useState(0),S=async(a,x)=>{var j,b;u(!0);try{const m=await fetch(`/api/gallery?page=${a}&per_page=${x}`,{headers:{Accept:"application/json"}});if(!m.ok)throw new Error("Failed to load");const s=await m.json();h((s==null?void 0:s.data)||[]),f(((j=s==null?void 0:s.meta)==null?void 0:j.last_page)||1),y(((b=s==null?void 0:s.meta)==null?void 0:b.total)||0)}catch{h([]),f(1),y(0)}finally{u(!1)}};i.useEffect(()=>{S(r,c)},[r,c]);const k=()=>o&&o.length?o:[{nameKey:"menu.home",href:"/",active:!1},{nameKey:"menu.media",href:"/media",active:!0}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-h-screen bg-white",style:{fontFamily:"Montserrat, sans-serif"},children:[e.jsx(P,{selectedProgram:"",onBack:()=>window.history.back()}),e.jsx(_,{menuItems:k(),links:p,auth:n,isLoggedIn:v}),e.jsxs(g.div,{className:"relative py-20 px-4 sm:px-6 overflow-hidden",style:{backgroundColor:"#211b4e"},initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.8},children:[e.jsxs("div",{className:"absolute inset-0 opacity-10",children:[e.jsx("div",{className:"absolute top-10 left-10 w-20 h-20 border-2 border-white/30 rounded-full"}),e.jsx("div",{className:"absolute top-32 right-20 w-16 h-16 border-2 border-white/30 rounded-lg rotate-45"}),e.jsx("div",{className:"absolute bottom-20 left-1/4 w-12 h-12 border-2 border-white/30 rounded-full"}),e.jsx("div",{className:"absolute bottom-32 right-10 w-24 h-24 border-2 border-white/30 rounded-lg rotate-12"})]}),e.jsx("div",{className:"max-w-6xl mx-auto text-center relative z-10",children:e.jsxs(g.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.2},className:"mb-8",children:[e.jsx("h1",{className:"text-4xl md:text-6xl font-bold text-white mb-6 leading-tight",children:t("galleries.title")}),e.jsx("p",{className:"text-xl text-white/90 max-w-4xl mx-auto leading-relaxed",children:t("galleries.subtitle")})]})})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-10",children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:w.map((a,x)=>e.jsx(g.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1+x*.05},className:"h-full",children:e.jsxs(E,{className:"overflow-hidden hover:shadow-lg transition-all duration-300 h-full flex flex-col",children:[e.jsxs("div",{className:"relative",children:[e.jsx(I,{src:a.cover_image,alt:a.title,className:"w-full h-64 object-cover"}),a.photo_count?e.jsx("div",{className:"absolute top-4 right-4",children:e.jsx(L,{className:"bg-orange-500 text-white px-3 py-1",children:a.photo_count})}):null,e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2",children:e.jsxs(M,{variant:"outline",size:"sm",className:"bg-white/90 text-gray-900 border-gray-300",onClick:()=>window.location.href=`/galleries/${a.id}`,children:[t("galleries.view.album")," ",e.jsx(z,{className:"w-4 h-4 ml-2"})]})})]}),e.jsxs($,{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center text-gray-500 text-sm mb-3",children:[e.jsx(A,{className:"w-4 h-4 mr-2"})," ",a.event_date||""]}),e.jsx("h4",{className:"font-bold text-lg text-gray-900 mb-2",children:a.title}),e.jsx("p",{className:"text-gray-600 text-sm flex-grow",children:a.description||""})]})]})},a.id))}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between mt-8 gap-4",children:[e.jsxs("div",{className:"text-sm text-gray-600",children:[t("pagination.total"),": ",C]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{className:`px-3 py-2 rounded border ${r<=1?"text-gray-400 border-gray-200 cursor-not-allowed":"text-gray-700 hover:bg-gray-100 border-gray-300"}`,disabled:r<=1,onClick:()=>d(a=>Math.max(1,a-1)),children:t("pagination.prev")}),e.jsxs("span",{className:"px-2 text-gray-600",children:[t("pagination.page")," ",r," / ",l]}),e.jsx("button",{className:`px-3 py-2 rounded border ${r>=l?"text-gray-400 border-gray-200 cursor-not-allowed":"text-gray-700 hover:bg-gray-100 border-gray-300"}`,disabled:r>=l,onClick:()=>d(a=>Math.min(l,a+1)),children:t("pagination.next")})]}),e.jsx("div",{children:e.jsxs("select",{className:"border border-gray-300 rounded px-2 pr-10 py-2 text-sm w-48",value:c,onChange:a=>{d(1),N(Number(a.target.value)||9)},children:[e.jsxs("option",{value:6,children:["6 ",t("pagination.per.page")]}),e.jsxs("option",{value:9,children:["9 ",t("pagination.per.page")]}),e.jsxs("option",{value:12,children:["12 ",t("pagination.per.page")]}),e.jsxs("option",{value:18,children:["18 ",t("pagination.per.page")]})]})})]})]}),e.jsx(B,{links:p})]}),e.jsx(R,{})]})}export{Y 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.