1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{148:(e,t,n)=>{n.r(t),n.d(t,{GridItem:()=>g,UgcCommentCount:()=>f,default:()=>h});var r=n(60143),a=n(29722),o=n(45159),i=n(62715),l=n(65019),c=n(50172),u=n(32368),d=n(71045),s=n(37942),m=n(54504);function f(e){var t,n=e.id,a=e.state,l=(0,i.GV)(function(e){return e.conf.defaultCommentFeature}),d=(0,o.useContext)(c.m),s=d.addStory,m=d.forStory;if((0,o.useEffect)(function(){s(n)}),"viafoura"!==l||!(0,u.l)(a))return null;var f=null!=(t=m({comments:a,id:n}))?t:0;return f<1?null:(0,r.jsxs)("div",{className:"flex flex-row items-center text-gray-900",children:[(0,r.jsx)("svg",{className:"mr-1",fill:"none",viewBox:"0 0 16 16",width:"16",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"m3.3864 1.543h9.7628c0.6712 0 1.2203 0.6 1.2203 1.3333v8c0 0.7333-0.5491 1.3333-1.2203 1.3333h-8.5424l-2.4407 2.6667v-12c0-0.73333 0.54915-1.3333 1.2203-1.3333zm1.2199 9.3333h8.5424v-8h-9.7627v9.3333l1.2203-1.3333z",fill:"#111827",fillRule:"evenodd"})}),f]})}var g=function(e){var t=e.category,n=e.commentsId,a=e.id,i=e.image,c=e.name,u=e.onClick,m=e.title,g=e.url,v=(0,o.useCallback)(function(){null==u||u(),(0,d.xN)({action:"click",label:m,section:"photos",signPost:t?[t]:void 0,ugc_id:a},"ugc_interaction")},[t,a,u,m]);return(0,r.jsxs)(l.A,{className:"rounded-lg border border-gray-300 bg-white no-underline shadow-sm hover:shadow-md focus:shadow-md @md:w-auto",href:g,noStyle:!0,onClick:v,children:[(0,r.jsx)("div",{className:"overflow-hidden rounded-t-lg",children:(0,r.jsx)("img",{alt:m,className:"h-52 w-full object-cover object-top @md:h-40",src:i})}),(0,r.jsx)("div",{className:"flex w-full items-center p-4",children:(0,r.jsxs)("div",{className:"flex w-full flex-col",children:[(0,r.jsx)("div",{className:"line-clamp-2 h-full min-h-10 text-sm font-semibold",children:m}),(0,r.jsxs)("div",{className:"mt-4 flex text-sm font-medium",children:[(0,r.jsx)("div",{className:"mr-4 line-clamp-2 text-gray-600",children:c}),(0,r.jsx)(f,{id:n,state:s.r$.OPEN})]})]})})]})};function v(e){var t=e.limit,n=e.offset,a=e.ugc;return a.length<n||n<1?null:(0,r.jsx)(r.Fragment,{children:a.slice(n-1,t).map(function(e){var t,n=e.ugcItem,a=n.id,i=n.title;return(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(g,{category:e.ugcItem.categoryName,commentsId:"ugc:".concat(a),id:a,name:null==(t=e.ugcItem.userDetails)?void 0:t.userName,title:i,url:e.ugcItem.canonicalUrl})},e.index)})})}let h=function(e){var t=e.zoneItemData,n=t.limit,o=t.offset,i=t.ugc,l=t.ugcListId,c=o-1,u=Math.min(null!=n?n:i.length,20),d=(0,m.Gr)({limitWithOffset:u+c,loadUgcCount:10,ugcItems:i,ugcListId:l}),s=d.loadMore,f=d.loadedUgcItems,g=d.loadedUgcLimit,h=d.loading,x=d.noMoreUgcItems,b=f.length<u-c,y=f.slice(0,g).map(function(e,t){return{index:t+1,ugcItem:e}});return y.length>0?(0,r.jsx)("div",{className:"@container",children:(0,r.jsxs)("div",{className:"mb-7 mt-5.5 border-gray-300",children:[(0,r.jsx)("div",{"data-testid":"ugc-container",children:(0,r.jsx)("div",{className:"grid w-full gap-4 @md:grid-cols-3",children:(0,r.jsx)(v,{limit:g,offset:o,ugc:y})})}),(0,r.jsx)("div",{className:"mb-5 mt-6 w-full",children:x?(0,r.jsx)("div",{className:"m-auto text-center font-inter text-base text-gray-500","data-testid":"no-more",children:(0,r.jsxs)("div",{className:"font-medium",children:["You have reached the end.",(0,r.jsx)("br",{}),"Fancy some more?"," ",(0,r.jsx)("a",{className:"text-indigo-700 underline",href:"/",children:"Visit our home page"})]})}):!b&&(0,r.jsx)("button",{className:(0,a.A)("m-auto mt-10 flex select-none items-center justify-center","rounded-md border border-gray-900 px-4 py-2 text-sm","font-inter text-gray-900 hover:bg-gray-50 focus:outline-none",{"pointer-events-none opacity-50":h}),"data-testid":"load-button",onClick:function(){return s()},type:"button",children:"Load More"})})]})}):null}},32368:(e,t,n)=>{n.d(t,{f:()=>o,l:()=>a});var r=n(37942);function a(e){return e===r.r$.OPEN}function o(e){return e>9e3?"9k+":e>=1e3?"".concat((e/1e3).toFixed(0),"k"):e.toString()}},50172:(e,t,n)=>{n.d(t,{A:()=>d,m:()=>u});var r=n(76367),a=n(30694),o=n(91167),i=n(60143),l=n(45159),c=n(62715),u=(0,l.createContext)({addStory(){},forStory:()=>null});function d(e){var t=e.children,n=(0,c.GV)(function(e){return e.features.viafoura}),d=(0,o._)((0,l.useState)({}),2),s=d[0],m=d[1];
1(0,l.useEffect)(function(){n.enabled&&Object.entries(s).forEach(function(e){var t=(0,o._)(e,2),n=t[0],i=Object.entries(t[1]).filter(function(e){return void 0===(0,o._)(e,2)[1]}).map(function(e){return(0,o._)(e,1)[0]});0!==i.length&&(m(function(e){var t=(0,r._)({},e);return i.forEach(function(e){t[n][e]=null}),t}),fetch("https://livecomments.viafoura.co/v4/livecomments/"+"".concat(n,"/content-containers/")+"comment-count-and-status/by-container-ids",{body:JSON.stringify(i),method:"POST"}).then(function(e){if(!e.ok)throw m(function(e){var t=(0,r._)({},e);return i.forEach(function(e){t[n][e]=0}),t}),Error("Viafoura comment count response error");return e}).then(function(e){return e.json()}).then(function(e){m(function(t){var o,i=!1,l=null!=(o=t[n])?o:{};return(e.forEach(function(e){var t=e.commentCount,n=e.containerId;l[n]!==t&&(i=!0,l[n]=t)}),i)?(0,a._)((0,r._)({},t),{[n]:l}):t})}).catch(function(e){console.error(e)}))})},[s,n]);var f=n.enabled?n.data.sectionUuid:"",g=(0,l.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;n.enabled&&m(function(n){return n[t]&&e in n[t]?n:(0,a._)((0,r._)({},n),{[t]:(0,a._)((0,r._)({},n[t]),{[e]:void 0})})})},[f,n.enabled]),v=(0,l.useCallback)(function(e){var t,n,r;return null!=(n=null==(r=s[null!=(t=e.viafouraSyndicationSectionUuid)?t:f])?void 0:r[e.id])?n:null},[s,f]),h=(0,l.useMemo)(function(){return{addStory:g,forStory:v}},[g,v]);return n.enabled?(0,i.jsx)(u.Provider,{value:h,children:t}):(0,i.jsx)(i.Fragment,{children:t})}},71045:(e,t,n)=>{n.d(t,{SQ:()=>g,X_:()=>m,bp:()=>d,rF:()=>f,xN:()=>s});var r=n(76367),a=n(30694),o=n(73321),i=n(62715),l=n(70044),c=n(63233),u=n(42696);function d(e,t){(0,c.CI)({data:{ad_category:e.categoryText||e.category.name,ad_date:e.publicationDate,ad_id:e.id,ad_title:e.title},event:t})}function s(e,t,n){var o,i,l,u,d;(0,c.CI)({data:(0,a._)((0,r._)({},e),{ad_category:void 0,ad_date:void 0,ad_id:void 0,ad_title:void 0,businessCategory:null!=(o=e.businessCategory)?o:void 0,businessName:null!=(i=e.businessName)?i:void 0,category:null!=(l=e.category)?l:void 0,signPost:null!=(u=e.signPost)?u:void 0,ugc_id:null!=(d=e.ugc_id)?d:void 0}),event:t,storyTags:null!=n?n:void 0})}function m(e,t){return t===l.It?e.images[1]:e.logo}function f(e){if(e.dateBorn){var t,n,r,a=new Date(e.dateBorn);if(e.dateDeceased){var o=new Date(e.dateDeceased);r=o.getFullYear();var i=Math.floor((o.getTime()-a.getTime())/1e3/60/60/24);t=0;for(var l=a.getFullYear();l<=o.getFullYear();l+=1){var c,d=(c=l)%4==0&&(c%100!=0||c%400==0)?366:365;i>=d&&(i-=d,t+=1)}}n=a.getFullYear()}else e.yearDeceased&&(r=e.yearDeceased,e.yearBorn&&(n=e.yearBorn));var s=[];return r&&(n?s.push("".concat(n," - ").concat(r)):s.push(r.toString())),void 0!==t&&s.push("Aged ".concat(t," year").concat((0,u.LS)(t))),s}function g(){var e,t,n,r,a,l=(0,o.useSearchParams)(),c=null!=(e=null==l||null==(r=l.get("q"))?void 0:r.trim())?e:"",u=null!=(t=null==l||null==(a=l.get("date"))?void 0:a.trim())?t:"",d=null!=(n=null==l?void 0:l.get("location"))?n:"",s=(0,i.GV)(function(e){return e.features.ugc.enabled&&e.features.ugc.data.useRegion}),m=null==l?void 0:l.get("region");return{date:u,isSearching:!!(c||u||d),location:d,query:c,region:null===m?s:"1"===m,regionDefault:s}}}}]);
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.