PageSourceSearch

https://www.ardent.africa/_next/static/immutable/chunks/24wh9v028ww0n.js

js ardent.africa collected 2026-09-25 23:06:54 UTC 33,426 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,356792,e=>{"use strict";var t=e.i(632165),s=e.i(205729),r=e.i(671985),a=e.i(621664),n=e.i(778193),i=e.i(58291),o=e.i(860484),l=e.i(187703),c=e.i(212089),d=e.i(697093),x=e.i(426960),h=e.i(759893),p=e.i(463854),u=e.i(408883),m=e.i(288903),y=e.i(233574),j=e.i(50473),g=e.i(536378),f=e.i(287089),v=e.i(600618),b=e.i(759741),C=e.i(305770),S=e.i(539271),w=e.i(87640),k=e.i(627061),T=e.i(486566),W=e.i(612312),B=e.i(65621),_=e.i(828331),z=e.i(456708),I=e.i(551592);let R=(0,I.default)((0,t.jsx)("path",{d:"M16 13h-3c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1m0-10v1H8V3c0-.55-.45-1-1-1s-1 .45-1 1v1H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-1V3c0-.55-.45-1-1-1s-1 .45-1 1m2 17H6c-.55 0-1-.45-1-1V9h14v10c0 .55-.45 1-1 1"}),"EventRounded");var A=e.i(238306),H=e.i(705987),$=e.i(205646);let M=(0,I.default)((0,t.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-6 14H8c-.55 0-1-.45-1-1s.45-1 1-1h5c.55 0 1 .45 1 1s-.45 1-1 1m3-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1m0-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1"}),"ArticleRounded"),F=(0,I.default)((0,t.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4"}),"PersonRounded");var L=e.i(280961);let P=(0,I.default)((0,t.jsx)("path",{d:"M12 7V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm9 12h-7v-2h2v-2h-2v-2h2v-2h-2V9h7c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1m-1-8h-2v2h2zm0 4h-2v2h2z"}),"BusinessRounded"),V=(0,I.default)((0,t.jsx)("path",{d:"M14 12c0 .74-.4 1.38-1 1.72V21c0 .55-.45 1-1 1s-1-.45-1-1v-7.28c-.6-.35-1-.98-1-1.72 0-1.1.9-2 2-2s2 .9 2 2m-3.25-5.87c-2.27.46-4.12 2.28-4.61 4.55-.4 1.86.07 3.62 1.08 4.94.35.45 1.03.47 1.43.07l.07-.07c.34-.34.34-.87.06-1.25-.68-.9-.98-2.1-.66-3.37.35-1.42 1.52-2.57 2.95-2.88C13.69 7.52 16 9.49 16 12c0 .87-.28 1.67-.76 2.32-.3.41-.29.97.07 1.33.44.44 1.17.37 1.54-.14.72-.98 1.15-2.2 1.15-3.51 0-3.72-3.39-6.65-7.25-5.87m.08-4.06c-4.53.51-8.22 4.18-8.76 8.71-.35 2.95.59 5.67 2.32 7.7.37.43 1.03.46 1.43.06l.05-.05c.35-.35.38-.92.05-1.3-1.56-1.83-2.33-4.37-1.7-7.06.7-3.01 3.18-5.39 6.22-5.97C15.53 3.18 20 7.08 20 12c0 1.96-.72 3.76-1.9 5.16-.34.4-.31.98.05 1.35.42.42 1.11.39 1.49-.07C21.11 16.7 22 14.46 22 12c0-5.91-5.13-10.62-11.17-9.93"}),"PodcastsRounded"),q=(0,I.default)((0,t.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M8 17c-.55 0-1-.45-1-1v-5c0-.55.45-1 1-1s1 .45 1 1v5c0 .55-.45 1-1 1m4 0c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v8c0 .55-.45 1-1 1m4 0c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1"}),"PollRounded");var E=e.i(339888),D=e.i(107177);let U=(0,I.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47"}),"HelpOutlineRounded");var O=e.i(894536);let K=(0,I.default)((0,t.jsx)("path",{d:"M12 2c-4.2 0-8 3.22-8 8.2 0 3.18 2.45 6.92 7.34 11.23.38.33.95.33 1.33 0C17.55 17.12 20 13.38 20 10.2 20 5.22 16.2 2 12 2m0 10c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"PlaceRounded"),Y=(0,I.default)((0,t.jsx)("path",{d:"M13.26 3C8.17 2.86 4 6.95 4 12H2.21c-.45 0-.67.54-.35.85l2.79 2.8c.2.2.51.2.71 0l2.79-2.8c.31-.31.09-.85-.36-.85H6c0-3.9 3.18-7.05 7.1-7 3.72.05 6.85 3.18 6.9 6.9.05 3.91-3.1 7.1-7 7.1-1.61 0-3.1-.55-4.28-1.48-.4-.31-.96-.28-1.32.08-.42.42-.39 1.13.08 1.49C9 20.29 10.91 21 13 21c5.05 0 9.14-4.17 9-9.26-.13-4.69-4.05-8.61-8.74-8.74m-.51 5c-.41 0-.75.34-.75.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03
1-.26.21-.36.09-.82-.26-1.03l-2.88-1.71v-3.4c0-.4-.34-.74-.75-.74"}),"HistoryRounded");var N=e.i(821260),G=e.i(207008),J=e.i(726386),Q=e.i(621984),X=e.i(519257),Z=e.i(977324),ee=e.i(49281),et=e.i(796187),es=e.i(842851),er=e.i(699724),ea=e.i(112560);let en={campaigns:[],events:[],jobs:[],services:[],entities:[],blogPosts:[],users:[],actors:[],posts:[],hashtags:[],causes:[],groups:[],surveys:[],durbars:[],challenges:[],orgs:[],help:[]},ei=[{key:"causes",type:"causes",icon:(0,t.jsx)(L.default,{}),href:"/causes"},{key:"campaigns",type:"campaigns",icon:(0,t.jsx)(z.default,{}),href:"/campaigns"},{key:"events",type:"events",icon:(0,t.jsx)(R,{}),href:"/events"},{key:"jobs",type:"jobs",icon:(0,t.jsx)(A.default,{}),href:"/jobs"},{key:"services",type:"services",icon:(0,t.jsx)(H.default,{}),href:"/marketplace"},{key:"entities",type:"entities",icon:(0,t.jsx)($.default,{}),href:"/reviews"},{key:"blogPosts",type:"blog",icon:(0,t.jsx)(M,{}),href:"/blog"},{key:"users",type:"users",icon:(0,t.jsx)(F,{}),href:"/supporter"},{key:"actors",type:"actors",icon:(0,t.jsx)(F,{}),href:"/network"},{key:"posts",type:"posts",icon:(0,t.jsx)(M,{}),href:"/feed"},{key:"hashtags",type:"hashtags",icon:(0,t.jsx)(L.default,{}),href:"/feed"},{key:"orgs",type:"orgs",icon:(0,t.jsx)(P,{}),href:"/ngos"},{key:"durbars",type:"durbars",icon:(0,t.jsx)(V,{}),href:"/durbar"},{key:"surveys",type:"surveys",icon:(0,t.jsx)(q,{}),href:"/polls"},{key:"groups",type:"groups",icon:(0,t.jsx)(E.default,{}),href:"/groups"},{key:"challenges",type:"challenges",icon:(0,t.jsx)(D.default,{}),href:"/challenges"},{key:"help",type:"help",icon:(0,t.jsx)(U,{}),href:"/support/help"}],eo={borderRadius:"16px",border:"1px solid",borderColor:"divider",bgcolor:"background.paper",textDecoration:"none",color:"inherit",height:"100%",transition:"box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease","&:hover":{boxShadow:"0 8px 28px rgba(0, 0, 0, 0.10)",borderColor:"primary.main",transform:"translateY(-2px)"}};function el(e,t){if(!e)return"";let s=e.trim();return s.length>t?`${s.slice(0,t).trimEnd()}...`:s}function ec(e,t){if(!e)return null;let s=new Date(e);return Number.isNaN(s.getTime())?null:new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric"}).format(s)}function ed(){let e=(0,r.useTranslations)("search"),n=(0,a.useLocale)(),x=(0,i.useRouter)(),C=(0,i.useSearchParams)(),{user:S}=(0,Z.useAuth)(),{categoryLabel:k}=(0,ee.useCategoryI18n)(),[T,z]=(0,s.useState)(C.get("q")||""),[I,R]=(0,s.useState)(C.get("q")||""),[A,H]=(0,s.useState)("all"),[$,M]=(0,s.use
1State)(""),[F,L]=(0,s.useState)(""),[P,V]=(0,s.useState)("relevance"),[q,E]=(0,s.useState)(!1),[D,U]=(0,s.useState)(!1),[O,K]=(0,s.useState)(en),[Y,G]=(0,s.useState)([]),[J,et]=(0,s.useState)(!1),[es,er]=(0,s.useState)([]),[eo,el]=(0,s.useState)([]),[ec,ed]=(0,s.useState)(!1),ex=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!S)return void el([]);let e=!0;return(0,ea.listSavedSearches)().then(t=>{e&&el(t.saved_searches??[])}).catch(()=>void 0),()=>{e=!1}},[S]),(0,s.useEffect)(()=>{if(!S)return void er([]);let e=!0;return(0,ea.listSearchHistory)({limit:8}).then(t=>{if(!e)return;let s=new Set,r=[];for(let e of t.history||[]){let t=e.search_query?.trim();if(t&&!s.has(t.toLowerCase())&&(s.add(t.toLowerCase()),r.push(t)),r.length>=6)break}er(r)}).catch(()=>{}),()=>{e=!1}},[S]);let ep=(0,s.useCallback)(async e=>{let t=e.trim();if(!t){K(en),R("");return}U(!0);try{let e=await (0,ea.search)({q:t,type:"all",category:$||void 0,status:F||void 0,sort:P});K(e.results||en),R(t)}catch(e){console.error("Search error:",e),K(en)}finally{U(!1)}},[$,F,P]);(0,s.useEffect)(()=>{if(!T.trim()){K(en),R("");return}let e=setTimeout(()=>{ep(T)},350);return()=>clearTimeout(e)},[T,$,F,P,ep]),(0,s.useEffect)(()=>{if(T.trim().length<2)return void G([]);let e=!0,t=setTimeout(async()=>{try{let t=await (0,ea.searchAutocomplete)({q:T.trim(),limit:6});e&&G(t.suggestions||[])}catch{e&&G([])}},250);return()=>{e=!1,clearTimeout(t)}},[T]);let eu=(0,s.useCallback)(e=>{let t=e.trim();et(!1),x.replace(`/search?q=${encodeURIComponent(t)}`,{scroll:!1}),t.length>=2&&(0,ea.recordSearchHistory)({search_query:t,filters:{type:A,category:$,status:F,sort:P}}).catch(()=>{})},[x,A,$,F,P]),em=e=>{z(e),et(!1),ep(e),eu(e)},ey=(0,s.useMemo)(()=>{let e={},t=0;for(let s of ei){let r=O[s.key]?.length||0;e[s.type]=r,t+=r}return e.all=t,e},[O]),ej=ei.filter(e=>0!==(O[e.key]?.length||0)&&("all"===A||A===e.type)),eg=(0,s.useCallback)(async()=>{if(I.trim()){ed(!0);try{await (0,ea.createSavedSearch)({name:I.trim(),search_query:I.trim(),filters:{..."all"!==A?{type:A}:{},...$?{category:$}:{},...F?{status:F}:{},..."relevance"!==P?{sort:P}:{}}});let e=await (0,ea.listSavedSearches)();el(e.saved_searches??[])}catch{}finally{ed(!1)}}},[I,A,$,F,P]),ef=(0,s.useCallback)(async e=>{el(t=>t.filter(t=>t.id!==e)),await (0,ea.deleteSavedSearch)(e).catch(()=>void 0)},[]),ev=eo.some(e=>e.search_query.toLowerCase()===I.trim().toLowerCase()),eb=!!I,eC=ey.all>0;return(0,t.jsx)(l.Container,{maxWidth:"lg",children:(0,t.jsxs)(o.Box,{sx:{paddingY:{xs:4,md:6}},children:[(0,t.jsxs)(o.Box,{sx:{textAlign:"center",mb:4},children:[(0,t.jsx)(c.Typography,{variant:"h1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:700,fontSize:{xs:"2.25rem",md:"3.25rem"},mb:1.5,color:"text.primary"},children:e("title")}),(0,t.jsx)(c.Typography,{variant:"body1",sx:{color:"text.secondary",maxWidth:620,mx:"auto"},children:e("subtitle")})]}),(0,t.jsx)("form",{onSubmit:e=>{e.preventDefault(),ep(T),eu(T)},children:(0,t.jsxs)(o.Box,{sx:{position:"relative",maxWidth:780,mx:"auto"},children:[(0,t.jsx)(p.TextField,{fullWidth:!0,inputRef:ex,placeholder:e("placeholder"),value:T,onChange:e=>{z(e.target.value),et(!0)},onFocus:()=>T.trim().length>=2&&et(!0),onBlur:()=>setTimeout(()=>et(!1),180),sx:{"& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:"background.paper",py:{xs:1,sm:1.25},pr:1},"& .MuiOutlinedInput-input":{py:.5,fontSize:"1.05rem"}},slotProps:{input:{startAdornment:(0,t.jsx)(u.InputAdornment,{position:"start",sx:{ml:1},children:(0,t.jsx)(W.default,{sx:{fontSize:24,color:"text.secondary"}})}),endAdornment:T?(0,t.jsx)(u.InputAdornment,{position:"end",children:(0,t.jsx)(b.IconButton,{size:"small","aria-label":e("clear"),onClick:()=>{z(""),K(en),R(""),ex.current?.focus()},children:(0,t.jsx)(B.default,{fontSize:"small"})})}):null}}}),(0,t.jsx)(X.AnimatePresence,{children:J&&Y.length>0&&(0,t.jsx)(d.Card,{component:Q.motion.div,initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},sx:{position:"absolute",top:"100%",left:0,right:0,zIndex:1200,mt:1,borderRadius:"16px",border:"1px solid",borderColor:"divider",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.14)",overflow:"hidden"},children:(0,t.jsx)(h.Stack,{children:Y.map(e=>(0,t.jsx)(v.Button,{fullWidth:!0,onMouseDown:e=>e.preventDefault(),onClick:()=>em(e),sx:{justifyContent:"flex-start",textTransform:"none",color:"text.primary",px:2.5,py:1.5,borderRadius:0,"&:hover":{backgroundColor:"action.hover"}},startIcon:(0,t.jsx)(W.default,{sx:{color:"text.secondary"}}),children:(0,t.jsx)(c.Typography,{variant:"body2",noWrap:!0,sx:{textAlign:"left",width:"100%"},children:e})},e))})})})]})}),eb&&(0,t.jsxs)(o.Box,{sx:{mt:4},children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{flexWrap:"wrap",gap:1,justifyContent:"center",mb:1},children:[(0,t.jsx)(m.Chip,{label:`${e("type.all")} (${ey.all})`,onClick:()=>H("all"),color:"all"===A?"primary":"default",variant:"all"===A?"filled":"outlined",sx:{fontWeight:600}}),ei.filter(e=>ey[e.type]>0).map(s=>(0,t.jsx)(m.Chip,{icon:(0,t.jsx)(o.Box,{sx:{display:"flex","& svg":{fontSize:18}},children:s.icon}),label:`${e(`type.${s.type}`)} (${ey[s.type]})`,onClick:()=>H(s.type),color:A===s.type?"primary":"default",variant:A===s.type?"filled":"outlined",sx:{fontWeight:600}},s.type)),(0,t.jsx)(v.Button,{size:"small",startIcon:(0,t.jsx)(_.default,{}),onClick:()=>E(e=>!e),sx:{textTransform:"none",ml:{xs:0,sm:1}}
1,children:q?e("hideFilters"):e("showFilters")})]}),(0,t.jsx)(w.Collapse,{in:q,children:(0,t.jsxs)(h.Stack,{direction:{xs:"column",sm:"row"},spacing:2,sx:{justifyContent:"center",mt:2,mb:1},children:[(0,t.jsxs)(g.FormControl,{size:"small",sx:{minWidth:190},children:[(0,t.jsx)(f.InputLabel,{id:"page-label-1",children:e("filters.categoryLabel")}),(0,t.jsxs)(y.Select,{labelId:"page-label-1",value:$,label:e("filters.categoryLabel"),onChange:e=>M(e.target.value),children:[(0,t.jsx)(j.MenuItem,{value:"",children:e("category.all")}),["Education","Healthcare","Clean Water","Economic Development","Women Empowerment","Youth Programs","Environmental Conservation","Agriculture","Technology Access","Arts & Culture"].map(e=>(0,t.jsx)(j.MenuItem,{value:e,children:k(e)},e))]})]}),(0,t.jsxs)(g.FormControl,{size:"small",sx:{minWidth:160},children:[(0,t.jsx)(f.InputLabel,{id:"page-label-2",children:e("filters.statusLabel")}),(0,t.jsxs)(y.Select,{labelId:"page-label-2",value:F,label:e("filters.statusLabel"),onChange:e=>L(e.target.value),children:[(0,t.jsx)(j.MenuItem,{value:"",children:e("status.all")}),(0,t.jsx)(j.MenuItem,{value:"active",children:e("status.active")}),(0,t.jsx)(j.MenuItem,{value:"won",children:e("status.won")})]})]}),(0,t.jsxs)(g.FormControl,{size:"small",sx:{minWidth:160},children:[(0,t.jsx)(f.InputLabel,{id:"page-label-3",children:e("filters.sortLabel")}),(0,t.jsxs)(y.Select,{labelId:"page-label-3",value:P,label:e("filters.sortLabel"),onChange:e=>V(e.target.value),children:[(0,t.jsx)(j.MenuItem,{value:"relevance",children:e("sort.relevance")}),(0,t.jsx)(j.MenuItem,{value:"recent",children:e("sort.recent")}),(0,t.jsx)(j.MenuItem,{value:"amount",children:e("sort.amount")})]})]})]})})]}),(0,t.jsx)(o.Box,{sx:{mt:4},children:D?(0,t.jsx)(e_,{}):eb?eC?(0,t.jsxs)(h.Stack,{spacing:5,children:[(0,t.jsxs)(h.Stack,{useFlexGap:!0,direction:"row",spacing:1,sx:{alignItems:"center",justifyContent:"space-between",flexWrap:"wrap"},children:["all"===A?(0,t.jsxs)(c.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[e("resultsFor",{query:I})," ","·"," ",e("totalCount",{count:ey.all})]}):(0,t.jsx)(o.Box,{}),S&&(0,t.jsx)(v.Button,{size:"small",variant:"outlined",startIcon:(0,t.jsx)(N.default,{}),onClick:eg,disabled:ec||ev,children:ev?e("saved.already"):e("saved.save")})]}),ej.map(e=>(0,t.jsx)(eh,{section:e,results:O,collapsed:"all"===A,locale:n},e.key))]}):(0,t.jsx)(eB,{query:I,narrowed:"all"!==A||"all"!==$||"all"!==F,onSearchEverything:()=>{H("all"),M("all"),L("all")}}):(0,t.jsx)(eW,{recent:es,saved:eo,onPick:em,onRemoveSaved:ef})})]})})}function ex({icon:e,title:s,count:a,href:n,showViewAll:i}){let l=(0,r.useTranslations)("search");return(0,t.jsxs)(h.Stack,{direction:"row",spacing:1.5,sx:{alignItems:"center",mb:2},children:[(0,t.jsx)(o.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:38,height:38,borderRadius:"12px",bgcolor:"action.hover",color:"primary.main","& svg":{fontSize:22}},children:e}),(0,t.jsx)(c.Typography,{variant:"h5",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,fontSize:"1.35rem"},children:s}),(0,t.jsx)(m.Chip,{label:a,size:"small",sx:{fontWeight:600}}),(0,t.jsx)(o.Box,{sx:{flex:1}}),i&&(0,t.jsx)(v.Button,{component:G.default,href:n,size:"small",endIcon:(0,t.jsx)(O.default,{}),sx:{textTransform:"none",flexShrink:0},children:l("viewAll")})]})}function eh({section:e,results:s,collapsed:a,locale:n}){let i=(0,r.useTranslations)("search"),l=s[e.key]||[],c=a?4:l.length,d=l.slice(0,c);return(0,t.jsxs)(o.Box,{component:Q.motion.div,initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[(0,t.jsx)(ex,{icon:e.icon,title:i(`sections.${e.type}`),count:l.length,href:e.href,showViewAll:a&&l.length>c}),(0,t.jsx)(o.Box,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)",md:"blogPosts"===e.key||"campaigns"===e.key?"repeat(2, 1fr)":"repeat(3, 1fr)"}},children:d.map(s=>(0,t.jsx)(ep,{sectionKey:e.key,item:s,locale:n},s.id))})]})}function ep({sectionKey:e,item:s,locale:r}){switch(e){case"campaigns":return(0,t.jsx)(em,{c:s});case"events":return(0,t.jsx)(ey,{e:s,locale:r});case"jobs":return(0,t.jsx)(ej,{j:s});case"services":return(0,t.jsx)(eg,{s:s});case"entities":return(0,t.jsx)(ef,{e:s});case"blogPosts":return(0,t.jsx)(ev,{b:s});case"users":return(0,t.jsx)(ek,{u:s});case"actors":return(0,t.jsx)(eb,{a:s});case"posts":return(0,t.jsx)(eC,{p:s});case"hashtags":return(0,t.jsx)(ew,{h:s});case"causes":return(0,t.jsx)(eS,{c:s});case"orgs":return(0,t.jsx)(eI,{o:s});case"durbars":return(0,t.jsx)(eR,{d:s});case"surveys":return(0,t.jsx)(eA,{s:s});case"groups":return(0,t.jsx)(eH,{g:s});case"challenges":return(0,t.jsx)(e$,{c:s});case"help":return(0,t.jsx)(eM,{h:s});default:return null}}function eu({src:e,alt:s}){return(0,t.jsx)(o.Box,{sx:{position:"relative",width:"100%",aspectRatio:"16 / 9",borderRadius:"12px",overflow:"hidden",bgcolor:"action.hover",flexShrink:0},children:e&&(0,t.jsx)(J.default,{src:e,alt:s,fill:!0,sizes:"(max-width: 900px) 100v
1w, 33vw",style:{objectFit:"cover"}})})}function em({c:e}){let{categoryLabel:s}=(0,ee.useCategoryI18n)(),r=(0,et.getCampaignProgressBars)(e);return(0,t.jsxs)(d.Card,{component:G.default,href:`/campaign/${e.slug}`,sx:eo,children:[(0,t.jsx)(o.Box,{sx:{p:1.5},children:(0,t.jsx)(eu,{src:e.image_url,alt:e.title})}),(0,t.jsxs)(x.CardContent,{sx:{pt:0},children:[e.category&&(0,t.jsx)(h.Stack,{direction:"row",spacing:1,sx:{mb:1,flexWrap:"wrap",gap:.5},children:(0,t.jsx)(m.Chip,{label:s(e.category),size:"small"})}),(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,lineHeight:1.3},children:el(e.title,80)}),(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:el(e.description,110)}),r.length>0&&(0,t.jsx)(h.Stack,{spacing:.75,sx:{mt:1.5},children:r.map(e=>(0,t.jsx)(C.LinearProgress,{variant:"determinate",value:e.value,sx:{height:6,borderRadius:"999px"}},e.kind))})]})]})}function ey({e,locale:s}){let a=(0,r.useTranslations)("search"),n=ec(e.start_date,s);return(0,t.jsxs)(d.Card,{component:G.default,href:`/events/${e.slug}`,sx:eo,children:[(0,t.jsx)(o.Box,{sx:{p:1.5},children:(0,t.jsx)(eu,{src:e.image_url,alt:e.title})}),(0,t.jsxs)(x.CardContent,{sx:{pt:0},children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{mb:1,flexWrap:"wrap",gap:.5},children:[(0,t.jsx)(m.Chip,{label:a(e.is_paid?"labels.paid":"labels.free"),size:"small",color:e.is_paid?"default":"success"}),e.category&&(0,t.jsx)(m.Chip,{label:e.category,size:"small",variant:"outlined"})]}),(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,lineHeight:1.3},children:el(e.title,80)}),(0,t.jsxs)(h.Stack,{spacing:.5,sx:{mt:1},children:[(0,t.jsx)(eT,{icon:(0,t.jsx)(R,{}),text:n||a("labels.noDate")}),e.location&&(0,t.jsx)(eT,{icon:(0,t.jsx)(K,{}),text:e.location})]})]})]})}function ej({j:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/jobs/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,lineHeight:1.3},children:el(e.title,80)}),e.description&&(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:el(e.description,100)}),(0,t.jsxs)(h.Stack,{direction:"row",spacing:.5,sx:{mt:1.5,flexWrap:"wrap",gap:.5},children:[e.employment_type&&(0,t.jsx)(m.Chip,{label:e.employment_type,size:"small"}),e.workplace_type&&(0,t.jsx)(m.Chip,{label:"remote"===e.workplace_type.toLowerCase()?s("labels.remote"):e.workplace_type,size:"small",variant:"outlined"}),e.seniority&&(0,t.jsx)(m.Chip,{label:e.seniority,size:"small",variant:"outlined"})]}),e.location&&(0,t.jsx)(o.Box,{sx:{mt:1},children:(0,t.jsx)(eT,{icon:(0,t.jsx)(K,{}),text:e.location})})]})})}function eg({s:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/marketplace/${e.id}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,lineHeight:1.3},children:el(e.title,80)}),e.description&&(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:el(e.description,100)}),(e.rating??0)>0&&(0,t.jsxs)(h.Stack,{direction:"row",spacing:.75,sx:{alignItems:"center",mt:1.5},children:[(0,t.jsx)(S.Rating,{value:e.rating||0,precision:.5,size:"small",readOnly:!0}),(0,t.jsx)(c.Typography,{variant:"caption",sx:{color:"text.secondary"},children:s("labels.reviews",{count:e.review_count||0})})]}),e.location&&(0,t.jsx)(o.Box,{sx:{mt:1},children:(0,t.jsx)(eT,{icon:(0,t.jsx)(K,{}),text:e.location})})]})})}function ef({e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/reviews/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1.5,sx:{alignItems:"center"},children:[(0,t.jsx)(k.Avatar,{src:e.logo_url||void 0,variant:"rounded",sx:{width:48,height:48,bgcolor:"action.hover",color:"text.secondary"},children:e.display_name?.[0]||"?"}),(0,t.jsxs)(o.Box,{sx:{minWidth:0},children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:e.display_name}),(0,t.jsx)(c.Typography,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:e.entity_type?.replace(/_/g," ")})]})]}),e.description&&(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:1},children:el(e.description,100)}),(0,t.jsxs)(h.Stack,{direction:"row",spacing:.75,sx:{mt:1.5,flexWrap:"wrap",gap:.5,alignItems:"center"},children:["number"==typeof e.trust_score&&(0,t.jsx)(m.Chip,{icon:(0,t.jsx)($.default,{}),label:s("labels.trustScore",{score:Math.round(e.trust_score)}),size:"small",color:"primary",variant:"outlined"}),(0,t.jsx)(c.Typography,{variant:"caption",sx:{color:"text.secondary"},children:s("labels.reviews",{count:e.published_review_count||0})})]})]})})}function ev({b:e}){return(0,t.jsxs)(d.Card,{component:G.default,href:`/blog/${e.slug}`,sx:eo,children:[e.featured_image_url&&(0,t.jsx)(o.Box,{sx:{p:1.5},children:(0,t.jsx)(eu,{src:e.featured_image_url,alt:e.title})}),(0,t.jsxs)(x.CardContent,{sx:{pt:e.featured_image_url?0:void 0},children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600,lineHeight:1.3},children:el(e.title,90)}),e.excerpt&&(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:el(e.excerpt,130)})]})]})}function eb({a:e}
1){return(0,t.jsx)(d.Card,{component:G.default,href:`/@${e.handle}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1.5,sx:{alignItems:"center"},children:[(0,t.jsx)(k.Avatar,{src:(0,es.resolveAvatarUrl)(e.avatar_url),sx:{width:48,height:48,bgcolor:"primary.main"},children:e.display_name[0]?.toUpperCase()}),(0,t.jsxs)(o.Box,{sx:{minWidth:0},children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:e.display_name}),(0,t.jsxs)(c.Typography,{variant:"body2",noWrap:!0,sx:{color:"text.secondary"},children:["@",e.handle]})]})]}),e.headline&&(0,t.jsx)(c.Typography,{variant:"body2",noWrap:!0,sx:{color:"text.secondary",mt:1},children:e.headline})]})})}function eC({p:e}){return(0,t.jsx)(d.Card,{component:G.default,href:`/post/${e.id}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[e.author&&(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{mb:1,alignItems:"center"},children:[(0,t.jsx)(k.Avatar,{src:(0,es.resolveAvatarUrl)(e.author.avatar_url),sx:{width:24,height:24},children:(e.author.display_name||e.author.handle||"?").charAt(0)}),(0,t.jsx)(c.Typography,{variant:"caption",color:"text.secondary",noWrap:!0,children:e.author.display_name||e.author.handle})]}),(0,t.jsx)(c.Typography,{variant:"body2",sx:{display:"-webkit-box",WebkitLineClamp:4,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.body})]})})}function eS({c:e}){return(0,t.jsx)(d.Card,{component:G.default,href:`/causes/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.name}),e.description&&(0,t.jsx)(c.Typography,{variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.description})]})})}function ew({h:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/tags/${encodeURIComponent(e.tag)}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(c.Typography,{variant:"subtitle1",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:["#",e.display_tag]}),(0,t.jsx)(c.Typography,{variant:"caption",sx:{color:"text.secondary"},children:s("hashtagUsage",{people:e.unique_actors,posts:e.post_count})})]})})}function ek({u:e}){let s=(0,r.useTranslations)("search"),a=e.full_name||e.username||s("anonymous");return(0,t.jsx)(d.Card,{...e.username?{component:G.default,href:`/supporter/${e.username}`}:{},sx:e.username?eo:{...eo,"&:hover":void 0},children:(0,t.jsx)(x.CardContent,{children:(0,t.jsxs)(h.Stack,{direction:"row",spacing:1.5,sx:{alignItems:"center"},children:[(0,t.jsx)(k.Avatar,{src:(0,es.resolveAvatarUrl)(e.avatar_url),sx:{width:48,height:48,bgcolor:"primary.main"},children:a[0]?.toUpperCase()}),(0,t.jsxs)(o.Box,{sx:{minWidth:0},children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:a}),e.bio&&(0,t.jsx)(c.Typography,{variant:"body2",noWrap:!0,sx:{color:"text.secondary"},children:e.bio})]})]})})})}function eT({icon:e,text:s}){return(0,t.jsxs)(h.Stack,{direction:"row",spacing:.75,sx:{alignItems:"center",color:"text.secondary"},children:[(0,t.jsx)(o.Box,{sx:{display:"flex","& svg":{fontSize:16}},children:e}),(0,t.jsx)(c.Typography,{variant:"caption",noWrap:!0,children:s})]})}function eW({recent:e,saved:s,onPick:a,onRemoveSaved:i}){let l=(0,r.useTranslations)("search");return(0,t.jsxs)(o.Box,{sx:{textAlign:"center",py:{xs:4,md:6},maxWidth:620,mx:"auto"},children:[(0,t.jsx)(o.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:84,height:84,borderRadius:"50%",bgcolor:"action.hover",color:"primary.main",mb:2},children:(0,t.jsx)(W.default,{sx:{fontSize:40}})}),(0,t.jsx)(o.Box,{sx:{maxWidth:380,mx:"auto",mb:3},children:(0,t.jsx)(n.TrendingPanel,{})}),(0,t.jsx)(c.Typography,{variant:"h6",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:l("start.title")}),(0,t.jsx)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:1},children:l("start.subtitle")}),s.length>0&&(0,t.jsxs)(o.Box,{sx:{mt:4,textAlign:"left"},children:[(0,t.jsx)(T.Divider,{sx:{mb:2}}),(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{alignItems:"center",mb:1.5,color:"text.secondary"},children:[(0,t.jsx)(N.default,{sx:{fontSize:18}}),(0,t.jsx)(c.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:l("saved.title")})]}),(0,t.jsx)(h.Stack,{direction:"row",spacing:1,sx:{flexWrap:"wrap",gap:1},children:s.map(e=>(0,t.jsx)(m.Chip,{label:e.name,variant:"outlined",onClick:()=>a(e.search_query),onDelete:()=>i(e.id),icon:(0,t.jsx)(N.default,{sx:{fontSize:16}})},e.id))})]}),e.length>0&&(0,t.jsxs)(o.Box,{sx:{mt:4,textAlign:"left"},children:[(0,t.jsx)(T.Divider,{sx:{mb:2}}),(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{alignItems:"center",mb:1.5,color:"text.secondary"},children:[(0,t.jsx)(Y,{sx:{fontSize:18}}),(0,t.jsx)(c.Typography,{variant:"subtitle2",sx:{fontWeight:600},children:l("recent.title")})]}),(0,t.jsx)(h.Stack,{direction:"row",spacing:1,sx:{flexWrap:"wrap",gap:1},children:e.map(e=>(0,t.jsx)(m.Chip,{label:e,variant:"outlined",onClick:()=>a(e),icon:(0,t.jsx)(Y,{sx:{fontSize:16}})},e))})]})]})}function eB({query:e,narrowed:s,onSearchEverything:a}){let n=(0,r.useTranslations)("search");return(0,t.jsxs)(o.Box,{sx:{textAlign:"center",py:{xs:5,md:7}},children:[(0,t.jsx)(o.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:84,height:84,borderRadius:"50%",bgcolor:"action.hover",color:"text.secondary",mb:2},children:(0,t.jsx)(W.default,{sx:{fontSize:40}})}),(0,t.jsx)(c.Typography,{variant:"h6",sx:{fontFamily:'"Sora", sans-serif',fontWeight:600},children:n("empty.title")}),(0,t.jsxs)(c.Typography,{variant:"body2",sx:{color:"text.secondary",mt:1},children:[n("resultsFor",{query:e})," ","·"," ",n("empty.subtitle")]}),s&&(0,t.jsx)(o.Box,{sx:{mt:2},children:(0,t.jsx)(v.Button,{variant:"outlined",onClick:a,children:n("empty.searchEverything")})})]})}function e_(){return(0,t.jsx)(h.Stack,{spacing:5,children:[0,1].map(e=>(0,t.jsxs)(o.Box,{children:[(0,t.jsx)(o.Box,{sx:{height:28,width:200,borderRadius:"8px",bgcolor:"action.hover",mb:2}}),(0,t.jsx)(o.Box,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)"}},children:[0,1,2].map(e=>(0,t.jsxs)(d.Card,{sx:{borderRadius:"16px",border:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(o.Box,{sx:{p:1.5},children:(0,t.jsx)(o.Box,{sx:{aspectRatio:"16 / 9",borderRadius:"12px",bgcolor:"action.hover"}})}),(0,t.jsxs)(x.CardContent,{sx:{pt:0},children:[(0,t.jsx)(o.Box,{sx:{height:20,width:"80%",borderRadius:"6px",bgcolor:"action.hover",mb:1}}),(0,t.jsx)(o.Box,{sx:{height:14,width:"100%",borderRadius:"6px",bgcolor:"action.hover",mb:.5}}),(0,t.jsx)(o.Box,{sx:{height:14,width:"60%",borderRadius:"6px",bgcolor:"action.hover"}})]})]},e))})]},e))})}function ez({children:e}){return(0,t.jsx)(c.Typography,{variant:"body2",color:"text.secondary",sx:{dis
1play:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e})}function eI({o:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/${"ngo"===e.kind?"ngo":"corporate"}/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{alignItems:"center",mb:.5,flexWrap:"wrap"},children:[(0,t.jsx)(m.Chip,{size:"small",label:s(`orgKind.${e.kind}`)}),e.verified&&(0,t.jsx)($.default,{sx:{fontSize:16,color:"warmGold.text"}})]}),(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.name}),e.description&&(0,t.jsx)(ez,{children:e.description})]})})}function eR({d:e}){let s=(0,r.useTranslations)("search")("live"===e.status?"durbarState.live":"scheduled"===e.status?"durbarState.scheduled":e.replay_post_id?"durbarState.replay":"durbarState.ended");return(0,t.jsx)(d.Card,{component:G.default,href:`/durbar/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsx)(m.Chip,{size:"small",label:s,color:"live"===e.status?"error":"default",sx:{mb:.5}}),(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.title}),e.description&&(0,t.jsx)(ez,{children:e.description})]})})}function eA({s:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/polls/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1,sx:{alignItems:"center",mb:.5,flexWrap:"wrap"},children:["open"!==e.status&&(0,t.jsx)(m.Chip,{size:"small",label:s("surveyClosed")}),(0,t.jsx)(c.Typography,{variant:"caption",color:"text.secondary",children:s("surveyResponses",{count:e.response_count})})]}),(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.title}),e.description&&(0,t.jsx)(ez,{children:e.description})]})})}function eH({g:e}){let s=(0,r.useTranslations)("search");return(0,t.jsx)(d.Card,{component:G.default,href:`/groups/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsxs)(h.Stack,{direction:"row",spacing:1.5,sx:{alignItems:"center",mb:.5},children:[(0,t.jsx)(k.Avatar,{src:(0,er.resolveMediaUrl)({bucket:"group-photos",storagePath:e.avatar_url})||void 0,sx:{width:32,height:32},children:e.name.charAt(0)}),(0,t.jsx)(c.Typography,{variant:"caption",color:"text.secondary",children:s("groupMembers",{count:e.member_count})})]}),(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.name}),e.description&&(0,t.jsx)(ez,{children:e.description})]})})}function e$({c:e}){let s=(0,a.useLocale)(),n=(0,r.useTranslations)("search"),i=ec(e.end_date,s);return(0,t.jsx)(d.Card,{component:G.default,href:`/challenges/${e.id}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[i&&(0,t.jsx)(c.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:n("challengeEnds",{date:i})}),(0,t.jsx)(c.Typography,{variant:"subtitle1",noWrap:!0,sx:{fontWeight:600},children:e.title}),e.description&&(0,t.jsx)(ez,{children:e.description})]})})}function eM({h:e}){return(0,t.jsx)(d.Card,{component:G.default,href:`/support/help/${e.slug}`,sx:eo,children:(0,t.jsxs)(x.CardContent,{children:[(0,t.jsx)(c.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.title}),e.summary&&(0,t.jsx)(ez,{children:e.summary})]})})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(l.Container,{maxWidth:"lg",children:(0,t.jsx)(o.Box,{sx:{paddingY:{xs:4,md:6}},children:(0,t.jsx)(e_,{})})}),children:(0,t.jsx)(ed,{})})}],356792)}]);

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.