import{u as k,r as J,a as T,c as $,o as B,b as f,d as z,w as E,e as L,v as R,f as S,g as m,h as U,j as o,k as H,H as s,t as d,i as M,p as C,s as F,x as O}from"./index-DmCbOAxb.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const W={key:0,class:"debug-panel"},A={class:"debug-item"},Z={__name:"PlaylistContainerFace",props:{id:String,layoutId:String,partner:String},setup(D){const N=k(),w="https://display24.ru",u=J(!1);let h=null;const b=D,e=T({id:null,displayCode:null,layoutId:null,content:null}),I=$(()=>{var r,n,t,a,l,i,c,p,y;return{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px",backgroundColor:((r=e.background)==null?void 0:r.color)||"#000",zIndex:e.zIndex||0,borderColor:((n=e.border)==null?void 0:n.color)||"#fff",borderStyle:((t=e.border)==null?void 0:t.style)||"solid",borderWidth:(((a=e.border)==null?void 0:a.width)||0)+"px",borderRadius:((l=e.border)==null?void 0:l.radius)+"px",boxShadow:"".concat((i=e.shadow)==null?void 0:i.x,"px ").concat((c=e.shadow)==null?void 0:c.y,"px ").concat((p=e.shadow)==null?void 0:p.b,"px ").concat((y=e.shadow)==null?void 0:y.color)}});async function P(){var r;try{const t=(await C.get("".concat(w,"/api/v1/player/layouts/").concat(e.layoutId,"?v=")+Date.now(),{headers:{"Content-Type":"application/json"},timeout:5e3})).data;if(!t||typeof t!="object"||t.online!==!0)throw new Error("OFFLINE_OR_HTML_STUB_200");if((t==null?void 0:t.code)==200){let a=((r=t.data)==null?void 0:r[0])||{};a=JSON.parse(JSON.stringify(a));const l=a==null?void 0:a.content.find(i=>i.id==e.id);l&&Object.assign(e,l),F("layouts",e.layoutId,a).then(i=>i&&console.info("PlaylistContainerFace (layouts): Сохранение данных в кэш")).catch(console.error)}else console.warn("PlaylistContainerFace (layouts): Нет данных")}catch(n){let t=await O("layouts",e.layoutId)||{};if(t=JSON.parse(JSON.stringify(t)),t){const a=t==null?void 0:t.content.find(l=>l.id==e.id);return a&&Object.assign(e,a),console.warn("PlaylistContainerFace (layouts): Данные загружены из кэша"),!0}else return console.error("PlaylistContainerFace (layouts): Нет данных в кэше."),!1}}async function j(){var r;if(e.schedule)try{const t=(await C.get("".concat(w,"/api/v1/player/schedules/").concat(e.schedule,"?v=")+Date.now(),{headers:{"Content-Type":"application/json"},timeout:5e3})).data;if(!t||typeof t!="object"||t.online!==!0)throw new Error("OFFLINE_OR_HTML_STUB_200");if((t==null?void 0:t.code)==200){let a=((r=t.data)==null?void 0:r[0])||{};a=JSON.parse(JSON.stringify(a));const l=(a==null?void 0:a.content)||null;Object.assign(e,{scheduleData:l}),u.value=f(e==null?void 0:e.scheduleData),F("schedule",e.schedule,a).then(i=>i&&console.info("PlaylistContainerFace (schedules): Сохранение данных в кэш")).catch(console.error)}else console.warn("PlaylistContainerFace (schedules): Нет данных")}catch(n){let t=await O("schedule",e.schedule)||{};if(t=JSON.parse(JSON.stringify(t)),t){const a=(t==null?void 0:t.content)||null;return Object.assign(e,{scheduleData:a}),u.value=f(e==null?void 0:e.scheduleData),console.warn("PlaylistContainerFace (schedules): Данные загружены из кэша"),!0}else return console.error("PlaylistContainerFace (schedules): Нет данных в кэше"),!1}}return B(async()=>{e.id=b.id,e.displayCode=b.code,e.layoutId=b.layoutId,await P(),await j(),h=setInterval(()=>{u.value=f(e==null?void 0:e.scheduleData)},1e3)}),z(async()=>{h&&clearInterval(h)}),E(()=>e.scheduleData,r=>{u.value=f(r)}),(r,n)=>{var t,a,l,i,c,p,y,g,x,v;return L((m(),S("div",{class:"container",style:M(I.value),ref:"containerRef"},[H(N).debug?(m(),S("div",W,[o("div",A,[n[0]||(n[0]=o("div",{style:{"font-weight":"bold"}},"Область:",-1)),s(" Наименование: "+d(e.name||"-"),1),n[1]||(n[1]=o("br",null,null,-1)),s(" Ширина: "+d(e.width||0)+" px",1),n[2]||(n[2]=o("br",null,null,-1)),s(" Высота: "+d(e.height||0)+" px",1),n[3]||(n[3]=o("br",null,null,-1)),s(" Z-index: "+d((t=e.zIndex)!=null?t:0)+" ",1),n[4]||(n[4]=o("div",{style:{"padding-top":"10px","font-weight":"bold"}},"Медиа:",-1)),s(" Наименование: "+d(((a=e.content)==null?void 0:a.name)||"-"),1),n[5]||(n[5]=o("br",null,null,-1)),s(" Тип: "+d(((l=e.content)==null?void 0:l.type)||"-"),1),n[6]||(n[6]=o("br",null,null,-1)),s(" Размер: "+d(parseFloat(((i=e.content)==null?void 0:i.size)/1024/1024).toFixed(3)||0)+" Мб",1),n[7]||(n[7]=o("br",null,null,-1)),s(" Длительность: "+d((p=(c=e.content)==null?void 0:c.duration)!=null?p:0)+" сек.",1),n[8]||(n[8]=o("br",null,null,-1)),s(" Ширина: "+d((g=(y=e.content)==null?void 0:y.width)!=null?g:0)+" px",1),n[9]||(n[9]=o("br",null,null,-1)),s(" Высота: "+d((v=(x=e.content)==null?void 0:x.height)!=null?v:0)+" px ",1)])])):U("",!0),n[10]||(n[10]=o("div",{class:"alarm-wrapper"},[o("div",{class:"alarm"},[s(" Модуль распознавания лиц не поддерживается "),o("br"),s("для платформы Tizen (только Windows и Andriod). ")])],-1))],4)),[[R,u.value]])}}},G=V(Z,[["__scopeId","data-v-df0a142a"]]);export{G as default};
