import{_ as V,m as y,a as v}from"./Op42DrS6.js";import{_ as D}from"./SFzgqC3l.js";import{_ as E}from"./CzQE3dcq.js";import{_ as L}from"./CQkidJVw.js";import{d as R,u as H,r as f,w as I,c as z,o as i,a as n,b as t,e,t as $,f as p,g as c,F as U,h as Y,i as q,j as G,n as J,k as K}from"./DhtOgXEi.js";import{u as O}from"./Cebajw3H.js";import{u as Q}from"./By7avbZL.js";const W={class:"mt-24px pb-56px container"},X={class:"mb-24px w-full flex flex-col items-center border-b border-b-neutral-300 pb-32px md:mb-24px"},Z={class:"mb-16px h-60px w-60px rounded-full bg-neutral-300"},ee=["src"],te={class:"mb-12px text-5 font-bold leading-5 tracking-2px uppercase"},ae={class:"mb-24px max-w-500px text-center text-2.5 font-medium leading-10px tracking-1px uppercase"},se={class:"flex items-center space-x-12px"},oe={key:0},ie=["href"],re={key:1},ne=["href"],le={key:2},pe=["href"],ce={key:3},de=["href"],ge={key:4},ue=["href"],me={class:"flex border-t border-t-neutral-300 lg:border-t-0 lg:pt-32px"},fe={class:"lg:border-r lg:border-r-neutral-300 lg:pr-32px"},be={class:"hidden lg:box-border lg:box-border lg:w-332px lg:flex lg:flex-shrink-0 lg:basis-332px lg:flex-col lg:pl-32px"},b=7,Me=R({__name:"[slug]",async setup(_e){var w;let d,_;const M=q().public.base,x=H(),h=f(1),{data:g,error:S}=([d,_]=I(()=>G(`/api/authors/${x.params.slug}?limit=${b}`,"$FM5dY8yjt2")),d=await d,_(),d);if(((w=S.value)==null?void 0:w.statusCode)===404)throw z({message:"Autor no existe",statusCode:404});if(!g.value)throw z({message:"Autor no encontrado",statusCode:404});const a=f(g.value.author),k=f(g.value.posts),C=f(g.value.total);async function P(s){h.value=s;const o=s===1?0:(s-1)*b;await $fetch(`/api/authors/${x.params.slug}?limit=${b}&offset=${o}`).then(r=>{k.value=r.posts}).catch(r=>{console.log("error",r)})}function j(s){P(s)}const{setTargetType:T,setTargetCategory:A,targeting:u}=O();return T("portada"),A("autor"),Q({title:()=>`Página 7 | ${a.value.name}`,ogUrl:()=>`${M}/autores/${a.value.slug}`,ogTitle:()=>`Página 7 | ${a.value.name}`,twitterTitle:()=>`Página 7 | ${a.value.name}`}),(s,o)=>{const r=V,N=D,B=E,F=L;return i(),n("div",W,[t("div",X,[t("div",Z,[t("img",{src:e(a).img?e(a).img:"/img/P7-logo.png",alt:"foto autor",class:"h-full w-full rounded-full object-cover grayscale"},null,8,ee)]),t("h1",te,$(e(a).name),1),t("p",ae,$(e(a).position),1),t("ul",se,[e(a).email?(i(),n("li",oe,[t("a",{href:`mailto:${e(a).email}`,target:"_blank",rel:"noopener noreferrer",class:"block h-40px w-40px flex items-center justify-center rounded-full bg-black text-22px text-white"},o[0]||(o[0]=[t("i",{class:"i-carbon-email"},null,-1)]),8,ie)])):p("",!0),e(a).twitter?(i(),n("li",re,[t("a",{href:`https://twitter.com/${e(a).twitter}`,target:"_blank",rel:"noopener noreferrer",class:"block h-40px w-40px flex items-center justify-center rounded-full bg-black text-22px text-white"},o[1]||(o[1]=[t("i",{class:"i-fa6-brands-x-twitter"},null,-1)]),8,ne)])):p("",!0),e(a).instagram?(i(),n("li",le,[t("a",{href:`https://www.instagram.com/${e(a).instagram}`,target:"_blank",rel:"noopener noreferrer",class:"block h-40px w-40px flex items-center justify-center rounded-full bg-black text-22px text-white"},o[2]||(o[2]=[t("i",{class:"i-fa6-brands-instagram"},null,-1)]),8,pe)])):p("",!0),e(a).facebook?(i(),n("li",ce,[t("a",{href:`https://www.facebook.com/${e(a).facebook}`,target:"_blank",rel:"noopener noreferrer",class:"block h-40px w-40px flex items-center justify-center rounded-full bg-black text-22px text-white"},o[3]||(o[3]=[t("i",{class:"i-fa6-brands-facebook-f"},null,-1)]),8,de)])):p("",!0),e(a).web?(i(),n("li",ge,[t("a",{href:e(a).web,target:"_blank",rel:"noopener noreferrer",class:"block h-40px w-40px flex items-center justify-center rounded-full bg-black text-22px text-white"},o[4]||(o[4]=[t("i",{class:"i-carbon-cursor-1"},null,-1)]),8,ue)])):p("",!0)])]),c(r,{id:"movil_ad_middle2",path:"/1098385/pagina7cl/ad_middle2",dimensions:[300,250],"size-mapping":"mobileSizeMapping"in s?s.mobileSizeMapping:e(y),targeting:e(u)},null,8,["size-mapping","targeting"]),t("div",me,[t("div",fe,[(i(!0),n(U,null,Y(e(k),(l,m)=>(i(),n("div",{key:l.id},[c(N,{url:l.url,title:l.title,"featured-image":l.featuredImage,"main-category":l.mainCategory,"published-at":l.publishedAt,class:J({"border-t border-t-neutral-300 pt-24px md:border-t-0 md:pt-0":m==3,"mb-24px md:mb-0":m==2,"lg:!mt-0":m==0})},null,8,["url","title","featured-image","main-category","published-at","class"]),m==2?(i(),K(r,{key:0,id:"movil_ad_middle3",path:"/1098385/pagina7cl/ad_middle3",dimensions:[300,250],"size-mapping":"mobileSizeMapping"in s?s.mobileSizeMapping:e(y),targeting:e(u)},null,8,["size-mapping","targeting"])):p("",!0)]))),128)),c(B,{"num-posts":b,total:e(C),"current-page":e(h),onChangePage:j},null,8,["total","current-page"])]),t("div",be,[c(r,{id:"desk_ad_box2",path:"/1098385/pagina7cl/ad_box2",dimensions:[300,250],"size-mapping":"asideSizeMapping"in s?s.asideSizeMapping:e(v),targeting:e(u)},null,8,["size-mapping","targeting"]),c(r,{id:"desk_ad_box3",path:"/1098385/pagina7cl/ad_box3",dimensions:[300,250],"size-mapping":"asideSizeMapping"in s?s.asideSizeMapping:e(v),targeting:e(u)},null,8,["size-mapping","targeting"]),c(F)])])])}}});export{Me as default};