System.register(["./index-legacy-kPmrjNKx.js","./_plugin-vue_export-helper-legacy-BVIICed7.js"],function(o,e){"use strict";var t,n,l,i,a,d,r,c,s,u,v,h,p,f,y,w,g,C,b,x;return{setters:[o=>{t=o.r,n=o.a,l=o.c,i=o.n,a=o.o,d=o.b,r=o.d,c=o.w,s=o.e,u=o.v,v=o.f,h=o.g,p=o.k,f=o.t,y=o.h,w=o.i,g=o.s,C=o.j,b=o.m},o=>{x=o._}],execute:function(){var e=document.createElement("style");e.textContent=".container[data-v-875c3488]{position:absolute}.content-clock[data-v-875c3488]{max-width:100%;max-height:100%;object-fit:contain}\n/*$vite$:1*/",document.head.appendChild(e),o("default",x({__name:"ClockContainer",props:{id:String,layoutId:String,partner:String},setup(o){const e="https://display24.ru",x=o,S=t(!1),$=t("");let m=null;const O=n({id:null,layoutId:null}),j=l(()=>{var o,e,t,n,l,a,d,r,c;return{top:`${O.top}px`,left:`${O.left}px`,width:`${O.width}px`,height:`${O.height}px`,backgroundColor:i(null===(o=O.background)||void 0===o?void 0:o.color)||i("#000"),zIndex:O.zIndex||0,border:`${(null===(e=O.border)||void 0===e?void 0:e.width)||0}px ${(null===(t=O.border)||void 0===t?void 0:t.style)||"solid"} ${(null===(n=O.border)||void 0===n?void 0:n.color)||"#fff"}`,borderRadius:`${null===(l=O.border)||void 0===l?void 0:l.radius}px`,boxShadow:`${null===(a=O.shadow)||void 0===a?void 0:a.x}px ${null===(d=O.shadow)||void 0===d?void 0:d.y}px ${null===(r=O.shadow)||void 0===r?void 0:r.b}px ${null===(c=O.shadow)||void 0===c?void 0:c.color}`}}),_=()=>{var o,e,t,n,l,i,a;switch(null===(o=O.content)||void 0===o?void 0:o.mediaMode){case 1:return{objectFit:"fill",width:"100%",height:"100%",fontSize:(null===(e=O.content)||void 0===e?void 0:e.fontSize)+"px",color:null===(t=O.content)||void 0===t?void 0:t.color};case 2:return{objectFit:"cover",width:"100%",height:"100%",fontSize:(null===(n=O.content)||void 0===n?void 0:n.fontSize)+"px",color:null===(l=O.content)||void 0===l?void 0:l.color};default:return{objectFit:"none",fontSize:(null===(i=O.content)||void 0===i?void 0:i.fontSize)+"px",color:null===(a=O.content)||void 0===a?void 0:a.color}}},k=()=>{var o;const e=b();$.value=e.format(null!==(o=O.content)&&void 0!==o&&o.showSeconds?"HH:mm:ss":"HH:mm")};return a(async()=>{O.id=x.id,O.layoutId=x.layoutId,await async function(){try{const n=(await w.get(`${e}/api/v1/player/layouts/${O.layoutId}?v=`+Date.now(),{headers:{"Content-Type":"application/json"},timeout:5e3})).data;if(!n||"object"!=typeof n||!0!==n.online)throw new Error("OFFLINE_OR_HTML_STUB_200");if(200==(null==n?void 0:n.code)){var o,t;let e=(null===(o=n.data)||void 0===o?void 0:o[0])||{};e=JSON.parse(JSON.stringify(e));let l=null===(t=e)||void 0===t?void 0:t.content.find(o=>o.id==O.id);l&&Object.assign(O,l),g("layouts",O.layoutId,e).then(o=>o&&console.info("ClockContainer (layouts): Сохранение данных в кэш")).catch(console.error)}else console.warn("ClockContainer (layouts): Нет данных")}catch(l){let o=await C("layouts",O.layoutId)||{};if(o=JSON.parse(JSON.stringify(o)),o){var n;let e=null===(n=o)||void 0===n?void 0:n.content.find(o=>o.id==O.id);return e&&Object.assign(O,e),console.warn("ClockContainer (layouts): Данные загружены из кэша"),!0}return console.error("ClockContainer (layouts): Нет данных в кэше."),!1}}(),await async function(){if(O.schedule)try{const n=(await w.get(`${e}/api/v1/player/schedules/${O.schedule}?v=`+Date.now(),{headers:{"Content-Type":"application/json"},timeout:5e3})).data;if(!n||"object"!=typeof n||!0!==n.online)throw new Error("OFFLINE_OR_HTML_STUB_200");if(200==(null==n?void 0:n.code)){var o,t;let e=(null===(o=n.data)||void 0===o?void 0:o[0])||{};e=JSON.parse(JSON.stringify(e));let l=(null===(t=e)||void 0===t?void 0:t.content)||null;Object.assign(O,{scheduleData:l}),S.value=d(null==O?void 0:O.scheduleData),g("schedule",O.schedule,e).then(o=>o&&console.info("ClockContainer (schedules): Сохранение данных в кэш")).catch(console.error)}else console.warn("ClockContainer (schedules): Нет данных")}catch(l){let o=await C("schedule",O.schedule)||{};if(o=JSON.parse(JSON.stringify(o)),o){var n;let e=(null===(n=o)||void 0===n?void 0:n.content)||null;return Object.assign(O,{scheduleData:e}),S.value=d(null==O?void 0:O.scheduleData),console.warn("ClockContainer (schedules): Данные загружены из кэша"),!0}return console.error("ClockContainer (schedules): Нет данных в кэше"),!1}}(),k(),m=setInterval(()=>{k(),S.value=d(null==O?void 0:O.scheduleData)},1e3)}),r(()=>{m&&clearInterval(m)}),c(()=>O.scheduleData,o=>{S.value=d(o)}),(o,e)=>s((h(),v("div",{class:"container",style:y(j.value)},[p("div",{class:"content-clock",style:y(_())},f($.value),5)],4)),[[u,S.value]])}},[["__scopeId","data-v-875c3488"]]))}}});
