sass-template-common 0.9.43 → 0.9.44

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.
@@ -11930,7 +11930,7 @@ function Cu({
11930
11930
  if (document.cookie.search(e.COGNITO_AUTH_PREFIX + "IS_AUTH=true") !== -1) {
11931
11931
  if (!window) return;
11932
11932
  const L = b("redirect_after_login_1");
11933
- L && L !== "" ? (document.cookie = "redirect_after_login_1=; Max-Age=0; path=/", window.location.pathname = L, window.location.hash = "comentarios") : window.location.pathname = "/auth/success";
11933
+ console.log("Redirect path after login:", L), L && L !== "" ? (document.cookie = "redirect_after_login_1=; Max-Age=0; path=/", window.location.pathname = L, window.location.hash = "comentarios") : window.location.pathname = "/auth/success";
11934
11934
  }
11935
11935
  };
11936
11936
  return /* @__PURE__ */ p(Y, { children: [
@@ -11982,7 +11982,7 @@ function Cu({
11982
11982
  await fetch("/api/auth/debug-login", { method: "GET", credentials: "include" });
11983
11983
  return;
11984
11984
  }
11985
- let L = "/auth/success";
11985
+ let L = "/auth/login";
11986
11986
  const H = b("redirect_after_login_1");
11987
11987
  H && H !== "" && (L = H), window.location.href = `/api/auth/login?redirect=${L}`;
11988
11988
  },
@@ -14833,7 +14833,7 @@ const _s = ({ onClick: e, isDisabled: t, API_ENV: s, icon: a, handleGoogleLogin:
14833
14833
  throw E(!1), new Error(`Error al obtener comentarios: ${M}`);
14834
14834
  }
14835
14835
  }, L = v?.comments && v.comments.length > 0, H = L ? u.commentHeaderMessageWithComments : u.commentHeaderMessageEmpty, se = /* @__PURE__ */ n("div", { style: { display: "flex", width: "100%", justifyContent: "center" }, children: /* @__PURE__ */ n(Os, {}) }), q = () => {
14836
- !window || !window.location || (document.cookie = `redirect_after_login_1=${window.location.pathname}; path=/; max-age=300`, window.location.pathname = "/auth/login");
14836
+ !window || !window.location || (document.cookie = `redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`, window.location.pathname = "/auth/login");
14837
14837
  };
14838
14838
  return /* @__PURE__ */ p(Y, { children: [
14839
14839
  /* @__PURE__ */ n("div", { className: "comments-container", children: /* @__PURE__ */ n(fe, { title: o.CONFIG_commentsV2 || L || e ? u.commentsSectionTitle : !1, children: /* @__PURE__ */ p(Y, { children: [
@@ -257,5 +257,5 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
257
257
  ${E}
258
258
  <figcaption>${L}</figcaption>
259
259
  </figure>
260
- `}}catch(b){console.error("insertVideos error for",g,b),A=""}else A=m;r=u,a+=A,n.lastIndex=u}return a+=e.slice(r),a=Nc(a),a}async function xc(e){const{news:t,banners:a,newsRelatedResponses:r,newsRelatedListResponses:n,slug:o,itemList:i,socials:l,getVideos:h,commonServices:c}=e;let d=t?.body?.rendered??"";d=d.replace(/<script[^>]*src=["']https:\/\/platform\.twitter\.com\/widgets\.js["'][^>]*><\/script>/gi,""),d=d.replace(/&nbsp;/g,""),d=Tc(d,a),d=Ic(d),d=await Sc(d),d=await Uc(d,e.texts,r),d=await kc(d,h),d=yc(d),d=Cc(d);const u=t.main.sources??[],{NEWS_JOURNALIST_COMPONENT:m,CONFIG_blockDefaultTwitterHydrator:g}=D(),f=t.config.articlepreview===je.fotoGaleria&&t.hascontent?.hasgalleryimages;return s.jsxs(s.Fragment,{children:[o!=="liveblogs"&&e.showHeaderImage?f?s.jsx(rn,{commonServices:c,newsformated:t,internal:t.info.link.internal}):s.jsx(Lr,{preview:t.preview}):null,s.jsx(le,{banners:a,name:"block_1"}),s.jsx("div",{className:"sass-pg-nrs-journalistArticleContent",children:m==="op1"?s.jsx(fc,{autorIcon:e.autorIcon,socials:l,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths}):s.jsx(vc,{autorIcon:e.autorIcon,socials:l,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),s.jsx(gc,{summary:t.main.summary}),s.jsx("main",{className:"sass-pg-nrs-contentNews",suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),s.jsx(hc,{texts:e.texts,itemList:i,banners:a,slug:o,getVideos:h,newsRelatedListResponses:n??[]}),u.length>0&&s.jsxs("div",{className:"sass-pg-nrs-noteSource",children:[s.jsx(Ac,{}),s.jsx("p",{children:String(e.texts.noteSource??"")+(u.length===1?"":"s")+": "+u.map(p=>p.name).join(", ")})]}),!g&&t&&t.hascontent&&t.hascontent.hasembeddedtwitter&&s.jsx("script",{async:!0,defer:!0,src:"https://platform.twitter.com/widgets.js"})]})}const Lc=e=>{const{config:t}=e,a=t.articlepreview;return!![je.videoEmbedded,je.videoYouTube,je.iframe].includes(a)},on=async e=>{const{texts:t,autorIcon:a,commonServices:r,slug:n,noteShare:o,paths:i,banners:l,news:h,newsRelatedResponses:c=[],newsRelatedListResponses:d=[],itemList:u=[],socials:m,getVideos:g}=e;if(h)return s.jsxs(s.Fragment,{children:[s.jsx(xc,{texts:t,autorIcon:a,socials:m,news:h,banners:l,newsRelatedResponses:c,newsRelatedListResponses:d,itemList:u,slug:n,getVideos:g,noteShare:o,paths:i,showHeaderImage:!Lc(h),commonServices:r}),s.jsx(le,{banners:l??[],name:"block_3"})]})},Pc=async e=>{const{ranking:t=[],banners:a,autor:r=[],news:n=[],newsRelatedResponses:o=[],newsRelatedListResponses:i=[],itemList:l=[],socials:h,getVideos:c}=e;if(!(!n||!n[0]))return s.jsx(s.Fragment,{children:s.jsxs(ec,{className:"sass-pg-news-contentLayout2",children:[s.jsx(sn,{option:e.slug,news:n,paths:e.paths,commonServices:e.commonServices,banners:e.banners,headerSectionStyles:e.headerSectionStyles,newsDescriptionSectionTag:e.newsDescriptionSectionTag}),s.jsx(tc,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:l,ranking:t,readestCustomStyles:e.readestCustomStyles,bannerTop:s.jsx(le,{banners:a??[],name:"right_1"}),banner:s.jsx(le,{banners:a??[],name:"right_2"}),complement:s.jsxs("div",{id:"comentarios",className:"sass-pg-news-complementContent",suppressHydrationWarning:!0,children:[r.length>0&&s.jsx(Qr,{texts:e.texts,autorIcon:e.autorIcon,autor:r[0],paths:e.paths}),n[0].authors.length>1&&s.jsx(Hr,{news:n[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),n[0]?.keywords?.tags&&n[0]?.keywords?.tags?.length>0&&s.jsx("div",{className:"sass-pg-news-tagContent sass-note-tags-content",children:s.jsx(jr,{tags:n[0]?.keywords?.tags,paths:e.paths})})]}),children:s.jsx(on,{texts:e.texts,autorIcon:e.autorIcon,socials:h,news:n[0],banners:a,newsRelatedResponses:o,newsRelatedListResponses:i,itemList:l,slug:e.slug,getVideos:c,noteShare:e.noteShare,paths:e.paths,commonServices:e.commonServices})})]})})},Bc=e=>s.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("g",{children:s.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=>s.jsx("form",{className:"su-w-full su-flex su-justify-center su-gap-4 sass-pg-buscar-content",children:s.jsxs("div",{className:"sass-pg-buscar-inputStyled sass-buscar-form",children:[s.jsx("input",{className:"sass-pg-buscar-inputStyledTest",defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),s.jsx("button",{className:"sass-pg-buscar-buttonStyled",type:"submit",children:s.jsx(Bc,{className:"sass-pg-buscar-searchStyled"})})]})}),Mc=e=>{const{data:t,option:a,autor:r,page:n,banners:o,pathname:i,ranking:l,currentPage:h,slug:c,texts:d={},socialIconsFilled:u=!1}=e,m=[5,10,15],{SUB_PUBLICATION_PREFIX_IN_ROUTES:g}=D(),f={5:1,10:2,15:3};switch(a){case"op1":return s.jsx(s.Fragment,{children:s.jsxs(Ns,{children:[s.jsx(Mr,{autor:r[0],autorIcon:e.autorIcon,socialIconsFilled:u}),s.jsx(Ss,{paths:e.paths,ranking:l,readestTitle:d.readestTitle??"",bannerTop:s.jsx(le,{banners:o??[],name:"right_1"}),banner:s.jsx(le,{banners:o??[],name:"right_2"}),children:s.jsx("section",{className:"sass-pg-autor-content",children:t.length>0?s.jsx(Mt,{className:["sass-pg-autor-newsContentSection","padding-0"].join(" "),paginatorComponent:s.jsx(nt,{block_subPublication:g?.autor,texts:d,pathname:i,query:"",currentPage:h,maxPages:e.paginationLimit,showNext:!(t.length<e.newsListLimit)}),children:Array.isArray(t)&&t?.map((p,A)=>s.jsxs(I.Fragment,{children:[m.includes(A+1)&&s.jsx("div",{className:"sass-pg-autor-itemContent banner-context",children:s.jsx(le,{banners:o??[],name:`block_2_${f[A+1]}`})}),s.jsx(jt,{autorIcon:e.autorIcon,item:p,option:c,paths:e.paths},A)]},A))}):s.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:s.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})})})]})});case"op2":return s.jsx(s.Fragment,{children:s.jsxs(Ns,{children:[s.jsx(qr,{autor:r[0],autorIcon:e.autorIcon,socialIconsFilled:u}),Array.isArray(t)?s.jsxs(s.Fragment,{children:[s.jsx(Ts,{content:t,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),s.jsx(nt,{block_subPublication:g?.autor,texts:d,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(n),showNext:!((t.length??0)<Number(e.newsListLimit))})]}):s.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:s.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})]})});default:return s.jsx(s.Fragment,{})}},Je=({className:e})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:e,children:s.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"})}),qc={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},it={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function Dc(e){return{email:{label:e?.email??it.email.label,required:!0},given_name:{label:e?.given_name??it.given_name.label,required:!0},family_name:{label:e?.family_name??it.family_name.label,required:!0},password:{label:e?.password??it.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??it.confirmPassword.label,required:!0}}}const Ee=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],ln=[{label:"La contraseña debe tener al menos 8 caracteres",test:Ee[0]},{label:"Usa un número",test:Ee[1]},{label:"Usa una letra minúscula",test:Ee[2]},{label:"Usa una letra mayúscula",test:Ee[3]},{label:"Usa un símbolo",test:Ee[4]}];function _c({texts:e,API_ENV:t,termsAndConditionsUrl:a}){const r={...qc,...e?.comentarios},n=I.useMemo(()=>Dc(e?.comentarios?.registerForm),[e?.comentarios?.registerForm]),o=I.useMemo(()=>[{label:r.passwordRuleMinLength,test:Ee[0]},{label:r.passwordRuleNumber,test:Ee[1]},{label:r.passwordRuleLowercase,test:Ee[2]},{label:r.passwordRuleUppercase,test:Ee[3]},{label:r.passwordRuleSymbol,test:Ee[4]}],[r.passwordRuleMinLength,r.passwordRuleNumber,r.passwordRuleLowercase,r.passwordRuleUppercase,r.passwordRuleSymbol]),[i,l]=I.useState({}),[h,c]=I.useState(!1),[d,u]=I.useState(!1),[m,g]=I.useState(null),[f,p]=I.useState("register"),A=async()=>{if(t.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const w=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${w}`},b=(w,U)=>{l(L=>({...L,[w]:U}))},S=async w=>{w.preventDefault(),g(null),u(!0);try{const U=Object.keys(n).filter(V=>!["username","password","confirmPassword"].includes(V)).map(V=>({Name:V,Value:i[V]}));if(U.some(V=>{if(!V.Value||V.Value.trim()==="")return!0}))return u(!1),g(r.errorCompleteFields);if(i.password!==i.confirmPassword){g(r.errorPasswordMismatch);return}const L=i.password||"";if(o.some(V=>!V.test(L))){g(r.errorPasswordInvalid);return}const Z=Math.floor(Date.now()/1e3);U.push({Name:"updated_at",Value:String(Z)});const H=t.PUBLIC_ENV==="local"?"token":await Ys("comment_register",t.CAPTCHA_KEY??"");if(!H)throw new Error("Captcha token no generado");const B=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email,password:i.password,userAttributes:U,token:H})});if(!B.ok){const V=await B.json().catch(()=>({}));if(V.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email})}),p("confirm");return}throw new Error(V?.error||"Error al crear usuario")}p("confirm")}catch(U){console.log(U),g(U?.message||U?.error||r.errorUnexpected)}finally{u(!1)}},N=async w=>{if(w.preventDefault(),!i.confirmationCode){g(r.errorVerificationCodeRequired);return}g(null),u(!0);try{const U=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email,code:i.confirmationCode})});if(!U.ok){const L=await U.json().catch(()=>({}));throw new Error(L?.error||"Error al confirmar usuario")}p("success")}catch(U){g(U?.message||r.errorUnexpected)}finally{u(!1)}},E=i.password||"";return s.jsxs(s.Fragment,{children:[f==="register"&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:A,className:"sass-pg-login-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-login-googleIcon"}),s.jsx("span",{children:r.GoogleButtonText})]}),s.jsx("div",{className:"sass-pg-login-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("form",{onSubmit:S,className:"sass-pg-login-form","data-error":m?"true":"false",children:[s.jsx("ul",{className:"sass-pg-login-formUl",children:Object.entries(n).map(([w,{label:U}])=>s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:U}),s.jsx("input",{type:w.toLowerCase().includes("password")?h?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:i[w]||"",onChange:L=>b(w,L.target.value),className:"sass-pg-login-input",placeholder:""}),w==="password"&&s.jsx("div",{className:"sass-pg-login-passwordChecker",children:o.map((L,z)=>{const Z=L.test(E);return s.jsxs("div",{className:Z?"sass-pg-login-valid":"sass-pg-login-invalid",children:[s.jsx("div",{children:Z?"✔":"○"}),s.jsx("div",{children:L.label})]},z)})}),w==="confirmPassword"&&s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:h,onChange:L=>c(L.target.checked)}),s.jsx("label",{htmlFor:"showPasswordRegister",className:"sass-pg-login-checkboxLabel",children:r.showPasswordsLabel})]})]},w))}),m&&s.jsx("p",{className:"sass-pg-login-error",children:m}),s.jsxs("p",{className:"sass-pg-login-terms",children:[r.termsPrefix," ",s.jsx("a",{href:a??"/pages/politicas-de-privacidad",target:"_blank",children:r.termsLinkText})," ",r.termsSuffix]}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:d,children:d?s.jsx(Je,{}):r.createAccountButton})]})]}),f==="confirm"&&s.jsxs("form",{onSubmit:N,className:"sass-pg-login-form","data-error":m?"true":"false",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:r.verificationCodeLabel}),s.jsx("input",{type:"text",name:"confirmationCode",value:i.confirmationCode||"",onChange:w=>b("confirmationCode",w.target.value),className:"sass-pg-login-input",required:!0})]}),m&&s.jsx("p",{className:"sass-pg-login-error",children:m}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:d,children:d?s.jsx(Je,{}):r.confirmAccountButton}),s.jsxs("p",{className:"sass-pg-login-switch",children:[r.alreadyConfirmedText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./login",children:r.loginButtonText})]})]}),f==="success"&&s.jsxs("form",{className:"sass-pg-login-form",children:[s.jsxs("div",{className:"sass-pg-login-successContainer",children:[s.jsx("div",{className:"sass-pg-login-thumbsUp",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:s.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"})})}),s.jsxs("div",{className:"sass-pg-login-successMessage",children:[s.jsx("p",{children:r.successTitle}),s.jsx("p",{children:r.successMessage})]})]}),s.jsx("a",{href:"./login",className:"sass-pg-login-primary",children:r.loginButtonText})]}),f==="register"&&s.jsxs("p",{className:"sass-pg-login-switch",children:[r.alreadyHasAccountText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./login",children:r.loginButtonText})]})]})}const Gc={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function jc({API_ENV:e,texts:t}){const a={...Gc,...t?.comentarios},[r,n]=I.useState("login"),[o,i]=I.useState(""),[l,h]=I.useState(""),[c,d]=I.useState(""),[u,m]=I.useState(""),[g,f]=I.useState(""),[p,A]=I.useState(!1),[b,S]=I.useState(!1),[N,E]=I.useState(null);I.useEffect(()=>{if(typeof window>"u")return;window.location.hash.includes("forgot")&&r==="login"&&n("forgot"),r==="login"&&U()});const w=B=>document.cookie.split("; ").find(V=>V.startsWith(B+"="))?.split("=")[1],U=async()=>{if(document.cookie.search(e.COGNITO_AUTH_PREFIX+"IS_AUTH=true")!==-1){if(!window)return;const B=w("redirect_after_login_1");B&&B!==""?(document.cookie="redirect_after_login_1=; Max-Age=0; path=/",window.location.pathname=B,window.location.hash="comentarios"):window.location.pathname="/auth/success"}},L=async()=>{if(e.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}let B="/auth/success";const V=w("redirect_after_login_1");V&&V!==""&&(B=V),window.location.href=`/api/auth/login?redirect=${B}`},z=async B=>{if(!b){if(B.preventDefault(),o===""||l===""){E("Complete todos los campos");return}E(null),S(!0);try{const V=e.PUBLIC_ENV==="local"?"token":await Ys("comment_login",e.CAPTCHA_KEY||"");if(!V)throw new Error("Captcha token no generado");const te=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:o,password:l,token:V})});if(!te.ok){const _=await te.json().catch(()=>({}));throw new Error(_?.error||"Ha ocurrido un error")}await U();return}catch(V){E(V?.message||"Error inesperado")}finally{S(!1)}}},Z=async B=>{if(!b){B.preventDefault(),E(null),S(!0);try{const V=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o})});if(!V.ok){const te=await V.json().catch(()=>({}));throw new Error(te?.error||"Error al enviar código")}h(""),n("changePassword")}catch(V){E(V?.message||"Error inesperado")}finally{S(!1)}}},H=async B=>{if(b)return;if(B.preventDefault(),u!==g){E("Las contraseñas no coinciden");return}if(ln.some(te=>!te.test(u))){E("La contraseña no cumple con los requisitos");return}E(null),S(!0);try{const te=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,code:c,newPassword:u})});if(!te.ok){const _=await te.json().catch(()=>({}));throw new Error(_?.error||"Error al cambiar contraseña")}n("feedback")}catch(te){E(te?.message||"Error inesperado")}finally{S(!1)}};return s.jsxs(s.Fragment,{children:[r==="login"&&s.jsx(Qc,{email:o,password:l,showPassword:p,loading:b,error:N,setEmail:i,setPassword:h,setShowPassword:A,onSubmit:z,onForgot:()=>{E(null),n("forgot")},handleGoogleLogin:L,t:a}),r==="forgot"&&s.jsx(Hc,{email:o,setEmail:i,loading:b,error:N,onSubmit:Z,onBack:()=>{E(null),n("login")},t:a}),r==="changePassword"&&s.jsx(Vc,{email:o,confirmationCode:c,newPassword:u,confirmNewPassword:g,showPassword:p,loading:b,error:N,setConfirmationCode:d,setNewPassword:m,setConfirmNewPassword:f,setShowPassword:A,onSubmit:H,onBack:()=>{E(null),n("forgot")},t:a}),r==="feedback"&&s.jsx(zc,{onBackToLogin:()=>{E(null),n("login")},t:a})]})}function Qc({email:e,password:t,showPassword:a,loading:r,error:n,setEmail:o,setPassword:i,setShowPassword:l,onSubmit:h,onForgot:c,handleGoogleLogin:d,t:u}){return s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:d,className:"sass-pg-login-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-login-googleIcon"}),s.jsx("span",{children:u.GoogleButtonText})]}),s.jsx("div",{className:"sass-pg-login-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("form",{onSubmit:h,className:"sass-pg-login-form","data-error":n?"true":"false",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:u.email}),s.jsx("input",{type:"email",value:e,onChange:m=>o(m.target.value),className:"sass-pg-login-input",placeholder:""})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:u.password}),s.jsx("input",{type:a?"text":"password",value:t,onChange:m=>i(m.target.value),className:"sass-pg-login-input",placeholder:""}),s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:m=>l(m.target.checked)}),s.jsx("label",{htmlFor:"showPasswordLogin",className:"sass-pg-login-checkboxLabel",children:u.showPassword})]})]}),n&&s.jsx("p",{className:"sass-pg-login-error",children:n}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:r,children:r?s.jsx(Je,{className:"sass-pg-login-spin"}):u.loginButtonText})]}),s.jsxs("p",{className:"sass-pg-login-switch",children:[u.noAccountText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./register",children:u.registerButtonText})]}),s.jsx("button",{type:"button",className:"sass-pg-login-forgotPassword",onClick:c,children:u.forgotPasswordText})]})}function Hc({email:e,setEmail:t,loading:a,error:r,onSubmit:n,onBack:o,t:i}){return s.jsxs("form",{onSubmit:n,className:"sass-pg-login-form","data-error":r?"true":"false",children:[s.jsx("p",{className:"sass-pg-login-message",children:i.forgotMessage}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:i.email}),s.jsx("input",{type:"email",value:e,name:"email",onChange:l=>t(l.target.value),className:"sass-pg-login-input",placeholder:""})]}),r&&s.jsx("p",{className:"sass-pg-login-error",children:r}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:a,children:a?s.jsx(Je,{}):i.sendCodeButton}),s.jsx("p",{className:"sass-pg-login-switch",style:{margin:"0 0 16px"},children:s.jsx("button",{type:"button",onClick:o,children:i.backButton})})]})}function Fc(e){const[t,a]=e.split("@");if(!t||!a)return e;let r="";t.length<=2?r=t[0]+"*":r=t[0]+"*".repeat(t.length-2)+t[t.length-1];const n=a.lastIndexOf(".");if(n===-1)return`${r}@${a}`;const o=a.slice(0,n),i=a.slice(n);let l="";return o.length<=2?l=o[0]+"*":l=o[0]+"*".repeat(o.length-2)+o[o.length-1],`${r}@${l}${i}`}function Vc({email:e,confirmationCode:t,newPassword:a,confirmNewPassword:r,showPassword:n,loading:o,error:i,setConfirmationCode:l,setNewPassword:h,setConfirmNewPassword:c,setShowPassword:d,onSubmit:u,onBack:m,t:g}){const f=g.changePasswordMessage.replace("{{email}}",Fc(e));return s.jsxs("form",{onSubmit:u,className:"sass-pg-login-form","data-error":i?"true":"false",children:[s.jsx("p",{className:"sass-pg-login-message",children:f}),s.jsxs("ul",{className:"sass-pg-login-formUl",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.verificationCodeLabel}),s.jsx("input",{type:"text",value:t,onChange:p=>l(p.target.value),className:"sass-pg-login-input",placeholder:""})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.newPasswordLabel}),s.jsx("input",{type:n?"text":"password",value:a,onChange:p=>h(p.target.value),className:"sass-pg-login-input",placeholder:"",name:"password"}),s.jsx("div",{className:"sass-pg-login-passwordChecker",children:ln.map((p,A)=>{const b=p.test(a);return s.jsxs("div",{className:b?"sass-pg-login-valid":"sass-pg-login-invalid",children:[s.jsx("div",{children:b?"✔":"○"}),s.jsx("div",{children:p.label})]},A)})})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.confirmPasswordLabel}),s.jsx("input",{type:n?"text":"password",value:r,onChange:p=>c(p.target.value),className:"sass-pg-login-input",placeholder:""}),s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:n,onChange:p=>d(p.target.checked)}),s.jsx("label",{htmlFor:"showPasswordForgot",className:"sass-pg-login-checkboxLabel",children:g.showPasswordsLabel})]})]})]}),i&&s.jsx("p",{className:"sass-pg-login-error",children:i}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",style:{maxWidth:o?"revert-layer":"fit-content"},disabled:o,children:o?s.jsx(Je,{}):g.changePasswordButton}),s.jsx("p",{className:"sass-pg-login-switch",children:s.jsx("button",{type:"button",onClick:m,children:g.backButton})})]})}function zc({onBackToLogin:e,t}){return s.jsxs("div",{className:"sass-pg-login-form",children:[s.jsx("p",{className:"sass-pg-login-success",children:t.feedbackSuccessMessage}),s.jsx("button",{type:"button",className:"sass-pg-login-primary",onClick:e,children:t.loginButtonText})]})}function Wc({containerId:e,containerId2:t}){return I.useEffect(()=>{try{let a=function(){const d=window.twttr;d?.widgets?d.widgets.load(r):c<10?(c++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const r=document.getElementById(e),n=document.getElementById(t);if(!r&&!n)return;const o=r?.querySelectorAll("script[src]")??[],i=n?.querySelectorAll("script[src]")??[];[...o,...i].forEach(d=>{const u=document.createElement("script");Array.from(d.attributes).forEach(m=>{u.setAttribute(m.name,m.value)}),d.replaceWith(u)});const h=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(h)for(let d=0;d<h.length;d++)h[d]?.remove();let c=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const d=document.createElement("script");d.src="https://platform.twitter.com/widgets.js",d.async=!0,d.onload=a,document.body.appendChild(d)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Yc=({currentNew:e})=>e&&e?.hascontent?.hasembeddedtwitter&&s.jsx("script",{src:"https://platform.twitter.com/widgets.js"}),Kc=e=>{const{isVideo:t=!1,isLarge:a=!1,hasShadow:r=!1,BackDropAuxHeigthMobile:n}=e,o=ys(),i=I.useMemo(()=>{const m=e?.preview?.sizes;if(m&&Array.isArray(m)&&m.length>0)return m;const g=e?.preview?.original;return g?.url?[{url:g.url,width:g.width||0,height:g.height||0}]:[]},[e?.preview?.sizes,e?.preview?.original]);if(!i.length||!i[0]?.url||i[0]?.url==="")return s.jsx("div",{className:"sass-com-img-imagePlaceholder"});const{PUBLIC_API_HOST:l="",PUBLIC_ASSETS_URL:h}=e.API_ENV,c=i[0]?.url,d=h&&h!=="false"?h:l,u=c?.startsWith("http")||c?.includes(d)?c:d+c;return s.jsx("figure",{className:"sass-com-img-figure",children:s.jsxs("span",{className:"sass-com-img-backdrop",children:[s.jsx("span",{className:"sass-com-img-backdropAux",style:{height:n||"56.25%"}}),s.jsxs("picture",{children:[s.jsx("img",{fetchPriority:"low",loading:"lazy",className:"sass-com-img-imageStyled",alt:e.preview?.description||"",src:u,style:{boxShadow:r?"0px 4px 8px 0px #00000033":"0px"}}),t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sass-com-img-boxPlayIcon",style:{height:a?"40%":"72px"}}),s.jsx(o,{className:"sass-com-img-playStyled",style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Jc=e=>s.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.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"})}),cn={info:{section:{name:"",slug:"",url:""},link:{url:"/",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},$c=({section:e,internalPath:t,banner:a,isVisible:r=!1,stylesConfig:n,API_ENV:o,fetchConfig:i,paths:l})=>{const h=o.FETCH_SIZE_MORE_NEWS??6,[c,d]=I.useState({data:Array.from({length:h},()=>cn)}),[u,m]=I.useState(!1),g=I.useCallback(async()=>{if(!t)return;const A=new URLSearchParams({section:e,currentNewsLink:t}),b=await fetch(`/api/get-more-news?${A}`);if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);return await b.json()},[e,t]),f=I.useCallback(async()=>{const{PUBLIC_API_FRONT:A,PUBLIC_X_SECURITY_TOKEN:b,PUBLIC_API_PATH_VERSION:S,PUBLIC_PUBLICATION_ID:N}=o;if(!A||!b||!N||!S)throw new Error("Missing required environment variables");const E=await re.get(`${A}${S}/news-list-section`,{params:{size:h+1,newstype:i.newsType,section:e,imagesizes:i.imgSizes,publication:parseInt(N)},headers:{"x-api-token":b,"Content-Type":"application/json"}});return{...E.data,data:E.data.data.filter(w=>w.info.link.internal!==t)}},[e,t,o]),p=I.useCallback(async()=>{if(!(u||!t)){m(!0);try{let A;o.PUBLIC_ENV!=="prod"?A=await g():A=await f(),d({...A,data:A.data.slice(0,h)})}catch(A){console.error("[/api/get-more-news] Error:",A.message),d(void 0)}}},[u,t,o.PUBLIC_ENV,g,f]);return I.useEffect(()=>{r&&p()},[r,p]),!c?.data||c.data.length===0?null:s.jsx(Zc,{news:c.data,title:"Más Noticias",...n["Modulo 1x3 Client"]??n["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,API_ENV:o,paths:l,isVisible:r})},Zc=e=>{const{news:t,hasLines:a=!1,API_ENV:r}=e,n=o=>a&&(o+1)%3!==0?"sass-bd-m13-contentSeparator":"";return s.jsx("div",{className:"su-grid su-justify-center sass-bd-m13-newsContent",style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:t.map((o,i)=>{const{main:l,authors:h,info:c,preview:d,isVideo:u=!1,config:m,overImage:g="default",isTitle:f=!1,isLarge:p=!1,keywords:A}=o;return s.jsx("div",{className:n(i),style:{order:i},children:s.jsxs("section",{className:"sass-com-sc1-content",children:[s.jsx(q,{title:l?.title?.section,href:c?.link?.url??"invalidUrl","aria-label":l?.title?.section??"nota",target:c?.link?.target,children:s.jsx(Kc,{isVisible:e.isVisible,preview:d,rounded:e.rounded,isVideo:u,isLarge:p,API_ENV:e.API_ENV,getImageUrl:e.getImageUrl})}),s.jsx("div",{className:"sass-com-sc1-newsDescription",children:s.jsx(Xc,{main:l,SHOW_TAG_BY_SECTION:r.SHOW_TAG_BY_SECTION,authors:h,info:c,preview:d,share:e.share,config:m,overImage:g,isTitle:f,paths:e.paths,isVisible:e.isVisible,DATE_CONFIG:e.API_ENV,keywords:A})})]})},i)})})},Xc=e=>{const{share:t=!1,cutSubtitle:a=!0,SHOW_TAG_BY_SECTION:r,keywords:n,info:o}=e,l=(()=>{if(!e?.authors||e.authors.length===0)return"";const d=e.authors[0],u=ye(e.info?.date?.modified,e.DATE_CONFIG);return d&&e?.config?.showtime&&e.config?.showauthor?`${d.fullname} - ${u}`:d&&e.config?.showauthor?d.fullname:e?.config?.showtime?u:""})(),h=()=>e.main.uppertitle?s.jsx("p",{className:"sass-com-nd-uppertitle",title:e.main.uppertitle,children:e.main.uppertitle}):null,c=()=>{if(r&&n?.tags?.length&&n.tags.length>0){const d=n.tags[0],u=d.name;return s.jsxs("h3",{className:"sass-com-nd-sectionDescriptionContainer",children:[d.approved?s.jsx(q,{"aria-label":u,block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.tema,className:"sass-com-nd-sectionDescription",href:Ue(d,e.paths),children:u}):s.jsx("div",{className:"sass-com-nd-sectionDescription",children:u}),h()]})}else if(o?.section?.url){const d=o.section.name;return s.jsxs("h3",{className:"sass-com-nd-sectionDescriptionContainer",children:[s.jsx(q,{"aria-label":d,className:"sass-com-nd-sectionDescription",href:o.section.url,children:d}),h()]})}return null};return s.jsxs("div",{className:"sass-com-nd-boxInformation",children:[t&&s.jsx(Jc,{className:"sass-com-nd-dotStyles"}),s.jsx(c,{}),s.jsx("h2",{className:"sass-com-nd-articule",children:s.jsx(q,{className:"sass-com-nd-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&&s.jsx("p",{className:"sass-com-nd-description",style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Ce(e.main?.subtitle?.striped):e.main?.subtitle?.striped}),(e?.config?.showtime||e.config?.showauthor)&&l&&s.jsx(s.Fragment,{children:e.authors?.[0]?.internaluser?s.jsx(q,{block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.autor,className:"sass-com-nd-correspondentLink",href:`/${e.paths.autor}/${e.authors[0].name}`,children:l}):s.jsx("div",{className:"sass-com-nd-correspondent",children:l})})]})},Rc=({user:e,handleLogout:t,message:a})=>{const r=()=>{const o=document.querySelector(".user-actions-options");o&&o.classList.toggle("show")},n=e.firstname??"Usuario";return s.jsx("div",{className:"comment-item",children:s.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?s.jsx("img",{className:"comment-avatar-img su-h-full",src:e.picture,alt:e.username}):s.jsx("div",{className:"comment-avatar su-flex-center su-rounded-full su-font-bold su-overflow-hidden",children:n.charAt(0).toUpperCase()}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{className:"comment-header su-flex su-items-center su-relative su-flex-wrap",children:[s.jsxs("span",{className:"comment-username su-font-bold su-truncate user-welcome",children:["Hola ",n,"!"]}),s.jsx("div",{className:"user-actions-options su-hidden su-absolute su-p-2",children:s.jsx("button",{className:"su-bg-transparent su-border-none",onClick:()=>{t()},children:"Cerrar Sesion"})}),s.jsx("button",{className:"user-actions-span",onClick:r,children:s.jsx(Dt,{width:13,height:13,fill:"black"})})]}),s.jsx("p",{className:"comment-text su-font-normal",children:a})]})]})})},dn=async(e,t)=>{if(!e)return!1;const{CAPTCHA_PROJECT:a,CAPTCHA_KEY_V2:r,COMMENTS_CAPTCHA_API_KEY:n}=t;try{const o=a,i=r,c=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${o}/assessments?key=${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:i}})})).json();return console.log("reCAPTCHA Enterprise verification result:",c),c.tokenProperties?.valid===!0}catch(o){return console.error("Error verificando reCAPTCHA Enterprise:",o),!1}};async function ed({publication:e,username:t,id:a,type:r,baseUrl:n,captchaToken:o,apiToken:i,securityToken:l,COMMENTS_VARS:h}){if(!e||!t||!a||!r||!o)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof t!="string"||typeof a!="string"||typeof r!="string"||typeof o!="string")throw new Error("Todos los parámetros deben ser strings");if(!await dn(o,h))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const c=`${n}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(r),u=new URLSearchParams({publication:e,username:t??!1,id:a,type:d}),m=`${c}?${u.toString()}`;try{console.log("Reporting comment:",{publication:e,username:t,id:a,type:r,encodedType:d,url:m});const g=await re.get(m,{headers:{"User-Agent":"blu3st@ck-react","x-security-token":l,"x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",g.data),g.status===200||g.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:g.status,data:g.data};throw new Error(`Respuesta inesperada del servidor: ${g.status}`)}catch(g){if(console.error("Error reporting comment:",g),re.isAxiosError(g)){const f=g.response?.status,p=g.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(p?.error||p?.message||`Error HTTP ${f}: No se pudo reportar el comentario`)}throw g}}const Qt={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 td(e){return Qt[e]}const Te=300,Ie={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function sd(e){const t=e.split(" ");if(t.length!==3)return e;const[a,r,n]=t,o=r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();return`${a} ${o} ${n}`}const Ht=(e,t,a)=>{if(!e||!e.current)return{boolean:!1,text:""};const r=e.current?.value||"",n=r.length>Te,{PUBLIC_ENV:o}=a,i=o==="local",l=r.trim()!==""&&(i||t!=="")&&!n,h=n?`No debes exceder el limite de ${Te} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:l,text:h}},hn=e=>{const t=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!t)return[];try{return JSON.parse(decodeURIComponent(t.split("=")[1]??""))}catch{return[]}},ad=(e,t)=>{const a=hn(e);a.includes(t)||(a.push(t),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};var Ft={exports:{}},Vt={exports:{}},se={};var un;function rd(){if(un)return se;un=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function N(w){if(typeof w=="object"&&w!==null){var U=w.$$typeof;switch(U){case t:switch(w=w.type,w){case h:case c:case r:case o:case n:case u:return w;default:switch(w=w&&w.$$typeof,w){case l:case d:case f:case g:case i:return w;default:return U}}case a:return U}}}function E(w){return N(w)===c}return se.AsyncMode=h,se.ConcurrentMode=c,se.ContextConsumer=l,se.ContextProvider=i,se.Element=t,se.ForwardRef=d,se.Fragment=r,se.Lazy=f,se.Memo=g,se.Portal=a,se.Profiler=o,se.StrictMode=n,se.Suspense=u,se.isAsyncMode=function(w){return E(w)||N(w)===h},se.isConcurrentMode=E,se.isContextConsumer=function(w){return N(w)===l},se.isContextProvider=function(w){return N(w)===i},se.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},se.isForwardRef=function(w){return N(w)===d},se.isFragment=function(w){return N(w)===r},se.isLazy=function(w){return N(w)===f},se.isMemo=function(w){return N(w)===g},se.isPortal=function(w){return N(w)===a},se.isProfiler=function(w){return N(w)===o},se.isStrictMode=function(w){return N(w)===n},se.isSuspense=function(w){return N(w)===u},se.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===c||w===o||w===n||w===u||w===m||typeof w=="object"&&w!==null&&(w.$$typeof===f||w.$$typeof===g||w.$$typeof===i||w.$$typeof===l||w.$$typeof===d||w.$$typeof===A||w.$$typeof===b||w.$$typeof===S||w.$$typeof===p)},se.typeOf=N,se}var ae={};var mn;function nd(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function N(M){return typeof M=="string"||typeof M=="function"||M===r||M===c||M===o||M===n||M===u||M===m||typeof M=="object"&&M!==null&&(M.$$typeof===f||M.$$typeof===g||M.$$typeof===i||M.$$typeof===l||M.$$typeof===d||M.$$typeof===A||M.$$typeof===b||M.$$typeof===S||M.$$typeof===p)}function E(M){if(typeof M=="object"&&M!==null){var he=M.$$typeof;switch(he){case t:var Zt=M.type;switch(Zt){case h:case c:case r:case o:case n:case u:return Zt;default:var Ln=Zt&&Zt.$$typeof;switch(Ln){case l:case d:case f:case g:case i:return Ln;default:return he}}case a:return he}}}var w=h,U=c,L=l,z=i,Z=t,H=d,B=r,V=f,te=g,_=a,x=o,k=n,G=u,P=!1;function W(M){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),y(M)||E(M)===h}function y(M){return E(M)===c}function T(M){return E(M)===l}function O(M){return E(M)===i}function Q(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function j(M){return E(M)===d}function F(M){return E(M)===r}function Y(M){return E(M)===f}function K(M){return E(M)===g}function R(M){return E(M)===a}function ee(M){return E(M)===o}function J(M){return E(M)===n}function ne(M){return E(M)===u}ae.AsyncMode=w,ae.ConcurrentMode=U,ae.ContextConsumer=L,ae.ContextProvider=z,ae.Element=Z,ae.ForwardRef=H,ae.Fragment=B,ae.Lazy=V,ae.Memo=te,ae.Portal=_,ae.Profiler=x,ae.StrictMode=k,ae.Suspense=G,ae.isAsyncMode=W,ae.isConcurrentMode=y,ae.isContextConsumer=T,ae.isContextProvider=O,ae.isElement=Q,ae.isForwardRef=j,ae.isFragment=F,ae.isLazy=Y,ae.isMemo=K,ae.isPortal=R,ae.isProfiler=ee,ae.isStrictMode=J,ae.isSuspense=ne,ae.isValidElementType=N,ae.typeOf=E})()),ae}var fn;function Us(){return fn||(fn=1,process.env.NODE_ENV==="production"?Vt.exports=rd():Vt.exports=nd()),Vt.exports}var ks,gn;function od(){if(gn)return ks;gn=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function n(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var h=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(h.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ks=n()?Object.assign:function(o,i){for(var l,h=r(o),c,d=1;d<arguments.length;d++){l=Object(arguments[d]);for(var u in l)t.call(l,u)&&(h[u]=l[u]);if(e){c=e(l);for(var m=0;m<c.length;m++)a.call(l,c[m])&&(h[c[m]]=l[c[m]])}}return h},ks}var xs,pn;function Ls(){if(pn)return xs;pn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xs=e,xs}var Ps,An;function wn(){return An||(An=1,Ps=Function.call.bind(Object.prototype.hasOwnProperty)),Ps}var Bs,bn;function id(){if(bn)return Bs;bn=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ls(),a={},r=wn();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function n(o,i,l,h,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var u;try{if(typeof o[d]!="function"){var m=Error((h||"React class")+": "+l+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}u=o[d](i,d,h,l,null,t)}catch(f){u=f}if(u&&!(u instanceof Error)&&e((h||"React class")+": type specification of "+l+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=c?c():"";e("Failed "+l+" type: "+u.message+(g??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Bs=n,Bs}var Os,vn;function ld(){if(vn)return Os;vn=1;var e=Us(),t=od(),a=Ls(),r=wn(),n=id(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var h="Warning: "+l;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function i(){return null}return Os=function(l,h){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(y){var T=y&&(c&&y[c]||y[d]);if(typeof T=="function")return T}var m="<<anonymous>>",g={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:N,element:E(),elementType:w(),instanceOf:U,node:H(),objectOf:z,oneOf:L,oneOfType:Z,shape:V,exact:te};function f(y,T){return y===T?y!==0||1/y===1/T:y!==y&&T!==T}function p(y,T){this.message=y,this.data=T&&typeof T=="object"?T:{},this.stack=""}p.prototype=Error.prototype;function A(y){if(process.env.NODE_ENV!=="production")var T={},O=0;function Q(F,Y,K,R,ee,J,ne){if(R=R||m,J=J||K,ne!==a){if(h){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=R+":"+K;!T[he]&&O<3&&(o("You are manually calling a React.PropTypes validation function for the `"+J+"` prop on `"+R+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[he]=!0,O++)}}return Y[K]==null?F?Y[K]===null?new p("The "+ee+" `"+J+"` is marked as required "+("in `"+R+"`, but its value is `null`.")):new p("The "+ee+" `"+J+"` is marked as required in "+("`"+R+"`, but its value is `undefined`.")):null:y(Y,K,R,ee,J)}var j=Q.bind(null,!1);return j.isRequired=Q.bind(null,!0),j}function b(y){function T(O,Q,j,F,Y,K){var R=O[Q],ee=k(R);if(ee!==y){var J=G(R);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+J+"` supplied to `"+j+"`, expected ")+("`"+y+"`."),{expectedType:y})}return null}return A(T)}function S(){return A(i)}function N(y){function T(O,Q,j,F,Y){if(typeof y!="function")return new p("Property `"+Y+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var K=O[Q];if(!Array.isArray(K)){var R=k(K);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected an array."))}for(var ee=0;ee<K.length;ee++){var J=y(K,ee,j,F,Y+"["+ee+"]",a);if(J instanceof Error)return J}return null}return A(T)}function E(){function y(T,O,Q,j,F){var Y=T[O];if(!l(Y)){var K=k(Y);return new p("Invalid "+j+" `"+F+"` of type "+("`"+K+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return A(y)}function w(){function y(T,O,Q,j,F){var Y=T[O];if(!e.isValidElementType(Y)){var K=k(Y);return new p("Invalid "+j+" `"+F+"` of type "+("`"+K+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return A(y)}function U(y){function T(O,Q,j,F,Y){if(!(O[Q]instanceof y)){var K=y.name||m,R=W(O[Q]);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected ")+("instance of `"+K+"`."))}return null}return A(T)}function L(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function T(O,Q,j,F,Y){for(var K=O[Q],R=0;R<y.length;R++)if(f(K,y[R]))return null;var ee=JSON.stringify(y,function(ne,M){var he=G(M);return he==="symbol"?String(M):M});return new p("Invalid "+F+" `"+Y+"` of value `"+String(K)+"` "+("supplied to `"+j+"`, expected one of "+ee+"."))}return A(T)}function z(y){function T(O,Q,j,F,Y){if(typeof y!="function")return new p("Property `"+Y+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected an object."));for(var ee in K)if(r(K,ee)){var J=y(K,ee,j,F,Y+"."+ee,a);if(J instanceof Error)return J}return null}return A(T)}function Z(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var T=0;T<y.length;T++){var O=y[T];if(typeof O!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(O)+" at index "+T+"."),i}function Q(j,F,Y,K,R){for(var ee=[],J=0;J<y.length;J++){var ne=y[J],M=ne(j,F,Y,K,R,a);if(M==null)return null;M.data&&r(M.data,"expectedType")&&ee.push(M.data.expectedType)}var he=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new p("Invalid "+K+" `"+R+"` supplied to "+("`"+Y+"`"+he+"."))}return A(Q)}function H(){function y(T,O,Q,j,F){return _(T[O])?null:new p("Invalid "+j+" `"+F+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return A(y)}function B(y,T,O,Q,j){return new p((y||"React class")+": "+T+" type `"+O+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function V(y){function T(O,Q,j,F,Y){var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type `"+R+"` "+("supplied to `"+j+"`, expected `object`."));for(var ee in y){var J=y[ee];if(typeof J!="function")return B(j,F,Y,ee,G(J));var ne=J(K,ee,j,F,Y+"."+ee,a);if(ne)return ne}return null}return A(T)}function te(y){function T(O,Q,j,F,Y){var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type `"+R+"` "+("supplied to `"+j+"`, expected `object`."));var ee=t({},O[Q],y);for(var J in ee){var ne=y[J];if(r(y,J)&&typeof ne!="function")return B(j,F,Y,J,G(ne));if(!ne)return new p("Invalid "+F+" `"+Y+"` key `"+J+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(O[Q],null," ")+`
261
- Valid keys: `+JSON.stringify(Object.keys(y),null," "));var M=ne(K,J,j,F,Y+"."+J,a);if(M)return M}return null}return A(T)}function _(y){switch(typeof y){case"number":case"string":case"undefined":return!0;case"boolean":return!y;case"object":if(Array.isArray(y))return y.every(_);if(y===null||l(y))return!0;var T=u(y);if(T){var O=T.call(y),Q;if(T!==y.entries){for(;!(Q=O.next()).done;)if(!_(Q.value))return!1}else for(;!(Q=O.next()).done;){var j=Q.value;if(j&&!_(j[1]))return!1}}else return!1;return!0;default:return!1}}function x(y,T){return y==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function k(y){var T=typeof y;return Array.isArray(y)?"array":y instanceof RegExp?"object":x(T,y)?"symbol":T}function G(y){if(typeof y>"u"||y===null)return""+y;var T=k(y);if(T==="object"){if(y instanceof Date)return"date";if(y instanceof RegExp)return"regexp"}return T}function P(y){var T=G(y);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function W(y){return!y.constructor||!y.constructor.name?m:y.constructor.name}return g.checkPropTypes=n,g.resetWarningCache=n.resetWarningCache,g.PropTypes=g,g},Os}var Ms,yn;function cd(){if(yn)return Ms;yn=1;var e=Ls();function t(){}function a(){}return a.resetWarningCache=t,Ms=function(){function r(i,l,h,c,d,u){if(u!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function n(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:n,element:r,elementType:r,instanceOf:n,node:r,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:a,resetWarningCache:t};return o.PropTypes=o,o},Ms}var Cn;function dd(){if(Cn)return Ft.exports;if(Cn=1,process.env.NODE_ENV!=="production"){var e=Us(),t=!0;Ft.exports=ld()(e.isElement,t)}else Ft.exports=cd()();return Ft.exports}var hd=dd();const ge=Qe(hd);var ud=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qs.apply(this,arguments)}function md(e,t){if(e==null)return{};var a={},r=Object.keys(e),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=e[n]);return a}function zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ds(e,t)}function Ds(e,t){return Ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ds(e,t)}var Wt=(function(e){fd(t,e);function t(){var r;return r=e.call(this)||this,r.handleExpired=r.handleExpired.bind(zt(r)),r.handleErrored=r.handleErrored.bind(zt(r)),r.handleChange=r.handleChange.bind(zt(r)),r.handleRecaptchaRef=r.handleRecaptchaRef.bind(zt(r)),r}var a=t.prototype;return a.getCaptchaFunction=function(n){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[n]:this.props.grecaptcha[n]:null},a.getValue=function(){var n=this.getCaptchaFunction("getResponse");return n&&this._widgetId!==void 0?n(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var n=this.getCaptchaFunction("execute");if(n&&this._widgetId!==void 0)return n(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var n=this;return new Promise(function(o,i){n.executionResolve=o,n.executionReject=i,n.execute()})},a.reset=function(){var n=this.getCaptchaFunction("reset");n&&this._widgetId!==void 0&&n(this._widgetId)},a.forceReset=function(){var n=this.getCaptchaFunction("reset");n&&n()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(n){this.props.onChange&&this.props.onChange(n),this.executionResolve&&(this.executionResolve(n),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var n=this.getCaptchaFunction("render");if(n&&this._widgetId===void 0){var o=document.createElement("div");this._widgetId=n(o,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(o)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(n){this.captcha=n},a.render=function(){var n=this.props;n.sitekey,n.onChange,n.theme,n.type,n.tabindex,n.onExpired,n.onErrored,n.size,n.stoken,n.grecaptcha,n.badge,n.hl,n.isolated;var o=md(n,ud);return Js.createElement("div",qs({},o,{ref:this.handleRecaptchaRef}))},t})(Js.Component);Wt.displayName="ReCAPTCHA",Wt.propTypes={sitekey:ge.string.isRequired,onChange:ge.func,grecaptcha:ge.object,theme:ge.oneOf(["dark","light"]),type:ge.oneOf(["image","audio"]),tabindex:ge.number,onExpired:ge.func,onErrored:ge.func,size:ge.oneOf(["compact","normal","invisible"]),stoken:ge.string,hl:ge.string,badge:ge.oneOf(["bottomright","bottomleft","inline"]),isolated:ge.bool},Wt.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var _s,Nn;function gd(){if(Nn)return _s;Nn=1;var e=Us(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},n={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=n;function i(f){return e.isMemo(f)?n:o[f.$$typeof]||t}var l=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,m=Object.prototype;function g(f,p,A){if(typeof p!="string"){if(m){var b=u(p);b&&b!==m&&g(f,b,A)}var S=h(p);c&&(S=S.concat(c(p)));for(var N=i(f),E=i(p),w=0;w<S.length;++w){var U=S[w];if(!a[U]&&!(A&&A[U])&&!(E&&E[U])&&!(N&&N[U])){var L=d(p,U);try{l(f,U,L)}catch{}}}}return f}return _s=g,_s}var pd=gd();const Ad=Qe(pd);function Gs(){return Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Gs.apply(this,arguments)}function wd(e,t){if(e==null)return{};var a={},r=Object.keys(e),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=e[n]);return a}function bd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ve={},vd=0;function yd(e,t){return t=t||{},function(r){var n=r.displayName||r.name||"Component",o=(function(l){bd(h,l);function h(d,u){var m;return m=l.call(this,d,u)||this,m.state={},m.__scriptURL="",m}var c=h.prototype;return c.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+vd++),this.__scriptLoaderID},c.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},c.asyncScriptLoaderHandleLoad=function(u){var m=this;this.setState(u,function(){return m.props.asyncScriptOnLoad&&m.props.asyncScriptOnLoad(m.state)})},c.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=ve[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var m in u.observers)u.observers[m](u);delete window[t.callbackName]},c.componentDidMount=function(){var u=this,m=this.setupScriptURL(),g=this.asyncScriptLoaderGetScriptLoaderID(),f=t,p=f.globalName,A=f.callbackName,b=f.scriptId;if(p&&typeof window[p]<"u"&&(ve[m]={loaded:!0,observers:{}}),ve[m]){var S=ve[m];if(S&&(S.loaded||S.errored)){this.asyncScriptLoaderHandleLoad(S);return}S.observers[g]=function(L){return u.asyncScriptLoaderHandleLoad(L)};return}var N={};N[g]=function(L){return u.asyncScriptLoaderHandleLoad(L)},ve[m]={loaded:!1,observers:N};var E=document.createElement("script");E.src=m,E.async=!0;for(var w in t.attributes)E.setAttribute(w,t.attributes[w]);b&&(E.id=b);var U=function(z){if(ve[m]){var Z=ve[m],H=Z.observers;for(var B in H)z(H[B])&&delete H[B]}};A&&typeof window<"u"&&(window[A]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),E.onload=function(){var L=ve[m];L&&(L.loaded=!0,U(function(z){return A?!1:(z(L),!0)}))},E.onerror=function(){var L=ve[m];L&&(L.errored=!0,U(function(z){return z(L),!0}))},document.body.appendChild(E)},c.componentWillUnmount=function(){var u=this.__scriptURL;if(t.removeOnUnmount===!0)for(var m=document.getElementsByTagName("script"),g=0;g<m.length;g+=1)m[g].src.indexOf(u)>-1&&m[g].parentNode&&m[g].parentNode.removeChild(m[g]);var f=ve[u];f&&(delete f.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete ve[u])},c.render=function(){var u=t.globalName,m=this.props;m.asyncScriptOnLoad;var g=m.forwardedRef,f=wd(m,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(f[u]=typeof window[u]<"u"?window[u]:void 0),f.ref=g,I.createElement(r,f)},h})(I.Component),i=I.forwardRef(function(l,h){return I.createElement(o,Gs({},l,{forwardedRef:h}))});return i.displayName="AsyncScriptLoader("+n+")",i.propTypes={asyncScriptOnLoad:ge.func},Ad(i,r)}}var js="onloadcallback",Cd="grecaptcha";function Qs(){return typeof window<"u"&&window.recaptchaOptions||{}}function Nd(){var e=Qs(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+js+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+js+"&render=explicit"}const Sn=yd(Nd,{callbackName:js,globalName:Cd,attributes:Qs().nonce?{nonce:Qs().nonce}:{}})(Wt),Hs=()=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:"sass-pg-cmt-lp-spin",children:s.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"})}),Sd={reportAbuseTitle:"Reportar Abuso",errorAlreadyReported:"Ya has reportado este comentario.",errorReportComment:"Error al reportar comentario",cancelButton:"Cancelar",reportButton:"Reportar",reportSuccessMessage:"¡Gracias por reportar!",reportCloseButton:"Cerrar"},Ed=({isOpen:e,onClose:t,commentId:a,publication:r,username:n,CAPTCHA_KEY_V2:o,texts:i})=>{const l={...Sd,...i?.comentarios},h={...Qt,...l.reportReasons??{}},[c,d]=I.useState("form"),[u,m]=I.useState(""),[g,f]=I.useState(""),[p,A]=I.useState(""),b=[{id:"spam",label:h.spam},{id:"inappropriate",label:h.inappropriate},{id:"hate",label:h.hate},{id:"misinformation",label:h.misinformation},{id:"terrorism",label:h.terrorism},{id:"intellectual",label:h.intellectual},{id:"bullying",label:h.bullying}],S=async()=>{if(!(!u||!a)){if(hn(document).includes(a)){f(l.errorAlreadyReported);return}d("loading"),f("");try{const w=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:r,username:n,id:a,captchaToken:p,type:Qt[u]})})).json();if(w.type==="success")ad(document,a),d("success"),setTimeout(()=>{N()},3e3);else throw new Error(w.message||l.errorReportComment)}catch(E){console.error("Error reporting comment:",E),f(E.message||l.errorReportComment),d("form")}}},N=()=>{d("form"),m(""),f(""),t()};return!e||!a||!n?null:s.jsx("div",{className:"sass-pg-cmt-rp-overlay",children:s.jsxs("div",{className:"sass-pg-cmt-rp-popup",children:[s.jsx("button",{className:"close-reply-form su-flex su-absolute su-p-0 su-bg-transparent su-border-none",onClick:N,children:s.jsx(Ye,{})}),s.jsx("h2",{className:"sass-pg-cmt-rp-title",children:l.reportAbuseTitle}),c==="loading"&&s.jsx("div",{className:"sass-pg-cmt-rp-loadingContainer",children:s.jsx(Hs,{})}),c==="form"||c==="loading"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sass-pg-cmt-rp-optionsContainer",children:b.map(E=>s.jsxs("label",{className:"sass-pg-cmt-rp-option",children:[s.jsx("input",{type:"radio",name:"reportReason",value:E.id,checked:u===E.id,onChange:w=>m(w.target.value),className:"sass-pg-cmt-rp-radioInput"}),s.jsx("span",{className:"sass-pg-cmt-rp-radioCustom"}),s.jsx("span",{className:"sass-pg-cmt-rp-optionLabel",children:E.label})]},E.id))}),g&&s.jsx("div",{className:"sass-pg-cmt-rp-errorMessage",children:g}),s.jsx(Sn,{sitekey:o,theme:"light",size:"normal",onChange:E=>A(E??""),onExpired:()=>A("")}),s.jsxs("div",{className:"sass-pg-cmt-rp-buttons",children:[s.jsx("button",{onClick:N,className:"sass-pg-cmt-rp-cancelButton",children:l.cancelButton}),s.jsx("button",{onClick:S,disabled:!u,className:"sass-pg-cmt-rp-reportButton",children:l.reportButton})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"sass-pg-cmt-rp-successContainer",children:[s.jsx("div",{className:"sass-pg-cmt-rp-thumbsUp",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:s.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"})})}),s.jsx("p",{className:"sass-pg-cmt-rp-successMessage",children:l.reportSuccessMessage})]}),s.jsx("div",{className:"sass-pg-cmt-rp-buttons",children:s.jsx("button",{onClick:N,className:["sass-pg-cmt-rp-closeButton","sass-pg-cmt-rp-buttonAlone"].join(" "),children:l.reportCloseButton})})]})]})})};function Td(e){const t=/^\[\[([^\]]+)\]\]/,a=e.match(t);return a?{user:{username:a[1],firstname:a[1],lastname:""},text:e.replace("[["+a[1]+"]]","")}:{user:!1,text:e}}function Yt(e){const t=e.comments.map(a=>{if(a.user)return{...a,user:a.user,text:a.text,reply:a.reply?Yt({comments:a.reply}).comments:a.reply};const{user:r,text:n}=Td(a.text);return{...a,user:r||!1,text:n,reply:a.reply?Yt({comments:a.reply}).comments:a.reply}});return{...e,comments:t}}async function Kt({publication:e,path:t,size:a=5,sizereply:r=2,id:n,lastid:o,state:i="5,6",apiToken:l,API_ENV:h}){const{PUBLIC_ENV:c}=h;if(c==="prod"){const d=await En({publication:e,path:t,size:a,sizereply:r,id:n,lastid:o,state:i,apiToken:l,API_ENV:h});return Yt(d[0])}else{const d=await fetch(`/api/comments-get?publication=${e}&path=${t}&size=${a}&sizereply=${r}&lastid=${o}`);if(!d.ok)throw new Error(`Error al obtener comentarios: ${d.status}`);const u=await d.json();return Yt(u.data[0])}}async function En({publication:e,path:t,size:a=5,sizereply:r=2,id:n,lastid:o,state:i="5,6",apiToken:l,API_ENV:h}){if(!e||!t)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof t!="string")throw new Error("Invalid input types for publication or path");if(!l)throw new Error("Missing CMS API token");const{PUBLIC_ENV:c,PUBLIC_API_HOST:d="dummy",PUBLIC_API_PATH:u,PUBLIC_API_PATH_VERSION:m}=h,g=parseInt(String(a),10),f=parseInt(String(r),10);if(isNaN(g)||g<=0)throw new Error("Invalid size parameter");if(isNaN(f)||f<0)throw new Error("Invalid sizereply parameter");const p=c!=="prod"?`${d}${u}`:"",A=new URLSearchParams({publication:e,path:t,size:g.toString(),sizereply:f.toString(),state:i});n&&A.append("id",n),o&&A.append("lastid",o);const b=`${p}${m}/newcomments/get?${A.toString()}`;try{const{data:S}=await re.get(b,{headers:{"x-api-token":l,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!S)throw new Error("No comments data received");return S.data||S||[]}catch(S){if(console.error("Error fetching comments:",S),re.isAxiosError(S)){const N=S.response?.status,E=S.response?.data;throw N===404?new Error("Comments not found"):N===403?new Error("Access forbidden - check API token"):N===401?new Error("Unauthorized - invalid API token"):N===500?new Error("Internal server error from CMS"):new Error(E?.error||E?.message||`HTTP ${N}: Failed to fetch comments`)}throw S}}const Id=(e,t)=>{const[a,r]=I.useState(void 0),{PUBLIC_PUBLICATION_ID:n}=t,o=n;return I.useEffect(()=>{if(a)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:l}=t;try{const h=await Kt({publication:o,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:l,API_ENV:t});r(h??[])}catch{r({comments:[],morecomment:!1})}})()},[a]),{comments:a,setComments:r}},Tn=({username:e,date:t,DATE_CONFIG:a})=>s.jsxs("div",{className:"comment-header su-flex su-items-center su-relative su-flex-wrap",children:[s.jsx("span",{className:"comment-username su-font-bold su-truncate",children:e}),s.jsx("span",{className:"comment-header-dot",children:"•"}),s.jsx("span",{className:"comment-date su-truncate",children:sd(ye(Number(t),a))})]}),In=({user:e})=>s.jsx("div",{className:"comment-avatar su-flex-center su-rounded-full su-font-bold su-overflow-hidden",children:e.picture?s.jsx("img",{className:"comment-avatar-img su-h-full",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),Un=({isReply:e=!1,onReply:t,onFlag:a})=>s.jsxs("div",{className:"comment-actions su-flex",children:[!e&&t&&s.jsx("button",{onClick:t,className:"comment-action-btn su-flex su-items-center su-gap-1 su-bg-transparent su-border-none",children:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[s.jsx("g",{clipPath:"url(#a)",children:s.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"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),s.jsx("button",{onClick:a,className:"comment-action-btn su-flex su-items-center su-gap-1 su-bg-transparent su-border-none",children:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[s.jsx("g",{clipPath:"url(#a)",children:s.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"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Fs=({commentRef:e,captchaToken:t="",setIsDisabled:a,API_ENV:r})=>(I.useEffect(()=>{const n=e.current;if(!n)return;const o=()=>{const l=n.value.length;n.parentElement&&(n.parentElement.dataset.text=`${l}/${Te}`),n.classList.toggle("over-limit",l>Te),a(!Ht(e,t,r).boolean)};return n.addEventListener("input",o),o(),()=>n.removeEventListener("input",o)},[e,t,a]),s.jsxs("div",{className:"su-relative",children:[s.jsx("label",{className:"su-block su-font-normal comment-input-label",children:"Comentario"}),s.jsx("textarea",{className:"su-w-full su-border-none su-outline-none",ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),Vs=({commentRef:e,captchaToken:t="",setCaptchaToken:a,children:r,API_ENV:n})=>{const o=Ht(e,t,n);return s.jsxs("div",{className:"form-actions su-flex-between",children:[s.jsx(Sn,{sitekey:n.CAPTCHA_KEY_V2??"",theme:"light",size:"normal",onChange:i=>a(i??""),onExpired:()=>a("")}),s.jsxs("div",{className:"submit-zone su-relative su-flex su-flex-col su-items-end",children:[r,!o.boolean&&s.jsx("p",{className:"submit-warning su-hidden su-font-normal su-p-0",children:o.text})]})]})},Ud={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con GOOGLE",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function kd({onClose:e,handleGoogleLogin:t,icon:a,texts:r,API_ENV:n}){const o={...Ud,...r?.comentarios},i=m=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`,window.location.pathname="/auth/login"+(m?"#forgot":""))},l=()=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`,window.location.pathname="/auth/register")},{S3_ID_DIR:h="",PUBLIC_ENV:c,PUBLIC_ASSETS_URL:d}=n,u=c=="local"?"":d&&d!=="false"?d:"";return s.jsx("div",{className:"sass-pg-cmt-lp-overlay",role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:m=>{const g=m.target;g&&g.id==="pop-overlay"&&e()},children:s.jsxs("div",{className:"sass-pg-cmt-lp-card",children:[s.jsxs("header",{className:"sass-pg-cmt-lp-header",children:[s.jsx("div",{className:"sass-pg-cmt-lp-logo",children:a?a():null}),s.jsx("button",{onClick:()=>{e()},className:"sass-pg-cmt-lp-close","aria-label":"Cerrar",children:s.jsx(Ye,{})})]}),s.jsxs("div",{className:"sass-pg-cmt-lp-anonimusWrapper",children:[s.jsx("img",{className:"sass-pg-cmt-lp-anonimusImage",src:u+(u!==""?"/arte/"+h:"")+"/anonimus-img.png",alt:"Imagen incognito"}),s.jsx("button",{onClick:()=>{e(!0)},className:"sass-pg-cmt-lp-anonimus",children:s.jsx("span",{children:"Continuar de forma anónima"})})]}),s.jsx("div",{className:"sass-pg-cmt-lp-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("button",{onClick:t,className:"sass-pg-cmt-lp-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-cmt-lp-googleIcon"}),s.jsx("span",{children:o.GoogleButtonText})]}),s.jsx("button",{type:"submit",className:"sass-pg-cmt-lp-primary",onClick:()=>{i(!1)},children:o.loginButtonText}),s.jsxs("p",{className:"sass-pg-cmt-lp-switch",children:[o.noAccountText,s.jsx("button",{type:"button",onClick:l,children:o.registerButtonText})]}),s.jsx("button",{type:"button",className:"sass-pg-cmt-lp-forgotPassword",onClick:()=>{i(!0)},children:o.forgotPasswordText})]})})}const zs=({onClick:e,isDisabled:t,API_ENV:a,icon:r,handleGoogleLogin:n,showAlert:o})=>{const[i,l]=I.useState(!1),{S3_ID_DIR:h="",PUBLIC_ENV:c,PUBLIC_API_HOST:d="",PUBLIC_ASSETS_URL:u}=a,[m,g]=I.useState(!1),[f,p]=I.useState(!1);I.useEffect(()=>{let b=null;return i&&(b=setTimeout(()=>{l(!1)},2400)),()=>{b&&clearTimeout(b)}},[i]);const A=c=="local"?d:u&&u!=="false"?u:"";return i?s.jsx("div",{className:"success-gif-container su-flex-center su-relative",children:s.jsx("img",{className:"success-gif su-absolute",src:A+"/arte/"+h+"/Success.gif"})}):s.jsxs(s.Fragment,{children:[f&&a.CONFIG_commentsV2&&o&&s.jsx(kd,{API_ENV:a,icon:r,handleGoogleLogin:n,onClose:b=>{b&&g(!0),p(!1)}}),s.jsxs("button",{type:"button",onClick:async b=>{if(!m&&a.CONFIG_commentsV2&&o){p(!0),console.log("open popup");return}await e(b)&&(a.CONFIG_commentsV2&&o&&g(!1),l(!0))},id:"comment-button",className:`submit-btn su-bg-transparent su-font-bold ${t?"disabled":"active"}`,children:["Enviar Comentario",s.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.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"})})]})]})},Ws=async({path:e,ref:t,captchaToken:a,button:r,user:n,id:o,addComment:i,API_ENV:l,anonimusUser:h})=>{const c=t.current?.value||"",{PUBLIC_PUBLICATION_ID:d}=l,u=d;if(console.log("check",n,h),!Ht(t,a,l).boolean||!n&&!h){console.log("warn");const g=r.nextElementSibling;return g&&(g.style.display="block"),!1}if(!n&&!h)return;const m=n?c:"[["+h+"]] "+c;try{const g=Date.now(),f=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:u,path:e,id:o,username:n?n.username:!1,comment:m,recaptchaResponse:a})});let p=null;try{p=await f.json()}catch(E){console.error("Error parsing JSON response:",E)}if(!f.ok)throw new Error(`Error al enviar comentario: ${p?.message} status: ${f.status}`);const A=Date.now(),b=Math.max(0,2400+Math.abs(A-g)),S=n||{username:h,firstname:h},N={username:S.username,firstname:S.firstname,...S.lastname&&{lastname:S.lastname},...S.picture&&{picture:S.picture}};return i({id:A.toString(),text:c,user:N,date:{time:Date.now()},reply:[]}),t.current&&(t.current.value=""),b}catch(g){return console.error("Error enviando comentario:",g),alert(g.message||"Error al enviar el comentario."),!1}},xd=({replyingTo:e,commentRef:t,user:a,path:r,addReply:n,closeForm:o,API_ENV:i})=>{const[l,h]=I.useState(!0),[c,d]=I.useState(""),u=()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0),o()};return s.jsxs("div",{className:"comment-form reply-form su-p-8 su-relative",children:[s.jsx("button",{className:"close-reply-form su-flex su-absolute su-p-0 su-bg-transparent su-border-none",onClick:u,children:s.jsx(Ye,{})}),s.jsx(Fs,{commentRef:t,captchaToken:c,setIsDisabled:h,API_ENV:i}),s.jsx(Vs,{commentRef:t,captchaToken:c,setCaptchaToken:d,API_ENV:i,children:s.jsx(zs,{onClick:async m=>{if(l)return;const g=await Ws({path:r,ref:t,captchaToken:c,button:m.currentTarget,user:a,id:e,addComment:n,API_ENV:i});return g&&typeof g=="number"?(setTimeout(()=>{u()},g),!0):!1},isDisabled:l,API_ENV:i})})]})},Ld=({reply:e,replyingTo:t,user:a,onFlag:r,DATE_CONFIG:n})=>{const o=e.text;let i=`${Ie.firstname} ${Ie.lastname??""}`,l=Ie.username;return e.user&&(i=`${e.user.firstname} ${e.user.lastname??""}`,l=e.user.username),s.jsx("div",{className:"comment-item reply",children:s.jsxs("div",{className:"comment-header-container su-flex su-relative",children:[s.jsx(In,{user:e.user?e.user:Ie}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Tn,{username:i,date:e.date.time,DATE_CONFIG:n}),s.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",s.jsx("strong",{children:t})]}),s.jsx("p",{className:"comment-text su-font-normal",children:o}),a?.username.toLowerCase()!==l.toLowerCase()&&s.jsx(Un,{isReply:!0,onFlag:()=>r(e.id)})]})]})})},Pd={moreRepliesButton:"Más Respuestas"},Bd=({comment:e,replyingTo:t,path:a,user:r,handleReplyingTo:n,onFlag:o,API_ENV:i,texts:l})=>{const h={...Pd,...l?.comentarios},c={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[d,u]=I.useState(c),[m,g]=I.useState(!1),{PUBLIC_PUBLICATION_ID:f,PUBLIC_X_SECURITY_TOKEN:p}=i,A=e.text,b=I.useRef(null);let S=`${Ie.firstname} ${Ie.lastname??""}`,N=Ie.username;e.user&&(S=`${e.user.firstname} ${e.user.lastname??""}`,N=e.user.username);const E=w=>{u({morereply:d.morereply,reply:[w,...d.reply]})};return s.jsx("div",{className:"comment-item",children:s.jsxs("div",{className:"comment-header-container su-flex su-relative","data-hasreplies":d.reply.length>0?"true":"false",children:[s.jsx(In,{user:e.user?e.user:Ie}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Tn,{username:S,date:e.date.time,DATE_CONFIG:i}),s.jsx("p",{className:"comment-text su-font-normal",children:A}),r?.username.toLowerCase()!==N.toLowerCase()&&s.jsx(Un,{onReply:()=>n(e.id),onFlag:()=>o(e.id)}),t===e.id&&r&&s.jsx(xd,{replyingTo:t,commentRef:b,addReply:E,user:r,path:a,API_ENV:i,closeForm:()=>n("")}),d.reply.length>0&&s.jsxs("div",{className:"comment-replies",children:[d.reply.map(w=>s.jsx(Ld,{user:r,reply:w,replyingTo:S,onFlag:o,DATE_CONFIG:i},w.id)),m?s.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:s.jsx(Hs,{})}):d.morereply&&s.jsx("button",{className:"comment-replies-button reply-button su-flex-center su-rounded-full su-border-none su-relative",onClick:async()=>{const w=d.reply[d.reply.length-1]?.id;g(!0);try{const L=await Kt({publication:f??"",path:a??"",size:2,sizereply:2,id:e.id,lastid:w,state:"5,6",apiToken:p??"",API_ENV:i});g(!1),u({morereply:L.morecomment,reply:[...d.reply,...L.comments]})}catch(U){throw g(!1),new Error(`Error al obtener comentarios: ${U}`)}},children:h.moreRepliesButton})]})]})]})})},Od=({commentRef:e,user:t,path:a,addComment:r,API_ENV:n})=>{const[o,i]=I.useState(!0),[l,h]=I.useState("");return s.jsxs("div",{className:"comment-form su-p-8 su-relative",children:[s.jsx(Fs,{commentRef:e,captchaToken:l,setIsDisabled:i,API_ENV:n}),s.jsx(Vs,{API_ENV:n,commentRef:e,captchaToken:l,setCaptchaToken:h,children:s.jsx(zs,{onClick:async c=>{if(o)return;const d=await Ws({path:a,ref:e,captchaToken:l,button:c.currentTarget,user:t,addComment:r,API_ENV:n});return d&&typeof d=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${Te}`),i(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${Te}`),i(!0)},d),!0):!1},isDisabled:o,API_ENV:n})})]})},Md=({usernameRef:e})=>s.jsxs("div",{className:"comment-username su-font-bold su-truncate",children:[s.jsx("label",{className:"su-block su-font-normal comment-input-label",children:"Nombre"}),s.jsx("input",{ref:e,name:"username",className:"su-w-full su-border-none su-outline-none",placeholder:"Ingresa tu nombre"})]}),qd=({usernameRef:e,commentRef:t,path:a,icon:r,handleGoogleLogin:n,addComment:o,API_ENV:i})=>{const[l,h]=I.useState(!0),[c,d]=I.useState(""),u=async m=>{if(l){console.log("error");return}if(!Ht(t,c,i).boolean){console.log("invalidForm");return}const g=e.current.value,f=await Ws({path:a,ref:t,captchaToken:c,button:m.currentTarget,user:void 0,addComment:o,API_ENV:i,anonimusUser:g});return d(""),f&&typeof f=="number"?(t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0),setTimeout(()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0)},f),!0):!1};return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"comment-form anoninus-form su-p-8 su-relative",children:[s.jsx(Md,{usernameRef:e}),s.jsx(Fs,{commentRef:t,captchaToken:c,setIsDisabled:h,API_ENV:i}),s.jsx(Vs,{API_ENV:i,commentRef:t,captchaToken:c,setCaptchaToken:d,children:s.jsx(zs,{onClick:u,isDisabled:l,API_ENV:i,handleGoogleLogin:n,icon:r,showAlert:!0})})]})})},Dd={commentsSectionTitle:"COMENTARIOS",commentHeaderMessageEmpty:"Se el primero en compartir tu opinión de este artículo.",commentHeaderMessageWithComments:"Comparte tu opinión de este artículo.",loadMoreButton:"Más",moreRepliesButton:"Más Respuestas"},_d=({isAuthenticated:e,path:t,user:a,handleLogout:r,icon:n,handleGoogleLogin:o,API_ENV:i,texts:l})=>{const h={...Dd,...l?.comentarios},{PUBLIC_PUBLICATION_ID:c,PUBLIC_X_SECURITY_TOKEN:d}=i,u=c??"",m=t.replaceAll("/","|"),[g,f]=I.useState(void 0),[p,A]=I.useState(""),{comments:b,setComments:S}=Id(m,i),[N,E]=I.useState(!1),w=I.useRef(null),U=I.useRef(null),L=x=>{A(p===x?"":x)},z=x=>{S(b?{...b,comments:[x,...b.comments??[]]}:void 0)},Z=x=>{f(x)},H=async()=>{if(!b||!b.morecomment||b.comments.length===0)return;const x=b.comments[b.comments.length-1];if(!x)return;E(!0);const k=x.id;try{const G=await Kt({publication:u,path:m??"",size:5,sizereply:2,id:void 0,lastid:k,state:"5,6",apiToken:d,API_ENV:i});S({morecomment:G.morecomment??!1,comments:[...b.comments,...G.comments]}),E(!1)}catch(G){throw E(!1),new Error(`Error al obtener comentarios: ${G}`)}},B=b?.comments&&b.comments.length>0,V=B?h.commentHeaderMessageWithComments:h.commentHeaderMessageEmpty,te=s.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:s.jsx(Hs,{})}),_=()=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=300`,window.location.pathname="/auth/login")};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"comments-container",children:s.jsx(de,{title:i.CONFIG_commentsV2||B||e?h.commentsSectionTitle:!1,children:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"comments-header",children:e&&a?s.jsxs(s.Fragment,{children:[s.jsx(Rc,{user:a,handleLogout:r,message:V}),s.jsx(Od,{commentRef:w,user:a,addComment:z,path:m,API_ENV:i})]}):i.CONFIG_commentsV2?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"anonimus-message",children:["¿Querés debatir con otros lectores? Comentá ahora de forma anónima o ",s.jsx("button",{className:"su-border-none su-p-0",onClick:_,children:"INICIA SESIÓN AQUÍ"})," para responder a otros usuarios y ser parte activa de nuestra comunidad."]}),s.jsx(qd,{usernameRef:U,commentRef:w,icon:n,handleGoogleLogin:o,addComment:z,path:m,API_ENV:i})]}):null}),b?b.comments&&b.comments.length>0?s.jsxs("div",{className:"comments-list","data-isauthenticated":`${e}`,children:[b.comments.map(x=>s.jsx(Bd,{comment:x,replyingTo:p,handleReplyingTo:L,onFlag:Z,user:a??Ie,path:m,API_ENV:i,texts:l},x.id)),N&&te]}):null:te,b?.morecomment&&!N&&s.jsx("button",{className:"comment-replies-button su-flex-center su-rounded-full",onClick:H,children:h.loadMoreButton})]})})}),s.jsx(Ed,{username:a?.username??void 0,publication:u,commentId:g,isOpen:g!==void 0,onClose:()=>f(void 0),CAPTCHA_KEY_V2:i.CAPTCHA_KEY_V2??"",texts:l})]})};function Gd({isAuthenticated:e,setIsAuthenticated:t,loginUrl:a,user:r,path:n,checkAuth:o,icon:i,API_ENV:l,texts:h}){const c=async()=>{if(l.PUBLIC_ENV==="local")await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),t(!1);else{const u=window.location.pathname;window.location.href=`${window.location.origin}/api/auth/logout?redirect=${encodeURIComponent(u)}`}},d=async()=>{if(l.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),o();return}if(!a)return;const u=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${u}`};return s.jsx(s.Fragment,{children:s.jsx(_d,{isAuthenticated:e,handleLogout:c,handleGoogleLogin:d,icon:i,path:n,user:e?r:void 0,API_ENV:l,texts:h})})}function jd({isVisible:e,path:t,icon:a,API_ENV:r,texts:n}){const[o,i]=I.useState(null),[l,h]=I.useState(null),c=r?.COGNITO_AUTH_PREFIX??"ASTRO_",d=I.useCallback(async()=>{if(e){if(document.cookie.search(c+"IS_AUTH=true")===-1){i(!1),h(null);return}try{const p=await(await fetch("/api/auth/user",{credentials:"include"})).json();i(p.isAuthenticated??!1),h(p.user??null)}catch(f){console.error("Error checking auth:",f),i(!1),h(null)}}},[e,c]);I.useEffect(()=>{d()},[d,e]),I.useEffect(()=>{if(!l||!e||typeof window>"u")return;const f=window;if(typeof f!="function"){console.warn("gtag no está disponible todavía");return}f.gtag("set",{user_id:l.username}),console.log("username setted successfully")},[l,e]);const u="/api/auth/login",m=s.jsx("div",{className:"su-flex-center su-relative",style:{minHeight:310}});if(o===null)return m;const g=t.replaceAll("|","/");return e?s.jsx(Gd,{icon:a,isAuthenticated:o,setIsAuthenticated:i,loginUrl:u,user:l??void 0,checkAuth:d,path:g,API_ENV:r,texts:n}):m}const Qd=({internalPath:e,icon:t,API_ENV:a,texts:r})=>(I.useEffect(()=>{if(!document)return;if(document.getElementById("recaptcha-enterprise-script"))return console.log("recaptcha already appended");const o=document.createElement("script");o.id="recaptcha-enterprise-script",o.defer=!0,o.async=!0,o.src=`https://www.google.com/recaptcha/enterprise.js?render=${a.CAPTCHA_KEY}`,document.body.appendChild(o),console.log("appended recaptcha")},[]),s.jsx("div",{suppressHydrationWarning:!0,children:s.jsx(jd,{path:e,icon:t,isVisible:!0,API_ENV:as(a),texts:r})})),Hd=({section:e,internalPath:t,stylesConfig:a,paths:r,API_ENV:n,fetchConfig:o})=>s.jsx("div",{suppressHydrationWarning:!0,style:a["Modulo 1x3 Client"]??a["Modulo 1x3"],children:s.jsx($c,{section:e,internalPath:t,stylesConfig:a,isVisible:!0,paths:r,fetchConfig:o,API_ENV:as(n)})});async function Fd({publication:e,path:t,username:a,comment:r,id:n,recaptchaResponse:o,baseUrl:i,apiToken:l,securityToken:h,COMMENTS_VARS:c}){if(console.log("Adding comment with data:",{publication:e,path:t,username:a,comment:r,id:n,recaptchaResponse:o}),!e||!t||!r)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,t,r].some(f=>typeof f!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!r.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const d=await dn(o,c);if(console.log("Verifying captcha token...",d),!d)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const u=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,m={publication:e,path:t.replace(/\|/gi,"/"),text:r.trim()};a&&(m.username=a),n&&(m.id=n);const g=new URLSearchParams(m);try{const{data:f}=await re.get(`${u}?${g.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":h,"x-api-token":l,"User-Agent":"amplifyapp-comments-saas"}});return!f||f.error?(console.error("CMS error response:",f),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",f),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(f){if(console.error("Error enviando comentario:",f),re.isAxiosError(f)){const p=f.response?.status??500,A=f.response?.data;return p===400?{type:"error",message:A?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:p===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:p===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:A?.message||"No se pudo enviar el comentario.",status:p}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const Ys=async(e,t)=>{if(!e)throw new Error("No action provided");if(!t)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((r,n)=>{a.enterprise.ready(async()=>{try{const o=await a.enterprise.execute(t,{action:e});if(!o)throw new Error("Captcha token no generado");r(o)}catch(o){n(o)}})})},Vd=async({token:e,projectId:t,captchaKey:a,apiKey:r,captchaAction:n})=>{if(!e)throw new Error("No token provided");if(!t||!a||!r)throw new Error("Missing project ID or site key");if(!n)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${t}/assessments?key=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:n}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==n)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(o){throw console.error("Recaptcha verification failed",o),new Error(String(o))}},zd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,cardWidth:200,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return s.jsx(ot,{...l,titleGradient:!0,paths:e.paths},i)})})})},Wd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,cardWidth:343,cardGap:32,visibleItems:3,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return s.jsx(ot,{...l,titleGradient:!0,paths:e.paths},i)})})})},Yd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return I.createElement(ot,{...l,key:i,titleGradient:!0,paths:e.paths})})})})},Jt=e=>{const t={};for(const a in e)a.startsWith("--")&&(t[a]=e[a]);return t},Kd=e=>{const{content:t,title:a,isVideo:r}=e;if(!t||t.length===0)return;const n=t[0],o=t.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return n&&o&&s.jsxs(de,{title:a,titleUrl:e.titleUrl,children:[s.jsx("div",{className:"sass-bd-dnfw-headerSection",children:s.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:"sass-bd-dnfw-image",href:n?.info?.link?.url,target:n?.info?.link?.target,children:[s.jsxs("div",{className:"sass-bd-dnfw-blockHeadContainer",children:[s.jsx("p",{className:"sass-bd-dnfw-title",children:n?.main?.title.home}),n?.main?.subtitle?.rendered&&s.jsx("p",{className:"sass-bd-dnfw-subtitle",children:n?.main?.subtitle?.striped})]}),s.jsx(we,{preview:n.preview})]})}),s.jsxs("div",{className:"sass-bd-dnfw-containerCards",children:[s.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),s.jsx("div",{className:"sass-bd-dnfw-newsContent",children:Array.isArray(o)&&o.map((l,h)=>{const c={...l,main:{...l.main,title:{...l.main.title,section:i?l.main.title.home:l.main.title.section}}};return s.jsx("div",{style:{order:h},children:s.jsx(Se,{...c,isVideo:r,paths:e.paths})},h)})})]})]})},Jd=({printEdition:e,title:t})=>e&&s.jsx(de,{title:t,children:s.jsx("div",{className:"iframe-container",dangerouslySetInnerHTML:{__html:e||""}})}),kn={banner:e=>s.jsx(le,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>s.jsx(xt,{...e}),"Modulo 1x3":e=>s.jsx(Ts,{...e}),"Modulo 1x4":e=>s.jsx(Yr,{...e}),"Modulo 1x5":e=>s.jsx(Kr,{...e}),"Destacado noticias":e=>s.jsx(zr,{...e}),"Destacado full width":e=>s.jsx(Kd,{...e}),"Destacado videos":e=>s.jsx(Jr,{...e}),"Carrusel card":e=>s.jsx(Zr,{...e}),"Carrusel story":e=>s.jsx(zd,{...e}),"Carrusel owl":e=>s.jsx(Wd,{...e}),"Modulo fotogaleria":e=>s.jsx(Yd,{...e}),"Carrusel opinion":e=>s.jsx(Xr,{...e}),"Modulo 1x3 card":e=>s.jsx($r,{...e}),"Modulo iframe":e=>s.jsx(Jd,{...e})};function Ks({component:e,slot_id:t,data:a,banners:r}){if(r)return kn[e]&&s.jsx("div",{className:"home-slot",style:Jt(a),children:kn[e]({...a,banners:r,slot_id:t})})}function $d({children:e,stylesConfigEntry:t}){return s.jsx("div",{className:"home-slot",style:Jt(t),children:e})}const xn={Diario:e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return s.jsx(Fr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:t,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths,textPosition:e.textPosition})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return s.jsx(Fr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:t,banners:e.banners,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>s.jsx(Ke,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>s.jsx(Vl,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>s.jsx(Fl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},$t=({component:e,data:t,banners:a,rightOnlyBanner:r})=>s.jsx("div",{style:Jt(t),children:xn[e]&&xn[e]({...t,rightOnlyBanner:r,banners:a})}),Zd=({slots:e,DYNAMIC_SLOT_SUBINDEXES:t,stylesConfig:a,AutorIcon:r,config:n,banners:o,showTagBySection:i})=>{const l=[],c=t,d=Object.keys(e).length/c;for(let u=1;u<=d;u++)for(let m=1;m<=c;m++){const g="Home_"+u+"_"+m;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||(e[g].blockSass[0]?.block==="Modulo iframe"?l.push(s.jsxs(ps,{id:e[g].blockSass[0].key,show:!!e[g].blockSass[0].value,order:(u-1)*c+(m-1),children:[s.jsx(Ks,{component:e[g].blockSass[0].block,banners:o,slot_id:g,data:{printEdition:e[g]?.blockSass[0].value,title:e[g]?.blockSass[0].title??"",titleUrl:e[g].blockSass[0].link??void 0}}),s.jsx(We,{children:s.jsx(De,{banners:o,index:"dynamic_"+u+"_"+m})})]},u+"_"+m)):l.push(s.jsxs(ps,{id:e[g].blockSass[0].key,show:!!e[g].content?.data,order:(u-1)*c+(m-1),children:[s.jsx(Ks,{component:e[g].blockSass[0].block,banners:o,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:s.jsx(r,{}),paths:n.paths,showTagBySection:i}}),s.jsx(We,{children:s.jsx(De,{banners:o,index:"dynamic_"+u+"_"+m})})]},u+"_"+m)))}return l},Xd=({mainBlock:e,StylesConfigMain:t,config:a,banners:r})=>{const{PUBLIC_ENV:n}=D();if(n!=="local")return null;const o=e?.news?.data||[],i=(l,h)=>({...e?.news,...t[l],data:o.slice(0,h),paths:a.paths});return s.jsxs(s.Fragment,{children:[s.jsx($t,{component:"Super",data:i("Super",1),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})}),s.jsx($t,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})}),s.jsx($t,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})})]})};v.AssetsPreconnect=Aa,v.AutorComponent=Mc,v.AutorHeader1=Mr,v.AutorHeader2=qr,v.BannerAdvertising=le,v.BannerAdvertisingMiddle=De,v.CarrouselCSR=ll,v.CarrouselIRS=qe,v.CarruselCard=Zr,v.CarruselOpinion=Xr,v.CommentLazyLoader=Qd,v.CommonServices=ke,v.Comscore=$s,v.ContactInfoServer=Rl,v.ContactInput=Ll,v.ContactSelect=Pl,v.ContactTextarea=Bl,v.ContentLayout1=kt,v.ContentLayoutTema=Ns,v.DEBUG_MainSlots=Xd,v.DestacadoNoticias=zr,v.DestacadoVideos=Jr,v.DynamicBlockServices=gr,v.DynamicComponents=Zd,v.DynamicMainSlot=$t,v.DynamicSlot=Ks,v.EditorialBlock=Yl,v.ErrorComponent=xl,v.Font=Ia,v.Footer=Il,v.FormatAfterScripts=pa,v.FormatScripts=es,v.GA4=Zs,v.GTM=Xs,v.GalleryHeader=rn,v.GenerateBody=rl,v.GenerateHead=al,v.Header=Ql,v.HeaderSectionComponent=sn,v.IframeHeader=tn,v.ImageOffline=yr,v.ImageOnline=we,v.ImageOnlineClient=vr,v.IssuuServices=Zi,v.ItemListSchema=Ca,v.JournalistArticule2=Qr,v.JournalistGroup=Hr,v.LayoutNewsComponent=Ss,v.LinkComponent=q,v.LiveBlogHeader=Pr,v.Location=ol,v.LoginForm=jc,v.MainComponentServices=Io,v.Marfeel=Rs,v.MasNoticiasLazyLoader=Hd,v.MiddleSection=We,v.Modulo1x3=Ts,v.Modulo1x3Card=$r,v.Modulo1x4=Yr,v.Modulo1x5=Kr,v.Modulo2Columnas=Kl,v.Modulo3Columnas=Wr,v.ModuloNewsletter=Jl,v.ModuloOpinion=Wl,v.NewListResponseDataPH=cn,v.NewsArticle=Na,v.NewsComponent=Pc,v.NewsContent=Mt,v.NewsDescriptionComponent=_e,v.News_Content=on,v.NextPrev=nt,v.OrgList=Sa,v.PreloadImages=ss,v.REPORT_REASONS=Qt,v.ReCaptchaRender=qn,v.Readest=xt,v.RegisterForm=_c,v.ScriptHydrator=Wc,v.SearchSection=Oc,v.Section=de,v.SectionCard=Se,v.SectionCard2=ot,v.SectionCardServerComponent=jt,v.SectionServerComponent=Xl,v.ShowSection=ps,v.SocialNetworks=Is,v.SpeculationRules=ya,v.Spin=Je,v.StaticSlotWrapper=$d,v.SubscribeColumn=Sr,v.SubscribeRow=Er,v.SubscribeWhatsAppColumn=wl,v.TagHeader=Hl,v.TagSection=jr,v.TimeLine=Br,v.TrimPathname=ho,v.TwitterHydration=Yc,v.VideoBlock3=kl,v.VideoBlock4=ql,v.VideoEmbeddedHeader=Rr,v.VideoYoutubeHeader=en,v.VideosSchemas=Ta,v.WebsiteList=Ea,v.addComment=Fd,v.bannersReplace=pt,v.becomeVideoObject=He,v.buildTagUrl=Ue,v.coloringByStrokeSVGs=Tl,v.compileStyleProps=Jt,v.createAssessment=wo,v.cutString=Ce,v.decodeApiEnv=as,v.encodeApiEnv=yo,v.extractMainSlug=Ae,v.extractRealtedNews=ao,v.extractRelatedNews=gt,v.formatDate=ye,v.formatDateEdiciones=Rn,v.formatDateJournalistArticule=ft,v.formatDateTimeline=oa,v.formatNewsMeta=ha,v.formatVideoData=wa,v.generalGetData=el,v.getCaptchaToken=Ys,v.getComments=En,v.getConfig=D,v.getDynamicSlots=Xi,v.getEnvironmentUrl=$e,v.getEnvironmentUrlFront=ro,v.getHydratorPath=go,v.getImageUrl=ie,v.getNextMeta=Ze,v.getPage=Re,v.getPlayIcon=vs,v.getPreloadImages=So,v.getPrevMeta=Xe,v.getRelatedNewsCarrousel=po,v.getReportReasonLabel=td,v.getResponse=Pe,v.getResponsePromise=ia,v.getSchemas=At,v.getScriptReplaces=rs,v.getSlugs=ka,v.getTextsStringValue=bo,v.getTypeOfNews=mo,v.getVideoRealPath=fo,v.handleGetComments=Kt,v.initLibrary=On,v.isPhotoGallery=vo,v.metadataToJSX=fa,v.metadata_defaults=Ar,v.parseTags=Rt,v.pathnameSplit=ua,v.processExtractedRelatedNews=ca,v.removePages=Ua,v.reportComment=ed,v.shareButtons=xr,v.socialIcons=Bt,v.speculationRules=va,v.speculationRulesHome=ba,v.toISOWithTimeZone=Le,v.urlReplaces=ma,v.usePlayIcon=ys,v.verifyCaptchaTokenEnterprise=Vd,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
260
+ `}}catch(b){console.error("insertVideos error for",g,b),A=""}else A=m;r=u,a+=A,n.lastIndex=u}return a+=e.slice(r),a=Nc(a),a}async function xc(e){const{news:t,banners:a,newsRelatedResponses:r,newsRelatedListResponses:n,slug:o,itemList:i,socials:l,getVideos:h,commonServices:c}=e;let d=t?.body?.rendered??"";d=d.replace(/<script[^>]*src=["']https:\/\/platform\.twitter\.com\/widgets\.js["'][^>]*><\/script>/gi,""),d=d.replace(/&nbsp;/g,""),d=Tc(d,a),d=Ic(d),d=await Sc(d),d=await Uc(d,e.texts,r),d=await kc(d,h),d=yc(d),d=Cc(d);const u=t.main.sources??[],{NEWS_JOURNALIST_COMPONENT:m,CONFIG_blockDefaultTwitterHydrator:g}=D(),f=t.config.articlepreview===je.fotoGaleria&&t.hascontent?.hasgalleryimages;return s.jsxs(s.Fragment,{children:[o!=="liveblogs"&&e.showHeaderImage?f?s.jsx(rn,{commonServices:c,newsformated:t,internal:t.info.link.internal}):s.jsx(Lr,{preview:t.preview}):null,s.jsx(le,{banners:a,name:"block_1"}),s.jsx("div",{className:"sass-pg-nrs-journalistArticleContent",children:m==="op1"?s.jsx(fc,{autorIcon:e.autorIcon,socials:l,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths}):s.jsx(vc,{autorIcon:e.autorIcon,socials:l,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),s.jsx(gc,{summary:t.main.summary}),s.jsx("main",{className:"sass-pg-nrs-contentNews",suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),s.jsx(hc,{texts:e.texts,itemList:i,banners:a,slug:o,getVideos:h,newsRelatedListResponses:n??[]}),u.length>0&&s.jsxs("div",{className:"sass-pg-nrs-noteSource",children:[s.jsx(Ac,{}),s.jsx("p",{children:String(e.texts.noteSource??"")+(u.length===1?"":"s")+": "+u.map(p=>p.name).join(", ")})]}),!g&&t&&t.hascontent&&t.hascontent.hasembeddedtwitter&&s.jsx("script",{async:!0,defer:!0,src:"https://platform.twitter.com/widgets.js"})]})}const Lc=e=>{const{config:t}=e,a=t.articlepreview;return!![je.videoEmbedded,je.videoYouTube,je.iframe].includes(a)},on=async e=>{const{texts:t,autorIcon:a,commonServices:r,slug:n,noteShare:o,paths:i,banners:l,news:h,newsRelatedResponses:c=[],newsRelatedListResponses:d=[],itemList:u=[],socials:m,getVideos:g}=e;if(h)return s.jsxs(s.Fragment,{children:[s.jsx(xc,{texts:t,autorIcon:a,socials:m,news:h,banners:l,newsRelatedResponses:c,newsRelatedListResponses:d,itemList:u,slug:n,getVideos:g,noteShare:o,paths:i,showHeaderImage:!Lc(h),commonServices:r}),s.jsx(le,{banners:l??[],name:"block_3"})]})},Pc=async e=>{const{ranking:t=[],banners:a,autor:r=[],news:n=[],newsRelatedResponses:o=[],newsRelatedListResponses:i=[],itemList:l=[],socials:h,getVideos:c}=e;if(!(!n||!n[0]))return s.jsx(s.Fragment,{children:s.jsxs(ec,{className:"sass-pg-news-contentLayout2",children:[s.jsx(sn,{option:e.slug,news:n,paths:e.paths,commonServices:e.commonServices,banners:e.banners,headerSectionStyles:e.headerSectionStyles,newsDescriptionSectionTag:e.newsDescriptionSectionTag}),s.jsx(tc,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:l,ranking:t,readestCustomStyles:e.readestCustomStyles,bannerTop:s.jsx(le,{banners:a??[],name:"right_1"}),banner:s.jsx(le,{banners:a??[],name:"right_2"}),complement:s.jsxs("div",{id:"comentarios",className:"sass-pg-news-complementContent",suppressHydrationWarning:!0,children:[r.length>0&&s.jsx(Qr,{texts:e.texts,autorIcon:e.autorIcon,autor:r[0],paths:e.paths}),n[0].authors.length>1&&s.jsx(Hr,{news:n[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),n[0]?.keywords?.tags&&n[0]?.keywords?.tags?.length>0&&s.jsx("div",{className:"sass-pg-news-tagContent sass-note-tags-content",children:s.jsx(jr,{tags:n[0]?.keywords?.tags,paths:e.paths})})]}),children:s.jsx(on,{texts:e.texts,autorIcon:e.autorIcon,socials:h,news:n[0],banners:a,newsRelatedResponses:o,newsRelatedListResponses:i,itemList:l,slug:e.slug,getVideos:c,noteShare:e.noteShare,paths:e.paths,commonServices:e.commonServices})})]})})},Bc=e=>s.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.jsx("g",{children:s.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=>s.jsx("form",{className:"su-w-full su-flex su-justify-center su-gap-4 sass-pg-buscar-content",children:s.jsxs("div",{className:"sass-pg-buscar-inputStyled sass-buscar-form",children:[s.jsx("input",{className:"sass-pg-buscar-inputStyledTest",defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),s.jsx("button",{className:"sass-pg-buscar-buttonStyled",type:"submit",children:s.jsx(Bc,{className:"sass-pg-buscar-searchStyled"})})]})}),Mc=e=>{const{data:t,option:a,autor:r,page:n,banners:o,pathname:i,ranking:l,currentPage:h,slug:c,texts:d={},socialIconsFilled:u=!1}=e,m=[5,10,15],{SUB_PUBLICATION_PREFIX_IN_ROUTES:g}=D(),f={5:1,10:2,15:3};switch(a){case"op1":return s.jsx(s.Fragment,{children:s.jsxs(Ns,{children:[s.jsx(Mr,{autor:r[0],autorIcon:e.autorIcon,socialIconsFilled:u}),s.jsx(Ss,{paths:e.paths,ranking:l,readestTitle:d.readestTitle??"",bannerTop:s.jsx(le,{banners:o??[],name:"right_1"}),banner:s.jsx(le,{banners:o??[],name:"right_2"}),children:s.jsx("section",{className:"sass-pg-autor-content",children:t.length>0?s.jsx(Mt,{className:["sass-pg-autor-newsContentSection","padding-0"].join(" "),paginatorComponent:s.jsx(nt,{block_subPublication:g?.autor,texts:d,pathname:i,query:"",currentPage:h,maxPages:e.paginationLimit,showNext:!(t.length<e.newsListLimit)}),children:Array.isArray(t)&&t?.map((p,A)=>s.jsxs(I.Fragment,{children:[m.includes(A+1)&&s.jsx("div",{className:"sass-pg-autor-itemContent banner-context",children:s.jsx(le,{banners:o??[],name:`block_2_${f[A+1]}`})}),s.jsx(jt,{autorIcon:e.autorIcon,item:p,option:c,paths:e.paths},A)]},A))}):s.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:s.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})})})]})});case"op2":return s.jsx(s.Fragment,{children:s.jsxs(Ns,{children:[s.jsx(qr,{autor:r[0],autorIcon:e.autorIcon,socialIconsFilled:u}),Array.isArray(t)?s.jsxs(s.Fragment,{children:[s.jsx(Ts,{content:t,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),s.jsx(nt,{block_subPublication:g?.autor,texts:d,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(n),showNext:!((t.length??0)<Number(e.newsListLimit))})]}):s.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:s.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})]})});default:return s.jsx(s.Fragment,{})}},Je=({className:e})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:e,children:s.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"})}),qc={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},it={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function Dc(e){return{email:{label:e?.email??it.email.label,required:!0},given_name:{label:e?.given_name??it.given_name.label,required:!0},family_name:{label:e?.family_name??it.family_name.label,required:!0},password:{label:e?.password??it.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??it.confirmPassword.label,required:!0}}}const Ee=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],ln=[{label:"La contraseña debe tener al menos 8 caracteres",test:Ee[0]},{label:"Usa un número",test:Ee[1]},{label:"Usa una letra minúscula",test:Ee[2]},{label:"Usa una letra mayúscula",test:Ee[3]},{label:"Usa un símbolo",test:Ee[4]}];function _c({texts:e,API_ENV:t,termsAndConditionsUrl:a}){const r={...qc,...e?.comentarios},n=I.useMemo(()=>Dc(e?.comentarios?.registerForm),[e?.comentarios?.registerForm]),o=I.useMemo(()=>[{label:r.passwordRuleMinLength,test:Ee[0]},{label:r.passwordRuleNumber,test:Ee[1]},{label:r.passwordRuleLowercase,test:Ee[2]},{label:r.passwordRuleUppercase,test:Ee[3]},{label:r.passwordRuleSymbol,test:Ee[4]}],[r.passwordRuleMinLength,r.passwordRuleNumber,r.passwordRuleLowercase,r.passwordRuleUppercase,r.passwordRuleSymbol]),[i,l]=I.useState({}),[h,c]=I.useState(!1),[d,u]=I.useState(!1),[m,g]=I.useState(null),[f,p]=I.useState("register"),A=async()=>{if(t.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const w=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${w}`},b=(w,U)=>{l(L=>({...L,[w]:U}))},S=async w=>{w.preventDefault(),g(null),u(!0);try{const U=Object.keys(n).filter(V=>!["username","password","confirmPassword"].includes(V)).map(V=>({Name:V,Value:i[V]}));if(U.some(V=>{if(!V.Value||V.Value.trim()==="")return!0}))return u(!1),g(r.errorCompleteFields);if(i.password!==i.confirmPassword){g(r.errorPasswordMismatch);return}const L=i.password||"";if(o.some(V=>!V.test(L))){g(r.errorPasswordInvalid);return}const Z=Math.floor(Date.now()/1e3);U.push({Name:"updated_at",Value:String(Z)});const H=t.PUBLIC_ENV==="local"?"token":await Ys("comment_register",t.CAPTCHA_KEY??"");if(!H)throw new Error("Captcha token no generado");const B=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email,password:i.password,userAttributes:U,token:H})});if(!B.ok){const V=await B.json().catch(()=>({}));if(V.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email})}),p("confirm");return}throw new Error(V?.error||"Error al crear usuario")}p("confirm")}catch(U){console.log(U),g(U?.message||U?.error||r.errorUnexpected)}finally{u(!1)}},N=async w=>{if(w.preventDefault(),!i.confirmationCode){g(r.errorVerificationCodeRequired);return}g(null),u(!0);try{const U=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i.email,code:i.confirmationCode})});if(!U.ok){const L=await U.json().catch(()=>({}));throw new Error(L?.error||"Error al confirmar usuario")}p("success")}catch(U){g(U?.message||r.errorUnexpected)}finally{u(!1)}},E=i.password||"";return s.jsxs(s.Fragment,{children:[f==="register"&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:A,className:"sass-pg-login-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-login-googleIcon"}),s.jsx("span",{children:r.GoogleButtonText})]}),s.jsx("div",{className:"sass-pg-login-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("form",{onSubmit:S,className:"sass-pg-login-form","data-error":m?"true":"false",children:[s.jsx("ul",{className:"sass-pg-login-formUl",children:Object.entries(n).map(([w,{label:U}])=>s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:U}),s.jsx("input",{type:w.toLowerCase().includes("password")?h?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:i[w]||"",onChange:L=>b(w,L.target.value),className:"sass-pg-login-input",placeholder:""}),w==="password"&&s.jsx("div",{className:"sass-pg-login-passwordChecker",children:o.map((L,z)=>{const Z=L.test(E);return s.jsxs("div",{className:Z?"sass-pg-login-valid":"sass-pg-login-invalid",children:[s.jsx("div",{children:Z?"✔":"○"}),s.jsx("div",{children:L.label})]},z)})}),w==="confirmPassword"&&s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:h,onChange:L=>c(L.target.checked)}),s.jsx("label",{htmlFor:"showPasswordRegister",className:"sass-pg-login-checkboxLabel",children:r.showPasswordsLabel})]})]},w))}),m&&s.jsx("p",{className:"sass-pg-login-error",children:m}),s.jsxs("p",{className:"sass-pg-login-terms",children:[r.termsPrefix," ",s.jsx("a",{href:a??"/pages/politicas-de-privacidad",target:"_blank",children:r.termsLinkText})," ",r.termsSuffix]}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:d,children:d?s.jsx(Je,{}):r.createAccountButton})]})]}),f==="confirm"&&s.jsxs("form",{onSubmit:N,className:"sass-pg-login-form","data-error":m?"true":"false",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:r.verificationCodeLabel}),s.jsx("input",{type:"text",name:"confirmationCode",value:i.confirmationCode||"",onChange:w=>b("confirmationCode",w.target.value),className:"sass-pg-login-input",required:!0})]}),m&&s.jsx("p",{className:"sass-pg-login-error",children:m}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:d,children:d?s.jsx(Je,{}):r.confirmAccountButton}),s.jsxs("p",{className:"sass-pg-login-switch",children:[r.alreadyConfirmedText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./login",children:r.loginButtonText})]})]}),f==="success"&&s.jsxs("form",{className:"sass-pg-login-form",children:[s.jsxs("div",{className:"sass-pg-login-successContainer",children:[s.jsx("div",{className:"sass-pg-login-thumbsUp",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:s.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"})})}),s.jsxs("div",{className:"sass-pg-login-successMessage",children:[s.jsx("p",{children:r.successTitle}),s.jsx("p",{children:r.successMessage})]})]}),s.jsx("a",{href:"./login",className:"sass-pg-login-primary",children:r.loginButtonText})]}),f==="register"&&s.jsxs("p",{className:"sass-pg-login-switch",children:[r.alreadyHasAccountText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./login",children:r.loginButtonText})]})]})}const Gc={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function jc({API_ENV:e,texts:t}){const a={...Gc,...t?.comentarios},[r,n]=I.useState("login"),[o,i]=I.useState(""),[l,h]=I.useState(""),[c,d]=I.useState(""),[u,m]=I.useState(""),[g,f]=I.useState(""),[p,A]=I.useState(!1),[b,S]=I.useState(!1),[N,E]=I.useState(null);I.useEffect(()=>{if(typeof window>"u")return;window.location.hash.includes("forgot")&&r==="login"&&n("forgot"),r==="login"&&U()});const w=B=>document.cookie.split("; ").find(V=>V.startsWith(B+"="))?.split("=")[1],U=async()=>{if(document.cookie.search(e.COGNITO_AUTH_PREFIX+"IS_AUTH=true")!==-1){if(!window)return;const B=w("redirect_after_login_1");console.log("Redirect path after login:",B),B&&B!==""?(document.cookie="redirect_after_login_1=; Max-Age=0; path=/",window.location.pathname=B,window.location.hash="comentarios"):window.location.pathname="/auth/success"}},L=async()=>{if(e.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}let B="/auth/login";const V=w("redirect_after_login_1");V&&V!==""&&(B=V),window.location.href=`/api/auth/login?redirect=${B}`},z=async B=>{if(!b){if(B.preventDefault(),o===""||l===""){E("Complete todos los campos");return}E(null),S(!0);try{const V=e.PUBLIC_ENV==="local"?"token":await Ys("comment_login",e.CAPTCHA_KEY||"");if(!V)throw new Error("Captcha token no generado");const te=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:o,password:l,token:V})});if(!te.ok){const _=await te.json().catch(()=>({}));throw new Error(_?.error||"Ha ocurrido un error")}await U();return}catch(V){E(V?.message||"Error inesperado")}finally{S(!1)}}},Z=async B=>{if(!b){B.preventDefault(),E(null),S(!0);try{const V=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o})});if(!V.ok){const te=await V.json().catch(()=>({}));throw new Error(te?.error||"Error al enviar código")}h(""),n("changePassword")}catch(V){E(V?.message||"Error inesperado")}finally{S(!1)}}},H=async B=>{if(b)return;if(B.preventDefault(),u!==g){E("Las contraseñas no coinciden");return}if(ln.some(te=>!te.test(u))){E("La contraseña no cumple con los requisitos");return}E(null),S(!0);try{const te=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,code:c,newPassword:u})});if(!te.ok){const _=await te.json().catch(()=>({}));throw new Error(_?.error||"Error al cambiar contraseña")}n("feedback")}catch(te){E(te?.message||"Error inesperado")}finally{S(!1)}};return s.jsxs(s.Fragment,{children:[r==="login"&&s.jsx(Qc,{email:o,password:l,showPassword:p,loading:b,error:N,setEmail:i,setPassword:h,setShowPassword:A,onSubmit:z,onForgot:()=>{E(null),n("forgot")},handleGoogleLogin:L,t:a}),r==="forgot"&&s.jsx(Hc,{email:o,setEmail:i,loading:b,error:N,onSubmit:Z,onBack:()=>{E(null),n("login")},t:a}),r==="changePassword"&&s.jsx(Vc,{email:o,confirmationCode:c,newPassword:u,confirmNewPassword:g,showPassword:p,loading:b,error:N,setConfirmationCode:d,setNewPassword:m,setConfirmNewPassword:f,setShowPassword:A,onSubmit:H,onBack:()=>{E(null),n("forgot")},t:a}),r==="feedback"&&s.jsx(zc,{onBackToLogin:()=>{E(null),n("login")},t:a})]})}function Qc({email:e,password:t,showPassword:a,loading:r,error:n,setEmail:o,setPassword:i,setShowPassword:l,onSubmit:h,onForgot:c,handleGoogleLogin:d,t:u}){return s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:d,className:"sass-pg-login-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-login-googleIcon"}),s.jsx("span",{children:u.GoogleButtonText})]}),s.jsx("div",{className:"sass-pg-login-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("form",{onSubmit:h,className:"sass-pg-login-form","data-error":n?"true":"false",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:u.email}),s.jsx("input",{type:"email",value:e,onChange:m=>o(m.target.value),className:"sass-pg-login-input",placeholder:""})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:u.password}),s.jsx("input",{type:a?"text":"password",value:t,onChange:m=>i(m.target.value),className:"sass-pg-login-input",placeholder:""}),s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:m=>l(m.target.checked)}),s.jsx("label",{htmlFor:"showPasswordLogin",className:"sass-pg-login-checkboxLabel",children:u.showPassword})]})]}),n&&s.jsx("p",{className:"sass-pg-login-error",children:n}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:r,children:r?s.jsx(Je,{className:"sass-pg-login-spin"}):u.loginButtonText})]}),s.jsxs("p",{className:"sass-pg-login-switch",children:[u.noAccountText,s.jsx("a",{className:"sass-pg-login-toRegister",href:"./register",children:u.registerButtonText})]}),s.jsx("button",{type:"button",className:"sass-pg-login-forgotPassword",onClick:c,children:u.forgotPasswordText})]})}function Hc({email:e,setEmail:t,loading:a,error:r,onSubmit:n,onBack:o,t:i}){return s.jsxs("form",{onSubmit:n,className:"sass-pg-login-form","data-error":r?"true":"false",children:[s.jsx("p",{className:"sass-pg-login-message",children:i.forgotMessage}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:i.email}),s.jsx("input",{type:"email",value:e,name:"email",onChange:l=>t(l.target.value),className:"sass-pg-login-input",placeholder:""})]}),r&&s.jsx("p",{className:"sass-pg-login-error",children:r}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",disabled:a,children:a?s.jsx(Je,{}):i.sendCodeButton}),s.jsx("p",{className:"sass-pg-login-switch",style:{margin:"0 0 16px"},children:s.jsx("button",{type:"button",onClick:o,children:i.backButton})})]})}function Fc(e){const[t,a]=e.split("@");if(!t||!a)return e;let r="";t.length<=2?r=t[0]+"*":r=t[0]+"*".repeat(t.length-2)+t[t.length-1];const n=a.lastIndexOf(".");if(n===-1)return`${r}@${a}`;const o=a.slice(0,n),i=a.slice(n);let l="";return o.length<=2?l=o[0]+"*":l=o[0]+"*".repeat(o.length-2)+o[o.length-1],`${r}@${l}${i}`}function Vc({email:e,confirmationCode:t,newPassword:a,confirmNewPassword:r,showPassword:n,loading:o,error:i,setConfirmationCode:l,setNewPassword:h,setConfirmNewPassword:c,setShowPassword:d,onSubmit:u,onBack:m,t:g}){const f=g.changePasswordMessage.replace("{{email}}",Fc(e));return s.jsxs("form",{onSubmit:u,className:"sass-pg-login-form","data-error":i?"true":"false",children:[s.jsx("p",{className:"sass-pg-login-message",children:f}),s.jsxs("ul",{className:"sass-pg-login-formUl",children:[s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.verificationCodeLabel}),s.jsx("input",{type:"text",value:t,onChange:p=>l(p.target.value),className:"sass-pg-login-input",placeholder:""})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.newPasswordLabel}),s.jsx("input",{type:n?"text":"password",value:a,onChange:p=>h(p.target.value),className:"sass-pg-login-input",placeholder:"",name:"password"}),s.jsx("div",{className:"sass-pg-login-passwordChecker",children:ln.map((p,A)=>{const b=p.test(a);return s.jsxs("div",{className:b?"sass-pg-login-valid":"sass-pg-login-invalid",children:[s.jsx("div",{children:b?"✔":"○"}),s.jsx("div",{children:p.label})]},A)})})]}),s.jsxs("div",{className:"sass-pg-login-field",children:[s.jsx("label",{className:"sass-pg-login-label",children:g.confirmPasswordLabel}),s.jsx("input",{type:n?"text":"password",value:r,onChange:p=>c(p.target.value),className:"sass-pg-login-input",placeholder:""}),s.jsxs("div",{className:"sass-pg-login-checkboxRow",children:[s.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:n,onChange:p=>d(p.target.checked)}),s.jsx("label",{htmlFor:"showPasswordForgot",className:"sass-pg-login-checkboxLabel",children:g.showPasswordsLabel})]})]})]}),i&&s.jsx("p",{className:"sass-pg-login-error",children:i}),s.jsx("button",{type:"submit",className:"sass-pg-login-primary",style:{maxWidth:o?"revert-layer":"fit-content"},disabled:o,children:o?s.jsx(Je,{}):g.changePasswordButton}),s.jsx("p",{className:"sass-pg-login-switch",children:s.jsx("button",{type:"button",onClick:m,children:g.backButton})})]})}function zc({onBackToLogin:e,t}){return s.jsxs("div",{className:"sass-pg-login-form",children:[s.jsx("p",{className:"sass-pg-login-success",children:t.feedbackSuccessMessage}),s.jsx("button",{type:"button",className:"sass-pg-login-primary",onClick:e,children:t.loginButtonText})]})}function Wc({containerId:e,containerId2:t}){return I.useEffect(()=>{try{let a=function(){const d=window.twttr;d?.widgets?d.widgets.load(r):c<10?(c++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const r=document.getElementById(e),n=document.getElementById(t);if(!r&&!n)return;const o=r?.querySelectorAll("script[src]")??[],i=n?.querySelectorAll("script[src]")??[];[...o,...i].forEach(d=>{const u=document.createElement("script");Array.from(d.attributes).forEach(m=>{u.setAttribute(m.name,m.value)}),d.replaceWith(u)});const h=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(h)for(let d=0;d<h.length;d++)h[d]?.remove();let c=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const d=document.createElement("script");d.src="https://platform.twitter.com/widgets.js",d.async=!0,d.onload=a,document.body.appendChild(d)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Yc=({currentNew:e})=>e&&e?.hascontent?.hasembeddedtwitter&&s.jsx("script",{src:"https://platform.twitter.com/widgets.js"}),Kc=e=>{const{isVideo:t=!1,isLarge:a=!1,hasShadow:r=!1,BackDropAuxHeigthMobile:n}=e,o=ys(),i=I.useMemo(()=>{const m=e?.preview?.sizes;if(m&&Array.isArray(m)&&m.length>0)return m;const g=e?.preview?.original;return g?.url?[{url:g.url,width:g.width||0,height:g.height||0}]:[]},[e?.preview?.sizes,e?.preview?.original]);if(!i.length||!i[0]?.url||i[0]?.url==="")return s.jsx("div",{className:"sass-com-img-imagePlaceholder"});const{PUBLIC_API_HOST:l="",PUBLIC_ASSETS_URL:h}=e.API_ENV,c=i[0]?.url,d=h&&h!=="false"?h:l,u=c?.startsWith("http")||c?.includes(d)?c:d+c;return s.jsx("figure",{className:"sass-com-img-figure",children:s.jsxs("span",{className:"sass-com-img-backdrop",children:[s.jsx("span",{className:"sass-com-img-backdropAux",style:{height:n||"56.25%"}}),s.jsxs("picture",{children:[s.jsx("img",{fetchPriority:"low",loading:"lazy",className:"sass-com-img-imageStyled",alt:e.preview?.description||"",src:u,style:{boxShadow:r?"0px 4px 8px 0px #00000033":"0px"}}),t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sass-com-img-boxPlayIcon",style:{height:a?"40%":"72px"}}),s.jsx(o,{className:"sass-com-img-playStyled",style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Jc=e=>s.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:s.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"})}),cn={info:{section:{name:"",slug:"",url:""},link:{url:"/",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},$c=({section:e,internalPath:t,banner:a,isVisible:r=!1,stylesConfig:n,API_ENV:o,fetchConfig:i,paths:l})=>{const h=o.FETCH_SIZE_MORE_NEWS??6,[c,d]=I.useState({data:Array.from({length:h},()=>cn)}),[u,m]=I.useState(!1),g=I.useCallback(async()=>{if(!t)return;const A=new URLSearchParams({section:e,currentNewsLink:t}),b=await fetch(`/api/get-more-news?${A}`);if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);return await b.json()},[e,t]),f=I.useCallback(async()=>{const{PUBLIC_API_FRONT:A,PUBLIC_X_SECURITY_TOKEN:b,PUBLIC_API_PATH_VERSION:S,PUBLIC_PUBLICATION_ID:N}=o;if(!A||!b||!N||!S)throw new Error("Missing required environment variables");const E=await re.get(`${A}${S}/news-list-section`,{params:{size:h+1,newstype:i.newsType,section:e,imagesizes:i.imgSizes,publication:parseInt(N)},headers:{"x-api-token":b,"Content-Type":"application/json"}});return{...E.data,data:E.data.data.filter(w=>w.info.link.internal!==t)}},[e,t,o]),p=I.useCallback(async()=>{if(!(u||!t)){m(!0);try{let A;o.PUBLIC_ENV!=="prod"?A=await g():A=await f(),d({...A,data:A.data.slice(0,h)})}catch(A){console.error("[/api/get-more-news] Error:",A.message),d(void 0)}}},[u,t,o.PUBLIC_ENV,g,f]);return I.useEffect(()=>{r&&p()},[r,p]),!c?.data||c.data.length===0?null:s.jsx(Zc,{news:c.data,title:"Más Noticias",...n["Modulo 1x3 Client"]??n["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,API_ENV:o,paths:l,isVisible:r})},Zc=e=>{const{news:t,hasLines:a=!1,API_ENV:r}=e,n=o=>a&&(o+1)%3!==0?"sass-bd-m13-contentSeparator":"";return s.jsx("div",{className:"su-grid su-justify-center sass-bd-m13-newsContent",style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:t.map((o,i)=>{const{main:l,authors:h,info:c,preview:d,isVideo:u=!1,config:m,overImage:g="default",isTitle:f=!1,isLarge:p=!1,keywords:A}=o;return s.jsx("div",{className:n(i),style:{order:i},children:s.jsxs("section",{className:"sass-com-sc1-content",children:[s.jsx(q,{title:l?.title?.section,href:c?.link?.url??"invalidUrl","aria-label":l?.title?.section??"nota",target:c?.link?.target,children:s.jsx(Kc,{isVisible:e.isVisible,preview:d,rounded:e.rounded,isVideo:u,isLarge:p,API_ENV:e.API_ENV,getImageUrl:e.getImageUrl})}),s.jsx("div",{className:"sass-com-sc1-newsDescription",children:s.jsx(Xc,{main:l,SHOW_TAG_BY_SECTION:r.SHOW_TAG_BY_SECTION,authors:h,info:c,preview:d,share:e.share,config:m,overImage:g,isTitle:f,paths:e.paths,isVisible:e.isVisible,DATE_CONFIG:e.API_ENV,keywords:A})})]})},i)})})},Xc=e=>{const{share:t=!1,cutSubtitle:a=!0,SHOW_TAG_BY_SECTION:r,keywords:n,info:o}=e,l=(()=>{if(!e?.authors||e.authors.length===0)return"";const d=e.authors[0],u=ye(e.info?.date?.modified,e.DATE_CONFIG);return d&&e?.config?.showtime&&e.config?.showauthor?`${d.fullname} - ${u}`:d&&e.config?.showauthor?d.fullname:e?.config?.showtime?u:""})(),h=()=>e.main.uppertitle?s.jsx("p",{className:"sass-com-nd-uppertitle",title:e.main.uppertitle,children:e.main.uppertitle}):null,c=()=>{if(r&&n?.tags?.length&&n.tags.length>0){const d=n.tags[0],u=d.name;return s.jsxs("h3",{className:"sass-com-nd-sectionDescriptionContainer",children:[d.approved?s.jsx(q,{"aria-label":u,block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.tema,className:"sass-com-nd-sectionDescription",href:Ue(d,e.paths),children:u}):s.jsx("div",{className:"sass-com-nd-sectionDescription",children:u}),h()]})}else if(o?.section?.url){const d=o.section.name;return s.jsxs("h3",{className:"sass-com-nd-sectionDescriptionContainer",children:[s.jsx(q,{"aria-label":d,className:"sass-com-nd-sectionDescription",href:o.section.url,children:d}),h()]})}return null};return s.jsxs("div",{className:"sass-com-nd-boxInformation",children:[t&&s.jsx(Jc,{className:"sass-com-nd-dotStyles"}),s.jsx(c,{}),s.jsx("h2",{className:"sass-com-nd-articule",children:s.jsx(q,{className:"sass-com-nd-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&&s.jsx("p",{className:"sass-com-nd-description",style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Ce(e.main?.subtitle?.striped):e.main?.subtitle?.striped}),(e?.config?.showtime||e.config?.showauthor)&&l&&s.jsx(s.Fragment,{children:e.authors?.[0]?.internaluser?s.jsx(q,{block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.autor,className:"sass-com-nd-correspondentLink",href:`/${e.paths.autor}/${e.authors[0].name}`,children:l}):s.jsx("div",{className:"sass-com-nd-correspondent",children:l})})]})},Rc=({user:e,handleLogout:t,message:a})=>{const r=()=>{const o=document.querySelector(".user-actions-options");o&&o.classList.toggle("show")},n=e.firstname??"Usuario";return s.jsx("div",{className:"comment-item",children:s.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?s.jsx("img",{className:"comment-avatar-img su-h-full",src:e.picture,alt:e.username}):s.jsx("div",{className:"comment-avatar su-flex-center su-rounded-full su-font-bold su-overflow-hidden",children:n.charAt(0).toUpperCase()}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{className:"comment-header su-flex su-items-center su-relative su-flex-wrap",children:[s.jsxs("span",{className:"comment-username su-font-bold su-truncate user-welcome",children:["Hola ",n,"!"]}),s.jsx("div",{className:"user-actions-options su-hidden su-absolute su-p-2",children:s.jsx("button",{className:"su-bg-transparent su-border-none",onClick:()=>{t()},children:"Cerrar Sesion"})}),s.jsx("button",{className:"user-actions-span",onClick:r,children:s.jsx(Dt,{width:13,height:13,fill:"black"})})]}),s.jsx("p",{className:"comment-text su-font-normal",children:a})]})]})})},dn=async(e,t)=>{if(!e)return!1;const{CAPTCHA_PROJECT:a,CAPTCHA_KEY_V2:r,COMMENTS_CAPTCHA_API_KEY:n}=t;try{const o=a,i=r,c=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${o}/assessments?key=${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:i}})})).json();return console.log("reCAPTCHA Enterprise verification result:",c),c.tokenProperties?.valid===!0}catch(o){return console.error("Error verificando reCAPTCHA Enterprise:",o),!1}};async function ed({publication:e,username:t,id:a,type:r,baseUrl:n,captchaToken:o,apiToken:i,securityToken:l,COMMENTS_VARS:h}){if(!e||!t||!a||!r||!o)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof t!="string"||typeof a!="string"||typeof r!="string"||typeof o!="string")throw new Error("Todos los parámetros deben ser strings");if(!await dn(o,h))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const c=`${n}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(r),u=new URLSearchParams({publication:e,username:t??!1,id:a,type:d}),m=`${c}?${u.toString()}`;try{console.log("Reporting comment:",{publication:e,username:t,id:a,type:r,encodedType:d,url:m});const g=await re.get(m,{headers:{"User-Agent":"blu3st@ck-react","x-security-token":l,"x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",g.data),g.status===200||g.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:g.status,data:g.data};throw new Error(`Respuesta inesperada del servidor: ${g.status}`)}catch(g){if(console.error("Error reporting comment:",g),re.isAxiosError(g)){const f=g.response?.status,p=g.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(p?.error||p?.message||`Error HTTP ${f}: No se pudo reportar el comentario`)}throw g}}const Qt={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 td(e){return Qt[e]}const Te=300,Ie={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function sd(e){const t=e.split(" ");if(t.length!==3)return e;const[a,r,n]=t,o=r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();return`${a} ${o} ${n}`}const Ht=(e,t,a)=>{if(!e||!e.current)return{boolean:!1,text:""};const r=e.current?.value||"",n=r.length>Te,{PUBLIC_ENV:o}=a,i=o==="local",l=r.trim()!==""&&(i||t!=="")&&!n,h=n?`No debes exceder el limite de ${Te} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:l,text:h}},hn=e=>{const t=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!t)return[];try{return JSON.parse(decodeURIComponent(t.split("=")[1]??""))}catch{return[]}},ad=(e,t)=>{const a=hn(e);a.includes(t)||(a.push(t),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};var Ft={exports:{}},Vt={exports:{}},se={};var un;function rd(){if(un)return se;un=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function N(w){if(typeof w=="object"&&w!==null){var U=w.$$typeof;switch(U){case t:switch(w=w.type,w){case h:case c:case r:case o:case n:case u:return w;default:switch(w=w&&w.$$typeof,w){case l:case d:case f:case g:case i:return w;default:return U}}case a:return U}}}function E(w){return N(w)===c}return se.AsyncMode=h,se.ConcurrentMode=c,se.ContextConsumer=l,se.ContextProvider=i,se.Element=t,se.ForwardRef=d,se.Fragment=r,se.Lazy=f,se.Memo=g,se.Portal=a,se.Profiler=o,se.StrictMode=n,se.Suspense=u,se.isAsyncMode=function(w){return E(w)||N(w)===h},se.isConcurrentMode=E,se.isContextConsumer=function(w){return N(w)===l},se.isContextProvider=function(w){return N(w)===i},se.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},se.isForwardRef=function(w){return N(w)===d},se.isFragment=function(w){return N(w)===r},se.isLazy=function(w){return N(w)===f},se.isMemo=function(w){return N(w)===g},se.isPortal=function(w){return N(w)===a},se.isProfiler=function(w){return N(w)===o},se.isStrictMode=function(w){return N(w)===n},se.isSuspense=function(w){return N(w)===u},se.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===c||w===o||w===n||w===u||w===m||typeof w=="object"&&w!==null&&(w.$$typeof===f||w.$$typeof===g||w.$$typeof===i||w.$$typeof===l||w.$$typeof===d||w.$$typeof===A||w.$$typeof===b||w.$$typeof===S||w.$$typeof===p)},se.typeOf=N,se}var ae={};var mn;function nd(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function N(M){return typeof M=="string"||typeof M=="function"||M===r||M===c||M===o||M===n||M===u||M===m||typeof M=="object"&&M!==null&&(M.$$typeof===f||M.$$typeof===g||M.$$typeof===i||M.$$typeof===l||M.$$typeof===d||M.$$typeof===A||M.$$typeof===b||M.$$typeof===S||M.$$typeof===p)}function E(M){if(typeof M=="object"&&M!==null){var he=M.$$typeof;switch(he){case t:var Zt=M.type;switch(Zt){case h:case c:case r:case o:case n:case u:return Zt;default:var Ln=Zt&&Zt.$$typeof;switch(Ln){case l:case d:case f:case g:case i:return Ln;default:return he}}case a:return he}}}var w=h,U=c,L=l,z=i,Z=t,H=d,B=r,V=f,te=g,_=a,x=o,k=n,G=u,P=!1;function W(M){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),y(M)||E(M)===h}function y(M){return E(M)===c}function T(M){return E(M)===l}function O(M){return E(M)===i}function Q(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function j(M){return E(M)===d}function F(M){return E(M)===r}function Y(M){return E(M)===f}function K(M){return E(M)===g}function R(M){return E(M)===a}function ee(M){return E(M)===o}function J(M){return E(M)===n}function ne(M){return E(M)===u}ae.AsyncMode=w,ae.ConcurrentMode=U,ae.ContextConsumer=L,ae.ContextProvider=z,ae.Element=Z,ae.ForwardRef=H,ae.Fragment=B,ae.Lazy=V,ae.Memo=te,ae.Portal=_,ae.Profiler=x,ae.StrictMode=k,ae.Suspense=G,ae.isAsyncMode=W,ae.isConcurrentMode=y,ae.isContextConsumer=T,ae.isContextProvider=O,ae.isElement=Q,ae.isForwardRef=j,ae.isFragment=F,ae.isLazy=Y,ae.isMemo=K,ae.isPortal=R,ae.isProfiler=ee,ae.isStrictMode=J,ae.isSuspense=ne,ae.isValidElementType=N,ae.typeOf=E})()),ae}var fn;function Us(){return fn||(fn=1,process.env.NODE_ENV==="production"?Vt.exports=rd():Vt.exports=nd()),Vt.exports}var ks,gn;function od(){if(gn)return ks;gn=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function n(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var h=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(h.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ks=n()?Object.assign:function(o,i){for(var l,h=r(o),c,d=1;d<arguments.length;d++){l=Object(arguments[d]);for(var u in l)t.call(l,u)&&(h[u]=l[u]);if(e){c=e(l);for(var m=0;m<c.length;m++)a.call(l,c[m])&&(h[c[m]]=l[c[m]])}}return h},ks}var xs,pn;function Ls(){if(pn)return xs;pn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xs=e,xs}var Ps,An;function wn(){return An||(An=1,Ps=Function.call.bind(Object.prototype.hasOwnProperty)),Ps}var Bs,bn;function id(){if(bn)return Bs;bn=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ls(),a={},r=wn();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function n(o,i,l,h,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var u;try{if(typeof o[d]!="function"){var m=Error((h||"React class")+": "+l+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}u=o[d](i,d,h,l,null,t)}catch(f){u=f}if(u&&!(u instanceof Error)&&e((h||"React class")+": type specification of "+l+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=c?c():"";e("Failed "+l+" type: "+u.message+(g??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Bs=n,Bs}var Os,vn;function ld(){if(vn)return Os;vn=1;var e=Us(),t=od(),a=Ls(),r=wn(),n=id(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var h="Warning: "+l;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function i(){return null}return Os=function(l,h){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(y){var T=y&&(c&&y[c]||y[d]);if(typeof T=="function")return T}var m="<<anonymous>>",g={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:N,element:E(),elementType:w(),instanceOf:U,node:H(),objectOf:z,oneOf:L,oneOfType:Z,shape:V,exact:te};function f(y,T){return y===T?y!==0||1/y===1/T:y!==y&&T!==T}function p(y,T){this.message=y,this.data=T&&typeof T=="object"?T:{},this.stack=""}p.prototype=Error.prototype;function A(y){if(process.env.NODE_ENV!=="production")var T={},O=0;function Q(F,Y,K,R,ee,J,ne){if(R=R||m,J=J||K,ne!==a){if(h){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=R+":"+K;!T[he]&&O<3&&(o("You are manually calling a React.PropTypes validation function for the `"+J+"` prop on `"+R+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[he]=!0,O++)}}return Y[K]==null?F?Y[K]===null?new p("The "+ee+" `"+J+"` is marked as required "+("in `"+R+"`, but its value is `null`.")):new p("The "+ee+" `"+J+"` is marked as required in "+("`"+R+"`, but its value is `undefined`.")):null:y(Y,K,R,ee,J)}var j=Q.bind(null,!1);return j.isRequired=Q.bind(null,!0),j}function b(y){function T(O,Q,j,F,Y,K){var R=O[Q],ee=k(R);if(ee!==y){var J=G(R);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+J+"` supplied to `"+j+"`, expected ")+("`"+y+"`."),{expectedType:y})}return null}return A(T)}function S(){return A(i)}function N(y){function T(O,Q,j,F,Y){if(typeof y!="function")return new p("Property `"+Y+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var K=O[Q];if(!Array.isArray(K)){var R=k(K);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected an array."))}for(var ee=0;ee<K.length;ee++){var J=y(K,ee,j,F,Y+"["+ee+"]",a);if(J instanceof Error)return J}return null}return A(T)}function E(){function y(T,O,Q,j,F){var Y=T[O];if(!l(Y)){var K=k(Y);return new p("Invalid "+j+" `"+F+"` of type "+("`"+K+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return A(y)}function w(){function y(T,O,Q,j,F){var Y=T[O];if(!e.isValidElementType(Y)){var K=k(Y);return new p("Invalid "+j+" `"+F+"` of type "+("`"+K+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return A(y)}function U(y){function T(O,Q,j,F,Y){if(!(O[Q]instanceof y)){var K=y.name||m,R=W(O[Q]);return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected ")+("instance of `"+K+"`."))}return null}return A(T)}function L(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function T(O,Q,j,F,Y){for(var K=O[Q],R=0;R<y.length;R++)if(f(K,y[R]))return null;var ee=JSON.stringify(y,function(ne,M){var he=G(M);return he==="symbol"?String(M):M});return new p("Invalid "+F+" `"+Y+"` of value `"+String(K)+"` "+("supplied to `"+j+"`, expected one of "+ee+"."))}return A(T)}function z(y){function T(O,Q,j,F,Y){if(typeof y!="function")return new p("Property `"+Y+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type "+("`"+R+"` supplied to `"+j+"`, expected an object."));for(var ee in K)if(r(K,ee)){var J=y(K,ee,j,F,Y+"."+ee,a);if(J instanceof Error)return J}return null}return A(T)}function Z(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var T=0;T<y.length;T++){var O=y[T];if(typeof O!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(O)+" at index "+T+"."),i}function Q(j,F,Y,K,R){for(var ee=[],J=0;J<y.length;J++){var ne=y[J],M=ne(j,F,Y,K,R,a);if(M==null)return null;M.data&&r(M.data,"expectedType")&&ee.push(M.data.expectedType)}var he=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new p("Invalid "+K+" `"+R+"` supplied to "+("`"+Y+"`"+he+"."))}return A(Q)}function H(){function y(T,O,Q,j,F){return _(T[O])?null:new p("Invalid "+j+" `"+F+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return A(y)}function B(y,T,O,Q,j){return new p((y||"React class")+": "+T+" type `"+O+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function V(y){function T(O,Q,j,F,Y){var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type `"+R+"` "+("supplied to `"+j+"`, expected `object`."));for(var ee in y){var J=y[ee];if(typeof J!="function")return B(j,F,Y,ee,G(J));var ne=J(K,ee,j,F,Y+"."+ee,a);if(ne)return ne}return null}return A(T)}function te(y){function T(O,Q,j,F,Y){var K=O[Q],R=k(K);if(R!=="object")return new p("Invalid "+F+" `"+Y+"` of type `"+R+"` "+("supplied to `"+j+"`, expected `object`."));var ee=t({},O[Q],y);for(var J in ee){var ne=y[J];if(r(y,J)&&typeof ne!="function")return B(j,F,Y,J,G(ne));if(!ne)return new p("Invalid "+F+" `"+Y+"` key `"+J+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(O[Q],null," ")+`
261
+ Valid keys: `+JSON.stringify(Object.keys(y),null," "));var M=ne(K,J,j,F,Y+"."+J,a);if(M)return M}return null}return A(T)}function _(y){switch(typeof y){case"number":case"string":case"undefined":return!0;case"boolean":return!y;case"object":if(Array.isArray(y))return y.every(_);if(y===null||l(y))return!0;var T=u(y);if(T){var O=T.call(y),Q;if(T!==y.entries){for(;!(Q=O.next()).done;)if(!_(Q.value))return!1}else for(;!(Q=O.next()).done;){var j=Q.value;if(j&&!_(j[1]))return!1}}else return!1;return!0;default:return!1}}function x(y,T){return y==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function k(y){var T=typeof y;return Array.isArray(y)?"array":y instanceof RegExp?"object":x(T,y)?"symbol":T}function G(y){if(typeof y>"u"||y===null)return""+y;var T=k(y);if(T==="object"){if(y instanceof Date)return"date";if(y instanceof RegExp)return"regexp"}return T}function P(y){var T=G(y);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function W(y){return!y.constructor||!y.constructor.name?m:y.constructor.name}return g.checkPropTypes=n,g.resetWarningCache=n.resetWarningCache,g.PropTypes=g,g},Os}var Ms,yn;function cd(){if(yn)return Ms;yn=1;var e=Ls();function t(){}function a(){}return a.resetWarningCache=t,Ms=function(){function r(i,l,h,c,d,u){if(u!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function n(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:n,element:r,elementType:r,instanceOf:n,node:r,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:a,resetWarningCache:t};return o.PropTypes=o,o},Ms}var Cn;function dd(){if(Cn)return Ft.exports;if(Cn=1,process.env.NODE_ENV!=="production"){var e=Us(),t=!0;Ft.exports=ld()(e.isElement,t)}else Ft.exports=cd()();return Ft.exports}var hd=dd();const ge=Qe(hd);var ud=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qs.apply(this,arguments)}function md(e,t){if(e==null)return{};var a={},r=Object.keys(e),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=e[n]);return a}function zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ds(e,t)}function Ds(e,t){return Ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ds(e,t)}var Wt=(function(e){fd(t,e);function t(){var r;return r=e.call(this)||this,r.handleExpired=r.handleExpired.bind(zt(r)),r.handleErrored=r.handleErrored.bind(zt(r)),r.handleChange=r.handleChange.bind(zt(r)),r.handleRecaptchaRef=r.handleRecaptchaRef.bind(zt(r)),r}var a=t.prototype;return a.getCaptchaFunction=function(n){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[n]:this.props.grecaptcha[n]:null},a.getValue=function(){var n=this.getCaptchaFunction("getResponse");return n&&this._widgetId!==void 0?n(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var n=this.getCaptchaFunction("execute");if(n&&this._widgetId!==void 0)return n(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var n=this;return new Promise(function(o,i){n.executionResolve=o,n.executionReject=i,n.execute()})},a.reset=function(){var n=this.getCaptchaFunction("reset");n&&this._widgetId!==void 0&&n(this._widgetId)},a.forceReset=function(){var n=this.getCaptchaFunction("reset");n&&n()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(n){this.props.onChange&&this.props.onChange(n),this.executionResolve&&(this.executionResolve(n),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var n=this.getCaptchaFunction("render");if(n&&this._widgetId===void 0){var o=document.createElement("div");this._widgetId=n(o,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(o)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(n){this.captcha=n},a.render=function(){var n=this.props;n.sitekey,n.onChange,n.theme,n.type,n.tabindex,n.onExpired,n.onErrored,n.size,n.stoken,n.grecaptcha,n.badge,n.hl,n.isolated;var o=md(n,ud);return Js.createElement("div",qs({},o,{ref:this.handleRecaptchaRef}))},t})(Js.Component);Wt.displayName="ReCAPTCHA",Wt.propTypes={sitekey:ge.string.isRequired,onChange:ge.func,grecaptcha:ge.object,theme:ge.oneOf(["dark","light"]),type:ge.oneOf(["image","audio"]),tabindex:ge.number,onExpired:ge.func,onErrored:ge.func,size:ge.oneOf(["compact","normal","invisible"]),stoken:ge.string,hl:ge.string,badge:ge.oneOf(["bottomright","bottomleft","inline"]),isolated:ge.bool},Wt.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var _s,Nn;function gd(){if(Nn)return _s;Nn=1;var e=Us(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},n={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=n;function i(f){return e.isMemo(f)?n:o[f.$$typeof]||t}var l=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,m=Object.prototype;function g(f,p,A){if(typeof p!="string"){if(m){var b=u(p);b&&b!==m&&g(f,b,A)}var S=h(p);c&&(S=S.concat(c(p)));for(var N=i(f),E=i(p),w=0;w<S.length;++w){var U=S[w];if(!a[U]&&!(A&&A[U])&&!(E&&E[U])&&!(N&&N[U])){var L=d(p,U);try{l(f,U,L)}catch{}}}}return f}return _s=g,_s}var pd=gd();const Ad=Qe(pd);function Gs(){return Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Gs.apply(this,arguments)}function wd(e,t){if(e==null)return{};var a={},r=Object.keys(e),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=e[n]);return a}function bd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ve={},vd=0;function yd(e,t){return t=t||{},function(r){var n=r.displayName||r.name||"Component",o=(function(l){bd(h,l);function h(d,u){var m;return m=l.call(this,d,u)||this,m.state={},m.__scriptURL="",m}var c=h.prototype;return c.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+vd++),this.__scriptLoaderID},c.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},c.asyncScriptLoaderHandleLoad=function(u){var m=this;this.setState(u,function(){return m.props.asyncScriptOnLoad&&m.props.asyncScriptOnLoad(m.state)})},c.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=ve[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var m in u.observers)u.observers[m](u);delete window[t.callbackName]},c.componentDidMount=function(){var u=this,m=this.setupScriptURL(),g=this.asyncScriptLoaderGetScriptLoaderID(),f=t,p=f.globalName,A=f.callbackName,b=f.scriptId;if(p&&typeof window[p]<"u"&&(ve[m]={loaded:!0,observers:{}}),ve[m]){var S=ve[m];if(S&&(S.loaded||S.errored)){this.asyncScriptLoaderHandleLoad(S);return}S.observers[g]=function(L){return u.asyncScriptLoaderHandleLoad(L)};return}var N={};N[g]=function(L){return u.asyncScriptLoaderHandleLoad(L)},ve[m]={loaded:!1,observers:N};var E=document.createElement("script");E.src=m,E.async=!0;for(var w in t.attributes)E.setAttribute(w,t.attributes[w]);b&&(E.id=b);var U=function(z){if(ve[m]){var Z=ve[m],H=Z.observers;for(var B in H)z(H[B])&&delete H[B]}};A&&typeof window<"u"&&(window[A]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),E.onload=function(){var L=ve[m];L&&(L.loaded=!0,U(function(z){return A?!1:(z(L),!0)}))},E.onerror=function(){var L=ve[m];L&&(L.errored=!0,U(function(z){return z(L),!0}))},document.body.appendChild(E)},c.componentWillUnmount=function(){var u=this.__scriptURL;if(t.removeOnUnmount===!0)for(var m=document.getElementsByTagName("script"),g=0;g<m.length;g+=1)m[g].src.indexOf(u)>-1&&m[g].parentNode&&m[g].parentNode.removeChild(m[g]);var f=ve[u];f&&(delete f.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete ve[u])},c.render=function(){var u=t.globalName,m=this.props;m.asyncScriptOnLoad;var g=m.forwardedRef,f=wd(m,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(f[u]=typeof window[u]<"u"?window[u]:void 0),f.ref=g,I.createElement(r,f)},h})(I.Component),i=I.forwardRef(function(l,h){return I.createElement(o,Gs({},l,{forwardedRef:h}))});return i.displayName="AsyncScriptLoader("+n+")",i.propTypes={asyncScriptOnLoad:ge.func},Ad(i,r)}}var js="onloadcallback",Cd="grecaptcha";function Qs(){return typeof window<"u"&&window.recaptchaOptions||{}}function Nd(){var e=Qs(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+js+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+js+"&render=explicit"}const Sn=yd(Nd,{callbackName:js,globalName:Cd,attributes:Qs().nonce?{nonce:Qs().nonce}:{}})(Wt),Hs=()=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:"sass-pg-cmt-lp-spin",children:s.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"})}),Sd={reportAbuseTitle:"Reportar Abuso",errorAlreadyReported:"Ya has reportado este comentario.",errorReportComment:"Error al reportar comentario",cancelButton:"Cancelar",reportButton:"Reportar",reportSuccessMessage:"¡Gracias por reportar!",reportCloseButton:"Cerrar"},Ed=({isOpen:e,onClose:t,commentId:a,publication:r,username:n,CAPTCHA_KEY_V2:o,texts:i})=>{const l={...Sd,...i?.comentarios},h={...Qt,...l.reportReasons??{}},[c,d]=I.useState("form"),[u,m]=I.useState(""),[g,f]=I.useState(""),[p,A]=I.useState(""),b=[{id:"spam",label:h.spam},{id:"inappropriate",label:h.inappropriate},{id:"hate",label:h.hate},{id:"misinformation",label:h.misinformation},{id:"terrorism",label:h.terrorism},{id:"intellectual",label:h.intellectual},{id:"bullying",label:h.bullying}],S=async()=>{if(!(!u||!a)){if(hn(document).includes(a)){f(l.errorAlreadyReported);return}d("loading"),f("");try{const w=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:r,username:n,id:a,captchaToken:p,type:Qt[u]})})).json();if(w.type==="success")ad(document,a),d("success"),setTimeout(()=>{N()},3e3);else throw new Error(w.message||l.errorReportComment)}catch(E){console.error("Error reporting comment:",E),f(E.message||l.errorReportComment),d("form")}}},N=()=>{d("form"),m(""),f(""),t()};return!e||!a||!n?null:s.jsx("div",{className:"sass-pg-cmt-rp-overlay",children:s.jsxs("div",{className:"sass-pg-cmt-rp-popup",children:[s.jsx("button",{className:"close-reply-form su-flex su-absolute su-p-0 su-bg-transparent su-border-none",onClick:N,children:s.jsx(Ye,{})}),s.jsx("h2",{className:"sass-pg-cmt-rp-title",children:l.reportAbuseTitle}),c==="loading"&&s.jsx("div",{className:"sass-pg-cmt-rp-loadingContainer",children:s.jsx(Hs,{})}),c==="form"||c==="loading"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sass-pg-cmt-rp-optionsContainer",children:b.map(E=>s.jsxs("label",{className:"sass-pg-cmt-rp-option",children:[s.jsx("input",{type:"radio",name:"reportReason",value:E.id,checked:u===E.id,onChange:w=>m(w.target.value),className:"sass-pg-cmt-rp-radioInput"}),s.jsx("span",{className:"sass-pg-cmt-rp-radioCustom"}),s.jsx("span",{className:"sass-pg-cmt-rp-optionLabel",children:E.label})]},E.id))}),g&&s.jsx("div",{className:"sass-pg-cmt-rp-errorMessage",children:g}),s.jsx(Sn,{sitekey:o,theme:"light",size:"normal",onChange:E=>A(E??""),onExpired:()=>A("")}),s.jsxs("div",{className:"sass-pg-cmt-rp-buttons",children:[s.jsx("button",{onClick:N,className:"sass-pg-cmt-rp-cancelButton",children:l.cancelButton}),s.jsx("button",{onClick:S,disabled:!u,className:"sass-pg-cmt-rp-reportButton",children:l.reportButton})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"sass-pg-cmt-rp-successContainer",children:[s.jsx("div",{className:"sass-pg-cmt-rp-thumbsUp",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:s.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"})})}),s.jsx("p",{className:"sass-pg-cmt-rp-successMessage",children:l.reportSuccessMessage})]}),s.jsx("div",{className:"sass-pg-cmt-rp-buttons",children:s.jsx("button",{onClick:N,className:["sass-pg-cmt-rp-closeButton","sass-pg-cmt-rp-buttonAlone"].join(" "),children:l.reportCloseButton})})]})]})})};function Td(e){const t=/^\[\[([^\]]+)\]\]/,a=e.match(t);return a?{user:{username:a[1],firstname:a[1],lastname:""},text:e.replace("[["+a[1]+"]]","")}:{user:!1,text:e}}function Yt(e){const t=e.comments.map(a=>{if(a.user)return{...a,user:a.user,text:a.text,reply:a.reply?Yt({comments:a.reply}).comments:a.reply};const{user:r,text:n}=Td(a.text);return{...a,user:r||!1,text:n,reply:a.reply?Yt({comments:a.reply}).comments:a.reply}});return{...e,comments:t}}async function Kt({publication:e,path:t,size:a=5,sizereply:r=2,id:n,lastid:o,state:i="5,6",apiToken:l,API_ENV:h}){const{PUBLIC_ENV:c}=h;if(c==="prod"){const d=await En({publication:e,path:t,size:a,sizereply:r,id:n,lastid:o,state:i,apiToken:l,API_ENV:h});return Yt(d[0])}else{const d=await fetch(`/api/comments-get?publication=${e}&path=${t}&size=${a}&sizereply=${r}&lastid=${o}`);if(!d.ok)throw new Error(`Error al obtener comentarios: ${d.status}`);const u=await d.json();return Yt(u.data[0])}}async function En({publication:e,path:t,size:a=5,sizereply:r=2,id:n,lastid:o,state:i="5,6",apiToken:l,API_ENV:h}){if(!e||!t)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof t!="string")throw new Error("Invalid input types for publication or path");if(!l)throw new Error("Missing CMS API token");const{PUBLIC_ENV:c,PUBLIC_API_HOST:d="dummy",PUBLIC_API_PATH:u,PUBLIC_API_PATH_VERSION:m}=h,g=parseInt(String(a),10),f=parseInt(String(r),10);if(isNaN(g)||g<=0)throw new Error("Invalid size parameter");if(isNaN(f)||f<0)throw new Error("Invalid sizereply parameter");const p=c!=="prod"?`${d}${u}`:"",A=new URLSearchParams({publication:e,path:t,size:g.toString(),sizereply:f.toString(),state:i});n&&A.append("id",n),o&&A.append("lastid",o);const b=`${p}${m}/newcomments/get?${A.toString()}`;try{const{data:S}=await re.get(b,{headers:{"x-api-token":l,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!S)throw new Error("No comments data received");return S.data||S||[]}catch(S){if(console.error("Error fetching comments:",S),re.isAxiosError(S)){const N=S.response?.status,E=S.response?.data;throw N===404?new Error("Comments not found"):N===403?new Error("Access forbidden - check API token"):N===401?new Error("Unauthorized - invalid API token"):N===500?new Error("Internal server error from CMS"):new Error(E?.error||E?.message||`HTTP ${N}: Failed to fetch comments`)}throw S}}const Id=(e,t)=>{const[a,r]=I.useState(void 0),{PUBLIC_PUBLICATION_ID:n}=t,o=n;return I.useEffect(()=>{if(a)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:l}=t;try{const h=await Kt({publication:o,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:l,API_ENV:t});r(h??[])}catch{r({comments:[],morecomment:!1})}})()},[a]),{comments:a,setComments:r}},Tn=({username:e,date:t,DATE_CONFIG:a})=>s.jsxs("div",{className:"comment-header su-flex su-items-center su-relative su-flex-wrap",children:[s.jsx("span",{className:"comment-username su-font-bold su-truncate",children:e}),s.jsx("span",{className:"comment-header-dot",children:"•"}),s.jsx("span",{className:"comment-date su-truncate",children:sd(ye(Number(t),a))})]}),In=({user:e})=>s.jsx("div",{className:"comment-avatar su-flex-center su-rounded-full su-font-bold su-overflow-hidden",children:e.picture?s.jsx("img",{className:"comment-avatar-img su-h-full",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),Un=({isReply:e=!1,onReply:t,onFlag:a})=>s.jsxs("div",{className:"comment-actions su-flex",children:[!e&&t&&s.jsx("button",{onClick:t,className:"comment-action-btn su-flex su-items-center su-gap-1 su-bg-transparent su-border-none",children:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[s.jsx("g",{clipPath:"url(#a)",children:s.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"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),s.jsx("button",{onClick:a,className:"comment-action-btn su-flex su-items-center su-gap-1 su-bg-transparent su-border-none",children:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[s.jsx("g",{clipPath:"url(#a)",children:s.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"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Fs=({commentRef:e,captchaToken:t="",setIsDisabled:a,API_ENV:r})=>(I.useEffect(()=>{const n=e.current;if(!n)return;const o=()=>{const l=n.value.length;n.parentElement&&(n.parentElement.dataset.text=`${l}/${Te}`),n.classList.toggle("over-limit",l>Te),a(!Ht(e,t,r).boolean)};return n.addEventListener("input",o),o(),()=>n.removeEventListener("input",o)},[e,t,a]),s.jsxs("div",{className:"su-relative",children:[s.jsx("label",{className:"su-block su-font-normal comment-input-label",children:"Comentario"}),s.jsx("textarea",{className:"su-w-full su-border-none su-outline-none",ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),Vs=({commentRef:e,captchaToken:t="",setCaptchaToken:a,children:r,API_ENV:n})=>{const o=Ht(e,t,n);return s.jsxs("div",{className:"form-actions su-flex-between",children:[s.jsx(Sn,{sitekey:n.CAPTCHA_KEY_V2??"",theme:"light",size:"normal",onChange:i=>a(i??""),onExpired:()=>a("")}),s.jsxs("div",{className:"submit-zone su-relative su-flex su-flex-col su-items-end",children:[r,!o.boolean&&s.jsx("p",{className:"submit-warning su-hidden su-font-normal su-p-0",children:o.text})]})]})},Ud={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con GOOGLE",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function kd({onClose:e,handleGoogleLogin:t,icon:a,texts:r,API_ENV:n}){const o={...Ud,...r?.comentarios},i=m=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`,window.location.pathname="/auth/login"+(m?"#forgot":""))},l=()=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`,window.location.pathname="/auth/register")},{S3_ID_DIR:h="",PUBLIC_ENV:c,PUBLIC_ASSETS_URL:d}=n,u=c=="local"?"":d&&d!=="false"?d:"";return s.jsx("div",{className:"sass-pg-cmt-lp-overlay",role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:m=>{const g=m.target;g&&g.id==="pop-overlay"&&e()},children:s.jsxs("div",{className:"sass-pg-cmt-lp-card",children:[s.jsxs("header",{className:"sass-pg-cmt-lp-header",children:[s.jsx("div",{className:"sass-pg-cmt-lp-logo",children:a?a():null}),s.jsx("button",{onClick:()=>{e()},className:"sass-pg-cmt-lp-close","aria-label":"Cerrar",children:s.jsx(Ye,{})})]}),s.jsxs("div",{className:"sass-pg-cmt-lp-anonimusWrapper",children:[s.jsx("img",{className:"sass-pg-cmt-lp-anonimusImage",src:u+(u!==""?"/arte/"+h:"")+"/anonimus-img.png",alt:"Imagen incognito"}),s.jsx("button",{onClick:()=>{e(!0)},className:"sass-pg-cmt-lp-anonimus",children:s.jsx("span",{children:"Continuar de forma anónima"})})]}),s.jsx("div",{className:"sass-pg-cmt-lp-divider",children:s.jsx("span",{children:"o"})}),s.jsxs("button",{onClick:t,className:"sass-pg-cmt-lp-google",children:[s.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:"sass-pg-cmt-lp-googleIcon"}),s.jsx("span",{children:o.GoogleButtonText})]}),s.jsx("button",{type:"submit",className:"sass-pg-cmt-lp-primary",onClick:()=>{i(!1)},children:o.loginButtonText}),s.jsxs("p",{className:"sass-pg-cmt-lp-switch",children:[o.noAccountText,s.jsx("button",{type:"button",onClick:l,children:o.registerButtonText})]}),s.jsx("button",{type:"button",className:"sass-pg-cmt-lp-forgotPassword",onClick:()=>{i(!0)},children:o.forgotPasswordText})]})})}const zs=({onClick:e,isDisabled:t,API_ENV:a,icon:r,handleGoogleLogin:n,showAlert:o})=>{const[i,l]=I.useState(!1),{S3_ID_DIR:h="",PUBLIC_ENV:c,PUBLIC_API_HOST:d="",PUBLIC_ASSETS_URL:u}=a,[m,g]=I.useState(!1),[f,p]=I.useState(!1);I.useEffect(()=>{let b=null;return i&&(b=setTimeout(()=>{l(!1)},2400)),()=>{b&&clearTimeout(b)}},[i]);const A=c=="local"?d:u&&u!=="false"?u:"";return i?s.jsx("div",{className:"success-gif-container su-flex-center su-relative",children:s.jsx("img",{className:"success-gif su-absolute",src:A+"/arte/"+h+"/Success.gif"})}):s.jsxs(s.Fragment,{children:[f&&a.CONFIG_commentsV2&&o&&s.jsx(kd,{API_ENV:a,icon:r,handleGoogleLogin:n,onClose:b=>{b&&g(!0),p(!1)}}),s.jsxs("button",{type:"button",onClick:async b=>{if(!m&&a.CONFIG_commentsV2&&o){p(!0),console.log("open popup");return}await e(b)&&(a.CONFIG_commentsV2&&o&&g(!1),l(!0))},id:"comment-button",className:`submit-btn su-bg-transparent su-font-bold ${t?"disabled":"active"}`,children:["Enviar Comentario",s.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.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"})})]})]})},Ws=async({path:e,ref:t,captchaToken:a,button:r,user:n,id:o,addComment:i,API_ENV:l,anonimusUser:h})=>{const c=t.current?.value||"",{PUBLIC_PUBLICATION_ID:d}=l,u=d;if(console.log("check",n,h),!Ht(t,a,l).boolean||!n&&!h){console.log("warn");const g=r.nextElementSibling;return g&&(g.style.display="block"),!1}if(!n&&!h)return;const m=n?c:"[["+h+"]] "+c;try{const g=Date.now(),f=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:u,path:e,id:o,username:n?n.username:!1,comment:m,recaptchaResponse:a})});let p=null;try{p=await f.json()}catch(E){console.error("Error parsing JSON response:",E)}if(!f.ok)throw new Error(`Error al enviar comentario: ${p?.message} status: ${f.status}`);const A=Date.now(),b=Math.max(0,2400+Math.abs(A-g)),S=n||{username:h,firstname:h},N={username:S.username,firstname:S.firstname,...S.lastname&&{lastname:S.lastname},...S.picture&&{picture:S.picture}};return i({id:A.toString(),text:c,user:N,date:{time:Date.now()},reply:[]}),t.current&&(t.current.value=""),b}catch(g){return console.error("Error enviando comentario:",g),alert(g.message||"Error al enviar el comentario."),!1}},xd=({replyingTo:e,commentRef:t,user:a,path:r,addReply:n,closeForm:o,API_ENV:i})=>{const[l,h]=I.useState(!0),[c,d]=I.useState(""),u=()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0),o()};return s.jsxs("div",{className:"comment-form reply-form su-p-8 su-relative",children:[s.jsx("button",{className:"close-reply-form su-flex su-absolute su-p-0 su-bg-transparent su-border-none",onClick:u,children:s.jsx(Ye,{})}),s.jsx(Fs,{commentRef:t,captchaToken:c,setIsDisabled:h,API_ENV:i}),s.jsx(Vs,{commentRef:t,captchaToken:c,setCaptchaToken:d,API_ENV:i,children:s.jsx(zs,{onClick:async m=>{if(l)return;const g=await Ws({path:r,ref:t,captchaToken:c,button:m.currentTarget,user:a,id:e,addComment:n,API_ENV:i});return g&&typeof g=="number"?(setTimeout(()=>{u()},g),!0):!1},isDisabled:l,API_ENV:i})})]})},Ld=({reply:e,replyingTo:t,user:a,onFlag:r,DATE_CONFIG:n})=>{const o=e.text;let i=`${Ie.firstname} ${Ie.lastname??""}`,l=Ie.username;return e.user&&(i=`${e.user.firstname} ${e.user.lastname??""}`,l=e.user.username),s.jsx("div",{className:"comment-item reply",children:s.jsxs("div",{className:"comment-header-container su-flex su-relative",children:[s.jsx(In,{user:e.user?e.user:Ie}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Tn,{username:i,date:e.date.time,DATE_CONFIG:n}),s.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",s.jsx("strong",{children:t})]}),s.jsx("p",{className:"comment-text su-font-normal",children:o}),a?.username.toLowerCase()!==l.toLowerCase()&&s.jsx(Un,{isReply:!0,onFlag:()=>r(e.id)})]})]})})},Pd={moreRepliesButton:"Más Respuestas"},Bd=({comment:e,replyingTo:t,path:a,user:r,handleReplyingTo:n,onFlag:o,API_ENV:i,texts:l})=>{const h={...Pd,...l?.comentarios},c={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[d,u]=I.useState(c),[m,g]=I.useState(!1),{PUBLIC_PUBLICATION_ID:f,PUBLIC_X_SECURITY_TOKEN:p}=i,A=e.text,b=I.useRef(null);let S=`${Ie.firstname} ${Ie.lastname??""}`,N=Ie.username;e.user&&(S=`${e.user.firstname} ${e.user.lastname??""}`,N=e.user.username);const E=w=>{u({morereply:d.morereply,reply:[w,...d.reply]})};return s.jsx("div",{className:"comment-item",children:s.jsxs("div",{className:"comment-header-container su-flex su-relative","data-hasreplies":d.reply.length>0?"true":"false",children:[s.jsx(In,{user:e.user?e.user:Ie}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Tn,{username:S,date:e.date.time,DATE_CONFIG:i}),s.jsx("p",{className:"comment-text su-font-normal",children:A}),r?.username.toLowerCase()!==N.toLowerCase()&&s.jsx(Un,{onReply:()=>n(e.id),onFlag:()=>o(e.id)}),t===e.id&&r&&s.jsx(xd,{replyingTo:t,commentRef:b,addReply:E,user:r,path:a,API_ENV:i,closeForm:()=>n("")}),d.reply.length>0&&s.jsxs("div",{className:"comment-replies",children:[d.reply.map(w=>s.jsx(Ld,{user:r,reply:w,replyingTo:S,onFlag:o,DATE_CONFIG:i},w.id)),m?s.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:s.jsx(Hs,{})}):d.morereply&&s.jsx("button",{className:"comment-replies-button reply-button su-flex-center su-rounded-full su-border-none su-relative",onClick:async()=>{const w=d.reply[d.reply.length-1]?.id;g(!0);try{const L=await Kt({publication:f??"",path:a??"",size:2,sizereply:2,id:e.id,lastid:w,state:"5,6",apiToken:p??"",API_ENV:i});g(!1),u({morereply:L.morecomment,reply:[...d.reply,...L.comments]})}catch(U){throw g(!1),new Error(`Error al obtener comentarios: ${U}`)}},children:h.moreRepliesButton})]})]})]})})},Od=({commentRef:e,user:t,path:a,addComment:r,API_ENV:n})=>{const[o,i]=I.useState(!0),[l,h]=I.useState("");return s.jsxs("div",{className:"comment-form su-p-8 su-relative",children:[s.jsx(Fs,{commentRef:e,captchaToken:l,setIsDisabled:i,API_ENV:n}),s.jsx(Vs,{API_ENV:n,commentRef:e,captchaToken:l,setCaptchaToken:h,children:s.jsx(zs,{onClick:async c=>{if(o)return;const d=await Ws({path:a,ref:e,captchaToken:l,button:c.currentTarget,user:t,addComment:r,API_ENV:n});return d&&typeof d=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${Te}`),i(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${Te}`),i(!0)},d),!0):!1},isDisabled:o,API_ENV:n})})]})},Md=({usernameRef:e})=>s.jsxs("div",{className:"comment-username su-font-bold su-truncate",children:[s.jsx("label",{className:"su-block su-font-normal comment-input-label",children:"Nombre"}),s.jsx("input",{ref:e,name:"username",className:"su-w-full su-border-none su-outline-none",placeholder:"Ingresa tu nombre"})]}),qd=({usernameRef:e,commentRef:t,path:a,icon:r,handleGoogleLogin:n,addComment:o,API_ENV:i})=>{const[l,h]=I.useState(!0),[c,d]=I.useState(""),u=async m=>{if(l){console.log("error");return}if(!Ht(t,c,i).boolean){console.log("invalidForm");return}const g=e.current.value,f=await Ws({path:a,ref:t,captchaToken:c,button:m.currentTarget,user:void 0,addComment:o,API_ENV:i,anonimusUser:g});return d(""),f&&typeof f=="number"?(t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0),setTimeout(()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${Te}`),h(!0)},f),!0):!1};return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"comment-form anoninus-form su-p-8 su-relative",children:[s.jsx(Md,{usernameRef:e}),s.jsx(Fs,{commentRef:t,captchaToken:c,setIsDisabled:h,API_ENV:i}),s.jsx(Vs,{API_ENV:i,commentRef:t,captchaToken:c,setCaptchaToken:d,children:s.jsx(zs,{onClick:u,isDisabled:l,API_ENV:i,handleGoogleLogin:n,icon:r,showAlert:!0})})]})})},Dd={commentsSectionTitle:"COMENTARIOS",commentHeaderMessageEmpty:"Se el primero en compartir tu opinión de este artículo.",commentHeaderMessageWithComments:"Comparte tu opinión de este artículo.",loadMoreButton:"Más",moreRepliesButton:"Más Respuestas"},_d=({isAuthenticated:e,path:t,user:a,handleLogout:r,icon:n,handleGoogleLogin:o,API_ENV:i,texts:l})=>{const h={...Dd,...l?.comentarios},{PUBLIC_PUBLICATION_ID:c,PUBLIC_X_SECURITY_TOKEN:d}=i,u=c??"",m=t.replaceAll("/","|"),[g,f]=I.useState(void 0),[p,A]=I.useState(""),{comments:b,setComments:S}=Id(m,i),[N,E]=I.useState(!1),w=I.useRef(null),U=I.useRef(null),L=x=>{A(p===x?"":x)},z=x=>{S(b?{...b,comments:[x,...b.comments??[]]}:void 0)},Z=x=>{f(x)},H=async()=>{if(!b||!b.morecomment||b.comments.length===0)return;const x=b.comments[b.comments.length-1];if(!x)return;E(!0);const k=x.id;try{const G=await Kt({publication:u,path:m??"",size:5,sizereply:2,id:void 0,lastid:k,state:"5,6",apiToken:d,API_ENV:i});S({morecomment:G.morecomment??!1,comments:[...b.comments,...G.comments]}),E(!1)}catch(G){throw E(!1),new Error(`Error al obtener comentarios: ${G}`)}},B=b?.comments&&b.comments.length>0,V=B?h.commentHeaderMessageWithComments:h.commentHeaderMessageEmpty,te=s.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:s.jsx(Hs,{})}),_=()=>{!window||!window.location||(document.cookie=`redirect_after_login_1=${window.location.pathname}; path=/; max-age=10000`,window.location.pathname="/auth/login")};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"comments-container",children:s.jsx(de,{title:i.CONFIG_commentsV2||B||e?h.commentsSectionTitle:!1,children:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"comments-header",children:e&&a?s.jsxs(s.Fragment,{children:[s.jsx(Rc,{user:a,handleLogout:r,message:V}),s.jsx(Od,{commentRef:w,user:a,addComment:z,path:m,API_ENV:i})]}):i.CONFIG_commentsV2?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"anonimus-message",children:["¿Querés debatir con otros lectores? Comentá ahora de forma anónima o ",s.jsx("button",{className:"su-border-none su-p-0",onClick:_,children:"INICIA SESIÓN AQUÍ"})," para responder a otros usuarios y ser parte activa de nuestra comunidad."]}),s.jsx(qd,{usernameRef:U,commentRef:w,icon:n,handleGoogleLogin:o,addComment:z,path:m,API_ENV:i})]}):null}),b?b.comments&&b.comments.length>0?s.jsxs("div",{className:"comments-list","data-isauthenticated":`${e}`,children:[b.comments.map(x=>s.jsx(Bd,{comment:x,replyingTo:p,handleReplyingTo:L,onFlag:Z,user:a??Ie,path:m,API_ENV:i,texts:l},x.id)),N&&te]}):null:te,b?.morecomment&&!N&&s.jsx("button",{className:"comment-replies-button su-flex-center su-rounded-full",onClick:H,children:h.loadMoreButton})]})})}),s.jsx(Ed,{username:a?.username??void 0,publication:u,commentId:g,isOpen:g!==void 0,onClose:()=>f(void 0),CAPTCHA_KEY_V2:i.CAPTCHA_KEY_V2??"",texts:l})]})};function Gd({isAuthenticated:e,setIsAuthenticated:t,loginUrl:a,user:r,path:n,checkAuth:o,icon:i,API_ENV:l,texts:h}){const c=async()=>{if(l.PUBLIC_ENV==="local")await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),t(!1);else{const u=window.location.pathname;window.location.href=`${window.location.origin}/api/auth/logout?redirect=${encodeURIComponent(u)}`}},d=async()=>{if(l.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),o();return}if(!a)return;const u=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${u}`};return s.jsx(s.Fragment,{children:s.jsx(_d,{isAuthenticated:e,handleLogout:c,handleGoogleLogin:d,icon:i,path:n,user:e?r:void 0,API_ENV:l,texts:h})})}function jd({isVisible:e,path:t,icon:a,API_ENV:r,texts:n}){const[o,i]=I.useState(null),[l,h]=I.useState(null),c=r?.COGNITO_AUTH_PREFIX??"ASTRO_",d=I.useCallback(async()=>{if(e){if(document.cookie.search(c+"IS_AUTH=true")===-1){i(!1),h(null);return}try{const p=await(await fetch("/api/auth/user",{credentials:"include"})).json();i(p.isAuthenticated??!1),h(p.user??null)}catch(f){console.error("Error checking auth:",f),i(!1),h(null)}}},[e,c]);I.useEffect(()=>{d()},[d,e]),I.useEffect(()=>{if(!l||!e||typeof window>"u")return;const f=window;if(typeof f!="function"){console.warn("gtag no está disponible todavía");return}f.gtag("set",{user_id:l.username}),console.log("username setted successfully")},[l,e]);const u="/api/auth/login",m=s.jsx("div",{className:"su-flex-center su-relative",style:{minHeight:310}});if(o===null)return m;const g=t.replaceAll("|","/");return e?s.jsx(Gd,{icon:a,isAuthenticated:o,setIsAuthenticated:i,loginUrl:u,user:l??void 0,checkAuth:d,path:g,API_ENV:r,texts:n}):m}const Qd=({internalPath:e,icon:t,API_ENV:a,texts:r})=>(I.useEffect(()=>{if(!document)return;if(document.getElementById("recaptcha-enterprise-script"))return console.log("recaptcha already appended");const o=document.createElement("script");o.id="recaptcha-enterprise-script",o.defer=!0,o.async=!0,o.src=`https://www.google.com/recaptcha/enterprise.js?render=${a.CAPTCHA_KEY}`,document.body.appendChild(o),console.log("appended recaptcha")},[]),s.jsx("div",{suppressHydrationWarning:!0,children:s.jsx(jd,{path:e,icon:t,isVisible:!0,API_ENV:as(a),texts:r})})),Hd=({section:e,internalPath:t,stylesConfig:a,paths:r,API_ENV:n,fetchConfig:o})=>s.jsx("div",{suppressHydrationWarning:!0,style:a["Modulo 1x3 Client"]??a["Modulo 1x3"],children:s.jsx($c,{section:e,internalPath:t,stylesConfig:a,isVisible:!0,paths:r,fetchConfig:o,API_ENV:as(n)})});async function Fd({publication:e,path:t,username:a,comment:r,id:n,recaptchaResponse:o,baseUrl:i,apiToken:l,securityToken:h,COMMENTS_VARS:c}){if(console.log("Adding comment with data:",{publication:e,path:t,username:a,comment:r,id:n,recaptchaResponse:o}),!e||!t||!r)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,t,r].some(f=>typeof f!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!r.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const d=await dn(o,c);if(console.log("Verifying captcha token...",d),!d)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const u=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,m={publication:e,path:t.replace(/\|/gi,"/"),text:r.trim()};a&&(m.username=a),n&&(m.id=n);const g=new URLSearchParams(m);try{const{data:f}=await re.get(`${u}?${g.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":h,"x-api-token":l,"User-Agent":"amplifyapp-comments-saas"}});return!f||f.error?(console.error("CMS error response:",f),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",f),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(f){if(console.error("Error enviando comentario:",f),re.isAxiosError(f)){const p=f.response?.status??500,A=f.response?.data;return p===400?{type:"error",message:A?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:p===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:p===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:A?.message||"No se pudo enviar el comentario.",status:p}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const Ys=async(e,t)=>{if(!e)throw new Error("No action provided");if(!t)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((r,n)=>{a.enterprise.ready(async()=>{try{const o=await a.enterprise.execute(t,{action:e});if(!o)throw new Error("Captcha token no generado");r(o)}catch(o){n(o)}})})},Vd=async({token:e,projectId:t,captchaKey:a,apiKey:r,captchaAction:n})=>{if(!e)throw new Error("No token provided");if(!t||!a||!r)throw new Error("Missing project ID or site key");if(!n)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${t}/assessments?key=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:n}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==n)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(o){throw console.error("Recaptcha verification failed",o),new Error(String(o))}},zd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,cardWidth:200,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return s.jsx(ot,{...l,titleGradient:!0,paths:e.paths},i)})})})},Wd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,cardWidth:343,cardGap:32,visibleItems:3,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return s.jsx(ot,{...l,titleGradient:!0,paths:e.paths},i)})})})},Yd=e=>{const{content:t,title:a,slot_id:r}=e,n=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&s.jsx(de,{title:a,titleUrl:e.titleUrl,children:s.jsx(qe,{slot_id:r,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:t.map((o,i)=>{const l={...o,main:{...o.main,title:{...o.main.title,section:n?o.main.title.home:o.main.title.section}}};return I.createElement(ot,{...l,key:i,titleGradient:!0,paths:e.paths})})})})},Jt=e=>{const t={};for(const a in e)a.startsWith("--")&&(t[a]=e[a]);return t},Kd=e=>{const{content:t,title:a,isVideo:r}=e;if(!t||t.length===0)return;const n=t[0],o=t.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return n&&o&&s.jsxs(de,{title:a,titleUrl:e.titleUrl,children:[s.jsx("div",{className:"sass-bd-dnfw-headerSection",children:s.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:"sass-bd-dnfw-image",href:n?.info?.link?.url,target:n?.info?.link?.target,children:[s.jsxs("div",{className:"sass-bd-dnfw-blockHeadContainer",children:[s.jsx("p",{className:"sass-bd-dnfw-title",children:n?.main?.title.home}),n?.main?.subtitle?.rendered&&s.jsx("p",{className:"sass-bd-dnfw-subtitle",children:n?.main?.subtitle?.striped})]}),s.jsx(we,{preview:n.preview})]})}),s.jsxs("div",{className:"sass-bd-dnfw-containerCards",children:[s.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),s.jsx("div",{className:"sass-bd-dnfw-newsContent",children:Array.isArray(o)&&o.map((l,h)=>{const c={...l,main:{...l.main,title:{...l.main.title,section:i?l.main.title.home:l.main.title.section}}};return s.jsx("div",{style:{order:h},children:s.jsx(Se,{...c,isVideo:r,paths:e.paths})},h)})})]})]})},Jd=({printEdition:e,title:t})=>e&&s.jsx(de,{title:t,children:s.jsx("div",{className:"iframe-container",dangerouslySetInnerHTML:{__html:e||""}})}),kn={banner:e=>s.jsx(le,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>s.jsx(xt,{...e}),"Modulo 1x3":e=>s.jsx(Ts,{...e}),"Modulo 1x4":e=>s.jsx(Yr,{...e}),"Modulo 1x5":e=>s.jsx(Kr,{...e}),"Destacado noticias":e=>s.jsx(zr,{...e}),"Destacado full width":e=>s.jsx(Kd,{...e}),"Destacado videos":e=>s.jsx(Jr,{...e}),"Carrusel card":e=>s.jsx(Zr,{...e}),"Carrusel story":e=>s.jsx(zd,{...e}),"Carrusel owl":e=>s.jsx(Wd,{...e}),"Modulo fotogaleria":e=>s.jsx(Yd,{...e}),"Carrusel opinion":e=>s.jsx(Xr,{...e}),"Modulo 1x3 card":e=>s.jsx($r,{...e}),"Modulo iframe":e=>s.jsx(Jd,{...e})};function Ks({component:e,slot_id:t,data:a,banners:r}){if(r)return kn[e]&&s.jsx("div",{className:"home-slot",style:Jt(a),children:kn[e]({...a,banners:r,slot_id:t})})}function $d({children:e,stylesConfigEntry:t}){return s.jsx("div",{className:"home-slot",style:Jt(t),children:e})}const xn={Diario:e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return s.jsx(Fr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:t,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths,textPosition:e.textPosition})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return s.jsx(Fr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:t,banners:e.banners,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>s.jsx(Ke,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>s.jsx(Vl,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>s.jsx(Fl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},$t=({component:e,data:t,banners:a,rightOnlyBanner:r})=>s.jsx("div",{style:Jt(t),children:xn[e]&&xn[e]({...t,rightOnlyBanner:r,banners:a})}),Zd=({slots:e,DYNAMIC_SLOT_SUBINDEXES:t,stylesConfig:a,AutorIcon:r,config:n,banners:o,showTagBySection:i})=>{const l=[],c=t,d=Object.keys(e).length/c;for(let u=1;u<=d;u++)for(let m=1;m<=c;m++){const g="Home_"+u+"_"+m;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||(e[g].blockSass[0]?.block==="Modulo iframe"?l.push(s.jsxs(ps,{id:e[g].blockSass[0].key,show:!!e[g].blockSass[0].value,order:(u-1)*c+(m-1),children:[s.jsx(Ks,{component:e[g].blockSass[0].block,banners:o,slot_id:g,data:{printEdition:e[g]?.blockSass[0].value,title:e[g]?.blockSass[0].title??"",titleUrl:e[g].blockSass[0].link??void 0}}),s.jsx(We,{children:s.jsx(De,{banners:o,index:"dynamic_"+u+"_"+m})})]},u+"_"+m)):l.push(s.jsxs(ps,{id:e[g].blockSass[0].key,show:!!e[g].content?.data,order:(u-1)*c+(m-1),children:[s.jsx(Ks,{component:e[g].blockSass[0].block,banners:o,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:s.jsx(r,{}),paths:n.paths,showTagBySection:i}}),s.jsx(We,{children:s.jsx(De,{banners:o,index:"dynamic_"+u+"_"+m})})]},u+"_"+m)))}return l},Xd=({mainBlock:e,StylesConfigMain:t,config:a,banners:r})=>{const{PUBLIC_ENV:n}=D();if(n!=="local")return null;const o=e?.news?.data||[],i=(l,h)=>({...e?.news,...t[l],data:o.slice(0,h),paths:a.paths});return s.jsxs(s.Fragment,{children:[s.jsx($t,{component:"Super",data:i("Super",1),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})}),s.jsx($t,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})}),s.jsx($t,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:r}),s.jsx(We,{children:s.jsx(De,{banners:r,index:1})})]})};v.AssetsPreconnect=Aa,v.AutorComponent=Mc,v.AutorHeader1=Mr,v.AutorHeader2=qr,v.BannerAdvertising=le,v.BannerAdvertisingMiddle=De,v.CarrouselCSR=ll,v.CarrouselIRS=qe,v.CarruselCard=Zr,v.CarruselOpinion=Xr,v.CommentLazyLoader=Qd,v.CommonServices=ke,v.Comscore=$s,v.ContactInfoServer=Rl,v.ContactInput=Ll,v.ContactSelect=Pl,v.ContactTextarea=Bl,v.ContentLayout1=kt,v.ContentLayoutTema=Ns,v.DEBUG_MainSlots=Xd,v.DestacadoNoticias=zr,v.DestacadoVideos=Jr,v.DynamicBlockServices=gr,v.DynamicComponents=Zd,v.DynamicMainSlot=$t,v.DynamicSlot=Ks,v.EditorialBlock=Yl,v.ErrorComponent=xl,v.Font=Ia,v.Footer=Il,v.FormatAfterScripts=pa,v.FormatScripts=es,v.GA4=Zs,v.GTM=Xs,v.GalleryHeader=rn,v.GenerateBody=rl,v.GenerateHead=al,v.Header=Ql,v.HeaderSectionComponent=sn,v.IframeHeader=tn,v.ImageOffline=yr,v.ImageOnline=we,v.ImageOnlineClient=vr,v.IssuuServices=Zi,v.ItemListSchema=Ca,v.JournalistArticule2=Qr,v.JournalistGroup=Hr,v.LayoutNewsComponent=Ss,v.LinkComponent=q,v.LiveBlogHeader=Pr,v.Location=ol,v.LoginForm=jc,v.MainComponentServices=Io,v.Marfeel=Rs,v.MasNoticiasLazyLoader=Hd,v.MiddleSection=We,v.Modulo1x3=Ts,v.Modulo1x3Card=$r,v.Modulo1x4=Yr,v.Modulo1x5=Kr,v.Modulo2Columnas=Kl,v.Modulo3Columnas=Wr,v.ModuloNewsletter=Jl,v.ModuloOpinion=Wl,v.NewListResponseDataPH=cn,v.NewsArticle=Na,v.NewsComponent=Pc,v.NewsContent=Mt,v.NewsDescriptionComponent=_e,v.News_Content=on,v.NextPrev=nt,v.OrgList=Sa,v.PreloadImages=ss,v.REPORT_REASONS=Qt,v.ReCaptchaRender=qn,v.Readest=xt,v.RegisterForm=_c,v.ScriptHydrator=Wc,v.SearchSection=Oc,v.Section=de,v.SectionCard=Se,v.SectionCard2=ot,v.SectionCardServerComponent=jt,v.SectionServerComponent=Xl,v.ShowSection=ps,v.SocialNetworks=Is,v.SpeculationRules=ya,v.Spin=Je,v.StaticSlotWrapper=$d,v.SubscribeColumn=Sr,v.SubscribeRow=Er,v.SubscribeWhatsAppColumn=wl,v.TagHeader=Hl,v.TagSection=jr,v.TimeLine=Br,v.TrimPathname=ho,v.TwitterHydration=Yc,v.VideoBlock3=kl,v.VideoBlock4=ql,v.VideoEmbeddedHeader=Rr,v.VideoYoutubeHeader=en,v.VideosSchemas=Ta,v.WebsiteList=Ea,v.addComment=Fd,v.bannersReplace=pt,v.becomeVideoObject=He,v.buildTagUrl=Ue,v.coloringByStrokeSVGs=Tl,v.compileStyleProps=Jt,v.createAssessment=wo,v.cutString=Ce,v.decodeApiEnv=as,v.encodeApiEnv=yo,v.extractMainSlug=Ae,v.extractRealtedNews=ao,v.extractRelatedNews=gt,v.formatDate=ye,v.formatDateEdiciones=Rn,v.formatDateJournalistArticule=ft,v.formatDateTimeline=oa,v.formatNewsMeta=ha,v.formatVideoData=wa,v.generalGetData=el,v.getCaptchaToken=Ys,v.getComments=En,v.getConfig=D,v.getDynamicSlots=Xi,v.getEnvironmentUrl=$e,v.getEnvironmentUrlFront=ro,v.getHydratorPath=go,v.getImageUrl=ie,v.getNextMeta=Ze,v.getPage=Re,v.getPlayIcon=vs,v.getPreloadImages=So,v.getPrevMeta=Xe,v.getRelatedNewsCarrousel=po,v.getReportReasonLabel=td,v.getResponse=Pe,v.getResponsePromise=ia,v.getSchemas=At,v.getScriptReplaces=rs,v.getSlugs=ka,v.getTextsStringValue=bo,v.getTypeOfNews=mo,v.getVideoRealPath=fo,v.handleGetComments=Kt,v.initLibrary=On,v.isPhotoGallery=vo,v.metadataToJSX=fa,v.metadata_defaults=Ar,v.parseTags=Rt,v.pathnameSplit=ua,v.processExtractedRelatedNews=ca,v.removePages=Ua,v.reportComment=ed,v.shareButtons=xr,v.socialIcons=Bt,v.speculationRules=va,v.speculationRulesHome=ba,v.toISOWithTimeZone=Le,v.urlReplaces=ma,v.usePlayIcon=ys,v.verifyCaptchaTokenEnterprise=Vd,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-template-common",
3
- "version": "0.9.43",
3
+ "version": "0.9.44",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"