1import{_ as Q}from"./ChSGVX5R.js";import{d as U,o as W,a as X,b as o,c as n,e as t,f as d,_ as V,t as i,g as m,n as Y,r as h,u as Z,w as ee,h as z,i as P,j as M,k as O,F as S,l as D,m as T,p as te,q as ae,s as F,R as oe}from"./Tu_9qqDy.js";import{_ as se}from"./BMOOCHg3.js";import{_ as ne}from"./BLwLhTZd.js";import{_ as re}from"./CDrgXwbz.js";import{_ as q}from"./CeXSdCxY.js";import{u as le,P as ie}from"./DbCD_h2_.js";import{C as ce,f as de}from"./h2e8lgc4.js";import{d as ue}from"./WZY87EM8.js";import{C as me}from"./BZUriWtP.js";import{s as pe}from"./BMOl9q7r.js";import{u as ve}from"./Z0pEkunY.js";import{u as he}from"./C-WUsUQi.js";import{u as ge,a as _e}from"./CZ_t7wTv.js";/* empty css */import"./BEU_PX5H.js";import"./Dpl8Ulra.js";import"./CzocND4P.js";import"./DnFtfSPy.js";import"./CmMqz9uY.js";import"./D6MhI1Dd.js";const fe={class:"bg-slate-900 rounded-lg overflow-hidden shadow-2xl relative"},be={key:0,class:"relative z-10 w-full overflow-hidden rounded-lg"},xe=["innerHTML"],ye={key:1,class:"relative z-10 flex flex-col md:flex-row gap-8 items-center"},we={class:"w-48 h-48 md:w-56 md:h-56 rounded-lg overflow-hidden shadow-lg border border-white/10 shrink-0 relative group"},ke={class:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"},Pe={class:"grow w-full flex flex-col justify-center"},$e={class:"text-white text-lg mb-1 line-clamp-1"},Ce={key:0,class:"text-slate-400 text-sm mb-6"},Ie=["src"],je={class:"w-full flex items-center gap-3 mb-6"},Ee={class:"text-xs font-mono text-slate-400 min-w-9"},Se=["max","value"],Te={class:"text-xs font-mono text-slate-400 min-w-9"},Le={class:"flex flex-wrap items-center justify-between gap-4"},Ne={class:"flex items-center gap-2 bg-slate-800/80 rounded-lg p-2 border border-white/5"},Re=["value"],Ae=U({__name:"PodcastAudioPlayer",props:{podcast:{},isAuthenticated:{type:Boolean}},emits:["markedPlayed","reproductionSaved"],setup(p,{emit:w}){const f=p,b=w,r=h(null),u=h(!1),v=h(0),_=h(0),x=h(0),c=h(!1),e=h(1),k=a=>{if(Number.isNaN(a))return"0:00";const s=Math.floor(a/60),g=Math.floor(a%60);return`${s}:${g<10?"0":""}${g}`},L=()=>{if(r.value){if(u.value){r.value.pause();return}r.value.play().catch(a=>{console.error("Error playing audio:",a)})}},I=()=>{u.value=!0,f.podcast?.id&&f.isAuthenticated&&b("markedPlayed")},N=()=>{u.value=!1},$=()=>{r.value&&(v.value=r.value.currentTime)},j=()=>{r.value&&(_.value=r.value.duration)},E=a=>{const s=a.target;r.value&&(r.value.currentTime=Number.parseFloat(s.value))},R=()=>{r.value&&(c.value=!c.value,r.value.muted=c.value)},A=a=>{const s=a.target;r.value&&(e.value=Number.parseFloat(s.value),r.value.volume=e.value,c.value=e.value===0)},B=()=>{u.value=!1,v.value=0,f.podcast?.id&&f.isAuthenticated&&x.value>=_.value*.75&&b("reproductionSaved"),x.value=0};let C=null;return W(()=>{C=pe(()=>{u.value&&(x.value+=1)},1e3)}),X(()=>{C&&clearInterval(C)}),(a,s)=>{const g=q,y=V;return o(),n("div",fe,[s[0]||(s[0]=t("div",{class:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,var(--tw-gradient-stops))] from-brand-second/20 via-transparent to-transparent pointer-events-none"},null,-1)),p.podcast.iframe?(o(),n("div",be,[t("div",{innerHTML:p.podcast.iframe,class:"w-full flex justify-center [&_iframe]:w-full [&_iframe]:rounded-lg"},null,8,xe)])):(o(),n("div",ye,[t("div",we,[d(g,{src:p.podcast.imagen_original||"/assets/instituto-pacifico/images/default-podcast.jpg",width:"224",height:"224",format:"webp",quality:"75",loading:"eager",fetchpriority:"high",decoding:"async",class:"w-full h-full object-cover",alt:p.podcast.nombre},null,8,["src","alt"]),t("div",ke,[d(y,{name:"heroicons:musical-note-solid",class:"w-12 h-12 text-white/60"})])]),t("div",Pe,[t("h2",$e,i(p.podcast.nombre),1),p.podcast.program?(o(),n("p",Ce,i(p.podcast.program.nombre),1)):m("",!0),t("audio",{ref_key:"audioRef",ref:r,src:p.podcast.url,class:"hidden",onPlay:I,onPause:N,onTimeupdate:$,onLoadedmetadata:j,onEnded:B},null,40,Ie),t("div",je,[t("span",Ee,i(k(v.value)),1),t("input",{type:"range",min:0,max:_.value,value:v.value,class:"grow accent-brand-seventh h-1 bg-slate-700 rounded-lg appearance-none cursor-pointer",onInput:E},null,40,Se),t("span",Te,i(k(_.value)),1)]),t("div",Le,[t("button",{type:"button",class:"w-14 h-14 roun
1ded-full bg-brand-seventh hover:bg-brand-seventh-hover text-white flex items-center justify-center shadow-lg transition-transform hover:scale-105 active:scale-95 duration-200",onClick:L,"aria-label":"Isplaying ? "},[d(y,{name:u.value?"heroicons:pause-solid":"heroicons:play-solid",class:Y(["w-6 h-6",{"ml-0.5":!u.value}])},null,8,["name","class"])]),t("div",Ne,[t("button",{type:"button",class:"text-slate-400 hover:text-white transition-colors",onClick:R},[d(y,{name:c.value?"heroicons:speaker-x-mark-solid":e.value>.5?"heroicons:speaker-wave-solid":"heroicons:speaker-wave",class:"w-5 h-5"},null,8,["name"])]),t("input",{type:"range",min:"0",max:"1",step:"0.05",value:c.value?0:e.value,class:"accent-slate-300 w-20 h-1 bg-slate-700 rounded-lg appearance-none cursor-pointer",onInput:A},null,40,Re)])])])]))])}}}),Be=Object.assign(Ae,{__name:"FeaturesPodcastAudioPlayer"}),Me={class:"ap-page-content"},De={key:0,class:"my-6"},Fe={key:2},ze={key:0,class:"mb-3"},Oe={class:"bg-brand-second/10 text-brand-second rounded-lg px-2.5 py-1 text-xs font-bold"},Ue={class:"ap-title-4 text-brand-first mb-4"},Ve={class:"mb-6 flex flex-wrap items-center justify-between gap-4 border-b border-slate-200 pb-4 text-sm text-slate-500"},qe={class:"flex items-center gap-6"},He={class:"flex items-center gap-2"},Je={key:0,class:"flex items-center gap-2"},Ge={class:"flex items-center gap-2"},Ke={key:0,class:"flex items-center gap-4"},Qe={class:"mb-8"},We={key:1,class:"mb-8 space-y-3"},Xe={class:"h-12 w-12 shrink-0 overflow-hidden rounded-full border border-slate-200 bg-slate-100 shadow-sm"},Ye={class:"text-xs font-bold leading-tight text-slate-800"},Ze={key:0,class:"mt-1 text-xs font-medium leading-none text-slate-500"},et={key:2,class:"mb-10"},tt={class:"flex flex-wrap gap-2"},at={key:3,class:"mb-10 border-t border-slate-200 pt-8"},ot={class:"grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3"},$t=U({__name:"[plan]",async setup(p){let w,f;const b=te(),r=ae(),u=Z(),v=le(),_=b.params.slug,x=b.params.plan,{data:c}=ve({module:"PD",item:_});x!=="1"&&!u.auth&&r.push(`/login?from=${encodeURIComponent(b.fullPath)}`);const e=h(null),k=h(!1),{data:L,pending:I,error:N}=([w,f]=ee(()=>v.getPodcastDetail(_,x)),w=await w,f(),w);z(L,a=>{const s=ge(a);s&&(e.value=s)},{immediate:!0,deep:!0});const $=h([]);z(e,async a=>{if(a&&a.program?.alias)try{const{data:s}=await v.getPodcasts({categoria:a.program.alias,id:a.id,limite:3});s.value&&($.value=_e(s.value).filter(g=>g&&g.id).slice(0,3))}catch(s){console.error("Error fetching related podcasts:",s)}},{immediate:!0,deep:!0});const j=F(()=>c.value?.image||e.value?.imagen_original||e.value?.imagen||ue()),E=F(()=>c.value?.description||e.value?.descripcion||e.value?.nombre||""),R=F(()=>!e.value?.nombre&&!c.value?.title?null:{"@context":"https://schema.org","@type":"PodcastEpisode",name:c.value?.title||e.value?.nombre,description:E.value,image:j.value||void 0,datePublished:e.value?.fecha_publicacion||e.value?.fecha||void 0,inLanguage:"es-PE",partOfSeries:e.value?.program?.nombre?{"@type":"PodcastSeries",name:e.value.program.nombre}:void 0,publisher:{"@type":"Organization",name:oe.name,logo:{"@type":"ImageObject",url:"https://actualidadpenal.pe/images/logo-penal.svg"}}});he({title:()=>c.value?.title||e.value?.nombre||"",moduleLabel:()=>c.value?.title?void 0:"Podcast",description:E,path:`/podcasts/ver/${_}/${x}`,type:"article",image:j,jsonLd:R,titleTemplate:"%s"});const A=async()=>{if(e.value?.id){if(!u.auth){r.push(`/login?from=${encodeURIComponent(b.fullPath)}`);return}k.value=!0;try{const a=await v.toggleFavorite(e.value.id);a?.body?.data&&(e.value.is_favorite=a.body.data.is_favorite)}catch(a){console.error("Error toggling favorite:",a)}finally{k.value=!1}}},B=async()=>{if(!e.value?.visto&&e.value?.id)try{await v.marcarReproducido(e.value.id),e.value.visto=!0}catch(a){console.error("Error marking as read/listened:",a)}},C=async()=>{if(e.value?.id)try{await v.guardarReproduccion(e.value.id),e.value.escuchado=(e.value.escuchado||0)+1}catch(a){console.error("Error updating reproduction count:",a)}};return(a,s)=>{const g=Q,y=V,H=se,J=ne,G=re,K=q;return o(),n("div",Me,[P(I)?(o(),n("div",De,[d(g,{lines:12})])):P(N)?(o(),M(ce,{key:1,title:"Error al cargar el podcast",message:"Ocurrió un error al cargar el podcast. Por favor, intenta nuevamente más tarde."})):e.value&&!P(I)?(o(),n("div",Fe,[e.value.program?(o(),n("div",ze,[t("span",Oe,i(e.value.program.nombre),1)])):m("",!0),t("h1",Ue,i(e.value.nombre),1),t("div",Ve,[t("div",qe,[t("div",He,[d(y,{name:"heroicons:calendar",class:"h-5 w-5 text-slate-400"}),t("span",null,"Publicado: "+i(P(de)(e.value.fecha_publicacion)),1)]),e.value.edicion?(o(),n("div",Je,[d(y,{name:"heroicons:hashtag",class:"h-5 w-5 text-slate-400"}),t("span",null,"Edición Nº "+i(e.value.edicion),1)])):m("",!0),t("div",Ge,[d(y,{name:"heroicons:play",class:"h-5 w-5 text-slate-400"}),t("span",null,"Reproducciones: "+i(e.value.escuchado||0),1)])]),P(u).auth?(o(),n("div",Ke,[d(H,{"is-favorite":!!e.value.is_favorite,loading:k.value,onClick:A},null,8,["is-favorite","loading"])])):m("",!0)]),d(Be,{podcast:e.value,"is-authenticated":!!P(u).auth,onMarkedPlayed:B,onReproductionSaved:C},null,8,["podcast","is-authenticated"]),t("div",Qe,[d(J,{class:"mb-2 text-base"},{default:O(()=>[...s[0]||(s[0]=[T("Descripción",-1)])]),_:1}),d(G,{class:"ap-prose-article"},{default:O(()=>[T(i(e.value.descripcion),1)]),_:1})]),e.value.staffs?.length?(o(),n("div",We,[(o(!0),n(S,null,D(e.value.staffs,l=>
1(o(),n("div",{key:l.id,class:"flex items-center gap-4 rounded-lg border border-slate-200/60 bg-slate-50 p-5"},[t("div",Xe,[d(K,{src:l.foto_medium||l.foto_small||"/images/user-photo-default.png",alt:l.nombre_completo||l.nombre,provider:"none",width:"96",height:"96",loading:"lazy",decoding:"async",class:"h-full w-full object-cover"},null,8,["src","alt"])]),t("div",null,[t("div",Ye,[l.profesion?(o(),n(S,{key:0},[T(i(l.profesion),1)],64)):m("",!0),T(i(l.nombre_completo||l.nombre),1)]),l.cargo_laboral?(o(),n("div",Ze,i(l.cargo_laboral),1)):m("",!0)])]))),128))])):m("",!0),e.value.tags?.length?(o(),n("div",et,[t("div",tt,[(o(!0),n(S,null,D(e.value.tags,l=>(o(),n("span",{key:l.id,class:"bg-brand-second/5 text-brand-second hover:bg-brand-second/10 rounded-lg px-2.5 py-1 text-xs font-medium transition-colors"},i(l.nombre),1))),128))])])):m("",!0),$.value.length?(o(),n("div",at,[s[1]||(s[1]=t("h2",{class:"ap-title-5 text-brand-first mb-4"},"Podcasts relacionados",-1)),t("div",ot,[(o(!0),n(S,null,D($.value,l=>(o(),M(ie,{key:l.id,podcast:l},null,8,["podcast"]))),128))])])):m("",!0),e.value.id?(o(),M(me,{key:4,"section-class":"mt-12 pt-8 border-t border-slate-200",title:"Comentarios",modulo:"PD",id:e.value.id??"",plan:e.value.plan_id??1,titulo:e.value.nombre??""},null,8,["id","plan","titulo"])):m("",!0)])):m("",!0)])}}});export{$t as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.