"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[415],{1067:(e,t,n)=>{n.d(t,{h:()=>o});var i=n(22739);function o(e,t){if(!e)return!1;let n=!1;return(0,i.L)(e.data,(e=>{e.type===t&&(n=!0)})),n}},81359:(e,t,n)=>{n.d(t,{q:()=>M});var i=n(45992),o=n(37577),r=n(82068),s=n(17588);const a=e=>{const t=new Image;return t.src=e,t},l=(e,t)=>{try{if(Array.from(document.fonts).some((t=>t.family===e)))return;new FontFace(e,`url(${t})`).load().then((e=>{document.fonts.add(e)}))}catch(n){console.warn("Error preloading font",n)}},u="https://img.genially.com/60ef11e790ed4a0ff835b724/0ecdb3d6-1773-46ee-927b-362b2b911e74.gif";a(u);const c="Comfortaa";l(c,"https://fonts.gstatic.com/s/comfortaa/v47/1PtCg8LJRfWJmhDAuUsSQamb1W0lwk4S4WjMXL830efAesmwYSFoxBEP_I28dnyM.woff2");const d=o.Ay.div.attrs((e=>{let{$computedHeight:t}=e;return{style:{borderRadius:t/1.855+"px"}}}))((()=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"93%",height:"65%",background:"rgb(21, 53, 80)",display:"flex",flexDirection:"row",alignItems:"center"}))),m=o.Ay.img({marginLeft:"-7%",height:"157%"}),f=o.Ay.div.attrs((e=>{let{$parentHeight:t}=e;return{style:{fontSize:t/1.96+"px"}}}))((e=>{let{theme:t}=e;return{marginLeft:"-7%",color:"white",fontFamily:`'${c}', "Source Sans Pro", _fb_`,fontWeight:t.font.weight.bold}}));var h=n(79883);const g=e=>{const[t,n]=(0,s.useState)(0);return(0,s.useEffect)((()=>{if(!e.current)return;const t=new ResizeObserver((e=>{n(e[0].contentRect.height)}));return t.observe(e.current),()=>t.disconnect()}),[e]),t},p=e=>{let{timeInMillis:t}=e;const n=(0,s.useRef)(null),o=g(n),r=(0,h.AF)(t);return(0,i.jsxs)(d,{ref:n,$computedHeight:o,children:[(0,i.jsx)(m,{src:u,alt:""}),(0,i.jsx)(f,{$parentHeight:o,children:r})]})},y=e=>{let{initialTime:t}=e;return(0,i.jsx)(p,{timeInMillis:t})},v=a("https://images.genially.com/widgets/countdown/sportwatch.avif"),b="Offside";l(b,"https://fonts.gstatic.com/s/offside/v24/HI_KiYMWKa9QrAykc5boR72elpU.woff2");const w=o.Ay.div({position:"relative",height:"100%",aspectRatio:"1/1"}),$=o.Ay.div({width:"100%",height:"100%",position:"absolute",top:"0",left:"0",backgroundImage:`url(${v.src})`,backgroundSize:"contain",backgroundPosition:"center",backgroundRepeat:"no-repeat"}),T=o.Ay.div((e=>{let{$width:t,$height:n,$top:i,$right:o}=e;return{position:"absolute",backgroundColor:"rgb(13, 37, 53)",width:t,height:n,top:i,right:o}})),A=o.Ay.div((e=>{let{theme:t,$distance:n,$startFromBottom:i=!1}=e;return o.AH`
    content: '';
    position: absolute;
    width: 10%;
    height: 10%;
    background-color: ${t.color.content.info.default()};
    border-radius: 50%;
    top: 0%;
    left: 50%;
    transform-origin: 0 ${n};
    animation-name: ${(e=>{const t=e?180:0;return(0,o.i7)({"0%":{transform:`rotate(${0+t}deg) translateX(-50%)`},"100%":{transform:`rotate(${360+t}deg) translateX(-50%)`}})})(i)};
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
  `})),x=o.Ay.div.attrs((e=>{let{$parentHeight:t}=e;return{style:{fontSize:t/3.7+"px"}}}))((()=>({position:"absolute",top:"48%",left:"50%",transform:"translate(-50%, -48%)",fontFamily:`'${b}', "Source Sans Pro", _fb_`,color:"rgb(191, 212, 232)"}))),E=e=>{let{timeInMillis:t}=e;const n=(0,s.useRef)(null),o=g(n),r=(0,h.AF)(t);return(0,i.jsxs)(w,{ref:n,children:[(0,i.jsx)(T,{$width:"21%",$height:"21%",$top:"11%",$right:"22%",children:(0,i.jsx)(A,{$distance:"480%"})}),(0,i.jsx)(T,{$width:"27%",$height:"27%",$top:"64.5%",$right:"37%",children:(0,i.jsx)(A,{$distance:"500%",$startFromBottom:!0})}),(0,i.jsx)($,{}),(0,i.jsx)(x,{$parentHeight:o,children:r})]})},S=e=>{let{initialTime:t,onTimeEnd:n}=e;const{remainingTime:o,initTimer:r}=((e,t)=>{const n=(0,s.useRef)(),i=(0,s.useRef)(!1),[o,r]=(0,s.useState)(e),a=(0,s.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=void 0)}),[n]);(0,s.useEffect)((()=>()=>a()),[a]);const l=(0,s.useCallback)((()=>{i.current=!0,a()}),[a]),u=(0,s.useCallback)((()=>{if(i.current||n.current)return;const e=Date.now();n.current=setInterval((()=>{const n=1e3*Math.floor((Date.now()-e)/1e3),i=Math.max(o-n,0);r(i),0===i&&(l(),t())}),1e3)}),[l,o,t]),c=(0,s.useCallback)((()=>{i.current=!1,u()}),[u]),d=(0,s.useCallback)((()=>{r(e),a(),u()}),[e,a,u]);return{remainingTime:o,initTimer:u,pauseTimer:l,resumeTimer:c,restartTimer:d}})(t,n);return(0,s.useEffect)((()=>{r()}),[r]),(0,i.jsx)(E,{timeInMillis:o})},M=e=>{let{theme:t,initialTime:n,onTimeEnd:s,disabled:a}=e;const l=n>r.l?r.l:n;return(0,i.jsx)(o.NP,{theme:t,children:a?(0,i.jsx)(y,{initialTime:l}):(0,i.jsx)(S,{initialTime:l,onTimeEnd:s})})}},62796:(e,t,n)=>{n.r(t),n.d(t,{geniallyTimerViewScript:()=>c});var i=n(45992),o=n(48237),r=n(1067),s=n(84054),a=n(41381),l=n(62800),u=n(81359);const c=(e,t)=>{(0,a.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>{const{onEndAction:n}=e.config;return null===n||void 0===n||n.preload(),n&&(0,r.h)(n,o.L.PlayAudio)&&(e.slide.audioRequirement=s.w.ShowMuteAndOverlay),()=>(0,i.jsx)(u.q,{theme:t.theme,initialTime:e.config.initialTime.milliseconds,onTimeEnd:()=>{(0,l.g)({view:t,widgetItem:e.item,action:e.config.onEndAction})}})}})(e,t)}},41381:(e,t,n)=>{n.d(t,{p:()=>s});var i=n(70377),o=n(66264),r=n(60708);function s(e){let{getTargetNodeItem:t,renderApp:n,renderThumbnailApp:s,initialState:a}=e,l=!1;const u=[],c=e=>{u.push(e)};return e=>{const d=t(e.config),m=null===d||void 0===d?void 0:d.parentSlide;function f(){if(!d)return;let e=null;if("idOfFreeNode"in d)e=document.getElementById(d.idOfFreeNode);else{const t=document.createElement("div");t.innerHTML=d.source;let n=t.getElementsByClassName("genially-widget-app");n.length||(n=t.getElementsByClassName("genially-widget-gallery"));const{id:i}=n[0];if(!i)return;e=document.getElementById(i)}if(e){const t=o=>{if(l){const r=n({setState:t,onUnmount:c});i.render(r(o),e)}else console.warn('"rerender" was called when the widget was already unmounted. This is a no-op. Did you forget to dispose of an event handler with "onUnmount"?')};l=!0,t(a),u.push((()=>{i.unmountComponentAtNode(e)}))}}function h(){l=!1,u.forEach((e=>{e()})),u.length=0}null===d||void 0===d||d.on(o.q.Mount,(()=>{f()})),null===d||void 0===d||d.on(o.q.Unmount,(()=>{h()})),d&&"isTransversal"in d&&d.isTransversal?f():null===m||void 0===m||m.on(r.m.Entering,(()=>{l||f()})),null===m||void 0===m||m.on(r.m.Exited,(()=>{d&&"isTransversal"in d&&d.isTransversal||l&&h()})),null===m||void 0===m||m.on(r.m.ThumbnailMount,(()=>{!function(){if(!s||!d||!("idOfThumbnailFreeNode"in d))return;const e=document.getElementsByClassName(d.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.unmountComponentAtNode(e)}))}(),function(){if(!s||!d||!("idOfThumbnailFreeNode"in d))return;const e=document.getElementsByClassName(d.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.render(s(),e)}))}()}))}}},79883:(e,t,n)=>{n.d(t,{EJ:()=>a,AF:()=>s,di:()=>l});const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.toString().padStart(t,"0")};function o(e){const t=Math.floor(e/1e3);return{seconds:t%60,minutes:Math.floor(t/60)}}function r(e){const t=function(e){const t=o(e);return{seconds:t.seconds,minutes:t.minutes%60,hours:Math.floor(t.minutes/60)}}(e);return{seconds:t.seconds,minutes:t.minutes,hours:t.hours%24,days:Math.floor(t.hours/24)}}function s(e){const t=o(e);return`${i(t.minutes)}:${i(t.seconds)}`}function a(e){const t=r(e);return`${i(t.days,2)}:${i(t.hours)}:${i(t.minutes)}:${i(t.seconds)}`}function l(){const e=new Date,t=e.getTime();return t-(t+6e4*e.getTimezoneOffset())}},62800:(e,t,n)=>{n.d(t,{g:()=>o});var i=n(57567);function o(e){let{view:t,widgetItem:n,action:o}=e;const r=n.playAnimation({type:i.K.Notification,parameters:{delayMs:0,durationMs:200}});t.setTimeout((()=>{r.stop()}),2500),null===o||void 0===o||o.run()}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/415.ffc79151.chunk.js.map