(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6303],{31686:function(e,t,r){"use strict";r.d(t,{Z:function(){return a.ZP}});var a=r(63289)},63426:function(e,t,r){"use strict";r.d(t,{dt:function(){return x},Id:function(){return m},OU:function(){return p},TX:function(){return g},ZP:function(){return B},mn:function(){return X}});var a,i,n,d,l,o,c,_,s,u,v,h,m,x,p,g,f=r(11527),j=r(45924),y=r(19800),C=r(34801),k=r(8857),S=r(50959),Z=r(95238),L=r(41249),b=r(41138),w=r(50401),N=r(81684),M=r(11771),I=r.n(M),A=r(16920),T=function(e){let{relatedContent:t,inline:r=!1,longText:a,qs:i}=e,n=(0,y.$)(),d=a?a.includes("]*?)>/gi,(e,t)=>{if(t.includes("target="))return e;let r=t.includes("rel="),a=t;return r?t.includes("noopener")||(a=t.replace(/rel=["']([^"']*?)["']/i,'rel="$1 noopener"')):a+=' rel="noopener"',"')}):a:void 0;return a||t&&t.length>0?(0,f.jsx)("div",{className:(0,j.Z)(I().card__related,r&&I()["card__related--inline"],i&&I().card__related__qs,"itinerari"===n.key&&I()["card__related--itinerari"]),children:a?(0,f.jsx)("div",{className:(0,j.Z)(I()["".concat(n.key)],I().card__related__longText),dangerouslySetInnerHTML:{__html:d}}):null==t?void 0:t.map((e,t)=>(0,f.jsxs)(y.rU,{href:null==e?void 0:e.path,...!(0,A.FS)(null==e?void 0:e.path,n.virtual_url)&&{rel:"nofollow"},target:"_blank",children:[(0,f.jsxs)("span",{className:(0,j.Z)(I()["".concat(n.key)]),children:[(0,N.Z)(e.__typename,null==e?void 0:e.path)," / "]}),(0,f.jsx)("span",{children:e.title})]},t))}):null},D=r(72203),H=r(32934),P=r.n(H);let q={id:"",url:"",title:"",lead:"",embed:"",subject:"",image:{title:"",url:""},moarLinks:[],content_type:""},E=e=>e.replace(/(<([^>]+)>)/gi,"").trim();var F=function(e){var t,r,a,i,n,d,l;let[o,c]=(0,S.useState)(q);return(0,S.useEffect)(()=>{let t={method:"GET"};(async()=>{if(e.id){let r=await fetch("".concat("https://prod.ilrestodelcarlino.it/teaserservice/teasers?objs=").concat(E(e.id)),t),a=await r.json();a&&c(a[0])}else c(q)})()},[]),(0,f.jsxs)("div",{className:P().card__main,children:[(null==o?void 0:o.content_type)==="video"&&(null==o?void 0:o.embed)&&e.size!==m.SM&&(0,f.jsx)("div",{className:P().card__image,children:(0,f.jsx)(D.Z,{embedCode:null==o?void 0:o.embed,playerType:e.playerType})}),(null==o?void 0:o.content_type)!=="video"&&e.size!==m.SM&&(null==o?void 0:null===(t=o.image)||void 0===t?void 0:t.url)&&(0,f.jsx)("div",{className:(0,j.Z)(P().card__image,P().polopolyImage),children:(0,f.jsx)(y.rU,{href:null==o?void 0:o.url,children:(0,f.jsx)(y.Ee,{src:null==o?void 0:null===(r=o.image)||void 0===r?void 0:r.url,alt:null!==(d=(0,y.Vt)(null==o?void 0:null===(a=o.image)||void 0===a?void 0:a.title))&&void 0!==d?d:"",title:null!==(l=(0,y.Vt)(null==o?void 0:null===(i=o.image)||void 0===i?void 0:i.title))&&void 0!==l?l:"",width:526,height:300,format:e.mediaFormat})})}),(0,f.jsxs)("div",{className:P().card__text,children:[(0,f.jsx)("div",{children:(null==o?void 0:o.subject)&&(0,f.jsx)("div",{className:(0,j.Z)(P().card__parent),children:null==o?void 0:o.subject})}),(null==o?void 0:o.title)&&(0,f.jsx)("header",{children:(0,f.jsxs)("h3",{className:(0,j.Z)(!parent&&P()["card__title--noParent"]),children:[X(null==o?void 0:o.title,"title",!1,null==o?void 0:o.url),(0,f.jsx)("span",{className:P().card__title__moarLinks,children:null==o?void 0:null===(n=o.moarLinks)||void 0===n?void 0:n.map(e=>(0,f.jsx)(S.Fragment,{children:X(e.title,"title",!1,e.url)},e.title))})]})}),e.showText&&(null==o?void 0:o.lead)&&(0,f.jsx)("div",{className:P().card__content,children:(0,f.jsx)("p",{children:X(null==o?void 0:o.lead,"text",!1,null==o?void 0:o.url)})})]})]})};(a=s||(s={})).SM="sm",a.MD="md",a.LG="lg",a.XL="xl",a.VIDEO_LEAF="vl",a.HF="half",(i=u||(u={})).Inside="inside",i.Outside="outside",(n=v||(v={})).Square="1:1",n.Wide="16:9",n.Ultrawide="21:9",(d=h||(h={}))[d.Hide=0]="Hide",d[d.Show=1]="Show",d[d.ShowWithPriority=2]="ShowWithPriority";let O=(e,t,r,a)=>(0,k.ZP)(e,{replace:e=>{if("text"===e.type&&"title"===t)return(0,f.jsx)(y.rU,{href:a,className:P().card__link,children:e.data});if(e instanceof k.W_){if("a"===e.name)return(0,f.jsx)(y.rU,{href:e.attribs.href,className:r?P().card__embeddedLink__qs:P().card__embeddedLink,children:(0,k.du)(e.children)});if("text"===t)return(0,f.jsx)(f.Fragment,{children:(0,k.du)(e.children)})}}});var U=function(e){let{data:t,className:r,showTitle:a=!0,rightSidebar:i=!1,qs:n}=e,{title:d,content:l}=t,o=new Date(null==l?void 0:l.publishedDate),c=(0,y.$)(),_=(0,S.useMemo)(()=>{var e;return(null==l?void 0:l.__typename)==="Link"?l.url||(null===(e=l.content)||void 0===e?void 0:e.url):null==l?void 0:l.path},[l]),[s]=(0,y.t6)();return(0,f.jsx)(f.Fragment,{children:d&&(0,f.jsx)("article",{"data-k5a-pos":null==t?void 0:t["data-k5a-pos"],onClick:()=>{s&&s(y.Sc.HP_POS,{title:d,path:_,position:null==t?void 0:t["data-k5a-pos"],source:"CARDULTIMORA"})},className:(0,j.Z)(P().card,P()["card--md"],i&&P()["card--md--right"],P()["card--md--".concat(c.key)],r),children:(0,f.jsxs)("div",{className:(0,j.Z)(P().card__main,P()["card__main--ultimaora"]),children:[(0,f.jsxs)("div",{className:(0,j.Z)(P()["card__main--flexdot"]),children:[(0,f.jsx)("div",{className:(0,j.Z)(P()["card__main--dot"])}),(0,f.jsx)("div",{className:(0,j.Z)(P()["card__main--time"]),children:"".concat(o.getHours(),":").concat((10>o.getMinutes()?"0":"")+o.getMinutes())})]}),(0,f.jsx)("div",{className:(0,j.Z)(P().card__text,P()["card__text--ultimaora"]),children:d&&a&&(0,f.jsx)("header",{children:(0,f.jsx)("h3",{children:O(d,"title",n,_)})})})]})})})},V=r(99775),R=r(31686),W=r(66770);(l=m||(m={})).SM="sm",l.MD="md",l.LG="lg",l.XL="xl",l.VIDEO_LEAF="vl",l.HF="half",(o=x||(x={})).Inside="inside",o.Outside="outside",(c=p||(p={})).Square="1:1",c.Wide="16:9",c.Ultrawide="21:9",c.Cinema="4:3",(_=g||(g={}))[_.Hide=0]="Hide",_[_.Show=1]="Show",_[_.ShowWithPriority=2]="ShowWithPriority";let X=(e,t,r,a,i)=>(0,k.ZP)(e,{replace:e=>{if("text"===e.type&&"title"===t)return" / "===e.data||" "===e.data?(0,f.jsx)("span",{children:e.data}):(0,f.jsx)(y.rU,{href:a,className:P().card__link,...i&&!(0,A.FS)(a,i.virtual_base_url||"")&&{rel:"nofollow"},children:e.data});if(e instanceof k.W_){if("a"===e.name)return(0,f.jsx)(y.rU,{href:e.attribs.href,...i&&!(0,A.FS)(e.attribs.href,i.virtual_base_url||"")&&{rel:"nofollow"},className:r?P().card__embeddedLink__qs:P().card__embeddedLink,children:(0,k.du)(e.children)});if("text"===t)return(0,f.jsx)(f.Fragment,{children:(0,k.du)(e.children)})}}}),G=e=>{let{href:t,children:r,host:a}=e;return t?(0,f.jsx)(y.rU,{href:t,...a&&!(0,A.FS)(t,a.virtual_base_url||"")&&{rel:"nofollow"},children:r}):(0,f.jsx)(f.Fragment,{children:r})},z=e=>{let{teaserByLine:t,authors:r,articleSection:a,hideAuthor:i}=e,n=(0,y.$)();return t&&"string"==typeof t&&/^[\s\n\t]+$/.test(t)?null:i||t||r?t&&!i?(0,f.jsxs)("div",{className:(0,j.Z)(P().card__author,(0,y.a1)(n.key)&&P().card__author__salus),children:["di ",(0,f.jsx)("span",{children:t})]}):r||i?(0,f.jsx)(R.Z,{author:r,teaserByLine:t,sectionTitle:a,className:P().card__author,hideAuthor:i}):(0,f.jsx)(f.Fragment,{}):(0,f.jsx)(f.Fragment,{})};var B=function(e){var t,r,a,i,n,d,l,o,c,_;let{size:s,priority:u,data:v,reverse:h=!1,relatedPosition:m="inside",showRelated:x=!0,inline:p=!1,mediaVisibility:g=1,className:N,showText:M=!0,showBelowText:I=!1,showTitle:A=!0,showOverTitle:H=!0,mediaFormat:q="16:9",slotName:E,videoPlayerType:O,parentLayout:R,showParentLink:B=!1,rightSidebar:$=!1,qs:K,ultimaora:Y,prerender:J=!1,forcePlayer:Q}=e,[ee,et]=(0,S.useState)(!0),{section:er}=(0,L.Vy)(),{isMobile:ea}=(0,y.Sj)(),{title:ei,content:en,text:ed,layout:el,teaserOvertitle:eo,longText:ec,isApertura:e_,byline:es}=v,{leaf:eu}=(0,L.Vy)(),ev=(null==v?void 0:null===(t=v.content)||void 0===t?void 0:t.__typename)==="ImageGallery"?null==v?void 0:null===(a=v.content)||void 0===a?void 0:null===(r=a.parent)||void 0===r?void 0:r.title:null===(d=v.content)||void 0===d?void 0:null===(n=d.contentPath)||void 0===n?void 0:null===(i=n[0])||void 0===i?void 0:i.title,eh=null==v?void 0:null===(l=v.content)||void 0===l?void 0:l.hideAuthor,em=(0,V.Z)({frontendData:null==en?void 0:en.frontendData}),{parent:ex,byline:ep,articleType:eg,updatedDate:ef}=en||{},ej=(0,y.$)(),ey=(0,S.useMemo)(()=>{var e;return(null==en?void 0:en.__typename)==="Link"?en.url||(null===(e=en.content)||void 0===e?void 0:e.url):(null==en?void 0:en.path)||(null==v?void 0:v.url)||""},[en]),eC=(null==v?void 0:null===(o=v.media)||void 0===o?void 0:o.image)||v.media,ek=v.media,eS=(null==ek?void 0:ek.embedCode)&&(null==ek?void 0:ek.embedCode).replace(/(dailymotion\.com\/player\/)[a-zA-Z0-9]+/g,"$1".concat("x8zb8")),eZ=null==ek?void 0:ek.mediaId,eL=null==ek?void 0:ek.showAdvertisement,eb=null==er?void 0:null===(c=er.path)||void 0===c?void 0:c.match(/video/),ew=(0,S.useMemo)(()=>eg===C.Iq.LiveArticle&&(0,b.K)(ef),[eg,ef]),eN=(0,S.useMemo)(()=>!!em&&em.showLiveBadge,[em]),eM=(0,S.useMemo)(()=>eo||(null==en?void 0:en.overTitle)||((null==ex?void 0:ex.hideSectionTitle)?"":null==ex?void 0:ex.title),[ex,eo,null==en?void 0:en.overTitle]),eI=(0,S.useMemo)(()=>!eo&&!(null==ex?void 0:ex.hideSectionTitle)&&B&&(null==er?void 0:er.localEdition)?null==ex?void 0:ex.path:ey,[ex,B]),eA=(0,S.useMemo)(()=>{if("ControApertura"===E&&!ea)return"16:9";let e=(0,y.vy)(ej.key)&&"md"==s&&ea&&"Layout-Apertura+Half"!==R;return eg===C.Iq.EditorialArticle&&"21:9"!==q&&!ea||e?"1:1":q},[eg,ea,q]),eT=(0,S.useMemo)(()=>null==eA?void 0:eA.replace(":","/"),[eA]),eD=(0,S.useMemo)(()=>1===g||2===g,[g]),eH=(0,S.useMemo)(()=>{switch(s){case"xl":return Z.dk;case"lg":return Z.Cy;case"md":return Z.qh;default:return"100vw"}},[s]),eP=(0,S.useMemo)(()=>{var e,t,r,a;return"string"==typeof(e=(0,k.ZP)(null!=ei?ei:""))?(0,y.Vt)(e):Array.isArray(e)?(0,y.Vt)((null===(r=e[0])||void 0===r?void 0:r.toString())||""):(null==e?void 0:null===(t=e.props)||void 0===t?void 0:t.children)?Array.isArray(e.props.children)?(0,y.Vt)((null===(a=e.props.children[0])||void 0===a?void 0:a.toString())||""):(0,y.Vt)(e.props.children.toString()):""},[ei]),[eq]=(0,y.t6)(),eE=(0,S.useMemo)(()=>eb?(0,W.Wv)(eu)?"VideoAltri":e_?"HPVideo1":"HPVideoaltri":eb?void 0:e_?"HP1":"HPaltri",[]);return(0,f.jsxs)("article",{"data-k5a-pos":null==v?void 0:v["data-k5a-pos"],onClick:()=>{eq(y.Sc.HP_POS,{title:ei,path:ey,position:null==v?void 0:v["data-k5a-pos"],source:"CARD"})},className:(0,j.Z)(P().card,P()["card--".concat(s)],$&&P()["card--".concat(s,"--right")],P()["card--".concat(s,"--").concat(ej.key)],p&&!Y&&P()["card--inline"],h&&P()["card--reverse"],eg===C.Iq.EditorialArticle&&P()["card--editorial"],(0,y.Zj)(ej.key)&&P()["card--".concat(ej.key)],N),children:["polopoly-widget"===el?(0,f.jsx)(F,{id:ei