1import{r as e,j as t,u as s,G as r,p as a,H as l,a as n}from"./index-Btz_IaPm.js";import{h as i,i as o,j as c}from"./publicCmsAdapters-CwwZaVO0.js";import{P as d}from"./publicAssets-8pWQjtP4.js";import"./vendor-DIqbiC5Q.js";import"./search-DQyM0wFE.js";const x=({projects:s,onViewDetails:r})=>{const[a,l]=e.useState(""),[n,i]=e.useState(""),[o,c]=e.useState(""),[d,x]=e.useState(1),[m,p]=e.useState("desc"),h=e.useMemo(()=>{const e=new Set(s.map(e=>e.department).filter(Boolean));return Array.from(e).sort((e,t)=>e.localeCompare(t))},[s]),u=e.useMemo(()=>{const e=new Set(s.map(e=>e.year));return Array.from(e).sort((e,t)=>t-e)},[s]),g=e.useMemo(()=>{let e=[...s];if(a){const t=a.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t))}return n&&(e=e.filter(e=>e.department===n)),""!==o&&null!==o&&(e=e.filter(e=>e.year===Number(o))),e.sort((e,t)=>"desc"===m?t.year-e.year:e.year-t.year),e},[s,a,n,o,m]),b=Math.max(1,Math.ceil(g.length/10));e.useEffect(()=>{x(e=>Math.min(Math.max(1,e),b))},[b,g.length]);const f=Math.min(d,b),j=g.slice(10*(f-1),10*f),y=e.useMemo(()=>{let e=Math.max(1,f-Math.floor(2.5)),t=Math.min(b,e+5-1);return e=Math.max(1,t-5+1),Array.from({length:t-e+1},(t,s)=>e+s)},[f,b]);return t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm p-4 sm:p-6 mb-6",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Search Projects"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:"text",value:a,onChange:e=>{l(e.target.value),x(1)},placeholder:"Search by project name...",className:"w-full px-4 py-3 pl-10 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white"}),t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Department"}),t.jsxs("select",{value:n,onChange:e=>{i(e.target.value),x(1)},className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white",children:[t.jsx("option",{value:"",children:"All Departments"}),h.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Year"}),t.jsxs("select",{value:o,onChange:e=>{c(e.target.value),x(1)},className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white",children:[t.jsx("option",{value:"",children:"All Years"}),u.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsx("div",{className:"flex items-end",children:t.jsxs("div",{className:"text-sm text-gray-500",children:[t.jsx("span",{className:"font-black text-[#006BD1]",children:g.length})," projects found"]})})]})}),t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm overflow-hidden mb-6",children:t.jsx("div",{className:"overflow-x-auto -mx-px",children:t.jsxs("table",{className:"w-full min-w-[640px]",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-gray-50 border-b border-gray-100",children:[t.jsx("th",{className:"text-left p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Project Name"}),t.jsx("th",{className:"text-left p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest hidden md:table-cell",children:"Department"}),t.jsx("th",{className:"text-left p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest cursor-pointer hover:bg-gray-100 transition-colors select-none",onClick:()=>{p(e=>"desc"===e?"asc":"desc")},scope:"col",children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:["Year","desc"===m?t.jsx("svg",{className:"w-3.5 h-3.5 text-[#1478d4]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}):t.jsx("svg",{className:"w-3.5 h-3.5 text-[#1478d4]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})]})}),t.jsx("th",{className:"text-left p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Actions"})]})}),t.jsx("tbody",{children:j.length>0?j.map(e=>t.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50 transition-colors",children:[t.jsxs("td",{className:"p-4 align-top",children:[t.jsx("div",{className:"text-sm font-black text-gray-900 uppercase tracking-tight leading-snug",children:e.name}),t.jsx("div",{className:"text-[10px] text-gray-500 mt-1 md:hidden uppercase tracking-tight line-clamp-2",children:e.department})]}),t.jsx("td",{className:"p-4 align-top hidden md:table-cell",children:t.jsx("div",{className:"text-[10px] font-medium text-gray-600 max-w-[220px] leading-relaxed",children:e.department})}),t.jsx("td",{className:"p-4 align-top whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-black text-gray-700",children:e.year})}),t.jsx("td",{className:"p-4 align-top",children:t.jsxs("button",{type:"button",onClick:()=>r(e),className:"bg-[#006BD1] text-white px-4 py-2 rounded text-[9px] font-black uppercase tracking-widest hover:bg-[#1478d4] transition-all inline-flex items-center gap-2",children:["View Details",t.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]},e.id)):t.jsx("tr",{children:t.jsx("td",{colSpan:4,className:"p-12 text-center",children:t.jsx("p",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest",children:"No projects match your filters."})})})})]})})}),g.length>0&&t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4",children:[t.jsxs("div",{className:"text-sm text-gray-500 text-center sm:text-left",children:["Showing"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:10*(f-1)+1})," to"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:Math.min(10*f,g.length)})," of"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:g.length})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>x(e=>Math.max(1,e-1)),disabled:1===f,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Previous"}),t.jsx("div",{className:"flex items-center gap-1",children:y.map(e=>t.jsx("button",{type:"button",onClick:()=>x(e),className:"min-w-[2.5rem] h-10 rounded-sm text-[9px] font-black transition-colors "+(f===e?"bg-[#006BD1] text-white":"border border-gray-200 hover:bg-gray-50 text-gray-600"),children:e},e))}),t.jsx("button",{type:"button",onClick:()=>x(e=>Math.min(b,e+1)),disabled:f===b,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Next"})]})]})]})},m=(e,t)=>
1{const s=String(e||"").toLowerCase();return String(t||"").toLowerCase().includes("pdf")||s.endsWith(".pdf")||s.includes(".pdf?")},p=({compact:e=!1})=>{const s=e?"w-7 h-9":"w-9 h-11",r=e?"text-[7px]":"text-[8px]";return t.jsxs("div",{className:`${s} rounded-md border border-red-700 bg-red-600 flex flex-col overflow-hidden shrink-0`,children:[t.jsx("div",{className:"flex-1 bg-white flex items-center justify-center",children:t.jsxs("svg",{className:"w-4 h-4 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M7 3h7l5 5v13a1 1 0 01-1 1H7a2 2 0 01-2-2V5a2 2 0 012-2z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M14 3v5h5"})]})}),t.jsx("div",{className:`h-4 flex items-center justify-center text-white font-black uppercase tracking-widest ${r}`,children:"PDF"})]})},h=({onNavigate:c})=>{const d=s(),x=r(),h=e.useMemo(()=>{const e=new URLSearchParams(x.search).get("tab");return"jobs"===e||"adverts"===e?"jobs":"tenders"===e?"tenders":"registry"},[x.search]),u=e.useMemo(()=>"shortlists"===new URLSearchParams(x.search).get("jobsTab")?"shortlists":"adverts",[x.search]),[g,b]=e.useState(h),[f,j]=e.useState(u),[y,w]=e.useState(null),[v,k]=e.useState([]),[N,C]=e.useState([]),[S,D]=e.useState([]),[M,L]=e.useState(null),[A,B]=e.useState(!0),P=e.useMemo(()=>N,[N]),F=e.useMemo(()=>S,[S]),T=e.useMemo(()=>v.filter(e=>{const t=String(e.type).toLowerCase(),s=String(e.category||"").toLowerCase(),r=["jobs","job"].includes(s),a=["shortlist","shortlists"].includes(s);return!t.includes("tender")&&!r&&!a}),[v]),W=e.useMemo(()=>{const e=e=>String(e||"").toLowerCase().replace(/\s+/g," ").trim(),t=e=>Boolean(e.urlPath||e.url),s=t=>["","tender","tenders"].includes(e(t)),r=e=>{const t=e.department||e.category;return s(t)?"Department TBA":String(t)},a=new Map;return v.filter(e=>String(e.type).toLowerCase().includes("tender")).forEach(l=>{const n=`${e(l.title)}|${i=l.date,(null==(o=e(i).match(/\b(20\d{2})\b/))?void 0:o[1])||""||e(l.date)}`;var i,o;const c=a.get(n);if(!c||!t(c)&&t(l)){const e=c?r(c):"",t=r(l),s="Department TBA"!==t?t:e||t;a.set(n,{...l,category:s,department:s})}else if(c&&s(c.department||c.category)){const e=r(l);"Department TBA"!==e&&a.set(n,{...c,category:e,department:e})}}),Array.from(a.values())},[v]);e.useEffect(()=>{"projects"!==new URLSearchParams(x.search).get("tab")?(b(h),j(u)):d("/projects-dashboard",{replace:!0})},[h,u,x.search,d]),e.useEffect(()=>{(async()=>{try{const[e,t,s]=await Promise.all([a.listDocuments({per_page:400}),a.listTenders({per_page:400}),a.listDepartments({per_page:400})]),[r,c]=await Promise.all([a.listDocuments({per_page:400,category:"jobs"}),a.listDocuments({per_page:400,category:"shortlisted"})]),d=l(r),x=n(e),m=n(t),p=n(s),h=n(r),u=n(c),g=new Map;p.forEach(e=>{const t=String((null==e?void 0:e.title)||(null==e?void 0:e.name)||"").trim();t&&[null==e?void 0:e.id,null==e?void 0:e.uuid,null==e?void 0:e.department_id].map(e=>String(e||"").trim()).filter(Boolean).forEach(e=>g.set(e,t))});const b=Array.isArray(x)?x.map(i):[],f=Array.isArray(m)?m.map(e=>{const t=g.get(String((null==e?void 0:e.department_id)||"").trim());return o(t?{...e,department:t}:e)}):[],j=Array.isArray(h)?h.filter(e=>"jobs"===String((null==e?void 0:e.category)||"").toLowerCase()):[],y=Array.isArray(u)?u.filter(e=>{const t=String((null==e?void 0:e.category)||"").toLowerCase();return"shortlisted"===t||"shortlist"===t||"shortlists"===t}):[],w=e=>{const t=new Set,s=[];return e.forEach(e=>{const r=String((null==e?void 0:e.id)||"").trim();r&&!t.has(r)&&(t.add(r),s.push(e))}),s},v=w(j.map(i)),N=w(y.map(i));k([...b,...f]),C(v),D(N),L("number"==typeof(null==d?void 0:d.total)?d.total:v.length),console.info("[DataSource][ResourceCentre] API connected.",{documents:b.length,tenders:f.length,jobs:v.length,jobsMetaTotal:"number"==typeof(null==d?void 0:d.total)?d.total:null,shortlists:N.length})}catch(e){console.error("[DataSource][ResourceCentre] Failed to load resources.",e)}finally{B(!1)}})()},[]);const[E,z]=e.useState(""),[_,R]=e.useState(""),[$,H]=e.useState(""),[V,O]=e.useState(""),[Y,I]=e.useState(""),[G,U]=e.useState(""),[K,q]=e.useState(""),[Q,J]=e.useState(""),[X,Z]=e.useState(1),[ee,te]=e.useState(1),[se,re]=e.useState(1),[ae,le]=e.useState(1),ne=e=>{const t=e.match(/\b(20\d{2})\b/);return t?t[1]:null},ie=e.useMemo(()=>T.filter(e=>{const t=e.title.toLowerCase().includes(E.toLowerCase())||e.desc.toLowerCase().includes(E.toLowerCase()),s=!_||e.category===_,r=!$||ne(e.date)===$;return t&&s&&r}),[T,E,_,$]),oe=e.useMemo(()=>W.filter(e=>{const t=e.title.toLowerCase().includes(G.toLowerCase())||e.desc.toLowerCase().includes(G.toLowerCase()),s=!K||e.category===K,r=!Q||ne(e.date)===Q;return t&&s&&r}),[W,G,K,Q]),ce=e.useMemo(()=>P.filter(e=>{const t=e.title.toLowerCase().includes(V.toLowerCase())||e.desc.toLowerCase().includes(V.toLowerCase()),s=!Y||ne(e.date)===Y;return t&&s}),[P,V,Y]),de=e.useMemo(()=>F.filter(e=>{const t=e.title.toLowerCase().includes(V.toLowerCase())||e.desc.toLowerCase().includes(V.toLowerCase()),s=!Y||ne(e.date)===Y;return t&&s}),[F,V,Y]);e.useEffect(()=>{Z(1),te(1),re(1),le(1)},[ie.length,oe.length,ce.length,de.length]);const xe=Math.max(1,Math.ceil(ie.length/8)),me=Math.max(1,Math.ceil(oe.length/8)),pe=Math.max(1,Math.ceil(ce.length/8)),he=Math.max(1,Math.ceil(de.length/8)),ue=Math.min(X,xe),ge=Math.min(ee,me),be=Math.min(se,pe),fe=Math.min(ae,he),je=ie.slice(8*(ue-1),8*ue),ye=oe.slice(8*(ge-1),8*ge),we=ce.slice(8*(be-1),8*be),ve=de.slice(8*(fe-1),8*fe),ke=e.useMemo(()=>Array.from(new Set(T.map(e=>e.category))).sort(),[T]),Ne=e.useMemo(()=>Array.from(new Set(T.map(e=>
1ne(e.date)).filter(Boolean))).sort().reverse(),[T]),Ce=e.useMemo(()=>Array.from(new Set(P.map(e=>ne(e.date)).filter(Boolean))).sort().reverse(),[P]),Se=e.useMemo(()=>Array.from(new Set(F.map(e=>ne(e.date)).filter(Boolean))).sort().reverse(),[F]),De=e.useMemo(()=>Array.from(new Set(W.map(e=>e.category))).sort(),[W]),Me=e.useMemo(()=>Array.from(new Set(W.map(e=>ne(e.date)).filter(Boolean))).sort().reverse(),[W]),Le=e=>{switch(e){case"Open":case"Active":return"bg-[#66C013] text-white";case"Closed":case"Awarded":return"bg-[#FE9000] text-white";case"Published":case"Official":return"bg-[#006BD1] text-white";default:return"bg-gray-100 text-gray-800 border-gray-200"}},Ae=e=>{const t=e.urlPath||e.url;t?window.open(t,"_blank","noopener,noreferrer"):alert("No downloadable file is attached to this record yet.")},Be=()=>{w(null)};return t.jsxs("div",{className:"pt-28 sm:pt-32 min-h-screen bg-[#F9FAFB] flex flex-col relative overflow-x-hidden",children:[t.jsxs("div",{className:"max-w-7xl mx-auto w-full px-4 sm:px-6 py-8 sm:py-12 flex-grow font-sans",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-stretch sm:items-center mb-8 sm:mb-12 gap-4 sm:gap-6",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"text-[#65be14] text-[10px] font-black uppercase tracking-[0.4em] mb-2 block",children:"Governance & Transparency"}),t.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-gray-900 uppercase tracking-tighter leading-tight",children:"Resource Centre"}),t.jsx("p",{className:"text-gray-500 text-xs sm:text-sm mt-2 font-medium max-w-prose",children:"Access public records, tenders, adverts, and official documents."})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[t.jsx("button",{type:"button",onClick:()=>d("/projects-dashboard"),className:"shrink-0 text-[10px] font-black uppercase tracking-widest text-[#1478d4] border border-[#1478d4] px-5 sm:px-6 py-3 sm:py-4 rounded hover:bg-[#1478d4] hover:text-white transition-all shadow-sm w-full sm:w-auto",children:"Projects Dashboard"}),t.jsx("button",{type:"button",onClick:()=>c("home"),className:"shrink-0 text-[10px] font-black uppercase tracking-widest text-gray-400 hover:text-gray-900 border border-gray-200 px-5 sm:px-6 py-3 sm:py-4 rounded hover:bg-white transition-all shadow-sm w-full sm:w-auto",children:"â Home"})]})]}),t.jsxs("div",{className:"flex gap-6 sm:gap-12 border-b border-gray-100 mb-12 overflow-x-auto pb-1 -mx-6 px-6 sm:mx-0 sm:px-0",children:[t.jsxs("button",{type:"button",onClick:()=>b("registry"),className:"pb-6 text-xs sm:text-sm font-black uppercase tracking-[0.4em] transition-all relative shrink-0 "+("registry"===g?"text-black":"text-black/70 hover:text-black"),children:["Downloads","registry"===g&&t.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-1 bg-[#1478d4]"})]}),t.jsxs("button",{type:"button",onClick:()=>b("tenders"),className:"pb-6 text-xs sm:text-sm font-black uppercase tracking-[0.4em] transition-all relative shrink-0 "+("tenders"===g?"text-black":"text-black/70 hover:text-black"),children:["Tenders","tenders"===g&&t.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-1 bg-[#1478d4]"})]}),t.jsxs("button",{type:"button",onClick:()=>b("jobs"),className:"pb-6 text-xs sm:text-sm font-black uppercase tracking-[0.4em] transition-all relative shrink-0 "+("jobs"===g?"text-black":"text-black/70 hover:text-black"),children:["Vacancies","jobs"===g&&t.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-1 bg-[#1478d4]"})]})]}),t.jsxs("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-700",children:[A&&t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"text-gray-400 text-sm font-bold uppercase tracking-widest animate-pulse",children:"Loading resources..."})}),!A&&"jobs"===g&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mb-4 flex gap-2 sm:gap-3",children:[t.jsx("button",{type:"button",onClick:()=>j("adverts"),className:"px-4 py-2 text-[9px] font-black uppercase tracking-widest rounded border transition-all "+("adverts"===f?"bg-[#1478d4] text-white border-[#1478d4]":"bg-white text-gray-500 border-gray-200 hover:border-[#1478d4]/40 hover:text-[#1478d4]"),children:"Adverts"}),t.jsx("button",{type:"button",onClick:()=>j("shortlists"),className:"px-4 py-2 text-[9px] font-black uppercase tracking-widest rounded border transition-all "+("shortlists"===f?"bg-[#1478d4] text-white border-[#1478d4]":"bg-white text-gray-500 border-gray-200 hover:border-[#1478d4]/40 hover:text-[#1478d4]"),children:"Shortlists"})]}),t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm p-4 sm:p-6 mb-8",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[t.jsxs("div",{className:"relative",children:[t.jsxs("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:["Search ","adverts"===f?"Adverts":"Shortlists"]}),t.jsx("input",{type:"text",value:V,onChange:e=>O(e.target.value),placeholder:"Search by title or ref...",className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Year"}),t.jsxs("select",{value:Y,onChange:e=>I(e.target.value),className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all",children:[t.jsx("option",{value:"",children:"All Years"}),("adverts"===f?Ce:Se).map(e=>t.jsx("option",{value:e,children:e},e))]})]}),"adverts"===f&&t.jsx("div",{className:"flex items-end",children:t.jsxs("p",{className:"pb-3 text-[10px] font-black uppercase tracking-widest text-gray-400",children:["API jobs total: ",t.jsx("span",{className:"text-[#1478d4]",children:M??P.length})]})})]})}),0===("adverts"===f?we:ve).length?t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm p-10 text-center",children:t.jsxs("p",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest italic",children:["No ","adverts"===f?"adverts":"shortlists"," available."]})}):t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm overflow-x-auto",children:t.jsxs("table",{className:"w-full min-w-[700px] text-left",children:[t.jsx("thead",{className:"bg-gray-50 border-b border-gray-100",children:t.jsxs("tr",{children:[t.jsx("th",{className:"p-3 sm:p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Title"}),t.jsx("th",{className:"p-3 sm:p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Date"}),t.jsx("th",{className:"p-3 sm:p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Status"}),t.jsx("th",{className:"p-3 sm:p-4 text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Download"})]})}),t.jsx("tbody",{children:("adverts"===f?we:ve).map(e=>t.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50 transition-colors",children:[t.jsx("td",{className:"p-3 sm:p-4",children:t.jsxs("div",{children:[t.jsx("div",{className:"text-xs sm:text-sm font-black text-gray-900 uppercase tracking-tight leading-snug",children:e.title}),t.jsx("div",{className:"text-[10px] text-gray-500 mt-1 line-clamp-2",children:e.desc})]})}),t.jsx("td",{className:"p-3 sm:p-4 text-[10px] font-medium text-gray-600",children:e.date}),t.jsx("td",{className:"p-3 sm:p-4",children:t.jsx("span",{className:`inline-block px-2 sm:px-3 py-1 text-[8px] font-black uppercase tracking-widest rounded ${Le(e.status)}`,children:e.status})}),t.jsx("td",{className:"p-3 sm:p-4",children:e.urlPath||e.url?t.jsxs("div",{className:"inline-flex items-center gap-2",children:[m(e.urlPath||e.url,e.type)&&t.jsx(p,{compact:!0}),t.jsx("a",{href:e.urlPath||e.url,target:"_blank",rel:"noopener noreferrer",download:!0,className:"inline-flex items-center gap-2 px-3 py-2 text-[9px] font-black uppercase tracking-widest text-[#1478d4] border border-[#1478d4] rounded hover:bg-[#1478d4] hover:text-white transition-all",children:"Download"})]}):t.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400",children:"No file"})})]},e.id))})]})}),"adverts"===f?pe>1:he>1?t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4 mt-6",children:[t.jsxs("div",{className:"text-sm text-gray-500 text-center sm:text-left",children:["Showing"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:8*(("adverts"===f?be:fe)-1)+1})," to"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:Math.min(8*("adverts"===f?be:fe),"adverts"===f?ce.length:de.length)})," of"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:"adverts"===f?ce.length:de.length})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>"adverts"===f?re(e=>Math.max(1,e-1)):le(e=>Math.max(1,e-1)),disabled:"adverts"===f?1===be:1===fe,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Previous"}),Array.from({length:"adverts"===f?pe:he},(e,t)=>t+1).map(e=>t.jsx("button",{type:"button",onClick:()=>"adverts"===f?re(e):le(e),className:"min-w-[2.5rem] h-10 rounded-sm text-[9px] font-black transition-colors "+(("adverts"===f?be:fe)===e?"bg-[#006BD1] text-white":"border border-gray-200 hover:bg-gray-50 text-gray-600"),children:e},e)),t.jsx("button",{type:"button",onClick:()=>"adverts"===f?re(e=>Math.min(pe,e+1)):le(e=>Math.min(he,e+1)),disabled:"adverts"===f?be===pe:fe===he,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Next"})]})]}):null]}),!A&&"registry"===g&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm p-4 sm:p-6 mb-8",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Search Documents"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:"text",value:E,onChange:e=>z(e.target.value),placeholder:"Search by title or ref...",className:"w-full px-4 py-3 pl-10 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all"}),t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Category"}
1),t.jsxs("select",{value:_,onChange:e=>R(e.target.value),className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all",children:[t.jsx("option",{value:"",children:"All Categories"}),ke.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Year"}),t.jsxs("select",{value:$,onChange:e=>H(e.target.value),className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all",children:[t.jsx("option",{value:"",children:"All Years"}),Ne.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsx("div",{className:"flex items-end",children:t.jsxs("div",{className:"text-sm text-gray-500 pb-3",children:[t.jsx("span",{className:"font-black text-[#006BD1]",children:ie.length})," documents found"]})})]})}),0===ie.length?t.jsx("div",{className:"text-center py-20 bg-white border border-gray-100 rounded-sm",children:t.jsx("p",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest italic",children:"No public records match your filters."})}):t.jsx("div",{className:"space-y-4 mb-12 sm:mb-20",children:je.map(e=>t.jsxs("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm hover:shadow-md transition-all p-4 sm:p-6 group flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-6",children:[t.jsx("div",{className:"flex sm:flex-col items-center sm:items-start gap-4 sm:gap-1 shrink-0",children:m(e.urlPath||e.url,e.type)&&t.jsx(p,{})}),t.jsxs("div",{className:"flex-grow min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[t.jsx("span",{className:`px-2 py-0.5 text-[7px] font-black uppercase tracking-widest rounded ${Le(e.status)}`,children:e.status}),t.jsx("span",{className:"text-[9px] font-medium text-[#FE9000] uppercase tracking-widest",children:e.category})]}),t.jsx("h3",{className:"text-base font-black text-gray-900 uppercase tracking-tight mb-1 group-hover:text-[#006BD1] transition-colors truncate",children:e.title}),t.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed uppercase tracking-tight line-clamp-1",children:e.desc})]}),t.jsxs("div",{className:"flex items-center justify-between sm:justify-end gap-6 shrink-0 border-t sm:border-t-0 pt-4 sm:pt-0",children:[t.jsxs("div",{className:"text-left sm:text-right",children:[t.jsx("span",{className:"text-[9px] text-gray-400 uppercase tracking-widest block font-black mb-1",children:e.type}),t.jsx("span",{className:"text-[10px] font-medium text-gray-900 whitespace-nowrap",children:e.date})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:()=>Ae(e),className:"bg-white border border-gray-200 text-[#006BD1] px-4 py-2.5 rounded text-[9px] font-black uppercase tracking-widest hover:bg-gray-50 transition-all",title:"Download",children:"Download"}),t.jsx("button",{onClick:()=>Ae(e),className:"bg-[#006BD1] text-white p-2.5 rounded hover:bg-[#1478d4] transition-all",title:"Download",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a2 2 0 002 2h12a2 2 0 002-2v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]})]})]},e.id))}),xe>1&&t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4 mt-6",children:[t.jsxs("div",{className:"text-sm text-gray-500 text-center sm:text-left",children:["Showing"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:8*(ue-1)+1})," to"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:Math.min(8*ue,ie.length)})," of"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:ie.length})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>Z(e=>Math.max(1,e-1)),disabled:1===ue,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Previous"}),Array.from({length:xe},(e,t)=>t+1).map(e=>t.jsx("button",{type:"button",onClick:()=>Z(e),className:"min-w-[2.5rem] h-10 rounded-sm text-[9px] font-black transition-colors "+(ue===e?"bg-[#006BD1] text-white":"border border-gray-200 hover:bg-gray-50 text-gray-600"),children:e},e)),t.jsx("button",{type:"button",onClick:()=>Z(e=>Math.min(xe,e+1)),disabled:ue===xe,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Next"})]})]})]}),"tenders"===g&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm p-4 sm:p-6 mb-8",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Search Tenders"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:"text",value:G,onChange:e=>U(e.target.value),placeholder:"Search by title, ref or desc...",className:"w-full px-4 py-3 pl-10 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all"}),t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Department"}),t.jsxs("select",{value:K,onChange:e=>q(e.target.value),className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all",children:[t.jsx("option",{value:"",children:"All Departments"}),De.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Year"}),t.jsxs("select",{value:Q,onChange:e=>J(e.target.value),className:"w-full px-4 py-3 text-sm border border-gray-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-[#1478d4]/30 focus:border-[#1478d4] bg-white transition-all",children:[t.jsx("option",{value:"",children:"All Years"}),Me.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsx("div",{className:"flex items-end",children:t.jsxs("div",{className:"text-sm text-gray-500 pb-3",children:[t.jsx("span",{className:"font-black text-[#006BD1]",children:oe.length})," tenders found"]}
1)})]})}),0===oe.length?t.jsx("div",{className:"text-center py-20 bg-white border border-gray-100 rounded-sm",children:t.jsx("p",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest italic",children:"No tenders match your filters."})}):t.jsx("div",{className:"bg-white border border-gray-100 rounded-sm shadow-sm overflow-hidden mb-12 sm:mb-20",children:t.jsx("div",{className:"overflow-x-auto overscroll-x-contain -mx-px",children:t.jsxs("table",{className:"w-full min-w-[640px]",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-gray-50 border-b border-gray-100",children:[t.jsx("th",{className:"text-left p-3 sm:p-4 text-[10px] sm:text-xs font-black text-black uppercase tracking-widest",children:"Title"}),t.jsx("th",{className:"text-left p-3 sm:p-4 text-[10px] sm:text-xs font-black text-black uppercase tracking-widest hidden lg:table-cell",children:"Department"}),t.jsx("th",{className:"text-left p-3 sm:p-4 text-[10px] sm:text-xs font-black text-black uppercase tracking-widest hidden md:table-cell",children:"Closing Date"}),t.jsx("th",{className:"text-left p-3 sm:p-4 text-[10px] sm:text-xs font-black text-black uppercase tracking-widest",children:"Status"}),t.jsx("th",{className:"text-left p-3 sm:p-4 text-[10px] sm:text-xs font-black text-black uppercase tracking-widest",children:"Downloads"})]})}),t.jsx("tbody",{children:ye.map(e=>t.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50 transition-colors",children:[t.jsxs("td",{className:"p-3 sm:p-4 align-top",children:[t.jsx("div",{className:"text-xs sm:text-sm font-black text-gray-900 uppercase tracking-tight leading-snug",children:e.title}),t.jsx("div",{className:"text-[10px] text-gray-500 mt-1 line-clamp-2",children:e.desc}),t.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[10px] text-gray-500 md:hidden",children:[t.jsx("span",{className:"font-medium uppercase",children:e.category}),t.jsx("span",{children:e.date})]})]}),t.jsx("td",{className:"p-3 sm:p-4 align-top hidden lg:table-cell",children:t.jsx("span",{className:"text-[10px] font-medium text-gray-600 uppercase",children:e.category})}),t.jsx("td",{className:"p-3 sm:p-4 align-top hidden md:table-cell",children:t.jsx("span",{className:"text-[10px] font-medium text-gray-600",children:e.date})}),t.jsx("td",{className:"p-3 sm:p-4 align-top",children:t.jsx("span",{className:`inline-block px-2 sm:px-3 py-1 text-[8px] font-black uppercase tracking-widest rounded ${Le(e.status)}`,children:e.status})}),t.jsx("td",{className:"p-3 sm:p-4 align-top",children:e.urlPath||e.url?t.jsxs("div",{className:"flex items-center gap-2",children:[m(e.urlPath||e.url,e.type)&&t.jsx(p,{compact:!0}),t.jsx("a",{href:e.urlPath||e.url,target:"_blank",rel:"noopener noreferrer",download:!0,style:{display:"inline-block",padding:"8px 12px",fontSize:"12px",background:"var(--gold)",color:"#000",borderRadius:"6px",textDecoration:"none",fontWeight:"600"},children:"Download Tender"})]}):t.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400",children:"No file"})})]},e.id))})]})})}),me>1&&t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4 mt-6",children:[t.jsxs("div",{className:"text-sm text-gray-500 text-center sm:text-left",children:["Showing"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:8*(ge-1)+1})," to"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:Math.min(8*ge,oe.length)})," of"," ",t.jsx("span",{className:"font-black text-[#006BD1]",children:oe.length})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>te(e=>Math.max(1,e-1)),disabled:1===ge,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Previous"}),Array.from({length:me},(e,t)=>t+1).map(e=>t.jsx("button",{type:"button",onClick:()=>te(e),className:"min-w-[2.5rem] h-10 rounded-sm text-[9px] font-black transition-colors "+(ge===e?"bg-[#006BD1] text-white":"border border-gray-200 hover:bg-gray-50 text-gray-600"),children:e},e)),t.jsx("button",{type:"button",onClick:()=>te(e=>Math.min(me,e+1)),disabled:ge===me,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Next"})]})]})]})]})]}),y&&t.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",onClick:Be,children:t.jsxs("div",{className:"bg-white rounded-lg shadow-2xl max-w-lg w-full max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"p-6 border-b border-gray-100",children:[t.jsx("div",{className:"flex justify-end items-start mb-4",children:t.jsx("button",{onClick:Be,className:"text-gray-400 hover:text-gray-900",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),t.jsx("h3",{className:"text-xl font-black text-gray-900 uppercase tracking-tight mb-3",children:y.title}),t.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[t.jsxs("span",{className:`border px-3 py-1 text-[8px] font-black uppercase tracking-widest rounded flex items-center gap-1 ${(e=>{switch(e){case"Tender":return"border-emerald-500 text-emerald-500";case"Budget":return"border-amber-500 text-amber-500";case"Report":return"border-blue-500 text-blue-500";case"Strategy":return"border-indigo-500 text-indigo-500";case"Gazette":return"border-rose-500 text-rose-500";default:return"border-gray-500 text-gray-500"}})(y.type)}`,children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),y.type]}),t.jsx("span",{className:`px-3 py-1 text-[8px] font-black uppercase tracking-widest rounded ${Le(y.status)}`,children:y.status})]})]}),t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsx("span",{className:"text-[9px] text-gray-400 uppercase tracking-widest block mb-1",children:"Description"}),t.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:y.desc})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-[9px] text-gray-400 uppercase tracking-widest block mb-1",children:"Category"}),t.jsx("span",{className:"text-sm font-medium text-gray-900",children:y.category})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-[9px] text-gray-400 uppercase tracking-widest block mb-1",children:"Date"}),t.jsx("span",{className:"text-sm font-medium text-gray-900",children:y.date})]})]}),t.jsxs("button",{onClick:()=>{Ae(y),Be()},className:"w-full bg-[#006BD1] text-white py-3 rounded text-[10px] font-black uppercase tracking-[0.4em] hover:bg-[#1478d4] transition-all flex items-center justify-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a2 2 0 002 2h12a2 2 0 002-2v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download Document"]})]})]})})]})},u=(e,t)=>
1{const s=String(e||"").toLowerCase();return String(t||"").toLowerCase().includes("pdf")||s.endsWith(".pdf")||s.includes(".pdf?")},g=({fileType:e})=>{const s="pdf"===e;return t.jsxs("div",{className:"w-16 h-20 rounded-xl border flex flex-col overflow-hidden "+(s?"bg-red-600 border-red-700":"bg-blue-600 border-blue-700"),children:[t.jsx("div",{className:"flex-1 bg-white flex items-center justify-center",children:t.jsxs("svg",{className:"w-7 h-7 "+(s?"text-red-600":"text-blue-600"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M7 3h7l5 5v13a1 1 0 01-1 1H7a2 2 0 01-2-2V5a2 2 0 012-2z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M14 3v5h5"})]})}),t.jsx("div",{className:"h-6 flex items-center justify-center text-white text-[9px] font-black uppercase tracking-widest",children:s?"PDF":"DOC"})]})},b=({onNavigate:s})=>{const[r,l]=e.useState("All"),[o,c]=e.useState(""),[d,x]=e.useState([]),[m,p]=e.useState(!0),[h,b]=e.useState(1);e.useEffect(()=>{(async()=>{try{const e=await a.listDocuments({per_page:400}),t=n(e),s=(Array.isArray(t)?t:[]).map(e=>{const t=i(e),s=t.urlPath||t.url||"";return{id:t.id,title:t.title,category:t.category,size:t.type||"Document",url:s,fileType:u(s,t.type||"Document")?"pdf":"doc"}}).filter(e=>Boolean(e.url));x(s),console.info("[DataSource][PublicRegistry] API connected.",{documents:s.length})}catch(e){console.error("[DataSource][PublicRegistry] Failed to load documents.",e)}finally{p(!1)}})()},[]),e.useEffect(()=>{b(1)},[r,o]);const f=["All",...Array.from(new Set(d.map(e=>e.category)))],j=d.filter(e=>{const t="All"===r||e.category===r,s=e.title.toLowerCase().includes(o.toLowerCase());return t&&s}),y=Math.max(1,Math.ceil(j.length/12)),w=Math.min(h,y),v=j.slice(12*(w-1),12*w);return t.jsx("div",{className:"min-h-screen bg-white pt-[120px] pb-24 font-sans",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-12",children:[t.jsxs("header",{className:"mb-20 text-center max-w-4xl mx-auto",children:[t.jsxs("div",{className:"flex items-center justify-center gap-4 mb-6",children:[t.jsx("span",{className:"bg-[#fd8e01] w-12 h-1.5 rounded-full block"}),t.jsx("span",{className:"text-[#fd8e01] text-[10px] font-black uppercase tracking-[0.6em]",children:"Document Repository"})]}),t.jsxs("h1",{className:"text-6xl lg:text-8xl font-black text-gray-900 uppercase tracking-tighter leading-none mb-10",children:["Public Registry ",t.jsx("br",{})," & ",t.jsx("span",{className:"text-[#fd8e01]",children:"Library"})]}),t.jsx("p",{className:"text-xl text-gray-500 font-light leading-relaxed",children:"The official central archive for all Kilifi County Government strategic plans, budget summaries, and policy frameworks. Open access for a transparent devolution."})]}),t.jsxs("div",{className:"mb-16 bg-gray-50 p-8 rounded-[3rem] border border-gray-100 flex flex-col md:flex-row gap-8 items-center justify-between shadow-sm",children:[t.jsxs("div",{className:"relative w-full md:w-1/2",children:[t.jsx("input",{type:"text",placeholder:"Search archive...",className:"w-full bg-white border border-gray-100 p-5 rounded-2xl text-[12px] font-bold focus:outline-none focus:ring-2 focus:ring-[#fd8e01]/20",value:o,onChange:e=>c(e.target.value)}),t.jsx("svg",{className:"w-5 h-5 absolute right-5 top-1/2 -translate-y-1/2 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),t.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2 w-full md:w-auto",children:f.map(e=>t.jsx("button",{onClick:()=>l(e),className:"px-8 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all whitespace-nowrap "+(r===e?"bg-gray-900 text-white shadow-xl":"bg-white text-gray-400 border border-gray-100 hover:border-gray-200"),children:e},e))})]}),m&&t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"text-gray-400 text-sm font-bold uppercase tracking-widest animate-pulse",children:"Loading documents..."})}),!m&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-10",children:v.length>0?v.map(e=>t.jsxs("div",{className:"group bg-white p-10 rounded-[3rem] border border-gray-100 hover:shadow-2xl transition-all duration-500 flex flex-col h-full relative overflow-hidden",children:[t.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-gray-50 rounded-bl-full group-hover:bg-[#fd8e01]/10 transition-colors"}),t.jsx("div",{className:"mb-10",children:"pdf"===e.fileType?t.jsx("div",{className:"w-24 h-20 bg-white border border-gray-200 rounded-xl overflow-hidden",children:t.jsx("object",{data:`${e.url}#page=1&view=FitH&zoom=page-fit`,type:"application/pdf",className:"w-full h-full",children:t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx(g,{fileType:"pdf"})})})}):t.jsx(g,{fileType:"doc"})}),t.jsx("span",{className:"text-[10px] font-black text-[#fd8e01]/80 uppercase tracking-widest mb-4 block",children:e.category}),t.jsx("h3",{className:"text-xl font-black text-gray-900 uppercase tracking-tight mb-8 leading-tight flex-grow line-clamp-3 group-hover:text-gray-900 transition-colors",children:e.title}),t.jsxs("div",{className:"pt-8 border-t border-gray-50 flex items-center justify-between",children:[t.jsx("span",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest",children:e.size}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",download:!0,className:"flex items-center gap-3 text-[10px] font-black text-[#fd8e01] uppercase tracking-widest hover:translate-x-1 transition-transform",children:["Download ",t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})]})]},e.id)):t.jsx("div",{className:"col-span-full py-20 text-center",children:t.jsx("p",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest",children:"No documents found matching your search."})})}),y>1&&t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4 mt-10",children:[t.jsxs("div",{className:"text-sm text-gray-500 text-center sm:text-left",children:["Showing"," ",t.jsx("span",{className:"font-black text-[#fd8e01]",children:12*(w-1)+1})," to"," ",t.jsx("span",{className:"font-black text-[#fd8e01]",children:Math.min(12*w,j.length)})," of"," ",t.jsx("span",{className:"font-black text-[#fd8e01]",children:j.length})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>b(e=>Math.max(1,e-1)),disabled:1===w,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Previous"}),Array.from({length:y},(e,t)=>t+1).map(e=>t.jsx("button",{type:"button",onClick:()=>b(e),className:"min-w-[2.5rem] h-10 rounded-sm text-[9px] font-black transition-colors "+(w===e?"bg-[#fd8e01] text-white":"border border-gray-200 hover:bg-gray-50 text-gray-600"),children:e},e)),t.jsx("button",{type:"button",onClick:()=>b(e=>Math.min(y,e+1)),disabled:w===y,className:"px-4 py-2 border border-gray-200 rounded-sm text-[9px] font-black uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-colors",children:"Next"})]})]}),t.jsxs("section",{className:"mt-24 p-16 bg-gray-900 rounded-[4rem] text-white text-center relative overflow-hidden",children:[t.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-[#fd8e01]/10 rounded-full -mr-32 -mt-32 blur-3xl"}),t.jsxs("h2",{className:"text-4xl font-black uppercase tracking-tight mb-6",children:["Need a Specific ",t.jsx("span",{className:"text-[#fd8e01]",children:"Article?"})]}),t.jsx("p",{className:"text-white/60 text-lg max-w-2xl mx-auto mb-10 font-medium",children:"Use our official contact portal to request documents not currently listed in the digital registry. We are committed to an open-government policy."}),t.jsx("button",{onClick:()=>s("contact"),className:"bg-[#fd8e01] text-white px-12 py-6 rounded-2xl font-black text-[10px] uppercase tracking-[0.4em] shadow-xl hover:scale-105 active:scale-95 transition-all",children:"Request Access"})]})]})})},f=(e,t)=>{const s=String(e||"").toLowerCase();return String(t||"").toLowerCase().includes("pdf")||s.endsWith(".pdf")||s.includes(".pdf?")},j=({fileType:e})=>{const s="pdf"===e;return t.jsxs("div",{className:"w-16 h-20 rounded-xl border flex flex-col overflow-hidden "+(s?"bg-red-600 border-red-700":"bg-blue-600 border-blue-700"),
1children:[t.jsx("div",{className:"flex-1 bg-white flex items-center justify-center",children:t.jsxs("svg",{className:"w-7 h-7 "+(s?"text-red-600":"text-blue-600"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M7 3h7l5 5v13a1 1 0 01-1 1H7a2 2 0 01-2-2V5a2 2 0 012-2z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M14 3v5h5"})]})}),t.jsx("div",{className:"h-6 flex items-center justify-center text-white text-[9px] font-black uppercase tracking-widest",children:s?"PDF":"DOC"})]})},y=({onNavigate:s})=>{const[r,l]=e.useState([]),[o,c]=e.useState(!0);return e.useEffect(()=>{(async()=>{try{const e=await a.listDocuments({per_page:400}),t=n(e),s=(Array.isArray(t)?t:[]).map(e=>{const t=i(e),s=t.urlPath||t.url||"";return{id:t.id,title:t.title,category:t.category,date:t.date,size:t.type||"PDF",url:s,fileType:f(s,t.type||"PDF")?"pdf":"doc"}}).filter(e=>Boolean(e.url));l(s),console.info("[DataSource][FinancialDocs] API connected.",{documents:s.length})}catch(e){console.error("[DataSource][FinancialDocs] Failed to load documents.",e),l([])}finally{c(!1)}})()},[]),o?t.jsx("div",{className:"min-h-screen bg-gray-50 pt-24 sm:pt-28 md:pt-32 pb-16 sm:pb-24 flex items-center justify-center",children:t.jsx("div",{className:"text-gray-400 text-sm font-bold uppercase tracking-widest animate-pulse",children:"Loading financial documents..."})}):t.jsx("div",{className:"min-h-screen bg-gray-50 pt-24 sm:pt-28 md:pt-32 pb-16 sm:pb-24",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-12",children:[t.jsxs("header",{className:"mb-10 sm:mb-16",children:[t.jsx("span",{className:"text-[#1478d4] text-[10px] font-black uppercase tracking-[0.35em] sm:tracking-[0.5em] mb-4 block text-center lg:text-left",children:"Budget & Finance Center"}),t.jsxs("h1",{className:"text-3xl sm:text-4xl md:text-5xl lg:text-7xl font-black text-gray-900 uppercase tracking-tighter leading-tight sm:leading-none mb-6 sm:mb-8 text-center lg:text-left",children:["Financial Documents ",t.jsx("br",{className:"hidden sm:block"})," & Transparency Reports"]}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-500 font-light max-w-3xl leading-relaxed mx-auto lg:mx-0 text-center lg:text-left",children:"Access up-to-date budget allocations, expenditure reports, and external audit findings for the Kilifi County Government."})]}),r.length>0?t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8 lg:gap-10",children:r.map(e=>t.jsxs("div",{className:"bg-white p-6 sm:p-8 lg:p-10 rounded-2xl sm:rounded-[40px] shadow-sm border border-gray-100 hover:shadow-2xl hover:-translate-y-1 sm:hover:-translate-y-2 transition-all group flex flex-col justify-between min-h-[380px] sm:min-h-[420px] lg:h-[450px]",children:[t.jsxs("div",{children:[t.jsx("div",{className:"mb-8",children:"pdf"===e.fileType?t.jsx("div",{className:"w-24 h-20 bg-white border border-gray-200 rounded-xl overflow-hidden",children:t.jsx("object",{data:`${e.url}#page=1&view=FitH&zoom=page-fit`,type:"application/pdf",className:"w-full h-full",children:t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx(j,{fileType:"pdf"})})})}):t.jsx(j,{fileType:"doc"})}),t.jsx("span",{className:"text-[10px] font-black text-[#FE9000] uppercase tracking-widest block mb-1",children:e.category}),t.jsx("h3",{className:"text-2xl font-black text-gray-900 mb-6 group-hover:text-[#1478d4] transition-colors line-clamp-3 leading-[1.1]",children:e.title}),t.jsxs("span",{className:"text-xs font-bold text-gray-300 uppercase tracking-widest",children:["PUBLISHED: ",e.date]})]}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",download:!0,className:"mt-8 bg-gray-900 text-white w-full py-5 rounded-3xl font-black text-[10px] uppercase tracking-widest text-center shadow-xl hover:bg-[#1478d4] transition-all flex items-center justify-center gap-4",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download Document"]})]},e.id))}):t.jsx("div",{className:"text-center py-20",children:t.jsx("p",{className:"text-gray-400 text-sm font-bold uppercase tracking-widest",children:"No financial documents available."})}),t.jsxs("section",{className:"mt-16 sm:mt-24 bg-white p-6 sm:p-10 lg:p-20 rounded-3xl sm:rounded-[60px] shadow-2xl border border-gray-100 grid grid-cols-1 lg:grid-cols-2 gap-10 sm:gap-16 items-center",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-4xl font-black text-gray-900 uppercase tracking-tight mb-8 leading-[1]",children:["Audit Performance ",t.jsx("br",{})," Overview"]}),t.jsx("p",{className:"text-lg text-gray-500 font-light leading-relaxed mb-8",children:"Kilifi County consistently maintains high standards of financial accountability. Our annual audits are performed by the Office of the Auditor General and are made available to the public within 6 months of the fiscal year-end."}),t.jsxs("div",{className:"flex gap-10",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-4xl font-black text-[#1478d4] tracking-tighter",children:"98.5%"}),t.jsx("span",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mt-2 whitespace-nowrap",children:"Budget Accuracy"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-4xl font-black text-emerald-600 tracking-tighter",children:"UNQUALIFIED"}),t.jsx("span",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mt-2 whitespace-nowrap",children:"Latest Audit Opinion"})]})]})]}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"aspect-square bg-blue-600 rounded-[50px] overflow-hidden translate-x-4 translate-y-4 shadow-2xl transition-transform hover:scale-[1.02] duration-700",children:t.jsx("img",{src:d,className:"w-full h-full object-cover object-center grayscale opacity-50 contrast-125",alt:"Kilifi County â transparency and public finance",decoding:"async",sizes:"(max-width: 1024px) 100vw, 50vw"})}),t.jsxs("div",{className:"absolute inset-0 bg-gradient-to-tr from-black/80 to-transparent flex flex-col justify-end p-12 rounded-[50px]",children:[t.jsx("span",{className:"text-[10px] font-black text-blue-400 uppercase tracking-widest mb-2",children:"Transparency Node"}),t.jsx("p",{className:"text-white text-xl font-medium tracking-tight leading-relaxed",children:"Financial transparency is not just an obligation; it's our promise to the citizens of Kilifi."})]})]})]})]})})},w=({onNavigate:r})=>{const l=s(),[i,o]=e.useState([]),[d,m]=e.useState(!0);e.useEffect(()=>{(async()=>{try{const[e,t]=await Promise.all([a.listProjects({per_page:400}),a.listDepartments({per_page:400})]),s=n(e),r=n(t),l=new Map;
1r.forEach(e=>{const t=String((null==e?void 0:e.title)||(null==e?void 0:e.name)||"").trim();t&&[null==e?void 0:e.id,null==e?void 0:e.uuid,null==e?void 0:e.department_id].map(e=>String(e||"").trim()).filter(Boolean).forEach(e=>l.set(e,t))});const i=Array.isArray(s)?s.map((e,t)=>{const s=l.get(String((null==e?void 0:e.department_id)||"").trim());return c(s?{...e,department:s}:e,t)}):[];o(i),console.info("[DataSource][ProjectsDashboard] API connected.",{projects:i.length})}catch(e){console.error("[DataSource][ProjectsDashboard] Failed to load projects.",e)}finally{m(!1)}})()},[]);return t.jsx("div",{className:"pt-28 sm:pt-32 min-h-screen bg-[#F9FAFB] flex flex-col relative overflow-x-hidden",children:t.jsxs("div",{className:"max-w-7xl mx-auto w-full px-4 sm:px-6 py-8 sm:py-12 flex-grow font-sans",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-stretch sm:items-center mb-8 sm:mb-12 gap-4 sm:gap-6",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"text-[#65be14] text-[10px] font-black uppercase tracking-[0.4em] mb-2 block",children:"Governance & Transparency"}),t.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-gray-900 uppercase tracking-tighter leading-tight",children:"Projects Dashboard"}),t.jsx("p",{className:"text-gray-500 text-xs sm:text-sm mt-2 font-medium max-w-prose",children:"Track county projects by status, budget, and implementation progress."})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[t.jsx("button",{type:"button",onClick:()=>l("/resource-centre"),className:"shrink-0 text-[10px] font-black uppercase tracking-widest text-[#1478d4] border border-[#1478d4] px-5 sm:px-6 py-3 sm:py-4 rounded hover:bg-[#1478d4] hover:text-white transition-all shadow-sm w-full sm:w-auto",children:"Resource Centre"}),t.jsx("button",{type:"button",onClick:()=>r("home"),className:"shrink-0 text-[10px] font-black uppercase tracking-widest text-gray-400 hover:text-gray-900 border border-gray-200 px-5 sm:px-6 py-3 sm:py-4 rounded hover:bg-white transition-all shadow-sm w-full sm:w-auto",children:"â Home"})]})]}),d?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx("div",{className:"text-gray-400 text-sm font-bold uppercase tracking-widest animate-pulse",children:"Loading projects..."})}):t.jsx(t.Fragment,{children:t.jsx("div",{className:"mb-16",children:t.jsx(x,{projects:i,onViewDetails:e=>{var t;const s=((null==(t=e.actions)?void 0:t.view)??`/projects/${e.id}`).trim();/^https?:\/\//i.test(s)?window.location.assign(s):l(s.startsWith("/")?s:`/${s}`,{state:{project:e}})}})})})]})})};export{y as FinancialDocs,w as ProjectsDashboard,b as PublicRegistry,h as ResourceCentre};
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.