├── .gitignore ├── favicon.ico ├── assets ├── demo.png ├── jpOn.png ├── three.ttf ├── zhOn.png ├── autoOff.png ├── autoOn.png ├── zhJPOn.png ├── TsunagiGothic.ttf ├── touchToStart.png └── AlimamaShuHeiTi.ttf ├── scripts ├── SharedConstants.js ├── EffectManager.js ├── MovieManager.js ├── Utilities.js ├── StillManager.js ├── SoundManager.js ├── BgManager.js ├── FgManager.js ├── SelectManager.js ├── TextManager.js ├── SpineManager.js └── TrackManager.js ├── main.css ├── README.md ├── main.html ├── lib ├── fontfaceobserver.js ├── PixiPlugin.min.js ├── pixi-sound.js └── gsap.min.js └── main.js /.gitignore: -------------------------------------------------------------------------------- 1 | .gitattributes 2 | 3 | .note.txt 4 | 5 | assets/*.woff2 6 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/favicon.ico -------------------------------------------------------------------------------- /assets/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/demo.png -------------------------------------------------------------------------------- /assets/jpOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/jpOn.png -------------------------------------------------------------------------------- /assets/three.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/three.ttf -------------------------------------------------------------------------------- /assets/zhOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/zhOn.png -------------------------------------------------------------------------------- /assets/autoOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/autoOff.png -------------------------------------------------------------------------------- /assets/autoOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/autoOn.png -------------------------------------------------------------------------------- /assets/zhJPOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/zhJPOn.png -------------------------------------------------------------------------------- /assets/TsunagiGothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/TsunagiGothic.ttf -------------------------------------------------------------------------------- /assets/touchToStart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/touchToStart.png -------------------------------------------------------------------------------- /assets/AlimamaShuHeiTi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShinyColorsDB/ShinyColorsDB-EventViewer/HEAD/assets/AlimamaShuHeiTi.ttf -------------------------------------------------------------------------------- /scripts/SharedConstants.js: -------------------------------------------------------------------------------- 1 | const assetUrl = "https://viewer.shinycolors.moe"; 2 | const usedFont = "theFont"; 3 | const zhcnFont = "AlimamaShuHeiTi"; 4 | const translate_master_list = "https://raw.githubusercontent.com/biuuu/ShinyColors/gh-pages/story.json"; 5 | const translate_CSV_url = 'https://raw.githubusercontent.com/biuuu/ShinyColors/gh-pages/data/story/{uid}.csv'; 6 | const fontTimeout = 3000; // control font loading time 放弃字体加载超时时间 7 | -------------------------------------------------------------------------------- /main.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | canvas { 8 | position: absolute; 9 | left: 50%; 10 | top: 50%; 11 | transform: translate(-50%, -50%); 12 | } 13 | 14 | @font-face { 15 | font-family: 'theFont'; 16 | src: url(./assets/TsunagiGothic.ttf); 17 | } 18 | 19 | /* @font-face { 20 | font-family: 'three'; 21 | src: url(./assets/three.ttf); 22 | } */ 23 | 24 | @font-face { 25 | font-family: 'AlimamaShuHeiTi'; 26 | src: url(./assets/AlimamaShuHeiTi.ttf); 27 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ShinyColorsDB-EventViewer 2 | A simple viewer that renders shinycolors events 3 | 4 | [demo website](https://event.shinycolors.moe/?eventId=202100711) 5 | 6 | ## Accessing Events? 7 | 8 | for produce/support events use query variable `eventId={number}` 9 | 10 | for other events, specify query variable eventType `eventId={number}&eventType={type}` 11 | 12 | business_unit_communication 13 | produce_communication_auditions 14 | produce_communication_promise_results 15 | produce_communication_televisions 16 | support_skills 17 | game_event_communications 18 | produce_communication_cheers 19 | produce_communications 20 | produce_events 21 | mypage_communications 22 | produce_communication_judges 23 | produce_communications_promises 24 | special_communications 25 | 26 | ![](./assets/demo.png) 27 | 28 | for iframe embed 29 | - Read custom event json 30 | ```json 31 | { 32 | "messageType": "iframeJson", 33 | "iframeJson": [...] 34 | } 35 | ``` 36 | - Jump to specific frame 37 | ```json 38 | { 39 | "messageType": "fastForward", 40 | "fastForward": { 41 | "forward": true, 42 | "target": 2 43 | } 44 | } 45 | ``` 46 | 47 | - Clear fast forward and back to first frame 48 | ```json 49 | { 50 | "messageType": "fastForward", 51 | "fastForward": { 52 | "forward": false 53 | } 54 | } 55 | ``` -------------------------------------------------------------------------------- /scripts/EffectManager.js: -------------------------------------------------------------------------------- 1 | class EffectManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._effectMap = new Map(); 5 | this._loader = PIXI.Loader.shared; 6 | } 7 | 8 | get stageObj() { 9 | return this._container; 10 | } 11 | 12 | reset(clear = true) { 13 | this._container.removeChildren(0, this._container.children.length); 14 | if (clear) { 15 | this._effectMap.clear(); 16 | } 17 | } 18 | 19 | processEffectByInput(effectLabel, effectTarget, effectValue, isFastForward) { 20 | if (!effectLabel) { return; } 21 | if (!this._effectMap.has(effectLabel)) { 22 | let thisEffect = null; 23 | switch (effectTarget.type) { 24 | case "rect": 25 | thisEffect = new PIXI.Graphics(); 26 | thisEffect.beginFill(`0x${effectTarget.color}`); 27 | thisEffect.drawRect(0, 0, effectTarget.width, effectTarget.height); 28 | thisEffect.endFill(); 29 | break; 30 | 31 | } 32 | this._effectMap.set(effectLabel, thisEffect); 33 | } 34 | 35 | let thisEffect = this._effectMap.get(effectLabel); 36 | this._container.addChild(thisEffect); 37 | 38 | Utilities.fadingEffect(thisEffect, effectValue); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /scripts/MovieManager.js: -------------------------------------------------------------------------------- 1 | class MovieManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._loader = PIXI.Loader.shared; 5 | } 6 | 7 | get stageObj() { 8 | return this._container; 9 | } 10 | 11 | reset() { 12 | this._container.removeChildren(0, this._container.children.length); 13 | } 14 | 15 | processMovieByInput(movie, onMovieEnded, isFastForwardMode) { 16 | if (!movie || isFastForwardMode) { return; } 17 | 18 | this._onMovieEnded = onMovieEnded; 19 | this._playMovie(movie); 20 | } 21 | 22 | _playMovie(movie) { 23 | let texture = PIXI.Texture.from(this._loader.resources[`movie${movie}`].data); 24 | let movieSprite = new PIXI.Sprite(texture); 25 | 26 | this._container.addChild(movieSprite); 27 | 28 | const controller = movieSprite.texture.baseTexture.resource.source; 29 | controller.addEventListener("ended", () => { 30 | setTimeout(() => { 31 | Utilities.fadingEffect(movieSprite, { 32 | type: "to", alpha: 0, time: 1000, ease: "easeOutQuart" 33 | }); 34 | }, 1500); 35 | 36 | setTimeout(() => { 37 | this._container.removeChild(movieSprite); 38 | this._onMovieEnded(); 39 | }, 2500); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /scripts/Utilities.js: -------------------------------------------------------------------------------- 1 | class Utilities { 2 | /** 3 | * @param {PIXIObject} pixiObj 4 | * @param {{type: fromTo,alpha: targetValue, time: effectLastingTime, ease: easingType}} effectValue 5 | **/ 6 | static fadingEffect(pixiObj, effectValue, isFastForward) { 7 | 8 | const thisEffect = this._getFromTo(effectValue.type); 9 | //delete effectValue.type; 10 | 11 | if (effectValue?.time) { 12 | effectValue.duration = effectValue.time / 1000; 13 | //delete effectValue.time; 14 | } 15 | if (isFastForward) { 16 | effectValue.duration = 50 / 1000; 17 | } 18 | if (!effectValue?.ease) { 19 | effectValue.ease = "easeInOutQuad"; 20 | } 21 | else { 22 | effectValue.ease = this._getEasing(effectValue.ease); 23 | } 24 | thisEffect(pixiObj, effectValue); 25 | } 26 | 27 | static _getFromTo(fromto) { 28 | switch (fromto) { 29 | case "from": 30 | return TweenMax.from; 31 | case "to": 32 | return TweenMax.to; 33 | } 34 | } 35 | 36 | static _getEasing(easing) { 37 | switch (easing) { 38 | case "easeInOutQuad": 39 | return Quad.easeInOut; 40 | case "easeInQuad": 41 | return Quad.easeIn; 42 | case "easeOutQuad": 43 | return Quad.easeOut; 44 | case "none": 45 | return Power0.easeNone; 46 | default: 47 | return Quad.easeInOut; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ShinyColorsDB-EventViewer 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /scripts/StillManager.js: -------------------------------------------------------------------------------- 1 | class StillManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._stMap = new Map(); 5 | this._loader = PIXI.Loader.shared; 6 | } 7 | 8 | get stageObj() { 9 | return this._container; 10 | } 11 | 12 | reset(clear = true) { 13 | this._container.removeChildren(0, this._container.children.length); 14 | if (clear) { 15 | this._stMap.clear(); 16 | } 17 | } 18 | 19 | processStillByInput(still, stillType, stillId, stillCtrl, isFastForward) { 20 | if (stillType && stillId) { 21 | this._changeStillByType(stillType, stillId); 22 | } 23 | 24 | if (still) { 25 | this._changeStill(still); 26 | } 27 | 28 | if (stillCtrl) { 29 | this._control(stillCtrl); 30 | } 31 | } 32 | 33 | _changeStill(stillName) { 34 | if (!stillName) { return; } 35 | if (stillName == "off") { 36 | this._control(stillName); 37 | return; 38 | } 39 | 40 | this._removeStill(); 41 | 42 | if (!this._stMap.has(stillName)) { 43 | this._stMap.set(stillName, new PIXI.Sprite(this._loader.resources[`still${stillName}`].texture)); 44 | } 45 | 46 | const thisStill = this._stMap.get(stillName); 47 | 48 | this._container.addChild(thisStill); 49 | } 50 | 51 | _changeStillByType(stillType, stillId) { 52 | if (!stillType || !stillId) { return; } 53 | 54 | this._removeStill(); 55 | 56 | if (!this._stMap.has(`${stillType}${stillId}`)) { 57 | this._stMap.set(`${stillType}${stillId}`, new PIXI.Sprite(this._loader.resources[`still${stillType}${stillId}`].texture)); 58 | } 59 | 60 | const thisStill = this._stMap.get(`${stillType}${stillId}`); 61 | 62 | this._container.addChild(thisStill); 63 | } 64 | 65 | _control(stillCtrl) { 66 | if (!stillCtrl) { return; } 67 | 68 | switch (stillCtrl) { 69 | case "off": 70 | this._removeStill(); 71 | break; 72 | case "on": 73 | break; 74 | } 75 | } 76 | 77 | _removeStill() { 78 | if (this._container.children.length) { 79 | this._container.removeChildAt(0); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /scripts/SoundManager.js: -------------------------------------------------------------------------------- 1 | class SoundManager { 2 | constructor() { 3 | this._loader = PIXI.Loader.shared; 4 | this._currentBgm = null; 5 | this._currentVoice = null; 6 | this._currentSe = null; 7 | this._onVoiceEnd = null; 8 | this._voiceDuration = 0; 9 | 10 | PIXI.sound.volumeAll = 0.1; 11 | } 12 | 13 | get voiceDuration() { 14 | return this._voiceDuration; 15 | } 16 | 17 | reset() { 18 | if (this._currentVoice) { 19 | this._currentVoice.stop(); 20 | this._currentVoice = null; 21 | } 22 | if (this._currentBgm) { 23 | this._currentBgm.stop(); 24 | this._currentBgm = null; 25 | } 26 | if (this._currentSe) { 27 | this._currentSe.stop(); 28 | this._currentSe = null; 29 | } 30 | } 31 | 32 | processSoundByInput(bgm, se, voice, charLabel, onVoiceEnd, isFastForward) { 33 | if (isFastForward) { return; } 34 | if (bgm) { 35 | this._playBgm(bgm); 36 | } 37 | 38 | if (se) { 39 | this._playSe(se); 40 | } 41 | 42 | if (voice) { 43 | this._playVoice(voice, charLabel, onVoiceEnd); 44 | } 45 | } 46 | 47 | _playBgm(bgmName) { 48 | if (bgmName == "fade_out") { 49 | TweenMax.to(this._currentBgm, 0, { volume: 0 }); 50 | return; 51 | } 52 | if (this._currentBgm) { this._currentBgm.stop(); } 53 | if (bgmName == "off") { return; } 54 | 55 | this._currentBgm = this._loader.resources[`bgm${bgmName}`].sound; 56 | this._currentBgm.autoPlay = true; 57 | this._currentBgm.play({ 58 | loop: true, 59 | singleInstance: true 60 | }); 61 | this._currentBgm.volume = 0.3; 62 | } 63 | 64 | _playSe(seName) { 65 | this._currentSe = this._loader.resources[`se${seName}`].sound.play({ 66 | loop: false 67 | }); 68 | } 69 | 70 | _playVoice(voiceName, charLabel, onVoiceEnd) { 71 | this._voiceDuration = 0; 72 | if (this._currentVoice) { 73 | this._currentVoice.stop(); 74 | this._onVoiceEnd(); 75 | } 76 | 77 | this._currentVoice = this._loader.resources[`voice${voiceName}`].sound.play({ 78 | loop: false 79 | }); 80 | 81 | this._voiceDuration = (this._currentVoice._duration) * 1000 + 1000; 82 | 83 | this._onVoiceEnd = () => { 84 | onVoiceEnd(charLabel); 85 | }; 86 | this._currentVoice.on('end', () => { 87 | this._onVoiceEnd(); 88 | }); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /scripts/BgManager.js: -------------------------------------------------------------------------------- 1 | class BgManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._bgMap = new Map(); 5 | this._loader = PIXI.Loader.shared; 6 | } 7 | 8 | get stageObj() { 9 | return this._container; 10 | } 11 | 12 | reset(clear = true) { 13 | this._container.removeChildren(0, this._container.children.length); 14 | if (clear) { 15 | this._bgMap.clear(); 16 | } 17 | } 18 | 19 | processBgByInput(bg, bgEffect, bgEffectTime, isFastForward) { 20 | if (bg && bgEffect) { 21 | if (isFastForward) { 22 | this._insertNewBg(bg, 1, true); 23 | } 24 | else { 25 | this._changeBgByEffect(bg, bgEffect, bgEffectTime); 26 | } 27 | } 28 | else if (bg && !bgEffect) { 29 | this._insertNewBg(bg, 1, true); 30 | } 31 | } 32 | 33 | _insertNewBg(bgName, alphaValue, removeOld = false) { 34 | if (!this._bgMap.has(bgName)) { 35 | this._bgMap.set(bgName, new PIXI.Sprite(this._loader.resources[`bg${bgName}`].texture)); 36 | } 37 | this._bgMap.get(bgName).alpha = alphaValue; 38 | 39 | if (removeOld && this._container.children.length != 0) { 40 | this._container.removeChildAt(0); 41 | } 42 | 43 | let order = this._container.children.length; 44 | this._container.addChildAt(this._bgMap.get(bgName), order); 45 | } 46 | 47 | _changeBgByEffect(bgName, effectName, bgEffectTime) { 48 | switch (effectName) { 49 | case "fade": 50 | this._insertNewBg(bgName, 0); 51 | let origBg, newBg; 52 | if (this._container.children.length == 1) { 53 | newBg = this._container.getChildAt(0); 54 | } 55 | else { 56 | origBg = this._container.getChildAt(0); 57 | newBg = this._container.getChildAt(1); 58 | } 59 | 60 | if (this._container.children.length != 1) { 61 | Utilities.fadingEffect(origBg, { alpha: 0, time: bgEffectTime ? bgEffectTime / 1000 : 1, ease: 'none', type: "to" }); 62 | setTimeout(() => { 63 | if (this._container.children.length) { 64 | this._container.removeChildAt(0); 65 | } 66 | }, bgEffectTime ? bgEffectTime : 1000); 67 | } 68 | Utilities.fadingEffect(newBg, { alpha: 1, time: bgEffectTime ? bgEffectTime : 1, ease: 'none', type: "to" }); 69 | 70 | break; 71 | case "mask": 72 | break; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /scripts/FgManager.js: -------------------------------------------------------------------------------- 1 | class FgManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._fgMap = new Map(); 5 | this._loader = PIXI.Loader.shared; 6 | this._currentFg = null; 7 | } 8 | 9 | get stageObj() { 10 | return this._container; 11 | } 12 | 13 | reset(clear = true) { 14 | this._container.removeChildren(0, this._container.children.length); 15 | if (clear) { 16 | this._fgMap.clear(); 17 | } 18 | } 19 | 20 | processFgByInput(fg, fgEffect, fgEffectTime, isFastForward) { 21 | if (!fg) { 22 | return; 23 | } 24 | else if (fg == "off") { 25 | if (this._container.children.length) { 26 | this._container.removeChildren(0, this._container.children.length); 27 | } 28 | } 29 | else if (isFastForward) { 30 | this._changeFg(fg, 0, 1); 31 | } 32 | else if (fg == "fade_out") { 33 | this._fadeOutFg(); 34 | } 35 | else if (fg && fgEffect) { 36 | if (isFastForward) { 37 | this._changeFg(fg, 0, 1); 38 | } 39 | else { 40 | this._changeFgByEffect(fg, fgEffect, fgEffectTime); 41 | } 42 | } 43 | else if (fg && !fgEffect) { 44 | this._changeFg(fg, 0, 1); 45 | } 46 | } 47 | 48 | _changeFg(fgName, order, alphaValue) { 49 | if (!this._fgMap.has(fgName)) { 50 | this._fgMap.set(fgName, new PIXI.Sprite(this._loader.resources[`fg${fgName}`].texture)); 51 | } 52 | this._currentFg = this._fgMap.get(fgName); 53 | this._currentFg.alpha = alphaValue; 54 | 55 | if (this._container.children.length != 0 && order == 0) { 56 | this._container.removeChildAt(order); 57 | } 58 | 59 | this._container.addChildAt(this._fgMap.get(fgName), order > this._container.children.length ? this._container.children.length : order); 60 | } 61 | 62 | _changeFgByEffect(fgName, fgEffect, fgEffectTime) { 63 | switch (fgEffect) { 64 | case "fade": 65 | this._changeFg(fgName, 1, 0); 66 | let newOrder = this._container.children.length == 1 ? 0 : 1; 67 | let origFg = this._container.getChildAt(0), newFg = this._container.getChildAt(newOrder); 68 | let k = setInterval(() => { 69 | if (newOrder) { 70 | origFg.alpha -= 0.01; 71 | } 72 | newFg.alpha += 0.01; 73 | }, 10); 74 | setTimeout(() => { 75 | clearInterval(k); 76 | if (newOrder) { 77 | origFg.alpha = 0; 78 | } 79 | newFg.alpha = 1; 80 | }, fgEffectTime ? fgEffectTime : 1000); 81 | this._container.removeChildAt(0); 82 | 83 | break; 84 | case "mask": 85 | break; 86 | } 87 | } 88 | 89 | _fadeOutFg() { 90 | Utilities.fadingEffect(this._currentFg, { alpha: 0, time: 1000, type: 'to' }); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /scripts/SelectManager.js: -------------------------------------------------------------------------------- 1 | class SelectManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._loader = PIXI.Loader.shared; 5 | this._stMap = new Map(); 6 | this._neededFrame = 1; 7 | //translate 8 | this._languageType = 0; // 0:jp 1:zh 2:jp+zh 9 | } 10 | 11 | get stageObj() { 12 | return this._container; 13 | } 14 | 15 | get neededFrame() { 16 | return this._neededFrame; 17 | } 18 | 19 | reset(clear = true) { 20 | this._container.removeChildren(0, this._container.children.length); 21 | this._neededFrame = 1; 22 | if (clear) { 23 | this._stMap.clear(); 24 | } 25 | } 26 | 27 | processSelectByInput(selectDesc, nextLabel, onClick, afterSelection, translated_text, isFastForward) { 28 | if (!selectDesc) { return; } 29 | 30 | if (!this._stMap.has(`selectFrame${this.neededFrame}`)) { 31 | let thisSelectContainer = new PIXI.Container(); 32 | thisSelectContainer.addChild(new PIXI.Sprite(this._loader.resources[`selectFrame${this.neededFrame}`].texture)); 33 | let currentText = { jp: '', zh: '' }; 34 | this._stMap.set(`selectFrame${this.neededFrame}`, { thisSelectContainer: thisSelectContainer, currentText: currentText }); 35 | } 36 | 37 | let { thisSelectContainer, currentText } = this._stMap.get(`selectFrame${this.neededFrame}`); 38 | thisSelectContainer.interactive = true; 39 | const localBound = thisSelectContainer.getLocalBounds(); 40 | thisSelectContainer.pivot.set(localBound.width / 2, localBound.height / 2); 41 | 42 | thisSelectContainer.on('click', () => { 43 | this._disableInteractive(); 44 | 45 | TweenMax.to(thisSelectContainer, 0.1, { pixi: { scaleX: 1.2, scaleY: 1.2 } }); 46 | 47 | setTimeout(() => { 48 | onClick(nextLabel); 49 | afterSelection(); 50 | 51 | this._fadeOutOption(); 52 | }, 800); 53 | 54 | }, { once: true }); 55 | 56 | if (translated_text) { 57 | currentText.jp = selectDesc; 58 | currentText.zh = translated_text; 59 | selectDesc = this._languageType === 1 ? translated_text : selectDesc; 60 | } 61 | 62 | let family = translated_text && this._languageType === 1 ? zhcnFont : usedFont; 63 | let textObj = new PIXI.Text(selectDesc, { 64 | fontFamily: family, 65 | fontSize: 24, 66 | fill: 0x000000, 67 | align: 'center', 68 | padding: 3 69 | }); 70 | thisSelectContainer.addChild(textObj); 71 | this._container.addChild(thisSelectContainer); 72 | 73 | // for selectFrame size is 318x172 74 | textObj.anchor.set(0.5); 75 | textObj.position.set(159, 86); 76 | 77 | switch (this.neededFrame) { 78 | case 1: 79 | thisSelectContainer.position.set(568, 125); 80 | break; 81 | case 2: 82 | thisSelectContainer.position.set(200, 240); 83 | break; 84 | case 3: 85 | thisSelectContainer.position.set(936, 240); 86 | break; 87 | } 88 | 89 | const tl = new TimelineMax({ repeat: -1, yoyo: true, repeatDelay: 0 }); 90 | const yLocation = thisSelectContainer.y; 91 | tl.to(thisSelectContainer, 1, { pixi: { y: yLocation - 10 }, ease: Power1.easeInOut }); 92 | tl.to(thisSelectContainer, 1, { pixi: { y: yLocation }, ease: Power1.easeInOut }); 93 | this.frameForward(); 94 | } 95 | 96 | frameForward() { 97 | this._neededFrame++; 98 | } 99 | 100 | frameReset() { 101 | this._neededFrame = 1; 102 | } 103 | 104 | toggleLanguage(type) { 105 | this._languageType = type; 106 | this._stMap.forEach((value, key) => { 107 | let { thisSelectContainer, currentText } = value; 108 | let textObj = thisSelectContainer.getChildAt(1); 109 | if (this._languageType === 0) { 110 | textObj.style.fontFamily = usedFont; 111 | textObj.text = currentText.jp; 112 | } 113 | else if (this._languageType === 1) { 114 | textObj.style.fontFamily = zhcnFont; 115 | textObj.text = currentText.zh; 116 | } 117 | }); 118 | } 119 | 120 | _disableInteractive() { 121 | this._stMap.forEach(st => { 122 | st.interactive = false; 123 | }); 124 | } 125 | 126 | _fadeOutOption() { 127 | this._stMap.forEach(st => { 128 | TweenMax.to(st, 1, { alpha: 0, ease: Power3.easeOut }); 129 | }); 130 | setTimeout(() => { 131 | this._container.removeChildren(0, this._container.children.length); 132 | }, 500); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /scripts/TextManager.js: -------------------------------------------------------------------------------- 1 | class TextManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._loader = PIXI.Loader.shared; 5 | this._txtFrameMap = new Map(); 6 | this._thisWaitTime = 0; 7 | this._typingEffect = null; 8 | //translate 9 | this._languageType = 0; // 0:jp 1:zh 2:jp+zh 10 | this._currentText = { jp: '', zh: '' }; 11 | } 12 | 13 | set languageType(type) { 14 | this._languageType = type; 15 | } 16 | 17 | get stageObj() { 18 | return this._container; 19 | } 20 | 21 | get textWaitTime() { 22 | return this._thisWaitTime; 23 | } 24 | 25 | get typingEffect() { 26 | return this._typingEffect; 27 | } 28 | 29 | reset(clear = true) { 30 | this._container.removeChildren(0, this._container.children.length); 31 | if (clear) { 32 | this._txtFrameMap.clear(); 33 | this._endNotification(); 34 | } 35 | } 36 | 37 | processTextFrameByInput(textFrame, speaker, text, translated_text, isFastForward) { 38 | this._thisWaitTime = 0; 39 | // let managerSound = this._loader.resources['managerSound'].sound; 40 | 41 | if (!textFrame || (textFrame == "off" && !this._container.children.length)) { return; } 42 | 43 | if (this._container.children.length) { 44 | this._container.removeChildren(0, this._container.children.length); 45 | if (textFrame == "off") { return; } 46 | } 47 | 48 | // this._thisWaitTime = isFastForward ? 50 : text.length * 300 + 500; 49 | this._thisWaitTime = isFastForward ? 50 : text ? text.length * 300 + 500 : 50; 50 | 51 | 52 | if (!this._txtFrameMap.has(textFrame)) { 53 | this._txtFrameMap.set(textFrame, new PIXI.Sprite(this._loader.resources[`textFrame${textFrame}`].texture)); 54 | } 55 | 56 | let thisTextFrame = this._txtFrameMap.get(textFrame); 57 | thisTextFrame.position.set(100, 450); 58 | this._container.addChildAt(thisTextFrame, 0); 59 | 60 | let noSpeaker = true; 61 | if (speaker !== "off") { 62 | noSpeaker = false; 63 | let speakerObj = new PIXI.Text(speaker, { 64 | fontFamily: usedFont, 65 | fontSize: 24, 66 | fill: 0x000000, 67 | align: 'center', 68 | padding: 3 69 | }); 70 | this._container.addChildAt(speakerObj, 1); 71 | speakerObj.position.set(260, 462); 72 | } 73 | 74 | if (translated_text) { 75 | this._currentText.jp = text; 76 | this._currentText.zh = translated_text; 77 | text = this._languageType === 1 ? translated_text : text; 78 | } 79 | 80 | let family = translated_text && this._languageType === 1 ? zhcnFont : usedFont; 81 | const textStyle = new PIXI.TextStyle({ 82 | align: "left", 83 | fontFamily: family, 84 | fontSize: 24, 85 | padding: 3 86 | }); 87 | 88 | this.textObj = new PIXI.Text('', textStyle); 89 | this._container.addChildAt(this.textObj, noSpeaker ? 1 : 2); 90 | this.textObj.position.set(240, 510); 91 | 92 | let word_index = 0; 93 | if (this._typingEffect != null) { 94 | clearInterval(this._typingEffect); 95 | } 96 | 97 | if (isFastForward) { 98 | this.textObj.text = text; 99 | } 100 | else { 101 | this._typingEffect = setInterval(() => { 102 | if (word_index === text.length) { 103 | clearInterval(this._typingEffect); 104 | // managerSound.stop() 105 | this._typingEffect = null; 106 | } 107 | 108 | // if(!noSpeaker && speaker == 'プロデューサー'){ 109 | // managerSound.play() 110 | // } 111 | this.textObj.text += text.charAt(word_index); 112 | word_index += 1; 113 | }, 65); 114 | } 115 | } 116 | 117 | toggleLanguage(type) { 118 | this.languageType = type; 119 | 120 | if (this._typingEffect) { 121 | clearInterval(this._typingEffect); 122 | this._typingEffect = null; 123 | } 124 | 125 | if (this.textObj) { 126 | let text; 127 | if (this._languageType === 0) { 128 | text = this._currentText.jp; 129 | this.textObj.style.fontFamily = usedFont; 130 | } 131 | else if (this._languageType === 1) { 132 | text = this._currentText.zh; 133 | this.textObj.style.fontFamily = zhcnFont; 134 | } 135 | this.textObj.text = text ?? ''; 136 | } 137 | } 138 | 139 | _endNotification() { 140 | let owariObj = new PIXI.Text("End", { 141 | fontFamily: usedFont, 142 | fontSize: 40, 143 | fill: 0xffffff, 144 | align: 'center' 145 | }); 146 | this._container.addChildAt(owariObj, 0); 147 | owariObj.anchor.set(0.5); 148 | owariObj.position.set(568, 320); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /lib/fontfaceobserver.js: -------------------------------------------------------------------------------- 1 | /* Font Face Observer v2.3.0 - © Bram Stein. License: BSD-3-Clause */(function(){'use strict';var f,g=[];function l(a){g.push(a);1==g.length&&f()}function m(){for(;g.length;)g[0](),g.shift()}f=function(){setTimeout(m)};function n(a){this.a=p;this.b=void 0;this.f=[];var b=this;try{a(function(a){q(b,a)},function(a){r(b,a)})}catch(c){r(b,c)}}var p=2;function t(a){return new n(function(b,c){c(a)})}function u(a){return new n(function(b){b(a)})}function q(a,b){if(a.a==p){if(b==a)throw new TypeError;var c=!1;try{var d=b&&b.then;if(null!=b&&"object"==typeof b&&"function"==typeof d){d.call(b,function(b){c||q(a,b);c=!0},function(b){c||r(a,b);c=!0});return}}catch(e){c||r(a,e);return}a.a=0;a.b=b;v(a)}} 2 | function r(a,b){if(a.a==p){if(b==a)throw new TypeError;a.a=1;a.b=b;v(a)}}function v(a){l(function(){if(a.a!=p)for(;a.f.length;){var b=a.f.shift(),c=b[0],d=b[1],e=b[2],b=b[3];try{0==a.a?"function"==typeof c?e(c.call(void 0,a.b)):e(a.b):1==a.a&&("function"==typeof d?e(d.call(void 0,a.b)):b(a.b))}catch(h){b(h)}}})}n.prototype.g=function(a){return this.c(void 0,a)};n.prototype.c=function(a,b){var c=this;return new n(function(d,e){c.f.push([a,b,d,e]);v(c)})}; 3 | function w(a){return new n(function(b,c){function d(c){return function(d){h[c]=d;e+=1;e==a.length&&b(h)}}var e=0,h=[];0==a.length&&b(h);for(var k=0;kparseInt(a[1],10)):F=!1);return F}function M(a){null===H&&(H=!!a.document.fonts);return H} 8 | function N(a,c){var b=a.style,g=a.weight;if(null===G){var e=document.createElement("div");try{e.style.font="condensed 100px sans-serif"}catch(q){}G=""!==e.style.font}return[b,g,G?a.stretch:"","100px",c].join(" ")} 9 | D.prototype.load=function(a,c){var b=this,g=a||"BESbswy",e=0,q=c||3E3,J=(new Date).getTime();return new Promise(function(K,L){if(M(b.context)&&!I(b.context)){var O=new Promise(function(r,t){function h(){(new Date).getTime()-J>=q?t(Error(""+q+"ms timeout exceeded")):b.context.document.fonts.load(N(b,'"'+b.family+'"'),g).then(function(n){1<=n.length?r():setTimeout(h,25)},t)}h()}),P=new Promise(function(r,t){e=setTimeout(function(){t(Error(""+q+"ms timeout exceeded"))},q)});Promise.race([P,O]).then(function(){clearTimeout(e); 10 | K(b)},L)}else u(function(){function r(){var d;if(d=-1!=k&&-1!=l||-1!=k&&-1!=m||-1!=l&&-1!=m)(d=k!=l&&k!=m&&l!=m)||(null===E&&(d=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),E=!!d&&(536>parseInt(d[1],10)||536===parseInt(d[1],10)&&11>=parseInt(d[2],10))),d=E&&(k==y&&l==y&&m==y||k==z&&l==z&&m==z||k==A&&l==A&&m==A)),d=!d;d&&(null!==f.parentNode&&f.parentNode.removeChild(f),clearTimeout(e),K(b))}function t(){if((new Date).getTime()-J>=q)null!==f.parentNode&&f.parentNode.removeChild(f), 11 | L(Error(""+q+"ms timeout exceeded"));else{var d=b.context.document.hidden;if(!0===d||void 0===d)k=h.g.offsetWidth,l=n.g.offsetWidth,m=v.g.offsetWidth,r();e=setTimeout(t,50)}}var h=new w(g),n=new w(g),v=new w(g),k=-1,l=-1,m=-1,y=-1,z=-1,A=-1,f=document.createElement("div");f.dir="ltr";x(h,N(b,"sans-serif"));x(n,N(b,"serif"));x(v,N(b,"monospace"));f.appendChild(h.g);f.appendChild(n.g);f.appendChild(v.g);b.context.document.body.appendChild(f);y=h.g.offsetWidth;z=n.g.offsetWidth;A=v.g.offsetWidth;t(); 12 | C(h,function(d){k=d;r()});x(h,N(b,'"'+b.family+'",sans-serif'));C(n,function(d){l=d;r()});x(n,N(b,'"'+b.family+'",serif'));C(v,function(d){m=d;r()});x(v,N(b,'"'+b.family+'",monospace'))})})};"object"===typeof module?module.exports=D:(window.FontFaceObserver=D,window.FontFaceObserver.prototype.load=D.prototype.load);}()); -------------------------------------------------------------------------------- /lib/PixiPlugin.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PixiPlugin 3.11.4 3 | * https://greensock.com 4 | * 5 | * @license Copyright 2022, GreenSock. All rights reserved. 6 | * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. 7 | * @author: Jack Doyle, jack@greensock.com 8 | */ 9 | 10 | !function (t, i) { "object" == typeof exports && "undefined" != typeof module ? i(exports) : "function" == typeof define && define.amd ? define(["exports"], i) : i((t = t || self).window = t.window || {}); }(this, function (i) { "use strict"; function l() { return "undefined" != typeof window; } function m() { return o || l() && (o = window.gsap) && o.registerPlugin && o; } function n(t) { return "function" == typeof t; } function t(t, i) { var r, o, n = [], e = 0, s = 0; for (r = 0; r < 4; r++) { for (o = 0; o < 5; o++)s = 4 === o ? t[e + 4] : 0, n[e + o] = t[e] * i[o] + t[e + 1] * i[o + 5] + t[e + 2] * i[o + 10] + t[e + 3] * i[o + 15] + s; e += 5; } return n; } function u(i, r) { var o = 1 - r, n = o * g, e = o * b, s = o * I; return t([n + r, e, s, 0, 0, n, e + r, s, 0, 0, n, e, s + r, 0, 0, 0, 0, 0, 1, 0], i); } function v(i, r, o) { var n = c(r), e = n[0] / 255, s = n[1] / 255, l = n[2] / 255, a = 1 - o; return t([a + o * e * g, o * e * b, o * e * I, 0, 0, o * s * g, a + o * s * b, o * s * I, 0, 0, o * l * g, o * l * b, a + o * l * I, 0, 0, 0, 0, 0, 1, 0], i); } function w(i, r) { r *= Math.PI / 180; var o = Math.cos(r), n = Math.sin(r); return t([g + o * (1 - g) + n * -g, b + o * -b + n * -b, I + o * -I + n * (1 - I), 0, 0, g + o * -g + .143 * n, b + o * (1 - b) + .14 * n, I + o * -I + -.283 * n, 0, 0, g + o * -g + n * -(1 - g), b + o * -b + n * b, I + o * (1 - I) + n * I, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], i); } function x(i, r) { return t([r, 0, 0, 0, .5 * (1 - r), 0, r, 0, 0, .5 * (1 - r), 0, 0, r, 0, .5 * (1 - r), 0, 0, 0, 1, 0], i); } function y(t, i) { var r, o = f.filters[i], n = t.filters || [], e = n.length; for (o || function _warn(t) { console.warn(t); }(i + " not found. PixiPlugin.registerPIXI(PIXI)"); -1 < --e;)if (n[e] instanceof o) return n[e]; return r = new o, "BlurFilter" === i && (r.blur = 0), n.push(r), t.filters = n, r; } function z(t, i, r, o) { i.add(r, t, r[t], o[t]), i._props.push(t); } function A(t, i) { var r = new f.filters.ColorMatrixFilter; return r.matrix = i, r.brightness(t, !0), r.matrix; } function D(t, i, r) { var o, n, e, s = y(t, "ColorMatrixFilter"), l = t._gsColorMatrixFilter = t._gsColorMatrixFilter || function _copy(t) { var i, r = {}; for (i in t) r[i] = t[i]; return r; }(M), a = i.combineCMF && !("colorMatrixFilter" in i && !i.colorMatrixFilter); e = s.matrix, i.resolution && (s.resolution = i.resolution), i.matrix && i.matrix.length === e.length ? (n = i.matrix, 1 !== l.contrast && z("contrast", r, l, M), l.hue && z("hue", r, l, M), 1 !== l.brightness && z("brightness", r, l, M), l.colorizeAmount && (z("colorize", r, l, M), z("colorizeAmount", r, l, M)), 1 !== l.saturation && z("saturation", r, l, M)) : (n = p.slice(), null != i.contrast ? (n = x(n, +i.contrast), z("contrast", r, l, i)) : 1 !== l.contrast && (a ? n = x(n, l.contrast) : z("contrast", r, l, M)), null != i.hue ? (n = w(n, +i.hue), z("hue", r, l, i)) : l.hue && (a ? n = w(n, l.hue) : z("hue", r, l, M)), null != i.brightness ? (n = A(+i.brightness, n), z("brightness", r, l, i)) : 1 !== l.brightness && (a ? n = A(l.brightness, n) : z("brightness", r, l, M)), null != i.colorize ? (i.colorizeAmount = "colorizeAmount" in i ? +i.colorizeAmount : 1, n = v(n, i.colorize, i.colorizeAmount), z("colorize", r, l, i), z("colorizeAmount", r, l, i)) : l.colorizeAmount && (a ? n = v(n, l.colorize, l.colorizeAmount) : (z("colorize", r, l, M), z("colorizeAmount", r, l, M))), null != i.saturation ? (n = u(n, +i.saturation), z("saturation", r, l, i)) : 1 !== l.saturation && (a ? n = u(n, l.saturation) : z("saturation", r, l, M))), o = n.length; for (; -1 < --o;)n[o] !== e[o] && r.add(e, o, e[o], n[o], "colorMatrixFilter"); r._props.push("colorMatrixFilter"); } function E(t, i) { var r = i.t, o = i.p, n = i.color; (0, i.set)(r, o, n[0] << 16 | n[1] << 8 | n[2]); } function F(t, i) { var r = i.g; r && (r.dirty++, r.clearDirty++); } function G(t, i) { i.t.visible = !!i.t.alpha; } function H(t, i, r, o) { var e = t[i], s = c(n(e) ? t[i.indexOf("set") || !n(t["get" + i.substr(3)]) ? i : "get" + i.substr(3)]() : e), l = c(r); o._pt = new d(o._pt, t, i, 0, 0, E, { t: t, p: i, color: s, set: a(t, i) }), o.add(s, 0, s[0], l[0]), o.add(s, 1, s[1], l[1]), o.add(s, 2, s[2], l[2]); } function N(t) { return "string" == typeof t; } function O(t) { return N(t) && "=" === t.charAt(1) ? t.substr(0, 2) + parseFloat(t.substr(2)) * j : t * j; } function P(t, i) { return i.set(i.t, i.p, 1 === t ? i.e : Math.round(1e5 * (i.s + i.c * t)) / 1e5, i); } function Q(t, i, r, o, n, e) { var s, l, a = 360 * (e ? j : 1), u = N(n), c = u && "=" === n.charAt(1) ? +(n.charAt(0) + "1") : 0, f = parseFloat(c ? n.substr(2) : n) * (e ? j : 1), h = c ? f * c : f - o, p = o + h; return u && ("short" === (s = n.split("_")[1]) && (h %= a) !== h % (a / 2) && (h += h < 0 ? a : -a), "cw" === s && h < 0 ? h = (h + 1e10 * a) % a - ~~(h / a) * a : "ccw" === s && 0 < h && (h = (h - 1e10 * a) % a - ~~(h / a) * a)), t._pt = l = new d(t._pt, i, r, o, h, P), l.e = p, l; } function R() { l() && (r = window, o = m(), f = f || r.PIXI, h = f && f.VERSION && "4" === f.VERSION.charAt(0), c = function _splitColor(t) { return o.utils.splitColor("0x" === (t + "").substr(0, 2) ? "#" + t.substr(2) : t); }); } var o, r, c, f, d, a, h, e, s, p = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], g = .212671, b = .71516, I = .072169, M = { contrast: 1, saturation: 1, colorizeAmount: 0, colorize: "rgb(255,255,255)", hue: 0, brightness: 1 }, _ = { tint: 1, lineColor: 1, fillColor: 1 }, C = "position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","), X = { x: "position", y: "position", tileX: "tilePosition", tileY: "tilePosition" }, S = { colorMatrixFilter: 1, saturation: 1, contrast: 1, hue: 1, colorize: 1, colorizeAmount: 1, brightness: 1, combineCMF: 1 }, j = Math.PI / 180; for (e = 0; e < C.length; e++)s = C[e], X[s + "X"] = s, X[s + "Y"] = s; var Y = { version: "3.11.4", name: "pixi", register: function register(t, i, r) { o = t, d = r, a = i.getSetter, R(); }, registerPIXI: function registerPIXI(t) { f = t; }, init: function init(t, i) { if (f || R(), !(f && t instanceof f.DisplayObject)) return console.warn(t, "is not a DisplayObject or PIXI was not found. PixiPlugin.registerPIXI(PIXI);"), !1; var r, o, n, e, s, l, a, u, c; for (l in i) { if (r = X[l], n = i[l], r) o = ~l.charAt(l.length - 1).toLowerCase().indexOf("x") ? "x" : "y", this.add(t[r], o, t[r][o], "skew" === r ? O(n) : n, 0, 0, 0, 0, 0, 1); else if ("scale" === l || "anchor" === l || "pivot" === l || "tileScale" === l) this.add(t[l], "x", t[l].x, n), this.add(t[l], "y", t[l].y, n); else if ("rotation" === l || "angle" === l) Q(this, t, l, t[l], n, "rotation" === l); else if (S[l]) e || (D(t, i.colorMatrixFilter || i, this), e = !0); else if ("blur" === l || "blurX" === l || "blurY" === l || "blurPadding" === l) { if (s = y(t, "BlurFilter"), this.add(s, l, s[l], n), 0 !== i.blurPadding) for (a = i.blurPadding || 2 * Math.max(s[l], n), u = t.filters.length; -1 < --u;)t.filters[u].padding = Math.max(t.filters[u].padding, a); } else if (_[l]) if (("lineColor" === l || "fillColor" === l) && t instanceof f.Graphics) for (c = (t.geometry || t).graphicsData, this._pt = new d(this._pt, t, l, 0, 0, F, { g: t.geometry || t }), u = c.length; -1 < --u;)H(h ? c[u] : c[u][l.substr(0, 4) + "Style"], h ? l : "color", n, this); else H(t, l, n, this); else "autoAlpha" === l ? (this._pt = new d(this._pt, t, "visible", 0, 0, G), this.add(t, "alpha", t.alpha, n), this._props.push("alpha", "visible")) : "resolution" !== l && this.add(t, l, "get", n); this._props.push(l); } } }; m() && o.registerPlugin(Y), i.PixiPlugin = Y, i.default = Y; if (typeof (window) === "undefined" || window !== i) { Object.defineProperty(i, "__esModule", { value: !0 }); } else { delete i.default; } }); 11 | -------------------------------------------------------------------------------- /scripts/SpineManager.js: -------------------------------------------------------------------------------- 1 | class SpineManager { 2 | constructor() { 3 | this._container = new PIXI.Container(); 4 | this._loader = PIXI.Loader.shared; 5 | this._spineMap = new Map(); 6 | this._keepsLipAnimation = false; 7 | this._replacingLipTrack = null; 8 | this._timeoutToClear = null; 9 | this.LOOP_EVENT_NAME = "loop_start"; 10 | this.RELAY_EVENT_NAME = 'relay'; 11 | this.LIP_EVENT_NAME = 'lip'; 12 | this.ANIMATION_MIX = 0.3; 13 | 14 | this.spineAlias = { 15 | stand_fix: 'stand', 16 | stand_costume_fix: 'stand_costume', 17 | 18 | stand_flex: 'stand', 19 | stand_costume_flex: 'stand_costume', 20 | 21 | stand: 'stand', 22 | stand_costume: 'stand_costume', 23 | 24 | stand_jersey: 'stand_jersey', 25 | stand_silhouette: 'stand_silhouette', 26 | }; 27 | 28 | this._currSpine = {}; 29 | } 30 | 31 | get stageObj() { 32 | return this._container; 33 | } 34 | 35 | reset(clear = true) { 36 | this._container.removeChildren(0, this._container.children.length); 37 | this._currSpine = {}; 38 | if (clear) { 39 | this._spineMap.clear(); 40 | } 41 | } 42 | 43 | processSpineByInput(charLabel, charId, charCategory, charPosition, charScale, charAnim1, charAnim2, charAnim3, charAnim4, charAnim5, 44 | charAnim1Loop, charAnim2Loop, charAnim3Loop, charAnim4Loop, charAnim5Loop, charLipAnim, lipAnimDuration, charEffect, isFastForward) { 45 | if (!charLabel) { return; } 46 | if (charId) { 47 | this._currSpine[charLabel] = { 48 | currCharId: charId, 49 | currCharCategory: this.spineAlias[charCategory] ?? 'stand' 50 | }; 51 | } 52 | let { currCharId, currCharCategory } = this._currSpine[charLabel]; 53 | let char_uid = `${charLabel}_${currCharId}_${currCharCategory}`; 54 | if (!this._spineMap.has(char_uid)) { 55 | this._spineMap.set(char_uid, new PIXI.spine.Spine(this._loader.resources[char_uid].spineData)); 56 | this._spineMap.get(char_uid).alpha = 1; 57 | } 58 | 59 | this._container.addChild(this._spineMap.get(char_uid)); 60 | 61 | charAnim1Loop = charAnim1Loop === undefined ? true : charAnim1Loop; 62 | charAnim2Loop = charAnim2Loop === undefined ? true : charAnim2Loop; 63 | charAnim3Loop = charAnim3Loop === undefined ? true : charAnim3Loop; 64 | charAnim4Loop = charAnim4Loop === undefined ? true : charAnim4Loop; 65 | charAnim5Loop = charAnim5Loop === undefined ? true : charAnim5Loop; 66 | charLipAnim = charLipAnim === undefined ? false : charLipAnim; 67 | 68 | let thisSpine = this._spineMap.get(char_uid); 69 | 70 | try { 71 | thisSpine.skeleton.setSkinByName('normal'); 72 | } 73 | catch { 74 | thisSpine.skeleton.setSkinByName('default'); 75 | } 76 | 77 | if (charPosition) { 78 | thisSpine.position.set(charPosition.x, charPosition.y); 79 | this._container.setChildIndex(thisSpine, this._container.children.length <= charPosition.order ? this._container.children.length - 1 : charPosition.order); 80 | } 81 | 82 | if (charScale) { 83 | thisSpine.scale = charScale; 84 | } 85 | 86 | if (charEffect) { 87 | if (charEffect.type == "from") { thisSpine.alpha = 1; } 88 | if (charEffect?.x) { charEffect.x += thisSpine.x; } 89 | if (charEffect?.y) { charEffect.y += thisSpine.y; } 90 | if (isFastForward) { charEffect.time = 50; } 91 | Utilities.fadingEffect(thisSpine, charEffect, isFastForward); 92 | } 93 | 94 | if (charAnim1) { 95 | this._setCharacterAnimation(charAnim1, charAnim1Loop, 0, thisSpine); 96 | } 97 | 98 | if (charAnim2) { 99 | this._setCharacterAnimation(charAnim2, charAnim2Loop, 1, thisSpine); 100 | } 101 | 102 | if (charAnim3) { 103 | this._setCharacterAnimation(charAnim3, charAnim3Loop, 2, thisSpine); 104 | } 105 | 106 | if (charAnim4) { 107 | this._setCharacterAnimation(charAnim4, charAnim4Loop, 3, thisSpine); 108 | } 109 | 110 | if (charAnim5) { 111 | this._setCharacterAnimation(charAnim5, charAnim5Loop, 4, thisSpine); 112 | } 113 | 114 | if (charLipAnim && !isFastForward) { 115 | const trackEntry = this._setCharacterAnimation(charLipAnim, true, 5, thisSpine); 116 | if (lipAnimDuration) { 117 | this._timeoutToClear = setTimeout(() => { 118 | if (trackEntry.trackIndex === 5) { 119 | trackEntry.time = 0; 120 | trackEntry.timeScale = 0; 121 | } 122 | if (this._replacingLipTrack && this._replacingLipTrack.trackIndex === 5) { //TRACK_INDEXES.LIP_ANIM 123 | this._replacingLipTrack.time = 0; 124 | this._replacingLipTrack.timeScale = 0; 125 | } 126 | 127 | this._keepsLipAnimation = false; 128 | }, lipAnimDuration * 1000); 129 | } 130 | 131 | const isReplacingLipAnimation = !lipAnimDuration && this._keepsLipAnimation; 132 | if (isReplacingLipAnimation) { 133 | this._replacingLipTrack = trackEntry; 134 | } 135 | else { 136 | this._lipTrack = trackEntry; 137 | } 138 | } 139 | 140 | thisSpine.skeleton.setToSetupPose(); 141 | thisSpine.update(0); 142 | thisSpine.autoUpdate = true; 143 | } 144 | 145 | stopLipAnimation(charLabel) { 146 | if (!this._currSpine[charLabel]) { return; } 147 | let { currCharId, currCharCategory } = this._currSpine[charLabel]; 148 | let char_uid = `${charLabel}_${currCharId}_${currCharCategory}`; 149 | if (!this._spineMap.has(char_uid) || !this._spineMap.get(char_uid).state.tracks[5]) { return; } 150 | if (this._lipTrack && this._lipTrack.trackIndex === 5) { 151 | this._lipTrack.time = 0; 152 | this._lipTrack.timeScale = 0; 153 | } 154 | 155 | if (this._replacingLipTrack && this._replacingLipTrack.trackIndex === 5) { 156 | this._replacingLipTrack.time = 0; 157 | this._replacingLipTrack.timeScale = 0; 158 | } 159 | } 160 | 161 | _setCharacterAnimation(charAnim, charAnimLoop, trackNo, thisSpine) { 162 | if (!charAnim || !this._getAnimation(charAnim, thisSpine)) { return; } 163 | let trackEntry = undefined, relayAnim = undefined; 164 | 165 | const animation = this._getAnimation(charAnim, thisSpine); 166 | 167 | const eventTimeline = animation.timelines.find(function (timeline) { 168 | return timeline.events; 169 | }); 170 | 171 | let loopStartTime = null, _this = this; 172 | if (eventTimeline) { 173 | eventTimeline.events.forEach(function (event) { 174 | switch (event.data.name) { 175 | case _this.LOOP_EVENT_NAME: 176 | loopStartTime = event.time; 177 | break; 178 | case _this.LIP_EVENT_NAME: 179 | _this._lipAnim = event.stringValue; 180 | break; 181 | default: 182 | break; 183 | } 184 | }); 185 | } 186 | 187 | if (loopStartTime) { 188 | charAnimLoop = false; 189 | } 190 | 191 | const before = thisSpine.state.getCurrent(trackNo); 192 | const beforeAnim = before ? before.animation.name : null; 193 | 194 | if (beforeAnim) { 195 | const beforeEventTimeline = this._getAnimation(beforeAnim, thisSpine).timelines.find(function (timeline) { 196 | return timeline.events; 197 | }); 198 | if (beforeEventTimeline) { 199 | const relayAnimEvent = beforeEventTimeline.events.find(function (event) { 200 | return event.data.name === _this.RELAY_EVENT_NAME; 201 | }); 202 | if (relayAnimEvent) { 203 | relayAnim = relayAnimEvent.stringValue; 204 | } 205 | } 206 | } 207 | 208 | if (relayAnim) { 209 | if (beforeAnim) { 210 | thisSpine.stateData.setMix(beforeAnim, relayAnim, this.ANIMATION_MIX); 211 | } 212 | thisSpine.stateData.setMix(relayAnim, charAnim, this.ANIMATION_MIX); 213 | thisSpine.state.setAnimation(trackNo, relayAnim, false); 214 | trackEntry = thisSpine.state.addAnimation(trackNo, charAnim, charAnimLoop); 215 | } else { 216 | if (beforeAnim) { 217 | thisSpine.stateData.setMix(beforeAnim, charAnim, this.ANIMATION_MIX); 218 | } 219 | trackEntry = thisSpine.state.setAnimation(trackNo, charAnim, charAnimLoop); 220 | } 221 | 222 | const listener = { 223 | complete: function complete() { 224 | const currentAnim = thisSpine.state.getCurrent(trackNo); 225 | const currentAnimName = currentAnim ? currentAnim.animation.name : null; 226 | if ((!loopStartTime || charAnim !== currentAnimName)) { 227 | return; 228 | } 229 | let trackEntry = thisSpine.state.setAnimation(trackNo, charAnim); 230 | trackEntry.listener = listener; 231 | trackEntry.time = loopStartTime; 232 | } 233 | }; 234 | 235 | trackEntry.listener = listener; 236 | return trackEntry; 237 | } 238 | 239 | _getAnimation(charAnim, thisSpine) { 240 | const animation = thisSpine.spineData.animations.find((a) => a.name === charAnim); 241 | if (!animation) { 242 | console.error(`${charAnim} is not found in spineData`); 243 | } 244 | return animation; 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /scripts/TrackManager.js: -------------------------------------------------------------------------------- 1 | class TrackManager { 2 | constructor(app) { 3 | this._tracks = []; 4 | this._current = 0; 5 | this._nextLabel = null; 6 | this._stopTrackIndex = -1; 7 | this._app = app; 8 | this._loader = PIXI.Loader.shared; 9 | this._bgManager = new BgManager(); 10 | this._fgManager = new FgManager(); 11 | this._spineManager = new SpineManager(); 12 | this._textManager = new TextManager(); 13 | this._selectManager = new SelectManager(); 14 | this._soundManager = new SoundManager(); 15 | this._effectManager = new EffectManager(); 16 | this._movieManager = new MovieManager(); 17 | this._stillManager = new StillManager(); 18 | this._timeoutToClear = null; 19 | this._textTypingEffect = null; 20 | this._autoPlayEnabled = true; 21 | this._stopped = false; 22 | //translate 23 | this._translateJson = null; 24 | this._translateLang = 0; // 0:jp 1:zh 2:jp+zh 25 | this._selecting = false; 26 | 27 | this._fastForwardMode = false; 28 | } 29 | 30 | set setTrack(tracks) { 31 | this._tracks = tracks; 32 | } 33 | 34 | set setTranslateJson(json) { 35 | this._translateJson = json; 36 | // this._translateTable = json['table'] 37 | } 38 | 39 | get currentTrack() { 40 | return this._tracks[this._current]; 41 | } 42 | 43 | get nextTrack() { 44 | return this._tracks[this._current + 1]; 45 | } 46 | 47 | get reachesStopTrack() { 48 | return this._stopTrackIndex !== -1 && this._current === this._stopTrackIndex; 49 | } 50 | 51 | get autoplay() { 52 | return this._autoPlayEnabled; 53 | } 54 | 55 | set nextLabel(v) { 56 | this._nextLabel = v; 57 | } 58 | 59 | set fastForward(f) { 60 | this._fastForwardMode = f; 61 | } 62 | 63 | set stopTrack(s) { 64 | this._stopTrackIndex = s; 65 | } 66 | 67 | destroy() { 68 | this._tracks = []; 69 | this._current = 0; 70 | this._nextLabel = null; 71 | this._stopTrackIndex = -1; 72 | } 73 | 74 | forward() { 75 | if (this._nextLabel) { 76 | this._jumpTo(this._nextLabel); 77 | } else { 78 | this._current++; 79 | } 80 | return this.currentTrack; 81 | } 82 | 83 | setBeforeSelectTrackToStopTrack() { 84 | const index = this._tracks.findIndex(track => track.select); 85 | this._stopTrackIndex = (index !== -1 && index !== 0) ? index - 1 : index; 86 | } 87 | 88 | resetStopTrack() { 89 | this._stopTrackIndex = -1; 90 | } 91 | 92 | addToStage() { 93 | this._app.stage.addChild( 94 | this._bgManager.stageObj, 95 | this._spineManager.stageObj, 96 | this._fgManager.stageObj, 97 | this._stillManager.stageObj, 98 | this._textManager.stageObj, 99 | this._selectManager.stageObj, 100 | this._effectManager.stageObj, 101 | this._movieManager.stageObj 102 | ); 103 | } 104 | 105 | loadAssetsByTrack() { 106 | if (this.currentTrack?.label == "end") { 107 | this._current = 0; 108 | this._selectManager.frameReset(); 109 | // this._loader.add("managerSound", './assets/002.m4a') 110 | this._loader.load(() => { 111 | this._renderTrack(); 112 | }); 113 | return; 114 | } 115 | const { speaker, text, select, nextLabel, textFrame, bg, fg, se, voice, bgm, movie, 116 | charId, charType, charLabel, charCategory, 117 | stillType, stillId, stillCtrl, still 118 | } = this.currentTrack; 119 | 120 | if (speaker && text && this._translateJson) { 121 | this.currentTrack.translated_text = this._translateJson.table.find((data) => data.name == speaker && data.text == text)['trans']; 122 | } 123 | if (textFrame && textFrame != "off" && !this._loader.resources[`textFrame${textFrame}`]) { 124 | this._loader.add(`textFrame${textFrame}`, `${assetUrl}/images/event/text_frame/${textFrame}.png`); 125 | } 126 | if (bg && !this._loader.resources[`bg${bg}`] && bg != "fade_out") { 127 | this._loader.add(`bg${bg}`, `${assetUrl}/images/event/bg/${bg}.jpg`); 128 | } 129 | if (fg && !this._loader.resources[`fg${fg}`] && fg != "off" && fg != "fade_out") { 130 | this._loader.add(`fg${fg}`, `${assetUrl}/images/event/fg/${fg}.png`); 131 | } 132 | if (se && !this._loader.resources[`se${se}`]) { 133 | this._loader.add(`se${se}`, `${assetUrl}/sounds/se/event/${se}.m4a`); 134 | } 135 | if (voice && !this._loader.resources[`voice${voice}`]) { 136 | this._loader.add(`voice${voice}`, `${assetUrl}/sounds/voice/events/${voice}.m4a`); 137 | } 138 | if (bgm && !this._loader.resources[`bgm${bgm}`] && bgm != "fade_out" && bgm != "off") { 139 | this._loader.add(`bgm${bgm}`, `${assetUrl}/sounds/bgm/${bgm}.m4a`); 140 | } 141 | if (movie && !this._loader.resources[`movie${movie}`]) { 142 | this._loader.add(`movie${movie}`, `${assetUrl}/movies/idols/card/${movie}.mp4`); 143 | } 144 | if (charLabel && charId) { 145 | const thisCharCategory = charCategory ? this._spineManager.spineAlias[charCategory] : "stand"; 146 | if (!this._loader.resources[`${charLabel}_${charId}_${thisCharCategory}`]) { 147 | this._loader.add(`${charLabel}_${charId}_${thisCharCategory}`, `${assetUrl}/spine/${charType}/${thisCharCategory}/${charId}/data.json`); 148 | } 149 | } 150 | if (select && !this._loader.resources[`selectFrame${this._selectManager.neededFrame}`]) { 151 | this._loader.add(`selectFrame${this._selectManager.neededFrame}`, `${assetUrl}/images/event/select_frame/00${this._selectManager.neededFrame}.png`); 152 | if (this._translateJson) { 153 | this.currentTrack.translated_text = this._translateJson.table.find((data) => data.id == "select" && data.text == select)['trans']; 154 | } 155 | this._selectManager.frameForward(); 156 | } 157 | if (still && !this._loader.resources[`still${still}`] && still != "off") { 158 | this._loader.add(`still${still}`, `${assetUrl}/images/event/still/${still}.jpg`); 159 | } 160 | if (stillType && stillId && !this._loader.resources[`still${stillType}${stillId}`]) { 161 | this._loader.add(`still${stillType}${stillId}`, `${assetUrl}/images/content/${stillType}/card/${stillId}.jpg`); 162 | } 163 | 164 | this.forward(); 165 | this.loadAssetsByTrack(); 166 | } 167 | 168 | _renderTrack() { 169 | if (this._stopped || this._selecting) { return; } 170 | console.log(`${this._current}/${this._tracks.length - 1}`, this.currentTrack); 171 | 172 | if (this.currentTrack.label == "end") { 173 | this.endOfEvent(); 174 | return; 175 | } 176 | 177 | const { speaker, text, textCtrl, textWait, textFrame, 178 | bg, bgEffect, bgEffectTime, fg, fgEffect, fgEffectTime, bgm, se, voice, voiceKeep, lip, select, nextLabel, stillId, stillCtrl, still, stillType, movie, 179 | charSpine, charLabel, charId, charCategory, charPosition, charScale, charAnim1, charAnim2, charAnim3, charAnim4, charAnim5, 180 | charAnim1Loop, charAnim2Loop, charAnim3Loop, charAnim4Loop, charAnim5Loop, charLipAnim, lipAnimDuration, charEffect, 181 | effectLabel, effectTarget, effectValue, waitType, waitTime, translated_text } = this.currentTrack; 182 | 183 | this._bgManager.processBgByInput(bg, bgEffect, bgEffectTime, this._fastForwardMode); 184 | this._fgManager.processFgByInput(fg, fgEffect, fgEffectTime, this._fastForwardMode); 185 | this._movieManager.processMovieByInput(movie, this._renderTrack.bind(this), this._fastForwardMode); 186 | this._textManager.processTextFrameByInput(textFrame, speaker, text, translated_text, this._fastForwardMode); 187 | this._selectManager.processSelectByInput(select, nextLabel, this._jumpTo.bind(this), this._afterSelection.bind(this), translated_text, this._fastForwardMode); 188 | this._stillManager.processStillByInput(still, stillType, stillId, stillCtrl, this._fastForwardMode); 189 | this._soundManager.processSoundByInput(bgm, se, voice, charLabel, this._spineManager.stopLipAnimation.bind(this._spineManager), this._fastForwardMode); 190 | this._spineManager.processSpineByInput(charLabel, charId, charCategory, charPosition, charScale, charAnim1, charAnim2, charAnim3, charAnim4, charAnim5, 191 | charAnim1Loop, charAnim2Loop, charAnim3Loop, charAnim4Loop, charAnim5Loop, charLipAnim, lipAnimDuration, charEffect, this._fastForwardMode); 192 | this._effectManager.processEffectByInput(effectLabel, effectTarget, effectValue, this._fastForwardMode); 193 | 194 | if (nextLabel == "end") { // will be handled at forward(); 195 | this._nextLabel = "end"; 196 | } 197 | 198 | this.forward(); 199 | 200 | if (this._current - 1 == this._stopTrackIndex) { // do nothing and wait 201 | return; 202 | } 203 | else if (select && !textCtrl) { // turn app.stage interactive off, in case selection is appeared on stage 204 | this._app.stage.interactive = false; 205 | this._renderTrack(); 206 | } 207 | else if (select && textCtrl) { // do nothing, waiting for selection 208 | this._app.stage.interactive = false; 209 | this._selecting = true; 210 | } 211 | else if (text && this.autoplay && !waitType) { 212 | this._textTypingEffect = this._textManager.typingEffect; 213 | // this._loader.resources['managerSound'].sound.stop() 214 | if (voice) { // here to add autoplay for both text and voice condition 215 | const voiceTimeout = this._soundManager.voiceDuration; 216 | this._timeoutToClear = setTimeout(() => { 217 | if (!this.autoplay) { return; } 218 | clearTimeout(this._timeoutToClear); 219 | this._timeoutToClear = null; 220 | this._renderTrack(); 221 | }, voiceTimeout); 222 | } 223 | else { // here to add autoplay for only text condition 224 | const textTimeout = this._textManager.textWaitTime; 225 | this._timeoutToClear = setTimeout(() => { 226 | if (!this.autoplay) { return; } 227 | clearTimeout(this._timeoutToClear); 228 | this._timeoutToClear = null; 229 | this._renderTrack(); 230 | }, textTimeout); 231 | } 232 | } 233 | else if (text && !this.autoplay && !waitType) { 234 | return; 235 | } 236 | else if (movie) { 237 | if (this._fastForwardMode) { 238 | this._renderTrack(); 239 | return; 240 | } 241 | else { return; } 242 | } 243 | else if (waitType == "time") { // should be modified, add touch event to progress, not always timeout 244 | if (this._fastForwardMode) { 245 | this._renderTrack(); 246 | } 247 | else { 248 | this._timeoutToClear = setTimeout(() => { 249 | clearTimeout(this._timeoutToClear); 250 | this._timeoutToClear = null; 251 | this._renderTrack(); 252 | }, waitTime); 253 | } 254 | } 255 | else if (waitType == "effect") { 256 | if (this._fastForwardMode) { 257 | this._renderTrack(); 258 | } 259 | else { 260 | this._timeoutToClear = setTimeout(() => { 261 | clearTimeout(this._timeoutToClear); 262 | this._timeoutToClear = null; 263 | this._renderTrack(); 264 | }, effectValue.time); 265 | } 266 | } 267 | else { 268 | this._renderTrack(); 269 | } 270 | } 271 | 272 | endOfEvent(clear = true) { 273 | this._bgManager.reset(clear); 274 | this._fgManager.reset(clear); 275 | this._spineManager.reset(clear); 276 | this._textManager.reset(clear); 277 | this._selectManager.reset(clear); 278 | this._soundManager.reset(); 279 | this._effectManager.reset(clear); 280 | this._movieManager.reset(); 281 | this._stillManager.reset(clear); 282 | this._stopped = clear; 283 | this._current = 0; 284 | this._nextLabel = null; 285 | this._app.stage.interactive = true; 286 | this._selecting = false; 287 | this.resetStopTrack(); 288 | } 289 | 290 | toggleAutoplay() { 291 | this._autoPlayEnabled = !this._autoPlayEnabled; 292 | } 293 | 294 | toggleLangDisplay() { 295 | this._translateLang = (this._translateLang + 1) % 2; 296 | this._textManager.toggleLanguage(this._translateLang); 297 | this._selectManager.toggleLanguage(this._translateLang); 298 | } 299 | 300 | _jumpTo(nextLabel) { 301 | const length = this._tracks.length; 302 | for (let i = 0; i < length; i++) { 303 | if (this._tracks[i].label !== nextLabel) { continue; } 304 | this._current = i; 305 | this._nextLabel = null; 306 | return; 307 | } 308 | throw new Error(`label ${nextLabel} is not found.`); 309 | } 310 | 311 | _jumpToFrame(frame) { 312 | this._current = frame; 313 | } 314 | 315 | _afterSelection() { 316 | this._app.stage.interactive = true; 317 | this._selecting = false; 318 | this._renderTrack(); 319 | } 320 | } 321 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | async function init() { 4 | 5 | let eventId = getQueryVariable("eventId"); 6 | let eventType = getQueryVariable("eventType", "produce_events"); 7 | let isIframeMode = getQueryVariable("iframeMode", null) === "1"; 8 | let isTranslate = getQueryVariable("isTranslate", null) === '1'; 9 | 10 | let jsonPath; 11 | 12 | const advPlayer = new AdvPlayer(); 13 | await advPlayer.LoadFont(usedFont); //load Font 14 | 15 | async function eventHandler(e) { 16 | if (!e.data.messageType || !e.origin) { 17 | console.log("Invalid message"); 18 | return; 19 | } 20 | switch (e.data.messageType) { 21 | case "iframeJson": 22 | console.log("Received iframeJson"); 23 | advPlayer.loadTrackScript(e.data.iframeJson); 24 | 25 | if (e.data.csvText) { 26 | const translateJson = advPlayer.CSVToJSON(e.data.csvText); 27 | if (translateJson) { 28 | await advPlayer.LoadFont(zhcnFont); 29 | advPlayer.loadTranslateScript(translateJson); 30 | } 31 | } 32 | advPlayer.start(); 33 | break; 34 | case "fastForward": 35 | console.log("Received fastForward"); 36 | advPlayer.reset(); 37 | advPlayer.fastForward(e.data.fastForward); 38 | break; 39 | 40 | } 41 | } 42 | 43 | if (isIframeMode) { 44 | window.addEventListener('message', eventHandler, false); 45 | window.parent.postMessage({ 46 | eventViewerIframeLoaded: true 47 | }, "*"); 48 | } 49 | else { 50 | if (eventId) { 51 | jsonPath = `${eventType}/${eventId}.json`; 52 | } 53 | else { 54 | jsonPath = prompt("input json path: ", "produce_events/202100711.json"); 55 | eventId = jsonPath.split("/")[1].split(".")[0]; 56 | eventType = jsonPath.split("/")[0]; 57 | window.location.search = `eventType=${eventType}&eventId=${eventId}`; 58 | } 59 | 60 | await advPlayer.loadTrackScript(jsonPath); 61 | 62 | if (isTranslate) { 63 | // advPlayer.isTranslate = true 64 | await advPlayer.LoadFont(zhcnFont); //load Font 65 | await advPlayer.getAndLoadTranslateScript(jsonPath); 66 | } 67 | 68 | advPlayer.start(); 69 | } 70 | } 71 | 72 | function getQueryVariable(name, defRet = null) { 73 | const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 74 | const result = window.location.search.substring(1).match(reg); 75 | if (result != null) { 76 | return decodeURI(result[2]); 77 | } else { 78 | return defRet; 79 | } 80 | } 81 | 82 | 83 | class AdvPlayer { 84 | 85 | _interestedEvents = ["click", "touchstart"]; 86 | _Menu = { 87 | touchToStart: null, 88 | autoBtn: null, 89 | switchLangBtn: null, 90 | }; 91 | _autoBtn_texture = { 92 | autoOn: null, 93 | autoOff: null, 94 | }; 95 | _switchLangBtn_texture = []; 96 | _isTranslate = false; 97 | _tm = undefined; 98 | _app = undefined; 99 | 100 | constructor() { 101 | this.createApp(); 102 | this.createPlayer(); 103 | this._Hello(); 104 | } 105 | 106 | set isTranslate(boolean) { 107 | this._isTranslate = boolean; 108 | } 109 | 110 | reset() { 111 | this._tm.endOfEvent(false); 112 | } 113 | 114 | createApp() { 115 | if (document.getElementById("ShinyColors")) { 116 | document.getElementById("ShinyColors").remove(); 117 | } 118 | 119 | PIXI.utils.skipHello(); 120 | 121 | this._app = new PIXI.Application({ 122 | width: 1136, 123 | height: 640, 124 | }); 125 | 126 | this._app.view.setAttribute("id", "ShinyColors"); 127 | 128 | document.body.appendChild(this._app.view); 129 | 130 | this._resize(); 131 | window.onresize = () => this._resize(); 132 | } 133 | 134 | createPlayer() { 135 | if (!this._app) { 136 | console.error('PIXI app has not been initialized'); 137 | return; 138 | } 139 | this._tm = new TrackManager(this._app); 140 | this._tm.addToStage(); 141 | } 142 | 143 | fastForward(forwardJson) { 144 | this._tm.fastForward = forwardJson.forward; 145 | if (forwardJson.forward) { 146 | this._tm.stopTrack = forwardJson.target; 147 | } 148 | else { 149 | this._tm.stopTrack = -1; 150 | } 151 | this._removeTouchToStart(); 152 | this._tm.loadAssetsByTrack(); 153 | } 154 | 155 | async loadTrackScript(Track) { 156 | 157 | if (!this._app || !this._tm) { 158 | return Promise.reject(); 159 | } 160 | 161 | if (typeof Track === 'string') { 162 | return new Promise((res, rej) => { 163 | this._app.loader.add("eventJson", `${assetUrl}/json/${Track}`) 164 | .load((_, resources) => { 165 | if (resources.eventJson.error) { alert("No such event."); return; } 166 | this._tm.setTrack = resources.eventJson.data; 167 | res(Track); 168 | }); 169 | }); 170 | } 171 | else if (typeof Track === 'object') { 172 | this._tm.setTrack = Track; 173 | return Promise.resolve(Track); 174 | } 175 | } 176 | 177 | async getAndLoadTranslateScript(jsonPath) { 178 | if (!this._app || !this._tm) { 179 | return Promise.reject(); 180 | } 181 | 182 | let TranslateUrl = await this._searchFromMasterList(jsonPath); 183 | 184 | if (!TranslateUrl) { 185 | return Promise.reject(); 186 | } 187 | 188 | return new Promise((res, rej) => { 189 | this._app.loader.add("TranslateUrl", TranslateUrl) 190 | .load((_, resources) => { 191 | let translateJson = this.CSVToJSON(resources.TranslateUrl.data); 192 | if (translateJson) { 193 | this._isTranslate = true; 194 | 195 | this._tm.setTranslateJson = translateJson; 196 | } 197 | res(translateJson); 198 | }); 199 | }); 200 | } 201 | 202 | loadTranslateScript(Script) { 203 | if (!this._app || !this._tm) { 204 | return; 205 | } 206 | 207 | if (typeof Script === 'object') { 208 | this._isTranslate = true; 209 | this._tm.setTranslateJson = Script; 210 | } 211 | } 212 | 213 | _searchFromMasterList(jsonPath) { 214 | return new Promise((res, rej) => { 215 | this._app.loader.add("TranslateMasterList", translate_master_list) 216 | .load((_, resources) => { 217 | let translateUrl = this._getCSVUrl(resources.TranslateMasterList.data, jsonPath); 218 | res(translateUrl); 219 | }); 220 | }); 221 | } 222 | 223 | async LoadFont(FontName) { 224 | const font = new FontFaceObserver(FontName); 225 | return await font.load(null, fontTimeout); 226 | } 227 | 228 | _getCSVUrl = (masterlist, jsonPath) => { 229 | let translateUrl; 230 | masterlist.forEach(([key, hash]) => { 231 | if (key === jsonPath) { 232 | translateUrl = translate_CSV_url.replace('{uid}', hash); 233 | return translateUrl; 234 | } 235 | }); 236 | 237 | return translateUrl; 238 | }; 239 | 240 | CSVToJSON = (text) => { 241 | if (text === "") { return; } 242 | const json = { 243 | translater: '', 244 | url: '', 245 | table: [] 246 | }; 247 | const table = text.split(/\r\n/).slice(1); 248 | table.forEach(row => { 249 | const columns = row.split(','); 250 | if (columns[0] === 'info') { 251 | json['url'] = columns[1]; 252 | } 253 | else if (columns[0] === '译者') { 254 | json['translater'] = columns[1]; 255 | } 256 | else if (columns[0] != '') { 257 | json['table'].push({ 258 | id: columns[0], 259 | name: columns[1], 260 | text: columns[2].replace('\\n', '\r\n'), 261 | trans: columns[3].replace('\\n', '\r\n'), 262 | }); 263 | } 264 | }); 265 | return json; 266 | }; 267 | 268 | _resize() { 269 | let height = document.documentElement.clientHeight; 270 | let width = document.documentElement.clientWidth; 271 | 272 | let ratio = Math.min(width / 1136, height / 640); 273 | 274 | let resizedX = 1136 * ratio; 275 | let resizedY = 640 * ratio; 276 | 277 | this._app.view.style.width = resizedX + 'px'; 278 | this._app.view.style.height = resizedY + 'px'; 279 | } 280 | 281 | start() { 282 | this._app.loader 283 | .add("touchToStart", "./assets/touchToStart.png") 284 | .add("autoOn", "./assets/autoOn.png") 285 | .add("autoOff", "./assets/autoOff.png") 286 | .add("jpON", "./assets/jpOn.png") 287 | .add("zhJPOn", "./assets/zhJPOn.png") 288 | .add("zhOn", "./assets/zhOn.png") 289 | .load((_, resources) => this._ready(resources)); 290 | } 291 | 292 | _ready = (resources) => { 293 | this._Menu.touchToStart = new PIXI.Sprite(resources.touchToStart.texture); 294 | this._Menu.autoBtn = new PIXI.Sprite(resources.autoOn.texture); 295 | this._autoBtn_texture.autoOn = resources.autoOn.texture; 296 | this._autoBtn_texture.autoOff = resources.autoOff.texture; 297 | 298 | if (this._isTranslate) { 299 | this._Menu.switchLangBtn = new PIXI.Sprite(resources.jpON.texture); 300 | this._switchLangBtn_texture = [ 301 | resources.jpON.texture, 302 | resources.zhOn.texture, 303 | resources.zhJPOn.texture 304 | ]; 305 | } 306 | 307 | // this._app.stage.interactive = true; 308 | let touchToStart = this._Menu.touchToStart; 309 | touchToStart.anchor.set(0.5); 310 | touchToStart.position.set(568, 500); 311 | this._app.stage.addChild(touchToStart); 312 | 313 | this._interestedEvents.forEach(e => { 314 | this._app.view.addEventListener(e, this._afterTouch); 315 | }); 316 | }; 317 | 318 | _removeTouchToStart() { 319 | this._app.stage.interactive = false; 320 | this._app.stage.removeChild(this._Menu.touchToStart); 321 | this._interestedEvents.forEach(e => { 322 | this._app.view.removeEventListener(e, this._afterTouch); 323 | }); 324 | this._interestedEvents.forEach(e => { 325 | this._app.stage.on(e, this._nextTrack); 326 | }); 327 | } 328 | 329 | _afterTouch = async () => { 330 | let { autoBtn, switchLangBtn } = this._Menu; 331 | 332 | this._removeTouchToStart(); 333 | 334 | //this._app.stage.removeChild(touchToStart); 335 | 336 | this._tm.loadAssetsByTrack(); 337 | 338 | //auto Btn 339 | autoBtn.anchor.set(0.5); 340 | autoBtn.position.set(1075, 50); 341 | autoBtn.interactive = true; 342 | this._app.stage.addChild(autoBtn); 343 | 344 | this._interestedEvents.forEach(e => { // autoplay is initialized to false 345 | autoBtn.on(e, () => { 346 | this._tm.toggleAutoplay(); 347 | this._toggleAutoplay(); 348 | }); 349 | }); 350 | 351 | //Trans 352 | if (this._isTranslate) { 353 | 354 | switchLangBtn.anchor.set(0.5); 355 | switchLangBtn.position.set(1075, 130); 356 | switchLangBtn.interactive = true; 357 | this._app.stage.addChild(switchLangBtn); 358 | 359 | this._interestedEvents.forEach(e => { // autoplay is initialized to false 360 | switchLangBtn.on(e, () => { 361 | this._tm.toggleLangDisplay(); 362 | this._toggleLangDisplay(); 363 | }); 364 | }); 365 | } 366 | }; 367 | 368 | _toggleAutoplay() { 369 | let { autoBtn } = this._Menu; 370 | let { autoOn, autoOff } = this._autoBtn_texture; 371 | 372 | if (this._tm.autoplay) { // toggle on 373 | if (!this._tm._timeoutToClear) { 374 | this._tm._renderTrack(); 375 | } 376 | 377 | autoBtn.texture = autoOn; 378 | this._app.stage.interactive = false; 379 | } 380 | else { // toggle off 381 | if (this._tm._timeoutToClear) { 382 | clearTimeout(this._tm._timeoutToClear); 383 | this._tm._timeoutToClear = null; 384 | } 385 | 386 | autoBtn.texture = autoOff; 387 | this._app.stage.interactive = true; 388 | } 389 | } 390 | 391 | _toggleLangDisplay() { 392 | let { switchLangBtn } = this._Menu; 393 | let next = this._tm._translateLang; 394 | switchLangBtn.texture = this._switchLangBtn_texture[next]; 395 | } 396 | 397 | _nextTrack = (ev) => { 398 | if (ev.target !== this._app.stage) { return; } 399 | if (this._tm.autoplay) { return; } 400 | if (this._tm._timeoutToClear) { 401 | clearTimeout(this._tm._timeoutToClear); 402 | } 403 | if (this._tm._textTypingEffect) { 404 | clearInterval(this._tm._textTypingEffect); 405 | } 406 | 407 | this._tm._renderTrack(); 408 | }; 409 | 410 | _Hello() { 411 | const log = [ 412 | `\n\n %c %c ShinyColors Event Viewer %c %c https://github.com/ShinyColorsDB/ShinyColorsDB-EventViewer %c \n\n`, 413 | 'background: #28de10; padding:5px 0;', 414 | 'color: #28de10; background: #030307; padding:5px 0;', 415 | 'background: #28de10; padding:5px 0;', 416 | 'background: #5eff84; padding:5px 0;', 417 | 'background: #28de10; padding:5px 0;', 418 | ]; 419 | 420 | console.log(...log); 421 | } 422 | } -------------------------------------------------------------------------------- /lib/pixi-sound.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @pixi/sound - v4.3.1 3 | * https://github.com/pixijs/pixi-sound 4 | * Compiled Mon, 19 Sep 2022 19:18:55 UTC 5 | * 6 | * @pixi/sound is licensed under the MIT license. 7 | * http://www.opensource.org/licenses/mit-license 8 | */ 9 | this.PIXI=this.PIXI||{},this.PIXI.sound=function(t,e,n,o){"use strict";function i(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,e}var r,s=i(e);function u(){return r}var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var l=function(){return(l=Object.assign||function(t){for(var e,n=1,o=arguments.length;n-1?t.sound=u().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},e.extension="loader",e}(),m=0,g=function(t){function e(e){var n=t.call(this)||this;return n.id=m++,n.init(e),n}return c(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name ".concat(t," does not exist."));switch(t){case"speed":this.speed=e;break;case"volume":this.volume=e;break;case"paused":this.paused=e;break;case"loop":this.loop=e;break;case"muted":this.muted=e}return this},Object.defineProperty(e.prototype,"progress",{get:function(){return this._source.currentTime/this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),e.prototype._onPlay=function(){this._playing=!0},e.prototype._onPause=function(){this._playing=!1},e.prototype.init=function(t){this._playing=!1,this._duration=t.source.duration;var e=this._source=t.source.cloneNode(!1);e.src=t.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),t.context.on("refresh",this.refresh,this),t.context.on("refreshPaused",this.refreshPaused,this),this._media=t},e.prototype._internalStop=function(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())},e.prototype.stop=function(){this._internalStop(),this._source&&this.emit("stop")},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var n=t.volume*(t.muted?0:1),o=e.volume*(e.muted?0:1),i=this._volume*(this._muted?0:1);this._source.volume=i*n*o,this._source.playbackRate=this._speed*t.speed*e.speed},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,n=this._paused||e.paused||t.paused;n!==this._pausedReal&&(this._pausedReal=n,n?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",n))},e.prototype.play=function(t){var n=this,i=t.start,r=t.end,s=t.speed,u=t.loop,a=t.volume,c=t.muted;this._speed=s,this._volume=a,this._loop=!!u,this._muted=c,this.refresh(),this.loop&&null!==r&&(this.loop=!1),this._start=i,this._end=r||this._duration,this._start=Math.max(0,this._start-e.PADDING),this._end=Math.min(this._end+e.PADDING,this._duration),this._source.onloadedmetadata=function(){n._source&&(n._source.currentTime=i,n._source.onloadedmetadata=null,n.emit("progress",i,n._duration),o.Ticker.shared.add(n._onUpdate,n))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")},e.prototype._onUpdate=function(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete()},e.prototype._onComplete=function(){o.Ticker.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},e.prototype.destroy=function(){o.Ticker.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},e.prototype.toString=function(){return"[HTMLAudioInstance id=".concat(this.id,"]")},e.PADDING=.1,e}(n.EventEmitter),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new g(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),e.prototype.load=function(t){var e=this._source,n=this.parent;if(4!==e.readyState)if(n.url){e.src=n.url;var o=function(){s(),n.isLoaded=!0;var e=n.autoPlayStart();t&&t(null,n,e)},i=function(){s(),t&&t(new Error("Sound loading has been aborted"))},r=function(){s();var n="Failed to load audio element (code: ".concat(e.error.code,")");t&&t(new Error(n))},s=function(){e.removeEventListener("canplaythrough",o),e.removeEventListener("load",o),e.removeEventListener("abort",i),e.removeEventListener("error",r)};e.addEventListener("canplaythrough",o,!1),e.addEventListener("load",o,!1),e.addEventListener("abort",i,!1),e.addEventListener("error",r,!1),e.load()}else t(new Error("sound.url or sound.source must be set"));else{n.isLoaded=!0;var u=n.autoPlayStart();t&&setTimeout((function(){t(null,n,u)}),0)}},e}(n.EventEmitter),v=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),P=function(){function t(){}return t.setParamValue=function(t,e){if(t.setValueAtTime){var n=u().context;t.setValueAtTime(e,n.audioContext.currentTime)}else t.value=e;return e},t}(),x=0,O=function(t){function e(e){var n=t.call(this)||this;return n.id=x++,n._media=null,n._paused=!1,n._muted=!1,n._elapsed=0,n.init(e),n}return c(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name ".concat(t," does not exist."));switch(t){case"speed":this.speed=e;break;case"volume":this.volume=e;break;case"muted":this.muted=e;break;case"loop":this.loop=e;break;case"paused":this.paused=e}return this},e.prototype.stop=function(){this._source&&(this._internalStop(),this.emit("stop"))},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh(),this._update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return this._filters},set:function(t){var e;this._filters&&(null===(e=this._filters)||void 0===e||e.filter((function(t){return t})).forEach((function(t){return t.disconnect()})),this._filters=null,this._source.connect(this._gain)),this._filters=(null==t?void 0:t.length)?t.slice(0):null,this.refresh()},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){if(this._source){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var n=t.volume*(t.muted?0:1),o=e.volume*(e.muted?0:1),i=this._volume*(this._muted?0:1);P.setParamValue(this._gain.gain,i*o*n),P.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed),this.applyFilters()}},e.prototype.applyFilters=function(){var t;if(null===(t=this._filters)||void 0===t?void 0:t.length){this._source.disconnect();var e=this._source;this._filters.forEach((function(t){e.connect(t.destination),e=t})),e.connect(this._gain)}},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,n=this._paused||e.paused||t.paused;n!==this._pausedReal&&(this._pausedReal=n,n?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",n))},e.prototype.play=function(t){var e=t.start,n=t.end,o=t.speed,i=t.loop,r=t.volume,s=t.muted,u=t.filters;this._paused=!1;var a=this._media.nodes.cloneBufferSource(),c=a.source,l=a.gain;this._source=c,this._gain=l,this._speed=o,this._volume=r,this._loop=!!i,this._muted=s,this._filters=u,this.refresh();var p=this._source.buffer.duration;this._duration=p,this._end=n,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=n,this._source.loopStart=e,this._source.start(0,e)):n?this._source.start(0,e,n-e):this._source.start(0,e),this.emit("start"),this._update(!0),this.enableTicker(!0)},e.prototype.enableTicker=function(t){o.Ticker.shared.remove(this._updateListener,this),t&&o.Ticker.shared.add(this._updateListener,this)},Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var t;this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),null===(t=this._filters)||void 0===t||t.forEach((function(t){return t.disconnect()})),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},e.prototype.toString=function(){return"[WebAudioInstance id=".concat(this.id,"]")},e.prototype._now=function(){return this._media.context.audioContext.currentTime},e.prototype._updateListener=function(){this._update()},e.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),n=e-this._lastUpdate;if(n>0||t){var o=this._source.playbackRate.value;this._elapsed+=n*o,this._lastUpdate=e;var i=this._duration,r=void 0;if(this._source.loopStart){var s=this._source.loopEnd-this._source.loopStart;r=(this._source.loopStart+this._elapsed%s)/i}else r=this._elapsed%i/i;this._progress=r,this.emit("progress",this._progress,i)}}},e.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},e.prototype._internalStop=function(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null}catch(t){}this._source=null}},e.prototype._onComplete=function(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null}catch(t){}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},e}(n.EventEmitter),j=function(){function t(t,e){this._output=e,this._input=t}return Object.defineProperty(t.prototype,"destination",{get:function(){return this._input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._filters},set:function(t){var e=this;if(this._filters&&(this._filters.forEach((function(t){t&&t.disconnect()})),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();var n=null;t.forEach((function(t){null===n?e._input.connect(t.destination):n.connect(t.destination),n=t})),n.connect(this._output)}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.filters=null,this._input=null,this._output=null},t}(),E=function(t){function e(e){var n=this,o=e.audioContext,i=o.createBufferSource(),r=o.createGain(),s=o.createAnalyser();return i.connect(s),s.connect(r),r.connect(e.destination),(n=t.call(this,s,r)||this).context=e,n.bufferSource=i,n.gain=r,n.analyser=s,n}return c(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,P.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var n=this.context.audioContext.createGain();return e.connect(n),n.connect(this.destination),{source:e,gain:n}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!1,configurable:!0}),e.BUFFER_SIZE=0,e}(j),w=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new E(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null}catch(t){}this._source=null,this.source=null},t.prototype.create=function(){return new O(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!1,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,n=new XMLHttpRequest,o=this.parent.url;n.open("GET",o,!0),n.responseType="arraybuffer",n.onload=function(){e.source=n.response,e._decode(n.response,t)},n.send()},t.prototype._decode=function(t,e){var n=this,o=function(t,o){if(t)e&&e(t);else{n.parent.isLoaded=!0,n.buffer=o;var i=n.parent.autoPlayStart();e&&e(null,n.parent,i)}};t instanceof AudioBuffer?o(null,t):this.parent.context.decode(t,o)},t}(),L=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var n=e.complete;this._autoPlayOptions=n?{complete:n}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var n={};return"string"==typeof e?n.url=e:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?n.source=e:n=e,(n=l({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},n)).url&&(n.url=_(n.url)),Object.freeze(n),new t(u().useLegacy?new b:new w,n)},Object.defineProperty(t.prototype,"context",{get:function(){return u().context},enumerable:!1,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!1,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var n={};for(var o in t)n[o]=this.addSprites(o,t[o]);return n}var i=new v(this,e);return this._sprites[t]=i,i},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var n in this._sprites)this.removeSprites(n);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!1,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var n,o=this;"string"==typeof t?n={sprite:r=t,loop:this.loop,complete:e}:"function"==typeof t?(n={}).complete=t:n=t;if((n=l({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},n||{})).sprite){var i=n.sprite,r=this._sprites[i];n.start=r.start+(n.start||0),n.end=r.end,n.speed=r.speed||1,n.loop=r.loop||n.loop,delete n.sprite}if(n.offset&&(n.start=n.offset),!this.isLoaded)return new Promise((function(t,e){o.autoPlay=!0,o._autoPlayOptions=n,o._preload((function(o,i,r){o?e(o):(n.loaded&&n.loaded(o,i,r),t(r))}))}));(this.singleInstance||n.singleInstance)&&this._removeInstances();var s=this._createInstance();return this._instances.push(s),this.isPlaying=!0,s.once("end",(function(){n.complete&&n.complete(o),o._onComplete(s)})),s.once("stop",(function(){o._onComplete(s)})),s.play(n),s},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.speed=1,e.muted=!1,e.volume=1,e.paused=!1,e}return c(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!1,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(n.EventEmitter),F=function(t){function e(){var o=this,i=window,r=new e.AudioContext,s=r.createDynamicsCompressor(),u=r.createAnalyser();return u.connect(s),s.connect(r.destination),(o=t.call(this,u,s)||this)._ctx=r,o._offlineCtx=new e.OfflineAudioContext(1,2,i.OfflineAudioContext?Math.max(8e3,Math.min(96e3,r.sampleRate)):44100),o._unlocked=!1,o.compressor=s,o.analyser=u,o.events=new n.EventEmitter,o.volume=1,o.speed=1,o.muted=!1,o.paused=!1,"running"!==r.state&&(o._unlock(),o._unlock=o._unlock.bind(o),document.addEventListener("mousedown",o._unlock,!0),document.addEventListener("touchstart",o._unlock,!0),document.addEventListener("touchend",o._unlock,!0)),o}return c(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!1,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){var n=function(t){e(new Error((null==t?void 0:t.message)||"Unable to decode file"))},o=this._offlineCtx.decodeAudioData(t,(function(t){e(null,t)}),n);o&&o.catch(n)},e}(j),S=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new F),this._htmlAudioContext=new A,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==F.AudioContext},enumerable:!1,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var n={};for(var o in t){var i=this._getOptions(t[o],e);n[o]=this.add(o,i)}return n}if(e instanceof L)return this._sounds[t]=e,e;var r=this._getOptions(e),s=L.from(r);return this._sounds[t]=s,s},t.prototype._getOptions=function(t,e){var n;return n="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?{source:t}:t,n=l(l({},n),e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){y.setLegacy(t),this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!1,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var n=this.find(t);return void 0!==e&&(n.volume=e),n.volume},t.prototype.speed=function(t,e){var n=this.find(t);return void 0!==e&&(n.speed=e),n.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),C={__proto__:null,HTMLAudioMedia:b,HTMLAudioInstance:g,HTMLAudioContext:A},k=function(){function t(t,e){this.init(t,e)}return t.prototype.init=function(t,e){this.destination=t,this.source=e||t},t.prototype.connect=function(t){this.source.connect(t)},t.prototype.disconnect=function(){this.source.disconnect()},t.prototype.destroy=function(){this.disconnect(),this.destination=null,this.source=null},t}(),M={__proto__:null,Filter:k,EqualizerFilter:function(t){function e(n,o,i,r,s,a,c,l,p,h){void 0===n&&(n=0),void 0===o&&(o=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===c&&(c=0),void 0===l&&(l=0),void 0===p&&(p=0),void 0===h&&(h=0);var f=this;if(!u().useLegacy){var d=[{f:e.F32,type:"lowshelf",gain:n},{f:e.F64,type:"peaking",gain:o},{f:e.F125,type:"peaking",gain:i},{f:e.F250,type:"peaking",gain:r},{f:e.F500,type:"peaking",gain:s},{f:e.F1K,type:"peaking",gain:a},{f:e.F2K,type:"peaking",gain:c},{f:e.F4K,type:"peaking",gain:l},{f:e.F8K,type:"peaking",gain:p},{f:e.F16K,type:"highshelf",gain:h}].map((function(t){var e=u().context.audioContext.createBiquadFilter();return e.type=t.type,P.setParamValue(e.Q,1),e.frequency.value=t.f,P.setParamValue(e.gain,t.gain),e}));(f=t.call(this,d[0],d[d.length-1])||this).bands=d,f.bandsMap={};for(var _=0;_0&&f.bands[_-1].connect(y),f.bandsMap[y.frequency.value]=y}return f}f=t.call(this,null)||this}return c(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency ".concat(t));P.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency ".concat(t));return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.bands.forEach((function(t){P.setParamValue(t.gain,0)}))},e.prototype.destroy=function(){this.bands.forEach((function(t){t.disconnect()})),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(k),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var n=this;if(!u().useLegacy){var o=u().context.audioContext.createWaveShaper();return(n=t.call(this,o)||this)._distortion=o,n.amount=e,n}n=t.call(this,null)||this}return c(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount=t;for(var e,n=1e3*t,o=44100,i=new Float32Array(o),r=Math.PI/180,s=0;sf&&(f=_)}s.fillRect(p,(1+h)*c,1,Math.max(1,(f-h)*c))}return i},resolveUrl:_,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var n=L.from({singleInstance:!0});if(!(n.media instanceof w))return n;for(var o=n.media,i=n.context.audioContext.createBuffer(1,48e3*e,48e3),r=i.getChannelData(0),s=0;s a;)s = s._prev; return s ? (e._next = s._next, s._next = e) : (e._next = t[r], t[r] = e), e._next ? e._next._prev = e : t[i] = e, e._prev = s, e.parent = e._dp = t, e; } function ya(t, e, r, i) { void 0 === r && (r = "_first"), void 0 === i && (i = "_last"); var n = e._prev, a = e._next; n ? n._next = a : t[r] === e && (t[r] = a), a ? a._prev = n : t[i] === e && (t[i] = n), e._next = e._prev = e.parent = null; } function za(t, e) { !t.parent || e && !t.parent.autoRemoveChildren || t.parent.remove(t), t._act = 0; } function Aa(t, e) { if (t && (!e || e._end > t._dur || e._start < 0)) for (var r = t; r;)r._dirty = 1, r = r.parent; return t; } function Ca(t, e, r, i) { return t._startAt && (B ? t._startAt.revert(ht) : t.vars.immediateRender && !t.vars.autoRevert || t._startAt.render(e, !0, i)); } function Ea(t) { return t._repeat ? Tt(t._tTime, t = t.duration() + t._rDelay) * t : 0; } function Ga(t, e) { return (t - e._start) * e._ts + (0 <= e._ts ? 0 : e._dirty ? e.totalDuration() : e._tDur); } function Ha(t) { return t._end = ja(t._start + (t._tDur / Math.abs(t._ts || t._rts || V) || 0)); } function Ia(t, e) { var r = t._dp; return r && r.smoothChildTiming && t._ts && (t._start = ja(r._time - (0 < t._ts ? e / t._ts : ((t._dirty ? t.totalDuration() : t._tDur) - e) / -t._ts)), Ha(t), r._dirty || Aa(r, t)), t; } function Ja(t, e) { var r; if ((e._time || e._initted && !e._dur) && (r = Ga(t.rawTime(), e), (!e._dur || kt(0, e.totalDuration(), r) - e._tTime > V) && e.render(r, !0)), Aa(t, e)._dp && t._initted && t._time >= t._dur && t._ts) { if (t._dur < t.duration()) for (r = t; r._dp;)0 <= r.rawTime() && r.totalTime(r._tTime), r = r._dp; t._zTime = -V; } } function Ka(e, r, i, n) { return r.parent && za(r), r._start = ja((t(i) ? i : i || e !== L ? xt(e, i, r) : e._time) + r._delay), r._end = ja(r._start + (r.totalDuration() / Math.abs(r.timeScale()) || 0)), xa(e, r, "_first", "_last", e._sort ? "_start" : 0), bt(r) || (e._recent = r), n || Ja(e, r), e._ts < 0 && Ia(e, e._tTime), e; } function La(t, e) { return (ot.ScrollTrigger || Q("scrollTrigger", e)) && ot.ScrollTrigger.create(e, t); } function Ma(t, e, r, i, n) { return Ht(t, e, n), t._initted ? !r && t._pt && !B && (t._dur && !1 !== t.vars.lazy || !t._dur && t.vars.lazy) && f !== Et.frame ? (ct.push(t), t._lazy = [n, i], 1) : void 0 : 1; } function Ra(t, e, r, i) { var n = t._repeat, a = ja(e) || 0, s = t._tTime / t._tDur; return s && !i && (t._time *= a / t._dur), t._dur = a, t._tDur = n ? n < 0 ? 1e10 : ja(a * (n + 1) + t._rDelay * n) : a, 0 < s && !i && Ia(t, t._tTime = t._tDur * s), t.parent && Ha(t), r || Aa(t.parent, t), t; } function Sa(t) { return t instanceof Ut ? Aa(t) : Ra(t, t._dur); } function Va(e, r, i) { var n, a, s = t(r[1]), o = (s ? 2 : 1) + (e < 2 ? 0 : 1), u = r[o]; if (s && (u.duration = r[1]), u.parent = i, e) { for (n = u, a = i; a && !("immediateRender" in n);)n = a.vars.defaults || {}, a = w(a.vars.inherit) && a.parent; u.immediateRender = w(n.immediateRender), e < 2 ? u.runBackwards = 1 : u.startAt = r[o - 1]; } return new Gt(r[0], u, r[1 + o]); } function Wa(t, e) { return t || 0 === t ? e(t) : e; } function Ya(t, e) { return r(t) && (e = st.exec(t)) ? e[1] : ""; } function _a(t, e) { return t && v(t) && "length" in t && (!e && !t.length || t.length - 1 in t && v(t[0])) && !t.nodeType && t !== h; } function cb(r) { return r = Ot(r)[0] || R("Invalid scope") || {}, function (t) { var e = r.current || r.nativeElement || r; return Ot(t, e.querySelectorAll ? e : e === r ? R("Invalid scope") || a.createElement("div") : r); }; } function db(t) { return t.sort(function () { return .5 - Math.random(); }); } function eb(t) { if (s(t)) return t; var p = v(t) ? t : { each: t }, _ = Yt(p.ease), m = p.from || 0, g = parseFloat(p.base) || 0, y = {}, e = 0 < m && m < 1, T = isNaN(m) || e, b = p.axis, w = m, x = m; return r(m) ? w = x = { center: .5, edges: .5, end: 1 }[m] || 0 : !e && T && (w = m[0], x = m[1]), function (t, e, r) { var i, n, a, s, o, u, h, l, f, c = (r || p).length, d = y[c]; if (!d) { if (!(f = "auto" === p.grid ? 0 : (p.grid || [1, U])[1])) { for (h = -U; h < (h = r[f++].getBoundingClientRect().left) && f < c;); f--; } for (d = y[c] = [], i = T ? Math.min(f, c) * w - .5 : m % f, n = f === U ? 0 : T ? c * x / f - .5 : m / f | 0, l = U, u = h = 0; u < c; u++)a = u % f - i, s = n - (u / f | 0), d[u] = o = b ? Math.abs("y" === b ? s : a) : K(a * a + s * s), h < o && (h = o), o < l && (l = o); "random" === m && db(d), d.max = h - l, d.min = l, d.v = c = (parseFloat(p.amount) || parseFloat(p.each) * (c < f ? c - 1 : b ? "y" === b ? c / f : f : Math.max(f, c / f)) || 0) * ("edges" === m ? -1 : 1), d.b = c < 0 ? g - c : g, d.u = Ya(p.amount || p.each) || 0, _ = _ && c < 0 ? Lt(_) : _; } return c = (d[t] - d.min) / d.max || 0, ja(d.b + (_ ? _(c) : c) * d.v) + d.u; }; } function fb(i) { var n = Math.pow(10, ((i + "").split(".")[1] || "").length); return function (e) { var r = ja(Math.round(parseFloat(e) / i) * i * n); return (r - r % 1) / n + (t(e) ? 0 : Ya(e)); }; } function gb(h, e) { var l, f, r = $(h); return !r && v(h) && (l = r = h.radius || U, h.values ? (h = Ot(h.values), (f = !t(h[0])) && (l *= l)) : h = fb(h.increment)), Wa(e, r ? s(h) ? function (t) { return f = h(t), Math.abs(f - t) <= l ? f : t; } : function (e) { for (var r, i, n = parseFloat(f ? e.x : e), a = parseFloat(f ? e.y : 0), s = U, o = 0, u = h.length; u--;)(r = f ? (r = h[u].x - n) * r + (i = h[u].y - a) * i : Math.abs(h[u] - n)) < s && (s = r, o = u); return o = !l || s <= l ? h[o] : e, f || o === e || t(e) ? o : o + Ya(e); } : fb(h)); } function hb(t, e, r, i) { return Wa($(t) ? !e : !0 === r ? !!(r = 0) : !i, function () { return $(t) ? t[~~(Math.random() * t.length)] : (r = r || 1e-5) && (i = r < 1 ? Math.pow(10, (r + "").length - 2) : 1) && Math.floor(Math.round((t - r / 2 + Math.random() * (e - t + .99 * r)) / r) * r * i) / i; }); } function lb(e, r, t) { return Wa(t, function (t) { return e[~~r(t)]; }); } function ob(t) { for (var e, r, i, n, a = 0, s = ""; ~(e = t.indexOf("random(", a));)i = t.indexOf(")", e), n = "[" === t.charAt(e + 7), r = t.substr(e + 7, i - e - 7).match(n ? at : tt), s += t.substr(a, e - a) + hb(n ? r : +r[0], n ? 0 : +r[1], +r[2] || 1e-5), a = i + 1; return s + t.substr(a, t.length - a); } function rb(t, e, r) { var i, n, a, s = t.labels, o = U; for (i in s) (n = s[i] - e) < 0 == !!r && n && o > (n = Math.abs(n)) && (a = i, o = n); return a; } function tb(t) { return za(t), t.scrollTrigger && t.scrollTrigger.kill(!!B), t.progress() < 1 && Ct(t, "onInterrupt"), t; } function yb(t, e, r) { return (6 * (t += t < 0 ? 1 : 1 < t ? -1 : 0) < 1 ? e + (r - e) * t * 6 : t < .5 ? r : 3 * t < 2 ? e + (r - e) * (2 / 3 - t) * 6 : e) * At + .5 | 0; } function zb(e, r, i) { var n, a, s, o, u, h, l, f, c, d, p = e ? t(e) ? [e >> 16, e >> 8 & At, e & At] : 0 : St.black; if (!p) { if ("," === e.substr(-1) && (e = e.substr(0, e.length - 1)), St[e]) p = St[e]; else if ("#" === e.charAt(0)) { if (e.length < 6 && (e = "#" + (n = e.charAt(1)) + n + (a = e.charAt(2)) + a + (s = e.charAt(3)) + s + (5 === e.length ? e.charAt(4) + e.charAt(4) : "")), 9 === e.length) return [(p = parseInt(e.substr(1, 6), 16)) >> 16, p >> 8 & At, p & At, parseInt(e.substr(7), 16) / 255]; p = [(e = parseInt(e.substr(1), 16)) >> 16, e >> 8 & At, e & At]; } else if ("hsl" === e.substr(0, 3)) if (p = d = e.match(tt), r) { if (~e.indexOf("=")) return p = e.match(et), i && p.length < 4 && (p[3] = 1), p; } else o = +p[0] % 360 / 360, u = p[1] / 100, n = 2 * (h = p[2] / 100) - (a = h <= .5 ? h * (u + 1) : h + u - h * u), 3 < p.length && (p[3] *= 1), p[0] = yb(o + 1 / 3, n, a), p[1] = yb(o, n, a), p[2] = yb(o - 1 / 3, n, a); else p = e.match(tt) || St.transparent; p = p.map(Number); } return r && !d && (n = p[0] / At, a = p[1] / At, s = p[2] / At, h = ((l = Math.max(n, a, s)) + (f = Math.min(n, a, s))) / 2, l === f ? o = u = 0 : (c = l - f, u = .5 < h ? c / (2 - l - f) : c / (l + f), o = l === n ? (a - s) / c + (a < s ? 6 : 0) : l === a ? (s - n) / c + 2 : (n - a) / c + 4, o *= 60), p[0] = ~~(o + .5), p[1] = ~~(100 * u + .5), p[2] = ~~(100 * h + .5)), i && p.length < 4 && (p[3] = 1), p; } function Ab(t) { var r = [], i = [], n = -1; return t.split(Rt).forEach(function (t) { var e = t.match(rt) || []; r.push.apply(r, e), i.push(n += e.length + 1); }), r.c = i, r; } function Bb(t, e, r) { var i, n, a, s, o = "", u = (t + o).match(Rt), h = e ? "hsla(" : "rgba(", l = 0; if (!u) return t; if (u = u.map(function (t) { return (t = zb(t, e, 1)) && h + (e ? t[0] + "," + t[1] + "%," + t[2] + "%," + t[3] : t.join(",")) + ")"; }), r && (a = Ab(t), (i = r.c).join(o) !== a.c.join(o))) for (s = (n = t.replace(Rt, "1").split(rt)).length - 1; l < s; l++)o += n[l] + (~i.indexOf(l) ? u.shift() || h + "0,0,0,0)" : (a.length ? a : u.length ? u : r).shift()); if (!n) for (s = (n = t.split(Rt)).length - 1; l < s; l++)o += n[l] + u[l]; return o + n[s]; } function Eb(t) { var e, r = t.join(" "); if (Rt.lastIndex = 0, Rt.test(r)) return e = Dt.test(r), t[1] = Bb(t[1], e), t[0] = Bb(t[0], e, Ab(t[1])), !0; } function Nb(t) { var e = (t + "").split("("), r = Ft[e[0]]; return r && 1 < e.length && r.config ? r.config.apply(null, ~t.indexOf("{") ? [function _parseObjectInString(t) { for (var e, r, i, n = {}, a = t.substr(1, t.length - 3).split(":"), s = a[0], o = 1, u = a.length; o < u; o++)r = a[o], e = o !== u - 1 ? r.lastIndexOf(",") : r.length, i = r.substr(0, e), n[s] = isNaN(i) ? i.replace(Bt, "").trim() : +i, s = r.substr(e + 1).trim(); return n; }(e[1])] : function _valueInParentheses(t) { var e = t.indexOf("(") + 1, r = t.indexOf(")"), i = t.indexOf("(", e); return t.substring(e, ~i && i < r ? t.indexOf(")", r + 1) : r); }(t).split(",").map(oa)) : Ft._CE && It.test(t) ? Ft._CE("", t) : r; } function Pb(t, e) { for (var r, i = t._first; i;)i instanceof Ut ? Pb(i, e) : !i.vars.yoyoEase || i._yoyo && i._repeat || i._yoyo === e || (i.timeline ? Pb(i.timeline, e) : (r = i._ease, i._ease = i._yEase, i._yEase = r, i._yoyo = e)), i = i._next; } function Rb(t, e, r, i) { void 0 === r && (r = function easeOut(t) { return 1 - e(1 - t); }), void 0 === i && (i = function easeInOut(t) { return t < .5 ? e(2 * t) / 2 : 1 - e(2 * (1 - t)) / 2; }); var n, a = { easeIn: e, easeOut: r, easeInOut: i }; return ha(t, function (t) { for (var e in Ft[t] = ot[t] = a, Ft[n = t.toLowerCase()] = r, a) Ft[n + ("easeIn" === e ? ".in" : "easeOut" === e ? ".out" : ".inOut")] = Ft[t + "." + e] = a[e]; }), a; } function Sb(e) { return function (t) { return t < .5 ? (1 - e(1 - 2 * t)) / 2 : .5 + e(2 * (t - .5)) / 2; }; } function Tb(r, t, e) { function Hm(t) { return 1 === t ? 1 : i * Math.pow(2, -10 * t) * G((t - a) * n) + 1; } var i = 1 <= t ? t : 1, n = (e || (r ? .3 : .45)) / (t < 1 ? t : 1), a = n / W * (Math.asin(1 / i) || 0), s = "out" === r ? Hm : "in" === r ? function (t) { return 1 - Hm(1 - t); } : Sb(Hm); return n = W / n, s.config = function (t, e) { return Tb(r, t, e); }, s; } function Ub(e, r) { function Pm(t) { return t ? --t * t * ((r + 1) * t + r) + 1 : 0; } void 0 === r && (r = 1.70158); var t = "out" === e ? Pm : "in" === e ? function (t) { return 1 - Pm(1 - t); } : Sb(Pm); return t.config = function (t) { return Ub(e, t); }, t; } var I, B, l, L, h, n, a, i, o, f, c, d, p, _, m, g, b, k, M, O, C, A, D, E, z, F, Y, N, j = { autoSleep: 120, force3D: "auto", nullTargetWarn: 1, units: { lineHeight: "" } }, q = { duration: .5, overwrite: !1, delay: 0 }, U = 1e8, V = 1 / U, W = 2 * Math.PI, X = W / 4, H = 0, K = Math.sqrt, Z = Math.cos, G = Math.sin, J = "function" == typeof ArrayBuffer && ArrayBuffer.isView || function () { }, $ = Array.isArray, tt = /(?:-?\.?\d|\.)+/gi, et = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, rt = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, it = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi, nt = /[+-]=-?[.\d]+/, at = /[^,'"\[\]\s]+/gi, st = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i, ot = {}, ut = { suppressEvents: !0, isStart: !0, kill: !1 }, ht = { suppressEvents: !0, kill: !1 }, lt = { suppressEvents: !0 }, ft = {}, ct = [], dt = {}, pt = {}, _t = {}, mt = 30, gt = [], vt = "", yt = function _merge(t, e) { for (var r in e) t[r] = e[r]; return t; }, Tt = function _animationCycle(t, e) { var r = Math.floor(t /= e); return t && r === t ? r - 1 : r; }, bt = function _isFromOrFromStart(t) { var e = t.data; return "isFromStart" === e || "isStart" === e; }, wt = { _start: 0, endTime: T, totalDuration: T }, xt = function _parsePosition(t, e, i) { var n, a, s, o = t.labels, u = t._recent || wt, h = t.duration() >= U ? u.endTime(!1) : t._dur; return r(e) && (isNaN(e) || e in o) ? (a = e.charAt(0), s = "%" === e.substr(-1), n = e.indexOf("="), "<" === a || ">" === a ? (0 <= n && (e = e.replace(/=/, "")), ("<" === a ? u._start : u.endTime(0 <= u._repeat)) + (parseFloat(e.substr(1)) || 0) * (s ? (n < 0 ? u : i).totalDuration() / 100 : 1)) : n < 0 ? (e in o || (o[e] = h), o[e]) : (a = parseFloat(e.charAt(n - 1) + e.substr(n + 1)), s && i && (a = a / 100 * ($(i) ? i[0] : i).totalDuration()), 1 < n ? _parsePosition(t, e.substr(0, n - 1), i) + a : h + a)) : null == e ? h : +e; }, kt = function _clamp(t, e, r) { return r < t ? t : e < r ? e : r; }, Mt = [].slice, Ot = function toArray(t, e, i) { return l && !e && l.selector ? l.selector(t) : !r(t) || i || !n && zt() ? $(t) ? function _flatten(t, e, i) { return void 0 === i && (i = []), t.forEach(function (t) { return r(t) && !e || _a(t, 1) ? i.push.apply(i, Ot(t)) : i.push(t); }) || i; }(t, i) : _a(t) ? Mt.call(t, 0) : t ? [t] : [] : Mt.call((e || a).querySelectorAll(t), 0); }, Pt = function mapRange(e, t, r, i, n) { var a = t - e, s = i - r; return Wa(n, function (t) { return r + ((t - e) / a * s || 0); }); }, Ct = function _callback(t, e, r) { var i, n, a, s = t.vars, o = s[e], u = l, h = t._ctx; if (o) return i = s[e + "Params"], n = s.callbackScope || t, r && ct.length && ma(), h && (l = h), a = i ? o.apply(n, i) : o.call(n), l = u, a; }, At = 255, St = { aqua: [0, At, At], lime: [0, At, 0], silver: [192, 192, 192], black: [0, 0, 0], maroon: [128, 0, 0], teal: [0, 128, 128], blue: [0, 0, At], navy: [0, 0, 128], white: [At, At, At], olive: [128, 128, 0], yellow: [At, At, 0], orange: [At, 165, 0], gray: [128, 128, 128], purple: [128, 0, 128], green: [0, 128, 0], red: [At, 0, 0], pink: [At, 192, 203], cyan: [0, At, At], transparent: [At, At, At, 0] }, Rt = function () { var t, e = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b"; for (t in St) e += "|" + t + "\\b"; return new RegExp(e + ")", "gi"); }(), Dt = /hsl[a]?\(/, Et = (M = Date.now, O = 500, C = 33, A = M(), D = A, z = E = 1e3 / 240, g = { time: 0, frame: 0, tick: function tick() { wl(!0); }, deltaRatio: function deltaRatio(t) { return b / (1e3 / (t || 60)); }, wake: function wake() { o && (!n && x() && (h = n = window, a = h.document || {}, ot.gsap = Ce, (h.gsapVersions || (h.gsapVersions = [])).push(Ce.version), P(i || h.GreenSockGlobals || !h.gsap && h || {}), m = h.requestAnimationFrame), p && g.sleep(), _ = m || function (t) { return setTimeout(t, z - 1e3 * g.time + 1 | 0); }, d = 1, wl(2)); }, sleep: function sleep() { (m ? h.cancelAnimationFrame : clearTimeout)(p), d = 0, _ = T; }, lagSmoothing: function lagSmoothing(t, e) { O = t || 1 / 0, C = Math.min(e || 33, O); }, fps: function fps(t) { E = 1e3 / (t || 240), z = 1e3 * g.time + E; }, add: function add(n, t, e) { var a = t ? function (t, e, r, i) { n(t, e, r, i), g.remove(a); } : n; return g.remove(n), F[e ? "unshift" : "push"](a), zt(), a; }, remove: function remove(t, e) { ~(e = F.indexOf(t)) && F.splice(e, 1) && e <= k && k--; }, _listeners: F = [] }), zt = function _wake() { return !d && Et.wake(); }, Ft = {}, It = /^[\d.\-M][\d.\-,\s]/, Bt = /["']/g, Lt = function _invertEase(e) { return function (t) { return 1 - e(1 - t); }; }, Yt = function _parseEase(t, e) { return t && (s(t) ? t : Ft[t] || Nb(t)) || e; }; function wl(t) { var e, r, i, n, a = M() - D, s = !0 === t; if (O < a && (A += a - C), (0 < (e = (i = (D += a) - A) - z) || s) && (n = ++g.frame, b = i - 1e3 * g.time, g.time = i /= 1e3, z += e + (E <= e ? 4 : E - e), r = 1), s || (p = _(wl)), r) for (k = 0; k < F.length; k++)F[k](i, b, n, t); } function en(t) { return t < N ? Y * t * t : t < .7272727272727273 ? Y * Math.pow(t - 1.5 / 2.75, 2) + .75 : t < .9090909090909092 ? Y * (t -= 2.25 / 2.75) * t + .9375 : Y * Math.pow(t - 2.625 / 2.75, 2) + .984375; } ha("Linear,Quad,Cubic,Quart,Quint,Strong", function (t, e) { var r = e < 5 ? e + 1 : e; Rb(t + ",Power" + (r - 1), e ? function (t) { return Math.pow(t, r); } : function (t) { return t; }, function (t) { return 1 - Math.pow(1 - t, r); }, function (t) { return t < .5 ? Math.pow(2 * t, r) / 2 : 1 - Math.pow(2 * (1 - t), r) / 2; }); }), Ft.Linear.easeNone = Ft.none = Ft.Linear.easeIn, Rb("Elastic", Tb("in"), Tb("out"), Tb()), Y = 7.5625, N = 1 / 2.75, Rb("Bounce", function (t) { return 1 - en(1 - t); }, en), Rb("Expo", function (t) { return t ? Math.pow(2, 10 * (t - 1)) : 0; }), Rb("Circ", function (t) { return -(K(1 - t * t) - 1); }), Rb("Sine", function (t) { return 1 === t ? 1 : 1 - Z(t * X); }), Rb("Back", Ub("in"), Ub("out"), Ub()), Ft.SteppedEase = Ft.steps = ot.SteppedEase = { config: function config(t, e) { void 0 === t && (t = 1); var r = 1 / t, i = t + (e ? 0 : 1), n = e ? 1 : 0; return function (t) { return ((i * kt(0, .99999999, t) | 0) + n) * r; }; } }, q.ease = Ft["quad.out"], ha("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function (t) { return vt += t + "," + t + "Params,"; }); var Nt, jt = function GSCache(t, e) { this.id = H++, (t._gsap = this).target = t, this.harness = e, this.get = e ? e.get : ga, this.set = e ? e.getSetter : re; }, qt = ((Nt = Animation.prototype).delay = function delay(t) { return t || 0 === t ? (this.parent && this.parent.smoothChildTiming && this.startTime(this._start + t - this._delay), this._delay = t, this) : this._delay; }, Nt.duration = function duration(t) { return arguments.length ? this.totalDuration(0 < this._repeat ? t + (t + this._rDelay) * this._repeat : t) : this.totalDuration() && this._dur; }, Nt.totalDuration = function totalDuration(t) { return arguments.length ? (this._dirty = 0, Ra(this, this._repeat < 0 ? t : (t - this._repeat * this._rDelay) / (this._repeat + 1))) : this._tDur; }, Nt.totalTime = function totalTime(t, e) { if (zt(), !arguments.length) return this._tTime; var r = this._dp; if (r && r.smoothChildTiming && this._ts) { for (Ia(this, t), !r._dp || r.parent || Ja(r, this); r && r.parent;)r.parent._time !== r._start + (0 <= r._ts ? r._tTime / r._ts : (r.totalDuration() - r._tTime) / -r._ts) && r.totalTime(r._tTime, !0), r = r.parent; !this.parent && this._dp.autoRemoveChildren && (0 < this._ts && t < this._tDur || this._ts < 0 && 0 < t || !this._tDur && !t) && Ka(this._dp, this, this._start - this._delay); } return (this._tTime !== t || !this._dur && !e || this._initted && Math.abs(this._zTime) === V || !t && !this._initted && (this.add || this._ptLookup)) && (this._ts || (this._pTime = t), na(this, t, e)), this; }, Nt.time = function time(t, e) { return arguments.length ? this.totalTime(Math.min(this.totalDuration(), t + Ea(this)) % (this._dur + this._rDelay) || (t ? this._dur : 0), e) : this._time; }, Nt.totalProgress = function totalProgress(t, e) { return arguments.length ? this.totalTime(this.totalDuration() * t, e) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.ratio; }, Nt.progress = function progress(t, e) { return arguments.length ? this.totalTime(this.duration() * (!this._yoyo || 1 & this.iteration() ? t : 1 - t) + Ea(this), e) : this.duration() ? Math.min(1, this._time / this._dur) : this.ratio; }, Nt.iteration = function iteration(t, e) { var r = this.duration() + this._rDelay; return arguments.length ? this.totalTime(this._time + (t - 1) * r, e) : this._repeat ? Tt(this._tTime, r) + 1 : 1; }, Nt.timeScale = function timeScale(t) { if (!arguments.length) return this._rts === -V ? 0 : this._rts; if (this._rts === t) return this; var e = this.parent && this._ts ? Ga(this.parent._time, this) : this._tTime; return this._rts = +t || 0, this._ts = this._ps || t === -V ? 0 : this._rts, this.totalTime(kt(-this._delay, this._tDur, e), !0), Ha(this), function _recacheAncestors(t) { for (var e = t.parent; e && e.parent;)e._dirty = 1, e.totalDuration(), e = e.parent; return t; }(this); }, Nt.paused = function paused(t) { return arguments.length ? (this._ps !== t && ((this._ps = t) ? (this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()), this._ts = this._act = 0) : (zt(), this._ts = this._rts, this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, 1 === this.progress() && Math.abs(this._zTime) !== V && (this._tTime -= V)))), this) : this._ps; }, Nt.startTime = function startTime(t) { if (arguments.length) { this._start = t; var e = this.parent || this._dp; return !e || !e._sort && this.parent || Ka(e, this, t - this._delay), this; } return this._start; }, Nt.endTime = function endTime(t) { return this._start + (w(t) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); }, Nt.rawTime = function rawTime(t) { var e = this.parent || this._dp; return e ? t && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : this._ts ? Ga(e.rawTime(t), this) : this._tTime : this._tTime; }, Nt.revert = function revert(t) { void 0 === t && (t = lt); var e = B; return B = t, (this._initted || this._startAt) && (this.timeline && this.timeline.revert(t), this.totalTime(-.01, t.suppressEvents)), "nested" !== this.data && !1 !== t.kill && this.kill(), B = e, this; }, Nt.globalTime = function globalTime(t) { for (var e = this, r = arguments.length ? t : e.rawTime(); e;)r = e._start + r / (e._ts || 1), e = e._dp; return !this.parent && this._sat ? this._sat.vars.immediateRender ? -1 : this._sat.globalTime(t) : r; }, Nt.repeat = function repeat(t) { return arguments.length ? (this._repeat = t === 1 / 0 ? -2 : t, Sa(this)) : -2 === this._repeat ? 1 / 0 : this._repeat; }, Nt.repeatDelay = function repeatDelay(t) { if (arguments.length) { var e = this._time; return this._rDelay = t, Sa(this), e ? this.time(e) : this; } return this._rDelay; }, Nt.yoyo = function yoyo(t) { return arguments.length ? (this._yoyo = t, this) : this._yoyo; }, Nt.seek = function seek(t, e) { return this.totalTime(xt(this, t), w(e)); }, Nt.restart = function restart(t, e) { return this.play().totalTime(t ? -this._delay : 0, w(e)); }, Nt.play = function play(t, e) { return null != t && this.seek(t, e), this.reversed(!1).paused(!1); }, Nt.reverse = function reverse(t, e) { return null != t && this.seek(t || this.totalDuration(), e), this.reversed(!0).paused(!1); }, Nt.pause = function pause(t, e) { return null != t && this.seek(t, e), this.paused(!0); }, Nt.resume = function resume() { return this.paused(!1); }, Nt.reversed = function reversed(t) { return arguments.length ? (!!t !== this.reversed() && this.timeScale(-this._rts || (t ? -V : 0)), this) : this._rts < 0; }, Nt.invalidate = function invalidate() { return this._initted = this._act = 0, this._zTime = -V, this; }, Nt.isActive = function isActive() { var t, e = this.parent || this._dp, r = this._start; return !(e && !(this._ts && this._initted && e.isActive() && (t = e.rawTime(!0)) >= r && t < this.endTime(!0) - V)); }, Nt.eventCallback = function eventCallback(t, e, r) { var i = this.vars; return 1 < arguments.length ? (e ? (i[t] = e, r && (i[t + "Params"] = r), "onUpdate" === t && (this._onUpdate = e)) : delete i[t], this) : i[t]; }, Nt.then = function then(t) { var i = this; return new Promise(function (e) { function zo() { var t = i.then; i.then = null, s(r) && (r = r(i)) && (r.then || r === i) && (i.then = t), e(r), i.then = t; } var r = s(t) ? t : pa; i._initted && 1 === i.totalProgress() && 0 <= i._ts || !i._tTime && i._ts < 0 ? zo() : i._prom = zo; }); }, Nt.kill = function kill() { tb(this); }, Animation); function Animation(t) { this.vars = t, this._delay = +t.delay || 0, (this._repeat = t.repeat === 1 / 0 ? -2 : t.repeat || 0) && (this._rDelay = t.repeatDelay || 0, this._yoyo = !!t.yoyo || !!t.yoyoEase), this._ts = 1, Ra(this, +t.duration, 1, 1), this.data = t.data, l && (this._ctx = l).data.push(this), d || Et.wake(); } qa(qt.prototype, { _time: 0, _start: 0, _end: 0, _tTime: 0, _tDur: 0, _dirty: 0, _repeat: 0, _yoyo: !1, parent: null, _initted: !1, _rDelay: 0, _ts: 1, _dp: 0, ratio: 0, _zTime: -V, _prom: 0, _ps: !1, _rts: 1 }); var Ut = function (i) { function Timeline(t, e) { var r; return void 0 === t && (t = {}), (r = i.call(this, t) || this).labels = {}, r.smoothChildTiming = !!t.smoothChildTiming, r.autoRemoveChildren = !!t.autoRemoveChildren, r._sort = w(t.sortChildren), L && Ka(t.parent || L, _assertThisInitialized(r), e), t.reversed && r.reverse(), t.paused && r.paused(!0), t.scrollTrigger && La(_assertThisInitialized(r), t.scrollTrigger), r; } _inheritsLoose(Timeline, i); var e = Timeline.prototype; return e.to = function to(t, e, r) { return Va(0, arguments, this), this; }, e.from = function from(t, e, r) { return Va(1, arguments, this), this; }, e.fromTo = function fromTo(t, e, r, i) { return Va(2, arguments, this), this; }, e.set = function set(t, e, r) { return e.duration = 0, e.parent = this, va(e).repeatDelay || (e.repeat = 0), e.immediateRender = !!e.immediateRender, new Gt(t, e, xt(this, r), 1), this; }, e.call = function call(t, e, r) { return Ka(this, Gt.delayedCall(0, t, e), r); }, e.staggerTo = function staggerTo(t, e, r, i, n, a, s) { return r.duration = e, r.stagger = r.stagger || i, r.onComplete = a, r.onCompleteParams = s, r.parent = this, new Gt(t, r, xt(this, n)), this; }, e.staggerFrom = function staggerFrom(t, e, r, i, n, a, s) { return r.runBackwards = 1, va(r).immediateRender = w(r.immediateRender), this.staggerTo(t, e, r, i, n, a, s); }, e.staggerFromTo = function staggerFromTo(t, e, r, i, n, a, s, o) { return i.startAt = r, va(i).immediateRender = w(i.immediateRender), this.staggerTo(t, e, i, n, a, s, o); }, e.render = function render(t, e, r) { var i, n, a, s, o, u, h, l, f, c, d, p, _ = this._time, m = this._dirty ? this.totalDuration() : this._tDur, g = this._dur, v = t <= 0 ? 0 : ja(t), y = this._zTime < 0 != t < 0 && (this._initted || !g); if (this !== L && m < v && 0 <= t && (v = m), v !== this._tTime || r || y) { if (_ !== this._time && g && (v += this._time - _, t += this._time - _), i = v, f = this._start, u = !(l = this._ts), y && (g || (_ = this._zTime), !t && e || (this._zTime = t)), this._repeat) { if (d = this._yoyo, o = g + this._rDelay, this._repeat < -1 && t < 0) return this.totalTime(100 * o + t, e, r); if (i = ja(v % o), v === m ? (s = this._repeat, i = g) : ((s = ~~(v / o)) && s === v / o && (i = g, s--), g < i && (i = g)), c = Tt(this._tTime, o), !_ && this._tTime && c !== s && (c = s), d && 1 & s && (i = g - i, p = 1), s !== c && !this._lock) { var T = d && 1 & c, b = T === (d && 1 & s); if (s < c && (T = !T), _ = T ? 0 : g, this._lock = 1, this.render(_ || (p ? 0 : ja(s * o)), e, !g)._lock = 0, this._tTime = v, !e && this.parent && Ct(this, "onRepeat"), this.vars.repeatRefresh && !p && (this.invalidate()._lock = 1), _ && _ !== this._time || u != !this._ts || this.vars.onRepeat && !this.parent && !this._act) return this; if (g = this._dur, m = this._tDur, b && (this._lock = 2, _ = T ? g : -1e-4, this.render(_, !0), this.vars.repeatRefresh && !p && this.invalidate()), this._lock = 0, !this._ts && !u) return this; Pb(this, p); } } if (this._hasPause && !this._forcing && this._lock < 2 && (h = function _findNextPauseTween(t, e, r) { var i; if (e < r) for (i = t._first; i && i._start <= r;) { if ("isPause" === i.data && i._start > e) return i; i = i._next; } else for (i = t._last; i && i._start >= r;) { if ("isPause" === i.data && i._start < e) return i; i = i._prev; } }(this, ja(_), ja(i))) && (v -= i - (i = h._start)), this._tTime = v, this._time = i, this._act = !l, this._initted || (this._onUpdate = this.vars.onUpdate, this._initted = 1, this._zTime = t, _ = 0), !_ && i && !e && (Ct(this, "onStart"), this._tTime !== v)) return this; if (_ <= i && 0 <= t) for (n = this._first; n;) { if (a = n._next, (n._act || i >= n._start) && n._ts && h !== n) { if (n.parent !== this) return this.render(t, e, r); if (n.render(0 < n._ts ? (i - n._start) * n._ts : (n._dirty ? n.totalDuration() : n._tDur) + (i - n._start) * n._ts, e, r), i !== this._time || !this._ts && !u) { h = 0, a && (v += this._zTime = -V); break; } } n = a; } else { n = this._last; for (var w = t < 0 ? t : i; n;) { if (a = n._prev, (n._act || w <= n._end) && n._ts && h !== n) { if (n.parent !== this) return this.render(t, e, r); if (n.render(0 < n._ts ? (w - n._start) * n._ts : (n._dirty ? n.totalDuration() : n._tDur) + (w - n._start) * n._ts, e, r || B && (n._initted || n._startAt)), i !== this._time || !this._ts && !u) { h = 0, a && (v += this._zTime = w ? -V : V); break; } } n = a; } } if (h && !e && (this.pause(), h.render(_ <= i ? 0 : -V)._zTime = _ <= i ? 1 : -1, this._ts)) return this._start = f, Ha(this), this.render(t, e, r); this._onUpdate && !e && Ct(this, "onUpdate", !0), (v === m && this._tTime >= this.totalDuration() || !v && _) && (f !== this._start && Math.abs(l) === Math.abs(this._ts) || this._lock || (!t && g || !(v === m && 0 < this._ts || !v && this._ts < 0) || za(this, 1), e || t < 0 && !_ || !v && !_ && m || (Ct(this, v === m && 0 <= t ? "onComplete" : "onReverseComplete", !0), !this._prom || v < m && 0 < this.timeScale() || this._prom()))); } return this; }, e.add = function add(e, i) { var n = this; if (t(i) || (i = xt(this, i, e)), !(e instanceof qt)) { if ($(e)) return e.forEach(function (t) { return n.add(t, i); }), this; if (r(e)) return this.addLabel(e, i); if (!s(e)) return this; e = Gt.delayedCall(0, e); } return this !== e ? Ka(this, e, i) : this; }, e.getChildren = function getChildren(t, e, r, i) { void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === r && (r = !0), void 0 === i && (i = -U); for (var n = [], a = this._first; a;)a._start >= i && (a instanceof Gt ? e && n.push(a) : (r && n.push(a), t && n.push.apply(n, a.getChildren(!0, e, r)))), a = a._next; return n; }, e.getById = function getById(t) { for (var e = this.getChildren(1, 1, 1), r = e.length; r--;)if (e[r].vars.id === t) return e[r]; }, e.remove = function remove(t) { return r(t) ? this.removeLabel(t) : s(t) ? this.killTweensOf(t) : (ya(this, t), t === this._recent && (this._recent = this._last), Aa(this)); }, e.totalTime = function totalTime(t, e) { return arguments.length ? (this._forcing = 1, !this._dp && this._ts && (this._start = ja(Et.time - (0 < this._ts ? t / this._ts : (this.totalDuration() - t) / -this._ts))), i.prototype.totalTime.call(this, t, e), this._forcing = 0, this) : this._tTime; }, e.addLabel = function addLabel(t, e) { return this.labels[t] = xt(this, e), this; }, e.removeLabel = function removeLabel(t) { return delete this.labels[t], this; }, e.addPause = function addPause(t, e, r) { var i = Gt.delayedCall(0, e || T, r); return i.data = "isPause", this._hasPause = 1, Ka(this, i, xt(this, t)); }, e.removePause = function removePause(t) { var e = this._first; for (t = xt(this, t); e;)e._start === t && "isPause" === e.data && za(e), e = e._next; }, e.killTweensOf = function killTweensOf(t, e, r) { for (var i = this.getTweensOf(t, r), n = i.length; n--;)Vt !== i[n] && i[n].kill(t, e); return this; }, e.getTweensOf = function getTweensOf(e, r) { for (var i, n = [], a = Ot(e), s = this._first, o = t(r); s;)s instanceof Gt ? la(s._targets, a) && (o ? (!Vt || s._initted && s._ts) && s.globalTime(0) <= r && s.globalTime(s.totalDuration()) > r : !r || s.isActive()) && n.push(s) : (i = s.getTweensOf(a, r)).length && n.push.apply(n, i), s = s._next; return n; }, e.tweenTo = function tweenTo(t, e) { e = e || {}; var r, i = this, n = xt(i, t), a = e.startAt, s = e.onStart, o = e.onStartParams, u = e.immediateRender, h = Gt.to(i, qa({ ease: e.ease || "none", lazy: !1, immediateRender: !1, time: n, overwrite: "auto", duration: e.duration || Math.abs((n - (a && "time" in a ? a.time : i._time)) / i.timeScale()) || V, onStart: function onStart() { if (i.pause(), !r) { var t = e.duration || Math.abs((n - (a && "time" in a ? a.time : i._time)) / i.timeScale()); h._dur !== t && Ra(h, t, 0, 1).render(h._time, !0, !0), r = 1; } s && s.apply(h, o || []); } }, e)); return u ? h.render(0) : h; }, e.tweenFromTo = function tweenFromTo(t, e, r) { return this.tweenTo(e, qa({ startAt: { time: xt(this, t) } }, r)); }, e.recent = function recent() { return this._recent; }, e.nextLabel = function nextLabel(t) { return void 0 === t && (t = this._time), rb(this, xt(this, t)); }, e.previousLabel = function previousLabel(t) { return void 0 === t && (t = this._time), rb(this, xt(this, t), 1); }, e.currentLabel = function currentLabel(t) { return arguments.length ? this.seek(t, !0) : this.previousLabel(this._time + V); }, e.shiftChildren = function shiftChildren(t, e, r) { void 0 === r && (r = 0); for (var i, n = this._first, a = this.labels; n;)n._start >= r && (n._start += t, n._end += t), n = n._next; if (e) for (i in a) a[i] >= r && (a[i] += t); return Aa(this); }, e.invalidate = function invalidate(t) { var e = this._first; for (this._lock = 0; e;)e.invalidate(t), e = e._next; return i.prototype.invalidate.call(this, t); }, e.clear = function clear(t) { void 0 === t && (t = !0); for (var e, r = this._first; r;)e = r._next, this.remove(r), r = e; return this._dp && (this._time = this._tTime = this._pTime = 0), t && (this.labels = {}), Aa(this); }, e.totalDuration = function totalDuration(t) { var e, r, i, n = 0, a = this, s = a._last, o = U; if (arguments.length) return a.timeScale((a._repeat < 0 ? a.duration() : a.totalDuration()) / (a.reversed() ? -t : t)); if (a._dirty) { for (i = a.parent; s;)e = s._prev, s._dirty && s.totalDuration(), o < (r = s._start) && a._sort && s._ts && !a._lock ? (a._lock = 1, Ka(a, s, r - s._delay, 1)._lock = 0) : o = r, r < 0 && s._ts && (n -= r, (!i && !a._dp || i && i.smoothChildTiming) && (a._start += r / a._ts, a._time -= r, a._tTime -= r), a.shiftChildren(-r, !1, -Infinity), o = 0), s._end > n && s._ts && (n = s._end), s = e; Ra(a, a === L && a._time > n ? a._time : n, 1, 1), a._dirty = 0; } return a._tDur; }, Timeline.updateRoot = function updateRoot(t) { if (L._ts && (na(L, Ga(t, L)), f = Et.frame), Et.frame >= mt) { mt += j.autoSleep || 120; var e = L._first; if ((!e || !e._ts) && j.autoSleep && Et._listeners.length < 2) { for (; e && !e._ts;)e = e._next; e || Et.sleep(); } } }, Timeline; }(qt); qa(Ut.prototype, { _lock: 0, _hasPause: 0, _forcing: 0 }); function _b(t, e, i, n, a, o) { var u, h, l, f; if (pt[t] && !1 !== (u = new pt[t]).init(a, u.rawVars ? e[t] : function _processVars(t, e, i, n, a) { if (s(t) && (t = Qt(t, a, e, i, n)), !v(t) || t.style && t.nodeType || $(t) || J(t)) return r(t) ? Qt(t, a, e, i, n) : t; var o, u = {}; for (o in t) u[o] = Qt(t[o], a, e, i, n); return u; }(e[t], n, a, o, i), i, n, o) && (i._pt = h = new pe(i._pt, a, t, 0, 1, u.render, u, 0, u.priority), i !== c)) for (l = i._ptLookup[i._targets.indexOf(a)], f = u._props.length; f--;)l[u._props[f]] = h; return u; } function fc(t, r, e, i) { var n, a, s = r.ease || i || "power1.inOut"; if ($(r)) a = e[t] || (e[t] = []), r.forEach(function (t, e) { return a.push({ t: e / (r.length - 1) * 100, v: t, e: s }); }); else for (n in r) a = e[n] || (e[n] = []), "ease" === n || a.push({ t: parseFloat(t), v: r[n], e: s }); } var Vt, Wt, Xt = function _addPropTween(t, e, i, n, a, o, u, h, l, f) { s(n) && (n = n(a || 0, t, o)); var c, d = t[e], p = "get" !== i ? i : s(d) ? l ? t[e.indexOf("set") || !s(t["get" + e.substr(3)]) ? e : "get" + e.substr(3)](l) : t[e]() : d, _ = s(d) ? l ? ee : $t : Jt; if (r(n) && (~n.indexOf("random(") && (n = ob(n)), "=" === n.charAt(1) && (!(c = ka(p, n) + (Ya(p) || 0)) && 0 !== c || (n = c))), !f || p !== n || Wt) return isNaN(p * n) || "" === n ? (d || e in t || Q(e, n), function _addComplexStringPropTween(t, e, r, i, n, a, s) { var o, u, h, l, f, c, d, p, _ = new pe(this._pt, t, e, 0, 1, se, null, n), m = 0, g = 0; for (_.b = r, _.e = i, r += "", (d = ~(i += "").indexOf("random(")) && (i = ob(i)), a && (a(p = [r, i], t, e), r = p[0], i = p[1]), u = r.match(it) || []; o = it.exec(i);)l = o[0], f = i.substring(m, o.index), h ? h = (h + 1) % 5 : "rgba(" === f.substr(-5) && (h = 1), l !== u[g++] && (c = parseFloat(u[g - 1]) || 0, _._pt = { _next: _._pt, p: f || 1 === g ? f : ",", s: c, c: "=" === l.charAt(1) ? ka(c, l) - c : parseFloat(l) - c, m: h && h < 4 ? Math.round : 0 }, m = it.lastIndex); return _.c = m < i.length ? i.substring(m, i.length) : "", _.fp = s, (nt.test(i) || d) && (_.e = 0), this._pt = _; }.call(this, t, e, p, n, _, h || j.stringFilter, l)) : (c = new pe(this._pt, t, e, +p || 0, n - (p || 0), "boolean" == typeof d ? ae : ne, 0, _), l && (c.fp = l), u && c.modifier(u, this, t), this._pt = c); }, Ht = function _initTween(t, e, r) { var i, n, a, s, o, u, h, l, f, c, d, p, _, m = t.vars, g = m.ease, v = m.startAt, y = m.immediateRender, T = m.lazy, b = m.onUpdate, x = m.onUpdateParams, k = m.callbackScope, M = m.runBackwards, O = m.yoyoEase, P = m.keyframes, C = m.autoRevert, A = t._dur, S = t._startAt, R = t._targets, D = t.parent, E = D && "nested" === D.data ? D.vars.targets : R, z = "auto" === t._overwrite && !I, F = t.timeline; if (!F || P && g || (g = "none"), t._ease = Yt(g, q.ease), t._yEase = O ? Lt(Yt(!0 === O ? g : O, q.ease)) : 0, O && t._yoyo && !t._repeat && (O = t._yEase, t._yEase = t._ease, t._ease = O), t._from = !F && !!m.runBackwards, !F || P && !m.stagger) { if (p = (l = R[0] ? fa(R[0]).harness : 0) && m[l.prop], i = ua(m, ft), S && (S._zTime < 0 && S.progress(1), e < 0 && M && y && !C ? S.render(-1, !0) : S.revert(M && A ? ht : ut), S._lazy = 0), v) { if (za(t._startAt = Gt.set(R, qa({ data: "isStart", overwrite: !1, parent: D, immediateRender: !0, lazy: !S && w(T), startAt: null, delay: 0, onUpdate: b, onUpdateParams: x, callbackScope: k, stagger: 0 }, v))), t._startAt._dp = 0, t._startAt._sat = t, e < 0 && (B || !y && !C) && t._startAt.revert(ht), y && A && e <= 0 && r <= 0) return void (e && (t._zTime = e)); } else if (M && A && !S) if (e && (y = !1), a = qa({ overwrite: !1, data: "isFromStart", lazy: y && !S && w(T), immediateRender: y, stagger: 0, parent: D }, i), p && (a[l.prop] = p), za(t._startAt = Gt.set(R, a)), t._startAt._dp = 0, t._startAt._sat = t, e < 0 && (B ? t._startAt.revert(ht) : t._startAt.render(-1, !0)), t._zTime = e, y) { if (!e) return; } else _initTween(t._startAt, V, V); for (t._pt = t._ptCache = 0, T = A && w(T) || T && !A, n = 0; n < R.length; n++) { if (h = (o = R[n])._gsap || ea(R)[n]._gsap, t._ptLookup[n] = c = {}, dt[h.id] && ct.length && ma(), d = E === R ? n : E.indexOf(o), l && !1 !== (f = new l).init(o, p || i, t, d, E) && (t._pt = s = new pe(t._pt, o, f.name, 0, 1, f.render, f, 0, f.priority), f._props.forEach(function (t) { c[t] = s; }), f.priority && (u = 1)), !l || p) for (a in i) pt[a] && (f = _b(a, i, t, d, o, E)) ? f.priority && (u = 1) : c[a] = s = Xt.call(t, o, a, "get", i[a], d, E, 0, m.stringFilter); t._op && t._op[n] && t.kill(o, t._op[n]), z && t._pt && (Vt = t, L.killTweensOf(o, c, t.globalTime(e)), _ = !t.parent, Vt = 0), t._pt && T && (dt[h.id] = 1); } u && de(t), t._onInit && t._onInit(t); } t._onUpdate = b, t._initted = (!t._op || t._pt) && !_, P && e <= 0 && F.render(U, !0, !0); }, Qt = function _parseFuncOrString(t, e, i, n, a) { return s(t) ? t.call(e, i, n, a) : r(t) && ~t.indexOf("random(") ? ob(t) : t; }, Kt = vt + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert", Zt = {}; ha(Kt + ",id,stagger,delay,duration,paused,scrollTrigger", function (t) { return Zt[t] = 1; }); var Gt = function (z) { function Tween(e, r, i, n) { var a; "number" == typeof r && (i.duration = r, r = i, i = null); var s, o, u, h, l, f, c, d, p = (a = z.call(this, n ? r : va(r)) || this).vars, _ = p.duration, m = p.delay, g = p.immediateRender, T = p.stagger, b = p.overwrite, x = p.keyframes, k = p.defaults, M = p.scrollTrigger, O = p.yoyoEase, P = r.parent || L, C = ($(e) || J(e) ? t(e[0]) : "length" in r) ? [e] : Ot(e); if (a._targets = C.length ? ea(C) : R("GSAP target " + e + " not found. https://greensock.com", !j.nullTargetWarn) || [], a._ptLookup = [], a._overwrite = b, x || T || y(_) || y(m)) { if (r = a.vars, (s = a.timeline = new Ut({ data: "nested", defaults: k || {}, targets: P && "nested" === P.data ? P.vars.targets : C })).kill(), s.parent = s._dp = _assertThisInitialized(a), s._start = 0, T || y(_) || y(m)) { if (h = C.length, c = T && eb(T), v(T)) for (l in T) ~Kt.indexOf(l) && ((d = d || {})[l] = T[l]); for (o = 0; o < h; o++)(u = ua(r, Zt)).stagger = 0, O && (u.yoyoEase = O), d && yt(u, d), f = C[o], u.duration = +Qt(_, _assertThisInitialized(a), o, f, C), u.delay = (+Qt(m, _assertThisInitialized(a), o, f, C) || 0) - a._delay, !T && 1 === h && u.delay && (a._delay = m = u.delay, a._start += m, u.delay = 0), s.to(f, u, c ? c(o, f, C) : 0), s._ease = Ft.none; s.duration() ? _ = m = 0 : a.timeline = 0; } else if (x) { va(qa(s.vars.defaults, { ease: "none" })), s._ease = Yt(x.ease || r.ease || "none"); var A, S, D, E = 0; if ($(x)) x.forEach(function (t) { return s.to(C, t, ">"); }), s.duration(); else { for (l in u = {}, x) "ease" === l || "easeEach" === l || fc(l, x[l], u, x.easeEach); for (l in u) for (A = u[l].sort(function (t, e) { return t.t - e.t; }), o = E = 0; o < A.length; o++)(D = { ease: (S = A[o]).e, duration: (S.t - (o ? A[o - 1].t : 0)) / 100 * _ })[l] = S.v, s.to(C, D, E), E += D.duration; s.duration() < _ && s.to({}, { duration: _ - s.duration() }); } } _ || a.duration(_ = s.duration()); } else a.timeline = 0; return !0 !== b || I || (Vt = _assertThisInitialized(a), L.killTweensOf(C), Vt = 0), Ka(P, _assertThisInitialized(a), i), r.reversed && a.reverse(), r.paused && a.paused(!0), (g || !_ && !x && a._start === ja(P._time) && w(g) && function _hasNoPausedAncestors(t) { return !t || t._ts && _hasNoPausedAncestors(t.parent); }(_assertThisInitialized(a)) && "nested" !== P.data) && (a._tTime = -V, a.render(Math.max(0, -m) || 0)), M && La(_assertThisInitialized(a), M), a; } _inheritsLoose(Tween, z); var e = Tween.prototype; return e.render = function render(t, e, r) { var i, n, a, s, o, u, h, l, f, c = this._time, d = this._tDur, p = this._dur, _ = t < 0, m = d - V < t && !_ ? d : t < V ? 0 : t; if (p) { if (m !== this._tTime || !t || r || !this._initted && this._tTime || this._startAt && this._zTime < 0 != _) { if (i = m, l = this.timeline, this._repeat) { if (s = p + this._rDelay, this._repeat < -1 && _) return this.totalTime(100 * s + t, e, r); if (i = ja(m % s), m === d ? (a = this._repeat, i = p) : ((a = ~~(m / s)) && a === m / s && (i = p, a--), p < i && (i = p)), (u = this._yoyo && 1 & a) && (f = this._yEase, i = p - i), o = Tt(this._tTime, s), i === c && !r && this._initted) return this._tTime = m, this; a !== o && (l && this._yEase && Pb(l, u), !this.vars.repeatRefresh || u || this._lock || (this._lock = r = 1, this.render(ja(s * a), !0).invalidate()._lock = 0)); } if (!this._initted) { if (Ma(this, _ ? t : i, r, e, m)) return this._tTime = 0, this; if (c !== this._time) return this; if (p !== this._dur) return this.render(t, e, r); } if (this._tTime = m, this._time = i, !this._act && this._ts && (this._act = 1, this._lazy = 0), this.ratio = h = (f || this._ease)(i / p), this._from && (this.ratio = h = 1 - h), i && !c && !e && (Ct(this, "onStart"), this._tTime !== m)) return this; for (n = this._pt; n;)n.r(h, n.d), n = n._next; l && l.render(t < 0 ? t : !i && u ? -V : l._dur * l._ease(i / this._dur), e, r) || this._startAt && (this._zTime = t), this._onUpdate && !e && (_ && Ca(this, t, 0, r), Ct(this, "onUpdate")), this._repeat && a !== o && this.vars.onRepeat && !e && this.parent && Ct(this, "onRepeat"), m !== this._tDur && m || this._tTime !== m || (_ && !this._onUpdate && Ca(this, t, 0, !0), !t && p || !(m === this._tDur && 0 < this._ts || !m && this._ts < 0) || za(this, 1), e || _ && !c || !(m || c || u) || (Ct(this, m === d ? "onComplete" : "onReverseComplete", !0), !this._prom || m < d && 0 < this.timeScale() || this._prom())); } } else !function _renderZeroDurationTween(t, e, r, i) { var n, a, s, o = t.ratio, u = e < 0 || !e && (!t._start && function _parentPlayheadIsBeforeStart(t) { var e = t.parent; return e && e._ts && e._initted && !e._lock && (e.rawTime() < 0 || _parentPlayheadIsBeforeStart(e)); }(t) && (t._initted || !bt(t)) || (t._ts < 0 || t._dp._ts < 0) && !bt(t)) ? 0 : 1, h = t._rDelay, l = 0; if (h && t._repeat && (l = kt(0, t._tDur, e), a = Tt(l, h), t._yoyo && 1 & a && (u = 1 - u), a !== Tt(t._tTime, h) && (o = 1 - u, t.vars.repeatRefresh && t._initted && t.invalidate())), u !== o || B || i || t._zTime === V || !e && t._zTime) { if (!t._initted && Ma(t, e, i, r, l)) return; for (s = t._zTime, t._zTime = e || (r ? V : 0), r = r || e && !s, t.ratio = u, t._from && (u = 1 - u), t._time = 0, t._tTime = l, n = t._pt; n;)n.r(u, n.d), n = n._next; e < 0 && Ca(t, e, 0, !0), t._onUpdate && !r && Ct(t, "onUpdate"), l && t._repeat && !r && t.parent && Ct(t, "onRepeat"), (e >= t._tDur || e < 0) && t.ratio === u && (u && za(t, 1), r || B || (Ct(t, u ? "onComplete" : "onReverseComplete", !0), t._prom && t._prom())); } else t._zTime || (t._zTime = e); }(this, t, e, r); return this; }, e.targets = function targets() { return this._targets; }, e.invalidate = function invalidate(t) { return t && this.vars.runBackwards || (this._startAt = 0), this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0, this._ptLookup = [], this.timeline && this.timeline.invalidate(t), z.prototype.invalidate.call(this, t); }, e.resetTo = function resetTo(t, e, r, i) { d || Et.wake(), this._ts || this.play(); var n, a = Math.min(this._dur, (this._dp._time - this._start) * this._ts); return this._initted || Ht(this, a), n = this._ease(a / this._dur), function _updatePropTweens(t, e, r, i, n, a, s) { var o, u, h, l, f = (t._pt && t._ptCache || (t._ptCache = {}))[e]; if (!f) for (f = t._ptCache[e] = [], h = t._ptLookup, l = t._targets.length; l--;) { if ((o = h[l][e]) && o.d && o.d._pt) for (o = o.d._pt; o && o.p !== e && o.fp !== e;)o = o._next; if (!o) return Wt = 1, t.vars[e] = "+=0", Ht(t, s), Wt = 0, 1; f.push(o); } for (l = f.length; l--;)(o = (u = f[l])._pt || u).s = !i && 0 !== i || n ? o.s + (i || 0) + a * o.c : i, o.c = r - o.s, u.e && (u.e = ia(r) + Ya(u.e)), u.b && (u.b = o.s + Ya(u.b)); }(this, t, e, r, i, n, a) ? this.resetTo(t, e, r, i) : (Ia(this, 0), this.parent || xa(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0), this.render(0)); }, e.kill = function kill(t, e) { if (void 0 === e && (e = "all"), !(t || e && "all" !== e)) return this._lazy = this._pt = 0, this.parent ? tb(this) : this; if (this.timeline) { var i = this.timeline.totalDuration(); return this.timeline.killTweensOf(t, e, Vt && !0 !== Vt.vars.overwrite)._first || tb(this), this.parent && i !== this.timeline.totalDuration() && Ra(this, this._dur * this.timeline._tDur / i, 0, 1), this; } var n, a, s, o, u, h, l, f = this._targets, c = t ? Ot(t) : f, d = this._ptLookup, p = this._pt; if ((!e || "all" === e) && function _arraysMatch(t, e) { for (var r = t.length, i = r === e.length; i && r-- && t[r] === e[r];); return r < 0; }(f, c)) return "all" === e && (this._pt = 0), tb(this); for (n = this._op = this._op || [], "all" !== e && (r(e) && (u = {}, ha(e, function (t) { return u[t] = 1; }), e = u), e = function _addAliasesToVars(t, e) { var r, i, n, a, s = t[0] ? fa(t[0]).harness : 0, o = s && s.aliases; if (!o) return e; for (i in r = yt({}, e), o) if (i in r) for (n = (a = o[i].split(",")).length; n--;)r[a[n]] = r[i]; return r; }(f, e)), l = f.length; l--;)if (~c.indexOf(f[l])) for (u in a = d[l], "all" === e ? (n[l] = e, o = a, s = {}) : (s = n[l] = n[l] || {}, o = e), o) (h = a && a[u]) && ("kill" in h.d && !0 !== h.d.kill(u) || ya(this, h, "_pt"), delete a[u]), "all" !== s && (s[u] = 1); return this._initted && !this._pt && p && tb(this), this; }, Tween.to = function to(t, e, r) { return new Tween(t, e, r); }, Tween.from = function from(t, e) { return Va(1, arguments); }, Tween.delayedCall = function delayedCall(t, e, r, i) { return new Tween(e, 0, { immediateRender: !1, lazy: !1, overwrite: !1, delay: t, onComplete: e, onReverseComplete: e, onCompleteParams: r, onReverseCompleteParams: r, callbackScope: i }); }, Tween.fromTo = function fromTo(t, e, r) { return Va(2, arguments); }, Tween.set = function set(t, e) { return e.duration = 0, e.repeatDelay || (e.repeat = 0), new Tween(t, e); }, Tween.killTweensOf = function killTweensOf(t, e, r) { return L.killTweensOf(t, e, r); }, Tween; }(qt); qa(Gt.prototype, { _targets: [], _lazy: 0, _startAt: 0, _op: 0, _onInit: 0 }), ha("staggerTo,staggerFrom,staggerFromTo", function (r) { Gt[r] = function () { var t = new Ut, e = Mt.call(arguments, 0); return e.splice("staggerFromTo" === r ? 5 : 4, 0, 0), t[r].apply(t, e); }; }); function nc(t, e, r) { return t.setAttribute(e, r); } function vc(t, e, r, i) { i.mSet(t, e, i.m.call(i.tween, r, i.mt), i); } var Jt = function _setterPlain(t, e, r) { return t[e] = r; }, $t = function _setterFunc(t, e, r) { return t[e](r); }, ee = function _setterFuncWithParam(t, e, r, i) { return t[e](i.fp, r); }, re = function _getSetter(t, e) { return s(t[e]) ? $t : u(t[e]) && t.setAttribute ? nc : Jt; }, ne = function _renderPlain(t, e) { return e.set(e.t, e.p, Math.round(1e6 * (e.s + e.c * t)) / 1e6, e); }, ae = function _renderBoolean(t, e) { return e.set(e.t, e.p, !!(e.s + e.c * t), e); }, se = function _renderComplexString(t, e) { var r = e._pt, i = ""; if (!t && e.b) i = e.b; else if (1 === t && e.e) i = e.e; else { for (; r;)i = r.p + (r.m ? r.m(r.s + r.c * t) : Math.round(1e4 * (r.s + r.c * t)) / 1e4) + i, r = r._next; i += e.c; } e.set(e.t, e.p, i, e); }, oe = function _renderPropTweens(t, e) { for (var r = e._pt; r;)r.r(t, r.d), r = r._next; }, le = function _addPluginModifier(t, e, r, i) { for (var n, a = this._pt; a;)n = a._next, a.p === i && a.modifier(t, e, r), a = n; }, fe = function _killPropTweensOf(t) { for (var e, r, i = this._pt; i;)r = i._next, i.p === t && !i.op || i.op === t ? ya(this, i, "_pt") : i.dep || (e = 1), i = r; return !e; }, de = function _sortPropTweensByPriority(t) { for (var e, r, i, n, a = t._pt; a;) { for (e = a._next, r = i; r && r.pr > a.pr;)r = r._next; (a._prev = r ? r._prev : n) ? a._prev._next = a : i = a, (a._next = r) ? r._prev = a : n = a, a = e; } t._pt = i; }, pe = (PropTween.prototype.modifier = function modifier(t, e, r) { this.mSet = this.mSet || this.set, this.set = vc, this.m = t, this.mt = r, this.tween = e; }, PropTween); function PropTween(t, e, r, i, n, a, s, o, u) { this.t = e, this.s = i, this.c = n, this.p = r, this.r = a || ne, this.d = s || this, this.set = o || Jt, this.pr = u || 0, (this._next = t) && (t._prev = this); } ha(vt + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function (t) { return ft[t] = 1; }), ot.TweenMax = ot.TweenLite = Gt, ot.TimelineLite = ot.TimelineMax = Ut, L = new Ut({ sortChildren: !1, defaults: q, autoRemoveChildren: !0, id: "root", smoothChildTiming: !0 }), j.stringFilter = Eb; function Cc(t) { return (Te[t] || we).map(function (t) { return t(); }); } function Dc() { var t = Date.now(), o = []; 2 < t - xe && (Cc("matchMediaInit"), ye.forEach(function (t) { var e, r, i, n, a = t.queries, s = t.conditions; for (r in a) (e = h.matchMedia(a[r]).matches) && (i = 1), e !== s[r] && (s[r] = e, n = 1); n && (t.revert(), i && o.push(t)); }), Cc("matchMediaRevert"), o.forEach(function (t) { return t.onMatch(t); }), xe = t, Cc("matchMedia")); } var _e, ye = [], Te = {}, we = [], xe = 0, ke = ((_e = Context.prototype).add = function add(t, i, n) { function Cw() { var t, e = l, r = a.selector; return e && e !== a && e.data.push(a), n && (a.selector = cb(n)), l = a, t = i.apply(a, arguments), s(t) && a._r.push(t), l = e, a.selector = r, a.isReverted = !1, t; } s(t) && (n = i, i = t, t = s); var a = this; return a.last = Cw, t === s ? Cw(a) : t ? a[t] = Cw : Cw; }, _e.ignore = function ignore(t) { var e = l; l = null, t(this), l = e; }, _e.getTweens = function getTweens() { var e = []; return this.data.forEach(function (t) { return t instanceof Context ? e.push.apply(e, t.getTweens()) : t instanceof Gt && !(t.parent && "nested" === t.parent.data) && e.push(t); }), e; }, _e.clear = function clear() { this._r.length = this.data.length = 0; }, _e.kill = function kill(e, t) { var r = this; if (e) { var i = this.getTweens(); this.data.forEach(function (t) { "isFlip" === t.data && (t.revert(), t.getChildren(!0, !0, !1).forEach(function (t) { return i.splice(i.indexOf(t), 1); })); }), i.map(function (t) { return { g: t.globalTime(0), t: t }; }).sort(function (t, e) { return e.g - t.g || -1; }).forEach(function (t) { return t.t.revert(e); }), this.data.forEach(function (t) { return !(t instanceof qt) && t.revert && t.revert(e); }), this._r.forEach(function (t) { return t(e, r); }), this.isReverted = !0; } else this.data.forEach(function (t) { return t.kill && t.kill(); }); if (this.clear(), t) { var n = ye.indexOf(this); ~n && ye.splice(n, 1); } }, _e.revert = function revert(t) { this.kill(t || {}); }, Context); function Context(t, e) { this.selector = e && cb(e), this.data = [], this._r = [], this.isReverted = !1, t && this.add(t); } var Me, Oe = ((Me = MatchMedia.prototype).add = function add(t, e, r) { v(t) || (t = { matches: t }); var i, n, a, s = new ke(0, r || this.scope), o = s.conditions = {}; for (n in this.contexts.push(s), e = s.add("onMatch", e), s.queries = t) "all" === n ? a = 1 : (i = h.matchMedia(t[n])) && (ye.indexOf(s) < 0 && ye.push(s), (o[n] = i.matches) && (a = 1), i.addListener ? i.addListener(Dc) : i.addEventListener("change", Dc)); return a && e(s), this; }, Me.revert = function revert(t) { this.kill(t || {}); }, Me.kill = function kill(e) { this.contexts.forEach(function (t) { return t.kill(e, !0); }); }, MatchMedia); function MatchMedia(t) { this.contexts = [], this.scope = t; } var Pe = { registerPlugin: function registerPlugin() { for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)e[r] = arguments[r]; e.forEach(function (t) { return function _createPlugin(t) { var e = (t = !t.name && t.default || t).name, r = s(t), i = e && !r && t.init ? function () { this._props = []; } : t, n = { init: T, render: oe, add: Xt, kill: fe, modifier: le, rawVars: 0 }, a = { targetTest: 0, get: 0, getSetter: re, aliases: {}, register: 0 }; if (zt(), t !== i) { if (pt[e]) return; qa(i, qa(ua(t, n), a)), yt(i.prototype, yt(n, ua(t, a))), pt[i.prop = e] = i, t.targetTest && (gt.push(i), ft[e] = 1), e = ("css" === e ? "CSS" : e.charAt(0).toUpperCase() + e.substr(1)) + "Plugin"; } S(e, i), t.register && t.register(Ce, i, pe); }(t); }); }, timeline: function timeline(t) { return new Ut(t); }, getTweensOf: function getTweensOf(t, e) { return L.getTweensOf(t, e); }, getProperty: function getProperty(i, t, e, n) { r(i) && (i = Ot(i)[0]); var a = fa(i || {}).get, s = e ? pa : oa; return "native" === e && (e = ""), i ? t ? s((pt[t] && pt[t].get || a)(i, t, e, n)) : function (t, e, r) { return s((pt[t] && pt[t].get || a)(i, t, e, r)); } : i; }, quickSetter: function quickSetter(r, e, i) { if (1 < (r = Ot(r)).length) { var n = r.map(function (t) { return Ce.quickSetter(t, e, i); }), a = n.length; return function (t) { for (var e = a; e--;)n[e](t); }; } r = r[0] || {}; var s = pt[e], o = fa(r), u = o.harness && (o.harness.aliases || {})[e] || e, h = s ? function (t) { var e = new s; c._pt = 0, e.init(r, i ? t + i : t, c, 0, [r]), e.render(1, e), c._pt && oe(1, c); } : o.set(r, u); return s ? h : function (t) { return h(r, u, i ? t + i : t, o, 1); }; }, quickTo: function quickTo(t, i, e) { function Ux(t, e, r) { return n.resetTo(i, t, e, r); } var r, n = Ce.to(t, yt(((r = {})[i] = "+=0.1", r.paused = !0, r), e || {})); return Ux.tween = n, Ux; }, isTweening: function isTweening(t) { return 0 < L.getTweensOf(t, !0).length; }, defaults: function defaults(t) { return t && t.ease && (t.ease = Yt(t.ease, q.ease)), ta(q, t || {}); }, config: function config(t) { return ta(j, t || {}); }, registerEffect: function registerEffect(t) { var i = t.name, n = t.effect, e = t.plugins, a = t.defaults, r = t.extendTimeline; (e || "").split(",").forEach(function (t) { return t && !pt[t] && !ot[t] && R(i + " effect requires " + t + " plugin."); }), _t[i] = function (t, e, r) { return n(Ot(t), qa(e || {}, a), r); }, r && (Ut.prototype[i] = function (t, e, r) { return this.add(_t[i](t, v(e) ? e : (r = e) && {}, this), r); }); }, registerEase: function registerEase(t, e) { Ft[t] = Yt(e); }, parseEase: function parseEase(t, e) { return arguments.length ? Yt(t, e) : Ft; }, getById: function getById(t) { return L.getById(t); }, exportRoot: function exportRoot(t, e) { void 0 === t && (t = {}); var r, i, n = new Ut(t); for (n.smoothChildTiming = w(t.smoothChildTiming), L.remove(n), n._dp = 0, n._time = n._tTime = L._time, r = L._first; r;)i = r._next, !e && !r._dur && r instanceof Gt && r.vars.onComplete === r._targets[0] || Ka(n, r, r._start - r._delay), r = i; return Ka(L, n, 0), n; }, context: function context(t, e) { return t ? new ke(t, e) : l; }, matchMedia: function matchMedia(t) { return new Oe(t); }, matchMediaRefresh: function matchMediaRefresh() { return ye.forEach(function (t) { var e, r, i = t.conditions; for (r in i) i[r] && (i[r] = !1, e = 1); e && t.revert(); }) || Dc(); }, addEventListener: function addEventListener(t, e) { var r = Te[t] || (Te[t] = []); ~r.indexOf(e) || r.push(e); }, removeEventListener: function removeEventListener(t, e) { var r = Te[t], i = r && r.indexOf(e); 0 <= i && r.splice(i, 1); }, utils: { wrap: function wrap(e, t, r) { var i = t - e; return $(e) ? lb(e, wrap(0, e.length), t) : Wa(r, function (t) { return (i + (t - e) % i) % i + e; }); }, wrapYoyo: function wrapYoyo(e, t, r) { var i = t - e, n = 2 * i; return $(e) ? lb(e, wrapYoyo(0, e.length - 1), t) : Wa(r, function (t) { return e + (i < (t = (n + (t - e) % n) % n || 0) ? n - t : t); }); }, distribute: eb, random: hb, snap: gb, normalize: function normalize(t, e, r) { return Pt(t, e, 0, 1, r); }, getUnit: Ya, clamp: function clamp(e, r, t) { return Wa(t, function (t) { return kt(e, r, t); }); }, splitColor: zb, toArray: Ot, selector: cb, mapRange: Pt, pipe: function pipe() { for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)e[r] = arguments[r]; return function (t) { return e.reduce(function (t, e) { return e(t); }, t); }; }, unitize: function unitize(e, r) { return function (t) { return e(parseFloat(t)) + (r || Ya(t)); }; }, interpolate: function interpolate(e, i, t, n) { var a = isNaN(e + i) ? 0 : function (t) { return (1 - t) * e + t * i; }; if (!a) { var s, o, u, h, l, f = r(e), c = {}; if (!0 === t && (n = 1) && (t = null), f) e = { p: e }, i = { p: i }; else if ($(e) && !$(i)) { for (u = [], h = e.length, l = h - 2, o = 1; o < h; o++)u.push(interpolate(e[o - 1], e[o])); h--, a = function func(t) { t *= h; var e = Math.min(l, ~~t); return u[e](t - e); }, t = i; } else n || (e = yt($(e) ? [] : {}, e)); if (!u) { for (s in i) Xt.call(c, e, s, "get", i[s]); a = function func(t) { return oe(t, c) || (f ? e.p : e); }; } } return Wa(t, a); }, shuffle: db }, install: P, effects: _t, ticker: Et, updateRoot: Ut.updateRoot, plugins: pt, globalTimeline: L, core: { PropTween: pe, globals: S, Tween: Gt, Timeline: Ut, Animation: qt, getCache: fa, _removeLinkedListItem: ya, reverting: function reverting() { return B; }, context: function context(t) { return t && l && (l.data.push(t), t._ctx = l), l; }, suppressOverwrites: function suppressOverwrites(t) { return I = t; } } }; ha("to,from,fromTo,delayedCall,set,killTweensOf", function (t) { return Pe[t] = Gt[t]; }), Et.add(Ut.updateRoot), c = Pe.to({}, { duration: 0 }); function Hc(t, e) { for (var r = t._pt; r && r.p !== e && r.op !== e && r.fp !== e;)r = r._next; return r; } function Jc(t, a) { return { name: t, rawVars: 1, init: function init(t, n, e) { e._onInit = function (t) { var e, i; if (r(n) && (e = {}, ha(n, function (t) { return e[t] = 1; }), n = e), a) { for (i in e = {}, n) e[i] = a(n[i]); n = e; } !function _addModifiers(t, e) { var r, i, n, a = t._targets; for (r in e) for (i = a.length; i--;)(n = (n = t._ptLookup[i][r]) && n.d) && (n._pt && (n = Hc(n, r)), n && n.modifier && n.modifier(e[r], t, a[i], r)); }(t, n); }; } }; } var Ce = Pe.registerPlugin({ name: "attr", init: function init(t, e, r, i, n) { var a, s, o; for (a in this.tween = r, e) o = t.getAttribute(a) || "", (s = this.add(t, "setAttribute", (o || 0) + "", e[a], i, n, 0, 0, a)).op = a, s.b = o, this._props.push(a); }, render: function render(t, e) { for (var r = e._pt; r;)B ? r.set(r.t, r.p, r.b, r) : r.r(t, r.d), r = r._next; } }, { name: "endArray", init: function init(t, e) { for (var r = e.length; r--;)this.add(t, r, t[r] || 0, e[r], 0, 0, 0, 0, 0, 1); } }, Jc("roundProps", fb), Jc("modifiers"), Jc("snap", gb)) || Pe; Gt.version = Ut.version = Ce.version = "3.11.4", o = 1, x() && zt(); function td(t, e) { return e.set(e.t, e.p, Math.round(1e4 * (e.s + e.c * t)) / 1e4 + e.u, e); } function ud(t, e) { return e.set(e.t, e.p, 1 === t ? e.e : Math.round(1e4 * (e.s + e.c * t)) / 1e4 + e.u, e); } function vd(t, e) { return e.set(e.t, e.p, t ? Math.round(1e4 * (e.s + e.c * t)) / 1e4 + e.u : e.b, e); } function wd(t, e) { var r = e.s + e.c * t; e.set(e.t, e.p, ~~(r + (r < 0 ? -.5 : .5)) + e.u, e); } function xd(t, e) { return e.set(e.t, e.p, t ? e.e : e.b, e); } function yd(t, e) { return e.set(e.t, e.p, 1 !== t ? e.b : e.e, e); } function zd(t, e, r) { return t.style[e] = r; } function Ad(t, e, r) { return t.style.setProperty(e, r); } function Bd(t, e, r) { return t._gsap[e] = r; } function Cd(t, e, r) { return t._gsap.scaleX = t._gsap.scaleY = r; } function Dd(t, e, r, i, n) { var a = t._gsap; a.scaleX = a.scaleY = r, a.renderTransform(n, a); } function Ed(t, e, r, i, n) { var a = t._gsap; a[e] = r, a.renderTransform(n, a); } function Hd(t, e) { var r = this, i = this.target, n = i.style; if (t in rr) { if (this.tfm = this.tfm || {}, "transform" !== t && (~(t = hr[t] || t).indexOf(",") ? t.split(",").forEach(function (t) { return r.tfm[t] = mr(i, t); }) : this.tfm[t] = i._gsap.x ? i._gsap[t] : mr(i, t)), 0 <= this.props.indexOf(lr)) return; i._gsap.svg && (this.svgo = i.getAttribute("data-svg-origin"), this.props.push(fr, e, "")), t = lr; } (n || e) && this.props.push(t, e, n[t]); } function Id(t) { t.translate && (t.removeProperty("translate"), t.removeProperty("scale"), t.removeProperty("rotate")); } function Jd() { var t, e, r = this.props, i = this.target, n = i.style, a = i._gsap; for (t = 0; t < r.length; t += 3)r[t + 1] ? i[r[t]] = r[t + 2] : r[t + 2] ? n[r[t]] = r[t + 2] : n.removeProperty(r[t].replace(sr, "-$1").toLowerCase()); if (this.tfm) { for (e in this.tfm) a[e] = this.tfm[e]; a.svg && (a.renderTransform(), i.setAttribute("data-svg-origin", this.svgo || "")), !(t = Fe()) || t.isStart || n[lr] || (Id(n), a.uncache = 1); } } function Kd(t, e) { var r = { target: t, props: [], revert: Jd, save: Hd }; return e && e.split(",").forEach(function (t) { return r.save(t); }), r; } function Md(t, e) { var r = Se.createElementNS ? Se.createElementNS((e || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), t) : Se.createElement(t); return r.style ? r : Se.createElement(t); } function Nd(t, e, r) { var i = getComputedStyle(t); return i[e] || i.getPropertyValue(e.replace(sr, "-$1").toLowerCase()) || i.getPropertyValue(e) || !r && Nd(t, dr(e) || e, 1) || ""; } function Qd() { (function _windowExists() { return "undefined" != typeof window; })() && window.document && (Ae = window, Se = Ae.document, Re = Se.documentElement, Ee = Md("div") || { style: {} }, Md("div"), lr = dr(lr), fr = lr + "Origin", Ee.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0", Ie = !!dr("perspective"), Fe = Ce.core.reverting, De = 1); } function Rd(t) { var e, r = Md("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), i = this.parentNode, n = this.nextSibling, a = this.style.cssText; if (Re.appendChild(r), r.appendChild(this), this.style.display = "block", t) try { e = this.getBBox(), this._gsapBBox = this.getBBox, this.getBBox = Rd; } catch (t) { } else this._gsapBBox && (e = this._gsapBBox()); return i && (n ? i.insertBefore(this, n) : i.appendChild(this)), Re.removeChild(r), this.style.cssText = a, e; } function Sd(t, e) { for (var r = e.length; r--;)if (t.hasAttribute(e[r])) return t.getAttribute(e[r]); } function Td(e) { var r; try { r = e.getBBox(); } catch (t) { r = Rd.call(e, !0); } return r && (r.width || r.height) || e.getBBox === Rd || (r = Rd.call(e, !0)), !r || r.width || r.x || r.y ? r : { x: +Sd(e, ["x", "cx", "x1"]) || 0, y: +Sd(e, ["y", "cy", "y1"]) || 0, width: 0, height: 0 }; } function Ud(t) { return !(!t.getCTM || t.parentNode && !t.ownerSVGElement || !Td(t)); } function Vd(t, e) { if (e) { var r = t.style; e in rr && e !== fr && (e = lr), r.removeProperty ? ("ms" !== e.substr(0, 2) && "webkit" !== e.substr(0, 6) || (e = "-" + e), r.removeProperty(e.replace(sr, "-$1").toLowerCase())) : r.removeAttribute(e); } } function Wd(t, e, r, i, n, a) { var s = new pe(t._pt, e, r, 0, 1, a ? yd : xd); return (t._pt = s).b = i, s.e = n, t._props.push(r), s; } function Zd(t, e, r, i) { var n, a, s, o, u = parseFloat(r) || 0, h = (r + "").trim().substr((u + "").length) || "px", l = Ee.style, f = or.test(e), c = "svg" === t.tagName.toLowerCase(), d = (c ? "client" : "offset") + (f ? "Width" : "Height"), p = "px" === i, _ = "%" === i; return i === h || !u || pr[i] || pr[h] ? u : ("px" === h || p || (u = Zd(t, e, r, "px")), o = t.getCTM && Ud(t), !_ && "%" !== h || !rr[e] && !~e.indexOf("adius") ? (l[f ? "width" : "height"] = 100 + (p ? h : i), a = ~e.indexOf("adius") || "em" === i && t.appendChild && !c ? t : t.parentNode, o && (a = (t.ownerSVGElement || {}).parentNode), a && a !== Se && a.appendChild || (a = Se.body), (s = a._gsap) && _ && s.width && f && s.time === Et.time && !s.uncache ? ia(u / s.width * 100) : (!_ && "%" !== h || _r[Nd(a, "display")] || (l.position = Nd(t, "position")), a === t && (l.position = "static"), a.appendChild(Ee), n = Ee[d], a.removeChild(Ee), l.position = "absolute", f && _ && ((s = fa(a)).time = Et.time, s.width = a[d]), ia(p ? n * u / 100 : n && u ? 100 / n * u : 0))) : (n = o ? t.getBBox()[f ? "width" : "height"] : t[d], ia(_ ? u / n * 100 : u / 100 * n))); } function _d(t, e, r, i) { if (!r || "none" === r) { var n = dr(e, t, 1), a = n && Nd(t, n, 1); a && a !== r ? (e = n, r = a) : "borderColor" === e && (r = Nd(t, "borderTopColor")); } var s, o, u, h, l, f, c, d, p, _, m, g = new pe(this._pt, t.style, e, 0, 1, se), v = 0, y = 0; if (g.b = r, g.e = i, r += "", "auto" === (i += "") && (t.style[e] = i, i = Nd(t, e) || i, t.style[e] = r), Eb(s = [r, i]), i = s[1], u = (r = s[0]).match(rt) || [], (i.match(rt) || []).length) { for (; o = rt.exec(i);)c = o[0], p = i.substring(v, o.index), l ? l = (l + 1) % 5 : "rgba(" !== p.substr(-5) && "hsla(" !== p.substr(-5) || (l = 1), c !== (f = u[y++] || "") && (h = parseFloat(f) || 0, m = f.substr((h + "").length), "=" === c.charAt(1) && (c = ka(h, c) + m), d = parseFloat(c), _ = c.substr((d + "").length), v = rt.lastIndex - _.length, _ || (_ = _ || j.units[e] || m, v === i.length && (i += _, g.e += _)), m !== _ && (h = Zd(t, e, f, _) || 0), g._pt = { _next: g._pt, p: p || 1 === y ? p : ",", s: h, c: d - h, m: l && l < 4 || "zIndex" === e ? Math.round : 0 }); g.c = v < i.length ? i.substring(v, i.length) : ""; } else g.r = "display" === e && "none" === i ? yd : xd; return nt.test(i) && (g.e = 0), this._pt = g; } function be(t) { var e = t.split(" "), r = e[0], i = e[1] || "50%"; return "top" !== r && "bottom" !== r && "left" !== i && "right" !== i || (t = r, r = i, i = t), e[0] = gr[r] || r, e[1] = gr[i] || i, e.join(" "); } function ce(t, e) { if (e.tween && e.tween._time === e.tween._dur) { var r, i, n, a = e.t, s = a.style, o = e.u, u = a._gsap; if ("all" === o || !0 === o) s.cssText = "", i = 1; else for (n = (o = o.split(",")).length; -1 < --n;)r = o[n], rr[r] && (i = 1, r = "transformOrigin" === r ? fr : lr), Vd(a, r); i && (Vd(a, lr), u && (u.svg && a.removeAttribute("transform"), br(a, 1), u.uncache = 1, Id(s))); } } function ge(t) { return "matrix(1, 0, 0, 1, 0, 0)" === t || "none" === t || !t; } function he(t) { var e = Nd(t, lr); return ge(e) ? yr : e.substr(7).match(et).map(ia); } function ie(t, e) { var r, i, n, a, s = t._gsap || fa(t), o = t.style, u = he(t); return s.svg && t.getAttribute("transform") ? "1,0,0,1,0,0" === (u = [(n = t.transform.baseVal.consolidate().matrix).a, n.b, n.c, n.d, n.e, n.f]).join(",") ? yr : u : (u !== yr || t.offsetParent || t === Re || s.svg || (n = o.display, o.display = "block", (r = t.parentNode) && t.offsetParent || (a = 1, i = t.nextElementSibling, Re.appendChild(t)), u = he(t), n ? o.display = n : Vd(t, "display"), a && (i ? r.insertBefore(t, i) : r ? r.appendChild(t) : Re.removeChild(t))), e && 6 < u.length ? [u[0], u[1], u[4], u[5], u[12], u[13]] : u); } function je(t, e, r, i, n, a) { var s, o, u, h = t._gsap, l = n || ie(t, !0), f = h.xOrigin || 0, c = h.yOrigin || 0, d = h.xOffset || 0, p = h.yOffset || 0, _ = l[0], m = l[1], g = l[2], v = l[3], y = l[4], T = l[5], b = e.split(" "), w = parseFloat(b[0]) || 0, x = parseFloat(b[1]) || 0; r ? l !== yr && (o = _ * v - m * g) && (u = w * (-m / o) + x * (_ / o) - (_ * T - m * y) / o, w = w * (v / o) + x * (-g / o) + (g * T - v * y) / o, x = u) : (w = (s = Td(t)).x + (~b[0].indexOf("%") ? w / 100 * s.width : w), x = s.y + (~(b[1] || b[0]).indexOf("%") ? x / 100 * s.height : x)), i || !1 !== i && h.smooth ? (y = w - f, T = x - c, h.xOffset = d + (y * _ + T * g) - y, h.yOffset = p + (y * m + T * v) - T) : h.xOffset = h.yOffset = 0, h.xOrigin = w, h.yOrigin = x, h.smooth = !!i, h.origin = e, h.originIsAbsolute = !!r, t.style[fr] = "0px 0px", a && (Wd(a, h, "xOrigin", f, w), Wd(a, h, "yOrigin", c, x), Wd(a, h, "xOffset", d, h.xOffset), Wd(a, h, "yOffset", p, h.yOffset)), t.setAttribute("data-svg-origin", w + " " + x); } function me(t, e, r) { var i = Ya(e); return ia(parseFloat(e) + parseFloat(Zd(t, "x", r + "px", i))) + i; } function te(t, e, i, n, a) { var s, o, u = 360, h = r(a), l = parseFloat(a) * (h && ~a.indexOf("rad") ? ir : 1) - n, f = n + l + "deg"; return h && ("short" === (s = a.split("_")[1]) && (l %= u) !== l % 180 && (l += l < 0 ? u : -u), "cw" === s && l < 0 ? l = (l + 36e9) % u - ~~(l / u) * u : "ccw" === s && 0 < l && (l = (l - 36e9) % u - ~~(l / u) * u)), t._pt = o = new pe(t._pt, e, i, n, l, ud), o.e = f, o.u = "deg", t._props.push(i), o; } function ue(t, e) { for (var r in e) t[r] = e[r]; return t; } function ve(t, e, r) { var i, n, a, s, o, u, h, l = ue({}, r._gsap), f = r.style; for (n in l.svg ? (a = r.getAttribute("transform"), r.setAttribute("transform", ""), f[lr] = e, i = br(r, 1), Vd(r, lr), r.setAttribute("transform", a)) : (a = getComputedStyle(r)[lr], f[lr] = e, i = br(r, 1), f[lr] = a), rr) (a = l[n]) !== (s = i[n]) && "perspective,force3D,transformOrigin,svgOrigin".indexOf(n) < 0 && (o = Ya(a) !== (h = Ya(s)) ? Zd(r, n, a, h) : parseFloat(a), u = parseFloat(s), t._pt = new pe(t._pt, i, n, o, u - o, td), t._pt.u = h || 0, t._props.push(n)); ue(i, l); } var Ae, Se, Re, De, Ee, ze, Fe, Ie, Be = Ft.Power0, Le = Ft.Power1, Ye = Ft.Power2, Ne = Ft.Power3, qe = Ft.Power4, Ue = Ft.Linear, Ve = Ft.Quad, We = Ft.Cubic, Xe = Ft.Quart, He = Ft.Quint, Qe = Ft.Strong, Ke = Ft.Elastic, Ze = Ft.Back, Ge = Ft.SteppedEase, Je = Ft.Bounce, $e = Ft.Sine, tr = Ft.Expo, er = Ft.Circ, rr = {}, ir = 180 / Math.PI, nr = Math.PI / 180, ar = Math.atan2, sr = /([A-Z])/g, or = /(left|right|width|margin|padding|x)/i, ur = /[\s,\(]\S/, hr = { autoAlpha: "opacity,visibility", scale: "scaleX,scaleY", alpha: "opacity" }, lr = "transform", fr = lr + "Origin", cr = "O,Moz,ms,Ms,Webkit".split(","), dr = function _checkPropPrefix(t, e, r) { var i = (e || Ee).style, n = 5; if (t in i && !r) return t; for (t = t.charAt(0).toUpperCase() + t.substr(1); n-- && !(cr[n] + t in i);); return n < 0 ? null : (3 === n ? "ms" : 0 <= n ? cr[n] : "") + t; }, pr = { deg: 1, rad: 1, turn: 1 }, _r = { grid: 1, flex: 1 }, mr = function _get(t, e, r, i) { var n; return De || Qd(), e in hr && "transform" !== e && ~(e = hr[e]).indexOf(",") && (e = e.split(",")[0]), rr[e] && "transform" !== e ? (n = br(t, i), n = "transformOrigin" !== e ? n[e] : n.svg ? n.origin : wr(Nd(t, fr)) + " " + n.zOrigin + "px") : (n = t.style[e]) && "auto" !== n && !i && !~(n + "").indexOf("calc(") || (n = vr[e] && vr[e](t, e, r) || Nd(t, e) || ga(t, e) || ("opacity" === e ? 1 : 0)), r && !~(n + "").trim().indexOf(" ") ? Zd(t, e, n, r) + r : n; }, gr = { top: "0%", bottom: "100%", left: "0%", right: "100%", center: "50%" }, vr = { clearProps: function clearProps(t, e, r, i, n) { if ("isFromStart" !== n.data) { var a = t._pt = new pe(t._pt, e, r, 0, 0, ce); return a.u = i, a.pr = -10, a.tween = n, t._props.push(r), 1; } } }, yr = [1, 0, 0, 1, 0, 0], Tr = {}, br = function _parseTransform(t, e) { var r = t._gsap || new jt(t); if ("x" in r && !e && !r.uncache) return r; var i, n, a, s, o, u, h, l, f, c, d, p, _, m, g, v, y, T, b, w, x, k, M, O, P, C, A, S, R, D, E, z, F = t.style, I = r.scaleX < 0, B = "deg", L = getComputedStyle(t), Y = Nd(t, fr) || "0"; return i = n = a = u = h = l = f = c = d = 0, s = o = 1, r.svg = !(!t.getCTM || !Ud(t)), L.translate && ("none" === L.translate && "none" === L.scale && "none" === L.rotate || (F[lr] = ("none" !== L.translate ? "translate3d(" + (L.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + ("none" !== L.rotate ? "rotate(" + L.rotate + ") " : "") + ("none" !== L.scale ? "scale(" + L.scale.split(" ").join(",") + ") " : "") + ("none" !== L[lr] ? L[lr] : "")), F.scale = F.rotate = F.translate = "none"), m = ie(t, r.svg), r.svg && (O = r.uncache ? (P = t.getBBox(), Y = r.xOrigin - P.x + "px " + (r.yOrigin - P.y) + "px", "") : !e && t.getAttribute("data-svg-origin"), je(t, O || Y, !!O || r.originIsAbsolute, !1 !== r.smooth, m)), p = r.xOrigin || 0, _ = r.yOrigin || 0, m !== yr && (T = m[0], b = m[1], w = m[2], x = m[3], i = k = m[4], n = M = m[5], 6 === m.length ? (s = Math.sqrt(T * T + b * b), o = Math.sqrt(x * x + w * w), u = T || b ? ar(b, T) * ir : 0, (f = w || x ? ar(w, x) * ir + u : 0) && (o *= Math.abs(Math.cos(f * nr))), r.svg && (i -= p - (p * T + _ * w), n -= _ - (p * b + _ * x))) : (z = m[6], D = m[7], A = m[8], S = m[9], R = m[10], E = m[11], i = m[12], n = m[13], a = m[14], h = (g = ar(z, R)) * ir, g && (O = k * (v = Math.cos(-g)) + A * (y = Math.sin(-g)), P = M * v + S * y, C = z * v + R * y, A = k * -y + A * v, S = M * -y + S * v, R = z * -y + R * v, E = D * -y + E * v, k = O, M = P, z = C), l = (g = ar(-w, R)) * ir, g && (v = Math.cos(-g), E = x * (y = Math.sin(-g)) + E * v, T = O = T * v - A * y, b = P = b * v - S * y, w = C = w * v - R * y), u = (g = ar(b, T)) * ir, g && (O = T * (v = Math.cos(g)) + b * (y = Math.sin(g)), P = k * v + M * y, b = b * v - T * y, M = M * v - k * y, T = O, k = P), h && 359.9 < Math.abs(h) + Math.abs(u) && (h = u = 0, l = 180 - l), s = ia(Math.sqrt(T * T + b * b + w * w)), o = ia(Math.sqrt(M * M + z * z)), g = ar(k, M), f = 2e-4 < Math.abs(g) ? g * ir : 0, d = E ? 1 / (E < 0 ? -E : E) : 0), r.svg && (O = t.getAttribute("transform"), r.forceCSS = t.setAttribute("transform", "") || !ge(Nd(t, lr)), O && t.setAttribute("transform", O))), 90 < Math.abs(f) && Math.abs(f) < 270 && (I ? (s *= -1, f += u <= 0 ? 180 : -180, u += u <= 0 ? 180 : -180) : (o *= -1, f += f <= 0 ? 180 : -180)), e = e || r.uncache, r.x = i - ((r.xPercent = i && (!e && r.xPercent || (Math.round(t.offsetWidth / 2) === Math.round(-i) ? -50 : 0))) ? t.offsetWidth * r.xPercent / 100 : 0) + "px", r.y = n - ((r.yPercent = n && (!e && r.yPercent || (Math.round(t.offsetHeight / 2) === Math.round(-n) ? -50 : 0))) ? t.offsetHeight * r.yPercent / 100 : 0) + "px", r.z = a + "px", r.scaleX = ia(s), r.scaleY = ia(o), r.rotation = ia(u) + B, r.rotationX = ia(h) + B, r.rotationY = ia(l) + B, r.skewX = f + B, r.skewY = c + B, r.transformPerspective = d + "px", (r.zOrigin = parseFloat(Y.split(" ")[2]) || 0) && (F[fr] = wr(Y)), r.xOffset = r.yOffset = 0, r.force3D = j.force3D, r.renderTransform = r.svg ? Cr : Ie ? Pr : xr, r.uncache = 0, r; }, wr = function _firstTwoOnly(t) { return (t = t.split(" "))[0] + " " + t[1]; }, xr = function _renderNon3DTransforms(t, e) { e.z = "0px", e.rotationY = e.rotationX = "0deg", e.force3D = 0, Pr(t, e); }, kr = "0deg", Mr = "0px", Or = ") ", Pr = function _renderCSSTransforms(t, e) { var r = e || this, i = r.xPercent, n = r.yPercent, a = r.x, s = r.y, o = r.z, u = r.rotation, h = r.rotationY, l = r.rotationX, f = r.skewX, c = r.skewY, d = r.scaleX, p = r.scaleY, _ = r.transformPerspective, m = r.force3D, g = r.target, v = r.zOrigin, y = "", T = "auto" === m && t && 1 !== t || !0 === m; if (v && (l !== kr || h !== kr)) { var b, w = parseFloat(h) * nr, x = Math.sin(w), k = Math.cos(w); w = parseFloat(l) * nr, b = Math.cos(w), a = me(g, a, x * b * -v), s = me(g, s, -Math.sin(w) * -v), o = me(g, o, k * b * -v + v); } _ !== Mr && (y += "perspective(" + _ + Or), (i || n) && (y += "translate(" + i + "%, " + n + "%) "), !T && a === Mr && s === Mr && o === Mr || (y += o !== Mr || T ? "translate3d(" + a + ", " + s + ", " + o + ") " : "translate(" + a + ", " + s + Or), u !== kr && (y += "rotate(" + u + Or), h !== kr && (y += "rotateY(" + h + Or), l !== kr && (y += "rotateX(" + l + Or), f === kr && c === kr || (y += "skew(" + f + ", " + c + Or), 1 === d && 1 === p || (y += "scale(" + d + ", " + p + Or), g.style[lr] = y || "translate(0, 0)"; }, Cr = function _renderSVGTransforms(t, e) { var r, i, n, a, s, o = e || this, u = o.xPercent, h = o.yPercent, l = o.x, f = o.y, c = o.rotation, d = o.skewX, p = o.skewY, _ = o.scaleX, m = o.scaleY, g = o.target, v = o.xOrigin, y = o.yOrigin, T = o.xOffset, b = o.yOffset, w = o.forceCSS, x = parseFloat(l), k = parseFloat(f); c = parseFloat(c), d = parseFloat(d), (p = parseFloat(p)) && (d += p = parseFloat(p), c += p), c || d ? (c *= nr, d *= nr, r = Math.cos(c) * _, i = Math.sin(c) * _, n = Math.sin(c - d) * -m, a = Math.cos(c - d) * m, d && (p *= nr, s = Math.tan(d - p), n *= s = Math.sqrt(1 + s * s), a *= s, p && (s = Math.tan(p), r *= s = Math.sqrt(1 + s * s), i *= s)), r = ia(r), i = ia(i), n = ia(n), a = ia(a)) : (r = _, a = m, i = n = 0), (x && !~(l + "").indexOf("px") || k && !~(f + "").indexOf("px")) && (x = Zd(g, "x", l, "px"), k = Zd(g, "y", f, "px")), (v || y || T || b) && (x = ia(x + v - (v * r + y * n) + T), k = ia(k + y - (v * i + y * a) + b)), (u || h) && (s = g.getBBox(), x = ia(x + u / 100 * s.width), k = ia(k + h / 100 * s.height)), s = "matrix(" + r + "," + i + "," + n + "," + a + "," + x + "," + k + ")", g.setAttribute("transform", s), w && (g.style[lr] = s); }; ha("padding,margin,Width,Radius", function (e, r) { var t = "Right", i = "Bottom", n = "Left", o = (r < 3 ? ["Top", t, i, n] : ["Top" + n, "Top" + t, i + t, i + n]).map(function (t) { return r < 2 ? e + t : "border" + t + e; }); vr[1 < r ? "border" + e : e] = function (e, t, r, i, n) { var a, s; if (arguments.length < 4) return a = o.map(function (t) { return mr(e, t, r); }), 5 === (s = a.join(" ")).split(a[0]).length ? a[0] : s; a = (i + "").split(" "), s = {}, o.forEach(function (t, e) { return s[t] = a[e] = a[e] || a[(e - 1) / 2 | 0]; }), e.init(t, s, n); }; }); var Ar, Sr, Rr, Dr = { name: "css", register: Qd, targetTest: function targetTest(t) { return t.style && t.nodeType; }, init: function init(t, e, i, n, a) { var s, o, u, h, l, f, c, d, p, _, m, g, v, y, T, b, w = this._props, x = t.style, k = i.vars.startAt; for (c in De || Qd(), this.styles = this.styles || Kd(t), b = this.styles.props, this.tween = i, e) if ("autoRound" !== c && (o = e[c], !pt[c] || !_b(c, e, i, n, t, a))) if (l = typeof o, f = vr[c], "function" === l && (l = typeof (o = o.call(i, n, t, a))), "string" === l && ~o.indexOf("random(") && (o = ob(o)), f) f(this, t, c, o, i) && (T = 1); else if ("--" === c.substr(0, 2)) s = (getComputedStyle(t).getPropertyValue(c) + "").trim(), o += "", Rt.lastIndex = 0, Rt.test(s) || (d = Ya(s), p = Ya(o)), p ? d !== p && (s = Zd(t, c, s, p) + p) : d && (o += d), this.add(x, "setProperty", s, o, n, a, 0, 0, c), w.push(c), b.push(c, 0, x[c]); else if ("undefined" !== l) { if (k && c in k ? (s = "function" == typeof k[c] ? k[c].call(i, n, t, a) : k[c], r(s) && ~s.indexOf("random(") && (s = ob(s)), Ya(s + "") || (s += j.units[c] || Ya(mr(t, c)) || ""), "=" === (s + "").charAt(1) && (s = mr(t, c))) : s = mr(t, c), h = parseFloat(s), (_ = "string" === l && "=" === o.charAt(1) && o.substr(0, 2)) && (o = o.substr(2)), u = parseFloat(o), c in hr && ("autoAlpha" === c && (1 === h && "hidden" === mr(t, "visibility") && u && (h = 0), b.push("visibility", 0, x.visibility), Wd(this, x, "visibility", h ? "inherit" : "hidden", u ? "inherit" : "hidden", !u)), "scale" !== c && "transform" !== c && ~(c = hr[c]).indexOf(",") && (c = c.split(",")[0])), m = c in rr) if (this.styles.save(c), g || ((v = t._gsap).renderTransform && !e.parseTransform || br(t, e.parseTransform), y = !1 !== e.smoothOrigin && v.smooth, (g = this._pt = new pe(this._pt, x, lr, 0, 1, v.renderTransform, v, 0, -1)).dep = 1), "scale" === c) this._pt = new pe(this._pt, v, "scaleY", v.scaleY, (_ ? ka(v.scaleY, _ + u) : u) - v.scaleY || 0, td), this._pt.u = 0, w.push("scaleY", c), c += "X"; else { if ("transformOrigin" === c) { b.push(fr, 0, x[fr]), o = be(o), v.svg ? je(t, o, 0, y, 0, this) : ((p = parseFloat(o.split(" ")[2]) || 0) !== v.zOrigin && Wd(this, v, "zOrigin", v.zOrigin, p), Wd(this, x, c, wr(s), wr(o))); continue; } if ("svgOrigin" === c) { je(t, o, 1, y, 0, this); continue; } if (c in Tr) { te(this, v, c, h, _ ? ka(h, _ + o) : o); continue; } if ("smoothOrigin" === c) { Wd(this, v, "smooth", v.smooth, o); continue; } if ("force3D" === c) { v[c] = o; continue; } if ("transform" === c) { ve(this, o, t); continue; } } else c in x || (c = dr(c) || c); if (m || (u || 0 === u) && (h || 0 === h) && !ur.test(o) && c in x) u = u || 0, (d = (s + "").substr((h + "").length)) !== (p = Ya(o) || (c in j.units ? j.units[c] : d)) && (h = Zd(t, c, s, p)), this._pt = new pe(this._pt, m ? v : x, c, h, (_ ? ka(h, _ + u) : u) - h, m || "px" !== p && "zIndex" !== c || !1 === e.autoRound ? td : wd), this._pt.u = p || 0, d !== p && "%" !== p && (this._pt.b = s, this._pt.r = vd); else if (c in x) _d.call(this, t, c, s, _ ? _ + o : o); else if (c in t) this.add(t, c, s || t[c], _ ? _ + o : o, n, a); else if ("parseTransform" !== c) { Q(c, o); continue; } m || (c in x ? b.push(c, 0, x[c]) : b.push(c, 1, s || t[c])), w.push(c); } T && de(this); }, render: function render(t, e) { if (e.tween._time || !Fe()) for (var r = e._pt; r;)r.r(t, r.d), r = r._next; else e.styles.revert(); }, get: mr, aliases: hr, getSetter: function getSetter(t, e, r) { var i = hr[e]; return i && i.indexOf(",") < 0 && (e = i), e in rr && e !== fr && (t._gsap.x || mr(t, "x")) ? r && ze === r ? "scale" === e ? Cd : Bd : (ze = r || {}) && ("scale" === e ? Dd : Ed) : t.style && !u(t.style[e]) ? zd : ~e.indexOf("-") ? Ad : re(t, e); }, core: { _removeProperty: Vd, _getMatrix: ie } }; Ce.utils.checkPrefix = dr, Ce.core.getStyleSaver = Kd, Rr = ha((Ar = "x,y,z,scale,scaleX,scaleY,xPercent,yPercent") + "," + (Sr = "rotation,rotationX,rotationY,skewX,skewY") + ",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", function (t) { rr[t] = 1; }), ha(Sr, function (t) { j.units[t] = "deg", Tr[t] = 1; }), hr[Rr[13]] = Ar + "," + Sr, ha("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY", function (t) { var e = t.split(":"); hr[e[1]] = Rr[e[0]]; }), ha("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function (t) { j.units[t] = "px"; }), Ce.registerPlugin(Dr); var Er = Ce.registerPlugin(Dr) || Ce, zr = Er.core.Tween; e.Back = Ze, e.Bounce = Je, e.CSSPlugin = Dr, e.Circ = er, e.Cubic = We, e.Elastic = Ke, e.Expo = tr, e.Linear = Ue, e.Power0 = Be, e.Power1 = Le, e.Power2 = Ye, e.Power3 = Ne, e.Power4 = qe, e.Quad = Ve, e.Quart = Xe, e.Quint = He, e.Sine = $e, e.SteppedEase = Ge, e.Strong = Qe, e.TimelineLite = Ut, e.TimelineMax = Ut, e.TweenLite = Gt, e.TweenMax = zr, e.default = Er, e.gsap = Er; if (typeof (window) === "undefined" || window !== e) { Object.defineProperty(e, "__esModule", { value: !0 }); } else { delete e.default; } }); 11 | --------------------------------------------------------------------------------