1(()=>{"use strict";var t,e=i.prototype=Object.create(Object.prototype);function i(t){Object.call(this),i.instance=this,n.setupScopeVariables(this,t,{setup:t,fps:60,size:{width:960,height:640},renderer:i.AUTO,orientation:i.LANDSCAPE,extendCanvas:!0,debug:!1,center:!0,captureMode:!1,captureScale:1,desktopPreview:!1,forceOrientation:!0,autoScroll:!0,scaleDesktop:!1,createCanvas:!0,allowUpscale:!0,allowDownscale:!0,allowResizeEvent:!0,fullscreen:null,background:null,orientationImageSRC:null,preventDefaultEvents:!0,preventDefaultEventsClick:!0,systemIsMobileAny:n.isMobile.any(),onCompleteHasBeenCalled:!1}),this.init()}function n(){}function s(){}function r(t,e){this.type=t,this.object=e,this.callbackFunction=null,this.target=null,this.currentTarget=null}e.constructor=i,i.SCALE_SUFFIX_SMALL="@1",i.LANDSCAPE="landscape",i.PORTRAIT="portrait",i.NONE="none",i.MOBILE="mobile",i.DESKTOP="desktop",i.ALL="all",i.NONE="none",i.AUTO="auto",i.CANVAS="canvas",i.WEBGL="webgl",i.ORIENTATION_TIMEOUT=100,i.getInstance=function(t){return null==i.instance&&(i.instance=new i(null!=t?t:{})),i.instance},Object.defineProperty(i,"devicePixelRatio",{get:function(){return window.devicePixelRatio||1}}),Object.defineProperty(e,"canvasList",{get:function(){return this._canvasList=this._canvasList||[],this._canvasList}}),e.getIsWebview=function(){if(this.systemIsMobileAny){var t=!1;if(n.isMobile.iOS()){var e=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),i=/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);t=e||i}else t=/(; wv)/i.test(navigator.userAgent);return t}return!1},e.getFPS=function(){return this.fps},e.getBackgroundHex=function(){return this.background?this.background.split("#").join("0x"):"#fff"},e.getCanvas=function(t){return t=void 0!==t?t:0,this.canvasList[t]},e.getCanvasBounds=function(){return{x:0,y:0,width:this.size.width,height:this.size.height}},Object.defineProperty(e,"allowUpscale",{get:function(){return this._allowUpscale||!1},set:function(t){t===i.MOBILE?this._allowUpscale=!!this.systemIsMobileAny:t===i.DESKTOP&&(this._allowUpscale=!this.systemIsMobileAny),t===i.ALL?this._allowUpscale=!0:"boolean"==typeof t&&(this._allowUpscale=t)}}),e.getScaleDesktop=function(){return this.scaleDesktop||this.getFullscreen()},e.getScaledTouchPosition=function(t){var e=this.getTransformMultiplier();return{x:t.clientX*e.x,y:t.clientY*e.y}},e.getTransformMultiplier=function(){var t=this.getCanvas(),e=t.style,i=Number(e.width.split("px").join(""))||t.width,n=Number(e.height.split("px").join(""))||t.height;return{x:t.width/i,y:t.height/n}},e.getUpscaleRatio=function(t){return t=!this.allowUpscale&&t>1?1:t,!this.allowDownscale&&t<1?1:t},e.getIsPortraitScale=function(){return this.size.width/this.size.height>this.screenWidth/this.screenHeight},e.getFullscreen=function(){var t=!1;return this.fullscreen==i.ALL||this.systemIsMobileAny&&this.fullscreen==i.MOBILE?t=!0:this.systemIsMobileAny||this.fullscreen!=i.DESKTOP||(t=!0),this.captureMode&&(t=!1),t},Object.defineProperty(e,"orientationIsCorrect",{get:function(){var t=this.orientation==this.currentOrientation,e=this.orientation==i.NONE;return!this.systemIsMobileAny||t||e}}),Object.defineProperty(e,"currentOrientation",{get:function(){return this.screenWidth>this.screenHeight?i.LANDSCAPE:i.PORTRAIT}}),e.getOrientation=function(){return this.currentOrientation},Object.defineProperty(e,"canvasWidth",{get:function(){return this.orientationIsCorrect?this.width:this.height}}),Object.defineProperty(e,"canvasHeight",{get:function(){return this.orientationIsCorrect?this.height:this.width}}),Object.defineProperty(e,"screenWidth",{get:function(){var t=window.innerWidth*i.devicePixelRatio;return this.size.maxWidth?Math.min(this.size.maxWidth,t):t}}),Object.defineProperty(e,"screenHeight",{get:function(){var t=window.innerHeight*i.devicePixelRatio;return this.size.maxHeight?Math.min(this.size.maxHeight,t):t}}),Object.defineProperty(e,"width",{get:function(){return this.getFullscreen()?this.getIsPortraitScale()?this.screenWidth/this.widthRatio:this.height*this.screenRatio:this.size.width}}),Object.defineProperty(e,"height",{get:function(){return this.getFullscreen()?this.getIsPortraitScale()?this.width/this.screenRatio:this.screenHeight/this.heightRatio:this.size.height}}),Object.defineProperty(e,"screenRatio",{get:function(){return this.screenWidth/this.screenHeight}}),Object.defineProperty(e,"widthRatio",{get:function(){return this.getUpscaleRatio(this.screenWidth/(this.orientationIsCorrect?this.size.width:this.size.height))}}),Object.defineProperty(e,"heightRatio",{get:function(){return this.getUpscaleRatio(this.screenHeight/(this.orientationIsCorrect?this.size.height:this.size.width))}}),e.init=function(){this.setup.onComplete&&(this.initCanvas(),this.initCSSAttributes(),this.initEventHandler(),this.initOrientationImage(),this.initCompleteTimeout())},e.initCanvas=function(){this.createCanvas&&this.addCanvas()},e.addCanvas=function(t){return t=t||document.createElement("canvas"),this.canvasList.push(t),this.setCanvasCSS(t),this.resizeAndCenter(),document.body.appendChild(t),t},e.initCSSAttributes=function(){this.setBodyCSS(document.body),this.setCanvasCSS(this.getCanvas())},e.setBodyCSS=function(t){t&&(t.style.margin=0,t.style.padding=0,this.background&&(t.style.background=this.background))},e.setCanvasCSS=function(t){t&&(t.style.display="block",t.style.position="absolute",t.style["-webkit-touch-callout"]="none",t.style["-webkit-user-select"]="none",t.style["-khtml-user-select"]="none",t.style["-moz-user-select"]="none",t.style["-ms-user-select"]="none",t.style["user-select"]="none",t.style.outline="none",t.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)",this.background&&(t.style.background=this.background))},e.setCenterCSS=function(t){if(t){var e=t.style.width?t.style.width.split("px")[0].split(",").join("."):t.width,i=t.style.height?t.style.height.split("px")[0].split(",").join("."):t.height,n=Math.round(.5*(window.innerHeight-i))+"px",s=Math.round(.5*(window.innerWidth-e))+"px";t.style.position="absolute",t.style.top=n,t.style.left=s}},e.initEventHandler=function(){window.addEventListener("resize",this.windowResizeHandler.bind(this),!1),window.addEventListener("orientationchange",this.windowOrientationChangeHandler.bind(this)),window.addEventListener("click",this.windowPreventClickhandler.bind(this),!1),window.addEventListener("touchstart",this.windowPreventClickhandler.bind(this),!1),window.addEventListener("touchmove",this.windowPreventDefaulthandler.bind(this),!1),window.addEventListener("touchend",this.windowPreventClickhandler.bind(this),!1),window.addEventListener("gesturestart",this.windowPreventDefaulthandler.bind(this),!1),window.addEventListener("scroll",this.windowLockScrollHandler.bind(this),!1)},e.windowResizeHandler=function(){this.allowResizeEvent&&this.resizeAndCenter()},e.windowOrientationChangeHandler=function(){this.allowResizeEvent&&this.resizeAndCenter()},e.windowPreventDefaulthandler=function(t){this.preventDefaultEvents&&t.preventDefault()},e.windowPreventClickhandler=function(t){this.preventDefaultEventsClick&&t.preventDefault()},e.windowLockScrollHandler=function(t){this.preventDefaultEvents&&window.scrollTo(0,1)},e.initOrientationImage=function(){this.orientationImageSRC&&this.systemIsMobileAny&&(this.orientationImage=new Image,this.orientationImage.src=this.orientationImageSRC,this.orientationImage.style.display="none",this.orientationImage.onload=function(){this.setCenterCSS(this.orientationImage)}.bind(this),document.body.appendChild(this.orientationImage),this.triggerOrientationVisibility(this.getCanvas()))},e.triggerOrientationVisibility=function(t){if(this.systemIsMobileAny){var e=this.orientationIsCorrect;this.orientationImage&&(this.orientationImage.style.display=e?"none":"inline",t&&(t.style.display=e?"block":"none"))}},e.resizeAndCenter=function(){for(var t=0;t<this.canvasList.length;++t){var e=this.canvasList[t];this.scrollToTop(),this.rotateCanvasIfOrientationIsNotCorrect(e),this.setCenterCSS(this.orientationImage),this.triggerOrientationVisibility(e),this.resizeCanvas(e),this.rescaleCanvas(e),this.centerCanvas(e)}this.initOnComplete()},e.scrollToTop=function(){this.autoScroll&&setTimeout((function(){window.scrollTo(0,1)}),1)},e.rotateCanvasIfOrientationIsNotCorrect=function(t){!this.orientationImageSRC&&this.forceOrientation&&this.changeCanvasRotationTo(t,this.orientationIsCorrect?0:90)},e.changeCanvasRotationTo=function(t,e){t&&(t.style["-ms-transform"]="rotate("+e+"deg)",t.style["-webkit-transform"]="rotate("+e+"deg)",t.style.transform="rotate("+e+"deg)")},e.resizeCanvas=function(t){this.extendCanvas&&(t.width=this.canvasWidth,t.height=this.canvasHeight)},e.rescaleCanvas=function(t){if(this.getFullscreen()||this.captureMode||this.desktopPreview){var e=this.canvasWidth/i.devicePixelRatio,n=this.canvasHeight/i.devicePixelRatio,s=this.orientationIsCorrect?this.screenWidth/this.canvasWidth:this.screenWidth/this.canvasHeight;e*=s=this.desktopPreview?this.orientation===i.PORTRAIT?window.innerHeight/this.size.height:window.innerWidth/this.size.width:this.captureMode?this.captureScale:s,n*=s;var r=t.style;r.width=e+"px",r.height=n+"px"}},e.centerCanvas=function(t){1==this.center&&this.setCenterCSS(t)},e.initCompleteTimeout=function(){n.isMobile.any()?setTimeout(this.initOnComplete.bind(this),i.ORIENTATION_TIMEOUT):this.initOnComplete()},e.initOnComplete=function(){null!=this.setup.onComplete&&0==this.onCompleteHasBeenCalled&&(this.onCompleteHasBeenCalled=!0,this.setup.onComplete())},n.prototype=new Object,n.prototype.constructor=n,n.debugLog="",n.isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){var t=(/iPad/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream;return navigator.userAgent.match(/iPhone|iPad|iPod/i)||t},iPad:function(){return navigator.userAgent.match(/iPad/)},iPhoneOriPod:function(){return navigator.userAgent.match(/iPhone|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return n.isMobile.Android()||n.isMobile.BlackBerry()||n.isMobile.iOS()||n.isMobile.Opera()||n.isMobile.Windows()}},n.isDesktop={Firefox:function(){return navigator.userAgent.match(/Firefox/i)},Chrome:function(){return navigator.userAgent.match(/Chrome/i)},InternetExplorer:function(){return navigator.userAgent.match(/Trident/i)}},n.isLocal=function(){var t=window.location.href;return!(t.match("http")||t.match("https"))},n.getiOSVersion=function(){return n.isMobile.iOS()?navigator.userAgent.match(/OS ((\d+_?){2,3})\s/)[1]:null},n.getURLParameterString=function(t){var e=(t=void 0!==t?t:window).location.href.split("?");return e.length>1?"?"+e[1]:""},n.getURLParameter=function(t,e){return e=void 0!==e?e:window,decodeURIComponent((new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)").exec(e.location.search)||[,""])[1].replace(/\+/g,"%20"))||null},n.error=function(){var t=Array.prototype.slice.call(arguments),e=t.join(" ");console.log(e)},n.getURLHash=function(t){var e=window.location.href.split("#")[1];if(e)for(var i=e.split("?").join("&").split("&"),n=0;n<i.length;++n){var s=i[n].split("="),r=s[0],o=s[1];if(r==t)break;o=null}return o}
1,n.setupScopeVariables=function(t,e,i){for(var n in e=void 0!==e?e:{},i){var s=void 0!==e[n]?e[n]:i[n];t[n]=s}},(s.prototype=Object.create(Object.prototype)).constructor=s,s.color="#ff0000",s.allowPointerEvents=!0,s.clear=function(){s.div&&(s.div.innerHTML="")},s.remove=function(){s.div&&s.div.parentNode.removeChild(s.div)},s.print=function(){s.div||(s.div=document.createElement("div"),document.body.appendChild(s.div),s.div.style.position="absolute",s.div.style.width="100%",s.div.style.height="100%",s.div.style.overflow="hidden",s.div.style.color=s.color,s.div.style["font-family"]="Sans-serif",s.allowPointerEvents&&(s.div.style["pointer-events"]="none"));var t=s.div.parentNode;t.insertBefore(s.div,t.nextSibling);for(var e=0;e<arguments.length;++e){var i=arguments[e];s.div.innerHTML=s.div.innerHTML+i+(e!=arguments.length-1?", ":"")}s.div.innerHTML="<span class='debugText'>"+s.div.innerHTML+"</span><br>"},s.error=n.error,Math.cbrt=Math.cbrt||function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},s=function(){return i.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,s.prototype=new n,s}),Array.prototype.find||(Array.prototype.find=function(t){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,s=arguments[1],r=0;r<n;r++)if(e=i[r],t.call(s,e,r,i))return e}),Array.prototype.fill||(Array.prototype.fill=function(t){if(null==this)throw new TypeError("this is null or not defined");for(var e=Object(this),i=e.length>>>0,n=arguments[1],s=n>>0,r=s<0?Math.max(i+s,0):Math.min(s,i),o=arguments[2],a=void 0===o?i:o>>0,h=a<0?Math.max(i+a,0):Math.min(a,i);r<h;)e[r]=t,r++;return e}),function(){if(!("btoa"in window)){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";window.btoa=function(e){var i,n,s="";for(i=0,n=e.length;i<n;i+=3){var r=255&e.charCodeAt(i),o=255&e.charCodeAt(i+1),a=255&e.charCodeAt(i+2),h=(3&r)<<4|o>>4,u=i+1<n?(15&o)<<2|a>>6:64,c=i+2<n?63&a:64;s+=t.charAt(r>>2)+t.charAt(h)+t.charAt(u)+t.charAt(c)}return s}}}(),"atob"in window||(window.atob=function(t){if((t=t.replace(/=+$/,"")).length%4==1)throw new Error("bad atob input");for(var e,i,n=0,s=0,r="";i=t.charAt(s++);~i&&(e=n%4?64*e+i:i,n++%4)?r+=String.fromCharCode(255&e>>(-2*n&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return r}),window.console=window.console||((t={}).log=t.warn=t.debug=t.info=t.error=t.time=t.dir=t.profile=t.clear=t.exception=t.trace=t.assert=function(t){},t),function(){for(var t,e=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],n=i.length,s=window.console=window.console||{};n--;)s[t=i[n]]||(s[t]=e)}(),r.prototype=new Object,r.ACTIVE="active",r.ADD="add",r.ADDED="added",r.ANIMATION_END="animationend",r.AUDIO_COMPLETE="audioComplete",r.AUDIO_PAUSE="audioPause",r.AUDIO_PLAY="audioPlay",r.BLUR="blur",r.CALL="call",r.CANVAS_RESIZE="canvasresize",r.CHANGE="change",r.CLICK="click",r.CLOSE="close",r.CLOSED="closed",r.COMPLETE="complete",r.COMMENT="comment",r.CONNECT="connnect",r.END="end",r.ENTER="enter",r.ERROR="error",r.EXIT="exit",r.FAIL="fail",r.FOCUS="focus",r.GYRO="gyro",r.HIDE="hide",r.HIT="hit",r.INACTIVE="inactive",r.INDEX="index",r.INIT="init",r.KEY="key",r.KILL="kill",r.LOAD="load",r.LOADED="loaded",r.LOCK="lock",r.MESSAGE="message",r.MOUSE_DOWN="mousedown",r.MOUSE_MOVE="mousemove",r.MOUSE_OUT="mouseout",r.MOUSE_OVER="mouseover",r.MOUSE_UP="mouseup",r.MOUSE_UP_OUTSIDE="mouseupoutside",r.NEXT="next",r.OPEN="open",r.PAUSE="pause",r.PLAY="play",r.PRESS_DOWN="pressdown",r.PRESS_MOVE="pressmove",r.PRESS_UP="pressup",r.PREVIOUS="previous",r.PROCESS="process",r.PROGRESS="progress",r.READY="ready",r.REMOVE="remove",r.REMOVED="removed",r.RESET="reset",r.RESIZE="resize",r.SEND="send",r.SETUP="setup",r.SHAKE="shake",r.SHOW="show",r.SPAWN="spawn",r.START="start",r.STARTED="started",r.STEP="step",r.STOP="stop",r.SUCCESS="success",r.TOGGLE="toggle",r.TOGGLE_BUTTON="toggleButton",r.TOUCH_END="touchend",r.TOUCH_END_OUTSIDE="touchendoutside",r.TOUCH_MOVE="touchmove",r.TOUCH_START="touchstart",r.TWEEN_START="tweenstart",r.TWEEN_COMPLETE="tweencomplete",r.UNLOCK="unlock",r.UPDATE="update",r.VALIDATE="validate";var o=a.prototype=Object.create(Object.prototype);function a(){Object.call(this),this.eventLibrary={}}
1o.constructor=a,o.on=function(t,e,i){this.addEventListener(t,e,i)},o.off=function(t,e,i){this.removeEventListener(t,e,i)},o.send=function(t,e){this.dispatchEvent(t,e)},o.mute=function(){this.removeAllEventListeners()},o.addEventListener=function(t,e,i){var n={type:t,target:this,callbackFunction:e,scope:i},s=this.getListWithType(t),r=this.objectIsInList(s,n);0!=s.length&&r||(s.push(n),this.eventLibrary[t]=s)},o.removeEventListener=function(t,e,i){for(var n=this.getListWithType(t),s=n.length-1;s>=0;--s){var r=n[s],o=r.type==t,a=!e||r.callbackFunction==e,h=r.scope==i;o&&a&&h&&n.splice(s,1)}this.eventLibrary[t]},o.removeAllEventListeners=function(){this.eventLibrary={}},o.dispatchEvent=function(t,e){for(var i=this.getListWithType(t.type),n=i.length-1;n>=0;--n){var s=i[n];s&&(t.currentTarget=e||t.target||null,t.target=s.target,t.callbackFunction=s.callbackFunction,s.callbackFunction?s.scope?s.callbackFunction.call(s.scope,t):s.callbackFunction(t):console.log('Error: callbackFunction for "'+t.type+'" event not defined.'))}},o.getListWithType=function(t){var e=this.eventLibrary[t];return null==e?[]:this.eventLibrary[t]},o.objectIsInList=function(t,e){for(var i=!0,n=0;n<t.length;++n){var s=t[n];if(!this.compareEvents(s,e)){i=!1;break}}return i},o.compareEvents=function(t,e){var i=!0;if(null!=t&&null!=e){var n=t.type==e.type,s=t.callbackFunction==e.callbackFunction,r=t.scope==e.scope;n&&s&&r||(i=!1)}return i};var h=u.prototype=Object.create(a.prototype);function u(t){a.call(this),console.log(this.addEventListener),this.setup=t||{},this.id=this.setup.id,this.path=this.setup.path,this.volume=this.setup.volume,this.jukebox=this.setup.jukebox,this.loop=void 0!==this.setup.loop&&this.setup.loop,this.single=this.setup.single?this.setup.single:null,this.sprite=this.setup.sprite?this.setup.sprite:null,this.loader=this.setup.loader||null,this.audio=null,this.audioSRC=null,this.isPlaying=!1,this.isAtEnd=!1,this.stopSoundOnFocusLoss=!0,this.wasPausedOnMouseOut=!1}h.constructor=u,Object.defineProperty(h,"pitch",{get:function(){return this._pitch=void 0!==this._pitch?this._pitch:1,this._pitch},set:function(t){this._pitch=t}}),Object.defineProperty(h,"currentTime",{get:function(){return this.audio.currentTime}}),Object.defineProperty(h,"globalVolume",{get:function(){return this._globalVolume=this.jukebox?this.jukebox.globalVolume:1,this._globalVolume}}),Object.defineProperty(h,"volume",{get:function(){return this._volume=void 0!==this._volume?this._volume:1,this._volume},set:function(t){this._volume=Math.max(0,Math.min(1,t)),this.setVolume(this._volume,null)}}),Object.defineProperty(h,"duration",{get:function(){return isNaN(this.audio.duration)?null:parseFloat(this.audio.duration.toFixed(3))}}),Object.defineProperty(h,"time",{get:function(){var t=isNaN(this.audio.currentTime)||null===this.duration?null:this.audio.currentTime%this.duration;return null!=t?parseFloat(t.toFixed(3)):null}}),h.play=function(t){try{this.isPlaying||(this.initAudio(),this.initEventHandler(),this.audio.play(),this.isPlaying=!0,this.isAtEnd=!1),t&&(this.audio.currentTime=t),this.dispatchEvent(new r(r.PLAY,this))}catch(t){}},h.update=function(){},h.initAudio=function(){this.audio||(this.audio=this.loader?this.loader.getObjectWithID(this.path).result:new Audio,this.audio.src=this.getCorrectFileFormat()),this.audio.loop=this.loop,this.audio.volume=this.volume},h.setVolume=function(t){t*=this.globalVolume,this.audio&&(this.audio.volume=t)},h.initEventHandler=function(){this.audio.addEventListener("ended",this.audioEndedHandler.bind(this))},h.audioEndedHandler=function(){this.isAtEnd=!0,this.isPlaying&&this.dispatchEvent(new r(r.COMPLETE,this))},h.pause=function(){this.audio&&(this.audio.pause(),this.isPlaying=!1)},h.seek=function(t){return 0!=sound.audio.currentTime&&(this.play(t),!0)},h.getCorrectFileFormat=function(){if(null==this.audioSRC){var t=this.path.split(".");t.pop();for(var e=t.join("."),i=[{type:"audio/mpeg",format:"mp3"},{type:"audio/wav",format:"wav"},{type:"audio/ogg",format:"ogg"}],n=0;n<i.length;++n){var s=i[n];if(this.audio.canPlayType(s.type))break;s=null}this.audioSRC=e+"."+s.format}return this.audioSRC};class c extends a{constructor(t){super(),this.setup=t||{},this.id=this.setup.id?this.setup.id:null,this.volume=this.setup.volume,this.loader=this.setup.loader?this.setup.loader:null,this.jukebox=this.setup.jukebox,this.loop=void 0!==this.setup.loop&&this.setup.loop,this.single=this.setup.single?this.setup.single:null,this.sprite=this.setup.sprite?this.setup.sprite:null,this.path=this.setup.path,this.isPlaying=!1,this.isAtEnd=!1,this.queList=[],this.startTimestamp=0,this.playbackTime=0,this.init()}get globalVolume(){return this._globalVolume=this.jukebox?this.jukebox.globalVolume:1,this._globalVolume}get volume(){return this._volume=void 0!==this._volume?this._volume:1,this._volume}set volume(t){this._volume=Math.max(0,Math.min(1,t)),this.setVolume(this._volume,null)}get duration(){return parseFloat(this.source.buffer.duration.toFixed(3))}get time(){var t;return t=this.isPlaying?(Date.now()-this.startTimestamp)/1e3+this.playbackTime:this.playbackTime,t%=this.duration,parseFloat(t.toFixed(3))}get pitch(){return this._pitch=void 0!==this._pitch?this._pitch:1,this._pitch}set pitch(t){this._pitch=t,this.source&&(this.source.playbackRate.value=this._pitch)}init(){var t=this.loader.getObjectWithID(this.path);this.buffer=t.result}update(){this.updatePlaybackState()}updatePlaybackState(){var t=this.source.playbackState;void 0!==t&&(this.playbackState!=t&&(this.playbackState=t),3!=this.playbackState||this.endDispatched||this.sourceOnEndedHandler(null))}play(t){t=void 0!==t?t:this.playbackTime,this.source=p.audioContext.createBufferSource(),this.source.buffer=this.buffer,this.source.loop=this.loop,this.source.onended=this.sourceOnEndedHandler.bind(this),this.source.connect(p.audioContext.destination),this.gainNode=p.audioContext.createGain(),this.gainNode.connect(p.audioContext.destination),this.source.connect(this.gainNode),this.source.start(0,t),this.isPlaying=!0,this.endDispatched=!1,this.setVolume(this.volume),this.playbackTime=t,this.startTimestamp=Date.now(),this.dispatchEvent(new r(r.PLAY,this))}sourceOnEndedHandler(t){this.endDispatched=!0,this.isPlaying&&this.dispatchEvent(new r(r.COMPLETE,this))}setVolume(t){t*=this.globalVolume,this.gainNode&&(this.gainNode.gain.value=2*t-1)}pause(){const t=this.isPlaying;this.playbackTime=this.time,this.isPlaying=!1,this.endDispatched=!1,3!==this.playbackState&&t&&(this.source.stop||(this.source.stop=source.noteOff),this.source.stop(0))}seek(t){if(!this.source||!this.buffer)return!1;if(this.source.buffer.duration<t)return!1;try{this.source.stop()}catch(t){console.log("Try catch:",t)}return this.play(t),!0}}var l=p.prototype=Object.create(a.prototype);l.constructor=p;const d={sampleRate:44100};function p(t){a.call(this),p.instance=this,this.setup=t||this.setup||{},this.clearIntervalTime=this.setup.clearIntervalTime||null,this.ignoreSoundOnMobile=void 0!==this.setup.ignoreSoundOnMobile&&this.setup.ignoreSoundOnMobile,this.loader=this.setup.loader||null,this.json=this.setup.json||null,this.ignoreFocus=this.setup.ignoreFocus||!1,this.init()}p.audioContext=window.AudioContext?new window.AudioContext(d):window.webkitAudioContext?new window.webkitAudioContext(d):window.mozAudioContext?new window.mozAudioContext(d):window.oAudioContext?new window.oAudioContext(d):window.msAudioContext?new window.msAudioContext(d):null,Object.defineProperty(l,"globalVolume",{get:function(){return this._globalVolume=void 0!==this._globalVolume?this._globalVolume:1,this._globalVolume},set:function(t){this._globalVolume=Math.max(0,Math.min(1,t)),this.changeVolumeOfSoundList(this._globalVolume,null)}}),l.getIgnoreSoundOnMobile=function(){return this.ignoreSoundOnMobile&&n.isMobile.any()},l.setIgnoreSoundOnMobile=function(t){this.ignoreSoundOnMobile=t},l.setGlobalVolume=function(t,e){this.globalVolume=t,this.changeVolumeOfSoundList(t,e)},l.getSoundWithPropertyAndValue=function(t,e){for(var i=0;i<this.soundList.length;++i){var n=this.soundList[i];if(n[t]==e)return n}},p.getInstance=function(t){return null==p.instance?p.instance=new p(t):t&&(p.instance.loader=p.instance.loader||t.loader,p.instance.json=p.instance.json||t.json,p.instance.ignoreFocus=p.instance.ignoreFocus||t.ignoreFocus,p.instance.sprite=p.instance.sprite||t.sprite),p.audioContext&&"suspended"==p.audioContext.state&&p.audioContext.resume(),p.instance},l.init=function(){this.initVariables(),this.initWindowEvents()},l.initVariables=function(){this.soundList=[],this.windowHasFocus=!0,this.muteVolume=1},l.update=function(){for(var t=0;t<this.soundList.length;++t)this.soundList[t].update()},l.play=function(t){if(p.audioContext&&"suspended"==p.audioContext.state&&p.audioContext.resume(),this.windowHasFocus&&(!this.getIgnoreSoundOnMobile()||navigator.isCocoonJS)){t.path=this.getSoundPath(t.id),t.sprite=this.sprite,t.loader=this.loader,t.volume=null==t.volume?1:t.volume,t.jukebox=this;var e=this.createSound(t);null!=e&&(e.play(),e.setVolume(e.volume*this.muteVolume),e.pitch=t.pitch||1,e.on(r.COMPLETE,function(t){for(var e=this.soundList.length-1;e>=0;--e){var i=this.soundList[e];i==t.target&&0==i.loop&&this.soundList.splice(e,1)}}.bind(this)),this.soundList.push(e))}return e},l.seek=function(t,e){for(var i=0;i<this.soundList.length;++i){var n=this.soundList[i];n.id==t&&n.seek(t,e)}},l.changeVolumeOfSoundList=function(t,e){for(var i=0;i<this.soundList.length;++i){var n=this.soundList[i];this.soundIsInList(n,e)||n.setVolume(n.volume*this.muteVolume)}},l.createSound=function(t){for(var e=null,i=0;i<this.soundList.length;++i)if(e=this.soundList[i],t.id==e.id&&1==e.single)return null;return this.sprite?(this.soundInstance=this.soundInstance||this.getObjectPrototype(t),e=new SpriteSound(this.soundInstance,t,this.json)):e=this.getObjectPrototype(t),e},l.getObjectPrototype=function(t){const e=new(p.audioContext?c:u)(t);return e.addEventListener(r.PLAY,this.soundEventHandler.bind(this)),e.addEventListener(r.COMPLETE,this.soundEventHandler.bind(this)),e},l.soundEventHandler=function(t){this.dispatchEvent(t)},l.pauseAllSounds=function(t){for(var e=this.soundList.length-1;e>=0;--e){var i=this.soundList[e];this.soundIsInList(i,t)||(i.pause(),this.soundList.splice(e,1))}},l.mute=function(){this.muteVolume=0},l.unmute=function(){this.muteVolume=1},l.pause=function(t){var e=this.removeSoundFromList(t.id,this.soundList);e&&e.pause()},l.removeSoundFromList=function(t,e){if(t&&e)for(var i=e.length-1;i>=-1;--i){var n=e[i];if(n&&t==n.id)return e.splice(i,1),n}},l.initWindowEvents=function(){window.onfocus=this.windowOnFocusHandler.bind(this),window.onblur
1=this.windowOnBlurHandler.bind(this),document.addEventListener("visibilitychange",this.documentVisibilityChangeHandler.bind(this))},l.documentVisibilityChangeHandler=function(){document.hidden?this.windowOnBlurHandler():this.windowOnFocusHandler()},l.windowOnBlurHandler=function(){this.windowHasFocus&&!this.ignoreFocus&&(this.windowHasFocus=!1,this.windowBlurVolume=this.globalVolume,this.setGlobalVolume(0))},l.windowOnFocusHandler=function(){this.windowHasFocus||this.ignoreFocus||(this.windowHasFocus=!0,this.setGlobalVolume(this.windowBlurVolume))},l.getSoundPath=function(t){var e="";this.sprite?e=this.json.src:(e=t.split(".").length>1?t:this.json?this.json[t]:null)instanceof Array&&(e=e[Math.floor(Math.random()*e.length)]);var i=n.getURLParameter("cdnURL");return i&&e&&(e=i+e),e},l.getSoundByID=function(t){return this.json[t]},l.soundIsInList=function(t,e){var i=!1;if(e)for(var n=0;n<e.length;++n){var s=e[n];if(t.id==s){i=!0;break}}return i};var f=g.prototype=Object.create(a.prototype);function g(t){a.call(this),this.setup=t||{},this.recursion=this.setup.recursion||1,this.static=this.setup.static||!0,this.ignoreRecursionProgressDepth=this.setup.ignoreRecursionProgressDepth||1,this.maxCueSize=this.setup.maxCueSize||4,this.forceURLImage=this.setup.forceURLImage||!0,this.suffix=this.setup.suffix||"",this.numItems=0}f.constructor=g,g.POOL=g.POOL||[],g.REGEX_FILE=/([^"]+(?=\.(jpg|gif|png|json|js|wav|mp3|ogg))\.\2)/gm,g.getNormalizedURL=function(t){return"string"==typeof t?t.split("\\").join("/"):""},g.getValueIsURL=function(t){return"string"==typeof t&&t.match(g.REGEX_FILE)},Object.defineProperty(f,"results",{get:function(){for(var t=[],e=0;e<this.loadItems.length;++e){var i=this.loadItems[e];t.push(i.result)}return t}}),Object.defineProperty(f,"loadItems",{get:function(){return this.static?g.POOL:(this._loadItems=void 0!==this._loadItems?this._loadItems:[],this._loadItems)}}),Object.defineProperty(f,"list",{get:function(){return this._list=this._list||[],this._list}}),Object.defineProperty(f,"pool",{get:function(){return this._pool=this._pool||[],this._pool}}),Object.defineProperty(f,"progress",{get:function(){for(var t=0,e=0,i=this.pool.length,n=0;n<i;++n){var s=this.pool[n];s.startRecursion!==this.ignoreRecursionProgressDepth?t+=s.progress:e++}var r=Math.min(1,t/(i-e-1));return r||0}}),Object.defineProperty(f,"ignore",{get:function(){return this._ignore||[]},set:function(t){this._ignore=t}}),f.getProgress=function(){return this.progress},f.getObjectWithID=function(t){return this.getLoadItemsWithID(t)[0]},f.getObjectsWithID=function(t){return this.getLoadItemsWithID(t)},f.getLoadItemsWithID=function(t){return this.getItemsInArrayWithId(this.loadItems,t)},f.getItemsInArrayWithId=function(t,e){var i=[];if(e)for(var n=0;n<t.length;++n){var s=t[n];this.removeSuffix(g.getNormalizedURL(s.id))==this.removeSuffix(g.getNormalizedURL(e))&&i.push(s)}return i},f.isIgnoredFileType=function(t){for(var e=0;e<this.ignore.length;++e){var i=this.ignore[e];if(t.match(i))return!0}return!1},f.reset=function(){this._pool=[],this._list=[],this._ignore=[]},f.createLoadItem=function(t,e){var i=null;switch(t.split(".")[1].split("?")[0].split("#")[0]){case O.TYPE_JSON:i=new O(e);break;case T.TYPE_PNG:case T.TYPE_JPG:case T.TYPE_GIF:i=new T(e,this.forceURLImage);break;case S.TYPE_MP3:case S.TYPE_OGG:case S.TYPE_WAV:i=new S(e);break;case A.TYPE_JS:i=new A(e)}return i},f.addSuffix=function(t){return void 0!==this.suffix?t+this.suffix:t},f.removeSuffix=function(t){return t.split(this.suffix).join("")},f.load=function(t){this.manifest=t instanceof Array?t:[t],this.loadData(this.manifest,this.recursion)},f.loadArray=function(t,e){for(var i=0;i<t.length;++i){var n=t[i];this.loadData(n,e)}this.loadNextItem()},f.loadObject=function(t,e){for(var i in t){var n=t[i];switch(typeof n){case"object":this.loadObject(n,e);break;case"string":var s=n.split("manifest:");s.length>1&&(n=s[1].split("};")[0]);var r=g.getValueIsURL(n);r&&this.loadData(r,e)}}this.loadNextItem()},f.loadData=function(t,e){if(t instanceof Array)this.loadArray(t,e);else if(t instanceof Object)this.loadObject(t,e);else if(t){this.numItems++;var i=this.createLoadItem(t,e);if(i&&!this.isIgnoredFileType(t)){i.on(r.PROGRESS,this.loadItemProgressHandler,this),i.on(r.PROCESS,this.loadItemProcessHandler,this),i.on(r.COMPLETE,this.loadItemCompleteHandler,this),i.url=g.getNormalizedURL(t),i.url=this.addSuffix(i.url);var s=n.getURLParameter("cdnURL");
1s&&(i.url=s+i.url),this.send(new r(r.ADD,i)),this.pool.push(i),this.list.push(i)}}else this.loadNextItem()},f.loadNextItem=function(){for(var t=this.maxCueSize||this.list.length,e=0;e<t;++e){var i=this.list[e];i&&!i.isLoading&&i.load(i.url)}},f.loadItemProgressHandler=function(t){this.send(new r(r.PROGRESS,this.progress))},f.loadItemProcessHandler=function(t){var e=t.target;this.send(new r(r.PROCESS,e))},f.loadItemCompleteHandler=function(t){var e=t.target;this.addItemToGlobalPool(e),this.recurseLoadResult(e),this.removeItemFromArray(this.list,e),this.dispatchLoadAndCompleteEvents(e),this.loadNextItem()},f.addItemToGlobalPool=function(t){this.getObjectWithID(t.id)||this.loadItems.push(t)},f.recurseLoadResult=function(t){t.recurse&&this.loadData(t.result,t.recursion-1)},f.removeItemFromArray=function(t,e){for(var i=t.length-1;i>=0;--i)t[i]==e&&t.splice(i,1)},f.dispatchLoadAndCompleteEvents=function(t){this.send(new r(r.LOAD,t)),0==this.list.length&&this.send(new r(r.COMPLETE))};var m=v.prototype=Object.create(a.prototype);function v(){a.call(this),this.mimeType=null,this.responseType=null}m.constructor=v,Object.defineProperty(m,"progress",{get:function(){return this._progress||0},set:function(t){this._progress=t}}),Object.defineProperty(m,"data",{get:function(){return this._data=this._data||this.request.response||this.request.responseText,this._data},set:function(t){this._data=t}}),m.load=function(t){this.url=t,v.getXMLHttpRequestAndCall(this.xmlHttpCallbackHandler.bind(this))},m.xmlHttpCallbackHandler=function(t){this.request=t,this.request.addEventListener?(this.request.addEventListener(r.PROGRESS,this.requestProgressHandler.bind(this)),this.request.addEventListener(r.LOAD,this.requestLoadHandler.bind(this))):this.request.onreadystatechange=this.requestOnReadyStateChangeHandler.bind(this),this.request.overrideMimeType&&this.mimeType?(this.request.overrideMimeType(this.mimeType),this.openAndSendRequest()):null==this.mimeType?this.openAndSendRequest():this.dispatchEvent(new r(r.ERROR))},m.openAndSendRequest=function(){this.request.open("GET",this.url,!0);try{this.responseType&&(this.request.responseType=this.responseType)}catch(t){}this.request.send()},m.requestProgressHandler=function(t){this.progress=t.loaded/t.total,this.dispatchEvent(new r(r.PROGRESS))},m.requestLoadHandler=function(t){this.progress=1,this.dispatchEvent(new r(r.PROGRESS)),this.dispatchEvent(new r(r.COMPLETE))},m.requestOnReadyStateChangeHandler=function(){4===this.request.readyState&&this.requestLoadHandler(null)},v.getXMLHttpRequestAndCall=function(t){var e=null;try{t(e=new XMLHttpRequest)}catch(i){try{t(e=new window.ActiveXObject("Msxml2.XMLHTTP"))}catch(i){t(e=new window.ActiveXObject("Microsoft.XMLHTTP"))}}return e};var b=y.prototype=Object.create(a.prototype);function y(t){a.call(this),this.type=y.TYPE_FILE,this.startRecursion=t,this.recursion=t}b.constructor=y,y.TYPE_FILE="file",Object.defineProperty(b,"id",{get:function(){return this.url}}),Object.defineProperty(b,"name",{get:function(){return this.id.split("/").slice(-1).join().split(".")[0]}}),Object.defineProperty(b,"recurse",{get:function(){return this.recursion>=0||null===this.recursion}}),Object.defineProperty(b,"progress",{get:function(){var t=this.urlRequest?this.urlRequest.progress:this._progress;return void 0===t?0:t},set:function(t){this._progress=t}}),Object.defineProperty(b,"result",{get:function(){return null}}),Object.defineProperty(b,"url",{get:function(){return this._url},set:function(t){this._url=t}}),b.load=function(t){this.url=t,this.isLoading=!0,this.urlRequest=new v,this.urlRequest.addEventListener(r.PROGRESS,this.urlRequestProgressHandler.bind(this)),this.urlRequest.addEventListener(r.COMPLETE,this.urlRequestCompleteHandler.bind(this)),this.urlRequest.load(this.url)},b.urlRequestProgressHandler=function(t){this.dispatchEvent(t)},b.urlRequestCompleteHandler=function(t){this.decreaseRecursion(),this.dispatchEvent(t)},b.decreaseRecursion=function(){this.recursion&&this.recursion--};var E=O.prototype=Object.create(y.prototype);function O(t){y.call(this,t),this.type=O.TYPE_JSON}E.constructor=O,O.TYPE_JSON="json",O.ERROR_IVALIDJSON="Invalid JSON file: ",E.urlRequestCompleteHandler=function(t){this.decreaseRecursion(),this.dispatchEvent(new r(r.PROCESS)),this.dispatchEvent(t)},Object.defineProperty(E,"result",{get:function(){try{var t=this.urlRequest.data,e=t?JSON.parse(t):null}catch(t){console.log(O.ERROR_IVALIDJSON+this.url)}return e}});var w=T.prototype=Object.create(y.prototype);
1function T(t,e){y.call(this,t),this.type=T.TYPE_IMAGE,this.forceURLImage=e||!1}w.constructor=T,T.TYPE_IMAGE="image",T.TYPE_PNG="png",T.TYPE_JPG="jpg",T.TYPE_GIF="gif",T.MIME_TYPE="text/plain; charset=x-user-defined",Object.defineProperty(w,"result",{get:function(){return this._result},set:function(t){this._result=t}}),Object.defineProperty(w,"recurse",{get:function(){return!1}}),w.load=function(t){this.url=t,this.isLoading=!0;var e=t.split(".");this.suffix=e[e.length-1],this.forceURLImage?this.urlRequestErrorHandler():(this.urlRequest=new v,this.urlRequest.mimeType=T.MIME_TYPE,this.urlRequest.addEventListener(r.PROGRESS,this.urlRequestProgressHandler.bind(this)),this.urlRequest.addEventListener(r.COMPLETE,this.urlRequestCompleteHandler.bind(this)),this.urlRequest.addEventListener(r.ERROR,this.urlRequestErrorHandler.bind(this)),this.urlRequest.load(t))},w.urlRequestErrorHandler=function(t){var e=new Image;e.crossOrigin="anonymous",e.onload=function(){this.result=e,this.progress=1,this.dispatchEvent(new r(r.PROCESS)),this.dispatchEvent(new r(r.PROGRESS)),this.dispatchEvent(new r(r.COMPLETE))}.bind(this),e.src=this.url},w.urlRequestCompleteHandlerLoaderItem=w.urlRequestCompleteHandler,w.urlRequestCompleteHandler=function(t){this.dispatchEvent(new r(r.PROCESS)),this.createImageDataObject(t)},w.createImageDataObject=function(t){var e=Base64.encode(this.urlRequest.data),i=new Image;i.crossOrigin="anonymous",i.onload=function(){this.result=i,this.dispatchEvent(t)}.bind(this),i.src="data:image/"+this.suffix+";base64,"+e};var I=S.prototype=Object.create(y.prototype);function S(t){y.call(this,t),this.type=S.TYPE_AUDIO,this.audioContext=p.audioContext,this.ignoreSoundOnMobile=p.getInstance().getIgnoreSoundOnMobile(),this.loadedDataCallback=this.audioLoadedDataHandler.bind(this)}I.constructor=S,S.TYPE_AUDIO="audio",S.TYPE_MP3="mp3",S.TYPE_M4A="m4a",S.TYPE_OGG="ogg",S.TYPE_WAV="wav",S.RESPONSE_TYPE="arraybuffer",S.RESPONSE_TYPE_BLOB="blob",S.TYPE_LIST=["m4a","mp3","ogg","wav"],Object.defineProperty(I,"result",{get:function(){return this._result},set:function(t){this._result=t}}),Object.defineProperty(I,"recurse",{get:function(){return!1}}),I.load=function(t){this.url=t,this.isLoading=!0;var e=t.split(".");this.suffix=e[e.length-1],n.isMobile.any()&&this.ignoreSoundOnMobile?(this.progress=1,this.dispatchEvent(new r(r.PROGRESS)),this.dispatchEvent(new r(r.COMPLETE))):this.audioContext?this.loadRequest(t):this.loadElement(t)},I.loadRequest=function(t){this.urlRequest=new v,this.urlRequest.responseType=S.RESPONSE_TYPE,this.urlRequest.addEventListener(r.PROGRESS,this.urlRequestProgressHandler.bind(this)),this.urlRequest.addEventListener(r.COMPLETE,this.urlRequestCompleteHandler.bind(this)),this.urlRequest.load(t)},I.urlRequestCompleteHandlerLoaderItem=I.urlRequestCompleteHandler,I.urlRequestCompleteHandler=function(t){this.audioContext.decodeAudioData(this.urlRequest.data,this.contextOnBufferHandler.bind(this))},I.contextOnBufferHandler=function(t){this.result=t,this.dispatchEvent(new r(r.COMPLETE))},I.loadElement=function(t){this.audio=new Audio,this.audio.preload="auto",this.audio.src=t,this.audio.load(),this.audio.pause(),this.audio.addEventListener("canplaythrough",this.loadedDataCallback),this.audio.addEventListener("error",this.audioOnErrorHandler.bind(this))},I.audioOnErrorHandler=function(t){this.audioLoadedDataHandler()},I.audioLoadedDataHandler=function(t){this.audio.removeEventListener("canplaythrough",this.loadedDataCallback),this.progress=1,this.dispatchEvent(new r(r.PROGRESS)),this.contextOnBufferHandler(this.audio)};var P=A.prototype=Object.create(y.prototype);function A(t){y.call(this,t),this.type=A.TYPE_JS}P.constructor=A,A.TYPE_JS="js",A.TAG_TYPE="text/javascript",Object.defineProperty(P,"result",{get:function(){return this._result},set:function(t){this._result=t}}),P.urlRequestCompleteHandlerLoadItem=P.urlRequestCompleteHandler,P.urlRequestCompleteHandler=function(t){this.appendJSFile(this.url)},P.appendJSFile=function(t){this.scriptTag=document.createElement("script"),this.scriptTag.type=A.TAG_TYPE,this.result={data:this.urlRequest.data},this.dispatchEvent(new r(r.PROCESS)),this.scriptTag.text=this.result.data,document.getElementsByTagName("head")[0].appendChild(this.scriptTag),this.dispatchEvent(new r(r.PROGRESS)),this.dispatchEvent(new r(r.COMPLETE))};class C{constructor(t,e){this._fps=t,this.fps=t,this.callback=e,this.isPlaying=!1,this.request}loop(t){var e=Math.floor((t-this.time)/this.delay);e>this.frame&&(this.frame=e,this.callback({time:t,frame:this.frame})),this.request=requestAnimationFrame(this.loop.bind(this))}get fps(){return this._fps}set fps(t){this._fps=t,this.setFrameRate(this._fps)}setFrameRate(t){this.delay=1e3/t,this.frame=-1,this.time=null}start(){this.isPlaying||(this.isPlaying=!0,this.request=requestAnimationFrame(this.loop.bind(this)))}pause(){this.isPlaying&&(cancelAnimationFrame(this.request),this.isPlaying=!1,this.time=null,this.frame=-1)}}function x(){}function M(){}function L(){}function R(){}function _(){}function j(){}function D(){}function F(){}function k(){}function H(){}function N(){}function V(){}
1(x.prototype=new Object).constructor=x,x.easeIn=function(t,e,i,n,s){return null==s&&(s=1.70158),i*(t/=n)*t*((s+1)*t-s)+e},x.easeOut=function(t,e,i,n,s){return null==s&&(s=1.70158),i*((t=t/n-1)*t*((s+1)*t+s)+1)+e},x.easeInOut=function(t,e,i,n,s){return null==s&&(s=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(s*=1.525))*t-s))+e:i/2*((t-=2)*t*((1+(s*=1.525))*t+s)+2)+e},(M.prototype=new Object).constructor=M,M.easeOut=function(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},M.easeIn=function(t,e,i,n){return i-M.easeOut(n-t,0,i,n)+e},M.easeInOut=function(t,e,i,n){return t<n/2?.5*M.easeIn(2*t,0,i,n)+e:.5*M.easeOut(2*t-n,0,i,n)+.5*i+e},(L.prototype=new Object).constructor=L,L.easeIn=function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},L.easeOut=function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},L.easeInOut=function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},(R.prototype=new Object).constructor=R,R.easeIn=function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},R.easeOut=function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},R.easeInOut=function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},(_.prototype=new Object).constructor=_,_.easeIn=function(t,e,i,n){return i*(t/=n)*t*t*t+e},_.easeOut=function(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e},_.easeInOut=function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},(j.prototype=new Object).constructor=j,j.easeIn=function(t,e,i,n,s,r){if(0==t)return e;if(1==(t/=n))return e+i;if(r||(r=.3*n),!s||s<Math.abs(i)){s=i;var o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return-s*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/r)+e},j.easeOut=function(t,e,i,n,s,r){if(0==t)return e;if(1==(t/=n))return e+i;if(r||(r=.3*n),!s||s<Math.abs(i)){s=i;var o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return s*Math.pow(2,-10*t)*Math.sin((t*n-o)*(2*Math.PI)/r)+i+e},j.easeInOut=function(t,e,i,n,s,r){if(0==t)return e;if(2==(t/=n/2))return e+i;if(r||(r=n*(.3*1.5)),!s||s<Math.abs(i)){s=i;var o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return t<1?s*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/r)*-.5+e:s*Math.pow(2,-10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/r)*.5+i+e},(D.prototype=new Object).constructor=D,D.easeIn=function(t,e,i,n){return i*(t/=n)*t+e},D.easeOut=function(t,e,i,n){return-i*(t/=n)*(t-2)+e},D.easeInOut=function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},(F.prototype=new Object).constructor=F,F.easeIn=function(t,e,i,n){return i*(t/=n)*t+e},F.easeOut=function(t,e,i,n){return-i*(t/=n)*(t-2)+e},F.easeInOut=function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},(k.prototype=new Object).constructor=k,k.easeNone=function(t,e,i,n){return i*t/n+e},k.easeIn=function(t,e,i,n){return i*t/n+e},k.easeOut=function(t,e,i,n){return i*t/n+e},k.easeInOut=function(t,e,i,n){return i*t/n+e},(H.prototype=new Object).constructor=H,H.easeIn=function(t,e,i,n){return 0==t?e:i*Math.pow(2,10*(t/n-1))+e},H.easeOut=function(t,e,i,n){return t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e},H.easeInOut=function(t,e,i,n){return 0==t?e:t==n?e+i:(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},(N.prototype=new Object).constructor=N,N.easeIn=function(t,e,i,n){return i*(t/=n)*t*t+e},N.easeOut=function(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e},N.easeInOut=function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},(V.prototype=new Object).constructor=V,V.easeIn=function(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e},V.easeOut=function(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e},V.easeInOut=function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e};var U=B.prototype=new a;function B(t,e,i){a.call(this),this.initSetup(t,e,i)}U.constructor=B,B.ignorePropertys=["ease","id","delay","fps","ignorePropertys"],U.initSetup=function(t,e,n){this.setup=n||this.setup||{},this.object=t||null,this.duration=e||null,this.id=this.setup.id,this.ease=this.setup.ease||N.easeOut,this.delay=this.setup.delay||0,this.fps=i?i.getInstance().getFPS():60,this.parameters=null,this.frame=0,this.reset()},Object.defineProperty(U,"complete",{get:function(){return this.getComplete()}}),B.getIsIgnoredProperty=function(t){for(var e=!1,i=0;i<B.ignorePropertys.length;++i)if(t==B.ignorePropertys[i]){e=!0;break}return e},U.getIsFirstFrame=function(){return 0==this.frame},U.getComplete=function(){return this.frame>=this.getTotalFrames()},U.getStart=function(){return this.frame>=this.getDelayFrames()},U.getTotalFrames=function(){return this.getDurationFrames()+this.getDelayFrames()},U.getDurationFrames=function(){return this.secondsToFrames(this.duration)},U.getDelayFrames=function(){return this.secondsToFrames(this.delay)},U.getTimescale=function(){return this.duration/this.getDurationFrames()},U.reset=function(){this.frame=0,this.eventObject={},this.eventObject[r.START]=!1,this.eventObject[r.COMPLETE]=!1},U.kill=function(){this.frame=this.getTotalFrames()-1,this.updateCurrentFrameProperties()},U.resetObject=function(){var t=this.setup.reset;if(!0===t)for(var e in this.beginValues){var i=this.beginValues[e];i&&(this.object[e]=i)}else if(t instanceof Array)for(var n=0;n<t.length;++n)e=t[n],this.object[e]=this.beginValues[e]},U.update=function(){this.updateStart(),this.updateCurrentFrameProperties(),this.updateEnd()},U.updateCurrentFrameProperties=function(){var t=this.getObjectAtFrame(this.frame);if(t)for(var e in t){var i=t[e];this.object[e]=i}this.frame++}
1,U.updateStart=function(){this.getStart()&&this.callOnce("start",function(){this.initBeginValues(),this.dispatchEvent(new r(r.START),this)}.bind(this))},U.updateEnd=function(){this.getComplete()&&this.callOnce("complete",function(){this.setup.reset&&this.resetObject()}.bind(this))},U.initBeginValues=function(){for(var t in this.beginValues={},this.setup)B.getIsIgnoredProperty(t)||(this.beginValues[t]=this.object[t])},U.getObjectAtFrame=function(t){var e=null;if(this.getStart()&&this.beginValues)for(var i in e={},this.setup){var n=t-this.getDelayFrames();if(!B.getIsIgnoredProperty(i)){var s=this.setup[i];e[i]={};var r=n*this.getTimescale(),o=this.beginValues[i],a=s-o;n<this.getDurationFrames()-1?e[i]=this.ease(r,o,a,this.duration):e[i]=s}}return e},U.callOnce=function(t,e){this.eventObject[t]||(this.eventObject[t]=!0,e())},U.secondsToFrames=function(t){return Math.ceil(this.fps*t)};var q,G=z.prototype=new a;function z(t){a.call(this),this.override=t||!1,this.initVariables()}function W(t){a.call(this),this.setup=t||{},this.autoDispatchEnter=null==this.setup.autoDispatchEnter||this.setup.autoDispatchEnter,this.previousStateList=[],this.stateList=[],this.debug=!1,this.onExitState=null,this.onEnterState=null}function X(){a.call(this),this.id=null,this.setup=null,this.stateMachine=null}function Y(t){Object.call(this),this.setup=t||{},this.library={},this.currentState="",this.init()}function J(){}G.constructor=z,G.initVariables=function(){this.tweenList=[]},G.update=function(){for(var t=this.tweenList.length-1;t>=0;--t){var e=this.tweenList[t];e&&(e.update(),e.send(new r(r.UPDATE),e),e.getStart()&&e.send(new r(r.STEP),e),e.getComplete()&&(this.tweenList.splice(t,1),e.send(new r(r.COMPLETE),e)))}},G.add=function(t,e){if(t)if(t instanceof Array)for(var i=0;i<t.length;++i){var n=t[i];this.addTween(n,e)}else this.addTween(t,e);return t},G.remove=function(t){for(var e=this.tweenList.length-1;e>=0;--e)t==this.tweenList[e]&&this.tweenList.splice(e,1)},G.addTween=function(t,e){if(e=void 0!==e?e:this.override)for(var i=0;i<this.tweenList.length;++i)if(this.tweenList[i].object==t.object)return void(this.tweenList[i]=t);this.tweenList.push(t)},G.to=function(t,e,i){i.fps=this.fps,i.ignorePropertys=this.ignorePropertys;var n=new B(t,e,i);return this.addTween(n),n},G.from=function(t,e,i){i.fps=this.fps,i.ignorePropertys=this.ignorePropertys;var n={};for(var s in i)n[s]=i[s];for(var s in i)B.getIsIgnoredProperty(s)||void 0!==t[s]&&(n[s]=t[s]);this.start(t,i);var r=new B(t,e,n);return this.tweenList.push(r),r},G.start=function(t,e){for(var i in e)t[i]=e[i]},G.kill=function(t){t=void 0===t||t;for(var e=this.tweenList.length-1;e>=0;--e){var i=this.tweenList[e];t&&(i.kill(),i.send(new r(r.COMPLETE),i)),this.tweenList.splice(e,1)}},(q=W.prototype=new a).constructor=W,q.update=function(t){this.currentState&&this.currentState.update(t)},q.addState=function(t,e){e.id=t,e.stateMachine=this,e.init(),e.addEventListener(r.EXIT,this.stateEventHandler.bind(this)),e.addEventListener(r.MESSAGE,this.stateEventHandler.bind(this)),this.stateList.push(e)},q.stateEventHandler=function(t){this.dispatchEvent(t)},q.setState=function(t){if(this.debug&&console.log("StateMachine.setState: "+t),this.currentState&&(this.currentState.exit(),this.previousStateList.push(this.currentState.id)),this.currentState=this.getStateWithID(t),this.currentState){if(this.currentState.enter(),this.autoDispatchEnter){var e=this.getStateWithID(t);this.dispatchEvent(new r(r.ENTER),e)}}else console.log("Error: State not defined.",t)},q.getPreviousStateID=function(){return this.previousStateList[Math.max(this.previousStateList.length-1,0)]},q.getPreviousState=function(){return this.getStateWithID(this.getPreviousStateID())},q.getCurrentState=function(){return this.currentState},q.killPreviousState=function(){if(this.getPreviousStateID()==this.currentState.id)return!0;this.killState(this.getPreviousState()),this.previousStateList.pop()},q.killPreviousStates=function(){for(;this.previousStateList.length>0;)if(this.killPreviousState())return},q.killState=function(t){t&&(t.kill(),this.dispatchEvent(new r(r.KILL,t)))},q.hasState=function(t){for(var e=0;e<this.stateList.length;++e)if(this.stateList[e].id==t)return!0;return!1},q.getStateWithID=function(t){for(var e=0;e<this.stateList.length;++e){var i=this.stateList[e];if(i.id==t)break;
1i=null}return i},(q=X.prototype=new a).constructor=X,q.init=function(){},q.update=function(){},q.enter=function(){},q.exit=function(){},q.kill=function(){},q.updateIfAvailable=function(t){t&&t.update()},Y.prototype=new Object,Y.prototype.constructor=Y,Y.prototype.init=function(){},Y.prototype.update=function(){var t=this.library[this.currentState];t&&t()},Y.prototype.addState=function(t,e){this.library[t]=e},Y.prototype.setState=function(t){this.currentState=t},J.LANG="lang",J.continueAfterCondition=function(t,e,i){i=void 0!==i?i:100,t()?e():setTimeout((function(){J.continueAfterCondition(t,e,i)}),i)},J.getURLIsInLocalFileSystem=function(){var t=window.location.href;return!(t.match("http")||t.match("https"))},J.getCanvasDataURL=function(t,e,i,n){n=void 0!==n?n:"image/jpeg",e=void 0===e?1:e,i=void 0===i?1:i;var s=document.createElement("canvas");return s.width=t.width*e,s.height=t.height*e,s.getContext("2d").drawImage(t,0,0,s.width,s.height),s.toDataURL(n,i)},J.mergeObjects=function(t,e){for(var i in e)t[i]=e[i];return t},J.setupScopeVariables=function(t,e,i){for(var n in e=void 0!==e?e:{},i){var s=void 0!==e[n]?e[n]:i[n];t[n]=s}},J.clearContainer=function(t){if(t)for(;t.children.length>0;)t.removeChildAt(0)},J.maskDisplayObject=function(t,e){e.x=e.x||0,e.y=e.y||0;var i=new createjs.Shape;i.x=t.x,i.y=t.y,i.graphics.beginFill("#ffffff").drawRect(e.x,e.y,e.width,e.height),t.mask=i},J.setDisplayObjectSizeTo=function(t,e,i,n){var s=t.getBounds();if(null!=e){var r=e/s.width;t.scaleX=r,t.width=r*s.width}if(null!=i){var o=i/s.height;t.scaleY=o,t.height=o*s.height}},J.getFrameLabel=function(t,e){var i=null;if(t&&t.spriteSheet){var n=null==e?t.currentFrame:e,s=t.spriteSheet._data;for(var r in s){var o=s[r],a=r[0];if(a==a.toUpperCase()&&J.getListContainsValue(o.frames,n)){i=r;break}}}return i},J.getNumOfDisplayObjectsByNameAndFrameInContainer=function(t,e,i){for(var n=0,s=0;s<t.children.length;++s){var r=t.children[s];r.children?n+=J.getNumOfDisplayObjectsByNameAndFrameInContainer(r,e,i):r.name==e&&r.currentFrame==i&&n++}
1return n},J.getChildrenByName=function(t,e,i,n){n=void 0!==n&&n,i=void 0===i||i;var s=[];for(var r in t){var o=t[r];o instanceof createjs.DisplayObject&&"string"==typeof r&&(r.match(e)?(i&&(o.name=r),s.push(o)):"parent"!=r&&o.children&&(s=s.concat(J.getChildrenByName(o,e))))}if(n)for(var a=t.children,h=s.length-1;h>=0;--h){var u=s[h];J.getListContainsValue(a,u)||s.splice(h,1)}return s},J.centerPixiPivot=function(t){var e=t.getLocalBounds(t),i=t.pivot;i.x=.5*e.width,i.y=.5*e.height,t.x+=.5*t.width,t.y+=.5*t.height},J.getNumberValueString=function(t,e,i){i=void 0!==i?i:e.length;for(var n=e,s=0;s<i-1;++s)n+=e;return String(n+t).slice(-i)},J.convertSecondsToStringFormat=function(t,e){var i=null==e?":":e,n=Math.floor(t/60),s=Math.ceil(t%60);return String("00"+String(n)).slice(-2)+i+String("00"+String(s)).slice(-2)},J.capitalizeFirstLetter=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},J.getURLParameterStateID=function(t,e){e=void 0!==e?e:"state";var i=System.getURLParameter(e),n=String(J.getLanguageID().split("-")[0]).toLowerCase(),s=null;return i&&(s=window.PIXI?i+"_"+J.LANG+"_"+n:"img/assets_"+i+"_"+J.LANG+"_"+n+".json"),t.hasState(s)||(s=window.PIXI?i:"img/assets_"+i+".json"),t.hasState(s)?s:null},J.getManifestWithLanguageString=function(t){for(var e=0;e<t.length;++e){var i=t[e].split("?lang");i.length>1&&(t[e]=J.getLanguageString(i[0]))}return t},J.getLanguageString=function(t){var e="_lang_",i=t.split(e),n=J.getLanguageID();if(t)if(1==i.length){var s=n.split("-"),r=e+(n=s.length>1?s[0]:n);t.split("@1").length>1?t=t.replace("@1",r+"@1"):t.split(".").length>1?t=t.replace(".",r+"."):t+=r}else if(i.length>1){var o="."+i[1].split(".")[1];t=i[0]+e+n+o}return t},J.getLanguageID=function(){var t=System.getURLParameter("lang");return null==t?"de":t},J.getObjectWithPropertyAndValue=function(t,e,i){for(var n=0;n<t.length;++n){var s=t[n];if(i==s[e])break;s=null}return s},J.changeToMatchingOrder=function(t,e){for(var i=[],n=0;n<e.length;++n)for(var s=e[n],r=t.length-1;r>=0;--r){var o=t[r];o.match(s)&&(i.push(o),t.splice(r,1))}return i.concat(t),i}
1,J.removeMatchingElementFromList=function(t,e){for(var i=e.length-1;i>=0;--i)e[i].match(t)&&e.splice(i,1);return e},J.getXRandomElementsFromList=function(t,e){for(var i=[],n=0;n<t;++n){var s=Math.floor(Math.random()*e.length),r=e.splice(s,1)[0];i.push(r)}return i},J.getListContainsValue=function(t,e){if(t)for(var i=0;i<t.length;++i)if(t[i]==e)return!0;return!1},J.getListContainsValueStrict=function(t,e){if(t)for(var i=0;i<t.length;++i)if(t[i]===e)return!0;return!1},J.getMatchingElementFromList=function(t,e){for(var i=0;i<e.length;++i){var n=e[i];if(n.match(t))return n}},J.getMatchingElementsFromList=function(t,e){for(var i=[],n=0;n<e.length;++n){var s=e[n];s.match(t)&&i.push(s)}return i},J.getAmountOfValuesInList=function(t,e){for(var i=0,n=0;n<e.length;++n)e[n]==t&&i++;return i},J.forEveryObjectInListCall=function(t,e,i){i=void 0===i||i;for(var n=0;n<t.length;++n){var s=t[n];(null!==s||i)&&e(s,n)}},J.getArrayWithObjectsWithPrefix=function(t,e,i){for(var n=new Array,s=0;s<t.length;++s){var r=t[s];r[e].split(i).length>1&&n.push(r)}return n},J.getShuffledArrayFrom=function(t){var e=[];for(t=t.concat();t.length>0;)e.push(t.splice(Math.floor(Math.random()*t.length),1)[0]);return e},J.getRandomElementFromList=function(t){return J.getRandomElementsFromList(t,1)[0]},J.getRandomElementsFromList=function(t,e,i){var n=[],s=t.slice(),r=i?i.length:0;if(i&&(n=n.concat(i)),t.length>0)for(;n.length<e-r;){var o=Math.floor(Math.random()*s.length),a=s.splice(o,1)[0];J.getListContainsValue(n,a)||n.push(a)}return n},J.getListElementWithPropertyAndValue=function(t,e,i){for(var n=0;n<t.length;++n){var s=t[n];if(s[e]==i)return s}},J.getClosestObject=function(t,e){for(var i=null,n=null,s=0;s<t.length;++s){var r=t[s],o=J.getDistanceBetweenTwoPoints(r.x,r.y,e.x,e.y);(null===i||o<i)&&(i=o,n=r)}return n},J.removeDuplicatesFromList=function(t){return t.reduce((function(t,e){return J.getListContainsValue(t,e)||t.push(e),t}),[])},J.getDistanceBetweenTwoPoints=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)},J.getRotationBetweenTwoPoints=function(t,e,i,n){var s=t-i,r=e-n;return-Math.atan2(s,r)*(180/Math.PI)},J.rotationToPoint=function(t){var e=t+180;return e=e<0?e+360:e>360?e-360:e,{x:Math.cos(Math.PI/180*e),y:Math.sin(Math.PI/180*e)}},J.pointHitsObject=function(t,e,i){var n=!1;return t>i.x&&t<i.x+Number(i.width)&&e>i.y&&e<i.y+Number(i.height)&&(n=!0),n},J.getFibonacciAt=function(t){for(var e=0,i=[],n=0;n<t+2;++n)e=(i.length>1?i[n-1]:0)+(i.length>2?i[n-2]:1),i.push(e);return e},J.followMouse=function(t,e,i,n){J.followProperty(t,"x",e,n),J.followProperty(t,"y",i,n)},J.followProperty=function(t,e,i,n,s){return n=n||.06,n=(i+(s=s||-1)*t[e])*n,t[e]=t[e]+n,n},J.graphicsAreOnStage=function(t,e,i){var n=!0,s=e.getBounds();return(t.x+e.x+s.width<0||t.x+e.x>i.width)&&(n=!1),(t.y+e.y+s.height<0||t.y+e.y>i.height)&&(n=!1),n},J.getDisplayObjectVO=function(t){var e=t.scale?t.scale:{x:t.scaleX,y:t.scaleY};return{graphics:t,x:t.x,y:t.y,rotation:t.rotation,width:t.width,height:t.height,scale:{x:e.x,y:e.y},alpha:t.alpha,random:Math.random()}},J.sortListByProperty=function(t,e,i){var n=i?-1:1;return t.sort((function(t,i){return t[e]<i[e]?-1*n:t[e]>i[e]?1*n:0})),t},J.sortAlphabetically=function(t,e){return J.sortAccending(t,e)},J.sortAccending=function(t,e){return t<e?-1:t>e?1:0};var K=Q.prototype=Object.create(Object.prototype);function Q(t){Object.call(this),this.languageDefault=t.languageDefault||"de",this.languageSuffix=t.languageSuffix||"lang",this.languageDelimiter=t.languageSuffix||"_",this.languageVersions=void 0!==t.languageVersions&&t.languageVersions,this.system=this.adaptObjectLanguageURLs(t),this.settings=this.adaptObjectLanguageURLs(t.settings||Settings),this.gameSetup=i.getInstance(),this.manifest=t.manifest||null,this.loaderIgnore=t.loaderIgnore||null,this.preloaderManifest=t.preloaderManifest||null,this.preloaderState=t.preloaderState||null,this.proxy=t.proxy||null,this.tweenTime=void 0!==t.tweenTime?t.tweenTime:.3,this.tweenObjectStart=void 0!==t.tweenObjectStart?t.tweenObjectStart:{alpha:0},this.tweenObjectIn=void 0!==t.tweenObjectIn?t.tweenObjectIn:{alpha:1,ease:Strong.easeOut},this.tweenObjectOut=void 0!==t.tweenObjectOut?t.tweenObjectOut:null,this.allowSameStateSet=void 0===t.allowSameStateSet||t.allowSameStateSet,this.urlAudio=t.urlAudio||null,this.urlContent=t.urlC
1ontent||null,this.urlPreloader=t.urlPreloader||null,this.urlSuffix=t.urlSuffix||null,this.roundPixels=t.roundPixels||null,this.forceURLImage=void 0===t.forceURLImage||t.forceURLImage,this.clearBeforeRender=void 0===t.clearBeforeRender||t.clearBeforeRender,this.renderOnBlur=void 0!==t.renderOnBlur&&t.renderOnBlur;var e=n.getURLParameter("cdnURL");e&&this.urlAudio&&(this.urlAudio=e+this.urlAudio),this.forceFocus=!1,this.inFocus=!0,this.step=0,this.init()}K.constructor=Q,Object.defineProperty(K,"language",{get:function(){this._language=this._language||n.getURLParameter(this.languageSuffix)||this.languageDefault;var t=this._language.split("-");return this._language=t.length>1?t[0]:this._language,this._language},set:function(t){this._language=t}}),Object.defineProperty(K,"urlParameterState",{get:function(){return J.getURLParameterStateID(this.stateMachine,"state")}}),K.initVariables=function(){},K.initTracking=function(){},K.initStateMachine=function(){},K.loadCompleteHandler=function(){},K.init=function(){this.initFacadeVariables(),this.initFacadeStateMachine(),this.initPixiJS(),this.initPixiRotationInput(),this.initWindowEvents(),this.initTick(),this.initLoader(),this.initSetupObject(),this.initVariables(),this.initTracking(),this.initStateMachine()},K.adaptObjectLanguageURLs=function(t){for(var e in t){var i=t[e];if("string"==typeof i)t[e]=this.replaceStringLanguageValue(i);else if(i instanceof Array)for(var n=0;n<i.length;++n)i[n]=this.replaceStringLanguageValue(i[n])}return t},K.replaceStringLanguageValue=function(t){var e=this.languageDelimiter,i=this.languageSuffix,n=t.split(e+i);if(n.length>1){var s=n[1].split(".");s[0]=this.language;var r=s.join(".");n[1]=r,t=n.join(e+i+e)}return t},K.searchAndReplaceValueInList=function(t,e,i){if(t)for(var n=0;n<t.length;++n)if(t[n]==e){t[n]=i;break}},K.initFacadeVariables=function(){this.doTween=new z,this.fps=this.gameSetup.getFPS(),p.getInstance({ignoreSoundOnMobile:this.system.ignoreSoundOnMobile,ignoreFocus:this.system.ignoreFocus}),this.setup={forceURLImage:this.forceURLImage,recursion:1,facade:this,proxy:this.proxy,suffix:this.urlSuffix,urlAudio:this.urlAudio,urlContent:this.urlContent,urlPreloader:this.urlPreloader}},K.initFacadeStateMachine=function(){this.stateMachine=new W,this.stateMachine.on(r.ENTER,this.stateMachineOnEnterStateHandler,this)},K.stateMachineOnEnterStateHandler=function(t){this.tweenTransitionStateGraphics()},K.setState=function(t){var e=!this.stateMachine.currentState||this.stateMachine.currentState.id!=t;return(this.allowSameStateSet||e)&&this.stateMachine.setState(t),t},K.tweenTransitionStateGraphics=function(){var t=this.stateMachine.getCurrentState(),e=this.stateMachine.getPreviousState();t.graphics&&e?(t.graphics.interactive=!1,t.graphics.mouseEnabled=!1,this.tweenObjectStart&&this.doTween.start(t.graphics,this.tweenObjectStart),this.tweenObjectIn?this.doTween.to(t.graphics,this.tweenTime,this.tweenObjectIn).on(r.COMPLETE,this.tweenInCompleteHandler,this):this.tweenInCompleteHandler(null),this.tweenObjectOut&&e.graphics&&this.doTween.to(e.graphics,this.tweenTime,this.tweenObjectOut)):this.tweenInCompleteHandler(null)},K.tweenInCompleteHandler=function(t){this.stateMachine.killPreviousStates();var e=this.stateMachine.getCurrentState().graphics;e&&(e.interactive=!0,e.mouseEnabled=!0)},K.initPixiJS=function(){PIXI.utils.skipHello?PIXI.utils.skipHello():window.PIXI.utils._saidHello=!0,this.stage=new PIXI.Container,this.renderer=this.getPixiRenderer(),this.renderer.preserveDrawingBuffer=!1,this.stage.renderer=this.renderer,this.canvas=this.renderer.view,this.gameSetup.preventDefaultEvents&&(this.canvas.onclick=function(){this.focus()},this.canvas.onselectstart=function(){return!1}),this.gameSetup.addCanvas(this.canvas)},K.getPixiRenderer=function(){var t=null,e=this.gameSetup.canvasWidth,n=this.gameSetup.canvasHeight,s={transparent:!0,clearBeforeRender:this.clearBeforeRender,roundPixels:this.roundPixels,antialias:!1};switch(this.gameSetup.renderer){case i.CANVAS:t=new PIXI.CanvasRenderer(e,n,s);break;case i.WEBGL:default:t=PIXI.autoDetectRenderer(e,n,s)}return t.resize(e,n),this.gameSetup.preventDefaultEvents||(t.plugins.interaction.autoPreventDefault=!1),t},K.initPixiRotationInput=function(){Number(this.canvas.style.width.split("px")[0]);var t=Number(this.canvas.style.height.split("px")[0]),e=PIXI.InteractionManager?PIXI.InteractionManager.prototype:PIXI.interaction.InteractionManager.prototype;e.mapPositionToPointOriginal=e.mapPositionToPointOriginal?e.mapPositionToPointOriginal:e.mapPositionToPoint,e.mapPositionToPoint=this.gameSetup.orientationIsCorrect?e.mapPositionToPointOriginal:function(e,i,n){var s=this.interactionDOMElement.getBoundingClientRect();s={bottom:s.right,height:s.width,left:s.left,right:s.bottom,top:s.top,width:s.height};var r=n,o=t-i;e.x=(r-s.left)*(this.interactionDOMElement.width/s.width)/this.resolution,e.y=(o-s.top)*(this.interactionDOMElement.height/s.height)/this.resolution}},K.initWindowEvents=function(){this.gameSetup.extendCanvas&&window.addEventListener(r.RESIZE,this.windowResizeHandler.bind(this)),!1===this.renderOnBlur&&(window.addEventListener(r.BLUR,this.windowOnBlurHandler.bind(this)),window.addEventListener(r.FOCUS,this.windowOnFocusHandler.bind(this)))},K.windowResizeHandler=function(t){this.initPixiRotationInput(),this.gameSetup.allowResizeEvent&&this.renderer.resize(this.gameSetup.canvasWidth,this.gameSetup.canvasHeight),this.render()},K.windowOnBlurHandler=function(t){this.inFocus=!1},K.windowOnFocusHandler=function(t){this.inFocus=!0},K.initTick=function(){var t=this;if(void 0!==this.gameSetup.setup.fps)new C(this.fps,this.tick.bind(this)).start();else{var e=function(){requestAnimationFrame(e),t.tick()};requestAnimationFrame(e)}},K.tick=function(){(this.forceFocus||this.inFocus)&&this.render()},K.render=function(){var t=this.gameSetup.orientationImageSRC;if((this.forceFocus||this.gameSetup.orientationIsCorrect&&t||null==t)&&!this.renderError){this.step++;try{this.stateMachine.update(this.step),this.doTween&&this.doTween.update(),this.renderer.render(this.stage)}
1catch(t){this.renderError=!0,console.error&&console.error(t)}}},K.initSetupObject=function(){this.setup.loaderPreload=this.loaderPreload,this.setup.loader=this.loader,this.setup.stage=this.stage,this.setup.canvas=this.canvas,this.setup.renderer=this.renderer,this.setup.facade=this},K.initJukebox=function(){if(null!=this.urlAudio){var t=this.loader.getObjectWithID(this.urlAudio);if(t){var e=t.result;p.getInstance({loader:this.loader,json:e}).ignoreSoundEnd=!0}}},K.initLoader=function(){this.loaderPreload=new g(this.setup),this.loaderPreload.ignore=this.loaderIgnore,this.loaderPreload.on(r.COMPLETE,this.loaderPreladCompleteHandler.bind(this)),this.loader=new g(this.setup),this.loader.ignore=this.loaderIgnore,this.loader.on(r.COMPLETE,this.loaderCompleteHandler.bind(this)),this.preloaderManifest&&this.preloaderManifest.length>0?this.loaderPreload.load(this.preloaderManifest):this.loaderPreladCompleteHandler()},K.loaderPreladCompleteHandler=function(t){this.enterPreloaderState(),this.loader.load(this.manifest)},K.enterPreloaderState=function(){this.stateMachine.hasState(this.preloaderState)&&this.stateMachine.setState(this.preloaderState)},K.loaderCompleteHandler=function(t){this.initJukebox(),this.loadCompleteHandler()};var Z=$.prototype=Object.create(Object.prototype);function $(t){Object.call(this),this.reset()}function tt(){}Z.constructor=$,Z.reset=function(){},Object.defineProperty(Z,"user",{get:function(){return this._user||(this._user={name:"",score:0}),this._user}}),Object.defineProperty(Z,"score",{get:function(){return this.user.score},set:function(t){this.user.score=t}}),Object.defineProperty(Z,"questionList",{get:function(){return[{questionText:"Was bedeutet\nFake News auf\nDeutsch?",questionFontSize:40,questionVO:"game2Question0",correctVO:"game2CorrectFNName",falseVO:"game2FalseFNName",answers:[{text:"Langweilige\nInformationen",size:28,isCorrect:!1},{text:"Gefälschte\nNachrichten",size:28,isCorrect:!0},{text:"Korrekte\nMeldungen",size:28,isCorrect:!1}]},{questionText:"Was stimmt nicht?",questionFontSize:35,questionVO:"game2Question1",correctVO:"game2Correct1",falseVO:"game2False1",answers:[{text:"Fake News gibt es\nnur im Internet.",size:28,isCorrect:!0},{text:"Fake News kann\nman manchmal\nschwer erkennen.",size:25,isCorrect:!1},{text:"Fake News sind\ngefährlich, weil sie die\nMenschen beeinflussen.",size:25,isCorrect:!1}]},{questionText:"Welcher dieser Punkte kann\nein Hinweis sein, dass es sich\num Fake News handelt?",questionFontSize:30,questionVO:"game2Question2",correctVO:"game2Correct2",falseVO:"game2False2",answers:[{text:"Die Farbe der Schrift.",size:28,isCorrect:!1},{text:"Viele\nRechtschreibfehler",size:28,isCorrect:!0},{text:"Die Länge\nder Nachricht.",size:28,isCorrect:!1}]},{questionText:"Wie kannst du überprüfen,\nob eine Meldung wahr ist?",questionFontSize:30,questionVO:"game2Question3",correctVO:"game2CorrectTruth",falseVO:"game2FalseTruth",answers:[{text:"Ich vergleiche\ndie Informationen\nmit anderen Quellen.",size:25,isCorrect:!0},{text:"Ich glaube alles.",size:28,isCorrect:!1},{text:"Ich lese nichts\nmehr im Internet.",size:28,isCorrect:!1}]},{questionText:"Sind Fake News in\nsozialen Netzwerken\ngefährlich?",questionFontSize:30,questionVO:"game2Question4",correctVO:"game2CorrectDanger",falseVO:"game2FalseDanger",answers:[{text:"Ja, denn sie\nverbreiten sich dort\nbesonders schnell.",size:25,isCorrect:!0},{text:"Nein, denn in den\nsozialen Netzwerken\nwerden nur echte\nInformationen gezeigt.",size:25,isCorrect:!1},{text:"Fake News sind\nin sozialen Netzwerken\nnicht gefährlich.",size:25,isCorrect:!1}]},{questionText:"Was tust du,\nwenn du glaubst, dass eine\nNachricht nicht wahr ist?",questionFontSize:30,questionVO:"game2Question5",correctVO:"game2CorrectDoubt",falseVO:"game2FalseDoubt",answers:[{text:"Ich glaube der\nNachricht trotzdem.\nSonst würde es ja\nnicht dort stehen.",size:25,isCorrect:!1},{text:"Ich teile sie mit\nall meinen Freunden.",size:28,isCorrect:!1},{text:"Ich leite sie nicht weiter\nund vergleiche\ndie Informationen\nmit anderen Seiten.",size:25,isCorrect:!0}]}]}}),(tt.prototype=new Object).constructor=tt,tt.URL_JSON_AUDIO="audio/audio.json",tt.URL_JSON_CONTENT="img/content.json",tt.URL_JSON_PRELOADER="img/preloader.json",tt.ID_STATE_PRELOADER="preloader",tt.ID_STATE_START="start",tt.ID_STATE_INTRO="intro",tt.ID_STATE_GAME0INTRO="game0Intro",tt.ID_STATE_GAME0="game0",tt.ID_STATE_GAME0OUTRO="game0Outro",tt.ID_STATE_GAME1INTRO="game1Intro",tt.ID_STATE_GAME1="game1",tt.ID_STATE_GAME1OUTRO="game1Outro",tt.ID_STATE_GAME2INTRO="game2Intro",tt.ID_STATE_GAME2="game2",tt.ID_STATE_GAME2OUTRO="game2Outro",tt.ID_STATE_OUTRO="outro",tt.PARAMETER_STATE="state";var et=it.prototype=Object.create(X.prototype);function it(t,e){X.call(this,t),this.tick=0,this.list=[],this.setup=t||this.setup||{},this.removeAllEventListenersOnKill=e||!1,this.updateID=void 0,this.initSharedObjectVariables()}et.constructor=it,it.CENTER_RANGE=400,Object.defineProperty(et,"events",{get:function(){var t=[];return t.push(r.MESSAGE),t.push(r.EXIT),J.forEveryObjectInListCall(this.list,function(e){if(e.events)for(var i=0;i<e.events.length;++i){var n=e.events[i];
1J.getListContainsValue(t,n)||t.push(n)}}.bind(this)),t}}),Object.defineProperty(et,"graphics",{get:function(){return this.shared.graphics},set:function(t){this.shared.graphics=t}}),Object.defineProperty(et,"container",{get:function(){return this.shared.container}}),et.getModule=function(t,e){return this.getModules(t,e)[0]},et.getModules=function(t,e){var i=[];e||window[t];for(var n=0;n<this.list.length;++n){var s=this.list[n];s&&s.constructor.name===t&&i.push(s)}return i},et.start=function(){},et.post=function(){},et.enter=function(){this.start(),this.mapComponentCallbacks(),this.filterListElements(),this.setupComponents(),this.post()},et.mapComponentCallbacks=function(){var t=function(e){if("object"==typeof e)return e;if("function"==typeof e){var i=e();return i instanceof Array?i.map((function(e){return t(e)})):i}return result};this.list=this.list.reduce((function(e,i){return e.concat(t(i))}),[])},et.filterListElements=function(){this.list=this.list.filter((function(t){return null!=t}))},et.setupComponents=function(){this.list.forEach(function(t){for(var e=0;e<this.events.length;++e){var i=this.events[e];t.moduleState=this,t.addEventListener(i,this.moduleEventHandler.bind(this))}t.enter()}.bind(this))},et.moduleEventHandler=function(t){this.dispatchEvent(t)},et.exit=function(){this.list.forEach(function(t){t.exit(),t.removeAllEventListeners()}.bind(this))},et.update=function(t){this.list.forEach(function(e){e.updateID!==this.updateID&&null!==e.updateID||e.update(t)}.bind(this))},et.kill=function(){this.list.forEach(function(t){t.kill()}.bind(this)),this.removeAllEventListenersOnKill&&this.removeAllEventListeners()},et.initSharedObjectVariables=function(){for(var t in this.shared={state:this,messenger:new a},this.setup){var e=this.setup[t];this.shared[t]=e}this.list=[]};var nt,st=rt.prototype=Object.create(a.prototype);function rt(){a.call(this)}function ot(t,e,i,n){rt.call(this),this.setup=t,this.name=e,this.progressCallback=i,this.transform=n||{x:0,y:0,scale:"x"}}function at(t){Object.call(this),J.setupScopeVariables(this,t,{setup:t,graphics:null,transform:{x:0,y:0,scale:"x"}}),this.init()}function ht(){}st.constructor=rt,st.enter=function(){},st.exit=function(){},st.kill=function(){},st.update=function(){},(nt=ot.prototype=Object.create(rt.prototype)).constructor=ot,nt.enter=function(){this.initVariables(),this.initMask()},nt.update=function(){this.updateMaskProgress()},nt.initVariables=function(){this.graphics=this.setup.graphics,this.displayObject=this.graphics.getChildByName(this.name)},nt.initMask=function(){this.mask=new at({graphics:this.displayObject,transform:this.transform})},nt.updateMaskProgress=function(){this.mask.progress=this.progressCallback()},(nt=at.prototype=Object.create(Object.prototype)).constructor=at,Object.defineProperty(nt,"progress",{get:function(){return this._progress},set:function(t){this._progress=t;var e=this.mask.pivot;e.x=this.graphics.width*this.transform.x,e.y=this.graphics.height*this.transform.y,this.mask.x=this.graphics.x+e.x,this.mask.y=this.graphics.y+e.y,this.mask.scale[this.transform.scale]=Math.max(.001,Math.min(1,this._progress))}}),nt.init=function(){this.initMask()},nt.initMask=function(){this.mask=new PIXI.Graphics;var t=this.mask.pivot;t.x=this.graphics.width*this.transform.x,t.y=this.graphics.height*this.transform.y,this.mask.x=this.graphics.x+t.x,this.mask.y=this.graphics.y+t.y,this.mask.beginFill(0,1),this.mask.drawRect(0,0,this.graphics.width,this.graphics.height),this.mask.endFill(),this.progress=this.setup.progress||0,this.graphics.mask=this.mask,this.graphics.parent.addChild(this.mask)},(ht.prototype=Object.create(Object.prototype)).constructor=ht,ht.p00={x:0,y:0},ht.p11={x:1,y:1},ht.linearTransition=[ht.p00,ht.p00,ht.p11,ht.p11],ht.getY=function(t,e,i,n,s){var r;if(t==e.x)r=0;else if(t==s.x)r=1;else{var o=-e.x+3*i.x-3*n.x+s.x,a=3*e.x-6*i.x+3*n.x,h=-3*e.x+3*i.x,u=e.x-t,c=ht.solveCubic(o,a,h,u);if(null==c)return null;r=c}return ht.cubed(1-r)*e.y+3*r*ht.squared(1-r)*i.y+3*ht.squared(r)*(1-r)*n.y+ht.cubed(r)*s.y},ht.solveCubic=function(t,e,i,n){if(0==t)return ht.solveQuadratic(e,i,n);if(0==n)return 0;e/=t,n/=t;var s=(3*(i/=t)-ht.squared(e))/9,r=(-27*n+e*(9*i-2*ht.squared(e)))/54,o=ht.cubed(s)+ht.squared(r),a=e/3,h=null,u=null;if(o>0){var c=r+Math.sqrt(o);c=c<0?-ht.cubicRoot(-c):ht.cubicRoot(c);var l=r-Math.sqrt(o);if((h=-a+c+(l=l<0?-ht.cubicRoot(-l):ht.cubicRoot(l)))>=0&&h<=1)return h}else if(0==o){if((h=2*(u=r<0?-ht.cubicRoot(-r):ht.cubicRoot(r))-a)>=0&&h<=1)return h;if((h=-(u+a))>=0&&h<=1)return h}else{var d=(s=-s)*s*s;if(d=Math.acos(r/Math.sqrt(d)),(h=-a+(u=2*Math.sqrt(s))*Math.cos(d/3))>=0&&h<=1)return h;if((h=-a+u*Math.cos((d+2*Math.PI)/3))>=0&&h<=1)return h;if((h=-a+u*Math.cos((d+4*Math.PI)/3))>=0&&h<=1)return h}return null}
1,ht.solveQuadratic=function(t,e,i){var n=(-e+Math.sqrt(ht.squared(e)-4*t*i))/(2*t);return n>=0&&n<=1||(n=(-e-Math.sqrt(ht.squared(e)-4*t*i))/(2*t))>=0&&n<=1?n:null},ht.squared=function(t){return t*t},ht.cubed=function(t){return t*t*t},ht.cubicRoot=function(t){return Math.pow(t,1/3)};var ut=ct.prototype=Object.create(Object.prototype);function ct(){Object.call(this),this.object={},this.pool={}}ut.constructor=ct,ut.setObject=function(t,e,i){this.object[t][e]=i},ut.getObject=function(t,e,i){i=void 0!==i&&i,this.object[t]=this.object[t]||{};var n=this.object[t][e]||null;return i&&this.removeObject(t,e),n},ut.removeObject=function(t,e){this.object[t][e]=null},ut.addToPool=function(t,e){(this.pool[t]=this.pool[t]||[]).push(e)},ut.getFromPool=function(t){var e=this.pool[t];if(e)var i=e.pop();return this.pool[t]=e,i};var lt=dt.prototype=Object.create(PIXI.Container.prototype);function dt(){PIXI.Container.call(this)}lt.constructor=dt,lt.getChildByID=function(t){return this.getChildrenByID(t)[0]},lt.getChildrenByID=function(t,e){return e=void 0===e||e,this.getChildrenByPropertyAndValue("id",t,e)},lt.getChildByName=function(t,e){return this.getChildrenByName(t,!1,e)[0]},lt.getChildrenByName=function(t,e,i){return e=void 0===e||e,this.getChildrenByPropertyAndValue("name",t,e,i)},lt.getChildrenByPropertyAndValue=function(t,e,i,n){i=void 0!==i&&i,n=void 0===n||n;for(var s=[],r=this.children,o=0;o<r.length;++o){var a=r[o],h=a.children,u=a[t];u&&(i?u.match(e):u==e)&&s.push(a),h.length>0&&a.getChildrenByPropertyAndValue&&n&&(s=s.concat(a.getChildrenByPropertyAndValue(t,e,i)))}return s},Object.defineProperty(lt,"stage",{get:function(){if(!this._stage)for(var t=this.parent;null!=t;)(t=t.parent)&&(this._stage=t);return this._stage}}),Object.defineProperty(lt,"renderer",{get:function(){return this.stage.renderer}}),PIXI.AnimatedSprite=PIXI.AnimatedSprite||PIXI.extras.AnimatedSprite;var pt=ft.prototype=Object.create(PIXI.AnimatedSprite.prototype);function ft(t,e,i){this.animationDictionary=e||{},PIXI.AnimatedSprite.call(this,t,e),this.comments=i||null,this.onAnimationEnd=null,this.isPlaying=!0,this.setAnimation(0)}function gt(t){return gt.core={filter:function(e,i){i=void 0!==i&&i;var n=[];for(var s in t){var r=t[s];e(s,r)&&n.push(i?s:r)}return n},map:function(e){var i=[];for(var n in t){var s=t[n];i.push(e(n,s))}return i},every:function(e){for(var i in t)if(e(i,t[i]))return!0;return!1},forEach:function(e){for(var i in t)e(i,t[i])},reduce:function(e,i){for(var n in t)i=e(n,t[n],i);return i},find:function(e,i){for(var n in t)e(n,t[n],i),i=n;return i},clone:function(){var e=function(t,i){for(var n in t){var s=t[n];i[n]=s instanceof Array?e(s,[]):"object"==typeof s?e(s,{}):s}return i};return e(t,{})}},gt.core}pt.constructor=ft,ft.ANIMATION_SPEED=1,Object.defineProperty(pt,"stage",{get:function(){return this.parent}}),Object.defineProperty(pt,"totalAnimationFrames",{get:function(){return this.endFrame-1-this.beginFrame}}),Object.defineProperty(pt,"labels",{get:function(){if(!this._labels)for(var t in this._labels=[],this.animationDictionary)this.labels.push(t);return this._labels}}),Object.defineProperty(pt,"currentLabel",{get:function(){return this.getLabelAtFrame(this.beginFrame)}}),Object.defineProperty(pt,"currentFrameIndexLabel",{get:function(){return this.getLabelAtFrame(this.currentFrameIndex)}}),Object.defineProperty(pt,"currentLabelObject",{get:function(){return this.animationDictionary[this.getLabelAtFrame(this.beginFrame)]}}),Object.defineProperty(pt,"currentFrameIndex",{get:function(){var t=this.currentLabelObject?this.currentLabelObject.begin:0;return Math.floor(t+this._currentTime)}}),pt.getFrameNumber=function(t,e){return"number"==typeof t?t:e||0},pt.getLabelAtFrame=function(t){for(var e in this.animationDictionary){var i=this.animationDictionary[e];if(t>=i.begin&&t<=i.end)return e}},pt.gotoAndPlayMovieClip=pt.gotoAndPlay,pt.gotoAndPlay=function(t,e,i){e=this.getFrameNumber(t,e),this.gotoAndPlayMovieClip(e),this._currentTime=e,this.setAnimation(t,i),this.gotoAndPlayMovieClip(e)},pt.gotoAndStopMovieClip=pt.gotoAndStop,pt.gotoAndStop=function(t,e){e=this.getFrameNumber(t,e),this.gotoAndStopMovieClip(e),this.stop(),this.setAnimation(t),this.isPlaying=!1,this.setFrame
1(e)},pt.setFrame=function(t){this._currentTime=t;var e=Math.floor(this._currentTime);this._texture=this._textures[this.getAnimationFrameIndex(e)%this._textures.length]},pt.updateMovieClip=pt.update,pt.update=function(t){this.updateMovieClip(t);var e=Math.floor(this._currentTime),i=null;(this.loop||e<this.endFrame-this.beginFrame)&&(i=this.getAnimationFrameIndex(e)%this._textures.length,this._texture=this._textures[i],this.onAnimationEnd&&i==this.endFrame-1&&this.onAnimationEnd(this))},pt.clone=function(){var t=new ft(this.textures,this.animationDictionary);return t.pivot={x:this.pivot.x,y:this.pivot.y},t.scale={x:this.scale.x,y:this.scale.y},t.rotation=this.rotation,t.x=this.x,t.y=this.y,t},pt.setAnimation=function(t,e){this.animation=this.animationDictionary[t],this.animation&&(this.animation.loop=void 0!==e||e),this.beginFrame=this.animation?this.animation.begin:0,this.endFrame=this.animation?this.animation.end+1:this.textures.length},pt.getAnimationFrameIndex=function(t){return this.beginFrame+t%(this.endFrame-this.beginFrame)},(gt.prototype=Object.create(Object.prototype)).constructor=gt;var mt=vt.prototype=Object.create(PIXI.Sprite.prototype);function vt(t){PIXI.Sprite.call(this,t)}mt.constructor=vt,mt.clone=function(t){var e=null;if(t=void 0!==t&&t){var i=this.texture.baseTexture,n=this.texture.frame.clone();if(this.texture.crop)var s=this.texture.crop.clone();else var r=this.texture.orig.clone();var o=this.texture.trim.clone();if(s)var a=new PIXI.Texture(i,n,s,o);else a=new PIXI.Texture(i,n,r,o);e=new vt(a)}else e=new vt(this.texture);return e},Object.defineProperty(mt,"stage",{get:function(){if(!this._stage)for(var t=this.parent;null!=t;)(t=t.parent)&&(this._stage=t);return this._stage}}),Object.defineProperty(mt,"renderer",{get:function(){return this.stage.renderer}});var bt=yt.prototype=Object.create(PIXI.Text.prototype);function yt(t,e,i){PIXI.Text.call(this,t,e),this.textStyle=e,this.margin=i,this.positionText()}bt.constructor=yt,yt.CENTER="center",yt.RIGHT="right",yt.LEFT="left",Object.defineProperty(bt,"measuredWidth",{get:function(){var t=this.context;return this._text.split("\n").reduce((function(e,i){var n=t.measureText(i).width;return n>e?n:e}),0)}}),Object.defineProperty(bt,"id",{get:function(){return this._id},set:function(t){this._id=t,this.positionText()}}),Object.defineProperty(bt,"_text",{get:function(){return this.__text},set:function(t){this.__text=t,this.positionText()}}),bt.positionText=function(){if(this.textStyle){var t=this.getBounds();switch(this.textStyle.align){case yt.CENTER:this.alignTextToCenter(t);break;case yt.RIGHT:this.alignTextToRight(t);break;default:this.alignTextToLeft(t)}}},bt.alignTextToCenter=function(t){var e=this.margin.x+.5*(this.margin.width-this.measuredWidth);this.position.x=e},bt.alignTextToRight=function(t){var e=this.margin.x+this.margin.width-this.measuredWidth;this.position.x=e},bt.alignTextToLeft=function(t){this.position.x=this.margin.x};var Et=Ot.prototype=Object.create(dt.prototype);function Ot(t){dt.call(this),this.json=t.json,this.library=this.json.library,this.elements=t.elements,this.id=t.id||this.json.meta.root,this.loop=t.loop||!0,this.timeScale=void 0!==t.timeScale?t.timeScale:1,this.onAnimationEnd=t.onAnimationEnd||null,this.isPlaying=!0,this.currentFrame=null,this.currentLabel=null,this.beginEndObject={}
1,this.objectLibrary=[],this.setFrame(0)}Et.constructor=Ot,Ot.TIMELINE="timeline",Ot.MOVIECLIP="movieclip",Ot.SPRITE="sprite",Ot.TEXTFIELD="textfield",Ot.CACHE_ID_BASETEXTURE="baseTexture",Ot.CACHE_ID_TEXTURE="texture",Ot.matrix=new PIXI.Matrix,Ot.cache=new ct,Object.defineProperty(Et,"totalFrames",{get:function(){return this.template.totalFrames}}),Object.defineProperty(Et,"template",{get:function(){return this._template=void 0!==this._template?this._template:this.getTemplate(this.id),this._template}}),Object.defineProperty(Et,"labels",{get:function(){return this.template.labels}}),Et.getTemplate=function(t){return this.library[t]},Object.defineProperty(Et,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale=t;var e=this;gt(this.layers).forEach((function(t,i){i.elements.forEach((function(t){t.timeScale=e._timeScale}))}))}}),Et.updateTransformContainer=Et.updateTransform,Et.updateTransform=function(){this.template.totalFrames>1&&this.updatePlayback(),this.updateTransformContainer()},Et.parse=function(t){var e=null,i=this.getTemplate(t),n=this.objectLibrary.filter((function(e){return e.id===t&&!e.parent}));if(n.length>0)e=n[0];else{switch(i.type){case Ot.TIMELINE:e=this.getTimeline(t);break;case Ot.MOVIECLIP:e=this.getMovieClip(t,i,this.elements);break;case Ot.SPRITE:e=this.getSprite(t,i,this.elements);break;case Ot.TEXTFIELD:e=this.getTextField(t,i)}this.objectLibrary.push(e)}return e},Et.updatePlayback=function(){var t=this.isPlaying?this.timeScale:0;
1this.setFrame(this.currentIndex+t)},Et.gotoAndStop=function(t){t=this.inputToFrame(t),this.setFrame(t),this.stop()},Et.gotoAndPlay=function(t){t=this.inputToFrame(t),this.setFrame(t),this.play()},Et.play=function(){this.isPlaying=!0},Et.stop=function(){this.isPlaying=!1},Et.clone=function(){return this.getTimeline(this.id)},Et.inputToFrame=function(t){return"number"==typeof t?t:(this.currentLabel=t,this.labelChanged=!0,0)},Object.defineProperty(Et,"layers",{get:function(){return this._layers=void 0!==this._layers?this._layers:{},this._layers}}),Et.setLayer=function(t,e){return this.layers[t]=e,this.layers[t]},Et.getLayer=function(t){return void 0===this.layers[t]&&(this.layers[t]={elements:[],previousIndex:null,nextIndex:null,previousKeyframe:null,nextKeyframe:null}),this.layers[t]},Et.getLayerID=function(t,e){return t+(null!==e?"#"+e:"")},Et.getTimeline=function(t){return new Ot({json:this.json,elements:this.elements,timeScale:this.timeScale,id:t})},Et.setFrame=function(t,e){this.graphicLoop&&!e||(this.currentIndex=t,this.nextFrame=this.getValidIndex(this.template,this.currentIndex),this.frameChanged=null===this.currentFrame||this.labelChanged||this.currentFrame.toFixed(8)!==this.nextFrame.toFixed(8),this.currentFrame=this.nextFrame,this.resolveLayers(this.template.layers),this.triggerLabelCallback(this.template,this.currentFrame),this.labelChanged=!1)},Et.resolveLayers=function(t){t.forEach(function(t,e){var i=this.resolveFrames(t,e),n=this.getLayerID(t.name,e);this.setLayer(n,i)}.bind(this))},Et.resolveFrames=function(t,e){var i=this.getLayerID(t.name,e),n=t.frames,s=this.getPreviousIndex(n,this.currentFrame),r=n[s],o=r.animation,a=this.getNextIndex(n,this.currentFrame),h=o?n[a]:r,u=r.elements,c=this.getLayer(i);c.previousIndex=s,c.nextIndex=a,c.previousKeyframe=r,c.nextKeyframe=h;var l=u.map(function(t){return this.resolveElement(i,t)}.bind(this));return this.removeMissing(i,l),c.elements=l,c},Et.resolveElement=function(t,e){var i=e.id,n=this.getLayer(t),s=this.getDisplayObject(n,i,e.uid);return s&&((this.frameChanged||void 0===this.frameChanged)&&(this.addTransform(e.uid,s,n),this.add(s)),this.sync(s,e,n.previousIndex)),s},Et.getDisplayObject=function(t,e,i){var n=null;return(n=t.elements.find((function(t){return t&&t.uid==i})))||(n=this.parse(e),t.elements.push(n)),n},Et.addTransform=function(t,e,i){var n=this.getPercent(i.previousIndex,i.nextIndex,this.currentFrame),s=this.getTransform(i.previousKeyframe,i.nextKeyframe,t,n);s=this.translateGraphicLoop(s,e),s=this.translateMatrix(s,e),gt(s=this.translateVisible(s)).reduce((function(t,e,i){return void 0!==e&&(i[t]=e),i}),e),e.name=e.name?e.name:e.id},Et.sync=function(t,e,i){var n=[ft,Ot];if(this.getIsInstanceOf(t,n)){var s=null;if(e.graphicLoop&&void 0!==e.firstFrame){if("single frame"==e.graphicLoop)s=e.firstFrame;else if("play once"==e.graphicLoop){var r=this.getTemplate(e.id);s=Math.min(e.firstFrame+this.currentFrame-i,r.totalFrames-1)}else s=e.firstFrame+this.currentFrame;t.isPlaying&&t.setFrame(s,!0)}}},Et.triggerLabelCallback=function(t,e){if(this.frameChanged&&null!==this.onAnimationEnd&&void 0!==this.onAnimationEnd)if(null!==this.currentLabel){var i=this.getBeginEndObject(t,"labels",this.beginEndObject)[this.currentLabel];Number(e.toFixed(2)==i.end-1)&&this.onAnimationEnd()}else Number(e.toFixed(2)==this.totalFrames-1)&&this.onAnimationEnd()},Et.add=function(t){this.addChild(t)},Et.removeMissing=function(t,e){var i=this.getLayer(t).elements;i&&i.forEach(function(t){void 0===e.find((function(e){return e.uid==t.uid}))&&this.removeChild(t)}.bind(this))},Et.getValidIndex=function(t,e){if(null===this.currentLabel||void 0===this.currentLabel){var i=t.totalFrames;return i>1?this.loop?e%i:e>=i-1?i-1:e:0}var n=this.getBeginEndObject(t,"labels")[this.currentLabel],s=n.end-n.begin;return!this.loop&&e>=s?n.end-1:n.begin+e%s},Et.getIsInstanceOf=function(t,e){return e.find((function(e){return t instanceof e}))},Et.getMovieClip=function(t,e,i){var n=this.getAtlasJSONWithID(i,t),s=new ft(this.getTextures(i,n,t),this.getBeginEndObject(e,"labels"),this.getBeginEndObject(e,"comments"));return s.pivot=this.getDisplayObjectPivot(t,n),s.play(),s}
1,Et.getBeginEndObject=function(t,e,i){var n=t[e],s=null;if(n){var r=this,o=t.totalFrames;s=gt(n).reduce((function(t,e,i){i[e]=i[e]||{begin:0,end:0};var s=i[e];return s.begin=r.smallestWith(e,n),s.end=r.biggestValueAfter(e,n,s.begin,o),i}),i||{})}return s},Et.smallestWith=function(t,e){var i=null;return gt(e).forEach((function(e,n){t==n&&(null===i||e<i)&&(i=Number(e))})),i},Et.biggestValueAfter=function(t,e,i,n){var s=n;return gt(e).forEach((function(t,e){var n=Number(t);n<s&&n>i&&(s=n)})),s},Et.getFrames=function(t,e){return gt(t).filter(this.nameIsID(e).bind(this))},Et.getFilteredFrames=function(t,e){var i=this.getFrames(t,e);return i.pop(),i},Et.getTextures=function(t,e,i){var n=this.getFilteredFrames(e.frames,i),s=this.getBaseTexture(t,e.meta.image),r=n.map((function(t,e){var i=JSON.stringify(t),n=Ot.cache.getObject(Ot.CACHE_ID_TEXTURE,i);if(null===n){var r=t.frame,o=t.spriteSourceSize,a=new PIXI.Rectangle(r.x,r.y,r.w,r.h),h=new PIXI.Rectangle(o.x,o.y,r.w,r.h);n=new PIXI.Texture(s,a,void 0,h),Ot.cache.setObject(Ot.CACHE_ID_TEXTURE,n,i)}return n}));return r},Et.getBaseTexture=function(t,e){var i=Ot.cache.getObject(Ot.CACHE_ID_BASETEXTURE,e);if(null===i){var n=t.find((function(t){if(t instanceof Image)return t.src.split("/").slice(-1)[0].split("?")[0]==e}));i=new PIXI.BaseTexture(n),Ot.cache.setObject(Ot.CACHE_ID_BASETEXTURE,e,i)}return i},Et.getAtlasJSONWithID=function(t,e){return t.find(function(t){return!!this.getIsValidAtlas(t)&>(t.frames).every(this.nameIsID(e).bind(this))}.bind(this))},Et.getIsValidAtlas=function(t){return t.frames&&t.meta},Et.nameIsID=function(t){return function(e,i){return this.getFrameIDWithoutIndex(e)==t}},Et.getFrameIDWithoutIndex=function(t){return t.slice(0,-4)},Et.getSprite=function(t,e,i){var n=this.getAtlasJSONWithID(i,t),s=new vt(this.getTextures(i,n,t)[0]);return s.pivot=this.getDisplayObjectPivot(t,n),s},Et.getDisplayObjectPivot=function(t,e){return this.getFrames(e.frames,t).reduce((function(t,e){var i=e.spriteSourceSize;return t.x=i.x>t.x||null===t.x?i.x:t.x,t.y=i.y>t.y||null===t.y?i.y:t.y,t}),{x:null,y:null})},Et.getTextField=function(t,e){var i=new PIXI.TextStyle;return gt(e.style).forEach(function(t,e){i[t]=e}.bind(this)),new yt(e.text,i,e.margin)},Et.getPercent=function(t,e,i){var n=e-t;return 0!==n?(i-t)/n:0},Et.getTransform=function(t,e,i,n){var s=t.animation,r=this.translateAlpha(this.getFrameTransform(t,i)),o=this.translateAlpha(this.getFrameTransform(e,i)),a=this.getBezierPoints(s),h=ht.getY(n,a[0],a[1],a[2],a[3]);return this.getTransformBetweenItems(r,o,h)},Et.getTransformBetweenItems=function(t,e,i){var n=this.floatBetweenAandBAt,s=function(t,e){var r={};return gt(t).reduce((function(t,o){r[t]="number"==typeof o?n(o,e[t],i):"object"==typeof o?s(o,e[t]):o})),r};return s(t,e=void 0!==e?e:t)},Et.floatBetweenAandBAt=function(t,e,i){return t+i*(e-t)},Et.getBezierPoints=function(t){var e=null;return t&&t.length>0?((e=t.concat()).unshift(ht.p00),e.push(ht.p11)):e=ht.linearTransition,e},Et.getFrameTransform=function(t,e){return t.elements.find((function(t){return t.uid==e}))},Et.translateVisible=function(t){return t.visible=void 0===t.visible||t.visible,t},Et.translateGraphicLoop=function(t,e){return e instanceof Ot&&void 0===t.graphicLoop&&(t.graphicLoop=null),t},Et.translateMatrix=function(t,e){var i=Ot.matrix;i.identity();var n=t.matrix;return gt(n).forEach((function(t,e){i[t]=n[t]})),e.transform.setFromMatrix(i),t},Et.translateAlpha=function(t){return t&&(t.alpha=void 0!==t.alpha?t.alpha:1),t},Et.getPreviousIndex=function(t,e){return gt(t).reduce(function(t,i,n){var s=Number(t);return s>=n&&s<=e?s:n}.bind(this),0)},Et.getNextIndex=function(t,e){var i=gt(t).reduce((function(t,e,i){var n=Number(t);return n>i?n:i}),0);return gt(t).reduce(function(t,i,n){var s=Number(t);return s<=n&&s>=e?s:n}.bind(this),i)};const wt={Bezier:ht,Cache:ct,DisplayObjectContainer:dt,MovieClip:ft,Parse:gt,Sprite:vt,TextField:yt,Timeline:Ot};Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,s=arguments[1],r=0;r<n;r++)if(e=i[r],t.call(s,e,r,i))return e}});var Tt=It.prototype=Object.create(rt.prototype);function It(t,e){rt.call(this),J.setupScopeVariables(this,e,{messenger:t.messenger,id:t.state.id,url:t.urlC
1ontent,loader:t.loader,stage:t.stage,speed:1,play:!0,autoPlay:!0,setup:t})}Tt.constructor=It,Tt.enter=function(){var t=n.getURLParameter("cdnURL");t&&this.url&&-1===this.url.indexOf(t)&&(this.url=t+this.url),this.updateCommentElements=this.curryUpdateCommentElements(),this.initVariales(),this.initTimeline()},Tt.exit=function(){this.content&&this.content.stop()},Tt.kill=function(){this.initTimeline(!1)},Tt.update=function(){this.updateCommentElements()},Tt.initVariales=function(){this.commentEvent=new r(r.COMMENT)},Tt.initTimeline=function(t){if(t=void 0===t||t){var e=this.loader.getObjectWithID(this.url).result,n=this.loader.results,s=e.meta.frameRate/i.getInstance().fps;this.graphics=new wt.Timeline({json:e,elements:n,id:this.id,timeScale:s*this.speed}),this.graphics.loop=!1,this.graphics.stop(),this.content=this.graphics.getChildByName("content"),this.content&&(!1===this.autoPlay&&this.content.stop(),this.content&&(this.content.loop=!1),!1===this.play&&this.content.gotoAndPlay(this.content.totalFrames-1),this.content.onAnimationEnd=function(){this.messenger.send(new r(r.ANIMATION_END))}.bind(this)),this.setup.graphics=this.graphics,this.stage.addChild(this.graphics)}else this.stage.removeChild(this.graphics)},Tt.curryUpdateCommentElements=function(){var t={};return function(){var e=this,i=function(n){if(n.template){var s=n.template.comments;if(s){var r=s[Math.floor(n.currentFrame)],o=r+Math.floor(n.currentIndex);r&&o!=t[n.uid]&&(e.commentEvent.object=r,t[n.uid]=o,e.messenger.send(e.commentEvent))}}var a=n.children;a&&a.forEach((function(t){i(t),t.children&&t.children.forEach((function(t){i(t)}))}))};i(this.graphics)}};var St=Pt.prototype=Object.create(Object.prototype);function Pt(t){Object.call(this),this.NONE="none",this.TOP="top",this.BOTTOM="bottom",this.LEFT="left",this.RIGHT="right",this.CENTER="center",this.FULLSCREEN="fullscreen",this.bounds=t.bounds||null,this.graphics=t.graphics||null,this.canvas=t.canvas||null,this.centerRange=t.centerRange||50,this.voList=[],this.init()}St.constructor=Pt,St.init=function(){this.initChildValueObjects(),this.initChildPositions()},St.update=function(){this.initChildPositions()},St.getChildPosition=function(t){var e=this.NONE,i=t.width?t.width:t.getBounds().width,n=t.height?t.height:t.getBounds().height;return 0==t.x&&0==t.y&&i==this.bounds.width&&n==this.bounds.height&&(e=this.FULLSCREEN),e},St.getChildPositionX=function(t){this.LEFT;var e=t.width?t.width:t.getBounds().width;return Math.abs(.5*this.bounds.width-t.x-.5*e)<this.centerRange||e>this.bounds.width?this.CENTER:t.x>this.bounds.width-t.x?this.RIGHT:this.LEFT},St.getChildPositionY=function(t){this.TOP;var e=t.height?t.height:t.getBounds().height;return Math.abs(.5*this.bounds.height-t.y-.5*e)<this.centerRange||e>this.bounds.height?this.CENTER:t.y>this.bounds.height-t.y?this.BOTTOM:this.TOP},St.initChildValueObjects=function(){if(this.graphics)for(var t=0;t<this.graphics.children.length;++t){var e=this.graphics.children[t],i=null!=e.width?{width:e.width,height:e.height}:e.getBounds();if(i){var n={child:e,childWidth:i.width,childHeight:i.height,position:this.getChildPosition(e),positionX:this.getChildPositionX(e),positionY:this.getChildPositionY(e),distanceX:this.bounds.width-e.x,distanceY:this.bounds.height-e.y};this.voList.push(n)}}},St.initChildPositions=function(){for(var t=0;t<this.voList.length;++t){var e=this.voList[t],i=e.child,n=e.childWidth,s=e.childHeight,r=e.positionX,o=e.positionY,a=e.distanceX,h=e.distanceY;r==this.CENTER?i.x=-Math.floor(.5*(n-this.canvas.width)):r==this.RIGHT&&(i.x=this.canvas.width-a),o==this.CENTER&&(i.y=-Math.floor(.5*(s-this.canvas.height))),o==this.BOTTOM&&(i.y=this.canvas.height-h)}};var At=Ct.prototype=Object.create(rt.prototype);function Ct(t,e){rt.call(this),this.windowResizeCallback=this.windowResizeHandler.bind(this),this.setup=t,this.centerRange=void 0!==e?e:null}function xt(){}At.constructor=Ct,At.enter=function(){this.initVariables(),this.initFluidContainer(),this.initWindowEventHandler()},At.exit=function(){this.initWindowEventHandler(!1)},At.initVariables=function(){this.graphics=this.setup.graphics,this.canvas=this.setup.canvas,this.messenger=this.setup.messenger,this.gameSetup=i.getInstance(),this.bounds=this.gameSetup.getCanvasBounds(),this.extendCanvas=this.gameSetup.extendCanvas,this.event=new r(r.CANVAS_RESIZE)},At.initFluidContainer=function(){this.fluidContainer=new Pt({graphics:this.graphics,canvas:this.canvas,bounds:this.bounds,centerRange:this.centerRange}),this.graphics.updateTransform()},At.initWindowEventHandler=function(t){(t=void 0===t||t)?window.addEventListener("resize",this.windowResizeCallback,!1):window.removeEventListener("resize",this.windowResizeCallback,!1)}
1,At.windowResizeHandler=function(t){this.fluidContainer.update(),this.messenger.send(this.event)},(xt.prototype=Object.create(Object.prototype)).constructor=xt,xt.PREFIX_BUTTON="button",Object.defineProperty(xt,"mouseDown",{get:function(){return n.isMobile.any()?r.TOUCH_START:r.MOUSE_DOWN}}),Object.defineProperty(xt,"mouseUp",{get:function(){return n.isMobile.any()?r.TOUCH_END:r.MOUSE_UP}}),Object.defineProperty(xt,"mouseOut",{get:function(){return n.isMobile.any()?r.TOUCH_END_OUTSIDE:r.MOUSE_UP_OUTSIDE}}),Object.defineProperty(xt,"mouseMove",{get:function(){return n.isMobile.any()?r.TOUCH_MOVE:r.MOUSE_MOVE}}),Object.defineProperty(xt,"mouseOver",{get:function(){return r.MOUSE_OVER}}),xt.setup=function(t,e,i,n,s){xt.setupCallback("splitCallbackGraphics",t,e,i,n,s)},xt.create=function(t,e,i,n,s,r,o){xt.setupCallback("splitCallbackInteraction",t,e,i,n,s,r,o)},xt.setupCallback=function(t,e,i,n,s,r,o,a){s=void 0===s||s,e.interactive=!0,e.buttonMode=!0,xt[t](e,xt.mouseDown,i,s?xt.graphicsMouseDownHandler.bind(this):null),xt[t](e,xt.mouseUp,n,s?xt.graphicsMouseUpHandler.bind(this):null),xt[t](e,xt.mouseOut,r,s?xt.graphicsMouseUpHandler.bind(this):null),xt[t](e,xt.mouseMove,o,null),xt[t](e,xt.mouseOver,a,null)},xt.splitCallbackGraphics=function(t,e,i,n){t[e]=function(){i&&i(t),n&&n(t)}.bind(this)},xt.splitCallbackInteraction=function(t,e,i,n){t[e]=function(t){i&&i(t),n&&n(t)}.bind(this)},xt.graphicsMouseDownHandler=function(t){var e=t.currentTarget?t.currentTarget:t.target;e&&e.gotoAndStop&&e.gotoAndStop(1)},xt.graphicsMouseUpHandler=function(t){var e=t.currentTarget?t.currentTarget:t.target;e&&e.gotoAndStop&&e.gotoAndStop(0)},xt.disable=function(t){var e=[];t.interactive&&t.buttonMode&&(t.interactive=!1,t.buttonMode=!1,e.push(t));var i=t.children;if(i)for(var n=0;n<i.length;++n){var s=i[n];e=e.concat(xt.disable(s))}return e},xt.enable=function(t){if(t){t=void 0===t.length?[t]:t;for(var e=0;e<t.length;++e){var i=t[e];i.interactive=!0,i.buttonMode=!0}}},xt.setupToggle=function(t,e){xt.create(t,null,(function(t){xt.toggleMouseUpHandler(t),e(t)}),null,!1)},xt.toggleMouseUpHandler=function(t){var e=t.target;e.gotoAndStop(0===e.currentFrame?1:0)};var Mt,Lt=Rt.prototype=Object.create(rt.prototype);function Rt(t,e,i,n,s){rt.call(this),this.setup=t,e&&"object"==typeof e?Assist.setupScopeVariables(this,e,{prefix:"button",setupButton:!0,event:r.CLICK,killOnExit:!0,cursor:!0,forceButtonTarget:!0,audioObjectUp:null}):(this.prefix=e||"button",this.setupButton=void 0===i||i,this.event=n||r.CLICK,this.killOnExit=void 0===s||s,this.forceButtonTarget=!0)}function _t(t){rt.call(this),this.setup=t}function jt(t,e){r.call(this,t,e)}Lt.constructor=Rt,Lt.enter=function(){this.initVariables(),this.initButtons()},Lt.kill=function(){this.killOnExit&&this.initButtons(!1)},Lt.initVariables=function(){this.messenger=this.setup.messenger,this.graphics=this.setup.graphics,this.buttonList=this.graphics.getChildrenByName(this.prefix),this.gameSetup=i.getInstance()},Lt.initButtons=function(t){t=void 0===t||t;for(var e=0;e<this.buttonList.length;++e){var i=this.buttonList[e];this.setupButton&&i.gotoAndStop&&i.gotoAndStop(0),t?this.setupButton?xt.create(i,this.buttonMouseDownHandler.bind(this),this.buttonMouseUpHandler.bind(this),void 0,this.buttonMouseOutHandler.bind(this),this.buttonMoverOverHandler.bind(this)):xt.create(i,this.buttonMouseDownHandler.bind(this),this.buttonMouseUpHandler.bind(this),!1,this.buttonMouseOutHandler.bind(this),this.buttonMoverOverHandler.bind(this)):i.interactive=!1,!1===this.cursor&&(i.buttonMode=!1)}},Lt.buttonMouseDownHandler=function(t){this.send(r.MOUSE_DOWN,t)},Lt.buttonMouseUpHandler=function(t){this.send(r.MOUSE_UP,t),this.send(this.event,t),this.audioObjectUp&&AudioEvent&&this.messenger.send(new AudioEvent(AudioEvent.PLAY,this.audioObjectUp))},Lt.buttonMouseOutHandler=function(t){this.send(r.MOUSE_OUT,t)},Lt.buttonMoverOverHandler=function(t){},Lt.send=function(t,e){var i=new r(t);i.interactionData=e;var n=e.currentTarget||e.target,s=this.forceButtonTarget?this.getButtonTarget(n):n;this.messenger.send(i,s)},Lt.getButtonTarget=function(t){var e=t;if(e&&e.name)for(;e.name.split(this.prefix).length<2;)e=t.parent;return e},(Mt=_t.prototype=Object.create(rt.prototype)).constructor=_t,Mt.enter=function(){this.initVariables(),this.initMessengerEventHandler()},Mt.kill=function(){this.initMessengerEventHandler(!1)},Mt.play=function(t){var e=null;try{e="string"==typeof t?this.jukebox.play({id:t}):this.jukebox.play(t),this.messenger.send(new jt(jt.PLAYING,e))}catch(e){console&&console.log("Could not find sound with id:",t.id?t.id:t)}return e},Mt.pause=function(t){return"string"==typeof t?this.jukebox.pause({id:t}):this.jukebox.pause(t)},Mt.getSound=function(t){return this.jukebox.getSoundWithPropertyAndValue("id",t)},Mt.volume=function(t){var e=void 0!==t?t:1;this.jukebox.globalVolume=e},Mt.initVariables=function(){this.messenger=this.setup.messenger,this.jukebox=p.getInstance()},Mt.initMessengerEventHandler=function(t){(t=void 0===t||t)?(this.messenger.on(jt.PLAY,this.messengerAudioPlayHandler,this),this.messenger.on(jt.PAUSE,this.messengerAudioPauseHandler,this),this.messenger.on(jt.VOLUME,this.messengerAudioVolumeHandler,this)):(this.messenger.off(jt.PAUSE,this.messengerAudioPauseHandler,this),this.messenger.off(jt.PLAY,this.messengerAudioPlayHandler,this),this.messenger.off(jt.VOLUME,this.messengerAudioVolumeHandler,this))},Mt.messengerAudioPlayHandler=function(t){this.play(t.object)},Mt.messengerAudioPauseHandler=function(t){this.pause(t.object)},Mt.messengerAudioVolumeHandler=function(t){this.volume(t.object)},(Mt=jt.prototype=Object.create(r.prototype)).constructor=jt,jt.PLAY=r.AUDIO_PLAY,jt.PAUSE=r.AUDIO_PAUSE,jt.PLAYING="playing",jt.VOLUME="volume";var Dt=Ft.prototype=Object.create(rt.prototype);function Ft(t,e){rt.call(this),this.setup=t,"object"==typeof e?Assist.setupScopeVariables(this,e,{name:Ft.TOGGLE_NAME,audioObjectUp:null}):this.name=e||Ft.TOGGLE_NAME}Dt.constructor=Ft,Ft.TOGGLE_NAME="toggleAudio",Object.defineProperty(Dt,"baseVolume",{get:function(){return Ft.BASE_VOLUME},set:function(t){var e=Ft.BASE_VOLUME;Ft.BASE_VOLUME=void 0===e?t:e}}),Dt.enter=function(){this.initVariables(),this.initAudioToggle()},Dt.initVariables=function(){this.proxy=this.setup.proxy,this.graphics=this.setup.graphics,this.messenger=this.setup.messenger,this.baseVolume=p.getInstance().globalVolume||1,this.toggleAudio=this.graphics.getChildByName(this.name)}
1,Dt.initAudioToggle=function(){if(this.toggleAudio){var t=0===p.getInstance().globalVolume;this.toggleAudio.gotoAndStop(t?0:1),xt.setupToggle(this.toggleAudio,this.toggleMouseUpHandler.bind(this))}},Dt.toggleMouseUpHandler=function(t){var e=0===t.target.currentFrame?0:this.baseVolume;this.messenger.send(new jt(jt.VOLUME,e)),this.audioObjectUp&&jt&&this.messenger.send(new jt(jt.PLAY,this.audioObjectUp))};var kt=Ht.prototype=Object.create(a.prototype);function Ht(t,e,i,n){a.call(this),this.seconds=t,this.repeat=void 0===e?0:e,this.callbackFunction=i,this.args=n,this.initVariables()}kt.constructor=Ht,Object.defineProperty(kt,"currentStep",{get:function(){return this.currentRepeat}}),Object.defineProperty(kt,"currentTime",{get:function(){return this.getCurrentTime()}}),Object.defineProperty(kt,"hasStarted",{get:function(){return this.getHasStarted()}}),kt.getCurrentTime=function(){return(this.seconds?this.currentTicks:-1*this.currentTicks)/this.framesPerSecond},kt.getHasStarted=function(){return this.currentTicks},kt.start=function(){this.reset()},kt.stop=function(){this.hasBeenCompleted=!0},kt.reset=function(t){this.hasBeenCompleted=!1,this.currentTicks=Math.floor((isNaN(this.seconds)?0:this.seconds)*this.framesPerSecond),null==t&&(this.totalSteps=0,this.currentRepeat=null==this.repeat?null:this.repeat>0?this.repeat-1:0)},kt.update=function(){this.hasBeenCompleted||(this.currentTicks=this.currentTicks-1,this.send(new r(r.CHANGE)),isNaN(this.seconds)||this.currentTicks<=0&&(this.endCallbackHandler(),this.send(new r(r.STEP)),this.currentRepeat>0||null==this.currentRepeat?(null!=this.currentRepeat&&this.currentRepeat--,this.reset(!0)):this.send(new r(r.COMPLETE))))},kt.initVariables=function(){this.hasBeenCompleted=!0,this.framesPerSecond=i.getInstance().getFPS(),this.currentRepeat=0,this.currentTicks=0,this.totalSteps=0},kt.endCallbackHandler=function(){this.hasBeenCompleted=!0,this.totalSteps++,null!=this.callbackFunction&&this.callbackFunction.apply(this,this.args)};var Nt=Vt.prototype=Object.create(rt.prototype);function Vt(t,e,i,n,s,r,o){rt.call(this),this.setup=t,e&&"object"==typeof e?J.setupScopeVariables(this,e,{updateID:void 0,eventIn:null,eventOut:null,eventObject:null,targetName:null,cloneObject:null,senderIsState:null,timeout:null,callback:null}):(this.eventIn=e,this.eventOut=i,this.eventObject=n,this.targetName=s,this.cloneObject=r,this.timeout=null,this.senderIsState=o)}Nt.constructor=Vt,Nt.getTargetIsValid=function(t){return null===this.targetName||void 0===this.targetName||t.name==this.targetName},Nt.enter=function(){this.initVariables(),this.initTimeoutFrameTimer(),this.initMessengerEventHandler()},Nt.exit=function(){this.initMessengerEventHandler(!1)}
1,Nt.update=function(){this.timeoutFrameTimer.update()},Nt.initVariables=function(){this.messenger=this.setup.messenger,this.state=this.setup.state,this.stateMachine=this.setup.state.stateMachine,this.sender=this.senderIsState?this.state:this.messenger},Nt.initTimeoutFrameTimer=function(){this.timeoutFrameTimer=new Ht(this.timeout,0,function(t){this.sendEventOut(this.timeoutCopyEvent)}.bind(this))},Nt.initMessengerEventHandler=function(t){(t=void 0===t||t)?null===this.eventIn?this.messengerEventInHandler(new r):this.messenger.on(this.eventIn,this.messengerEventInHandler,this):this.messenger.off(this.eventIn,this.messengerEventInHandler,this)},Nt.messengerEventInHandler=function(t){this.timeoutCopyEvent=t,null===this.timeout||0===this.timeout?this.sendEventOut(t):this.timeoutFrameTimer.start()},Nt.sendEventOut=function(t){if(this.eventOut){var e=this.getTargetIsValid(t.currentTarget),i=new r;i.type=this.eventOut,this.cloneObject?(i.object=t.object,i.target=t.target):i.object=this.eventObject,e&&this.sender.send(i,this.cloneObject?t.currentTarget:null)}this.callback&&this.callback(t)};var Ut,Bt,qt=Gt.prototype=Object.create(rt.prototype);function Gt(t,e,i,n,s,r){rt.call(this),this.animations={mouseUp:function(t,e){return[(new z).to(t.scale,.5*e,{x:void 0!==t.startScale?t.startScale.x:1,ease:x.easeOut}),(new z).to(t.scale,.5*e,{delay:.02,y:void 0!==t.startScale?t.startScale.y:1,ease:x.easeOut})]},mouseDown:function(t,e){return[(new z).to(t.scale,.5*e,{delay:.02,x:(void 0!==t.startScale?t.startScale.x:1)+.2,ease:x.easeOut}),(new z).to(t.scale,.5*e,{y:(void 0!==t.startScale?t.startScale.y:1)+.2,ease:x.easeOut})]}},this.setup=t,this.duration=.3,this.mouseDown=e||this.animations.mouseDown,this.mouseUp=i||this.animations.mouseUp,this.name=n||"button",this.excludes=s,this.overwrite=null!=r&&r}function zt(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t,name:null,label:null,loop:void 0,random:!1})}function Wt(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t,name:null,label:null})}function Xt(){}function Yt(t,e){it.call(this,t),J.setupScopeVariables(this,e,{progress:0,names:{bar:"bar"}})}function Jt(t,e){rt.call(this),this.setup=t}qt.constructor=Gt,qt.getNameIsValid=function(t){if(t){var e=t.name;if(e)var i=e.split(this.name).length>1,n=!this.excludes||!Assist.getListContainsValue(this.excludes,e);return i&&n}return!1},qt.enter=function(){this.initVariables(),this.initMessengerEventHandler()},qt.kill=function(){this.initMessengerEventHandler(!1)},qt.update=function(){this.doTween.update()},qt.initVariables=function(){this.doTween=new z(this.overwrite),this.proxy=this.setup.proxy,this.animation=this.proxy.animation,this.messenger=this.setup.messenger},qt.initMessengerEventHandler=function(t){(t=void 0===t||t)?(this.messenger.on(r.MOUSE_DOWN,this.messengerMouseDownHandler,this),this.messenger.on(r.MOUSE_UP,this.messengerMouseUpHandler,this),this.messenger.on(r.MOUSE_OUT,this.messengerMouseOutHandler,this)):(this.messenger.off(r.MOUSE_DOWN,this.messengerMouseDownHandler,this),this.messenger.off(r.MOUSE_UP,this.messengerMouseUpHandler,this),this.messenger.off(r.MOUSE_OUT,this.messengerMouseOutHandler,this))},qt.messengerMouseDownHandler=function(t){this.doTween.kill(!1);var e=t.currentTarget;e.startScale||(e.startScale={x:e.scale.x,y:e.scale.y}),this.getNameIsValid(e)&&this.doTween.add(this.mouseDown(e,this.duration))},qt.messengerMouseUpHandler=function(t){this.doTween.kill(!1);var e=t.currentTarget;this.getNameIsValid(e)&&this.doTween.add(this.mouseUp(e,this.duration))},qt.messengerMouseOutHandler=function(t){this.messengerMouseUpHandler(t)},(Ut=zt.prototype=Object.create(rt.prototype)).constructor=zt,Ut.enter=function(){this.initVariables()},Ut.initVariables=function(){if(this.graphics=this.setup.graphics,this.displayObject=null==this.name?this.graphics:this.graphics.getChildByName(this.name),this.displayObject){if(this.displayObject.labels){var t=wt.Parse(this.displayObject.labels).find(function(t,e){return e==this.label}.bind(this));void 0!==this.loop&&(this.displayObject.loop=this.loop),this.label&&t&&this.displayObject.gotoAndPlay(this.label)}"number"==typeof this.label&&this.displayObject.gotoAndPlay(this.label),this.random&&this.displayObject.gotoAndStop(Math.floor(Math.random()*this.displayObject.totalFrames))}},(Ut=Wt.prototype=Object.create(rt.prototype)).constructor=Wt,Ut.enter
1=function(){this.initVariables()},Ut.exit=function(){},Ut.kill=function(){},Ut.update=function(){},Ut.initVariables=function(){this.graphics=this.setup.graphics,this.displayObject=this.graphics.getChildByName(this.name),this.displayObject.gotoAndStop(this.label)},(Xt.prototype=Object.create(Object.prototype)).constructor=Xt,Xt.Defaults=function(t){return function(){return[new It(this.shared,t),new Ct(this.shared),new Rt(this.shared),new _t(this.shared),new Ft(this.shared),new Vt(this.shared,{eventIn:r.COMMENT,callback:function(t){var e=t.object.split(":"),i=e[1];"audio"==e[0]&&this.shared.messenger.send(new r(jt.PLAY,{id:i,single:!0}))}.bind(this)}),new Vt(this.shared,{eventIn:r.CLICK,callback:function(t){t.currentTarget.name.split("button"),this.shared.messenger.send(new jt(jt.PLAY,{id:"select",pitch:1+.5*Math.random()}))}.bind(this)}),new Gt(this.shared),new Vt(this.shared,{eventIn:r.EXIT,callback:function(t){Xt.playOut(this,this.shared.graphics,t.object)}.bind(this)}),new zt(this.shared,{name:"content",label:"in"})]}},Xt.playOut=function(t,e,i){var n=e.getChildByName("content");n&&n.labels?("out"!=n.currentLabel&&n.gotoAndPlay("out"),t.shared.messenger.send(new r(r.HIDE)),n.onAnimationEnd=function(){"out"==this.currentLabel&&(this.onAnimationEnd=null,setTimeout((function(){t.send(new r(r.EXIT,i))}),100))}):t.send(new r(r.EXIT,i))},Xt.ButtonAssist=function(){var t=new Gt(this.shared,AnimationTemplate.mouseDown,AnimationTemplate.mouseUp,this.names.shield);return t.updateID=this.names.search,t},(Bt=Yt.prototype=Object.create(it.prototype)).constructor=Yt,Bt.getProgress=function(){return J.followProperty(this,"progress",this.setup.loader.progress),this.progress},Bt.init=function(){this.list=[Xt.Defaults({loader:this.setup.loaderPreload,url:tt.URL_JSON_PRELOADER}).bind(this),new ot(this.shared,this.names.bar,this.getProgress.bind(this),{x:0,y:1,scale:"x"}),new Jt(this.shared)]},(Bt=Jt.prototype=Object.create(rt.prototype)).constructor=Jt,Bt.enter=function(){var t=this.setup.messenger;this.setup.loader.on(r.COMPLETE,(function(e){setTimeout((function(){t.send(new r(r.EXIT))}),100)}))};var Kt=Qt.prototype=Object.create(rt.prototype);function Qt(t,e,i,n,s){rt.call(this),this.setup=t,this.eventID=e||r.CLICK,this.sendName=i||!1,this.ignoreList=n||[],this.autoDispatch=void 0!==s&&s}Kt.constructor=Qt,Kt.enter=function(){this.initVariables(),this.initMessengerEventHandler(),this.initAutoEventDispatch()},Kt.kill=function(){this.initMessengerEventHandler(!1)},Kt.initVariables=function(){this.messenger=this.setup.messenger},Kt.initMessengerEventHandler=function(t){(t=void 0===t||t)?this.messenger.on(this.eventID,this.messengerEventIDHandler,this):this.messenger.off(this.eventID,this.messengerEventIDHandler,this)},Kt.messengerEventIDHandler=function(t){if(t.currentTarget){var e=t.currentTarget.name;if(!J.getListContainsValueStrict(this.ignoreList,e)){var i=this.sendName?t.currentTarget.name:t.currentTarget;this.sendExitEvent(i)}}else this.sendExitEvent(t.currentTarget)},Kt.sendExitEvent=function(t){setTimeout(function(){this.send(new r(r.EXIT,t))}.bind(this),1)},Kt.initAutoEventDispatch=function(){this.autoDispatch&&this.sendExitEvent()};var Zt=$t.prototype=Object.create(rt.prototype);function $t(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t})}Zt.constructor=$t,Zt.enter=function(){this.initVariables(),this.initEvents(!0)},Zt.exit=function(){this.initEvents(!1)},Zt.kill=function(){},Zt.update=function(){this.updateDoTween()},Zt.initVariables=function(){const t=this.setup.messenger,e=this.setup.proxy,i=new z;this.updateDoTween=t=>i.update(),this.commentHandler=this.curryCommentHandler(e,i),this.initEvents=this.curryInitEvents(t)},Zt.curryInitEvents=function(t){return(e=!0)=>{e?t.on(r.COMMENT,this.commentHandler,this):t.off(r.COMMENT,this.commentHandler,this)}},Zt.curryCommentHandler=function(t,e){return i=>{const n=i.object.split(":"),s=n[1];"audio"===n[0]&&"intro"===s&&e.to(t.music,1.2,{volume:0}).on(r.COMPLETE,(e=>{t.music.pause()}),this)}};var te=ee.prototype=Object.create(it.prototype);function ee(t,e){it.call(this,t),J.setupScopeVariables(this,e,{})}te.constructor=ee,te.init=function(){this.list=[Xt.Defaults().bind(this),new $t(this.shared),new Qt(this.shared)]};class ie{constructor(t,e,i){this.name=t,this.animation=e,this.button=i,this.animation.visible=!1,this.button.interactive=!1}start(){this.button.interactive=!0}showAnimation(){this.button.interactive=!1,this.animation.loop=!1,this.animation.visible=!0,this.animation.gotoAndPlay("go")}hideAnimation(){this.animation.visible=!1}}var ne=se.prototype=Object.create(rt.prototype);function se(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t})}ne.constructor=se,ne.enter=function(){this.initVariables(),this.initEvents(!0)},ne.exit=function(){this.initEvents(!1)},ne.kill=function(){},ne.update=function(){},ne.initVariables=function(){const t=this.setup.graphics,e=this.setup.messenger,i=p.getInstance();this.currentIndex=0;const n=[this.createExplainerItemByName(t,"Name"),this.createExplainerItemByName(t,"Headline"),this.createExplainerItemByName(t,"Author"),this.createExplainerItemByName(t,"Text"),this.createExplainerItemByName(t,"Image")];this.clickHandler=this.curryClickHandler(i),this.getExplainerItemByName=this.curryGetExplainerItemByName(n),this.startExplainerItem=this.curryStartExplainerItem(n,i),this.initEvents=this.curryInitEvents(e),setTimeout((t=>
1{this.startExplainerItem()}),800)},ne.createExplainerItemByName=function(t,e){const i=t.getChildByName("animation"+e),n=t.getChildByName("button"+e);return new ie(e,i,n)},ne.curryGetExplainerItemByName=function(t){return e=>{for(let i=0;i<t.length;i++){const n=t[i];if(n.name===e)return n}}},ne.curryStartExplainerItem=function(t,e){return i=>{const n=t[this.currentIndex];n?e.play({id:"game0"+n.name+"Stop"}).on(r.COMPLETE,(t=>{e.play({id:"game0"+n.name+"Start"}).on(r.COMPLETE,(t=>{n.start()}),this)}),this):this.dispatch(new r(r.EXIT))}},ne.curryInitEvents=function(t){return this.dispatch=e=>t.send(e),e=>{e?t.on(r.CLICK,this.clickHandler,this):t.off(r.CLICK,this.clickHandler,this)}},ne.curryClickHandler=function(t){return e=>{const i=e.currentTarget.name.split("button")[1],n=this.getExplainerItemByName(i);n.showAnimation(),t.play({id:"positive"}).on(r.COMPLETE,(t=>{this.currentIndex++,setTimeout((t=>{n.hideAnimation(),this.startExplainerItem()}),2e3)}),this)}};var re=oe.prototype=Object.create(it.prototype);function oe(t,e){it.call(this,t),J.setupScopeVariables(this,e,{})}re.constructor=oe,re.init=function(){this.list=[Xt.Defaults().bind(this),new se(this.shared)]};class ae extends a{constructor(t,e){super(),this.choiceImages=t,this.choiceImages.startX=this.choiceImages.x,this.choiceImages.gotoAndStop(0),this.doTween=e,this.usedIds=[],this.rangeFake={min:0,max:Object.keys(this.choiceImages.labels)[1]-1},console.log(this.rangeFake),this._resetCard(),setTimeout(this.showRandomCard.bind(this),1e3)}get isFake(){return this.choiceImages.currentFrame<=this.rangeFake.max}_swipeRight(){return this.doTween.to(this.choiceImages,.4,{x:this.choiceImages.startX+1e3,rotation:.5})}_swipeLeft(){return this.doTween.to(this.choiceImages,.4,{x:this.choiceImages.startX-1e3,rotation:-.5})}_resetCard(){this.choiceImages.x=this.choiceImages.startX-1e3,this.choiceImages.rotation=-.5}_getRandomUnusedId(t=0){const e=Math.floor(Math.random()*this.choiceImages.totalFrames);return-1!==this.usedIds.indexOf(e)&&t<500?this._getRandomUnusedId(t+1):(this.usedIds.push(e),e)}choiceTrue(){return{isCorrect:!this.isFake,callback:this._swipeLeft.bind(this)}}choiceFake(){return{isCorrect:this.isFake,callback:this._swipeRight.bind(this)}}showRandomCard(t){if("number"!=typeof t&&(t=.4),this.usedIds.length===this.choiceImages.totalFrames)this.send(new r(r.COMPLETE));else{this._resetCard();const e=this._getRandomUnusedId();this.choiceImages.gotoAndStop(e),this.tweenCardIn(t)}}reshowCard(){this._resetCard(),this.tweenCardIn(.4)}tweenCardIn(t){this.choiceImages.visible=!0,this.doTween.to(this.choiceImages,t,{x:this.choiceImages.startX,rotation:0,ease:x.easeOut})}}var he=ue.prototype=Object.create(rt.prototype);function ue(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t})}he.constructor=ue,he.enter=function(){this.initVariables(),this.initEvents(!0)},he.exit=function(){this.initEvents(!1)},he.kill=function(){},he.update=function(){this.updateDoTween()},he.initVariables=function(){const t=this.setup.graphics,e=this.setup.messenger,i=p.getInstance();this.playAudio=this.curryPlayAudio(i);const n=new z;this.updateDoTween=t=>n.update();const s=t.getChildByName("buttonTrue");s.interactive=!1;const o=t.getChildByName("buttonFake");o.interactive=!1,this.hideButtonTrue=this.curryHideButton(s,n),this.hideButtonFake=this.curryHideButton(o,n),this.showButtonTrue=this.curryShowButton(s,n),this.showButtonFake=this.curryShowButton(o,n);const a=t.getChildByName("choiceImages"),h=new ae(a,n);h.on(r.COMPLETE,this.choiceCardCompleteHandler,this),setTimeout((t=>{this.playAudio({id:"game1Start"}).on(r.COMPLETE,(t=>{s.interactive=!0,o.interactive=!0}))}),1400),this.clickHandler=this.curryClickHandler(i,h),this.initEvents=this.curryInitEvents(e)},he.curryInitEvents=function(t){return this.dispatch=e=>t.send(e),e=>{e?t.on(r.CLICK,this.clickHandler,this):t.off(r.CLICK,this.clickHandler,this)}},he.curryPlayAudio=function(t){return e=>t.play(e)},he.curryClickHandler=function(t,e){return t=>{const i=t.currentTarget;let n,s,o,a,h;this.hideButtonFake(),this.hideButtonTrue(),"buttonFake"===i.name?(a=this.playAudio({id:"game1ButtonFake"}),h=e.choiceFake(),s=h.isCorrect):(a=this.playAudio({id:"game1ButtonTrue"}),h=e.choiceTrue(),o=h.isCorrect),n=s||o,a.on(r.COMPLETE,(t=>{let i;if(n)if(o)i=this.playAudio({id:"game1CorrectTrue"}),this.playAudio({id:"positiveSFX"}),this.addResultAudioEventHandler(i,e,n,h.callback);else{const t=e.choiceImages.currentFrame+1,s=this.playAudio({id:"game1CorrectFakeStart"});this.playAudio({id:"positiveSFX"}),s.on(r.COMPLETE,(s=>{i=this.playAudio({id:"game1CorrectFake"+t}),this.addResultAudioEventHandler(i,e,n,h.callback)}),this)}else i=this.playAudio({id:"game1False"}),this.playAudio({id:"negativeSFX"}),this.addResultAudioEventHandler(i,e,n,h.callback)}),this)}}
1,he.addResultAudioEventHandler=function(t,e,i,n){t.on(r.COMPLETE,(t=>{setTimeout((t=>{i?n().on(r.COMPLETE,(t=>{i?e.showRandomCard():e.reshowCard(),this.showButtonFake(),this.showButtonTrue()}),this):(this.showButtonFake(),this.showButtonTrue())}),1200)}),this)},he.curryHideButton=function(t,e){return i=>{t.interactive=!1,e.to(t,.4,{alpha:0}).on(r.COMPLETE,(e=>{t.visible=!1}))}},he.curryShowButton=function(t,e){return i=>{t.interactive=!0,t.visible=!0,e.to(t,.4,{alpha:1})}},he.choiceCardCompleteHandler=function(t){this.hideButtonTrue(),this.hideButtonFake(),setTimeout((t=>{this.dispatch(new r(r.EXIT))}),1e3)};var ce=le.prototype=Object.create(it.prototype);function le(t,e){it.call(this,t),J.setupScopeVariables(this,e,{})}ce.constructor=le,ce.init=function(){this.list=[Xt.Defaults().bind(this),new ue(this.shared)]};class de extends a{constructor(t,e,i,n,s,r,o){super(),this.container=t,this.doTween=e,this.questionVO=n,this.answerStrings=o,this.container.visible=!1,this.container.getChildByName("numberQuestion").text=String(i);const a=this.container.getChildByName("background"),h=this.container.getChildByName("textQuestion");h.text=r,h.style.fontSize=s,h.x=-Math.floor(.5*(h.width-a.width))+a.x,this.answerContainers=this.container.getChildrenByName("answer"),this.containerQuestion=this.container.getChildByName("containerQuestion"),this.active=!1,this.setAnswers(o)}get active(){return this._active}set active(t){this._active=t}show(){this.container.visible=!0,this.doTween.from(this.containerQuestion,.4,{x:this.containerQuestion.x-1e3,ease:x.easeOut});for(let t=0;t<this.answerContainers.length;t++){const e=this.answerContainers[t];this.doTween.from(e,.4,{x:e.x-1e3,ease:x.easeOut,delay:.2*(1+t)}),setTimeout((t=>{this.send(new r(r.AUDIO_PLAY,"whoosh"))}),200*(1+t))}}hide(){this.doTween.to(this.containerQuestion,.4,{x:this.containerQuestion.x+1e3,ease:x.easeIn});for(let t=0;t<this.answerContainers.length;t++){const e=this.answerContainers[t];this.doTween.to(e,.4,{x:e.x+1e3,ease:x.easeIn,delay:.2*t}),setTimeout((t=>{this.send(new r(r.AUDIO_PLAY,"whoosh"))}),200*(1+t))}}setAnswers(t){for(let e=0;e<this.answerContainers.length;e++){const i=this.answerContainers[e];i.interactive=!0,i.buttonMode=!0,i.on("pointerdown",this.clickHandler,this);const n=i.getChildByName("bgContainerAnswer"),s=i.getChildByName("textAnswer");s.text=t[e].text,s.style.fontSize=t[e].size,s.y=-Math.floor(.5*(s.height-n.height))+n.y,s.x=-Math.floor(.5*(s.width-n.width))+n.x}}clickHandler(t){if(!this.selectedAnswer&&this.active){const e=t.currentTarget,i=(e.getChildByName("bgAnswer"),e.getChildByName("textAnswer"));this.selectedAnswer=i.text,this.selectedAnswerContainer=e,this.send(new r(r.AUDIO_PLAY,"select")),this.send(new r(r.ADD,i.text))}}setAnswerCorrect(t){this.selectedAnswerContainer.getChildByName("bgAnswer").gotoAndStop(t)}reset(){this.selectedAnswer=void 0,this.selectedAnswerContainer=void 0}}var pe=fe.prototype=Object.create(rt.prototype);function fe(t,e){rt.call(this),J.setupScopeVariables(this,e,{setup:t})}pe.constructor=fe,pe.enter=function(){this.initVariables()},pe.exit=function(){},pe.kill=function(){},pe.update=function(){this.updateDoTween()},pe.initVariables=function(){const t=this.setup.graphics,e=this.setup.messenger,i=this.setup.proxy,n=p.getInstance();this.playAudio=this.curryPlayAudio(n),this.dispatch=t=>e.send(t);const s=new z;this.updateDoTween=t=>s.update();const o=t.getChildByName("objectQuestion"),a=this.getShuffledArrayFrom(i.questionList),h=[];this.questionCompleteHandler=this.curryQuestionCompleteHandler(h,a);for(let t=0;t<a.length;t++){const e=a[t],i=o.clone();i.x=o.x,i.y=o.y;const n=new de(i,s,t+1,e.questionVO,e.questionFontSize,e.questionText,e.answers);n.on(r.ADD,this.questionCompleteHandler,this),n.on(r.AUDIO_PLAY,(t=>{this.dispatch(new r(r.AUDIO_PLAY,{id:t.object}))}),this),o.parent.addChild(i),h.push(n)}o.parent.removeChild(o),this.playAudio({id:h[0].questionVO}).on(r.COMPLETE,(t=>{h[0].active=!0})),h[0].show()},pe.curryPlayAudio=function(t){return e=>t.play(e)},pe.curryQuestionCompleteHandler=function(t,e,i){let n=0;return i=>{const s=this.getAnswerIDByAnswerString(t[n],i.object);if(e[n].answers[s].isCorrect){const i=this.playAudio({id:e[n].correctVO});t[n].setAnswerCorrect(1),i.on(r.COMPLETE,(e=>{t[n].hide(),n++,setTimeout((e=>{t[n]?(this.playAudio({id:t[n].questionVO}).on(r.COMPLETE,(e=>{t[n].active=!0})),t[n].show()):this.dispatch(new r(r.EXIT))}),800)}),this)}else t[n].setAnswerCorrect(2),this.playAudio({id:e[n].falseVO}).on(r.COMPLETE,(e=>{t[n].setAnswerCorrect(3),t[n].reset()}),this)}},pe.getAnswerIDByAnswerString=function(t,e){for(let i=0;i<t.answerStrings.length;i++)if(e===t.answerStrings[i].text)return i},pe.getShuffledArrayFrom=function(t){var e=[];for(t=t.concat();t.length>0;)e.push(t.splice(Math.floor(Math.random()*t.length),1)[0]);return e};var ge=me.prototype=Object.create(it.prototype);function me(t,e){it.call(this,t),J.setupScopeVariables(this,e,{})}ge.constructor=me,ge.init=function(){this.list=[Xt.Defaults().bind(this),new fe(this.shared)]};var ve=be.prototype=Object.create(Q.prototype);function be(){Q.call(this,{proxy:new $,forceURLImage:!0,settings:tt,urlAudio:tt.URL_JSON_AUDIO,tweenObjectStart:null,tweenObjectIn:null,urlSuffix:"?v=000",urlC
1ontent:tt.URL_JSON_CONTENT,urlPreloader:tt.URL_JSON_PRELOADER,preloaderState:tt.ID_STATE_PRELOADER,preloaderManifest:[tt.URL_JSON_PRELOADER],manifest:[tt.URL_JSON_AUDIO,tt.URL_JSON_CONTENT]})}ve.constructor=be,ve.sendTag=function(t){window.parent.AssistToggo?window.parent.AssistToggo.sendIVWTag(t,location):console.log("sendIVWTag",t)},ve.initStateMachine=function(){this.proxy.loader=this.loader,this.stateMachine.on(r.EXIT,this.stateMachineExitHandler,this),this.stateMachine.on(r.ENTER,this.stateMachineEnterHandler,this),this.stateMachine.addState(tt.ID_STATE_PRELOADER,new Yt(this.setup)),this.stateMachine.addState(tt.ID_STATE_START,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_INTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME0INTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME0,new oe(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME0OUTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME1INTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME1,new le(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME1OUTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME2INTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME2,new me(this.setup)),this.stateMachine.addState(tt.ID_STATE_GAME2OUTRO,new ee(this.setup)),this.stateMachine.addState(tt.ID_STATE_OUTRO,new ee(this.setup))},ve.stateMachineExitHandler=function(t){switch(t.currentTarget.id){case tt.ID_STATE_PRELOADER:n.getURLParameter(tt.PARAMETER_STATE)!==tt.ID_STATE_START&&null!==n.getURLParameter(tt.PARAMETER_STATE)||this.playMusic(),this.setState(n.getURLParameter(tt.PARAMETER_STATE)||tt.ID_STATE_START);break;case tt.ID_STATE_START:this.playMusic(),this.setState(tt.ID_STATE_INTRO);break;case tt.ID_STATE_INTRO:this.setState(tt.ID_STATE_GAME0INTRO);break;case tt.ID_STATE_GAME0INTRO:this.setState(tt.ID_STATE_GAME0);break;case tt.ID_STATE_GAME0:this.setState(tt.ID_STATE_GAME0OUTRO);break;case tt.ID_STATE_GAME0OUTRO:this.setState(tt.ID_STATE_GAME1INTRO);break;case tt.ID_STATE_GAME1INTRO:this.setState(tt.ID_STATE_GAME1);break;case tt.ID_STATE_GAME1:this.setState(tt.ID_STATE_GAME1OUTRO);break;case tt.ID_STATE_GAME1OUTRO:this.setState(tt.ID_STATE_GAME2INTRO);break;case tt.ID_STATE_GAME2INTRO:this.setState(tt.ID_STATE_GAME2);break;case tt.ID_STATE_GAME2:this.setState(tt.ID_STATE_GAME2OUTRO);break;case tt.ID_STATE_GAME2OUTRO:if("buttonDownload"===t.object.name){const t=document.createElement("a");t.href="pdf/fakenews_experte.pdf",t.download="fakenews_experte.pdf",t.dispatchEvent(new MouseEvent("click"))}else this.playMusic(),this.setState(tt.ID_STATE_START);break;case tt.ID_STATE_OUTRO:this.setState(tt.ID_STATE_START)}},ve.stateMachineEnterHandler=function(t){},ve.playMusic=function(){this.proxy.music&&!this.proxy.music.isPlaying?(this.proxy.music.play(),this.proxy.music.seek(0),this.proxy.music.volume=.1):this.proxy.music||(this.proxy.music=p.getInstance().play({id:"music",loop:!0,single:!0,volume:.1}))},window.init=t=>{"true"===n.getURLParameter("verbose")&&(console.log("Built by:","re**.ha******"),console.log("Built date:","13.12.2021 15:15:59")),p.getInstance().globalVolume=n.getURLParameter("volume")||.5;const e={createCanvas:!1,renderer:i.AUTO,orientation:i.PORTRAIT,fps:60,fullscreen:i.ALL,size:{width:640,height:960},onComplete:function(){new be}};"false"===n.getURLParameter("fullscreen")&&(e.fullscreen=!1,e.desktopPreview=!0),new i(e)}})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.