define(["pluginManager"],function(pluginManager){"use strict";return function(){var interval,self=this;function animate(){var min,max,animations=[bounceInLeft,bounceInRight,swing,tada,wobble,rotateIn,rotateOut],elem=document.querySelector(".logoScreenSaverImage");elem&&elem.animate&&animations[min=0,max=animations.length-1,Math.floor(Math.random()*(max-min+1))+min](elem,1)}function bounceInLeft(elem,iterations){var timing={duration:900,iterations:iterations,easing:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"};return elem.animate([{transform:"translate3d(-3000px, 0, 0)",opacity:"0",offset:0},{transform:"translate3d(25px, 0, 0)",opacity:"1",offset:.6},{transform:"translate3d(-100px, 0, 0)",offset:.75},{transform:"translate3d(5px, 0, 0)",offset:.9},{transform:"none",opacity:"1",offset:1}],timing)}function bounceInRight(elem,iterations){var timing={duration:900,iterations:iterations,easing:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"};return elem.animate([{transform:"translate3d(3000px, 0, 0)",opacity:"0",offset:0},{transform:"translate3d(-25px, 0, 0)",opacity:"1",offset:.6},{transform:"translate3d(100px, 0, 0)",offset:.75},{transform:"translate3d(-5px, 0, 0)",offset:.9},{transform:"none",opacity:"1",offset:1}],timing)}function swing(elem,iterations){var timing={duration:900,iterations:iterations};return elem.animate([{transform:"translate(0%)",offset:0},{transform:"rotate3d(0, 0, 1, 15deg)",offset:.2},{transform:"rotate3d(0, 0, 1, -10deg)",offset:.4},{transform:"rotate3d(0, 0, 1, 5deg)",offset:.6},{transform:"rotate3d(0, 0, 1, -5deg)",offset:.8},{transform:"rotate3d(0, 0, 1, 0deg)",offset:1}],timing)}function tada(elem,iterations){var timing={duration:900,iterations:iterations};return elem.animate([{transform:"scale3d(1, 1, 1)",offset:0},{transform:"scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)",offset:.1},{transform:"scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)",offset:.2},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.3},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.4},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.5},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.6},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.7},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.8},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.9},{transform:"scale3d(1, 1, 1)",offset:1}],timing)}function wobble(elem,iterations){var timing={duration:900,iterations:iterations};return elem.animate([{transform:"translate(0%)",offset:0},{transform:"translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg)",offset:.15},{transform:"translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg)",offset:.45},{transform:"translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg)",offset:.6},{transform:"translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg)",offset:.75},{transform:"translateX(0%)",offset:1}],timing)}function rotateIn(elem,iterations){elem.style["transform-origin"];var timing={duration:900,iterations:iterations};return elem.animate([{transform:"rotate3d(0, 0, 1, -200deg)",opacity:"0",transformOrigin:"center",offset:0},{transform:"none",opacity:"1",transformOrigin:"center",offset:1}],timing)}function rotateOut(elem,iterations){elem.style["transform-origin"];var timing={duration:900,iterations:iterations};return elem.animate([{transform:"none",opacity:"1",transformOrigin:"center",offset:0},{transform:"rotate3d(0, 0, 1, 200deg)",opacity:"0",transformOrigin:"center",offset:1}],timing)}function stopInterval(){interval&&(clearInterval(interval),interval=null)}self.name="Logo Screen Saver",self.type="screensaver",self.id="logoscreensaver",self.supportsAnonymous=!0,self.show=function(){require(["css!"+pluginManager.mapPath(self,"style.css")],function(){var elem=document.querySelector(".logoScreenSaver");elem||((elem=document.createElement("div")).classList.add("logoScreenSaver"),document.body.appendChild(elem),elem.innerHTML='<img class="logoScreenSaverImage" src="'+pluginManager.mapPath(self,"logowhite.png")+'" />'),stopInterval(),interval=setInterval(animate,3e3)})},self.hide=function(){stopInterval();var onAnimationFinish,elem=document.querySelector(".logoScreenSaver");elem&&(onAnimationFinish=function(){elem.parentNode.removeChild(elem)},elem.animate?function(elem,iterations){var timing={duration:400,iterations:iterations};return elem.animate([{opacity:"1",offset:0},{opacity:"0",offset:1}],timing)}(elem,1).onfinish=onAnimationFinish:onAnimationFinish())}}});