"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[3513],{43513:(t,e,n)=>{n.r(e),n.d(e,{geniallyStopwatchViewScript:()=>u});var o=n(57567),i=n(66264),s=n(84054),a=n(60708),c=n(53289),r=n(79883),l=n(62800);const u=(t,e)=>{var n;let u;t.config.alarms.forEach((t=>{var e;t.active&&(null===(e=t.action)||void 0===e||e.preload())})),t.slide.audioRequirement=s.w.ShowMute;const d=t.item,f=t.config.startButtonRef;f&&(f.markAsInteractive=!0);const m=t.config.pauseButtonRef;m&&(m.markAsInteractive=!0);const p=t.config.restartButtonRef;p&&(p.markAsInteractive=!0);const v=t.config.textItemRef,h=(0,c.D)(null!==(n=null===v||void 0===v?void 0:v.text)&&void 0!==n?n:""),g=t=>{v&&(v.text=(0,c.x)((0,r.AF)(t),h))};let w=!1;function y(t){w=t,m&&(m.shown=t),f&&(f.shown=!t)}let M=0;const A=new Set;function T(){y(!0);let n=Date.now();u=e.setInterval((()=>{const o=Date.now(),i=o-n;if(n=o,w){M+=i;const t=5999e3;M>t&&(M=t)}const s=1e3*Math.floor(M/1e3);g(s);for(const n of t.config.alarms)n.active&&s>=n.time.milliseconds&&!A.has(n)&&(A.add(n),(0,l.g)({view:e,widgetItem:d,action:n.action}))}),100)}function x(){y(!1),A.clear(),M=0}const E="https://s3.eu-west-1.amazonaws.com/genially-audio-dev/64676ad5ec3dd256383244f9/520b02c3-751c-456c-816b-817a3d8050da.mpga";e.preloadAudio(E);const b=()=>{e.playAudio({source:E})},k="https://s3.eu-west-1.amazonaws.com/genially-audio-dev/64676ad5ec3dd256383244f9/038b75ee-5922-4a44-902c-4a751318bf11.mpga";e.preloadAudio(k);null===f||void 0===f||f.on(i.q.Click,(()=>{y(!0),b()})),null===m||void 0===m||m.on(i.q.Click,(()=>{y(!1);const t=d.playAnimation({type:o.K.Heartbeat,parameters:{delayMs:0,durationMs:2e3}});e.setTimeout((()=>{t.stop()}),2e3),b()})),null===p||void 0===p||p.on(i.q.Click,(()=>{x(),e.playAudio({source:k})})),d.parentSlide.on(a.m.Exiting,(()=>{x(),u&&(e.clearInterval(u),u=void 0)})),d.parentSlide.on(a.m.Entering,(()=>{y(!1),M=0,g(0)})),"print"!==e.viewMode&&d.parentSlide.on(a.m.Entered,(()=>{d.visible?T():d.once(i.q.Visible,(()=>{T()}))}))}},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,{EJ:()=>c,AF:()=>a,di:()=>r});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 a(t){const e=i(t);return`${o(e.minutes)}:${o(e.seconds)}`}function c(t){const e=s(t);return`${o(e.days,2)}:${o(e.hours)}:${o(e.minutes)}:${o(e.seconds)}`}function r(){const t=new Date,e=t.getTime();return e-(e+6e4*t.getTimezoneOffset())}},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/3513.b1013a8c.chunk.js.map