sass-template-common 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9584,7 +9584,7 @@ async function w2(e) {
9584
9584
  ), d = await A2(d, l), d = m2(d), d = h2(d);
9585
9585
  const c = t.main.sources ?? [];
9586
9586
  return /* @__PURE__ */ m("div", { className: $t.content, children: [
9587
- o !== "liveblogs" || e.showHeaderImage ? t.hascontent?.hasgalleryimages ? /* @__PURE__ */ a(
9587
+ o !== "liveblogs" && e.showHeaderImage ? t.hascontent?.hasgalleryimages ? /* @__PURE__ */ a(
9588
9588
  js,
9589
9589
  {
9590
9590
  newsformated: t,
@@ -108,4 +108,4 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
108
108
  ${m}
109
109
  <figcaption>${u.data.data[0].main.description||""}</figcaption>
110
110
  </figure>
111
- `}o+=y,r=h}return o+=e.slice(r),o}async function wc(e){const{news:n,banners:a,newsRelatedResponses:s,slug:o,itemList:r,socials:i,getVideos:l}=e;let d=n?.body?.rendered??"";d=d.replace(/&nbsp;/g,""),d=fc(d,a),d=gc(d),d=await Co(d),d=await pc(d,e.texts,s),d=await Ac(d,l),d=uc(d),d=mc(d);const c=n.main.sources??[];return t.jsxs("div",{className:yn.content,children:[o!=="liveblogs"||e.showHeaderImage?n.hascontent?.hasgalleryimages?t.jsx(ia,{newsformated:n,internal:n.info.link.internal}):t.jsx(Ws,{preview:n.preview}):null,t.jsx(ae,{banners:a,name:"block_1"}),t.jsx("div",{className:yn.journalistArticleContent,children:t.jsx(ic,{autorIcon:e.autorIcon,socials:i,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),t.jsx(cc,{summary:n.main.summary}),t.jsx("div",{className:yn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),t.jsx(ac,{texts:e.texts,itemList:r,banners:a,slug:o}),c.length>0&&t.jsxs("div",{className:yn.noteSource,children:[t.jsx(hc,{}),t.jsx("p",{children:e.texts.noteSource+(c.length===1?"":"s")+": "+c.map(h=>h.name).join(", ")})]})]})}const vo={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},yc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNewsMultimedia({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.videos.filter(r=>r.type==="video-embedded")[0];return t.jsxs("div",{className:vo.content,children:[t.jsx("div",{dangerouslySetInnerHTML:{__html:o?.code??""}}),t.jsx("p",{className:vo.title,children:o?.title})]})},la={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},bc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNewsMultimedia({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.videos.filter(r=>r.type==="video-youtube")[0];return t.jsxs("div",{className:la.content,children:[t.jsx("iframe",{className:la.iframeStyled,src:`https://www.youtube.com/embed/${o?.code??""}`,frameBorder:"0",allowFullScreen:!0}),t.jsx("p",{className:la.title,children:o?.title})]})},Cc={content:"_content_ezbiw_1"},vc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNews({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.external?.iframe;return t.jsx("div",{className:Cc.content,dangerouslySetInnerHTML:{__html:o??""}})},_o={content:"_content_156j7_1"},Fe={imagen:"imagen",videoEmbedded:"videoEmbedded",videoYouTube:"videoYouTube",iframe:"iframe"},_c={[Fe.videoEmbedded]:yc,[Fe.videoYouTube]:bc,[Fe.iframe]:vc},Nc=({news:e})=>{const{config:n,hascontent:a,info:s}=e,o=n.articlepreview,r=s.link.internal,i=a?.hasgalleryimages;if(o===Fe.imagen&&i)return t.jsx("div",{className:_o.content,children:t.jsx(ia,{newsformated:e,internal:r})});const l=o?_c[o]:null;return l?t.jsx("div",{className:_o.content,children:t.jsx(l,{newsformated:e,internal:r})}):null},Sc=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,cardWidth:200,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Ut,{...l,titleGradient:!0,paths:e.paths},i)})})})},kc=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,cardWidth:343,cardGap:32,visibleItems:3,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Ut,{...l,titleGradient:!0,paths:e.paths},i)})})})},Ec=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return b.createElement(Ut,{...l,key:i,titleGradient:!0,paths:e.paths})})})})},bn=e=>{const n={};for(const a in e)a.startsWith("--")&&(n[a]=e[a]);return n},Xe={headerSection:"_headerSection_1c69w_1",title:"_title_1c69w_11",subtitle:"_subtitle_1c69w_23",newsContent:"_newsContent_1c69w_36",containerCards:"_containerCards_1c69w_44",image:"_image_1c69w_50",blockHeadContainer:"_blockHeadContainer_1c69w_56"},Ic=e=>{const{content:n,title:a,isVideo:s}=e;if(!n||n.length===0)return;const o=n[0],r=n.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return o&&r&&t.jsxs(te,{title:a,titleUrl:e.titleUrl,children:[t.jsx("div",{className:Xe.headerSection,children:t.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:Xe.image,href:o?.info?.link?.url,target:o?.info?.link?.target,children:[t.jsxs("div",{className:Xe.blockHeadContainer,children:[t.jsx("p",{className:Xe.title,children:o?.main?.title.home}),o?.main?.subtitle?.rendered&&t.jsx("p",{className:Xe.subtitle,children:o?.main?.subtitle?.striped})]}),t.jsx(ge,{preview:o.preview})]})}),t.jsxs("div",{className:Xe.containerCards,children:[t.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),t.jsx("div",{className:Xe.newsContent,children:Array.isArray(r)&&r.map((l,d)=>{const c={...l,main:{...l.main,title:{...l.main.title,section:i?l.main.title.home:l.main.title.section}}};return t.jsx("div",{style:{order:d},children:t.jsx(Ee,{...c,isVideo:s,paths:e.paths})},d)})})]})]})},No={banner:e=>t.jsx(ae,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>t.jsx(rn,{...e}),"Modulo 1x3":e=>t.jsx(na,{...e}),"Modulo 1x4":e=>t.jsx(uo,{...e}),"Modulo 1x5":e=>t.jsx(mo,{...e}),"Destacado noticias":e=>t.jsx(io,{...e}),"Destacado full width":e=>t.jsx(Ic,{...e}),"Destacado videos":e=>t.jsx(fo,{...e}),"Carrusel card":e=>t.jsx(Ao,{...e}),"Carrusel story":e=>t.jsx(Sc,{...e}),"Carrusel owl":e=>t.jsx(kc,{...e}),"Modulo fotogaleria":e=>t.jsx(Ec,{...e}),"Carrusel opinion":e=>t.jsx(wo,{...e}),"Modulo 1x3 card":e=>t.jsx(po,{...e})};function ca({component:e,slot_id:n,data:a,banners:s}){if(s)return No[e]&&t.jsx("div",{className:"home-slot",style:bn(a),children:No[e]({...a,banners:s,slot_id:n})})}function Uc({children:e,stylesConfigEntry:n}){return t.jsx("div",{className:"home-slot",style:bn(n),children:e})}const So={Diario:e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(so,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:n,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(so,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:n,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>t.jsx(mt,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>t.jsx(Ol,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>t.jsx(Pl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Cn=({component:e,data:n,banners:a,rightOnlyBanner:s})=>t.jsx("div",{style:bn(n),children:So[e]&&So[e]({...n,rightOnlyBanner:s,banners:a})}),Tc=({slots:e,DYNAMIC_SLOT_SUBINDEXES:n,stylesConfig:a,AutorIcon:s,config:o,banners:r})=>{const i=[],d=n,c=Object.keys(e).length/d;for(let h=1;h<=c;h++)for(let u=1;u<=d;u++){const f="Home_"+h+"_"+u;!e[f]||!e[f].blockSass||!e[f].blockSass[0]||!e[f].blockSass[0].value||!e[f].blockSass[0].block||e[f].blockSass[0].block==="No Mostrar"||i.push(t.jsxs(Ls,{show:!!e[f].content?.data,order:(h-1)*d+(u-1),children:[t.jsx(ca,{component:e[f].blockSass[0].block,banners:r,slot_id:f,data:{...e[f].blockSass[0].block?a[e[f].blockSass[0].block]:[],content:e[f].content?.data??[],title:e[f].blockSass[0].title??void 0,titleUrl:e[f].blockSass[0].link??void 0,autorIcon:t.jsx(s,{}),paths:o.paths}}),t.jsx($e,{children:t.jsx(Te,{banners:r,index:"dynamic_"+h+"_"+u})})]},h+"_"+u))}return i},xc=({mainBlock:e,StylesConfigMain:n,config:a,banners:s})=>{const{PUBLIC_ENV:o}=Y();if(o!=="local")return null;const r=e?.news?.data||[],i=(l,d)=>({...e?.news,...n[l],data:r.slice(0,d),paths:a.paths});return t.jsxs(t.Fragment,{children:[t.jsx(Cn,{component:"Super",data:i("Super",1),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})}),t.jsx(Cn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})}),t.jsx(Cn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})})]})},qc=e=>{const{config:n,hascontent:a}=e,s=n.articlepreview,o=[Fe.videoEmbedded,Fe.videoYouTube,Fe.iframe];return!!(s===Fe.imagen&&a?.hasgalleryimages||o.includes(s))},Bc=async e=>{const{custom_complement:n,ranking:a=[],banners:s,autor:o=[],news:r=[],newsRelatedResponses:i=[],itemList:l=[],socials:d,getVideos:c}=e,h=e.slug==="liveblogs";if(!(!r||!r[0]))return t.jsx(t.Fragment,{children:t.jsxs(Kl,{className:ra.contentLayout2,children:[t.jsx(Zl,{option:e.slug,news:r,paths:e.paths}),t.jsx(Te,{banners:s,index:1}),!h&&t.jsx(Nc,{news:r[0]}),t.jsx(Jl,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:l,ranking:a,bannerTop:t.jsx(ae,{banners:s??[],name:"right_1"}),banner:t.jsx(ae,{banners:s??[],name:"right_2"}),complement:n||t.jsxs("div",{id:"comentarios",suppressHydrationWarning:!0,children:[o.length>0&&t.jsx(no,{texts:e.texts,autorIcon:e.autorIcon,autor:o[0],paths:e.paths}),r[0].authors.length>1&&t.jsx(ao,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),t.jsx("div",{className:ra.tagContent,children:t.jsx(to,{tags:r[0]?.keywords?.tags,paths:e.paths})}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath}))}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:2})}),t.jsx(ca,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0}}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:3})}),t.jsx(te,{title:e.texts.moreNewsTitle,children:t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",currentNews:r[0]}))})}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:4})})]})]}),children:t.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[t.jsx(wc,{texts:e.texts,autorIcon:e.autorIcon,socials:d,news:r[0],banners:s,newsRelatedResponses:i,itemList:l,slug:e.slug,getVideos:c,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!qc(r[0])}),t.jsx(ae,{banners:s??[],name:"block_3"})]})})]})})},pt={content:"_content_1tl6i_1",contentInfo:"_contentInfo_1tl6i_24",imageStyled:"_imageStyled_1tl6i_41",name:"_name_1tl6i_46",description:"_description_1tl6i_51",contentInfoWithoutImg:"_contentInfoWithoutImg_1tl6i_104"},Lc=async e=>{const n=e.img?await ne(e.img):"";return t.jsx("section",{className:pt.content,children:t.jsxs("div",{className:`${pt.contentInfo} ${n?"":pt.contentInfoWithoutImg}`,children:[e.img&&t.jsx("img",{fetchPriority:"low",loading:"lazy",className:pt.imageStyled,src:n}),t.jsx("h1",{className:pt.name,children:e.tag}),e.description&&t.jsx("div",{className:pt.description,dangerouslySetInnerHTML:{__html:e.description}})]})})},vn={content:"_content_7wvro_1",contentInfo:"_contentInfo_7wvro_23",name:"_name_7wvro_34",description:"_description_7wvro_43"},Dc=e=>t.jsx("section",{className:vn.content,style:{color:e.textColor,"--backDropHeigth":e.backDropHeigth?e.backDropHeigth:"100%",padding:e.sectionPadding??"","--backgroundColor":e.backgroundColor},children:t.jsxs("div",{className:vn.contentInfo,children:[t.jsx("h1",{className:vn.name,style:{color:e.textColor},children:e.tag}),e.description&&t.jsx("div",{style:{color:e.textColor},className:vn.description,dangerouslySetInnerHTML:{__html:e.description}})]})}),Mc=e=>{const{option:n,entity:a}=e;switch(n){case"op1":return t.jsx(Lc,{tag:a?.name??"",img:a?.image?.url??"",description:a?.description?a?.description:""});case"op2":return t.jsx(Dc,{tag:a?.name??"",description:a?.description?a?.description:"",backDropHeigth:e.backDropHeigth,backgroundColor:e.backgroundColor,sectionPadding:e.sectionPadding,textColor:e.textColor});default:return t.jsx(t.Fragment,{})}},Mt={content:"_content_gxziw_1",buttonStyled:"_buttonStyled_gxziw_9",searchStyled:"_searchStyled_gxziw_21",inputStyled:"_inputStyled_gxziw_32",inputStyledTest:"_inputStyledTest_gxziw_51"},Pc=e=>t.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("g",{opacity:"0.8",children:t.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),Oc=e=>t.jsx("form",{className:Mt.content,style:{height:e.hasContent?"218px":"50vh"},children:t.jsxs("div",{className:Mt.inputStyled,children:[t.jsx("input",{className:Mt.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),t.jsx("button",{className:Mt.buttonStyled,type:"submit",children:t.jsx(Pc,{className:Mt.searchStyled})})]})}),da={content:"_content_io3tv_1",newsContentSection:"_newsContentSection_io3tv_5",itemContent:"_itemContent_io3tv_10"},Qc=e=>{const{data:n,option:a,autor:s,page:o,banners:r,pathname:i,ranking:l,currentPage:d,slug:c,texts:h={}}=e,u=[5,10,15],f={5:1,10:2,15:3};switch(a){case"op1":return t.jsx(t.Fragment,{children:t.jsxs(Yn,{children:[t.jsx(Js,{autor:s[0],autorIcon:e.autorIcon}),t.jsx(Jn,{paths:e.paths,ranking:l,readestTitle:h.readestTitle??"",bannerTop:t.jsx(ae,{banners:r??[],name:"right_1"}),banner:t.jsx(ae,{banners:r??[],name:"right_2"}),children:t.jsx("section",{className:da.content,children:n.length>0?t.jsx(un,{className:[da.newsContentSection,"padding-0"].join(" "),paginatorComponent:t.jsx(Et,{texts:h,pathname:i,query:"",currentPage:d,maxPages:e.paginationLimit,showNext:!(n.length<e.newsListLimit)}),children:Array.isArray(n)&&n?.map((y,m)=>t.jsxs(b.Fragment,{children:[u.includes(m+1)&&t.jsx("div",{className:da.itemContent+" banner-context",children:t.jsx(ae,{banners:r??[],name:`block_2_${f[m+1]}`})}),t.jsx(wn,{autorIcon:e.autorIcon,item:y,option:c,paths:e.paths},m)]},m))}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})})})]})});case"op2":return t.jsx(t.Fragment,{children:t.jsxs(Yn,{children:[t.jsx(Zs,{autor:s[0],autorIcon:e.autorIcon}),Array.isArray(n)?t.jsxs(t.Fragment,{children:[t.jsx(na,{content:n,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),t.jsx(Et,{texts:h,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(o),showNext:!((n.length??0)<Number(e.newsListLimit))})]}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})]})});default:return t.jsx(t.Fragment,{})}},ko={content:"_content_pq89v_1",videoContent:"_videoContent_pq89v_9"},Pt={container:"_container_1xr2t_1",playStyled:"_playStyled_1xr2t_6",imageStyled:"_imageStyled_1xr2t_13",longer:"_longer_1xr2t_26",contentNews:"_contentNews_1xr2t_31",tagContent:"_tagContent_1xr2t_51",tag:"_tag_1xr2t_51",titular:"_titular_1xr2t_68",small:"_small_1xr2t_81",figure:"_figure_1xr2t_87",backDrop:"_backDrop_1xr2t_92",backDropAux:"_backDropAux_1xr2t_100"},Eo=async e=>{const{size:n="longer",video:a}=e,s=a.main.image.sizes[0]?.url??"";return t.jsx("figure",{className:Pt.figure,children:t.jsxs("span",{className:Pt.backdrop,children:[t.jsx("span",{className:Pt.backDropAux}),t.jsx(T,{href:a.info.link.url,target:a.info.link.target,children:t.jsxs("div",{children:[a.main.image.sizes.map(async(o,r)=>o.width>=580?t.jsx("source",{media:"(width >=900px)",srcSet:await ne(o.url)},r):t.jsx("source",{media:"(width <900px)",srcSet:await ne(o.url)},r)),t.jsx("img",{fetchPriority:"low",loading:"lazy",className:[Pt.imageStyled,Pt[n]].join(" "),alt:"",src:s?await ne(s):""})]})})]})})},jc=e=>{const{videos:n}=e;return t.jsx("div",{className:ko.content,children:t.jsx(rt,{children:t.jsx(te,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:ko.videoContent,children:[t.jsx(Eo,{video:n[0]}),t.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.slice(1).map((a,s)=>t.jsx(Eo,{size:"small",video:a},`video-small-${s}`))})]})})})})},Re={content:"_content_ruy5q_1",videoContent:"_videoContent_ruy5q_9",articleSection:"_articleSection_ruy5q_21",contentLatout:"_contentLatout_ruy5q_31",title:"_title_ruy5q_36",article:"_article_ruy5q_21",correspondent:"_correspondent_ruy5q_64"},Io={container:"_container_1rq2h_1",playStyled:"_playStyled_1rq2h_9"},Gc=e=>{const{video:n}=e;return t.jsx(T,{href:n.info.link.url?n.info.link.url:void 0,target:n.info.link.target,children:t.jsxs("section",{className:Io.container,children:[t.jsx(ge,{isLarge:!0,preview:{sizes:n.main.image.sizes,description:n.main.description}}),t.jsx(lt,{className:Io.playStyled})]})})},$c=e=>{const n=()=>e?.video.main.author?`${e?.video.main.author} - ${ye(e.video.info.date.created)}`:e?.video.main.author;return t.jsx("div",{className:Re.content,children:t.jsx(rt,{className:Re.contentLatout,children:t.jsx(te,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:Re.videoContent,children:[t.jsx(Gc,{video:e.video}),t.jsxs("div",{className:Re.articleSection,children:[t.jsx(T,{className:Re.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),t.jsx("p",{className:Re.article,children:be(e.video.main.description)}),t.jsx("p",{className:Re.correspondent,children:n()})]})]})})})})},zc=e=>{switch(e.option){case"op1":return t.jsx(jc,{videos:e.data});case"op2":return t.jsx($c,{video:e.data[0]});default:return t.jsx(t.Fragment,{})}};function Hc({containerId:e,containerId2:n}){return b.useEffect(()=>{try{let a=function(){const h=window.twttr;h?.widgets?h.widgets.load(s):c<10?(c++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const s=document.getElementById(e),o=document.getElementById(n);if(!s&&!o)return;const r=s?.querySelectorAll("script[src]")??[],i=o?.querySelectorAll("script[src]")??[];[...r,...i].forEach(h=>{const u=document.createElement("script");Array.from(h.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),h.replaceWith(u)});const d=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(d)for(let h=0;h<d.length;h++)d[h]?.remove();let c=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const h=document.createElement("script");h.src="https://platform.twitter.com/widgets.js",h.async=!0,h.onload=a,document.body.appendChild(h)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Vc=e=>{const{isVideo:n=!1,isLarge:a=!1,hasShadow:s=!1,BackDropAuxHeigthMobile:o}=e,r=b.useMemo(()=>e?.preview?.sizes||[],[e?.preview?.sizes]);if(!r.length||!r[0]?.url||r[0]?.url==="")return t.jsx("div",{className:K.imagePlaceholder});const{PUBLIC_API_HOST:i,PUBLIC_ENV:l}=Y();return t.jsx("figure",{className:K.figure,children:t.jsxs("span",{className:K.backdrop,children:[t.jsx("span",{className:K.backdropAux,style:{height:o||"56.25%"}}),t.jsxs("picture",{children:[t.jsx("img",{fetchPriority:"low",loading:"lazy",className:K.imageStyled,alt:e.preview?.description||"",src:(l==="local"?i:"")+r[0]?.url,style:{boxShadow:s?"0px 4px 8px 0px #00000033":"0px"}}),n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:K.boxPlayIcon,style:{height:a?"40%":"72px"}}),t.jsx(lt,{className:K.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Fc=e=>t.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),Uo={info:{section:{name:"",slug:"",url:""},link:{url:"invalidUrl",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},To=6,Wc=({section:e,currentNews:n,banner:a,isVisible:s=!1,stylesConfig:o})=>{const[r,i]=b.useState({data:Array.from({length:To},()=>Uo)}),[l,d]=b.useState(!1),c=b.useCallback(async()=>{if(!(l||!n?.info?.link?.internal)){d(!0);try{const h=new URLSearchParams({section:e,currentNewsLink:n.info.link.internal}),u=await fetch(`/api/get-more-news?${h}`);if(!u.ok)throw i(void 0),new Error(`HTTP error! status: ${u.status}`);const f=await u.json();i({...f,data:f.data.slice(0,To)})}catch(h){console.error("[/api/get-more-news] Error:",h.message),i(void 0)}}},[e,n.info.link.internal,l]);return b.useEffect(()=>{s&&c()},[s,r,c]),!r?.data||r.data.length===0?null:t.jsx(Yc,{news:r.data,title:"Más Noticias",...o["Modulo 1x3 Client"]??o["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,isVisible:s})},Yc=e=>{const{news:n,hasLines:a=!1}=e,s=o=>a&&(o+1)%3!==0?oa.contentSeparator:"";return t.jsx("div",{className:oa.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:n.map((o,r)=>{const{main:i,authors:l,info:d,preview:c,isVideo:h=!1,config:u,overImage:f="default",isTitle:y=!1,isLarge:m=!1}=o;return t.jsx("div",{className:s(r),style:{order:r},children:t.jsxs("section",{className:It.content,children:[t.jsx(T,{title:i?.title?.section,href:d?.link?.url??"invalidUrl","aria-label":i?.title?.section??"nota",target:d?.link?.target,children:t.jsx(Vc,{isVisible:e.isVisible,preview:c,rounded:e.rounded,isVideo:h,isLarge:m,getImageUrl:e.getImageUrl})}),t.jsx("div",{className:It.newsDescription,children:t.jsx(Kc,{main:i,authors:l,info:d,preview:c,share:e.share,config:u,overImage:f,isTitle:y,paths:o.paths,isVisible:e.isVisible})})]})},r)})})},Kc=e=>{const{share:n=!1,cutSubtitle:a=!0}=e,o=(()=>{if(!e?.authors||e.authors.length===0)return"";const r=e.authors[0],i=ye(e.info?.date?.modified);return r&&e?.config?.showtime&&e.config?.showauthor?`${r.fullname} - ${i}`:r&&e.config?.showauthor?r.fullname:e?.config?.showtime?i:""})();return t.jsxs("div",{className:F.boxInformation,children:[n&&t.jsx(Fc,{className:F.dotStyles}),e?.info?.section?.url&&t.jsxs("div",{className:F.sectionDescriptionContainer,children:[t.jsx(T,{className:F.sectionDescription,href:e.info.section.url??"invalidUrl",children:e.info.section.name}),e?.main?.uppertitle&&t.jsx("p",{className:F.uppertitle,children:e.main.uppertitle})]}),t.jsx("h2",{className:F.articule,children:t.jsx(T,{className:F.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&t.jsx("p",{className:F.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?be(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&o&&t.jsx(t.Fragment,{children:e.authors?.[0]?.internaluser?t.jsx(T,{className:F.correspondentLink,href:`/autor/${e.authors[0].name}`,children:o}):t.jsx("div",{className:F.correspondent,children:o})})]})},Jc=({user:e,handleLogout:n,message:a})=>{const s=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},o=e.firstname??"Usuario";return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):t.jsx("div",{className:"comment-avatar",children:o.charAt(0).toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{className:"comment-header",children:[t.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",o,"!"]}),t.jsx("div",{className:"user-actions-options",children:t.jsx("button",{onClick:()=>{n()},children:"Cerrar Sesion"})}),t.jsx("button",{className:"user-actions-span",onClick:s,children:t.jsx(gn,{width:13,height:13,fill:"black"})})]}),t.jsx("p",{className:"comment-text",children:a})]})]})})},ee={overlay:"_overlay_qj491_3",popup:"_popup_qj491_17",title:"_title_qj491_40",optionsContainer:"_optionsContainer_qj491_52",option:"_option_qj491_52",radioInput:"_radioInput_qj491_66",radioCustom:"_radioCustom_qj491_70",optionLabel:"_optionLabel_qj491_97",buttons:"_buttons_qj491_110",cancelButton:"_cancelButton_qj491_117",closeButton:"_closeButton_qj491_118",buttonAlone:"_buttonAlone_qj491_137",reportButton:"_reportButton_qj491_143",successContainer:"_successContainer_qj491_163",thumbsUp:"_thumbsUp_qj491_171",successMessage:"_successMessage_qj491_177",errorMessage:"_errorMessage_qj491_218",loadingContainer:"_loadingContainer_qj491_231"},xo=async e=>{const{PUBLIC_ENV:n}=Y();if(n==="local")return!0;if(!e)return!1;try{const i=await(await fetch("https://recaptchaenterprise.googleapis.com/v1/projects/undefined/assessments?key=undefined",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:void 0}})})).json();return console.log("reCAPTCHA Enterprise verification result:",i),i.tokenProperties?.valid===!0}catch(a){return console.error("Error verificando reCAPTCHA Enterprise:",a),!1}};async function Zc({publication:e,username:n,id:a,type:s,baseUrl:o,captchaToken:r,apiToken:i}){if(!e||!n||!a||!s||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof n!="string"||typeof a!="string"||typeof s!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await xo(r))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const l=`${o}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(s),c=new URLSearchParams({publication:e,username:n,id:a,type:d}),h=`${l}?${c.toString()}`;try{console.log("Reporting comment:",{publication:e,username:n,id:a,type:s,encodedType:d,url:h});const u=await V.post(h,null,{headers:{"User-Agent":"Bluestack","x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",u.data),u.status===200||u.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:u.status,data:u.data};throw new Error(`Respuesta inesperada del servidor: ${u.status}`)}catch(u){if(console.error("Error reporting comment:",u),V.isAxiosError(u)){const f=u.response?.status,y=u.response?.data;throw f===400?new Error("Datos inválidos para el reporte"):f===401?new Error("Token de API inválido"):f===403?new Error("Acceso denegado para reportar comentario"):f===404?new Error("Comentario no encontrado"):f===409?new Error("El comentario ya fue reportado por este usuario"):f===500?new Error("Error interno del servidor CMS"):new Error(y?.error||y?.message||`Error HTTP ${f}: No se pudo reportar el comentario`)}throw u}}const Ue={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function Xc(e){return Ue[e]}const et=300,je={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function Rc(e){const n=e.split(" ");if(n.length!==3)return e;const[a,s,o]=n,r=s.charAt(0).toUpperCase()+s.slice(1).toLowerCase();return`${a} ${r} ${o}`}const ha=(e,n)=>{if(!e||!e.current)return{boolean:!1,text:""};const a=e.current?.value||"",s=a.length>et,{PUBLIC_ENV:o}=Y(),r=o==="local",i=a.trim()!==""&&(r||n!=="")&&!s,l=s?`No debes exceder el limite de ${et} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:i,text:l}},qo=e=>{const n=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!n)return[];try{return JSON.parse(decodeURIComponent(n.split("=")[1]??""))}catch{return[]}},ed=(e,n)=>{const a=qo(e);a.includes(n)||(a.push(n),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function td(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let l="";return r.length<=2?l=r[0]+"*":l=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${l}${i}`}const _={overlay:"_overlay_tlrod_1",header:"_header_tlrod_18",logo:"_logo_tlrod_25",card:"_card_tlrod_32",close:"_close_tlrod_47",form:"_form_tlrod_71",formUl:"_formUl_tlrod_80",field:"_field_tlrod_92",label:"_label_tlrod_99",input:"_input_tlrod_108",error:"_error_tlrod_126",primary:"_primary_tlrod_132",divider:"_divider_tlrod_167",google:"_google_tlrod_193",googleIcon:"_googleIcon_tlrod_223",spin:"_spin_tlrod_256",checkboxRow:"_checkboxRow_tlrod_278",switch:"_switch_tlrod_307",terms:"_terms_tlrod_315",message:"_message_tlrod_346",passwordChecker:"_passwordChecker_tlrod_351",valid:"_valid_tlrod_370",invalid:"_invalid_tlrod_374",forgotPassword:"_forgotPassword_tlrod_378",successContainer:"_successContainer_tlrod_397",thumbsUp:"_thumbsUp_tlrod_405",successMessage:"_successMessage_tlrod_411"},Ge=()=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:_.spin,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),nd=({isOpen:e,onClose:n,commentId:a,publication:s,username:o})=>{const[r,i]=b.useState("form"),[l,d]=b.useState(""),[c,h]=b.useState(""),[u]=b.useState(""),f=[{id:"spam",label:Ue.spam},{id:"inappropriate",label:Ue.inappropriate},{id:"hate",label:Ue.hate},{id:"misinformation",label:Ue.misinformation},{id:"terrorism",label:Ue.terrorism},{id:"intellectual",label:Ue.intellectual},{id:"bullying",label:Ue.bullying}],y=async()=>{if(!(!l||!a)){if(qo(document).includes(a)){h("Ya has reportado este comentario.");return}i("loading"),h("");try{const w=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:s,username:o,id:a,captchaToken:u,type:Ue[l]})})).json();if(w.type==="success")ed(document,a),i("success"),setTimeout(()=>{m()},3e3);else throw new Error(w.message||"Error al reportar comentario")}catch(g){console.error("Error reporting comment:",g),h(g.message||"Error al reportar comentario"),i("form")}}},m=()=>{i("form"),d(""),h(""),n()};return!e||!a||!o?null:t.jsx("div",{className:ee.overlay,children:t.jsxs("div",{className:ee.popup,children:[t.jsx("button",{className:"close-reply-form",onClick:m,children:t.jsx(ct,{})}),t.jsx("h2",{className:ee.title,children:"Reportar Abuso"}),r==="loading"&&t.jsx("div",{className:ee.loadingContainer,children:t.jsx(Ge,{})}),r==="form"||r==="loading"?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:ee.optionsContainer,children:f.map(g=>t.jsxs("label",{className:ee.option,children:[t.jsx("input",{type:"radio",name:"reportReason",value:g.id,checked:l===g.id,onChange:w=>d(w.target.value),className:ee.radioInput}),t.jsx("span",{className:ee.radioCustom}),t.jsx("span",{className:ee.optionLabel,children:g.label})]},g.id))}),c&&t.jsx("div",{className:ee.errorMessage,children:c}),t.jsxs("div",{className:ee.buttons,children:[t.jsx("button",{onClick:m,className:ee.cancelButton,children:"Cancelar"}),t.jsx("button",{onClick:y,disabled:!l,className:ee.reportButton,children:"Reportar"})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:ee.successContainer,children:[t.jsx("div",{className:ee.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsx("p",{className:ee.successMessage,children:"¡Gracias por reportar!"})]}),t.jsx("div",{className:ee.buttons,children:t.jsx("button",{onClick:m,className:[ee.closeButton,ee.buttonAlone].join(" "),children:"Cerrar"})})]})]})})};async function _n({publication:e,path:n,size:a=5,sizereply:s=2,id:o,lastid:r,state:i="5,6",apiToken:l}){if(!e||!n)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof n!="string")throw new Error("Invalid input types for publication or path");if(!l)throw new Error("Missing CMS API token");const d=parseInt(String(a),10),c=parseInt(String(s),10);if(isNaN(d)||d<=0)throw new Error("Invalid size parameter");if(isNaN(c)||c<0)throw new Error("Invalid sizereply parameter");const h=`${ka()}/hit/5.0/1/newcomments/get`,u=new URLSearchParams({publication:e,path:n,size:d.toString(),sizereply:c.toString(),state:i});o&&u.append("id",o),r&&u.append("lastid",r);const f=`${h}?${u.toString()}`;try{console.log("Fetching comments from:",f);const{data:y}=await V.get(f,{headers:{"x-api-token":l,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!y)throw new Error("No comments data received");return y.data||y||[]}catch(y){if(console.error("Error fetching comments:",y),V.isAxiosError(y)){const m=y.response?.status,g=y.response?.data;throw m===404?new Error("Comments not found"):m===403?new Error("Access forbidden - check API token"):m===401?new Error("Unauthorized - invalid API token"):m===500?new Error("Internal server error from CMS"):new Error(g?.error||g?.message||`HTTP ${m}: Failed to fetch comments`)}throw y}}const{PUBLIC_PUBLICATION_ID:ad}=Y(),sd=ad,od=e=>{const[n,a]=b.useState(void 0);return b.useEffect(()=>{if(n)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:o}=Y();try{const r=await _n({publication:sd,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:o});a(r[0]??[])}catch(r){console.error(r),a({comments:[],morecomment:!1})}})()},[n]),{comments:n,setComments:a}},Bo=({username:e,date:n})=>t.jsxs("div",{className:"comment-header",children:[t.jsx("span",{className:"comment-username",children:e}),t.jsx("span",{className:"comment-header-dot",children:"•"}),t.jsx("span",{className:"comment-date",children:Rc(ye(Number(n)))})]}),Lo=({user:e})=>t.jsx("div",{className:"comment-avatar",children:e.picture?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),Do=({isReply:e=!1,onReply:n,onFlag:a})=>t.jsxs("div",{className:"comment-actions",children:[!e&&n&&t.jsx("button",{onClick:n,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),t.jsx("button",{onClick:a,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Mo=({commentRef:e,captchaToken:n="",setIsDisabled:a})=>(b.useEffect(()=>{const s=e.current;if(!s)return;const o=()=>{const i=s.value.length;s.parentElement&&(s.parentElement.dataset.text=`${i}/${et}`),s.classList.toggle("over-limit",i>et),a(!ha(e,n).boolean)};return s.addEventListener("input",o),o(),()=>s.removeEventListener("input",o)},[e,n,a]),t.jsxs("div",{children:[t.jsx("label",{className:"comment-input-label",children:"Comentario"}),t.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),Po=({commentRef:e,captchaToken:n="",children:a})=>{const s=ha(e,n);return t.jsx("div",{className:"form-actions",children:t.jsxs("div",{className:"submit-zone",children:[a,!s.boolean&&t.jsx("p",{className:"submit-warning",children:s.text})]})})},Oo=({onClick:e,isDisabled:n})=>{const[a,s]=b.useState(!1);return b.useEffect(()=>{let o=null;return a&&(o=setTimeout(()=>{s(!1)},2400)),()=>{o&&clearTimeout(o)}},[a]),a?t.jsx("div",{className:"success-gif-container",children:t.jsx("img",{className:"success-gif",src:"/Success.gif"})}):t.jsxs("button",{type:"button",onClick:async o=>{await e(o)&&s(!0)},id:"comment-button",className:`submit-btn ${n?"disabled":"active"}`,children:["Enviar Comentario",t.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})},{PUBLIC_PUBLICATION_ID:rd}=Y(),id=rd,Qo=async({path:e,ref:n,captchaToken:a,button:s,user:o,id:r,addComment:i})=>{const l=n.current?.value||"";if(!ha(n,a).boolean||!o){const d=s.nextElementSibling;return d&&(d.style.display="block"),!1}try{const d=Date.now(),c=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:id,path:e,id:r,username:o.username,comment:l,recaptchaResponse:a})});let h=null;try{h=await c.json()}catch(m){console.error("Error parsing JSON response:",m)}if(!c.ok)throw new Error(`Error al enviar comentario: ${h?.message} status: ${c.status}`);const u=Date.now(),f=Math.max(0,2400+Math.abs(u-d)),y={username:o.username,firstname:o.firstname,...o.lastname&&{lastname:o.lastname},...o.picture&&{picture:o.picture}};return i({id:u.toString(),text:l,user:y,date:{time:Date.now()},reply:[]}),n.current&&(n.current.value=""),f}catch(d){return console.error("Error enviando comentario:",d),alert(d.message||"Error al enviar el comentario."),!1}},ld=({replyingTo:e,commentRef:n,user:a,path:s,addReply:o,closeForm:r})=>{const[i,l]=b.useState(!0),[d,c]=b.useState(""),h=()=>{n.current?.parentElement&&(n.current.parentElement.dataset.text=`0/${et}`),l(!0),r()};return t.jsxs("div",{className:"comment-form reply-form",children:[t.jsx("button",{className:"close-reply-form",onClick:h,children:t.jsx(ct,{})}),t.jsx(Mo,{commentRef:n,captchaToken:d,setIsDisabled:l}),t.jsx(Po,{commentRef:n,captchaToken:d,setCaptchaToken:c,children:t.jsx(Oo,{onClick:async u=>{if(i)return;const f=await Qo({path:s,ref:n,captchaToken:d,button:u.currentTarget,user:a,id:e,addComment:o});return f&&typeof f=="number"?(setTimeout(()=>{h()},f),!0):!1},isDisabled:i})})]})},cd=({reply:e,replyingTo:n,user:a,onFlag:s})=>{const o=e.text;let r=`${je.firstname} ${je.lastname}`,i=je.username;return e.user&&(r=`${e.user.firstname} ${e.user.lastname}`,i=e.user.username),t.jsx("div",{className:"comment-item reply",children:t.jsxs("div",{className:"comment-header-container",children:[t.jsx(Lo,{user:e.user?e.user:je}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Bo,{username:r,date:e.date.time}),t.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",t.jsx("strong",{children:n})]}),t.jsx("p",{className:"comment-text",children:o}),a?.username.toLowerCase()!==i.toLowerCase()&&t.jsx(Do,{isReply:!0,onFlag:()=>s(e.id)})]})]})})},dd=({comment:e,replyingTo:n,path:a,user:s,handleReplyingTo:o,onFlag:r})=>{const i={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[l,d]=b.useState(i),[c,h]=b.useState(!1),u=process.env.NEXT_PUBLIC_PUBLICATION_ID??"",f=e.text,y=b.useRef(null);let m=`${je.firstname} ${je.lastname}`,g=je.username;e.user&&(m=`${e.user.firstname} ${e.user.lastname}`,g=e.user.username);const w=v=>{d({morereply:l.morereply,reply:[v,...l.reply]})};return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{className:"comment-header-container","data-hasreplies":l.reply.length>0?"true":"false",children:[t.jsx(Lo,{user:e.user?e.user:je}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Bo,{username:m,date:e.date.time}),t.jsx("p",{className:"comment-text",children:f}),s?.username.toLowerCase()!==g.toLowerCase()&&t.jsx(Do,{onReply:()=>o(e.id),onFlag:()=>r(e.id)}),n===e.id&&s&&t.jsx(ld,{replyingTo:n,commentRef:y,addReply:w,user:s,path:a,closeForm:()=>o("")}),l.reply.length>0&&t.jsxs("div",{className:"comment-replies",children:[l.reply.map(v=>t.jsx(cd,{user:s,reply:v,replyingTo:m,onFlag:r},v.id)),c?t.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:t.jsx(Ge,{})}):l.morereply&&t.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const v=l.reply[l.reply.length-1]?.id;h(!0);try{const k=(await _n({publication:u,path:a??"",size:2,sizereply:2,id:e.id,lastid:v,state:"5,6",apiToken:process.env.NEXT_PUBLIC_X_SECURITY_TOKEN}))[0];h(!1),d({morereply:k.morecomment,reply:[...l.reply,...k.comments]})}catch(I){throw h(!1),new Error(`Error al obtener comentarios: ${I}`)}},children:"Más Respuestas"})]})]})]})})},hd=({commentRef:e,user:n,path:a,addComment:s})=>{const[o,r]=b.useState(!0),[i,l]=b.useState("");return t.jsxs("div",{className:"comment-form",children:[t.jsx(Mo,{commentRef:e,captchaToken:i,setIsDisabled:r}),t.jsx(Po,{commentRef:e,captchaToken:i,setCaptchaToken:l,children:t.jsx(Oo,{onClick:async d=>{if(o)return;const c=await Qo({path:a,ref:e,captchaToken:i,button:d.currentTarget,user:n,addComment:s});return c&&typeof c=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${et}`),r(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${et}`),r(!0)},c),!0):!1},isDisabled:o})})]})},{PUBLIC_PUBLICATION_ID:ud,PUBLIC_X_SECURITY_TOKEN:md}=Y(),jo=ud??"",fd=({isAuthenticated:e,path:n,user:a,handleLogout:s})=>{const o=n.replaceAll("/","|"),[r,i]=b.useState(void 0),[l,d]=b.useState(""),{comments:c,setComments:h}=od(o),[u,f]=b.useState(!1),y=b.useRef(null),m=S=>{d(l===S?"":S)},g=S=>{h(c?{...c,comments:[S,...c.comments??[]]}:void 0)},w=S=>{i(S)},v=async()=>{if(!c||!c.morecomment||c.comments.length===0)return;const S=c.comments[c.comments.length-1];if(!S)return;f(!0);const O=S.id;try{const $=(await _n({publication:jo,path:o??"",size:5,sizereply:2,id:void 0,lastid:O,state:"5,6",apiToken:md}))[0];h({morecomment:$.morecomment??!1,comments:[...c.comments,...$.comments]}),f(!1)}catch(M){throw f(!1),new Error(`Error al obtener comentarios: ${M}`)}},I=c?.comments&&c.comments.length>0,k=I?"Comparte tu opinión de este artículo.":"Se el primero en compartir tu opinión de este artículo.",D=t.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:t.jsx(Ge,{})});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-container",children:t.jsx(te,{title:I||e?"COMENTARIOS":!1,children:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-header",children:e&&a&&t.jsxs(t.Fragment,{children:[t.jsx(Jc,{user:a,handleLogout:s,message:k}),t.jsx(hd,{commentRef:y,user:a,addComment:g,path:o})]})}),t.jsx("div",{className:"comments-list","data-isauthenticated":`${e}`,children:c?c.comments&&c.comments.length>0?t.jsxs(t.Fragment,{children:[c.comments.map(S=>t.jsx(dd,{comment:S,replyingTo:l,handleReplyingTo:m,onFlag:w,user:a??je,path:o},S.id)),u&&D]}):null:D}),c?.morecomment&&!u&&t.jsx("button",{className:"comment-replies-button",onClick:v,children:"Más"})]})})}),t.jsx(nd,{username:a?.username??void 0,publication:jo,commentId:r,isOpen:r!==void 0,onClose:()=>i(void 0)})]})},ua=async(e,n)=>{if(!e)throw new Error("No action provided");if(!n)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((s,o)=>{a.enterprise.ready(async()=>{try{const r=await a.enterprise.execute(n,{action:e});if(!r)throw new Error("Captcha token no generado");s(r)}catch(r){o(r)}})})},Go={email:{label:"Email",required:!0},given_name:{label:"Nombre",required:!0},family_name:{label:"Apellido",required:!0},password:{label:"Contraseña",required:!0},confirmPassword:{label:"Confirmar contraseña",required:!0}},Nn=[{label:"La contraseña debe tener al menos 8 caracteres",test:e=>e.length>=8},{label:"Usa un número",test:e=>/\d/.test(e)},{label:"Usa una letra minúscula",test:e=>/[a-z]/.test(e)},{label:"Usa una letra mayúscula",test:e=>/[A-Z]/.test(e)},{label:"Usa un símbolo",test:e=>/[^A-Za-z0-9]/.test(e)}];function gd({goToLogin:e,handleGoogleLogin:n}){const[a,s]=b.useState({}),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[d,c]=b.useState(null),[h,u]=b.useState("register"),f=(w,v)=>{s(I=>({...I,[w]:v}))},y=async w=>{w.preventDefault(),c(null),l(!0);try{const v=Object.keys(Go).filter(M=>!["username","password","confirmPassword"].includes(M)).map(M=>({Name:M,Value:a[M]}));if(v.some(M=>{if(!M.Value||M.Value.trim()==="")return!0}))return l(!1),c("Complete todos los campos");if(a.password!==a.confirmPassword){c("Las contraseñas no coinciden");return}const I=a.password||"";if(Nn.some(M=>!M.test(I))){c("La contraseña no es válida");return}const D=Math.floor(Date.now()/1e3);v.push({Name:"updated_at",Value:String(D)});const S=await ua("comment_register","");if(!S)throw new Error("Captcha token no generado");const O=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,password:a.password,userAttributes:v,token:S})});if(!O.ok){const M=await O.json().catch(()=>({}));if(M.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email})}),u("confirm");return}throw new Error(M?.error||"Error al crear usuario")}u("confirm")}catch(v){console.log(v),c(v?.message||v?.error||"Error inesperado")}finally{l(!1)}},m=async w=>{if(w.preventDefault(),!a.confirmationCode){c("Debes ingresar el código de verificación");return}c(null),l(!0);try{const v=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,code:a.confirmationCode})});if(!v.ok){const I=await v.json().catch(()=>({}));throw new Error(I?.error||"Error al confirmar usuario")}u("success")}catch(v){c(v?.message||"Error inesperado")}finally{l(!1)}},g=a.password||"";return t.jsxs(t.Fragment,{children:[h==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:n,className:_.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:_.googleIcon}),t.jsx("span",{children:"Continuar con Google"})]}),t.jsx("div",{className:_.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:y,className:_.form,"data-error":d?"true":"false",children:[t.jsx("ul",{className:_.formUl,children:Object.entries(Go).map(([w,{label:v}])=>t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:v}),t.jsx("input",{type:w.toLowerCase().includes("password")?o?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:a[w]||"",onChange:I=>f(w,I.target.value),className:_.input,placeholder:""}),w==="password"&&t.jsx("div",{className:_.passwordChecker,children:Nn.map((I,k)=>{const D=I.test(g);return t.jsxs("div",{className:D?_.valid:_.invalid,children:[t.jsx("div",{children:D?"✔":"○"}),t.jsx("div",{children:I.label})]},k)})}),w==="confirmPassword"&&t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:o,onChange:I=>r(I.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:_.checkboxLabel,children:"Mostrar contraseñas"})]})]},w))}),d&&t.jsx("p",{className:_.error,children:d}),t.jsxs("p",{className:_.terms,children:["Al continuar, confirmo que he leído y aceptado los",t.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:"Términos y Condiciones"}),"de nuestra comunidad"]}),t.jsx("button",{type:"submit",className:_.primary,disabled:i,children:i?t.jsx(Ge,{}):"Crear cuenta"})]})]}),h==="confirm"&&t.jsxs("form",{onSubmit:m,className:_.form,"data-error":d?"true":"false",children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Código de verificación"}),t.jsx("input",{type:"text",name:"confirmationCode",value:a.confirmationCode||"",onChange:w=>f("confirmationCode",w.target.value),className:_.input,required:!0})]}),d&&t.jsx("p",{className:_.error,children:d}),t.jsx("button",{type:"submit",className:_.primary,disabled:i,children:i?t.jsx(Ge,{}):"Confirmar cuenta"}),t.jsxs("p",{className:_.switch,children:["¿Ya confirmaste antes?",t.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]}),h==="success"&&t.jsxs("form",{className:_.form,children:[t.jsxs("div",{className:_.successContainer,children:[t.jsx("div",{className:_.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:_.successMessage,children:[t.jsx("p",{children:"Confirmación completa."}),t.jsx("p",{children:"Ya eres parte de la comunidad!"})]})]}),t.jsx("button",{onClick:e,className:_.primary,children:"Iniciar sesión"})]}),h==="register"&&t.jsxs("p",{className:_.switch,children:["¿Ya tenés cuenta?",t.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]})}function pd({onClose:e,checkAuth:n,goToRegister:a,handleGoogleLogin:s}){const[o,r]=b.useState("login"),[i,l]=b.useState(""),[d,c]=b.useState(""),[h,u]=b.useState(""),[f,y]=b.useState(""),[m,g]=b.useState(""),[w,v]=b.useState(!1),[I,k]=b.useState(!1),[D,S]=b.useState(null),O=async z=>{if(!I){z.preventDefault(),S(null),k(!0);try{const P=await ua("comment_login",void 0);if(!P)throw new Error("Captcha token no generado");const x=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i,password:d,token:P})});if(!x.ok){const Z=await x.json().catch(()=>({}));throw new Error(Z?.error||"Ha ocurrido un error")}e(),await n()}catch(P){S(P?.message||"Error inesperado")}finally{k(!1)}}},M=async z=>{if(!I){z.preventDefault(),S(null),k(!0);try{const P=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Error al enviar código")}c(""),r("changePassword")}catch(P){S(P?.message||"Error inesperado")}finally{k(!1)}}},$=async z=>{if(I)return;if(z.preventDefault(),f!==m){S("Las contraseñas no coinciden");return}if(Nn.some(x=>!x.test(f))){S("La contraseña no cumple con los requisitos");return}S(null),k(!0);try{const x=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,code:h,newPassword:f})});if(!x.ok){const Z=await x.json().catch(()=>({}));throw new Error(Z?.error||"Error al cambiar contraseña")}r("feedback")}catch(x){S(x?.message||"Error inesperado")}finally{k(!1)}};return t.jsxs(t.Fragment,{children:[o==="login"&&t.jsx(Ad,{email:i,password:d,showPassword:w,loading:I,error:D,setEmail:l,setPassword:c,setShowPassword:v,onSubmit:O,onForgot:()=>{S(null),r("forgot")},onRegister:a,handleGoogleLogin:s}),o==="forgot"&&t.jsx(wd,{email:i,setEmail:l,loading:I,error:D,onSubmit:M,onBack:()=>{S(null),r("login")}}),o==="changePassword"&&t.jsx(yd,{email:i,confirmationCode:h,newPassword:f,confirmNewPassword:m,showPassword:w,loading:I,error:D,setConfirmationCode:u,setNewPassword:y,setConfirmNewPassword:g,setShowPassword:v,onSubmit:$,onBack:()=>{S(null),r("forgot")}}),o==="feedback"&&t.jsx(bd,{onBackToLogin:()=>{S(null),r("login")}})]})}function Ad({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:l,onSubmit:d,onForgot:c,onRegister:h,handleGoogleLogin:u}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:u,className:_.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:_.googleIcon}),t.jsx("span",{children:"Continuar con Google"})]}),t.jsx("div",{className:_.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:d,className:_.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Email"}),t.jsx("input",{type:"email",value:e,onChange:f=>r(f.target.value),className:_.input,placeholder:""})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Contraseña"}),t.jsx("input",{type:a?"text":"password",value:n,onChange:f=>i(f.target.value),className:_.input,placeholder:""}),t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>l(f.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:_.checkboxLabel,children:"Mostrar contraseña"})]})]}),o&&t.jsx("p",{className:_.error,children:o}),t.jsx("button",{type:"submit",className:_.primary,disabled:s,children:s?t.jsx(Ge,{}):"Iniciar Sesión"})]}),t.jsxs("p",{className:_.switch,children:["¿No tenés cuenta?",t.jsx("button",{type:"button",onClick:h,children:"Registrate"})]}),t.jsx("button",{type:"button",className:_.forgotPassword,onClick:c,children:"Olvidé mi contraseña"})]})}function wd({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r}){return t.jsxs("form",{onSubmit:o,className:_.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:_.message,children:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña."}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Email"}),t.jsx("input",{type:"email",value:e,name:"email",onChange:i=>n(i.target.value),className:_.input,placeholder:""})]}),s&&t.jsx("p",{className:_.error,children:s}),t.jsx("button",{type:"submit",className:_.primary,disabled:a,children:a?t.jsx(Ge,{}):"Enviar código"}),t.jsx("p",{className:_.switch,children:t.jsx("button",{type:"button",onClick:r,children:"Volver"})})]})}function yd({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:l,setNewPassword:d,setConfirmNewPassword:c,setShowPassword:h,onSubmit:u,onBack:f}){return t.jsxs("form",{onSubmit:u,className:_.form,"data-error":i?"true":"false",children:[t.jsxs("p",{className:_.message,children:["Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a ",td(e),". Ingrese el código y la contraseña nueva."]}),t.jsxs("ul",{className:_.formUl,children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Código de verificación"}),t.jsx("input",{type:"text",value:n,onChange:y=>l(y.target.value),className:_.input,placeholder:""})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Nueva contraseña"}),t.jsx("input",{type:o?"text":"password",value:a,onChange:y=>d(y.target.value),className:_.input,placeholder:"",name:"password"}),t.jsx("div",{className:_.passwordChecker,children:Nn.map((y,m)=>{const g=y.test(a);return t.jsxs("div",{className:g?_.valid:_.invalid,children:[t.jsx("div",{children:g?"✔":"○"}),t.jsx("div",{children:y.label})]},m)})})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Confirmar contraseña"}),t.jsx("input",{type:o?"text":"password",value:s,onChange:y=>c(y.target.value),className:_.input,placeholder:""}),t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:y=>h(y.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:_.checkboxLabel,children:"Mostrar contraseñas"})]})]})]}),i&&t.jsx("p",{className:_.error,children:i}),t.jsx("button",{type:"submit",className:_.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(Ge,{}):"Cambiar contraseña"}),t.jsx("p",{className:_.switch,children:t.jsx("button",{type:"button",onClick:f,children:"Volver"})})]})}function bd({onBackToLogin:e}){return t.jsxs("div",{className:_.form,children:[t.jsx("p",{className:_.success,children:"La contraseña fue cambiada con éxito"}),t.jsx("button",{type:"button",className:_.primary,onClick:e,children:"Iniciar Sesión"})]})}function Cd({loginUrl:e,onClose:n,checkAuth:a,icon:s}){const[o,r]=b.useState("login"),i=async()=>{if(!e)return;const l=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${l}`};return t.jsx("div",{className:_.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:l=>{const d=l.target;d&&d.id==="pop-overlay"&&n()},children:t.jsxs("div",{className:_.card,children:[t.jsxs("header",{className:_.header,children:[t.jsx("div",{className:_.logo,children:s?s():null}),t.jsx("button",{onClick:n,className:_.close,"aria-label":"Cerrar",children:t.jsx(ct,{})})]}),o==="login"&&t.jsx(pd,{onClose:n,checkAuth:a,handleGoogleLogin:i,goToRegister:()=>r("register")}),o==="register"&&t.jsx(gd,{handleGoogleLogin:i,goToLogin:()=>r("login")})]})})}function vd({isAuthenticated:e,setIsAuthenticated:n,loginUrl:a,user:s,path:o,checkAuth:r,icon:i}){const[l,d]=b.useState(!1),c=async()=>{{const u=window.location.pathname;window.location.href=`${window.location.origin}/api/auth/logout?redirect=${encodeURIComponent(u)}`}},h=async u=>{u.preventDefault(),a&&d(!0)};return t.jsxs(t.Fragment,{children:[l&&t.jsx(Cd,{loginUrl:a,icon:i,checkAuth:r,onClose:()=>{d(!1)}}),!e&&t.jsxs("div",{className:"auth-container",children:[t.jsx("p",{children:"Sumate a la comunidad para dejar tu comentario"}),t.jsx("a",{href:a,onClick:h,className:"login-button",children:"Iniciar Sesión"})]}),t.jsx(fd,{isAuthenticated:e,handleLogout:c,path:o,user:e?s:void 0})]})}function _d({isVisible:e,path:n,icon:a}){const[s,o]=b.useState(null),[r,i]=b.useState(null),l=async()=>{if(e){if(document.cookie.search("undefinedIS_AUTH=true")===-1){o(!1),i(null),console.log("user not logged");return}try{const u=await(await fetch("/api/auth/user",{credentials:"include"})).json();o(u.isAuthenticated??!1),i(u.user??null)}catch(h){console.error("Error checking auth:",h),o(!1),i(null)}}};b.useEffect(()=>{l()},[e]),b.useEffect(()=>{if(!r||!e||typeof window>"u")return;const h=window;if(typeof h!="function"){console.warn("gtag no está disponible todavía");return}h.gtag("set",{user_id:r.username}),console.log("username setted successfully")},[r,e]);const d="/api/auth/login",c=t.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:t.jsx(Ge,{})});return s===null?c:e?t.jsx(vd,{icon:a,isAuthenticated:s,setIsAuthenticated:o,loginUrl:d,user:r??void 0,checkAuth:l,path:n}):c}const Nd=({render:e,internalPath:n,section:a,currentNews:s,stylesConfig:o,icon:r})=>{const i=b.useRef(null),[l,d]=b.useState(!0);b.useEffect(()=>{const h=new IntersectionObserver(([u])=>{u?.isIntersecting&&(d(!0),h.disconnect())},{rootMargin:"0px",threshold:.1});return i.current&&h.observe(i.current),()=>h.disconnect()},[]);const c={comment:t.jsx(_d,{path:n,icon:r,isVisible:l}),more:t.jsx(Wc,{section:a,currentNews:s,stylesConfig:o,isVisible:l})};return t.jsx("div",{ref:i,suppressHydrationWarning:!0,style:{...o?o["Modulo 1x3 Client"]?o["Modulo 1x3 Client"]:o["Modulo 1x3"]:{}},children:c[e]})};async function Sd({publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r,baseUrl:i,apiToken:l,securityToken:d}){if(console.log("Adding comment with data:",{publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r}),!e||!n||!s||!a)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,n,s,a].some(y=>typeof y!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!a.trim())return{type:"error",message:"El nombre no puede estar vacío.",status:400};if(!s.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const c=await xo(r);if(console.log("Verifying captcha token...",c),!c)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const h=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,u={publication:e,path:n.replace(/\|/gi,"/"),username:a??!1,text:s.trim()};o&&(u.id=o);const f=new URLSearchParams(u);try{const{data:y}=await V.get(`${h}?${f.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":d,"x-api-token":l,"User-Agent":"amplifyapp-comments-saas"}});return!y||y.error?(console.error("CMS error response:",y),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",y),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(y){if(console.error("Error enviando comentario:",y),V.isAxiosError(y)){const m=y.response?.status??500,g=y.response?.data;return m===400?{type:"error",message:g?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:m===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:m===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:g?.message||"No se pudo enviar el comentario.",status:m}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const kd=async({token:e,projectId:n,captchaKey:a,apiKey:s,captchaAction:o})=>{if(!e)throw new Error("No token provided");if(!n||!a||!s)throw new Error("Missing project ID or site key");if(!o)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${n}/assessments?key=${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:o}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==o)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(r){throw console.error("Recaptcha verification failed",r),new Error(String(r))}};p.AssetsPreconnect=qa,p.AutorComponent=Qc,p.AutorHeader1=Js,p.AutorHeader2=Zs,p.BannerAdvertising=ae,p.BannerAdvertisingMiddle=Te,p.CarrouselCSR=Zi,p.CarrouselIRS=Ze,p.CarruselCard=Ao,p.CarruselOpinion=wo,p.CommonServices=fe,p.Comscore=ma,p.ContactInfoServer=Wl,p.ContactInput=kl,p.ContactSelect=El,p.ContactTextarea=Il,p.ContentLayout1=rt,p.ContentLayoutTema=Yn,p.DEBUG_MainSlots=xc,p.DestacadoNoticias=io,p.DestacadoVideos=fo,p.DynamicBlockServices=xs,p.DynamicComponents=Tc,p.DynamicMainSlot=Cn,p.DynamicSlot=ca,p.EditorialBlock=Gl,p.ErrorComponent=Sl,p.Font=za,p.Footer=Al,p.FormatAfterScripts=xa,p.FormatScripts=Un,p.GA4=fa,p.GTM=ga,p.GalleryHeader=ia,p.GenerateBody=Fi,p.GenerateHead=Vi,p.Header=Ml,p.ImageOffline=Os,p.IssuuServices=Gi,p.ItemListSchema=Pa,p.JournalistArticule2=no,p.JournalistGroup=ao,p.LayoutNewsComponent=Jn,p.LazyLoader=Nd,p.LiveBlogHeader=Ys,p.Location=Ki,p.MainComponentServices=Ar,p.Marfeel=pa,p.MiddleSection=$e,p.Modulo1x3=na,p.Modulo1x3Card=po,p.Modulo1x4=uo,p.Modulo1x5=mo,p.Modulo2Columnas=$l,p.Modulo3Columnas=co,p.ModuloNewsletter=zl,p.ModuloOpinion=jl,p.NewListResponseDataPH=Uo,p.NewsArticle=Qa,p.NewsComponent=Bc,p.NewsContent=un,p.NextPrev=Et,p.OrgList=ja,p.PreloadImages=xn,p.REPORT_REASONS=Ue,p.Readest=rn,p.ScriptHydrator=Hc,p.SearchSection=Oc,p.Section=te,p.SectionCard=Ee,p.SectionCard2=Ut,p.SectionCardServerComponent=wn,p.SectionServerComponent=Fl,p.ShowSection=Ls,p.SocialNetworks=sc,p.SpeculationRules=Ma,p.StaticSlotWrapper=Uc,p.SubscribeColumn=$s,p.SubscribeRow=zs,p.SubscribeWhatsAppColumn=cl,p.TagComponent=Mc,p.TagSection=to,p.TimeLine=Ks,p.TrimPathname=dr,p.VideoBlock3=Nl,p.VideoBlock4=Tl,p.VideoSection=zc,p.VideosSchemas=$a,p.WebsiteList=Ga,p.addComment=Sd,p.bannersReplace=Wt,p.becomeVideoObject=nt,p.buildTagUrl=qn,p.coloringByStrokeSVGs=Hs,p.compileStyleProps=bn,p.cutString=be,p.extractRealtedNews=lr,p.formatDate=ye,p.formatDateEdiciones=ir,p.formatDateJournalistArticule=En,p.formatDateTimeline=_a,p.formatNewsMeta=Ea,p.formatVideoData=Ba,p.generalGetData=Hi,p.getCaptchaToken=ua,p.getComments=_n,p.getConfig=Y,p.getDynamicSlots=$i,p.getEnvironmentUrl=At,p.getEnvironmentUrlFront=ka,p.getImageUrl=ne,p.getNextMeta=wt,p.getPage=bt,p.getPreloadImages=pr,p.getPrevMeta=yt,p.getReportReasonLabel=Xc,p.getResponse=Na,p.getResponsePromise=Sa,p.getSchemas=Yt,p.getScriptReplaces=Bn,p.getSlugs=Va,p.getTypeOfNews=ur,p.getVideoRealPath=mr,p.initLibrary=rr,p.metadataToJSX=Ta,p.metadata_defaults=qs,p.parseTags=In,p.pathnameSplit=Ia,p.removePages=Ha,p.reportComment=Zc,p.shareButtons=Vs,p.socialIcons=cn,p.speculationRules=Da,p.speculationRulesHome=La,p.urlReplaces=Ua,p.verifyCaptchaTokenEnterprise=kd,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
111
+ `}o+=y,r=h}return o+=e.slice(r),o}async function wc(e){const{news:n,banners:a,newsRelatedResponses:s,slug:o,itemList:r,socials:i,getVideos:l}=e;let d=n?.body?.rendered??"";d=d.replace(/&nbsp;/g,""),d=fc(d,a),d=gc(d),d=await Co(d),d=await pc(d,e.texts,s),d=await Ac(d,l),d=uc(d),d=mc(d);const c=n.main.sources??[];return t.jsxs("div",{className:yn.content,children:[o!=="liveblogs"&&e.showHeaderImage?n.hascontent?.hasgalleryimages?t.jsx(ia,{newsformated:n,internal:n.info.link.internal}):t.jsx(Ws,{preview:n.preview}):null,t.jsx(ae,{banners:a,name:"block_1"}),t.jsx("div",{className:yn.journalistArticleContent,children:t.jsx(ic,{autorIcon:e.autorIcon,socials:i,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),t.jsx(cc,{summary:n.main.summary}),t.jsx("div",{className:yn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),t.jsx(ac,{texts:e.texts,itemList:r,banners:a,slug:o}),c.length>0&&t.jsxs("div",{className:yn.noteSource,children:[t.jsx(hc,{}),t.jsx("p",{children:e.texts.noteSource+(c.length===1?"":"s")+": "+c.map(h=>h.name).join(", ")})]})]})}const vo={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},yc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNewsMultimedia({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.videos.filter(r=>r.type==="video-embedded")[0];return t.jsxs("div",{className:vo.content,children:[t.jsx("div",{dangerouslySetInnerHTML:{__html:o?.code??""}}),t.jsx("p",{className:vo.title,children:o?.title})]})},la={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},bc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNewsMultimedia({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.videos.filter(r=>r.type==="video-youtube")[0];return t.jsxs("div",{className:la.content,children:[t.jsx("iframe",{className:la.iframeStyled,src:`https://www.youtube.com/embed/${o?.code??""}`,frameBorder:"0",allowFullScreen:!0}),t.jsx("p",{className:la.title,children:o?.title})]})},Cc={content:"_content_ezbiw_1"},vc=async({newsformated:e,internal:n})=>{if(!n)return;const s=await new fe().getNews({path:n,imagesizes:e.preview.sizes[0]?.scale});if(!s)return;const o=s.data.data[0]?.external?.iframe;return t.jsx("div",{className:Cc.content,dangerouslySetInnerHTML:{__html:o??""}})},_o={content:"_content_156j7_1"},Fe={imagen:"imagen",videoEmbedded:"videoEmbedded",videoYouTube:"videoYouTube",iframe:"iframe"},_c={[Fe.videoEmbedded]:yc,[Fe.videoYouTube]:bc,[Fe.iframe]:vc},Nc=({news:e})=>{const{config:n,hascontent:a,info:s}=e,o=n.articlepreview,r=s.link.internal,i=a?.hasgalleryimages;if(o===Fe.imagen&&i)return t.jsx("div",{className:_o.content,children:t.jsx(ia,{newsformated:e,internal:r})});const l=o?_c[o]:null;return l?t.jsx("div",{className:_o.content,children:t.jsx(l,{newsformated:e,internal:r})}):null},Sc=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,cardWidth:200,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Ut,{...l,titleGradient:!0,paths:e.paths},i)})})})},kc=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,cardWidth:343,cardGap:32,visibleItems:3,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Ut,{...l,titleGradient:!0,paths:e.paths},i)})})})},Ec=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(te,{title:a,titleUrl:e.titleUrl,children:t.jsx(Ze,{slot_id:s,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:n.map((r,i)=>{const l={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return b.createElement(Ut,{...l,key:i,titleGradient:!0,paths:e.paths})})})})},bn=e=>{const n={};for(const a in e)a.startsWith("--")&&(n[a]=e[a]);return n},Xe={headerSection:"_headerSection_1c69w_1",title:"_title_1c69w_11",subtitle:"_subtitle_1c69w_23",newsContent:"_newsContent_1c69w_36",containerCards:"_containerCards_1c69w_44",image:"_image_1c69w_50",blockHeadContainer:"_blockHeadContainer_1c69w_56"},Ic=e=>{const{content:n,title:a,isVideo:s}=e;if(!n||n.length===0)return;const o=n[0],r=n.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return o&&r&&t.jsxs(te,{title:a,titleUrl:e.titleUrl,children:[t.jsx("div",{className:Xe.headerSection,children:t.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:Xe.image,href:o?.info?.link?.url,target:o?.info?.link?.target,children:[t.jsxs("div",{className:Xe.blockHeadContainer,children:[t.jsx("p",{className:Xe.title,children:o?.main?.title.home}),o?.main?.subtitle?.rendered&&t.jsx("p",{className:Xe.subtitle,children:o?.main?.subtitle?.striped})]}),t.jsx(ge,{preview:o.preview})]})}),t.jsxs("div",{className:Xe.containerCards,children:[t.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),t.jsx("div",{className:Xe.newsContent,children:Array.isArray(r)&&r.map((l,d)=>{const c={...l,main:{...l.main,title:{...l.main.title,section:i?l.main.title.home:l.main.title.section}}};return t.jsx("div",{style:{order:d},children:t.jsx(Ee,{...c,isVideo:s,paths:e.paths})},d)})})]})]})},No={banner:e=>t.jsx(ae,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>t.jsx(rn,{...e}),"Modulo 1x3":e=>t.jsx(na,{...e}),"Modulo 1x4":e=>t.jsx(uo,{...e}),"Modulo 1x5":e=>t.jsx(mo,{...e}),"Destacado noticias":e=>t.jsx(io,{...e}),"Destacado full width":e=>t.jsx(Ic,{...e}),"Destacado videos":e=>t.jsx(fo,{...e}),"Carrusel card":e=>t.jsx(Ao,{...e}),"Carrusel story":e=>t.jsx(Sc,{...e}),"Carrusel owl":e=>t.jsx(kc,{...e}),"Modulo fotogaleria":e=>t.jsx(Ec,{...e}),"Carrusel opinion":e=>t.jsx(wo,{...e}),"Modulo 1x3 card":e=>t.jsx(po,{...e})};function ca({component:e,slot_id:n,data:a,banners:s}){if(s)return No[e]&&t.jsx("div",{className:"home-slot",style:bn(a),children:No[e]({...a,banners:s,slot_id:n})})}function Uc({children:e,stylesConfigEntry:n}){return t.jsx("div",{className:"home-slot",style:bn(n),children:e})}const So={Diario:e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(so,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:n,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(so,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:n,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>t.jsx(mt,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>t.jsx(Ol,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>t.jsx(Pl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Cn=({component:e,data:n,banners:a,rightOnlyBanner:s})=>t.jsx("div",{style:bn(n),children:So[e]&&So[e]({...n,rightOnlyBanner:s,banners:a})}),Tc=({slots:e,DYNAMIC_SLOT_SUBINDEXES:n,stylesConfig:a,AutorIcon:s,config:o,banners:r})=>{const i=[],d=n,c=Object.keys(e).length/d;for(let h=1;h<=c;h++)for(let u=1;u<=d;u++){const f="Home_"+h+"_"+u;!e[f]||!e[f].blockSass||!e[f].blockSass[0]||!e[f].blockSass[0].value||!e[f].blockSass[0].block||e[f].blockSass[0].block==="No Mostrar"||i.push(t.jsxs(Ls,{show:!!e[f].content?.data,order:(h-1)*d+(u-1),children:[t.jsx(ca,{component:e[f].blockSass[0].block,banners:r,slot_id:f,data:{...e[f].blockSass[0].block?a[e[f].blockSass[0].block]:[],content:e[f].content?.data??[],title:e[f].blockSass[0].title??void 0,titleUrl:e[f].blockSass[0].link??void 0,autorIcon:t.jsx(s,{}),paths:o.paths}}),t.jsx($e,{children:t.jsx(Te,{banners:r,index:"dynamic_"+h+"_"+u})})]},h+"_"+u))}return i},xc=({mainBlock:e,StylesConfigMain:n,config:a,banners:s})=>{const{PUBLIC_ENV:o}=Y();if(o!=="local")return null;const r=e?.news?.data||[],i=(l,d)=>({...e?.news,...n[l],data:r.slice(0,d),paths:a.paths});return t.jsxs(t.Fragment,{children:[t.jsx(Cn,{component:"Super",data:i("Super",1),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})}),t.jsx(Cn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})}),t.jsx(Cn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:s}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:1})})]})},qc=e=>{const{config:n,hascontent:a}=e,s=n.articlepreview,o=[Fe.videoEmbedded,Fe.videoYouTube,Fe.iframe];return!!(s===Fe.imagen&&a?.hasgalleryimages||o.includes(s))},Bc=async e=>{const{custom_complement:n,ranking:a=[],banners:s,autor:o=[],news:r=[],newsRelatedResponses:i=[],itemList:l=[],socials:d,getVideos:c}=e,h=e.slug==="liveblogs";if(!(!r||!r[0]))return t.jsx(t.Fragment,{children:t.jsxs(Kl,{className:ra.contentLayout2,children:[t.jsx(Zl,{option:e.slug,news:r,paths:e.paths}),t.jsx(Te,{banners:s,index:1}),!h&&t.jsx(Nc,{news:r[0]}),t.jsx(Jl,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:l,ranking:a,bannerTop:t.jsx(ae,{banners:s??[],name:"right_1"}),banner:t.jsx(ae,{banners:s??[],name:"right_2"}),complement:n||t.jsxs("div",{id:"comentarios",suppressHydrationWarning:!0,children:[o.length>0&&t.jsx(no,{texts:e.texts,autorIcon:e.autorIcon,autor:o[0],paths:e.paths}),r[0].authors.length>1&&t.jsx(ao,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),t.jsx("div",{className:ra.tagContent,children:t.jsx(to,{tags:r[0]?.keywords?.tags,paths:e.paths})}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath}))}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:2})}),t.jsx(ca,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0}}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:3})}),t.jsx(te,{title:e.texts.moreNewsTitle,children:t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",currentNews:r[0]}))})}),t.jsx($e,{children:t.jsx(Te,{banners:s,index:4})})]})]}),children:t.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[t.jsx(wc,{texts:e.texts,autorIcon:e.autorIcon,socials:d,news:r[0],banners:s,newsRelatedResponses:i,itemList:l,slug:e.slug,getVideos:c,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!qc(r[0])}),t.jsx(ae,{banners:s??[],name:"block_3"})]})})]})})},pt={content:"_content_1tl6i_1",contentInfo:"_contentInfo_1tl6i_24",imageStyled:"_imageStyled_1tl6i_41",name:"_name_1tl6i_46",description:"_description_1tl6i_51",contentInfoWithoutImg:"_contentInfoWithoutImg_1tl6i_104"},Lc=async e=>{const n=e.img?await ne(e.img):"";return t.jsx("section",{className:pt.content,children:t.jsxs("div",{className:`${pt.contentInfo} ${n?"":pt.contentInfoWithoutImg}`,children:[e.img&&t.jsx("img",{fetchPriority:"low",loading:"lazy",className:pt.imageStyled,src:n}),t.jsx("h1",{className:pt.name,children:e.tag}),e.description&&t.jsx("div",{className:pt.description,dangerouslySetInnerHTML:{__html:e.description}})]})})},vn={content:"_content_7wvro_1",contentInfo:"_contentInfo_7wvro_23",name:"_name_7wvro_34",description:"_description_7wvro_43"},Dc=e=>t.jsx("section",{className:vn.content,style:{color:e.textColor,"--backDropHeigth":e.backDropHeigth?e.backDropHeigth:"100%",padding:e.sectionPadding??"","--backgroundColor":e.backgroundColor},children:t.jsxs("div",{className:vn.contentInfo,children:[t.jsx("h1",{className:vn.name,style:{color:e.textColor},children:e.tag}),e.description&&t.jsx("div",{style:{color:e.textColor},className:vn.description,dangerouslySetInnerHTML:{__html:e.description}})]})}),Mc=e=>{const{option:n,entity:a}=e;switch(n){case"op1":return t.jsx(Lc,{tag:a?.name??"",img:a?.image?.url??"",description:a?.description?a?.description:""});case"op2":return t.jsx(Dc,{tag:a?.name??"",description:a?.description?a?.description:"",backDropHeigth:e.backDropHeigth,backgroundColor:e.backgroundColor,sectionPadding:e.sectionPadding,textColor:e.textColor});default:return t.jsx(t.Fragment,{})}},Mt={content:"_content_gxziw_1",buttonStyled:"_buttonStyled_gxziw_9",searchStyled:"_searchStyled_gxziw_21",inputStyled:"_inputStyled_gxziw_32",inputStyledTest:"_inputStyledTest_gxziw_51"},Pc=e=>t.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("g",{opacity:"0.8",children:t.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),Oc=e=>t.jsx("form",{className:Mt.content,style:{height:e.hasContent?"218px":"50vh"},children:t.jsxs("div",{className:Mt.inputStyled,children:[t.jsx("input",{className:Mt.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),t.jsx("button",{className:Mt.buttonStyled,type:"submit",children:t.jsx(Pc,{className:Mt.searchStyled})})]})}),da={content:"_content_io3tv_1",newsContentSection:"_newsContentSection_io3tv_5",itemContent:"_itemContent_io3tv_10"},Qc=e=>{const{data:n,option:a,autor:s,page:o,banners:r,pathname:i,ranking:l,currentPage:d,slug:c,texts:h={}}=e,u=[5,10,15],f={5:1,10:2,15:3};switch(a){case"op1":return t.jsx(t.Fragment,{children:t.jsxs(Yn,{children:[t.jsx(Js,{autor:s[0],autorIcon:e.autorIcon}),t.jsx(Jn,{paths:e.paths,ranking:l,readestTitle:h.readestTitle??"",bannerTop:t.jsx(ae,{banners:r??[],name:"right_1"}),banner:t.jsx(ae,{banners:r??[],name:"right_2"}),children:t.jsx("section",{className:da.content,children:n.length>0?t.jsx(un,{className:[da.newsContentSection,"padding-0"].join(" "),paginatorComponent:t.jsx(Et,{texts:h,pathname:i,query:"",currentPage:d,maxPages:e.paginationLimit,showNext:!(n.length<e.newsListLimit)}),children:Array.isArray(n)&&n?.map((y,m)=>t.jsxs(b.Fragment,{children:[u.includes(m+1)&&t.jsx("div",{className:da.itemContent+" banner-context",children:t.jsx(ae,{banners:r??[],name:`block_2_${f[m+1]}`})}),t.jsx(wn,{autorIcon:e.autorIcon,item:y,option:c,paths:e.paths},m)]},m))}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})})})]})});case"op2":return t.jsx(t.Fragment,{children:t.jsxs(Yn,{children:[t.jsx(Zs,{autor:s[0],autorIcon:e.autorIcon}),Array.isArray(n)?t.jsxs(t.Fragment,{children:[t.jsx(na,{content:n,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),t.jsx(Et,{texts:h,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(o),showNext:!((n.length??0)<Number(e.newsListLimit))})]}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})]})});default:return t.jsx(t.Fragment,{})}},ko={content:"_content_pq89v_1",videoContent:"_videoContent_pq89v_9"},Pt={container:"_container_1xr2t_1",playStyled:"_playStyled_1xr2t_6",imageStyled:"_imageStyled_1xr2t_13",longer:"_longer_1xr2t_26",contentNews:"_contentNews_1xr2t_31",tagContent:"_tagContent_1xr2t_51",tag:"_tag_1xr2t_51",titular:"_titular_1xr2t_68",small:"_small_1xr2t_81",figure:"_figure_1xr2t_87",backDrop:"_backDrop_1xr2t_92",backDropAux:"_backDropAux_1xr2t_100"},Eo=async e=>{const{size:n="longer",video:a}=e,s=a.main.image.sizes[0]?.url??"";return t.jsx("figure",{className:Pt.figure,children:t.jsxs("span",{className:Pt.backdrop,children:[t.jsx("span",{className:Pt.backDropAux}),t.jsx(T,{href:a.info.link.url,target:a.info.link.target,children:t.jsxs("div",{children:[a.main.image.sizes.map(async(o,r)=>o.width>=580?t.jsx("source",{media:"(width >=900px)",srcSet:await ne(o.url)},r):t.jsx("source",{media:"(width <900px)",srcSet:await ne(o.url)},r)),t.jsx("img",{fetchPriority:"low",loading:"lazy",className:[Pt.imageStyled,Pt[n]].join(" "),alt:"",src:s?await ne(s):""})]})})]})})},jc=e=>{const{videos:n}=e;return t.jsx("div",{className:ko.content,children:t.jsx(rt,{children:t.jsx(te,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:ko.videoContent,children:[t.jsx(Eo,{video:n[0]}),t.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.slice(1).map((a,s)=>t.jsx(Eo,{size:"small",video:a},`video-small-${s}`))})]})})})})},Re={content:"_content_ruy5q_1",videoContent:"_videoContent_ruy5q_9",articleSection:"_articleSection_ruy5q_21",contentLatout:"_contentLatout_ruy5q_31",title:"_title_ruy5q_36",article:"_article_ruy5q_21",correspondent:"_correspondent_ruy5q_64"},Io={container:"_container_1rq2h_1",playStyled:"_playStyled_1rq2h_9"},Gc=e=>{const{video:n}=e;return t.jsx(T,{href:n.info.link.url?n.info.link.url:void 0,target:n.info.link.target,children:t.jsxs("section",{className:Io.container,children:[t.jsx(ge,{isLarge:!0,preview:{sizes:n.main.image.sizes,description:n.main.description}}),t.jsx(lt,{className:Io.playStyled})]})})},$c=e=>{const n=()=>e?.video.main.author?`${e?.video.main.author} - ${ye(e.video.info.date.created)}`:e?.video.main.author;return t.jsx("div",{className:Re.content,children:t.jsx(rt,{className:Re.contentLatout,children:t.jsx(te,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:Re.videoContent,children:[t.jsx(Gc,{video:e.video}),t.jsxs("div",{className:Re.articleSection,children:[t.jsx(T,{className:Re.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),t.jsx("p",{className:Re.article,children:be(e.video.main.description)}),t.jsx("p",{className:Re.correspondent,children:n()})]})]})})})})},zc=e=>{switch(e.option){case"op1":return t.jsx(jc,{videos:e.data});case"op2":return t.jsx($c,{video:e.data[0]});default:return t.jsx(t.Fragment,{})}};function Hc({containerId:e,containerId2:n}){return b.useEffect(()=>{try{let a=function(){const h=window.twttr;h?.widgets?h.widgets.load(s):c<10?(c++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const s=document.getElementById(e),o=document.getElementById(n);if(!s&&!o)return;const r=s?.querySelectorAll("script[src]")??[],i=o?.querySelectorAll("script[src]")??[];[...r,...i].forEach(h=>{const u=document.createElement("script");Array.from(h.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),h.replaceWith(u)});const d=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(d)for(let h=0;h<d.length;h++)d[h]?.remove();let c=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const h=document.createElement("script");h.src="https://platform.twitter.com/widgets.js",h.async=!0,h.onload=a,document.body.appendChild(h)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Vc=e=>{const{isVideo:n=!1,isLarge:a=!1,hasShadow:s=!1,BackDropAuxHeigthMobile:o}=e,r=b.useMemo(()=>e?.preview?.sizes||[],[e?.preview?.sizes]);if(!r.length||!r[0]?.url||r[0]?.url==="")return t.jsx("div",{className:K.imagePlaceholder});const{PUBLIC_API_HOST:i,PUBLIC_ENV:l}=Y();return t.jsx("figure",{className:K.figure,children:t.jsxs("span",{className:K.backdrop,children:[t.jsx("span",{className:K.backdropAux,style:{height:o||"56.25%"}}),t.jsxs("picture",{children:[t.jsx("img",{fetchPriority:"low",loading:"lazy",className:K.imageStyled,alt:e.preview?.description||"",src:(l==="local"?i:"")+r[0]?.url,style:{boxShadow:s?"0px 4px 8px 0px #00000033":"0px"}}),n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:K.boxPlayIcon,style:{height:a?"40%":"72px"}}),t.jsx(lt,{className:K.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Fc=e=>t.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),Uo={info:{section:{name:"",slug:"",url:""},link:{url:"invalidUrl",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},To=6,Wc=({section:e,currentNews:n,banner:a,isVisible:s=!1,stylesConfig:o})=>{const[r,i]=b.useState({data:Array.from({length:To},()=>Uo)}),[l,d]=b.useState(!1),c=b.useCallback(async()=>{if(!(l||!n?.info?.link?.internal)){d(!0);try{const h=new URLSearchParams({section:e,currentNewsLink:n.info.link.internal}),u=await fetch(`/api/get-more-news?${h}`);if(!u.ok)throw i(void 0),new Error(`HTTP error! status: ${u.status}`);const f=await u.json();i({...f,data:f.data.slice(0,To)})}catch(h){console.error("[/api/get-more-news] Error:",h.message),i(void 0)}}},[e,n.info.link.internal,l]);return b.useEffect(()=>{s&&c()},[s,r,c]),!r?.data||r.data.length===0?null:t.jsx(Yc,{news:r.data,title:"Más Noticias",...o["Modulo 1x3 Client"]??o["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,isVisible:s})},Yc=e=>{const{news:n,hasLines:a=!1}=e,s=o=>a&&(o+1)%3!==0?oa.contentSeparator:"";return t.jsx("div",{className:oa.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:n.map((o,r)=>{const{main:i,authors:l,info:d,preview:c,isVideo:h=!1,config:u,overImage:f="default",isTitle:y=!1,isLarge:m=!1}=o;return t.jsx("div",{className:s(r),style:{order:r},children:t.jsxs("section",{className:It.content,children:[t.jsx(T,{title:i?.title?.section,href:d?.link?.url??"invalidUrl","aria-label":i?.title?.section??"nota",target:d?.link?.target,children:t.jsx(Vc,{isVisible:e.isVisible,preview:c,rounded:e.rounded,isVideo:h,isLarge:m,getImageUrl:e.getImageUrl})}),t.jsx("div",{className:It.newsDescription,children:t.jsx(Kc,{main:i,authors:l,info:d,preview:c,share:e.share,config:u,overImage:f,isTitle:y,paths:o.paths,isVisible:e.isVisible})})]})},r)})})},Kc=e=>{const{share:n=!1,cutSubtitle:a=!0}=e,o=(()=>{if(!e?.authors||e.authors.length===0)return"";const r=e.authors[0],i=ye(e.info?.date?.modified);return r&&e?.config?.showtime&&e.config?.showauthor?`${r.fullname} - ${i}`:r&&e.config?.showauthor?r.fullname:e?.config?.showtime?i:""})();return t.jsxs("div",{className:F.boxInformation,children:[n&&t.jsx(Fc,{className:F.dotStyles}),e?.info?.section?.url&&t.jsxs("div",{className:F.sectionDescriptionContainer,children:[t.jsx(T,{className:F.sectionDescription,href:e.info.section.url??"invalidUrl",children:e.info.section.name}),e?.main?.uppertitle&&t.jsx("p",{className:F.uppertitle,children:e.main.uppertitle})]}),t.jsx("h2",{className:F.articule,children:t.jsx(T,{className:F.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&t.jsx("p",{className:F.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?be(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&o&&t.jsx(t.Fragment,{children:e.authors?.[0]?.internaluser?t.jsx(T,{className:F.correspondentLink,href:`/autor/${e.authors[0].name}`,children:o}):t.jsx("div",{className:F.correspondent,children:o})})]})},Jc=({user:e,handleLogout:n,message:a})=>{const s=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},o=e.firstname??"Usuario";return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):t.jsx("div",{className:"comment-avatar",children:o.charAt(0).toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{className:"comment-header",children:[t.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",o,"!"]}),t.jsx("div",{className:"user-actions-options",children:t.jsx("button",{onClick:()=>{n()},children:"Cerrar Sesion"})}),t.jsx("button",{className:"user-actions-span",onClick:s,children:t.jsx(gn,{width:13,height:13,fill:"black"})})]}),t.jsx("p",{className:"comment-text",children:a})]})]})})},ee={overlay:"_overlay_qj491_3",popup:"_popup_qj491_17",title:"_title_qj491_40",optionsContainer:"_optionsContainer_qj491_52",option:"_option_qj491_52",radioInput:"_radioInput_qj491_66",radioCustom:"_radioCustom_qj491_70",optionLabel:"_optionLabel_qj491_97",buttons:"_buttons_qj491_110",cancelButton:"_cancelButton_qj491_117",closeButton:"_closeButton_qj491_118",buttonAlone:"_buttonAlone_qj491_137",reportButton:"_reportButton_qj491_143",successContainer:"_successContainer_qj491_163",thumbsUp:"_thumbsUp_qj491_171",successMessage:"_successMessage_qj491_177",errorMessage:"_errorMessage_qj491_218",loadingContainer:"_loadingContainer_qj491_231"},xo=async e=>{const{PUBLIC_ENV:n}=Y();if(n==="local")return!0;if(!e)return!1;try{const i=await(await fetch("https://recaptchaenterprise.googleapis.com/v1/projects/undefined/assessments?key=undefined",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:void 0}})})).json();return console.log("reCAPTCHA Enterprise verification result:",i),i.tokenProperties?.valid===!0}catch(a){return console.error("Error verificando reCAPTCHA Enterprise:",a),!1}};async function Zc({publication:e,username:n,id:a,type:s,baseUrl:o,captchaToken:r,apiToken:i}){if(!e||!n||!a||!s||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof n!="string"||typeof a!="string"||typeof s!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await xo(r))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const l=`${o}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(s),c=new URLSearchParams({publication:e,username:n,id:a,type:d}),h=`${l}?${c.toString()}`;try{console.log("Reporting comment:",{publication:e,username:n,id:a,type:s,encodedType:d,url:h});const u=await V.post(h,null,{headers:{"User-Agent":"Bluestack","x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",u.data),u.status===200||u.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:u.status,data:u.data};throw new Error(`Respuesta inesperada del servidor: ${u.status}`)}catch(u){if(console.error("Error reporting comment:",u),V.isAxiosError(u)){const f=u.response?.status,y=u.response?.data;throw f===400?new Error("Datos inválidos para el reporte"):f===401?new Error("Token de API inválido"):f===403?new Error("Acceso denegado para reportar comentario"):f===404?new Error("Comentario no encontrado"):f===409?new Error("El comentario ya fue reportado por este usuario"):f===500?new Error("Error interno del servidor CMS"):new Error(y?.error||y?.message||`Error HTTP ${f}: No se pudo reportar el comentario`)}throw u}}const Ue={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function Xc(e){return Ue[e]}const et=300,je={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function Rc(e){const n=e.split(" ");if(n.length!==3)return e;const[a,s,o]=n,r=s.charAt(0).toUpperCase()+s.slice(1).toLowerCase();return`${a} ${r} ${o}`}const ha=(e,n)=>{if(!e||!e.current)return{boolean:!1,text:""};const a=e.current?.value||"",s=a.length>et,{PUBLIC_ENV:o}=Y(),r=o==="local",i=a.trim()!==""&&(r||n!=="")&&!s,l=s?`No debes exceder el limite de ${et} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:i,text:l}},qo=e=>{const n=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!n)return[];try{return JSON.parse(decodeURIComponent(n.split("=")[1]??""))}catch{return[]}},ed=(e,n)=>{const a=qo(e);a.includes(n)||(a.push(n),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function td(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let l="";return r.length<=2?l=r[0]+"*":l=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${l}${i}`}const _={overlay:"_overlay_tlrod_1",header:"_header_tlrod_18",logo:"_logo_tlrod_25",card:"_card_tlrod_32",close:"_close_tlrod_47",form:"_form_tlrod_71",formUl:"_formUl_tlrod_80",field:"_field_tlrod_92",label:"_label_tlrod_99",input:"_input_tlrod_108",error:"_error_tlrod_126",primary:"_primary_tlrod_132",divider:"_divider_tlrod_167",google:"_google_tlrod_193",googleIcon:"_googleIcon_tlrod_223",spin:"_spin_tlrod_256",checkboxRow:"_checkboxRow_tlrod_278",switch:"_switch_tlrod_307",terms:"_terms_tlrod_315",message:"_message_tlrod_346",passwordChecker:"_passwordChecker_tlrod_351",valid:"_valid_tlrod_370",invalid:"_invalid_tlrod_374",forgotPassword:"_forgotPassword_tlrod_378",successContainer:"_successContainer_tlrod_397",thumbsUp:"_thumbsUp_tlrod_405",successMessage:"_successMessage_tlrod_411"},Ge=()=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:_.spin,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),nd=({isOpen:e,onClose:n,commentId:a,publication:s,username:o})=>{const[r,i]=b.useState("form"),[l,d]=b.useState(""),[c,h]=b.useState(""),[u]=b.useState(""),f=[{id:"spam",label:Ue.spam},{id:"inappropriate",label:Ue.inappropriate},{id:"hate",label:Ue.hate},{id:"misinformation",label:Ue.misinformation},{id:"terrorism",label:Ue.terrorism},{id:"intellectual",label:Ue.intellectual},{id:"bullying",label:Ue.bullying}],y=async()=>{if(!(!l||!a)){if(qo(document).includes(a)){h("Ya has reportado este comentario.");return}i("loading"),h("");try{const w=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:s,username:o,id:a,captchaToken:u,type:Ue[l]})})).json();if(w.type==="success")ed(document,a),i("success"),setTimeout(()=>{m()},3e3);else throw new Error(w.message||"Error al reportar comentario")}catch(g){console.error("Error reporting comment:",g),h(g.message||"Error al reportar comentario"),i("form")}}},m=()=>{i("form"),d(""),h(""),n()};return!e||!a||!o?null:t.jsx("div",{className:ee.overlay,children:t.jsxs("div",{className:ee.popup,children:[t.jsx("button",{className:"close-reply-form",onClick:m,children:t.jsx(ct,{})}),t.jsx("h2",{className:ee.title,children:"Reportar Abuso"}),r==="loading"&&t.jsx("div",{className:ee.loadingContainer,children:t.jsx(Ge,{})}),r==="form"||r==="loading"?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:ee.optionsContainer,children:f.map(g=>t.jsxs("label",{className:ee.option,children:[t.jsx("input",{type:"radio",name:"reportReason",value:g.id,checked:l===g.id,onChange:w=>d(w.target.value),className:ee.radioInput}),t.jsx("span",{className:ee.radioCustom}),t.jsx("span",{className:ee.optionLabel,children:g.label})]},g.id))}),c&&t.jsx("div",{className:ee.errorMessage,children:c}),t.jsxs("div",{className:ee.buttons,children:[t.jsx("button",{onClick:m,className:ee.cancelButton,children:"Cancelar"}),t.jsx("button",{onClick:y,disabled:!l,className:ee.reportButton,children:"Reportar"})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:ee.successContainer,children:[t.jsx("div",{className:ee.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsx("p",{className:ee.successMessage,children:"¡Gracias por reportar!"})]}),t.jsx("div",{className:ee.buttons,children:t.jsx("button",{onClick:m,className:[ee.closeButton,ee.buttonAlone].join(" "),children:"Cerrar"})})]})]})})};async function _n({publication:e,path:n,size:a=5,sizereply:s=2,id:o,lastid:r,state:i="5,6",apiToken:l}){if(!e||!n)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof n!="string")throw new Error("Invalid input types for publication or path");if(!l)throw new Error("Missing CMS API token");const d=parseInt(String(a),10),c=parseInt(String(s),10);if(isNaN(d)||d<=0)throw new Error("Invalid size parameter");if(isNaN(c)||c<0)throw new Error("Invalid sizereply parameter");const h=`${ka()}/hit/5.0/1/newcomments/get`,u=new URLSearchParams({publication:e,path:n,size:d.toString(),sizereply:c.toString(),state:i});o&&u.append("id",o),r&&u.append("lastid",r);const f=`${h}?${u.toString()}`;try{console.log("Fetching comments from:",f);const{data:y}=await V.get(f,{headers:{"x-api-token":l,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!y)throw new Error("No comments data received");return y.data||y||[]}catch(y){if(console.error("Error fetching comments:",y),V.isAxiosError(y)){const m=y.response?.status,g=y.response?.data;throw m===404?new Error("Comments not found"):m===403?new Error("Access forbidden - check API token"):m===401?new Error("Unauthorized - invalid API token"):m===500?new Error("Internal server error from CMS"):new Error(g?.error||g?.message||`HTTP ${m}: Failed to fetch comments`)}throw y}}const{PUBLIC_PUBLICATION_ID:ad}=Y(),sd=ad,od=e=>{const[n,a]=b.useState(void 0);return b.useEffect(()=>{if(n)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:o}=Y();try{const r=await _n({publication:sd,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:o});a(r[0]??[])}catch(r){console.error(r),a({comments:[],morecomment:!1})}})()},[n]),{comments:n,setComments:a}},Bo=({username:e,date:n})=>t.jsxs("div",{className:"comment-header",children:[t.jsx("span",{className:"comment-username",children:e}),t.jsx("span",{className:"comment-header-dot",children:"•"}),t.jsx("span",{className:"comment-date",children:Rc(ye(Number(n)))})]}),Lo=({user:e})=>t.jsx("div",{className:"comment-avatar",children:e.picture?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),Do=({isReply:e=!1,onReply:n,onFlag:a})=>t.jsxs("div",{className:"comment-actions",children:[!e&&n&&t.jsx("button",{onClick:n,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),t.jsx("button",{onClick:a,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Mo=({commentRef:e,captchaToken:n="",setIsDisabled:a})=>(b.useEffect(()=>{const s=e.current;if(!s)return;const o=()=>{const i=s.value.length;s.parentElement&&(s.parentElement.dataset.text=`${i}/${et}`),s.classList.toggle("over-limit",i>et),a(!ha(e,n).boolean)};return s.addEventListener("input",o),o(),()=>s.removeEventListener("input",o)},[e,n,a]),t.jsxs("div",{children:[t.jsx("label",{className:"comment-input-label",children:"Comentario"}),t.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),Po=({commentRef:e,captchaToken:n="",children:a})=>{const s=ha(e,n);return t.jsx("div",{className:"form-actions",children:t.jsxs("div",{className:"submit-zone",children:[a,!s.boolean&&t.jsx("p",{className:"submit-warning",children:s.text})]})})},Oo=({onClick:e,isDisabled:n})=>{const[a,s]=b.useState(!1);return b.useEffect(()=>{let o=null;return a&&(o=setTimeout(()=>{s(!1)},2400)),()=>{o&&clearTimeout(o)}},[a]),a?t.jsx("div",{className:"success-gif-container",children:t.jsx("img",{className:"success-gif",src:"/Success.gif"})}):t.jsxs("button",{type:"button",onClick:async o=>{await e(o)&&s(!0)},id:"comment-button",className:`submit-btn ${n?"disabled":"active"}`,children:["Enviar Comentario",t.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})},{PUBLIC_PUBLICATION_ID:rd}=Y(),id=rd,Qo=async({path:e,ref:n,captchaToken:a,button:s,user:o,id:r,addComment:i})=>{const l=n.current?.value||"";if(!ha(n,a).boolean||!o){const d=s.nextElementSibling;return d&&(d.style.display="block"),!1}try{const d=Date.now(),c=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:id,path:e,id:r,username:o.username,comment:l,recaptchaResponse:a})});let h=null;try{h=await c.json()}catch(m){console.error("Error parsing JSON response:",m)}if(!c.ok)throw new Error(`Error al enviar comentario: ${h?.message} status: ${c.status}`);const u=Date.now(),f=Math.max(0,2400+Math.abs(u-d)),y={username:o.username,firstname:o.firstname,...o.lastname&&{lastname:o.lastname},...o.picture&&{picture:o.picture}};return i({id:u.toString(),text:l,user:y,date:{time:Date.now()},reply:[]}),n.current&&(n.current.value=""),f}catch(d){return console.error("Error enviando comentario:",d),alert(d.message||"Error al enviar el comentario."),!1}},ld=({replyingTo:e,commentRef:n,user:a,path:s,addReply:o,closeForm:r})=>{const[i,l]=b.useState(!0),[d,c]=b.useState(""),h=()=>{n.current?.parentElement&&(n.current.parentElement.dataset.text=`0/${et}`),l(!0),r()};return t.jsxs("div",{className:"comment-form reply-form",children:[t.jsx("button",{className:"close-reply-form",onClick:h,children:t.jsx(ct,{})}),t.jsx(Mo,{commentRef:n,captchaToken:d,setIsDisabled:l}),t.jsx(Po,{commentRef:n,captchaToken:d,setCaptchaToken:c,children:t.jsx(Oo,{onClick:async u=>{if(i)return;const f=await Qo({path:s,ref:n,captchaToken:d,button:u.currentTarget,user:a,id:e,addComment:o});return f&&typeof f=="number"?(setTimeout(()=>{h()},f),!0):!1},isDisabled:i})})]})},cd=({reply:e,replyingTo:n,user:a,onFlag:s})=>{const o=e.text;let r=`${je.firstname} ${je.lastname}`,i=je.username;return e.user&&(r=`${e.user.firstname} ${e.user.lastname}`,i=e.user.username),t.jsx("div",{className:"comment-item reply",children:t.jsxs("div",{className:"comment-header-container",children:[t.jsx(Lo,{user:e.user?e.user:je}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Bo,{username:r,date:e.date.time}),t.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",t.jsx("strong",{children:n})]}),t.jsx("p",{className:"comment-text",children:o}),a?.username.toLowerCase()!==i.toLowerCase()&&t.jsx(Do,{isReply:!0,onFlag:()=>s(e.id)})]})]})})},dd=({comment:e,replyingTo:n,path:a,user:s,handleReplyingTo:o,onFlag:r})=>{const i={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[l,d]=b.useState(i),[c,h]=b.useState(!1),u=process.env.NEXT_PUBLIC_PUBLICATION_ID??"",f=e.text,y=b.useRef(null);let m=`${je.firstname} ${je.lastname}`,g=je.username;e.user&&(m=`${e.user.firstname} ${e.user.lastname}`,g=e.user.username);const w=v=>{d({morereply:l.morereply,reply:[v,...l.reply]})};return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{className:"comment-header-container","data-hasreplies":l.reply.length>0?"true":"false",children:[t.jsx(Lo,{user:e.user?e.user:je}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Bo,{username:m,date:e.date.time}),t.jsx("p",{className:"comment-text",children:f}),s?.username.toLowerCase()!==g.toLowerCase()&&t.jsx(Do,{onReply:()=>o(e.id),onFlag:()=>r(e.id)}),n===e.id&&s&&t.jsx(ld,{replyingTo:n,commentRef:y,addReply:w,user:s,path:a,closeForm:()=>o("")}),l.reply.length>0&&t.jsxs("div",{className:"comment-replies",children:[l.reply.map(v=>t.jsx(cd,{user:s,reply:v,replyingTo:m,onFlag:r},v.id)),c?t.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:t.jsx(Ge,{})}):l.morereply&&t.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const v=l.reply[l.reply.length-1]?.id;h(!0);try{const k=(await _n({publication:u,path:a??"",size:2,sizereply:2,id:e.id,lastid:v,state:"5,6",apiToken:process.env.NEXT_PUBLIC_X_SECURITY_TOKEN}))[0];h(!1),d({morereply:k.morecomment,reply:[...l.reply,...k.comments]})}catch(I){throw h(!1),new Error(`Error al obtener comentarios: ${I}`)}},children:"Más Respuestas"})]})]})]})})},hd=({commentRef:e,user:n,path:a,addComment:s})=>{const[o,r]=b.useState(!0),[i,l]=b.useState("");return t.jsxs("div",{className:"comment-form",children:[t.jsx(Mo,{commentRef:e,captchaToken:i,setIsDisabled:r}),t.jsx(Po,{commentRef:e,captchaToken:i,setCaptchaToken:l,children:t.jsx(Oo,{onClick:async d=>{if(o)return;const c=await Qo({path:a,ref:e,captchaToken:i,button:d.currentTarget,user:n,addComment:s});return c&&typeof c=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${et}`),r(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${et}`),r(!0)},c),!0):!1},isDisabled:o})})]})},{PUBLIC_PUBLICATION_ID:ud,PUBLIC_X_SECURITY_TOKEN:md}=Y(),jo=ud??"",fd=({isAuthenticated:e,path:n,user:a,handleLogout:s})=>{const o=n.replaceAll("/","|"),[r,i]=b.useState(void 0),[l,d]=b.useState(""),{comments:c,setComments:h}=od(o),[u,f]=b.useState(!1),y=b.useRef(null),m=S=>{d(l===S?"":S)},g=S=>{h(c?{...c,comments:[S,...c.comments??[]]}:void 0)},w=S=>{i(S)},v=async()=>{if(!c||!c.morecomment||c.comments.length===0)return;const S=c.comments[c.comments.length-1];if(!S)return;f(!0);const O=S.id;try{const $=(await _n({publication:jo,path:o??"",size:5,sizereply:2,id:void 0,lastid:O,state:"5,6",apiToken:md}))[0];h({morecomment:$.morecomment??!1,comments:[...c.comments,...$.comments]}),f(!1)}catch(M){throw f(!1),new Error(`Error al obtener comentarios: ${M}`)}},I=c?.comments&&c.comments.length>0,k=I?"Comparte tu opinión de este artículo.":"Se el primero en compartir tu opinión de este artículo.",D=t.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:t.jsx(Ge,{})});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-container",children:t.jsx(te,{title:I||e?"COMENTARIOS":!1,children:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-header",children:e&&a&&t.jsxs(t.Fragment,{children:[t.jsx(Jc,{user:a,handleLogout:s,message:k}),t.jsx(hd,{commentRef:y,user:a,addComment:g,path:o})]})}),t.jsx("div",{className:"comments-list","data-isauthenticated":`${e}`,children:c?c.comments&&c.comments.length>0?t.jsxs(t.Fragment,{children:[c.comments.map(S=>t.jsx(dd,{comment:S,replyingTo:l,handleReplyingTo:m,onFlag:w,user:a??je,path:o},S.id)),u&&D]}):null:D}),c?.morecomment&&!u&&t.jsx("button",{className:"comment-replies-button",onClick:v,children:"Más"})]})})}),t.jsx(nd,{username:a?.username??void 0,publication:jo,commentId:r,isOpen:r!==void 0,onClose:()=>i(void 0)})]})},ua=async(e,n)=>{if(!e)throw new Error("No action provided");if(!n)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((s,o)=>{a.enterprise.ready(async()=>{try{const r=await a.enterprise.execute(n,{action:e});if(!r)throw new Error("Captcha token no generado");s(r)}catch(r){o(r)}})})},Go={email:{label:"Email",required:!0},given_name:{label:"Nombre",required:!0},family_name:{label:"Apellido",required:!0},password:{label:"Contraseña",required:!0},confirmPassword:{label:"Confirmar contraseña",required:!0}},Nn=[{label:"La contraseña debe tener al menos 8 caracteres",test:e=>e.length>=8},{label:"Usa un número",test:e=>/\d/.test(e)},{label:"Usa una letra minúscula",test:e=>/[a-z]/.test(e)},{label:"Usa una letra mayúscula",test:e=>/[A-Z]/.test(e)},{label:"Usa un símbolo",test:e=>/[^A-Za-z0-9]/.test(e)}];function gd({goToLogin:e,handleGoogleLogin:n}){const[a,s]=b.useState({}),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[d,c]=b.useState(null),[h,u]=b.useState("register"),f=(w,v)=>{s(I=>({...I,[w]:v}))},y=async w=>{w.preventDefault(),c(null),l(!0);try{const v=Object.keys(Go).filter(M=>!["username","password","confirmPassword"].includes(M)).map(M=>({Name:M,Value:a[M]}));if(v.some(M=>{if(!M.Value||M.Value.trim()==="")return!0}))return l(!1),c("Complete todos los campos");if(a.password!==a.confirmPassword){c("Las contraseñas no coinciden");return}const I=a.password||"";if(Nn.some(M=>!M.test(I))){c("La contraseña no es válida");return}const D=Math.floor(Date.now()/1e3);v.push({Name:"updated_at",Value:String(D)});const S=await ua("comment_register","");if(!S)throw new Error("Captcha token no generado");const O=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,password:a.password,userAttributes:v,token:S})});if(!O.ok){const M=await O.json().catch(()=>({}));if(M.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email})}),u("confirm");return}throw new Error(M?.error||"Error al crear usuario")}u("confirm")}catch(v){console.log(v),c(v?.message||v?.error||"Error inesperado")}finally{l(!1)}},m=async w=>{if(w.preventDefault(),!a.confirmationCode){c("Debes ingresar el código de verificación");return}c(null),l(!0);try{const v=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.email,code:a.confirmationCode})});if(!v.ok){const I=await v.json().catch(()=>({}));throw new Error(I?.error||"Error al confirmar usuario")}u("success")}catch(v){c(v?.message||"Error inesperado")}finally{l(!1)}},g=a.password||"";return t.jsxs(t.Fragment,{children:[h==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:n,className:_.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:_.googleIcon}),t.jsx("span",{children:"Continuar con Google"})]}),t.jsx("div",{className:_.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:y,className:_.form,"data-error":d?"true":"false",children:[t.jsx("ul",{className:_.formUl,children:Object.entries(Go).map(([w,{label:v}])=>t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:v}),t.jsx("input",{type:w.toLowerCase().includes("password")?o?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:a[w]||"",onChange:I=>f(w,I.target.value),className:_.input,placeholder:""}),w==="password"&&t.jsx("div",{className:_.passwordChecker,children:Nn.map((I,k)=>{const D=I.test(g);return t.jsxs("div",{className:D?_.valid:_.invalid,children:[t.jsx("div",{children:D?"✔":"○"}),t.jsx("div",{children:I.label})]},k)})}),w==="confirmPassword"&&t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:o,onChange:I=>r(I.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:_.checkboxLabel,children:"Mostrar contraseñas"})]})]},w))}),d&&t.jsx("p",{className:_.error,children:d}),t.jsxs("p",{className:_.terms,children:["Al continuar, confirmo que he leído y aceptado los",t.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:"Términos y Condiciones"}),"de nuestra comunidad"]}),t.jsx("button",{type:"submit",className:_.primary,disabled:i,children:i?t.jsx(Ge,{}):"Crear cuenta"})]})]}),h==="confirm"&&t.jsxs("form",{onSubmit:m,className:_.form,"data-error":d?"true":"false",children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Código de verificación"}),t.jsx("input",{type:"text",name:"confirmationCode",value:a.confirmationCode||"",onChange:w=>f("confirmationCode",w.target.value),className:_.input,required:!0})]}),d&&t.jsx("p",{className:_.error,children:d}),t.jsx("button",{type:"submit",className:_.primary,disabled:i,children:i?t.jsx(Ge,{}):"Confirmar cuenta"}),t.jsxs("p",{className:_.switch,children:["¿Ya confirmaste antes?",t.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]}),h==="success"&&t.jsxs("form",{className:_.form,children:[t.jsxs("div",{className:_.successContainer,children:[t.jsx("div",{className:_.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:_.successMessage,children:[t.jsx("p",{children:"Confirmación completa."}),t.jsx("p",{children:"Ya eres parte de la comunidad!"})]})]}),t.jsx("button",{onClick:e,className:_.primary,children:"Iniciar sesión"})]}),h==="register"&&t.jsxs("p",{className:_.switch,children:["¿Ya tenés cuenta?",t.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]})}function pd({onClose:e,checkAuth:n,goToRegister:a,handleGoogleLogin:s}){const[o,r]=b.useState("login"),[i,l]=b.useState(""),[d,c]=b.useState(""),[h,u]=b.useState(""),[f,y]=b.useState(""),[m,g]=b.useState(""),[w,v]=b.useState(!1),[I,k]=b.useState(!1),[D,S]=b.useState(null),O=async z=>{if(!I){z.preventDefault(),S(null),k(!0);try{const P=await ua("comment_login",void 0);if(!P)throw new Error("Captcha token no generado");const x=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i,password:d,token:P})});if(!x.ok){const Z=await x.json().catch(()=>({}));throw new Error(Z?.error||"Ha ocurrido un error")}e(),await n()}catch(P){S(P?.message||"Error inesperado")}finally{k(!1)}}},M=async z=>{if(!I){z.preventDefault(),S(null),k(!0);try{const P=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Error al enviar código")}c(""),r("changePassword")}catch(P){S(P?.message||"Error inesperado")}finally{k(!1)}}},$=async z=>{if(I)return;if(z.preventDefault(),f!==m){S("Las contraseñas no coinciden");return}if(Nn.some(x=>!x.test(f))){S("La contraseña no cumple con los requisitos");return}S(null),k(!0);try{const x=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,code:h,newPassword:f})});if(!x.ok){const Z=await x.json().catch(()=>({}));throw new Error(Z?.error||"Error al cambiar contraseña")}r("feedback")}catch(x){S(x?.message||"Error inesperado")}finally{k(!1)}};return t.jsxs(t.Fragment,{children:[o==="login"&&t.jsx(Ad,{email:i,password:d,showPassword:w,loading:I,error:D,setEmail:l,setPassword:c,setShowPassword:v,onSubmit:O,onForgot:()=>{S(null),r("forgot")},onRegister:a,handleGoogleLogin:s}),o==="forgot"&&t.jsx(wd,{email:i,setEmail:l,loading:I,error:D,onSubmit:M,onBack:()=>{S(null),r("login")}}),o==="changePassword"&&t.jsx(yd,{email:i,confirmationCode:h,newPassword:f,confirmNewPassword:m,showPassword:w,loading:I,error:D,setConfirmationCode:u,setNewPassword:y,setConfirmNewPassword:g,setShowPassword:v,onSubmit:$,onBack:()=>{S(null),r("forgot")}}),o==="feedback"&&t.jsx(bd,{onBackToLogin:()=>{S(null),r("login")}})]})}function Ad({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:l,onSubmit:d,onForgot:c,onRegister:h,handleGoogleLogin:u}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:u,className:_.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:_.googleIcon}),t.jsx("span",{children:"Continuar con Google"})]}),t.jsx("div",{className:_.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:d,className:_.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Email"}),t.jsx("input",{type:"email",value:e,onChange:f=>r(f.target.value),className:_.input,placeholder:""})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Contraseña"}),t.jsx("input",{type:a?"text":"password",value:n,onChange:f=>i(f.target.value),className:_.input,placeholder:""}),t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>l(f.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:_.checkboxLabel,children:"Mostrar contraseña"})]})]}),o&&t.jsx("p",{className:_.error,children:o}),t.jsx("button",{type:"submit",className:_.primary,disabled:s,children:s?t.jsx(Ge,{}):"Iniciar Sesión"})]}),t.jsxs("p",{className:_.switch,children:["¿No tenés cuenta?",t.jsx("button",{type:"button",onClick:h,children:"Registrate"})]}),t.jsx("button",{type:"button",className:_.forgotPassword,onClick:c,children:"Olvidé mi contraseña"})]})}function wd({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r}){return t.jsxs("form",{onSubmit:o,className:_.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:_.message,children:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña."}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Email"}),t.jsx("input",{type:"email",value:e,name:"email",onChange:i=>n(i.target.value),className:_.input,placeholder:""})]}),s&&t.jsx("p",{className:_.error,children:s}),t.jsx("button",{type:"submit",className:_.primary,disabled:a,children:a?t.jsx(Ge,{}):"Enviar código"}),t.jsx("p",{className:_.switch,children:t.jsx("button",{type:"button",onClick:r,children:"Volver"})})]})}function yd({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:l,setNewPassword:d,setConfirmNewPassword:c,setShowPassword:h,onSubmit:u,onBack:f}){return t.jsxs("form",{onSubmit:u,className:_.form,"data-error":i?"true":"false",children:[t.jsxs("p",{className:_.message,children:["Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a ",td(e),". Ingrese el código y la contraseña nueva."]}),t.jsxs("ul",{className:_.formUl,children:[t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Código de verificación"}),t.jsx("input",{type:"text",value:n,onChange:y=>l(y.target.value),className:_.input,placeholder:""})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Nueva contraseña"}),t.jsx("input",{type:o?"text":"password",value:a,onChange:y=>d(y.target.value),className:_.input,placeholder:"",name:"password"}),t.jsx("div",{className:_.passwordChecker,children:Nn.map((y,m)=>{const g=y.test(a);return t.jsxs("div",{className:g?_.valid:_.invalid,children:[t.jsx("div",{children:g?"✔":"○"}),t.jsx("div",{children:y.label})]},m)})})]}),t.jsxs("div",{className:_.field,children:[t.jsx("label",{className:_.label,children:"Confirmar contraseña"}),t.jsx("input",{type:o?"text":"password",value:s,onChange:y=>c(y.target.value),className:_.input,placeholder:""}),t.jsxs("div",{className:_.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:y=>h(y.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:_.checkboxLabel,children:"Mostrar contraseñas"})]})]})]}),i&&t.jsx("p",{className:_.error,children:i}),t.jsx("button",{type:"submit",className:_.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(Ge,{}):"Cambiar contraseña"}),t.jsx("p",{className:_.switch,children:t.jsx("button",{type:"button",onClick:f,children:"Volver"})})]})}function bd({onBackToLogin:e}){return t.jsxs("div",{className:_.form,children:[t.jsx("p",{className:_.success,children:"La contraseña fue cambiada con éxito"}),t.jsx("button",{type:"button",className:_.primary,onClick:e,children:"Iniciar Sesión"})]})}function Cd({loginUrl:e,onClose:n,checkAuth:a,icon:s}){const[o,r]=b.useState("login"),i=async()=>{if(!e)return;const l=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${l}`};return t.jsx("div",{className:_.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:l=>{const d=l.target;d&&d.id==="pop-overlay"&&n()},children:t.jsxs("div",{className:_.card,children:[t.jsxs("header",{className:_.header,children:[t.jsx("div",{className:_.logo,children:s?s():null}),t.jsx("button",{onClick:n,className:_.close,"aria-label":"Cerrar",children:t.jsx(ct,{})})]}),o==="login"&&t.jsx(pd,{onClose:n,checkAuth:a,handleGoogleLogin:i,goToRegister:()=>r("register")}),o==="register"&&t.jsx(gd,{handleGoogleLogin:i,goToLogin:()=>r("login")})]})})}function vd({isAuthenticated:e,setIsAuthenticated:n,loginUrl:a,user:s,path:o,checkAuth:r,icon:i}){const[l,d]=b.useState(!1),c=async()=>{{const u=window.location.pathname;window.location.href=`${window.location.origin}/api/auth/logout?redirect=${encodeURIComponent(u)}`}},h=async u=>{u.preventDefault(),a&&d(!0)};return t.jsxs(t.Fragment,{children:[l&&t.jsx(Cd,{loginUrl:a,icon:i,checkAuth:r,onClose:()=>{d(!1)}}),!e&&t.jsxs("div",{className:"auth-container",children:[t.jsx("p",{children:"Sumate a la comunidad para dejar tu comentario"}),t.jsx("a",{href:a,onClick:h,className:"login-button",children:"Iniciar Sesión"})]}),t.jsx(fd,{isAuthenticated:e,handleLogout:c,path:o,user:e?s:void 0})]})}function _d({isVisible:e,path:n,icon:a}){const[s,o]=b.useState(null),[r,i]=b.useState(null),l=async()=>{if(e){if(document.cookie.search("undefinedIS_AUTH=true")===-1){o(!1),i(null),console.log("user not logged");return}try{const u=await(await fetch("/api/auth/user",{credentials:"include"})).json();o(u.isAuthenticated??!1),i(u.user??null)}catch(h){console.error("Error checking auth:",h),o(!1),i(null)}}};b.useEffect(()=>{l()},[e]),b.useEffect(()=>{if(!r||!e||typeof window>"u")return;const h=window;if(typeof h!="function"){console.warn("gtag no está disponible todavía");return}h.gtag("set",{user_id:r.username}),console.log("username setted successfully")},[r,e]);const d="/api/auth/login",c=t.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:t.jsx(Ge,{})});return s===null?c:e?t.jsx(vd,{icon:a,isAuthenticated:s,setIsAuthenticated:o,loginUrl:d,user:r??void 0,checkAuth:l,path:n}):c}const Nd=({render:e,internalPath:n,section:a,currentNews:s,stylesConfig:o,icon:r})=>{const i=b.useRef(null),[l,d]=b.useState(!0);b.useEffect(()=>{const h=new IntersectionObserver(([u])=>{u?.isIntersecting&&(d(!0),h.disconnect())},{rootMargin:"0px",threshold:.1});return i.current&&h.observe(i.current),()=>h.disconnect()},[]);const c={comment:t.jsx(_d,{path:n,icon:r,isVisible:l}),more:t.jsx(Wc,{section:a,currentNews:s,stylesConfig:o,isVisible:l})};return t.jsx("div",{ref:i,suppressHydrationWarning:!0,style:{...o?o["Modulo 1x3 Client"]?o["Modulo 1x3 Client"]:o["Modulo 1x3"]:{}},children:c[e]})};async function Sd({publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r,baseUrl:i,apiToken:l,securityToken:d}){if(console.log("Adding comment with data:",{publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r}),!e||!n||!s||!a)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,n,s,a].some(y=>typeof y!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!a.trim())return{type:"error",message:"El nombre no puede estar vacío.",status:400};if(!s.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const c=await xo(r);if(console.log("Verifying captcha token...",c),!c)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const h=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,u={publication:e,path:n.replace(/\|/gi,"/"),username:a??!1,text:s.trim()};o&&(u.id=o);const f=new URLSearchParams(u);try{const{data:y}=await V.get(`${h}?${f.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":d,"x-api-token":l,"User-Agent":"amplifyapp-comments-saas"}});return!y||y.error?(console.error("CMS error response:",y),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",y),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(y){if(console.error("Error enviando comentario:",y),V.isAxiosError(y)){const m=y.response?.status??500,g=y.response?.data;return m===400?{type:"error",message:g?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:m===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:m===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:g?.message||"No se pudo enviar el comentario.",status:m}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const kd=async({token:e,projectId:n,captchaKey:a,apiKey:s,captchaAction:o})=>{if(!e)throw new Error("No token provided");if(!n||!a||!s)throw new Error("Missing project ID or site key");if(!o)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${n}/assessments?key=${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:o}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==o)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(r){throw console.error("Recaptcha verification failed",r),new Error(String(r))}};p.AssetsPreconnect=qa,p.AutorComponent=Qc,p.AutorHeader1=Js,p.AutorHeader2=Zs,p.BannerAdvertising=ae,p.BannerAdvertisingMiddle=Te,p.CarrouselCSR=Zi,p.CarrouselIRS=Ze,p.CarruselCard=Ao,p.CarruselOpinion=wo,p.CommonServices=fe,p.Comscore=ma,p.ContactInfoServer=Wl,p.ContactInput=kl,p.ContactSelect=El,p.ContactTextarea=Il,p.ContentLayout1=rt,p.ContentLayoutTema=Yn,p.DEBUG_MainSlots=xc,p.DestacadoNoticias=io,p.DestacadoVideos=fo,p.DynamicBlockServices=xs,p.DynamicComponents=Tc,p.DynamicMainSlot=Cn,p.DynamicSlot=ca,p.EditorialBlock=Gl,p.ErrorComponent=Sl,p.Font=za,p.Footer=Al,p.FormatAfterScripts=xa,p.FormatScripts=Un,p.GA4=fa,p.GTM=ga,p.GalleryHeader=ia,p.GenerateBody=Fi,p.GenerateHead=Vi,p.Header=Ml,p.ImageOffline=Os,p.IssuuServices=Gi,p.ItemListSchema=Pa,p.JournalistArticule2=no,p.JournalistGroup=ao,p.LayoutNewsComponent=Jn,p.LazyLoader=Nd,p.LiveBlogHeader=Ys,p.Location=Ki,p.MainComponentServices=Ar,p.Marfeel=pa,p.MiddleSection=$e,p.Modulo1x3=na,p.Modulo1x3Card=po,p.Modulo1x4=uo,p.Modulo1x5=mo,p.Modulo2Columnas=$l,p.Modulo3Columnas=co,p.ModuloNewsletter=zl,p.ModuloOpinion=jl,p.NewListResponseDataPH=Uo,p.NewsArticle=Qa,p.NewsComponent=Bc,p.NewsContent=un,p.NextPrev=Et,p.OrgList=ja,p.PreloadImages=xn,p.REPORT_REASONS=Ue,p.Readest=rn,p.ScriptHydrator=Hc,p.SearchSection=Oc,p.Section=te,p.SectionCard=Ee,p.SectionCard2=Ut,p.SectionCardServerComponent=wn,p.SectionServerComponent=Fl,p.ShowSection=Ls,p.SocialNetworks=sc,p.SpeculationRules=Ma,p.StaticSlotWrapper=Uc,p.SubscribeColumn=$s,p.SubscribeRow=zs,p.SubscribeWhatsAppColumn=cl,p.TagComponent=Mc,p.TagSection=to,p.TimeLine=Ks,p.TrimPathname=dr,p.VideoBlock3=Nl,p.VideoBlock4=Tl,p.VideoSection=zc,p.VideosSchemas=$a,p.WebsiteList=Ga,p.addComment=Sd,p.bannersReplace=Wt,p.becomeVideoObject=nt,p.buildTagUrl=qn,p.coloringByStrokeSVGs=Hs,p.compileStyleProps=bn,p.cutString=be,p.extractRealtedNews=lr,p.formatDate=ye,p.formatDateEdiciones=ir,p.formatDateJournalistArticule=En,p.formatDateTimeline=_a,p.formatNewsMeta=Ea,p.formatVideoData=Ba,p.generalGetData=Hi,p.getCaptchaToken=ua,p.getComments=_n,p.getConfig=Y,p.getDynamicSlots=$i,p.getEnvironmentUrl=At,p.getEnvironmentUrlFront=ka,p.getImageUrl=ne,p.getNextMeta=wt,p.getPage=bt,p.getPreloadImages=pr,p.getPrevMeta=yt,p.getReportReasonLabel=Xc,p.getResponse=Na,p.getResponsePromise=Sa,p.getSchemas=Yt,p.getScriptReplaces=Bn,p.getSlugs=Va,p.getTypeOfNews=ur,p.getVideoRealPath=mr,p.initLibrary=rr,p.metadataToJSX=Ta,p.metadata_defaults=qs,p.parseTags=In,p.pathnameSplit=Ia,p.removePages=Ha,p.reportComment=Zc,p.shareButtons=Vs,p.socialIcons=cn,p.speculationRules=Da,p.speculationRulesHome=La,p.urlReplaces=Ua,p.verifyCaptchaTokenEnterprise=kd,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-template-common",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"