"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[4358],{1067:(t,e,n)=>{n.d(e,{h:()=>i});var o=n(22739);function i(t,e){if(!t)return!1;let n=!1;return(0,o.L)(t.data,(t=>{t.type===e&&(n=!0)})),n}},64358:(t,e,n)=>{n.r(e),n.d(e,{geniallyCountdownToDateViewScript:()=>f});var o=n(48237),i=n(1067),s=n(66264),c=n(84054),r=n(60708),u=n(53289),a=n(79883),l=n(62800),d=n(73267);const f=(t,e)=>{var n,f;const m=t.config.targetDate;null===(n=t.config.onEndAction)||void 0===n||n.preload();const{onEndAction:g}=t.config;let h;g&&(0,i.h)(g,o.L.PlayAudio)&&(t.slide.audioRequirement=c.w.ShowMuteAndOverlay);const p=t.config.textItemRef,v=t.config.plusItemRef,w=(0,u.D)(null!==(f=null===p||void 0===p?void 0:p.text)&&void 0!==f?f:""),y=t=>{p&&(p.text=(0,u.x)((0,a.EJ)(Math.max(t,0)),w))},M=t.item;function E(){h&&(e.clearInterval(h),h=void 0)}function T(t){let e=Math.max(t,0);if(e<=0&&E(),e>d.G){const t=e-Math.trunc(e/d.U)*d.U;e=99*d.U+t,v&&(v.opacity=1)}else v&&(v.opacity=0);return y(e),e}function x(){const n=Date.now(),o=m.getTime()-Date.now();h=e.setInterval((()=>{const i=1e3*Math.floor((Date.now()-n)/1e3);0===T(o-i)&&(0,l.g)({view:e,widgetItem:M,action:t.config.onEndAction})}),100)}const D=M.parentSlide;D.on(r.m.Exiting,(()=>{E()})),D.on(r.m.Entering,(()=>{const t=T(m.getTime()-Date.now());y(t)})),"print"!==e.viewMode&&D.on(r.m.Entered,(()=>{M.visible?x():M.once(s.q.Visible,(()=>{x()}))}))}},53289:(t,e,n)=>{function o(t){if(t.nodeType===Node.TEXT_NODE&&t.textContent&&""!==t.textContent.trim())return t;if(t.hasChildNodes())for(let e=0;e<t.childNodes.length;e+=1){const n=o(t.childNodes[e]);if(n)return n}return null}function i(t){const e=document.createElement("div");e.innerHTML=t;const n=o(e);return n?function(t){let e="",n=t;for(;n;)n instanceof HTMLElement&&n.style.cssText&&(e=n.style.cssText+e),n=n.parentElement;return e}(n):""}function s(t,e){const n=document.createElement("span");return n.setAttribute("style",e),n.textContent=t.replace(/^\s+/g,(t=>"\xa0".repeat(t.length))).replace(/\s+$/g,(t=>"\xa0".repeat(t.length))),n.outerHTML}n.d(e,{D:()=>i,x:()=>s})},79883:(t,e,n)=>{n.d(e,{cQ:()=>a,EJ:()=>r,AF:()=>c,ek:()=>l,di:()=>u});const o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return t.toString().padStart(e,"0")};function i(t){const e=Math.floor(t/1e3);return{seconds:e%60,minutes:Math.floor(e/60)}}function s(t){const e=function(t){const e=i(t);return{seconds:e.seconds,minutes:e.minutes%60,hours:Math.floor(e.minutes/60)}}(t);return{seconds:e.seconds,minutes:e.minutes,hours:e.hours%24,days:Math.floor(e.hours/24)}}function c(t){const e=i(t);return`${o(e.minutes)}:${o(e.seconds)}`}function r(t){const e=s(t);return`${o(e.days,2)}:${o(e.hours)}:${o(e.minutes)}:${o(e.seconds)}`}function u(){const t=new Date,e=t.getTime();return e-(e+6e4*t.getTimezoneOffset())}const a=100,l=(t,e)=>0===t?0:e/t*100},62800:(t,e,n)=>{n.d(e,{g:()=>i});var o=n(57567);function i(t){let{view:e,widgetItem:n,action:i}=t;const s=n.playAnimation({type:o.K.Notification,parameters:{delayMs:0,durationMs:200}});e.setTimeout((()=>{s.stop()}),2500),null===i||void 0===i||i.run()}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/4358.466b89db.chunk.js.map