1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,923947,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(522016),i=e.i(435596);function a({selectedCategory:e,categoryNames:r,totalPosts:o,searchQuery:n,setSearchQuery:l}){return(0,t.jsxs)("div",{className:"container mx-auto px-4",children:[(0,t.jsxs)("div",{className:"hidden md:flex items-center gap-4 py-4",children:[(0,t.jsxs)("div",{className:"flex gap-2 lg:gap-3 overflow-x-auto scrollbar-hide flex-shrink-0",children:[(0,t.jsx)(s.default,{href:"/news",className:`px-4 lg:px-5 py-2 rounded-full whitespace-nowrap text-sm lg:text-base font-medium transition-all ${"all"===e?"bg-primary text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:"All Posts"}),Object.entries(r).map(([r,s])=>(0,t.jsx)("a",{href:`/news?category=${r}`,className:`px-4 lg:px-5 py-2 rounded-full whitespace-nowrap text-sm lg:text-base font-medium transition-all ${e===r?"bg-primary text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:s},r))]}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)("p",{className:"text-gray-600 text-sm whitespace-nowrap overflow-hidden text-ellipsis",children:0===o?(0,t.jsx)("span",{children:"No posts found"}):(0,t.jsxs)("span",{children:["Showing ",(0,t.jsx)("span",{className:"font-semibold text-primary",children:o})," ",1===o?"post":"posts","all"!==e&&r[e]&&(0,t.jsxs)("span",{children:[" in ",(0,t.jsx)("span",{className:"font-semibold text-primary",children:r[e]})]})]})})}),(0,t.jsxs)("div",{className:"relative w-full max-w-xs flex-shrink-0",children:[(0,t.jsx)("input",{type:"text",value:n,onChange:e=>l(e.target.value),placeholder:"Search posts...",className:"w-full px-4 py-2 pl-10 pr-4 rounded-full border border-gray-200 focus:border-primary focus:ring-2 focus:ring-primary/20 outline-none transition-all text-sm text-gray-700 placeholder-gray-400"}),(0,t.jsx)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,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"})}),n&&(0,t.jsx)("button",{onClick:()=>l(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(i.default,{})})]}),(0,t.jsxs)("div",{className:"md:hidden py-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide",children:[(0,t.jsx)(s.default,{href:"/news",className:`px-4 py-2 rounded-full whitespace-nowrap text-sm font-medium transition-all ${"all"===e?"bg-primary text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:"All Posts"}),Object.entries(r).map(([r,s])=>(0,t.jsx)("a",{href:`/news?category=${r}`,className:`px-4 py-2 rounded-full whitespace-nowrap text-sm font-medium transition-all ${e===r?"bg-primary text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:s},r))]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:n,onChange:e=>l(e.target.value),placeholder:"Search posts...",className:"w-full px-4 py-2.5 pl-10 pr-4 rounded-xl border border-gray-200 focus:border-primary focus:ring-2 focus:ring-primary/20 outline-none transition-all text-sm text-gray-700 placeholder-gray-400"}),(0,t.jsx)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,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"})}),n&&(0,t.jsx)("button",{onClick:()=>l(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-gray-600 text-sm",children:0===o?(0,t.jsx)("span",{children:"No posts found"}):(0,t.jsxs)("span",{children:["Showing ",(0,t.jsx)("span",{className:"font-semibold text-primary",children:o})," ",1===o?"post":"posts","all"!==e&&r[e]&&(0,t.jsxs)("span",{children:[" in ",(0,t.jsx)("span",{className:"font-semibold text-primary",children:r[e]})]})]})}),(0,t.jsx)(i.default,{})]})]})]})}var o=e.i(657688),n=e.i(401851),l=e.i(685149);function c({initialPosts:e,categoryNames:i,searchQuery:a}){let[d,m]=(0,r.useState)(12);(0,r.useEffect)(()=>{m(12)},[a]);let u=(0,r.useMemo)(()=>
1{if(!a.trim())return e;let t=a.toLowerCase();return e.filter(e=>e.title.toLowerCase().includes(t)||e.excerpt?.toLowerCase().includes(t))},[e,a]),p=u.slice(0,d),h=d<u.length;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("section",{className:"container mx-auto px-4 py-8 md:py-10",children:0===u.length?(0,t.jsxs)("div",{className:"bg-white rounded-2xl p-12 md:p-16 text-center border border-gray-100",children:[(0,t.jsx)("svg",{className:"w-16 h-16 md:w-20 md:h-20 mx-auto mb-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})}),(0,t.jsx)("h3",{className:"text-xl md:text-2xl font-bold text-gray-800 mb-2",children:"No posts found"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm md:text-base",children:a?"Try adjusting your search terms or browse all posts":"Check back later for new updates"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8 animate-content-reveal",children:p.map((e,r)=>{let a="women-religious"===e.category?`/women-religious/${e.slug}`:"men-religious"===e.category?`/men-religious/${e.slug}`:"seminaries"===e.category?`/seminaries/${e.slug}`:`/post/${e.slug}`;return(0,t.jsx)("article",{className:"bg-white rounded-xl md:rounded-2xl shadow-lg hover:shadow-xl transition-all border border-gray-100 overflow-hidden group",style:{animationDelay:`${r%12*.05}s`},children:(0,t.jsxs)(s.default,{href:a,className:"block",children:[(0,t.jsx)("div",{className:"relative aspect-video w-full bg-linear-to-br from-primary/10 via-primary-light/10 to-primary-dark/10 overflow-hidden",children:e.imageUrl?(0,t.jsx)(o.default,{src:e.imageUrl,alt:e.title,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-500"}):(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-8",children:(0,t.jsx)("div",{className:"relative w-full h-full",children:(0,t.jsx)(o.default,{src:l.LOGO_URL,alt:"Diocese Logo",fill:!0,className:"object-contain opacity-30 group-hover:opacity-40 transition-opacity"})})})}),(0,t.jsxs)("div",{className:"p-5 md:p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 flex-wrap",children:[(0,t.jsx)("span",{className:"px-2 py-1 bg-primary/10 text-primary text-xs font-semibold rounded uppercase tracking-wider",children:i[e.category]||e.category}),(0,t.jsx)("span",{className:"text-xs text-gray-400",children:(0,n.format)(new Date(e.publishedAt),"MMM d, yyyy")})]}),(0,t.jsx)("h2",{className:"text-lg md:text-xl font-bold text-gray-900 mb-2 line-clamp-2 group-hover:text-primary transition-colors",children:e.title}),e.excerpt&&(0,t.jsx)("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-3 mb-4",children:e.excerpt}),(0,t.jsx)("div",{className:"flex items-center justify-end pt-3 border-t border-gray-100",children:(0,t.jsxs)("span",{className:"text-primary font-semibold text-sm flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read more",(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})]})},e.id)})}),h&&(0,t.jsxs)("div",{className:"text-center mt-10 md:mt-12",children:[(0,t.jsxs)("button",{onClick:()=>{m(e=>e+12)},className:"inline-flex items-center gap-2 px-8 py-3 bg-primary text-white rounded-lg hover:bg-primary-dark transition-colors font-medium shadow-md hover:shadow-lg",children:["Load More Posts",(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,t.jsxs)("p",{className:"text-gray-500 text-sm mt-3",children:["Showing ",p.length," of ",u.length," posts"]})]})]})})})}e.s(["default",0,function({initialPosts:e,selectedCategory:s,categoryNames:i}){let[o,n]=(0,r.useState)("");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("section",{className:"bg-white border-b border-gray-100 sticky top-16 z-40 shadow-sm",children:(0,t.jsx)(a,{selectedCategory:s,categoryNames:i,totalPosts:e.length,searchQuery:o,setSearchQuery:n})}),(0,t.jsx)(c,{initialPosts:e,categoryNames:i,searchQuery:o})]})}],923947)},435596,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(108703),i=e.i(35101);e.s(["default",0,function(){let{isSupported:e,isSubscribedToNews:a,isLoading:o,subscribeToNews:n,unsubscribeFromNews:l}=(0,s.useNotifications)(),{isLoading:c}=(0,i.usePWA)(),[d,m]=(0,r.useState)(!1);if(c||!e)return null;let u=async()=>{m(!0);try{a?await l():await n()}finally{m(!1)}};return(0,t.jsxs)("button",{onClick:u,disabled:o||d,className:`inline-flex items-center gap-2 px-4 py-2 text-sm font-semibold rounded-lg transition-all border ${a?"bg-white text-primary border-primary hover:bg-primary/5":"bg-primary text-white border-primary hover:bg-primary/90 shadow-md hover:shadow-lg"} ${o||d?"opacity-70 cursor-not-allowed":""}`,title:a?"Click to unsubscribe from news notifications":"Click to get notified about new posts",children:[o||d?(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),a?"â Subscribed":"Get Notified"]})}])},108703,35101,e=>{"use strict";var t=e.i(271645),r=e.i(959141);let s="fcm_token";e.s(["useNotifications",0,function(){let[e,i]=(0,t.useState)(!1),[a,o]=(0,t.useState)(null),[n,l]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),[m,u]=(0,t.useState)(!1),[p,h]=(0,t.useState)(!0),[x,g]=(0,t.useState)(null);(0,t.useEffect)(()=>{!async function(){try{let e=await (0,r.areNotificationsSupported)();if(i(e),!e)return void h(!1);let t=(0,r.getNotificationPermissionStatus)();o(t);let a=localStorage.getItem(s);if(a){l(a);let e=await fetch(`/api/notifications/subscribe?token=${encodeURIComponent(a)}`);if(e.ok){let t=await e.json();d(t.newsSubscription||!1),u(t.priestCelebrationSubscription||!1)}}if(a&&"granted"===t){let e=async()=>{try{let e=await (0,r.requestNotificationPermission)();e&&e!==a&&(await fetch("/api/notifications/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,userAgent:navigator.userAgent,subscribeToNews:!0})}),l(e),localStorage.setItem(s,e))}catch(e){console.error("Error refreshing token:",e)}},t=setInterval(()=>{e()},6048e5);return()=>clearInterval(t)}await (0,r.initializeMessaging)(),(0,r.onForegroundMessage)(e=>{let t=e.notification;t&&"granted"===Notification.permission&&new Notification(t.title||"Diocese of Cochin",{body:t.body,icon:"/images/diocese-logo.png"})})}catch(e){console.error("Error initializing notifications:",e),g("Failed to initialize notifications")}finally{h(!1)}}()},[]);let f=(0,t.useCallback)(async(e,t,i)=>{h(!0),g(null);try{let a=await (0,r.requestNotificationPermission)();if(!a)return g("Failed to get notification permission"),!1;if(l(a),localStorage.setItem(s,a),o("granted"),!(await fetch("/api/notifications/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a,userAgent:navigator.userAgent,[e]:!0})})).ok)throw Error(`Failed to subscribe to ${t}`);return i(!0),!0}catch(e){return console.error(`Error subscribing to ${t}:`,e),g(`Failed to subscribe to ${t} notifications`),!1}finally{h(!1)}},[]),y=(0,t.useCallback)(async(e,t,r)=>{if(!n)return!1;h(!0),g(null);try{if(!(await fetch(`/api/notifications/subscribe?token=${encodeURIComponent(n)}&type=${e}`,{method:"DELETE"})).ok)throw Error(`Failed to unsubscribe from ${t}`);return r(!1),!0}catch(e){return console.error(`Error unsubscribing from ${t}:`,e),g(`Failed to unsubscribe from ${t} notifications`),!1}finally{h(!1)}},[n]),b=(0,t.useCallback)(()=>f("subscribeToNews","news",d),[f]),w=(0,t.useCallback)(()=>y("news","news",d),[y]),j=(0,t.useCallback)(()=>f("subscribeToPriestCelebrations","priest celebrations",u),[f]),v=(0,t.useCallback)(()=>y("priest_celebrations","priest celebrations",u),[y]),N=(0,t.useCallback)(async(e,t)=>{g(null);try{let i=n;if(!i){if(!(i=await (0,r.requestNotificationPermission)()))return g("Failed to get notification permission"),!1;l(i),localStorage.setItem(s,i),o("granted")}if(!(await fetch("/api/notifications/priest-reminders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i,priestId:e,reminderType:t})})).ok)throw Error("Failed to subscribe to priest reminders");return!0}catch(e){return console.error("Error subscribing to priest reminders:",e),g("Failed to subscribe to priest reminders"),!1}},[n]),k=(0,t.useCallback)(async(e,t)=>{if(!n)return!1;g(null);try{let r=`/api/notifications/priest-reminders?token=${encodeURIComponent(n)}&priestId=${e}`;if(t&&(r+=`&reminderType=${t}`),!(await fetch(r,{method:"DELETE"})).ok)throw Error("Failed to unsubscribe from priest reminders");return!0}catch(e){return console.error("Error unsubscribing from priest reminders:",e),g("Failed to unsubscribe from priest reminders"),!1}},[n]),C=(0,t.useCallback)(async e=>{if(!n)return[];try{let t=await fetch(`/api/notifications/priest-reminders?token=${encodeURIComponent(n)}&priestId=${e}`);if(!t.ok)return[];return(await t.json()).subscriptions||[]}catch(e){return console.error("Error checking priest reminder status:",e),[]}},[n]);return{isSupported:e,permission:a,token:n,isSubscribedToNews:c,isSubscribedToPriestCelebrations:m,isLoading:p,error:x,subscribeToNews:b,unsubscribeFromNews:w,subscribeToPriestCelebrations:j,unsubscribeFromPriestCelebrations:v,subscribeToPriestReminder:N,unsubscribeFromPriestReminder:k,checkPriestReminderStatus:C}}],108703),e.s(["usePWA",0,function(){let[e,r]=(0,t.useState)(!1),[s,i]=(0,t.useState)(!1),[a,o]=(0,t.useState)(!1),[n,l]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!0);return(0,t.useEffect)(()=>{o(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);let e=window.matchMedia("(display-mode: standalone)").matches,t=!0===navigator.standalone,s=window.matchMedia("(display-mode: fullscreen)").matches,a=window.matchMedia("(display-mode: minimal-ui)").matches,n=e||t||s||a;i(n),r(n);let c=()=>
1{l(!0)};window.addEventListener("beforeinstallprompt",c);let m=window.matchMedia("(display-mode: standalone)"),u=e=>{i(e.matches),r(e.matches)};return m.addEventListener("change",u),d(!1),()=>{window.removeEventListener("beforeinstallprompt",c),m.removeEventListener("change",u)}},[]),{isPWA:e,isStandalone:s,isIOS:a,canInstall:n,isLoading:c}}],35101)}]);
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.