From 03be615422c771b45e7489083ac2a6cf6229366b Mon Sep 17 00:00:00 2001 From: floopy <113854184+floopy37@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:34:48 -0300 Subject: [PATCH] Auto parameter fetcher --- Init.js | 111 +++++++++++++++++------------------- contentScript.js | 8 +-- editorMenu.js | 25 ++++++-- manifest.json | 3 +- parameter_search/main.py | 88 ++++++++++++++++++++++++++++ parameter_search/pulsus.txt | 1 + 6 files changed, 165 insertions(+), 71 deletions(-) create mode 100644 parameter_search/main.py create mode 100644 parameter_search/pulsus.txt diff --git a/Init.js b/Init.js index 2acd69c..8cffbea 100644 --- a/Init.js +++ b/Init.js @@ -1,49 +1,51 @@ function completeSetup() { - Object.defineProperty(globalThis, 'calcLevelStars', { get: () => {return Bn},set: (val) => {Bn = val}}); - Object.defineProperty(globalThis, 'clevels', { get: () => {return Rt},set: (val) => {Rt = val}}); - Object.defineProperty(globalThis, 'copyLevel', { get: () => {return Mo},set: (val) => {Mo = val}}); - Object.defineProperty(globalThis, 'copyObject', { get: () => {return X},set: (val) => {X = val}}); - // Object.defineProperty(globalThis, 'fitText', { get: () => {return Dt},set: (val) => {Dt = val}}); - Object.defineProperty(globalThis, 'game', { get: () => {return Tt},set: (val) => {Tt = val}}); - Object.defineProperty(globalThis, 'getLevelDownloadState', { get: () => {return qo},set: (val) => {qo = val}}); - // Object.defineProperty(globalThis, 'img', { get: () => {return St},set: (val) => {St = val}}); - Object.defineProperty(globalThis, 'lang', { get: () => {return Pt},set: (val) => {Pt = val}}); - // Object.defineProperty(globalThis, 'langList', { get: () => {return U},set: (val) => {U = val}}); - Object.defineProperty(globalThis, 'langSel', { get: () => {return xt},set: (val) => {xt = val}}); - Object.defineProperty(globalThis, 'langs', { get: () => {return F},set: (val) => {F = val}}); - Object.defineProperty(globalThis, 'levels', { get: () => {return Ht},set: (val) => {Ht = val}}); - Object.defineProperty(globalThis, 'lvlHowl', { get: () => {return Qt},set: (val) => {Qt = val}}); - Object.defineProperty(globalThis, 'menu', { get: () => {return Bt},set: (val) => {Bt = val}}); - Object.defineProperty(globalThis, 'menuMusic', { get: () => {return to},set: (val) => {to = val}}); - Object.defineProperty(globalThis, 'musicManager', { get: () => {return cs},set: (val) => {cs = val}}); // This name is wrong - Object.defineProperty(globalThis, 'nav', { get: () => {return c},set: (val) => {c = val}}); // This name is wrong - Object.defineProperty(globalThis, 'newGrabLevelMeta', { get: () => {return H},set: (val) => {H = val}}); - Object.defineProperty(globalThis, 'newGrabLevel', { get: () => {return m},set: (val) => {m = val}}); - Object.defineProperty(globalThis, 'screen', { get: () => {return He},set: (val) => {He = val}}); - Object.defineProperty(globalThis, 'theme', { get: () => {return $},set: (val) => {$ = val}}); - Object.defineProperty(globalThis, 'themes', { get: () => {return qe},set: (val) => {qe = val}}); - Object.defineProperty(globalThis, 'toLoad', { get: () => {return Ne},set: (val) => {Ne = val}}); - Object.defineProperty(globalThis, 'user', { get: () => {return T},set: (val) => {T = val}}); - Object.defineProperty(globalThis, 'welcome', { get: () => {return s},set: (val) => {s = val}}); - Object.defineProperty(globalThis, 'newGrabUser', { get: () => {return Ut},set: (val) => {Ut = val}}); - Object.defineProperty(globalThis, 'drawScreens', { get: () => {return gs},set: (val) => {gs = val}}); // This is wrong - Object.defineProperty(globalThis, 'clickMenu', { get: () => {return fs},set: (val) => {fs = val}}); // This is wrong - Object.defineProperty(globalThis, 'ease', { get: () => {return At},set: (val) => {At = val}}); - Object.defineProperty(globalThis, 'editorAction', { get: () => {return kn},set: (val) => {kn = val}}); - Object.defineProperty(globalThis, 'executePlay', { get: () => {return en},set: (val) => {en = val}}); - Object.defineProperty(globalThis, 'hitbox', { get: () => {return Ft},set: (val) => {Ft = val}}); - Object.defineProperty(globalThis, 'loadLevel', { get: () => {return qi},set: (val) => {qi = val}}); - // Object.defineProperty(globalThis, 'loadStartScreens', { get: () => {return Cs},set: (val) => {Cs = val}}); // This is wrong - Object.defineProperty(globalThis, 'newSettingsMenu', { get: () => {return Jo},set: (val) => {Jo = val}}); - Object.defineProperty(globalThis, 'promptRes', { get: () => {return ki},set: (val) => {ki = val}}); - // Object.defineProperty(globalThis, 'prmpt', { get: () => {return Ri},set: (val) => {Ri = val}}); - Object.defineProperty(globalThis, 'popupMessage', { get: () => {return Gn},set: (val) => {Gn = val}}); // This is wrong - Object.defineProperty(globalThis, 'prmpting', { get: () => {return g},set: (val) => {g = val}}); - Object.defineProperty(globalThis, 'saveGameData', { get: () => {return Qn},set: (val) => {Qn = val}}); - Object.defineProperty(globalThis, 'server', { get: () => {return v},set: (val) => {v = val}}); - Object.defineProperty(globalThis, 'prmptingString', { get: () => {return Nt},set: (val) => {Nt = val}}); - Object.defineProperty(globalThis, 'scrollTimeline', { get: () => {return qn},set: (val) => {qn = val}}); // This is wrong - game.pulseHax = {params: {}}; + Object.defineProperty(globalThis, 'calcLevelStars', {get:()=>{ return Bn },set:(val)=>{ Bn =val}}); + Object.defineProperty(globalThis, 'clevels', {get:()=>{ return Rt },set:(val)=>{ Rt =val}}); + Object.defineProperty(globalThis, 'clickMenu', {get:()=>{ return fs },set:(val)=>{ fs =val}}); + Object.defineProperty(globalThis, 'copyLevel', {get:()=>{ return Mo },set:(val)=>{ Mo =val}}); + Object.defineProperty(globalThis, 'copyObject', {get:()=>{ return X },set:(val)=>{ X =val}}); + Object.defineProperty(globalThis, 'drawScreens', {get:()=>{ return gs },set:(val)=>{ gs =val}}); + Object.defineProperty(globalThis, 'ease', {get:()=>{ return At },set:(val)=>{ At =val}}); + Object.defineProperty(globalThis, 'editorAction', {get:()=>{ return kn },set:(val)=>{ kn =val}}); + Object.defineProperty(globalThis, 'executePlay', {get:()=>{ return en },set:(val)=>{ en =val}}); + Object.defineProperty(globalThis, 'fitText', {get:()=>{ return Dt },set:(val)=>{ Dt =val}}); + Object.defineProperty(globalThis, 'game', {get:()=>{ return Tt },set:(val)=>{ Tt =val}}); + Object.defineProperty(globalThis, 'getLevelDownloadState', {get:()=>{ return qo },set:(val)=>{ qo =val}}); + Object.defineProperty(globalThis, 'getObject', {get:()=>{ return te },set:(val)=>{ te =val}}); + Object.defineProperty(globalThis, 'hitbox', {get:()=>{ return Ft },set:(val)=>{ Ft =val}}); + Object.defineProperty(globalThis, 'img', {get:()=>{ return St },set:(val)=>{ St =val}}); + Object.defineProperty(globalThis, 'lang', {get:()=>{ return Pt },set:(val)=>{ Pt =val}}); + Object.defineProperty(globalThis, 'langList', {get:()=>{ return U },set:(val)=>{ U =val}}); + Object.defineProperty(globalThis, 'langSel', {get:()=>{ return xt },set:(val)=>{ xt =val}}); + Object.defineProperty(globalThis, 'langs', {get:()=>{ return F },set:(val)=>{ F =val}}); + Object.defineProperty(globalThis, 'levels', {get:()=>{ return Ht },set:(val)=>{ Ht =val}}); + Object.defineProperty(globalThis, 'loadLevel', {get:()=>{ return qi },set:(val)=>{ qi =val}}); + Object.defineProperty(globalThis, 'loadStartScreens', {get:()=>{ return Cs },set:(val)=>{ Cs =val}}); + Object.defineProperty(globalThis, 'lvlHowl', {get:()=>{ return Qt },set:(val)=>{ Qt =val}}); + Object.defineProperty(globalThis, 'matrix', {get:()=>{ return zt },set:(val)=>{ zt =val}}); + Object.defineProperty(globalThis, 'menu', {get:()=>{ return Bt },set:(val)=>{ Bt =val}}); + Object.defineProperty(globalThis, 'menuMusic', {get:()=>{ return to },set:(val)=>{ to =val}}); + Object.defineProperty(globalThis, 'musicManager', {get:()=>{ return cs },set:(val)=>{ cs =val}}); + Object.defineProperty(globalThis, 'nav', {get:()=>{ return c },set:(val)=>{ c =val}}); + Object.defineProperty(globalThis, 'newGrabLevel', {get:()=>{ return m },set:(val)=>{ m =val}}); + Object.defineProperty(globalThis, 'newGrabLevelMeta', {get:()=>{ return H },set:(val)=>{ H =val}}); + Object.defineProperty(globalThis, 'newGrabUser', {get:()=>{ return Ut },set:(val)=>{ Ut =val}}); + Object.defineProperty(globalThis, 'newSettingsMenu', {get:()=>{ return Jo },set:(val)=>{ Jo =val}}); + Object.defineProperty(globalThis, 'popupMessage', {get:()=>{ return Gn },set:(val)=>{ Gn =val}}); + Object.defineProperty(globalThis, 'prmpt', {get:()=>{ return Ri },set:(val)=>{ Ri =val}}); + Object.defineProperty(globalThis, 'prmpting', {get:()=>{ return g },set:(val)=>{ g =val}}); + Object.defineProperty(globalThis, 'prmptingString', {get:()=>{ return Nt },set:(val)=>{ Nt =val}}); + Object.defineProperty(globalThis, 'promptRes', {get:()=>{ return ki },set:(val)=>{ ki =val}}); + Object.defineProperty(globalThis, 'saveGameData', {get:()=>{ return Qn },set:(val)=>{ Qn =val}}); + Object.defineProperty(globalThis, 'screen', {get:()=>{ return He },set:(val)=>{ He =val}}); + Object.defineProperty(globalThis, 'scrollTimeline', {get:()=>{ return qn },set:(val)=>{ qn =val}}); + Object.defineProperty(globalThis, 'server', {get:()=>{ return v },set:(val)=>{ v =val}}); + Object.defineProperty(globalThis, 'theme', {get:()=>{ return $ },set:(val)=>{ $ =val}}); + Object.defineProperty(globalThis, 'themes', {get:()=>{ return qe },set:(val)=>{ qe =val}}); + Object.defineProperty(globalThis, 'toLoad', {get:()=>{ return Ne },set:(val)=>{ Ne =val}}); + Object.defineProperty(globalThis, 'user', {get:()=>{ return T },set:(val)=>{ T =val}}); + Object.defineProperty(globalThis, 'welcome', {get:()=>{ return s },set:(val)=>{ s =val}}); + game.pulseHax = {}; window.dispatchEvent(new CustomEvent('SetupComplete')); }; eval(` @@ -91,9 +93,11 @@ window.addEventListener("SetupComplete", function() { game.rgbToHex = function(r, g, b) { return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1); } - game.pulseHax.params.NSMItem = newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().indexOf(`.type`)-2] === "=" ? + game.pulseHax.params = { + NSMItem: newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().indexOf(`.type`)-2] === "=" ? newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().indexOf(`.type`)-1] : - newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().indexOf(`.type`)-1] + newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().search(`.type`)-2] + newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().indexOf(`.type`)-1] + newSettingsMenu.prototype.draw.toString()[newSettingsMenu.prototype.draw.toString().search(`.type`)-2], + }; const themeNames = { theme_addt_gufo: "Gufo's theme", theme_addt_floopy: "Floopy's theme", @@ -269,19 +273,6 @@ window.addEventListener("SetupComplete", function() { game.menuNSM.pages[0].items[10].event.toString() .slice(0, -1) + ",game.mods.hidden=false}" }; - newSettingsMenu.prototype.draw = ${ - newSettingsMenu.prototype.draw.toString() - .replace(`hue:e.hue,`, `hue:e.hue, after: e.after,`) - .replace(`open}})`, `open; if(!game.pulseHax.dropdownClosed) { - let interval = setInterval(() => { - if(e.animation.height === 0) { - clearInterval(interval); - e.after?.(); - } - }, 500) - }; game.pulseHax.dropdownClosed = false}})`) - .replace(`${game.pulseHax.params.NSMItem}.animation.height=0,`, `(${game.pulseHax.params.NSMItem}.animation.height = 0, game.pulseHax.dropdownClosed = false),`) - }; saveGameData = function${ saveGameData.toString() .replace('{', `{ diff --git a/contentScript.js b/contentScript.js index a1a239a..cd1ed12 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3,12 +3,12 @@ initScript.src = chrome.runtime.getURL(`Init.js`); initScript.onload = function() { this.remove(); }; -let phDraw = document.createElement('script'); -phDraw.src = chrome.runtime.getURL(`editorMenu.js`); -phDraw.onload = function() { +let editorMenu = document.createElement('script'); +editorMenu.src = chrome.runtime.getURL(`editorMenu.js`); +editorMenu.onload = function() { this.remove(); }; -(document.documentElement || document.head).append(initScript, phDraw); +(document.documentElement || document.head).append(initScript, editorMenu); chrome.storage.onChanged.addListener(function(changes, areaName) { if(areaName === "local" && Object.hasOwn(changes, "CustomTheme")) { diff --git a/editorMenu.js b/editorMenu.js index e8f40b9..6cdd761 100644 --- a/editorMenu.js +++ b/editorMenu.js @@ -556,9 +556,22 @@ window.addEventListener("SetupComplete", function() { game.selectBeats = function(condition, options) { if(condition === "current") { if(options === "checkCurrent") { - return game.beat.filter((b) => game.timelineTickFor(b[1]) === Math.round(game.timelineTickFor(game.time) / game.snap) * game.snap).map((b) => game.beat.indexOf(b)).length === 0; - }; - game.beat.filter((b) => game.timelineTickFor(b[1]) === Math.round(game.timelineTickFor(game.time) / game.snap) * game.snap).map((b) => game.beat.indexOf(b)).forEach((b) => { + return game.beat.filter((b) => { + if(!game.playing) { + return game.timelineTickFor(b[1]) === round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap; + } else { + return game.timelineTickFor(b[1]) <= round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap + game.snap/2 && game.timelineTickFor(b[1]) >= round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap - game.snap/2; + } + } + ).map((b) => game.beat.indexOf(b)).length === 0}; + game.beat.filter((b) => { + if(!game.playing) { + return game.timelineTickFor(b[1]) === round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap; + } else { + return game.timelineTickFor(b[1]) <= round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap + game.snap/2 && game.timelineTickFor(b[1]) >= round(game.timelineTickFor(game.time) / game.snap, 6) * game.snap - game.snap/2; + } + } + ).map((b) => game.beat.indexOf(b)).forEach((b) => { if(game.selectedBeats.includes(b)) { game.selectedBeats.splice(game.selectedBeats.indexOf(b), 1) } else { @@ -644,14 +657,14 @@ game.selectBeats = function(condition, options) { else if(predescescor !== undefined && successor !== undefined) { // Check for stream end if(!options.selectStreamEnd) { - if(round(beatTime + snapSelect, 5) !== round(game.timelineTickFor(successor[1]), 5)) { + if(round(beatTime + snapSelect, 6) !== round(game.timelineTickFor(successor[1]), 6)) { return false; } } // Check if it is snapped - if(round(game.timelineTickFor(predescescor[1]) + snapSelect, 5) !== round(beatTime, 5) - && round(game.timelineTickFor(successor[1]) - snapSelect, 5) !== round(beatTime, 5)) { + if(round(game.timelineTickFor(predescescor[1]) + snapSelect, 6) !== round(beatTime, 6) + && round(game.timelineTickFor(successor[1]) - snapSelect, 6) !== round(beatTime, 6)) { return false; } }; diff --git a/manifest.json b/manifest.json index 3147743..93a25d2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "PulseHax", - "version": "0.11.1-2", + "version": "0.11.2", "description": "Hacking pulsus has never been so easy", "permissions": ["storage"], "host_permissions": ["https://pulsus.cc/*","https://www.pulsus.cc/*"], @@ -13,6 +13,7 @@ "resources": [ "/Init.js", "/editorMenu.js", + "/colorBankMenu.js", "/assets/game/icon.ico", "/assets/audio/retry.wav", "/assets/audio/scroll.wav", diff --git a/parameter_search/main.py b/parameter_search/main.py new file mode 100644 index 0000000..de47ef7 --- /dev/null +++ b/parameter_search/main.py @@ -0,0 +1,88 @@ +import os.path +import re +import pyperclip + +def main() -> None: + print("Starting") + pulsus_txt = os.path.join(os.path.dirname(os.path.abspath(__file__)), "pulsus.txt") + file = open(pulsus_txt, "r", encoding="utf8") + file = file.read() + + def get_variable(search: str = "") -> str: + is_double = False + result = re.search(f"..{search}", file) + if(result == None): + is_double = True + result = re.search(f".{search}", file) + if(result == None): + raise ValueError(f"Invalid parameter(s) used for ${search}") + result = result.group(0) + return result[1 if result[0] == " " or result[0] == "," else 0 : 2 if not is_double else 3] + + def get_function(param_length: int = 0, start_search: str = "") -> str: + is_double = False + result = re.search(f"..\({','.join(['.' for i in range(param_length)])}\)" + "{" + f"{start_search}", file) + if(result == None): + is_double = True + result = re.search(f".\({','.join(['.' for i in range(param_length)])}\)" + "{" + f"{start_search}", file) + if(result == None): + raise ValueError(f"Invalid parameter(s) used for {start_search}") + result = result.group(0) + return result[0 if result[0] != " " else 1 : 2 if not is_double else 3] + names = { + "calcLevelStars": get_function(1, "if\(!0===.\.local\)"), + "clevels": get_variable('\[..\.lvl.sel\]'), + "clickMenu": get_function(0, '\}mouse'), + "copyLevel": get_function(1, '..\.saved\[..\.saved.length\]=\{\};var .=..\.saved.length-1;..\.saved\[.\]\.local=!0,..\.saved\[.\]\.copy'), + "copyObject": get_function(1, 'if\(void 0!==.\)return JSON'), + "drawScreens": get_function(0, '..\(\),"click"'), + "ease": get_function(3, 'return Number\.isNaN'), + "editorAction": get_function(1, '"objType"'), + "executePlay": get_function(0, 'var .=..\.timelineBPM/..\.bpm;!1'), + "fitText": get_function(6, '..\.n=..'), + "game": get_variable('\.selectedBeats'), + "getLevelDownloadState": get_function(1, 'return void 0===.\.newGrabbedLevels'), + "getObject": get_function(1, 'for\(var .=.\[0\]'), + "hitbox": get_function(7, 'if\(void 0!==.'), + "img": get_variable('\.contributorBadge'), + "lang": get_function(7, '.=.\[..\?"en":.\]'), + "langList": get_function(1, 'for\(var .="",.'), + "langSel": get_variable('="en"'), + "langs": get_variable('\[..\?"en"'), + "levels": get_variable('\.localOffsets'), + "loadLevel": get_function(3, 'if\("new"!==.'), + "loadStartScreens": get_function(0, 'background\(255\);var'), + "lvlHowl": get_variable('\[..\.lvl\.prevPlay\]'), + "matrix": get_variable('\.get\(\)\.x'), + "menu": get_variable('\.lvl\.sel'), + "menuMusic": get_function(0, 'soundManager.setup\(\{onready'), + "musicManager": get_function(0, 'var .,.;0===..\.disMode'), + "nav": get_function(0, 'imageMode\(CORNER\),..'), + "newGrabLevel": get_function(3, 'var .=\{id:0'), + "newGrabLevelMeta": get_function(2, 'var .=\{id:0'), + "newGrabUser": get_function(2, 'var .=\{uuid'), + "newSettingsMenu": get_function(1, 'for\(var .=0;.<.\.length;.\+\+\)for\(var .=0;.<.\[.\]\.items'), + "popupMessage": get_function(1, '..\.push\(\{type'), + "prmpt": get_function(1, 'var .;..\.active'), + "prmpting": get_variable(' of ..\.beat'), + "prmptingString": get_variable('\.inp=..\.inp'), + "promptRes": get_function(1, 'null!==\(.="submit"'), + "saveGameData": get_function(0, 'localStorage.setItem'), + "screen": get_variable(',..,..,..,.=..\.newHits'), + "scrollTimeline": get_function(3, 'var .=..\.timelineBPM/..\.bpm'), + "server": get_variable('\.userStatus\[.\]\[1\]<.'), + "theme": get_variable('=\{main'), + "themes": get_variable('=\[\{main'), + "toLoad": get_variable('="hidden",.\.finishFade'), + "user": get_variable('.uuid=.\.uuid\}\)'), + "welcome": get_variable('\.textA\),textSize\(100\)') + } + parameters: str = "" + for i in names: + parameters += "Object.defineProperty(globalThis, '" + i + "', {get:()=>{ return " + names[i] + " },set:(val)=>{ " + names[i] + " =val}});" + ("\n" if i != "welcome" else "") + print(parameters) + if input("Copy to clipboard?"): + pyperclip.copy(parameters) + +if(__name__ == "__main__"): + main() \ No newline at end of file diff --git a/parameter_search/pulsus.txt b/parameter_search/pulsus.txt new file mode 100644 index 0000000..48ed838 --- /dev/null +++ b/parameter_search/pulsus.txt @@ -0,0 +1 @@ +var n="login",r="",h="",a="";function onSubmit(i){return new Promise(function(e,t){"login"==n?B("newLogin",{email:r,pass:h,token:i}):"reg"==n&&B("newSignup",{user:a,email:r,pass:h,token:i}),grecaptcha.reset(),e()})}function e(e,t){var i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",e),document.createEvent?((t=document.createEvent("MouseEvents")).initEvent("click",!0,!0),i.dispatchEvent(t)):i.click()}var o=io(),Vt=0;function Mt(){return xe?0:navigator.userAgent.match(new RegExp("firefox","i"))?33*Vt:Vt}function p(){open("https://discord.gg/B77pTZp")}function b(){open("https://www.patreon.com/tetrogem")}function t(e){open(e)}function x(e){return!0}window.addEventListener("wheel",e=>{Vt=e.deltaY,e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()},{passive:!1});var w,l,qt=!1,f=!1,d=!1,C=!1,y=!1,E=!1,P=!1,S=!1,Zt=!1,jt=!1,R=!1,k=!1,Gt=!1,N=!1,Q=!1,Yt=!1,I=!1,A=!1,F=(window.addEventListener("keydown",e=>{"F11"!==e.code&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());var t=window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey;if(!_o.active)if(ft.pressed.push(e),ft.pressedTime=millis(),e.code,"ScrollLock"==e.code&&(e.preventDefault(),y=!0),t&&"KeyC"==e.code&&(e.preventDefault(),Zt=!0),t&&"KeyV"==e.code&&(e.preventDefault(),jt=!0),t&&"KeyA"==e.code&&(e.preventDefault(),I=!0),N=t,"Pause"==e.code&&(e.preventDefault(),P=!0),8==e.keyCode&&(R=!0,e.preventDefault()),46==e.keyCode&&(k=!0,e.preventDefault()),Gt=e.shiftKey,Yt=e.altKey,"AltGraph"===e.key&&(Q=!0),t&&"KeyX"==e.code&&(e.preventDefault(),A=!0),"PrintScreen"==e.code&&(e.preventDefault(),d=!0),t&&"KeyQ"==e.code&&(e.preventDefault(),f=!0),t&&83==e.keyCode&&(e.preventDefault(),qt=!0),"Escape"===e.code&&(Le=!0),Nt.active)"Enter"===e.key||"NumpadEnter"===e.key?ki("submit"):"ArrowLeft"===e.key?!1===Nt.anchor&&Gt?(Nt.anchor=Nt.cursor,Nt.cursor--,Gt=!1):!1===Nt.anchor||Gt?Nt.cursor--:(Nt.cursor=Nt.cursor>Nt.anchor?Nt.anchor:Nt.cursor,Nt.anchor=!1):"ArrowRight"===e.key?!1===Nt.anchor&&Gt?(Nt.anchor=Nt.cursor,Nt.cursor++,Gt=!1):!1===Nt.anchor||Gt?Nt.cursor++:(Nt.cursor=Nt.cursor{if(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),"ScrollLock"==t.code&&(t.preventDefault(),E=!0),"Pause"==t.code&&(t.preventDefault(),S=!0),"PrintScreen"==t.code&&(t.preventDefault(),C=!0),ft.pressed=ft.pressed.filter(e=>e.key!==t.key),ft.pressedTime=!1,"ShiftLeft"!==t.code&&"ShiftRight"!==t.code||(Gt=!1),"ControlLeft"!==t.code&&"ControlRight"!==t.code||(N=!1),"AltRight"!==t.code&&"AltGraph"!==t.key||(Q=!1),"AltLeft"!==t.code&&"AltRight"!==t.code||(Yt=!1),1===Tt.disMode&&!Tt.edit&&!Tt.replay.on&&!Tt.mods.auto)for(var e=0;e{Yt=Q=N=Gt=!1}),document.addEventListener("contextmenu",e=>e.preventDefault()),window.onbeforeunload=function(e){if(!We.client||We.client&&!Be)return(e=e||window.event)&&(e.returnValue="Are you sure you want to leave this page?"),"Are you sure you want to leave this page?"},{}),D={};function X(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))}function Jt(e,t){return F[Qe?"en":t]?.[e]??F.en[e]}function Pt(e,t,i,o,n,s,r){t=F[Qe?"en":t];return t?(t[e]??F.en[e])?.replace("`1`",i).replace("`2`",o).replace("`3`",n).replace("`4`",s).replace("`5`",r)??"[NOTFOUND]"+e:"Loading..."}function W(e,t,i,o,n){if(t+="C",void 0===e)return Pt("menu_account_countryUndefined",xt);void 0===D[t]||void 0===D[t][e]||void 0===D[t][e].name?s="Invalid Country":null==(s=Qe?s:D[t][e].name)&&(s=D.enC[e].name);for(var s,r=s.split(""),h=null,a=0;are.sizeLimit?Gn({type:"error",message:"file_tooLarge",keys:[ie(e.size),ie(re.sizeLimit)]}):re.success(e))}};function B(e,t){v.queueType.unshift(e),v.queueData.unshift(t)}function G(){if(100{Tt.submittedScore=e}),{saved:[],scores:[],onlineScores:[],search:[],localOffsets:[],onlineOffsets:[],savedDiffReq:[]}),O={saved:[],search:[]},We={client:!1},Ue=!0,Le=!1,Ke=0,$t=!1,Rt=[],z=0,Ve=0,kt=0,Me=[],$={},qe=[],Ze=[],Nt={active:!1,inp:"",title:"",buttonHover:[0,0],fade:0,check:!1,variable:0,allowEmptyString:!1,afterPrmpt:0,vSet:"",i:0,m:0,password:!1,cursor:0,anchor:!1},g={active:!1,title:"",buttonHover:[0,0],fade:0,variable:[],hsbNSM:{},rgbNSM:{},afterPrmpt:0,currentColor:0,hue:0,saturation:0,brightness:0,red:0,green:0,blue:0,alpha:0,loops:0,smooth:!1,old:{hue:0,saturation:0,brightness:0,red:0,green:0,blue:0,alpha:0,loops:0,smooth:!1,mode:!1},hex:"#00000000"},Qt=[0],je=[0],Ge=[0],ei=!1,ti=!1,Ye="",Rt=[],Je={n:"",b:"",i:"",c:""},_e={},$e="",et=!1,tt=!1,it=0,ot="normal",nt="string",st=0,rt=0,ht={},at=[],lt=[],dt=!1,gt=4,ct=!1,ft={pressed:[],pressedTime:!1,pressedRepeatStartTime:600,pressedRepeatDelay:35};function ut(){var e;return!1!==Bt.lvl.sel?"number"==typeof(e=Rt[Bt.lvl.sel])?v.newGrabbedLevels[e]:e:null}const vt={sections:[],callback:null,active:!1,trans:0,buttonHover:[],computeSections(){this.sections.length=0;var e=ut();if(e){var t=e.sections??[];0!==t[0]?.time&&this.sections.push({name:Pt("start",xt),startMS:0});for(const i of t)i.visible&&this.sections.push({name:i.name,startMS:i.time/e.bpm*60*1e3});this.sections.push({name:Pt("end",xt),startMS:0})}}};function mt(){return{x:0,y:0,w:1,h:1,r:0}}function pt(){this.data=[mt()],this.cache=mt()}function bt(e){e.hsbGrid=createGraphics(512,512,P2D),e.brightnessSlider=createGraphics(512,64,P2D),e.redSlider=createGraphics(512,64,P2D),e.greenSlider=createGraphics(512,64,P2D),e.blueSlider=createGraphics(512,64,P2D),e.alphaSlider=createGraphics(512,64,P2D),e.hsbGrid.noStroke(),e.hsbGrid.colorMode(HSB);for(var t=0;t<512;t++)for(var i=0;i<512;i++)e.hsbGrid.fill(t/512*360,i/512*100,100),e.hsbGrid.rect(t,i,1,1);e.brightnessSlider.noStroke(),e.brightnessSlider.colorMode(HSB);for(t=0;t<512;t++)e.brightnessSlider.fill(0,0,t/512*100),e.brightnessSlider.rect(t,0,1,64);e.redSlider.noStroke(),e.redSlider.colorMode(RGB);for(t=0;t<512;t++)e.redSlider.fill(t/512*255,0,0),e.redSlider.rect(t,0,1,64);e.greenSlider.noStroke(),e.greenSlider.colorMode(RGB);for(t=0;t<512;t++)e.greenSlider.fill(0,t/512*255,0),e.greenSlider.rect(t,0,1,64);e.blueSlider.noStroke(),e.blueSlider.colorMode(RGB);for(t=0;t<512;t++)e.blueSlider.fill(0,0,t/512*255),e.blueSlider.rect(t,0,1,64);e.alphaSlider.noStroke(),e.alphaSlider.colorMode(RGB);for(t=0;t<64;t++)for(i=0;i<4;i++)e.alphaSlider.fill((t+i)%2==0?color(30):color(10)),e.alphaSlider.rect(8*t,16*i,8,16);for(t=0;t<512;t++)e.alphaSlider.fill(255,255,255,t/512*255),e.alphaSlider.rect(t,0,1,64)}function ee(e,t){for(var i=e[0],o=(o=e[1]).split("."),n=1;nt&&pmouseXi&&pmouseYheight?width/64:height/64,l=(rectMode(CORNER),fill(10),rect(o,n,s,r,a),fill($.text),textAlign(LEFT,TOP),Dt(i,o,n-r-a/2,s,r),""),i=255;if(0===e.length&&(e=t,i=127.5),"password"===h)for(var d=0;dendTime&&(endTime=Tt.beat[e][1]):1===Tt.beat[e][5]&&Tt.beat[e][1]+Tt.beat[e][6]>endTime&&(endTime=Tt.beat[e][1]+Tt.beat[e][6]);return endTime+2*(Tt.ar-1e-5<=e[1]);for(const d of Tt.effects)d.time-=l;for(const c of Tt.sections)c.time-=l;Tt.songOffset+=Tt.mods.startPos}if(0!==Tt.mods.endPos){const f=Tt.bpm*((Tt.mods.endPos-Tt.mods.startPos)/Tt.mods.bpm/1e3/60);Tt.beat=Tt.beat.filter(e=>e[1]<=1e-5+f)}}if(Tt.timeEnd=Mi(),Tt.scoreMax=100*Tt.beat.length*10,Tt.ar=Tt.bpm/60/2*Tt.oldAr,Tt.arInit=Tt.ar,Tt.hw=Tt.bpm/60/2*Tt.hw,"new"===t&&(Rt=Uo(Ht.saved,"dateDesc"),Bt.lvl.searchSent=!1),void 0===Tt.gameVersion||Tt.gameVersion<4)for(n=0;nheight?width/64:height/64,fill($.overlayShade),rect(kt,height/16+kt,width/3*1.5,height/3,kt),rectMode(CORNER),fill($.text),"Loading..."!==Ut(e,"uuid").pp&&void 0!==Ut(e,"uuid").pp&&Wt(_t(Ut(e,"uuid").pp),"stretch",2*kt,height/16+2*kt,(width>height?height:width)/3-2*kt,(width>height?height:width)/3-2*kt),"self"===t&&(Ft("rcorner",2*kt,height/16+2*kt,(width>height?height:width)/3-2*kt,(width>height?height:width)/3-2*kt)?Bt.account.self.ppFade+=At(1,Bt.account.self.ppFade,.2):Bt.account.self.ppFade+=At(0,Bt.account.self.ppFade,.2),noStroke(),fill(0,200*Bt.account.self.ppFade),rect(2*kt,height/16+2*kt,(width>height?height:width)/3-2*kt,(width>height?height:width)/3-2*kt),fill(255,200*Bt.account.self.ppFade),textAlign(CENTER,CENTER),Dt(Pt("menu_account_changePP",xt),2*kt+((width>height?height:width)/3-2*kt)/2,height/16+2*kt+((width>height?height:width)/3-2*kt)/2,(width>height?height:width)/3-4*kt,(width>height?height:width)/3-4*kt)),fill(0,200),strokeWeight(kt/2),ellipseMode(CENTER),stroke($.overlayShade),v.newGUUnix[e]-Ut(e,"uuid").online<4?fill(0,255,0):fill(200),ellipse(2*kt+(width>height?height:width)/3-2*kt-2*kt/4,height/16+2*kt+(width>height?height:width)/3-2*kt-2*kt/4,2*kt,2*kt),noStroke(),fill($.text),textAlign(LEFT,CENTER),Dt(Ut(e,"uuid").user+"\n#"+Ut(e,"uuid").rank+" "+Pt("performancePoints",xt,floor(100*Tn(e))/100),3*kt+(width>height?height:width)/3-2*kt,height/16+kt+(width>height?height:width)/3/4*1.5,width/3*1.5-(width>height?height:width)/3-2*kt,(width>height?height:width)/3/2/2),"Loading..."!==Ut(e,"uuid").country&&Dt(W(Ut(e,"uuid").country,xt),3*kt+(width>height?height:width)/3-2*kt,height/16+kt+(width>height?height:width)/3/4*3,width/3*1.5-(width>height?height:width)/3-2*kt,(width>height?height:width)/3/4/1.5);Dt(v.newGUUnix[e]-Ut(e,"uuid").online<15?"game"===Ut(e,"uuid").statusScreen[0]?"local"!==Ut(e,"uuid").statusScreen[1]?Pt("menu_account_status_gameOnline",xt,H(Ut(e,"uuid").statusScreen[1],"id").title,void 0!==Ut(H(Ut(e,"uuid").statusScreen[1],"id").author,"uuid").user?Ut(H(Ut(e,"uuid").statusScreen[1],"id").author,"uuid").user:Pt("defaultUsername",xt),Ut(e,"uuid").statusScreen[1]):Pt("menu_account_status_gameLocal",xt):"edit"===Ut(e,"uuid").statusScreen[0]?Pt("menu_account_status_edit",xt):Pt("menu_account_status_menu",xt):(i="menu_account_status_lastOnline_seconds",60<=(o=w-Ut(e,"uuid").online)&&(i="menu_account_status_lastOnline_minutes",60<=(o/=60))&&(i="menu_account_status_lastOnline_hours",24<=(o/=60))&&(i="menu_account_status_lastOnline_days",30.5<=(o/=24))&&(o/=30.5,i="menu_account_status_lastOnline_months"),Pt("menu_account_status_lastOnline",xt,floor(o),Pt(i,xt))),3*kt+(width>height?height:width)/3-2*kt,height/16+kt+(width>height?height:width)/3/4*3+1.5*kt,width/3*1.5-(width>height?height:width)/3-2*kt,(width>height?height:width)/3/4/1.5/2),"self"===t&&(Ft("rcorner",3*kt+(width>height?height:width)/3-2*kt,height/16+kt+(width>height?height:width)/3/4*3-(width>height?height:width)/3/4/1.5/2,width/3*1.5-(width>height?height:width)/3-2*kt,(width>height?height:width)/3/4/1.5)?Bt.account.self.countryFade+=At(1,Bt.account.self.countryFade,.2):Bt.account.self.countryFade+=At(0,Bt.account.self.countryFade,.2),fill(0,200*Bt.account.self.countryFade),rect(3*kt+(width>height?height:width)/3-2*kt,height/16+kt+(width>height?height:width)/3/4*3-(width>height?height:width)/3/4/1.5/2,width/3*1.5-(width>height?height:width)/3-2*kt,(width>height?height:width)/3/4/1.5),textAlign(CENTER,CENTER),fill(255,255*Bt.account.self.countryFade),Dt(Pt("menu_account_changeCountry",xt),3*kt+(width>height?height:width)/3-2*kt+(width/3*1.5-(width>height?height:width)/3-2*kt)/2,height/16+kt+(width>height?height:width)/3/4*3-(width>height?height:width)/3/4/1.5/2+(width>height?height:width)/3/4/1.5/2,width/3*1.5-(width>height?height:width)/3-4*kt,(width>height?height:width)/3/4/1.5/1.5)),!0===Ut(e,"uuid").contributor&&(fill(0,255,0),image(St.contributorBadge,kt+width/3*1.5-2.5*kt*(Ut(e,"uuid").patreon>w?2:1),height/16+kt+height/3-2.5*kt,2*kt,2*kt)),Ut(e,"uuid").patreon>w&&(fill(0,255,0),image(St.platinumBadge,kt+width/3*1.5-2.5*kt,height/16+kt+height/3-2.5*kt,2*kt,2*kt)),fill($.overlayShade),rect(kt,height/16+2*kt+height/3,width/3*1.5,height/3*2-height/16-3*kt,kt),fill($.text),textAlign(LEFT,TOP),textSize(kt);var i,o=Ut(e,"uuid"),n=(void 0!==o?.bio?text('"'+o.bio+'"',2*kt,height/16+3*kt+height/3,width/3*1.5-2*kt,height/3*2-height/16-5*kt):(textAlign(CENTER,CENTER),Dt(Pt("menu_account_noBio",xt),kt+width/3*1.5/2,height/16+2*kt+height/3+(height/3*2-height/16-3*kt-3*kt)/2,width/3*1.5/1.5,kt)),"self"===t&&(Ft("rcorner",kt,height/16+2*kt+height/3,width/3*1.5,height/3*2-height/16-3*kt-3*kt)?Bt.account.self.bioFade+=At(1,Bt.account.self.bioFade,.2):Bt.account.self.bioFade+=At(0,Bt.account.self.bioFade,.2),fill(0,200*Bt.account.self.bioFade),rect(kt,height/16+2*kt+height/3,width/3*1.5,height/3*2-height/16-3*kt-3*kt,kt,kt,0,0),fill(255,255*Bt.account.self.bioFade),textAlign(CENTER,CENTER),Dt(Pt("menu_account_changeBio",xt),kt+width/3*1.5/2,height/16+2*kt+height/3+(height/3*2-height/16-3*kt-3*kt)/2,width/3*1.5/1.5,(height/3*2-height/16-3*kt-3*kt)/1.5)),fill($.main),rect(kt,height-4*kt,width/3*1.5,kt),textAlign(LEFT,CENTER),fill($.text),Dt(Pt("menu_account_joinedSince",xt,void 0===o?.joined?Pt("menu_account_unknownJoinDate",xt):fo(new Date(1e3*o.joined).toUTCString().slice(5,16))),2*kt,height-2*kt,width/3*1.5,kt),fill($.overlayShade),rect(2*kt+width/3*1.5,height/16+kt,width/3.5,height-height/16-2*kt,kt),pn(e,"user")),s=0;if("Loading..."!==n&&"no scores"!==n){for(var r=0;rs&&(s=n[r].performance);for(r=0;r<(16height?width/64:height/64;0!==Mt()&&("main"===e?Bt.online.scroll-=height/12/2*(Mt()/100):"incFR"===e&&(Bt.account.incFR.scroll-=height/12/2*(Mt()/100))),Vt*=.25,-(t+height/16+height/24+5*t*floor((Bt.online.searchedUsers.length-1)/3))+height-5*t<0?"main"===e?Bt.online.scroll=constrain(Bt.online.scroll,-(t+height/16+height/24+5*t*floor((Bt.online.searchedUsers.length-1)/3))+height-5*t,0):"incFR"===e&&(Bt.online.incFR.scroll=constrain(Bt.online.incFR.scroll,-(t+height/16+height/24+5*t*floor((Bt.online.searchedUsers.length-1)/3))+height-5*t,0)):"main"===e?Bt.online.scroll=constrain(Bt.online.scroll,-(t+height/16+height/24+5*t*floor((height/(4*t)*3-1)/3))+height-5*t,0):"incFR"===e&&(Bt.account.incFR.scroll=constrain(Bt.account.incFR.scroll,-(t+height/16+height/24+5*t*floor((height/(4*t)*3-1)/3))+height-5*t,0)),0===Bt.online.searchedUsers.length&&!1===Bt.trans&&("main"===e?Fo(0===Bt.online.search.length?0:Bt.online.search,Bt.online.searchOnline,e):Fo(0===Bt.account.friendSearch.length?0:Bt.account.friendSearch,Bt.account.onlineOnly,e)),rectMode(CORNER),ellipseMode(CENTER),textAlign(LEFT,CENTER),push(),-(t+height/16+height/24+5*t*floor((Bt.online.searchedUsers.length-1)/3))+height-5*t<0&&translate(0,Bt.online.scroll);for(var i=0;ie.resolve())}constructor(){this.args=[...arguments],yo.all.push(this)}resolve(){var e,t=color(...this.args);for(e in Object.setPrototypeOf(this,t),this)delete this[e];Object.assign(this,t)}setRed(){throw"PromisedColor is not resolved"}setGreen(){throw"PromisedColor is not resolved"}setBlue(){throw"PromisedColor is not resolved"}setAlpha(){throw"PromisedColor is not resolved"}}class Eo{static maxDifficulty=6;static colors=new Map;static getColor(e){e="stars"+Math.floor(constrain(e,0,Eo.maxDifficulty));return Eo.colors.get(e)}difficulty;awarded;special;constructor(e,t,i=!1){this.difficulty=constrain(Math.floor(e)??0,0,Eo.maxDifficulty),this.awarded=t??!1,this.special=i}draw(e,t,i,o){push(),smooth(),rectMode(CENTER),ellipseMode(CENTER),angleMode(DEGREES),noStroke(),fill(255),ellipse(e,t,i,o),fill(this.#getBackgroundColor()),ellipse(e,t,.9*i,.9*o);var n=Math.ceil(i/25);fill(0,100),this.#drawSymbol(e+n,t+n,i,o),fill(this.#getSymbolColor()),this.#drawSymbol(e,t,i,o),pop(),ellipseMode(CENTER)}#getBackgroundColor(){return Eo.colors.get(this.awarded?this.#getMainColorKey():"na")??Eo.colors.get("na")}#getSymbolColor(){return Eo.colors.get(this.awarded?"white":this.#getMainColorKey())??Eo.colors.get("na")}#getMainColorKey(){return this.#isAwardedUnranked()?this.#getAwardKey():"stars"+this.difficulty}#isAwardedUnranked(){return this.special}#getAwardKey(){if(this.special)return"special"}#drawSymbol(e,t,i,o){if(push(),translate(e,t),this.special)for(var n=0;n<3;n++)push(),rotate(60*n),rect(0,0,i/9,o*(4/9),i),pop();else[0].includes(this.difficulty)&&rect(0,0,1.5*i/9,1.5*i/9,1.5*i/9),[1,3,5].includes(this.difficulty)&&rect(0,0,i/9,o*(4/9),i),[2,3,4,5,6].includes(this.difficulty)&&(rect(-i/9*1.5,0,i/9,o*(4/14),i),rect(i/9*1.5,0,i/9,o*(4/14),i)),[4,5,6].includes(this.difficulty)&&(rect(-i/9*3,0,i/9,i/9,i),rect(i/9*3,0,i/9,i/9,i)),[6].includes(this.difficulty)&&(e=i*(4/9),t=o*(4/14)/1.5,rect(0,-(e/2-t/2),i/9,t,i),rect(0,e/2-t/2,i/9,t,i));pop()}}function Po(e,t,i,o,n,s,r){new Eo(n,s,r).draw(e,t,i,o)}function Oo(e,t,i,o,n){var s;null==e&&(s=St.naDiff),s=e<=1?St.easyDiff:e<=2?St.mediumDiff:e<=3?St.hardDiff:e<=4?St.advancedDiff:4{Dn(e)}).catch(e=>{console.error("Failed to read clipboard contents: ",e)})}function So(e){We.client?window.parent.postMessage({type:"copyText",copy:e},"*"):navigator.clipboard.writeText(e)}var Bo=[],To=JSON.parse(localStorage.getItem("pulsusGammaSettings"));function Ho(e){B("upload",{level:{beat:Rt[e].beat,bpm:Rt[e].bpm,ar:Rt[e].ar,hw:Rt[e].hw,hpD:Rt[e].hpD,effects:Rt[e].effects,song:Rt[e].song,bg:Rt[e].bg,songOffset:Rt[e].songOffset,sections:Rt[e].sections,title:Rt[e].title,desc:Rt[e].desc,author:Rt[e].author},session:T.session}),Bt.lvl.uploadVar.a=Bt.lvl.sel}function Ro(e){B("updateLevel",{lvl:e,session:T.session})}function ko(e,t){for(var i=!1,o=0;oheight?width/64:height/64,l=[!1,!1];if(n===Pt("menu_lvl_mods",xt))for(var d in l[0]=!0,Tt.mods)Tt.mods[d]!==Tt.modsDef[d]&&(l[1]=!0);translate(e+i/2,t+o/2),scale(1+((i+2*(widthheight?width/64:height/64))/i-1)*s[r]),rectMode(CENTER),h.discord?(imageMode(CENTER),image(St.discordLogo,0,0,i,o)):(push(),translate(cos(30)*(a/2)*lerp(0,1,s[r]),sin(30)*(a/2)*lerp(0,1,s[r])),fill(0,100),rect(0,0,i,o),pop(),l[0]&&l[1]||!0===h.alert?fill($.modText):fill(lerpColor($.buttonDown,$.buttonUp,s[r])),rect(0,0,i,o)),textAlign(CENTER,CENTER),l[0]&&l[1]||!0===h.alert?fill($.buttonUp):fill($.buttonText),noStroke(),Dt(n,0,0,i-2*a,o/1.5),pop()}function Wo(e,t){if("min:sec"===t)return 1===(i=floor(e/1e3)%60).toString().length&&(i="0"+i),floor(e/6e4)+":"+i;if("min:sec:ms"===t){1===(i=floor(e/1e3)%60).toString().length&&(i="0"+i);for(var i,o=floor(e%1e3),n=0;n<2;n++)o.toString().length<3&&(o="0"+o);return floor(e/6e4)+":"+i+":"+o}}function Uo(e,t){if(0!==Bt.lvl.tab)return e;var i=[...e];switch(t){default:return i;case"dateAsc":return i.reverse();case"dateDesc":return i;case"alphanumAsc":for(var o=[],n=0;nheight?width/64:height/64;if(void 0!==Rt[z]){if("lvl"===e){fill(0,25),rect(width/3+i,height/16+i,width/3*2/3*2-2*i,(height-height/16)/3-2*i,i),imageMode(CENTER),Po(width/3+2*i+(((height-height/16)/3-2*i)/2-i)/2,height/16+2*i+(((height-height/16)/3-2*i)/2-i)/2,((height-height/16)/3-2*i)/2-i,((height-height/16)/3-2*i)/2-i,Bn(Rt[z]),H(Rt[z],"id").ranked,H(Rt[z],"id").special),fill($.text),textAlign(LEFT,CENTER),Dt((!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).title,width/3+3*i+(((height-height/16)/3-2*i)/2-i),height/16+2*i+(((height-height/16)/3-2*i)/2-i)/2,width/3*2/3*2-2*i-3*i-(((height-height/16)/3-2*i)/2-i),((height-height/16)/3-2*i)/2-i,"bold");var o=(!0===Rt[z].local?Ut(Rt[z].author,"uuid"):Ut(H(Rt[z],"id").author,"uuid")).user;Dt(Pt("menu_lvl_by",xt,void 0===o?Pt("defaultUsername",xt):o),width/3+2*i,height/16+2*i+((height-height/16)/3-2*i)/2,width/3*2/3*2-2*i-2*i,((height-height/16)/3-2*i)/4-i),Dt(Pt("menu_lvl_song",xt,(!0===Rt[z].local?Lt(Rt[z].song,"id"):Lt(H(Rt[z],"id").song,"id")).artist,(!0===Rt[z].local?Lt(Rt[z].song,"id"):Lt(H(Rt[z],"id").song,"id")).name),width/3+2*i,height/16+1.5*i+((height-height/16)/3-2*i)/2+((height-height/16)/3-2*i)/4,width/3*2/3*2-2*i-2*i,((height-height/16)/3-2*i)/4-i),!0===Lt((!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).song,"id").explicit&&(imageMode(CORNER),Wt(St.explicit,"stretch",width/3+i+(width/3*2/3*2-2*i)-2.25*i,height/16+i+((height-height/16)/3-2*i)-2.25*i,1.5*i,1.5*i),Ft("rcorner",width/3+i+(width/3*2/3*2-2*i)-2.25*i,height/16+i+((height-height/16)/3-2*i)-2.25*i,1.5*i,1.5*i))&&($t=Pt("explicit",xt)),fill(0,25),rect(width/3+i+(width/3*2/3*2-2*i)+i,height/16+i,width/3*2/3-i,(height-height/16)/3-2*i,i);textAlign(LEFT,CENTER);for(t=0;t<8;t++){var o="",n=!1;0===t?o=void 0===(o=!0===Rt[z].local?Rt[z].id:Rt[z])?Pt("menu_lvl_notUploaded",xt)+(void 0!==Rt[z].copy?" "+Pt("menu_lvl_copyID",xt,Rt[z].copy):""):Pt("menu_lvl_ID",xt,o):1===t?(!0===Rt[z].local?o=$i(Pn(Rt[z].beat,Rt[z].bpm)):void 0!==(o=H(Rt[z],"id").bpmDis)&&(o=!0===o[0]?Pt("menu_lvl_foresight_range",xt,$i(o[1]*Tt.mods.bpm),$i(o[2]*Tt.mods.bpm)):$i(o*Tt.mods.bpm)),o=Pt("menu_lvl_bpm",xt,o),1!==Tt.mods.bpm&&(n=!0)):2===t?(!0===Rt[z].local?o=$i(En(Rt[z].effects,Rt[z].ar)):void 0!==(o=H(Rt[z],"id").arDis)&&(o=!0===o[0]?Pt("menu_lvl_foresight_range",xt,$i(o[1]*Tt.mods.foresight),$i(o[2]*Tt.mods.foresight)):$i(o*Tt.mods.foresight)),o=Pt("menu_lvl_foresight",xt,o),1!==Tt.mods.foresight&&(n=!0)):3===t?(o=(!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).hw,w=(!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).ar,o=null==o?w:o,o*=Tt.mods.hitWindow,o=Pt("menu_lvl_hitWindow",xt,$i(o)),1!==Tt.mods.hitWindow&&(n=!0)):4===t?(o=(!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).hpD,o=Pt("menu_lvl_hpD",xt,$i(o))):5===t?(o=Wo((!0===Rt[z].local?Lo(Rt[z].beat,Rt[z].bpm):H(Rt[z],"id").len)*(1/Tt.mods.bpm),"min:sec"),o=Pt("menu_lvl_length",xt,o),1!==Tt.mods.bpm&&(n=!0)):6===t?o=Hn(floor(100*Bn(Rt[z]))/100):7===t&&(o=H(Rt[z],"id").ranked?H(Rt[z],"id").special?Pt("menu_lvl_special",xt):Pt("menu_lvl_ranked",xt):Pt("menu_lvl_unranked",xt)),n?fill($.modText):fill($.text),Dt(o,width/3+i+(width/3*2/3*2-2*i)+2*i,height/16+1.75*i+((height-height/16)/3-4*i)/8*(t+1)-((height-height/16)/3-3*i)/8/4,width/3*2/3-i-2*i,((height-height/16)/3-4*i)/8)}fill($.lightTheme?0:255),ellipse(width/3+i+(width/3*2/3*2-2*i)+i+width/3*2/3-i-1.5*i,height/16+i+(height-height/16)/3-2*i-1.5*i,1.5*i,1.5*i),Bt.lvl.refreshArrowR+=At(0,Bt.lvl.refreshArrowR,.1),!Ft("ccenter",width/3+i+(width/3*2/3*2-2*i)+i+width/3*2/3-i-1.5*i,height/16+i+(height-height/16)/3-2*i-1.5*i,1.5*i,1.5*i)||Bt.lvl.showLeaderboard||Bt.lvl.showMods||($t=Pt("menu_lvl_refresh",xt),-.1<=Bt.lvl.refreshArrowR&&(Bt.lvl.refreshArrowR+=At(-.1,Bt.lvl.refreshArrowR,.2))),push(),translate(width/3+i+(width/3*2/3*2-2*i)+i+width/3*2/3-i-1.5*i,height/16+i+(height-height/16)/3-2*i-1.5*i),rotate(360*Bt.lvl.refreshArrowR),imageMode(CENTER),Wt($.lightTheme?St.refreshInvert:St.refresh,"stretch",0,0,.8*i,.8*i),pop(),fill(0,25),rect(width/3+i,height/16+i+((height-height/16)/3-2*i)+i,width/3*2-2*i,(height-height/16)/3-2*i,i),fill($.main),rect(width/3+i,height/16+i+((height-height/16)/3-2*i)+i+(((height-height/16)/3-2*i)/2-i/2/2),width/3*2-2*i,i/2),fill($.text),textAlign(CENTER,CENTER);o=null==(o=(!0===Rt[z].local?Rt[z]:H(Rt[z],"id")).desc)?"":o,textSize(i/1.25),text(0{vt.buttonHover[2*e]/=4,Tt.mods.startPos=P.startMS,console.log("Start "+P.name)}),0!==e&&(Kt(d/2+i+u,-v/2,u,v,Pt("practice_endBefore",xt),vt.buttonHover,2*e+1,{alert:Tt.mods.endPos===P.startMS}),Ft("rcorner",d/2+i+u+a,-v/2+l+f,u,v))&&(vt.callback=()=>{vt.buttonHover[2*e+1]/=4,Tt.mods.endPos=P.startMS,console.log("End "+P.name)}),pop()}fill(lerpColor($.shade,$.overlayShade,constrain(vt.trans,0,1))),rect(0,h/8*7,r,h/7);var m=r/2-2*i,p=h/8/1.5;Kt(r-m-i,h-h/8+(h/8-p)/2,m,p,Pt("menu_back",xt),vt.buttonHover,-1),Ft("rcorner",r-m-i+a,h-h/8+(h/8-p)/2+l,m,p)&&(vt.callback=()=>vt.active=!1),pop()}!0===Rt[z].local?Ht.localOffsets[Ht.saved.indexOf(Rt[z])]=Tt.mods.offset:Ht.onlineOffsets[Rt[z]]=Tt.mods.offset}else"song"===e&&(fill(0,25),rect(width/3+i,height/16+i,width/3*2-2*i,(height-height/16)/3-2*i,i),!0===Lt(Rt[Bt.song.sel],"id").explicit&&(Wt(St.explicit,"stretch",width/3+i+(width/3*2-2*i)-2.25*i,height/16+i+((height-height/16)/3-2*i)-2.25*i,1.5*i,1.5*i),Ft("rcorner",width/3+i+(width/3*2-2*i)-2.25*i,height/16+i+((height-height/16)/3-2*i)-2.25*i,1.5*i,1.5*i))&&($t=Pt("explicit",xt)),textAlign(CENTER,CENTER),fill($.text),Dt(Pt("menu_lvl_song_list",xt,Lt(Rt[Bt.song.sel],"id").artist,Lt(Rt[Bt.song.sel],"id").name),width/3+i+(width/3*2-2*i)/2,height/16+i+((height-height/16)/3-2*i)/2,width/3*2-2*i-2*i,((height-height/16)/3-2*i)/3),Dt(Pt("menu_lvl_ID",xt,Rt[Bt.song.sel]),width/3+i+(width/3*2-2*i)/2,height/16+i+((height-height/16)/3-2*i)/2+((height-height/16)/3-2*i)/3/2+i,width/3*2-2*i-2*i,((height-height/16)/3-2*i)/3/2),fill(0,25),rect(width/3+i,height/16+i+((height-height/16)/3-2*i)+i,width/3*2-2*i,(height-height/16)/3-2*i,i),Bt.song.songObject=soundManager.getSoundById(Rt[z]),imageMode(CORNER),Bt.song.listening?3===Bt.song.songObject.readyState?image(1===Bt.settings.themeSel?St.stopInvert:St.stop,width/3+i+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i,2*i,2*i):(Bt.song.loadR+=.25,Bt.song.loadR=Bt.song.loadR%360,push(),fill($.text),translate(width/3+i+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i),translate(2*i/2,2*i/2),rotate(Bt.song.loadR),rectMode(CENTER),rect(0,0,2*i,2*i),pop()):image(1===Bt.settings.themeSel?St.playInvert:St.play,width/3+i+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i,2*i,2*i),rectMode(CORNER),fill($.textDown),rect(width/3+i+i+(i+2*i),height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i/4/2,width/3*2-4*i-(i+2*i),i/4,i/4),void 0!==Bt.song.songObject&&3===Bt.song.songObject.readyState&&(mouseIsPressed&&Ft("rcorner",width/3+i+i+(i+2*i),height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i/4/2-i/2,width/3*2-4*i-(i+2*i),i)?(soundManager.setPosition(Rt[z],(mouseX-(width/3+i+i+(i+2*i)))/(width/3*2-4*i-(i+2*i))*Bt.song.songObject.duration),soundManager.setVolume(Rt[z],0)):soundManager.setVolume(Rt[z],Bt.settings.musicVolume),(0===Bt.song.songObject.playState||Bt.song.songObject.paused)&&Bt.song.listening&&soundManager.play(Rt[z]),textAlign(LEFT,CENTER),fill($.text),Dt(Wo(Bt.song.songObject.position,"min:sec")+"/"+Wo(Bt.song.songObject.duration,"min:sec"),width/3+i+i+(i+2*i),height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i/4/2+1.5*i,width/3*2-4*i-(i+2*i),i),mouseIsPressed?(Bt.song.playbackX+=At(Bt.song.songObject.position/Bt.song.songObject.duration,Bt.song.playbackX,.4),Bt.song.playbackR+=At(Bt.song.songObject.position/Bt.song.songObject.duration*742.5,Bt.song.playbackR,.4)):(Bt.song.playbackX+=At(Bt.song.songObject.position/Bt.song.songObject.duration,Bt.song.playbackX,.1/(21e4/Bt.song.songObject.duration)),Bt.song.playbackR+=At(Bt.song.songObject.position/Bt.song.songObject.duration*742.5,Bt.song.playbackR,.1/(21e4/Bt.song.songObject.duration))),Ft("rcenter",width/3+i+i+(i+2*i)+(width/3*2-4*i-(i+2*i))*Bt.song.playbackX,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i/4/2+i/8,i,i)?mouseIsPressed?Bt.song.playbackS+=At(1.25,Bt.song.playbackS,.2):Bt.song.playbackS+=At(1,Bt.song.playbackS,.2):Bt.song.playbackS+=At(.75,Bt.song.playbackS,.2),push(),translate(width/3+i+i+(i+2*i),height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)/2-i/4/2),translate((width/3*2-4*i-(i+2*i))*Bt.song.playbackX,i/8),rotate(Bt.song.playbackR),scale(Bt.song.playbackS),rectMode(CENTER),fill($.text),rect(0,0,i,i),pop()),Kt(width/3+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)+i,width/3*2-2*i,(height-height/16)/3/3*2-i/2,Pt("menu_song_copyID",xt),Bt.song.buttonHover,4),Kt(width/3+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)+i+(height-height/16)/3/3*2+i/2,width/3*2-2*i,(height-height/16)/3/3-i/2,-1!==O.saved.indexOf(Rt[z])?Pt("menu_lvl_unbookmark",xt):Pt("menu_lvl_bookmark",xt),Bt.song.buttonHover,5));Bt.lvl.deleteConfirm||Bt.lvl.uploadConfirm?Bt.lvl.deleteBanner+=At(1,Bt.lvl.deleteBanner,.2):Bt.lvl.deleteBanner+=At(0,Bt.lvl.deleteBanner,.2),push(),rectMode(CORNER),fill($.overlayShade),rect(-width/3*2+width/3*3*Bt.lvl.deleteBanner,height-(height-height/16)/3-1.5*i,width/3*2,(height-height/16)/3+i),fill($.text),Kt(-width/3*2+i+width/3*3*Bt.lvl.deleteBanner,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)+i+(height-height/16)/3/3*2+i/2,(width/3*2-2*i)/2-i/2,(height-height/16)/3/3-i/2,Pt(Bt.lvl.uploadConfirm?"menu_lvl_upload_yes":"menu_lvl_delete_yes",xt),Bt.lvl.buttonHover,6),Kt(-width/3*2+i+((width/3*2-2*i)/2-i/2)+i+width/3*3*Bt.lvl.deleteBanner,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)+i+(height-height/16)/3/3*2+i/2,(width/3*2-2*i)/2-i/2,(height-height/16)/3/3-i/2,Pt("menu_lvl_delete_no",xt),Bt.lvl.buttonHover,7),push(),translate((width/3*2-2*i)/2+width/3*3*Bt.lvl.deleteBanner,((height-height/16)/3/3*2-i/2)/2),fill($.text),Dt(Pt(Bt.lvl.uploadConfirm?void 0===Rt[Bt.lvl.sel].copy?"menu_lvl_upload_confirm":"menu_lvl_uploadUpdate_confirm":"menu_lvl_delete_confirm",xt,Rt[z].title),-width/3*2+i,height/16+i+((height-height/16)/3-2*i)+i+((height-height/16)/3-2*i)+i,width/3*2-2*i,((height-height/16)/3/3*2-i/2)/1.5),pop(),pop()}rectMode(CORNER),fill($.overlayShade),rect(0,height/16,width/3,height);for(t=0;t(height-(height/16+height/24))/(height/12)?Bt.lvl.scroll/(height-(height/16+height/24)-(height-(height/16+height/24))/12)*(height/12*(Rt.length-(height-(height/16+height/24))/(height/12))):0);b(height-(height/16+height/24))/(height/12)?Bt.lvl.scroll+=height/12/2/(height/12*(Rt.length-(height-(height/16+height/24))/(height/12)))*(height-(height/16+height/24)-(height-(height/16+height/24))/12)*(Mt()/100):Bt.lvl.scroll+=height/12/2*(Mt()/100):Bt.lvl.leaderboardScroll+=Mt()/100),Vt*=.25,Bt.lvl.scroll=constrain(Bt.lvl.scroll,0,height-(height/16+height/24+(height-(height/16+height/24))/12)),fill(30),rect(0,height/16,width/3-width/48,height/24),push(),imageMode(CENTER),translate(height/24/2,height/24/2),fill(255),Wt(St.bookmark,"contain",0,height/16,height/24/1.5,height/24/1.5),fill(255),Wt(St.online,"contain",height/24,height/16,height/24/1.5,height/24/1.5),"lvl"===e?(fill(255),Wt(St.ranked,"contain",height/24*2,height/16,height/24/1.5,height/24/1.5),fill(255),Wt(St.sort,"contain",height/24*3,height/16,height/24/1.5,height/24/1.5),fill(255),Wt(St.searchFor,"contain",height/24*4,height/16,height/24/1.5,height/24/1.5)):"song"===e&&(fill(255),image(St.sort,height/24*2,height/16,height/24/1.5,height/24/1.5),fill(255),Wt(St.searchFor,"contain",height/24*3,height/16,height/24/1.5,height/24/1.5)),pop(),fill(255),imageMode(CENTER),Wt("song"===e?St.upload:St.edit,"contain",width/3-width/48/2,height/16+height/24/2,(width/48t.h-o||(push(),translate(0,i*h),rectMode(CORNER),l=lerpColor(h%2!=0?$.shade:$.overlayShade,color(0,0,0),.15),a=d.user===t.self?color(100,0,0):-1!==po(t.self).indexOf(d.user)?color(100,0,100):l,l=lerpColor(l,a,.25),fill(l),rect(0,0,t.w,i),Ft("rcorner",zt.get().x,zt.get().y,t.w,i)?(this.highlights[h]+=At(1,this.highlights[h],.2),2===qo(t.levelID)&&this.clickEvents.push({hitbox:Ft("rcorner",zt.get().x,zt.get().y,t.w,i),event:function(e){zo(e[0],"leaderboardData")},item:[h]})):this.highlights[h]+=At(0,this.highlights[h],.2),push(),translate(0,i/2),push(),translate(s,0),rectMode(CENTER),fill(255,25),push(),h<=2&&(0===h?fill(201,176,55):1===h?fill(180,180,180):2===h&&fill(173,138,86),rotate(22.5),rect(0,0,i-s/1.1,i-s/1.1)),pop(),fill($.text),textSize(n),textAlign(CENTER,CENTER),stroke(l),strokeWeight(s/4),text(h+1,0,0),noStroke(),translate(s+n/2,0),imageMode(CENTER),image(_t(Ut(d.user,"uuid").pp),0,0,n,n),translate(s,0),textAlign(LEFT,CENTER),Dt(Ut(d.user,"uuid").user,0,0,9*s,n),textSize(n),translate(10*s,0),textAlign(LEFT,CENTER),text(Ot(Gi(d.log)*wn(d.mods)),0,0),translate(8*s,0),textAlign(LEFT,CENTER),text(Pt("accuracyFormat",xt,Zo(d.log)),0,0),translate(6*s,0),textAlign(LEFT,CENTER),text(Pt("comboFormat",xt,jo(d.log)),0,0),translate(6*s,0),void 0!==d.performance&&(textAlign(LEFT,CENTER),text(Pt("performancePoints",xt,d.performance.toFixed(2)),0,0)),translate(6*s,0),textAlign(LEFT,CENTER),Dt(Vo(d.mods),0,0,16*s,n),translate(17*s,0),a=tn(d.score*wn(d.mods)/rn(Rt[Bt.lvl.sel],"online")),fill(on(a)),textAlign(CENTER,CENTER),textStyle(BOLD),textSize(n),text(Tt.ranks[a].symbol,0,0),pop(),pop(),push(),l=21*s+n/2,translate(t.w-l*this.highlights[h],0),rect(0,0,l,i),fill($.text),textAlign(LEFT,CENTER),Dt(2===qo(t.levelID)?Pt("menu_lvl_watchReplay",xt):Pt("menu_lvl_watchReplayError",xt),s,i/2,l-2*s-4*s,n),imageMode(CORNER),image(2===qo(t.levelID)?$.lightTheme?St.replayInvert:St.replay:$.lightTheme?St.warningInvert:St.warning,17*s+n/4,0,i,i),pop(),pop())}pop(),push(),fill(40),rect(0,0,t.w,floor(o)),textSize(n/1.25),textAlign(LEFT,CENTER),push(),translate(0,o/2),fill(255),translate(s,0),textAlign(CENTER,CENTER),text(Pt("menu_lvl_leaderboard_position",xt),0,0),translate(s,0),textAlign(LEFT,CENTER),text(Pt("defaultUsername",xt),0,0),translate(s+n/2,0),translate(10*s,0),text(Pt("score",xt),0,0),translate(8*s,0),text(Pt("accuracy",xt),0,0),translate(6*s,0),text(Pt("maxCombo",xt),0,0),translate(6*s,0),text(Pt("pulse",xt),0,0),translate(6*s,0),text(Pt("menu_lvl_mods",xt),0,0),translate(17*s,0),textAlign(CENTER,CENTER),text(Pt("rank",xt),0,0),pop(),pop(),push(),translate(59*s,o);var g=constrain((t.h-o)/e.length*(e.length-r),0,t.h-o-s);translate(0,s/2+(t.h-o-g-s)*(te(t.scroll)/r)),fill($.scrollbar),rectMode(CORNER),rect(0,0,s/2,g,s),pop()}pop()},Go.prototype.click=function(){for(var e=0;eH.max&&!1!==H.max&&ee(v,H.max)}void 0===H.highlights&&(H.highlights=[0,0,0,0,0]);var m=(o-8*l)/3,p=(push(),translate(o/2,u/2),scale(1+.05*H.highlights[4]),rectMode(CENTER),0{for(const t of J)ee(t,e);i=e};if("boolean"!=typeof i&&_(!1),H.animation??=i?1:0,H.highlights??=[0],H.animation+=At(i?1:0,H.animation,.2),push(),translate(o/2,u/2),scale(1+.2*H.highlights[0]),push(),rectMode(CENTER),Ft("rcenter",zt.get().x,zt.get().y,o,u/1.5)?H.highlights[0]+=At(1,H.highlights[0],.2):H.highlights[0]+=At(0,H.highlights[0],.2),0{},message:"",keys:[],active:!(Jo.prototype.click=function(){var e=this.clickEvents;this.data.breakClickEvents=!1;for(var t=0;t=Tt.ranks[t].score)return t;return Tt.ranks.length-1}function on(e){var t,i,o;return void 0===Tt.ranks[e]?color(0):!0!==Tt.ranks[e].shiny?Tt.ranks[e].color:(i=red(Tt.ranks[e].color),o=green(Tt.ranks[e].color),e=blue(Tt.ranks[e].color),t=(Math.sin(millis()/300)+1)/2,i=lerp(i,i+45,t),o=lerp(o,o+45,t),e=lerp(e,e+45,t),color(i,o,e))}function nn(e){return(e=Math.round(1e5*e)/1e5)<=1?Math.round(1/26.6*(Math.pow(26.6,e)-1)/(1-1/26.6)*1e5)/1e5:Math.round(1e5*(1+Math.pow(e-1,1.5)))/1e5}function sn(e,t){return Rt=[],Rt=Uo(Ht.search,Bt.lvl.sortMode),"online"!==t?!0===Rt[e].local?Rt[e].beat.length*Rt[e].beat.length*100*.5:void 0!==H(Rt[e],"id").beatLen?H(Rt[e],"id").beatLen*H(Rt[e],"id").beatLen*100*.5:void 0:H(e,"id").beatLen*H(e,"id").beatLen*100*.5}function rn(e,t){var i=0;return Rt=[],Rt=Uo(Ht.search,Bt.lvl.sortMode),"online"!==t?!0===Rt[e].local?i=100*Rt[e].beat.length:void 0!==H(Rt[e],"id").beatLen&&(i=100*H(Rt[e],"id").beatLen):i=100*H(e,"id").beatLen,10*i}function hn(){0===Bt.account.user.length&&(Bt.account.blankErrors[0]=!0),0===Bt.account.email.length&&(Bt.account.blankErrors[1]=!0),0===Bt.account.pass.length&&(Bt.account.blankErrors[2]=!0),0===Bt.account.passConf.length&&(Bt.account.blankErrors[3]=!0),0===Bt.account.errors.length&&-1===Bt.account.blankErrors.indexOf(!0)&&(n="reg",r=Bt.account.email,a=Bt.account.user,h=Bt.account.pass,grecaptcha.execute())}function an(){0===Bt.account.email.length&&(Bt.account.blankErrors[1]=!0),0===Bt.account.pass.length&&(Bt.account.blankErrors[2]=!0),0===Bt.account.errors.length&&-1===Bt.account.blankErrors.indexOf(!0)&&1e3i[1]||!1===i[1])&&(i[1]=o[n].targetValue);return i[0]*=Tt.mods.foresight,i[1]*=Tt.mods.foresight,i[0]=Ot(1e4*i[0])/1e4,i[1]=Ot(1e4*i[1])/1e4,i[0]===i[1]?i[0]:Pt("menu_lvl_foresight_range",xt,i[0],i[1])}function Pn(e,t){for(var i=[!1,!1],o=0;oe&&(e=Tt.effects[t].track);return e}function Dn(e){for(var t,i,o=(e=e.split("")).length-1;0<=o;o--)"\n"===e[o]&&e.splice(o,1);e=e.join(""),Nt.inp=Nt.inp.split(""),!1!==Nt.anchor?(t=Nt.anchorNt.cursor?Nt.anchor:Nt.cursor,Nt.inp.splice(t,i-t,e),Nt.anchor=!1,Nt.cursor=t):Nt.inp.splice(Nt.cursor,0,e),Nt.inp=Nt.inp.join(""),Nt.cursor+=e.length}function Xn(){var e=Nt.anchorNt.cursor?Nt.anchor:Nt.cursor;Nt.inp=Nt.inp.split(""),!1===Nt.anchor?(Nt.inp.splice(Nt.cursor-1,1),Nt.cursor--):(Nt.inp.splice(e,t-e),Nt.anchor=!1,Nt.cursor=e),Nt.inp=Nt.inp.join("")}function Wn(e,t){for(var i=[],o=[],n=(e.sort(function(e,t){return e[0]-t[0]}),t.sort(function(e,t){return e.time-t.time}),0),s=0;s=t[n].time&&(!1===r||e[s][0]1-o+1||(r=Math.sin(Math.PI*(h+1-n)/2)+1,void 0!==s[h].color&&fill(s[h].color,alpha(s[h].color)*(r-o)),void 0!==s[h].text&&(textSize(Ot(i*r/2)),text(s[h].text,0,i*-h)));pop()}function Ln(e,t,i,o){e=constrain(millis()-e,0,t);return lerp(i,o,Math.sin(Math.PI*(e/t)/2))}function Kn(e,t,i,o,n){i=i[i.length-1].timing;return[n[0]/o*(.9*e)+.1*e,t/2+t/2*(n[2]/i)]}function Vn(e,t,i,o,n,s,r){for(var h=color(4,200),a=(e.background(h),e.textFont(Je.n),n[n.length-1].timing),l=n.length-2;0<=l;l--){var d=n[l];e.noStroke(),e.fill(lerpColor(h,d.color,.2)),e.rect(0,i/2-i/2*(d.timing/a),t,i*(d.timing/a))}e.strokeWeight(i/75);for(var g=0,l=0;lTt.beat[e][1]),s=Math.min(o[1],...n),r=Math.max(o[1],...n);for(let e=Tt.selectedBeats.length=0;e=s-ls&&h[1]<=r+ls&&Tt.selectedBeats.push(e)}}else if("effects"===t){var o=Tt.effects[e],n=Tt.effectMultiSel.map(e=>Tt.effects[e].time),a=Math.min(o.time,...n),l=Math.max(o.time,...n);for(let e=Tt.effectMultiSel.length=0;e=a-ls&&d.time<=l+ls&&Tt.effectMultiSel.push(e)}}}else 1!==Tt[i].length||-1===Tt[i].indexOf(e)?Tt[i]=[e]:Tt[i]=[]}function Gn(e){at.push({type:e.type,message:e.message,keys:e.keys??[],time:millis(),x:width-width/8,y:1.5*height,headerHover:0})}function Yn(e,t){for(var i in t=void 0===t?Tt.mods:t)void 0===e[i]||null===e[i]?t[i]=Tt.modsDef[i]:t[i]=e[i]}function Jn(e,t,i,o,n,s){o*=2*n/60,o=abs((floor(o)%2==1?0:1)-abs(floor(o)-o)),o=pow(n,o)/n;o%=1,push(),translate(e,t),scale(i/200),s&&scale(-1,1),scale(1+.1*o),rectMode(CENTER),push(),translate(0,-20*o),strokeWeight(7.5),stroke(255),fill(0,175,255),ellipse(150,12.5,50,50),pop(),push(),scale(1-.15*o,1-.05*o),stroke(255),strokeWeight(10),fill(0,125,205),rect(0,0,200,200,10),rotate((22.5+o)*(s?-1:1)),fill(0,175,255),rect(0,0,200,200,10),rotate(-22.5*(s?-1:1)),push(),translate(0,-5*o),noStroke(),fill(255),ellipse(-25,-12.5,25,50),ellipse(50,-12.5,25,50),noStroke(),arc(12.5,25,50,50,0,180),pop(),pop(),push(),translate(0,-20*o),strokeWeight(7.5),stroke(255),fill(0,175,255),ellipse(-150,-50,50,50),pop(),pop()}function _n(){let e="";return"account"===Bt.screen?e=!1===Bt.account.friendsScreen?T.uuid:Bt.account.viewFriend:"online"===Bt.screen&&(e=Bt.online.viewUser),e}function $n(e){var t=_n();!1===Bt.account.friendsScreen&&"account"===Bt.screen&&(Ft("rcorner",3*kt+width/3*1.5+width/3.5,4*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[5]/=2,cn()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,3*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[8]/=2,es()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[7]/=2,Bt.online.searchedUsers=[],Bt.account.friendsScreen="incFR"),Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16))&&(Bt.account.buttonHover[6]/=2,Bt.online.searchedUsers=[],Bt.account.friendsScreen="friends"),0===T.uuid.length?(Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&("account"===e?Bt.account.viewFriend=!1:(Bt.online.mode="main",Bt.online.viewUser="")),Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16)&&(Bt.account.buttonHover[7]/=2,es())):-1!==po(T.uuid).indexOf(t)?(Ft("rcorner",3*kt+width/3*1.5+width/3.5,3*(height/16+kt),width/6.5,height/16)&&("account"===e?Bt.account.viewFriend=!1:(Bt.online.mode="main",Bt.online.viewUser="")),Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[7]/=2,es()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16)&&(B("removeFriend",{to:T.uuid,from:t,session:T.session}),v.grabbedFriends[T.uuid]=[],mo.clear())):-1!==vo(T.uuid,"incoming").indexOf(t)?(Ft("rcorner",3*kt+width/3*1.5+width/3.5,4*(height/16+kt),width/6.5,height/16)&&("account"===e?Bt.account.viewFriend=!1:(Bt.online.mode="main",Bt.online.viewUser="")),Ft("rcorner",3*kt+width/3*1.5+width/3.5,3*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[8]/=2,es()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16)&&(B("acceptFriendRequest",{to:T.uuid,from:t,session:T.session}),v.grabbedIncFriendReqs[T.uuid]=[],v.grabbedFriends[T.uuid]=[],v.grabbedFriendsT[T.uuid]=0,mo.clear()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&(B("denyFriendRequest",{to:T.uuid,from:t,session:T.session}),v.grabbedIncFriendReqs[T.uuid]=[],v.grabbedFriends[T.uuid]=[],mo.clear(),v.grabbedFriendsT[T.uuid]=0)):-1!==vo(T.uuid,"outgoing").indexOf(t)?(Ft("rcorner",3*kt+width/3*1.5+width/3.5,3*(height/16+kt),width/6.5,height/16)&&("account"===e?Bt.account.viewFriend=!1:(Bt.online.mode="main",Bt.online.viewUser="")),Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[7]/=2,es()),Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16)&&(B("revokeFriendRequest",{from:T.uuid,to:t,session:T.session}),v.grabbedOutFriendReqs[T.uuid]=[],v.grabbedFriends[T.uuid]=[],mo.clear(),v.grabbedFriendsT[T.uuid]=0)):"account"===Bt.screen&&!1===Bt.account.friendsScreen||(Ft("rcorner",3*kt+width/3*1.5+width/3.5,3*(height/16+kt),width/6.5,height/16)&&("account"===e?Bt.account.viewFriend=!1:(Bt.online.mode="main",Bt.online.viewUser="")),Ft("rcorner",3*kt+width/3*1.5+width/3.5,2*(height/16+kt),width/6.5,height/16)&&(Bt.account.buttonHover[7]/=2,es()),t!==T.uuid&&Ft("rcorner",3*kt+width/3*1.5+width/3.5,height/16+kt,width/6.5,height/16)&&(B("sendFriendRequest",{to:t,from:T.uuid,session:T.session}),v.grabbedOutFriendReqs[T.uuid]=[],v.grabbedFriends[T.uuid]=[],mo.clear(),v.grabbedFriendsT[T.uuid]=0))}function es(){var e=_n();v.grabbedIncFriendReqs[T.uuid]=void 0,v.grabbedOutFriendReqs[T.uuid]=void 0,v.grabbedFriends[T.uuid]=void 0,mo.clear(),v.grabbedFriendsT[T.uuid]=0,v.newGURequested[e]=void 0,v.newGURequestedT[e]=void 0,v.newGUURequested[e]=void 0,v.newGUURequestedT[e]=void 0,v.grabbedScoresUser[e]=void 0,mn.clear(),v.grabbedScoresTime=0}var ts=0;function is(e){20Pt("percentage",xt,Bt.settings.bgDim.toFixed(0))},{type:"slider",name:"settings_musicVolume",var:[Bt.settings,"musicVolume"],min:0,max:100,step:1,hint:"settings_musicVolume_sub",display:()=>Pt("percentage",xt,Bt.settings.musicVolume.toFixed(0))},{type:"slider",name:"settings_menuMusicVolume",var:[Bt.settings,"menuMusicVolume"],min:0,max:100,step:1,hint:"settings_menuMusicVolume_sub",display:()=>Pt("percentage",xt,Bt.settings.menuMusicVolume.toFixed(0))},{type:"slider",name:"settings_hitsoundVolume",var:[Bt.settings,"hitsoundVolume"],min:0,max:100,step:1,hint:"settings_hitsoundVolume_sub",display:()=>Pt("percentage",xt,Bt.settings.hitsoundVolume.toFixed(0))},{type:"slider",name:"settings_comboBreakVolume",var:[Bt.settings,"comboBreakVolume"],min:0,max:100,step:1,hint:"settings_comboBreakVolume_sub",display:()=>Pt("percentage",xt,Bt.settings.comboBreakVolume.toFixed(0))},{type:"number",name:"settings_offset",hint:"settings_offset_sub",var:[Bt.settings,"offset"],min:!1,max:!1,bigChange:10,smallChange:1}]},{title:"settings_header_notes",items:[{type:"slider",name:"settings_beatThickness",var:[Bt.settings,"beatThickness"],min:1,max:10,step:.1,hint:"settings_beatThickness_sub"},{type:"slider",name:"settings_holdThickness",var:[Bt.settings,"holdThickness"],min:1,max:10,step:.1,hint:"settings_holdThickness_sub"},{type:"slider",name:"settings_holdProgressThickness",var:[Bt.settings,"holdProgressThickness"],min:1,max:10,step:.1,hint:"settings_holdProgressThickness_sub"},{type:"slider",name:"settings_holdAngle",var:[Bt.settings,"holdAngle"],min:0,max:359,step:1,hint:"settings_holdAngle_sub",display:()=>Pt("degrees",xt,Bt.settings.holdAngle.toFixed(0))},{name:"settings_holdDirection",type:"dropdown",hint:"settings_holdDirection_sub",var:[Bt.settings,"holdDirection"],options:[0,1],labels:["cw","ccw"]},{type:"slider",name:"settings_beatTransparency",var:[Bt.settings,"noteEdgeOpacity"],min:0,max:100,step:1,hint:"settings_beatTransparency_sub",display:()=>Pt("percentage",xt,Bt.settings.noteEdgeOpacity.toFixed(0))},{type:"slider",name:"settings_holdProgressOpacity",var:[Bt.settings,"holdProgressOpacity"],min:0,max:100,step:1,hint:"settings_holdProgressOpacity_sub",display:()=>Pt("percentage",xt,Bt.settings.holdProgressOpacity.toFixed(0))},{type:"slider",name:"settings_notePaneOpacity",var:[Bt.settings,"notePaneOpacity"],min:0,max:100,step:1,hint:"settings_notePaneOpacity_sub",display:()=>Pt("percentage",xt,Bt.settings.notePaneOpacity.toFixed(0))}]},{title:"settings_header_particles",items:[{type:"slider",name:"settings_hitParticles",var:[Bt.settings,"hitParticlesThickness"],min:0,max:10,step:.1,hint:"settings_hitParticles_sub"},{type:"slider",name:"settings_hitParticlesOpacity",var:[Bt.settings,"hitParticlesOpacity"],min:0,max:100,step:1,hint:"settings_hitParticlesOpacity_sub",display:()=>Pt("percentage",xt,Bt.settings.hitParticlesOpacity.toFixed(0))},{type:"slider",name:"settings_hitParticlesSpread",var:[Bt.settings,"hitParticlesSpread"],min:0,max:10,step:1,hint:"settings_hitParticlesSpread_sub"},{type:"slider",name:"settings_hitParticlesDuration",var:[Bt.settings,"hitParticlesDuration"],min:50,max:500,step:50,hint:"settings_hitParticlesDuration_sub",display:()=>Pt("milliseconds_short",xt,Bt.settings.hitParticlesDuration.toFixed(0))},{type:"boolean",var:[Bt.settings,"disableMarvelouses"],name:"settings_disableMarvelouses",hint:"settings_disableMarvelouses_sub"},{type:"boolean",var:[Bt.settings,"disableGreats"],name:"settings_disableGreats",hint:"settings_disableGreats_sub"},{type:"boolean",var:[Bt.settings,"disableGoods"],name:"settings_disableGoods",hint:"settings_disableGoods_sub"},{type:"boolean",var:[Bt.settings,"disableOks"],name:"settings_disableOks",hint:"settings_disableOks_sub"},{type:"boolean",var:[Bt.settings,"disableMisses"],name:"settings_disableMisses",hint:"settings_disableMisses_sub"}]},{title:"settings_header_gui",items:[{type:"slider",name:"settings_headerWidth",var:[Bt.settings,"headerWidth"],min:1,max:10,step:1,hint:"settings_headerWidth_sub"},{name:"settings_boardOverlayType",type:"dropdown",hint:"settings_boardOverlayType_sub",var:[Bt.settings,"overlayText"],options:[!1,3,2],labels:["default","settings_keyboard_typeLETTERS","settings_keyboard_typeNUMPAD"]},{type:"slider",name:"settings_boardOverlay",var:[Bt.settings,"boardOverlay"],min:0,max:100,step:1,hint:"settings_boardOverlay_sub",display:()=>Pt("percentage",xt,Bt.settings.boardOverlay.toFixed(0))},{type:"slider",name:"settings_tilePush",var:[Bt.settings,"tilePush"],min:0,max:10,step:1,hint:"settings_tilePush_sub"},{type:"boolean",var:[Bt.settings,"showAccuracy"],name:"settings_showAccuracy",hint:"settings_showAccuracy_sub"},{type:"boolean",var:[Bt.settings,"showProgress"],name:"settings_showProgress",hint:"settings_showProgress_sub"},{type:"boolean",var:[Bt.settings,"showHP"],name:"settings_showHP",hint:"settings_showHP_sub"},{type:"boolean",var:[Bt.settings,"showJudgements"],name:"settings_showJudgements",hint:"settings_showJudgements_sub"},{type:"boolean",var:[Bt.settings,"showUR"],name:"settings_showUR",hint:"settings_showUR_sub"},{type:"boolean",var:[Bt.settings,"showScore"],name:"settings_showScore",hint:"settings_showScore_sub"},{type:"boolean",var:[Bt.settings,"showCombo"],name:"settings_showCombo",hint:"settings_showCombo_sub"},{type:"boolean",var:[Bt.settings,"showSections"],name:"settings_showSections",hint:"settings_showSections_sub"}]},{title:"settings_header_performance",items:[{name:"settings_fpsLimit",type:"dropdown",hint:"settings_fpsLimit_sub",var:[Bt.settings,"fpsLimit"],options:["vsync",25,30,50,60,75,90,120,144,240,2400],labels:["settings_fpsLimit_vsync",[25],[30],[50],[60],[75],[90],[120],[144],[240],"settings_fpsLimit_unlimited"]},{type:"boolean",var:[Bt.settings,"disableEase"],name:"settings_disableEase",hint:"settings_disableEase_sub"},{type:"boolean",var:[Bt.settings,"debugOverlay"],name:"settings_debugOverlay",hint:"settings_debugOverlay_sub"}]},{title:"pulsusPlatinum",items:[{name:"settings_menuMusic",type:"string",hint:"settings_menuMusic_sub",var:[Bt.settings,"menuMusic"],allowEmpty:!0},{name:"settings_defaultBackground",type:"file",hint:"settings_defaultBackground_sub",var:[Bt.settings,"defaultBackground"],fileType:"image",sizeLimit:512e3,success:function(e){Bt.settings.defaultBackground=e.data},reset:function(){Bt.settings.defaultBackground=""}}]}]),Tt.effectsNSM=new Jo([]),Tt.beatNSM=new Jo([]),Tt.sectionsNSM=new Jo([]),g.hsbNSM=new Jo([{title:"settings_header_gameplay",items:[]}]),g.rgbNSM=new Jo([{title:"settings_header_gameplay",items:[]}]),Tt.menuNSM=new Jo([{title:"edit_tool_menu",items:[{type:"slider",name:"edit_menu_item_foresight",var:[Tt,"oldAr"],min:.1,max:5,step:.05,hint:"edit_menu_item_foresight_sub"},{type:"slider",name:"edit_menu_item_hitWindow",var:[Tt,"hw"],min:.1,max:5,step:.05,hint:"edit_menu_item_hitWindow_sub"},{type:"slider",name:"edit_menu_item_hpD",var:[Tt,"hpD"],min:0,max:100,step:1,hint:"edit_menu_item_hpD_sub"},{type:"file",name:"edit_menu_item_bg",var:[Tt,"bg"],hint:"edit_menu_item_bg_sub",fileType:"image",sizeLimit:512e3,success:function(e){Tt.bg=e.data},reset:function(){Tt.bg=""}},{type:"info",name:"edit_menu_currentSong",hint:"edit_menu_currentSong_sub",var:[Tt,"songOffset"],display:function(){return!0===Lt(Tt.song,"id").error?Pt("edit_menu_currentSongError",xt):void 0!==Qt[Tt.song]?void 0===Lt(Tt.song,"id").link||null===Lt(Tt.song,"id").link?Pt("edit_menu_currentSongError",xt):"loaded"===Qt[Tt.song].state()?Pt("menu_lvl_song_list",xt,Lt(Tt.song,"id").artist,Lt(Tt.song,"id").name):Pt("menu_downloading",xt):void 0}},{type:"number",name:"edit_menu_item_songID",hint:"edit_menu_item_songID_sub",var:[Tt,"song"],min:1203,max:!1,bigChange:3,smallChange:1},{type:"number",name:"edit_menu_item_songOffset",hint:"edit_menu_item_songOffset_sub",var:[Tt,"songOffset"],min:!1,max:!1,bigChange:10,smallChange:1},{type:"string",name:"edit_menu_item_title",hint:"edit_menu_item_title_sub",var:[Tt,"title"]},{type:"string",name:"edit_menu_item_desc",hint:"edit_menu_item_desc_sub",var:[Tt,"desc"]},{type:"button",name:"edit_menu_item_save",event:function(){Rt=[],Rt=Uo(Ht.saved,"dateDesc"),Yi(Ht.saved.indexOf(Rt[Tt.lvlSel]))},update:function(e){Tt.saved?e.name="edit_menu_item_saved":e.name="edit_menu_item_save"},hint:"edit_menu_item_save_sub"},{type:"button",name:"edit_menu_item_exit",event:function(){Tt.saved?yn():Tt.exiting=!0},hint:"edit_menu_item_exit_sub"}]}]),Bt.lvl.modsNSM=new Jo([{title:"menu_lvl_mods",items:[{type:"slider",name:"mods_bpm",var:[Tt.mods,"bpm"],min:.5,max:2,step:.01,hint:"mods_bpm_sub",display:function(){return Tt.mods.bpm+"x"}},{type:"slider",name:"mods_foresight",var:[Tt.mods,"foresight"],min:.25,max:2,step:.01,flip:!0,hint:"mods_foresight_sub",display:function(){return Tt.mods.foresight+"x"}},{type:"slider",name:"mods_hitWindow",var:[Tt.mods,"hitWindow"],min:.25,max:2,step:.01,flip:!0,hint:"mods_hitWindow_sub",display:function(){return Tt.mods.hitWindow+"x"}},{type:"boolean",name:"mods_hidden",hint:"mods_hidden_sub",var:[Tt.mods,"hidden"]},{type:"boolean",name:"mods_auto",hint:"mods_auto_sub",var:[Tt.mods,"auto"]},{type:"boolean",name:"mods_noEffects",hint:"mods_noEffects_sub",var:[Tt.mods,"noEffects"]},{type:"boolean",name:"mods_noFail",hint:"mods_noFail_sub",var:[Tt.mods,"noFail"]},{type:"boolean",name:"mods_instantFail",hint:"mods_instantFail_sub",var:[Tt.mods,"instantFail"]},{type:"boolean",name:"mods_perfect",hint:"mods_perfect_sub",var:[Tt.mods,"perfect"]},{type:"boolean",name:"mods_mirror",hint:"mods_mirror_sub",var:[Tt.mods,"mirror"]},{type:"boolean",name:"mods_noRelease",hint:"mods_noRelease_sub",var:[Tt.mods,"noRelease"]},{type:"boolean",name:"mods_random",hint:"mods_random_sub",var:[Tt.mods,"random"]},{type:"boolean",name:"mods_flashlight",hint:"mods_flashlight_sub",var:[Tt.mods,"flashlight"]},{type:"number",name:"mods_startPos",hint:"mods_startPos_sub",var:[Tt.mods,"startPos"],min:0,max:!1,bigChange:1e4,smallChange:1e3},{type:"number",name:"mods_endPos",hint:"mods_endPos_sub",var:[Tt.mods,"endPos"],min:0,max:!1,bigChange:1e4,smallChange:1e3,display:()=>0===Tt.mods.endPos?Pt("end",xt):Tt.mods.endPos},{type:"number",name:"mods_offset",hint:"mods_offset_sub",var:[Tt.mods,"offset"],min:!1,max:!1,bigChange:10,smallChange:1}]}]),Bt.lvl.newLeaderboard=new Go,$={main:color(255,255,255),text:color(0,0,0),overlayShade:color(230,230,230),shade:color(210,210,210),buttonDown:color(30,30,30),buttonUp:color(60,60,60),buttonText:color(255,255,255),textDown:color(75,75,75),select:color(128,215,255),modText:color(255,175,0),scrollbar:color(125,125,125),lightTheme:!1},qe=[{main:color(35,50,60),text:color(255,255,255),overlayShade:color(32,45,54),shade:color(20,35,45),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(60,50,35),modText:color(255,175,0),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)},{main:color(255,255,255),text:color(0,0,0),overlayShade:color(230,230,230),shade:color(210,210,210),buttonDown:color(30,30,30),buttonUp:color(60,60,60),buttonText:color(255,255,255),textDown:color(75,75,75),select:color(128,215,255),modText:color(0,175,255),scrollbar:color(125,125,125),lightTheme:!0,checkmark:color(0,175,255),dropdown:color(68,68,68)},{main:color(35,35,35),text:color(255,255,255),overlayShade:color(32,32,32),shade:color(20,20,20),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(35,50,60),modText:color(0,175,255),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)},{main:color(35,60,35),text:color(255,255,255),overlayShade:color(32,54,32),shade:color(20,45,20),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(60,35,60),modText:color(255,175,255),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)},{main:color(77,101,169),text:color(255,255,255),overlayShade:color(65,86,142),shade:color(58,77,127),buttonDown:color(150,175,200),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(150,175,200),modText:color(248,104,82),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)},{main:color(208,171,0),text:color(255,255,255),overlayShade:color(163,136,0),shade:color(143,119,0),buttonDown:color(255,215,0),buttonUp:color(255,245,200),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(60,22,66),modText:color(60,22,66),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(60,22,66),dropdown:color(225,225,225)},{main:color(15,15,15),text:color(255,255,255),overlayShade:color(8,8,8),shade:color(5,5,5),buttonDown:color(30,30,30),buttonUp:color(75,75,75),buttonText:color(255,255,255),textDown:color(200,200,200),select:color(163,136,0),modText:color(255,215,0),scrollbar:color(255,215,0),lightTheme:!1,checkmark:color(255,215,0),dropdown:color(225,225,225)},{main:color(30,45,75),text:color(255,255,255),overlayShade:color(27,40,69),shade:color(20,30,55),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(50,50,50),modText:color(100,100,100),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(200,200,200),dropdown:color(225,225,225)},{main:color(60,25,35),text:color(255,255,255),overlayShade:color(54,22,30),shade:color(45,10,20),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(35,50,60),modText:color(0,175,255),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)},{main:color(60,25,60),text:color(255,255,255),overlayShade:color(54,22,54),shade:color(45,10,45),buttonDown:color(240,240,240),buttonUp:color(255,255,255),buttonText:color(0,0,0),textDown:color(200,200,200),select:color(35,50,60),modText:color(0,175,255),scrollbar:color(255,255,255),lightTheme:!1,checkmark:color(0,175,255),dropdown:color(225,225,225)}],Tt.hitValues=[{points:150,timing:.05,acc:100,name:"Marvelous",color:color(200,0,255),hp:8,comboBreak:!1},{points:100,timing:.1,acc:100,name:"Great",color:color(0,175,255),hp:5,comboBreak:!1},{points:50,timing:.2,acc:50,name:"Good",color:color(0,255,0),hp:0,comboBreak:!1},{points:20,timing:.3,acc:20,name:"Ok",color:color(255,175,0),hp:-.25,comboBreak:!1},{points:0,timing:.5,acc:0,name:"Miss",color:color(255,0,0),hp:-1,comboBreak:!0}],Tt.ranks=[{symbol:"Π",color:color(127,227,225),score:2.5,shiny:!0},{symbol:"SS",color:color(201,176,55),score:2,shiny:!0},{symbol:"S",color:color(200,200,200),score:1},{symbol:"A",color:color(0,175,255),score:.85},{symbol:"B",color:color(0,255,0),score:.675},{symbol:"C",color:color(255,175,0),score:.5},{symbol:"D",color:color(255,0,175),score:.35},{symbol:"F",color:color(255,0,0),score:0},{symbol:"X",color:color(30),score:0}],Tt.tools=[["edit_tool_play",St.play,0,!1],["edit_tool_object_beat",St.objectBeat,0],["edit_tool_playback",St.objectBeat,0,!1],["edit_tool_bpm",St.timelineBPM,0,[["edit_tool_bpm_offset",St.timelineOffset,0,!1]]],["edit_tool_timelineMode",St.timelineSnap,0,!1],["edit_tool_metronome_off",St.metronome,0,!1],["edit_tool_paste",St.paste,0,!1],["edit_tool_mode_gameplay",St.editorModeGameplay,0,!1],["edit_tool_menu",St.menu,0,!1]],kt=width>height?width/64:height/64,lowLag.init(),lowLag.load("/client/resources/sound/hitsound02.mp3","hitsound"),lowLag.load("/client/resources/sound/metronome01.mp3","metronomeHigh"),lowLag.load("/client/resources/sound/metronome02.mp3","metronome"),lowLag.load("/client/resources/sound/holdRelease.mp3","holdRelease"),lowLag.load("/client/resources/sound/comboBreak.mp3","comboBreak"),no.connect(oo.destination),B("test"),o.on("authComplete",function(e){void 0!==e.session&&null!==e.session&&(window.localStorage.setItem("session",e.session),T.session=e.session),T.name=e.user,T.uuid=e.uuid,T.pp=e.pp,T.recievedAll=!0}),o.on("downloadingLevelData",function(e){Bt.lvl.downloading=!0,Bt.lvl.downloadVar.beat=e.beat,Bt.lvl.downloadVar.id=e.id,Bt.lvl.downloadVar.bpm=e.bpm,Bt.lvl.downloadVar.ar=e.ar,Bt.lvl.downloadVar.hpD=e.hpD,Bt.lvl.downloadVar.effects=e.effects,Bt.lvl.downloadVar.song=e.song,Bt.lvl.downloadVar.bg=e.bg,Bt.lvl.downloadVar.songOffset=e.songOffset,Bt.lvl.downloadVar.title=e.title,Bt.lvl.downloadVar.desc=e.desc,Bt.lvl.downloadVar.author=e.author}),o.on("grabbedUserData",function(e){var t;!1!==e.replace?(t=e.replace,v.grabbedUserData[e.replace]=[]):(t=v.grabbedUserData.length-1,v.grabbedUserData[v.grabbedUserData.length]=[]),v.grabbedUserData[t][0]=e.uuid,v.grabbedUserData[t][1]=e.user,v.grabbedUserData[t][2]=e.pp}),o.on("grabbedSongDataAll",function(e){Bt.song.data=e.songData}),o.on("grabbedSongData",function(e){var t;!1!==e.replace?(t=e.replace,v.grabbedSongData[e.replace]=[]):(t=v.grabbedSongData.length-1,v.grabbedSongData[v.grabbedSongData.length]=[]),v.grabbedSongData[t][0]=e.id,v.grabbedSongData[t][1]=e.name,v.grabbedSongData[t][2]=e.artist,v.grabbedSongData[t][3]=e.link}),o.on("grabbedLevelData",function(e){var t;!1!==e.replace?(t=e.replace,v.grabbedLevelData[e.replace]={}):(t=v.grabbedLevelData.length-1,v.grabbedLevelData[v.grabbedLevelData.length]={}),v.grabbedLevelData[t].id=e.id,v.grabbedLevelData[t].diff=e.diff}),o.on("uploadSongFinished",function(e){Bt.newSong.uploaded=!0,Bt.newSong.uploadID=e.id}),o.on("grabbedLevelDataAll",function(e){Bt.onlineLvl.data=e.levelData}),o.on("newGrabbedLevel",function(e){!1!==e.error&&(void 0===v.newGrabbedLevels[e.id]||"Metadata"===v.newGrabbedLevels[e.id].beat&&"Metadata"!==e.beat)?(void 0===v.newGrabbedLevels[e.id]&&(v.newGrabbedLevels[e.id]={}),v.newGrabbedLevels[e.id].id=e.id,v.newGrabbedLevels[e.id].beat=(("Metadata"!==e.beat||void 0!==v.newGrabbedLevels[e.id].beat&&0{e.data.client&&(We=e.data)},!1),setInterval(function(){Qn()},300),0e.levels[1]?e.levels[0]>e.levels[2]?e.levels[0]:e.levels[2]:e.levels[1]>e.levels[2]?e.levels[1]:e.levels[2])?0:(e-t)/e*255):void 0},brightness=function(e){return ue(e)/100*255},alpha=function(e){return"hsb"===colorMode()._colorMode?255*+ve(e):ve(e)/255*255},constrain=function(e,t,i){return is===e[0]&&Math.abs(n[1]-e[1])<=ls&&!Tt.selectedBeats.includes(t)&&o!=t))return t=Tt.keyDisplay[Bt.settings.language],void Gn({type:"error",message:"transform_collision_error",keys:[Tt.timelineTickFor(n[1]),t[n[0]],t[s]]})}for(const r of Tt.selectedBeats){var i=Tt.beat[r];i[0]=e[i[0]]}}function gs(){bs(),"click"===He&&ws(),"welcome"===He&&Cs(),"menu"===He&&(ps(),c()),"game"===He&&cs(),"hidden"!==Ne&&(rectMode(CORNER),fill(255),rect(0,-height+height*u.screenY,width,height),push(),translate(width/2,-height+height*u.boxY+height/2),rectMode(CENTER),fill(0),rotate(u.boxR+u.theta),rect(0,0,height=width){at.splice(e,1),e--;continue}}else t.x+=At(width-(width/5+kt),t.x,.2);t.y+=At(height-(height/8+kt)*(at.length-e),t.y,.2);var i=width/5,o=height/8,n=kt/2*(t.headerHover+1),s=n/2/2/1.5,r=(push(),translate(t.x,t.y),translate(i/2,o/2),rectMode(CENTER),push(),translate(cos(30)*kt,sin(30)*kt),fill(0,100),rect(0,0,i,o,kt/2),pop(),fill(255),rect(0,0,i,o,kt/2),lt.push({hitbox:Ft("rcenter",zt.get().x,zt.get().y,i,o),item:at[e],event:function(e){dt=!0}}),color(255,0,0));switch(t.type){case"error":r=color(255,0,0);break;case"success":r=color(0,175,0)}Ft("rcenter",zt.get().x,zt.get().y-o/2+kt/4,i,n)?t.headerHover+=At(1,t.headerHover,.2):t.headerHover+=At(0,t.headerHover,.2),fill(r),rect(0,-o/2+n/2,i,n,kt/2,kt/2,0,0),push(),translate(i/2-(n-s)/2,-o/2+n/2),stroke(255),strokeWeight(n/16),line(-s,-s,s,s),line(-s,s,s,-s),lt.push({hitbox:Ft("rcorner",zt.get().x-n/2,zt.get().y-n/2,n,n),item:at[e],event:function(e){e.time=-1e4}}),pop(),fill(0),noStroke(),textSize(kt/1.75),textAlign(LEFT,TOP),text(Pt(t.message,xt,t.keys[0],t.keys[1],t.keys[2],t.keys[3]),.25*kt,kt+n/2+(height-o)/2,i-kt,height),pop()}!1!==$t&&!0!==Ne&&(push(),rectMode(CORNER),h=height/28,fill(255,0),textAlign(LEFT,TOP),Dt($t,mouseX,mouseY-h,width,h/1.5),d=textWidth($t)+h/2,kt=Math.min(width,height)/64,translate(0,Math.max(mouseY-h,kt)),noStroke(),fill(0,200),rect(constrain(mouseX-(mouseX+d>width?d:0),0,width),0,d,h,h),fill(255),textAlign(CENTER,CENTER),text($t,constrain(mouseX-(mouseX+d>width?d:0),0,width)+d/2,h/2),$t=!1,pop()),f&&(Qe=!Qe,f=!1),g.active?g.fade+=At(1,g.fade,.15):g.fade+=At(0,g.fade,.15),push(),noStroke(),translate(0,height-height*constrain(g.fade,0,.5)*2),rectMode(CORNER),fill($.main,2*constrain(g.fade,0,.5)*200),rect(0,0,width,height),pop(),push(),translate(0,height-height*constrain(g.fade,0,1)),translate(0,Ot(height/16)),textAlign(CENTER,CENTER),textStyle(BOLD),fill(255),Dt(Pt(g.title,xt),width/2,height/16/2,width/4*1.5,height/16*2),Ot(red(g.currentColor))!==Ot(g.red)||Ot(green(g.currentColor))!==Ot(g.green)||Ot(blue(g.currentColor))!==Ot(g.blue)?(colorMode(RGB),g.currentColor=color(Ot(g.red),Ot(g.green),Ot(g.blue),Ot(g.alpha)),g.hue=Ot(hue(g.currentColor)),g.saturation=Ot(saturation(g.currentColor)),g.brightness=Ot(brightness(g.currentColor)),g.hex=wt(Ot(g.red),Ot(g.green),Ot(g.blue),Ot(g.alpha))):Ot(hue(g.currentColor))!==Ot(g.hue)||Ot(saturation(g.currentColor))!==Ot(g.saturation)||Ot(brightness(g.currentColor))!==Ot(g.brightness)?(colorMode(HSB),g.currentColor=color(Ot(g.hue),Ot(g.saturation),Ot(g.brightness),Ot(g.alpha)),g.red=Ot(red(g.currentColor)),g.green=Ot(green(g.currentColor)),g.blue=Ot(blue(g.currentColor)),g.hex=wt(Ot(g.red),Ot(g.green),Ot(g.blue),Ot(g.alpha))):Ot(alpha(g.currentColor))!==Ot(g.alpha)&&(colorMode(RGB),g.currentColor=color(Ot(g.red),Ot(g.green),Ot(g.blue),Ot(g.alpha)),g.hex=wt(Ot(g.red),Ot(g.green),Ot(g.blue),Ot(g.alpha))),g.hsbNSM.draw({x:width/16,y:height/12*3,width:width/4,height:height,stacked:!0,maxBarHeight:height/12,buffer:(height-height/16)/64,hideHeaders:!0,hideHints:!0,hideHighlights:!0}),g.rgbNSM.draw({x:width/16*2+width/4,y:0,width:width/4,height:height,stacked:!0,maxBarHeight:height/12,buffer:(height-height/16)/64,hideHeaders:!0,hideHints:!0,hideHighlights:!0}),push();var h,a,l,d=height/12*3;translate(width/16+width/4/2,height/8+height/12),rectMode(CENTER),fill(255),rect(0,0,d+kt,d+kt),imageMode(CENTER),image(ht.hsbGrid,0,0,d,d),mouseIsPressed&&Ft("rcenter",zt.get().x,zt.get().y,d+kt,d+kt)&&g.active&&(g.hue=constrain(Ot((mouseX-zt.get().x+d/2)/d*255),0,255),g.saturation=constrain(Ot((mouseY-zt.get().y+d/2)/d*255),0,255)),push(),translate(-d/2,-d/2),translate(d*(g.hue/255),d*(g.saturation/255)),colorMode(HSB),fill(g.hue,g.saturation,255),stroke(0),strokeWeight(d/128),ellipseMode(CENTER),ellipse(0,0,d/16,d/16),pop(),pop(),push(),translate(width/16*3+width/4*2,0),push(),rectMode(CORNER),noStroke(),translate(0,Ot(height/16*2)),fill(g.currentColor),rect(0,Ot(height/12*2),width/4,Ot(height/12*2)),g.old.multiple?g.old.mode===HSB?(colorMode(HSB),fill(te(g.old.hues[0]),te(g.old.saturations[0]),te(g.old.brightnesses[0]),!1===g.old.alphas?255:te(g.old.alphas[0]))):(g.old.mode,RGB):g.old.mode===HSB?(colorMode(HSB),fill(te(g.old.hue),te(g.old.saturation),te(g.old.brightness),!1===g.old.alpha?255:te(g.old.alpha))):g.old.mode===RGB&&(colorMode(RGB),fill(te(g.old.red),te(g.old.green),te(g.old.blue),!1===g.old.alpha?255:te(g.old.alpha))),rect(0,0,width/4,Ot(height/12*2)),pop(),push(),translate(width/4/2,3*Ot(height/12*2)),textStyle(NORMAL),Kt(-width/4/2,0,width/4,4*kt,Pt("submit",xt),g.buttonHover,1),Kt(-width/4/2,Ot(height/12*2),width/4,4*kt,Pt("cancel",xt),g.buttonHover,0),pop(),pop(),pop(),push(),translate(0,height-height*constrain(g.fade,0,1)*1),resetMatrix(),translate(0,height-height*constrain(g.fade,0,1)*1),textStyle(NORMAL),pop(),Nt.active?(I&&(Nt.anchor=0,Nt.cursor=Nt.inp.length,I=!1),l=Nt.anchorNt.cursor?Nt.anchor:Nt.cursor,(R||k)&&(0width-12*h&&mouseY>height-12*h?1:0,Bt.fpsHoverTrans+=At(d,Bt.fpsHoverTrans,.2),drawingContext.globalAlpha=lerp(200,20,Bt.fpsHoverTrans)/255,noStroke(),rectMode(CORNER),fill($.buttonUp,255),rect(width-5*h,height-3*h,4*h,2*h),textAlign(CENTER,CENTER),fill($.buttonText),$e="",Dt(Fe.dis.toFixed(0),width-3*h,height-2*h,4*h/1.5,2*h/1.5),pop()),(Bt.settings.debugOverlay||"click"===He||"welcome"===He||"menu"===He&&"logo"===Bt.screen)&&(push(),a=Math.min(width,height)/64,l=mouseX<12*a&&mouseY>height-12*a?1:0,Bt.versionInfoHoverTrans+=At(l,Bt.versionInfoHoverTrans,.2),drawingContext.globalAlpha=lerp(200,20,Bt.versionInfoHoverTrans)/255,fill($.text,255),textSize(a),textAlign(LEFT,BOTTOM),$e="",d="γ0.28.15.2"+(Se?"-staging":""),We.client&&(d=d+"-"+We.version),"game"!==He&&text(d+"\nTetroGem 2024",a,height-a),pop()),Se&&(fill(255,0,0),text(v.queueType,height/64,height-height/64*3)),Le=!1,pmouseY=mouseY,pmouseX=mouseX,"vsync"===Bt.settings.fpsLimit&&requestAnimationFrame(()=>gs())}function cs(){var e,t;0===Tt.disMode?cs.transitionFromMenu():1!==Tt.disMode&&2!==Tt.disMode&&3!==Tt.disMode||(cs.touchscreen(),Tt.ar=Tt.arInit+Tt.bpm/60/2*constrain(Tt.effected.ar,-Tt.oldAr,9999),cs.musicTime(),Tt.edit&&cs.updateEditor(),cs.parseEffects(),Tt.next=[],colorMode(HSB),t=[],e=cs.sortBeats(Tt.beat,Tt.edit),t=cs.scanBeats(e).drawableBeats,Tt.edit||cs.updateGameplay(),cs.updateAll(),(0<=millis()-Tt.lastDraw||Tt.edit)&&cs.field.draw(t),cs.paused(),1!==Tt.disMode&&cs.resultsScreen()),!0===Tt.retry&&cs.retry()}function fs(){}mouseClicked=function(){var e,t,i,o,n,s;width>height?width:height;_o.active?(e=width/2,t=height/2,Ft("rcorner",e+-(i=width/2)/2+i/3-(n=i/4)/2,t+(s=(o=height/2)/4)-s/2,n,s)?(_o.buttons[0]/=4,_o.active=!1,_o.spiral=!0,_o.callback()):Ft("rcorner",e+-i/2+i/3*2-n/2,t+o/4-s/2,n,s)&&(_o.buttons[1]/=4,_o.active=!1)):Nt.active?fs.prmpting():g.active?fs.prmptingColor():(dt=!1,fs.notifications(lt),dt||fs.screens())},mouseReleased=function(){mouseIsPressed=!1,Bt.lvl.scrollNewLock=!1},cs.field={},cs.field.draw=function(A){var e=Tt.bpmNew();Tt.lastDraw=millis(),background(0,0,0,255),imageMode(CORNER),Wt(0height/1080?1920/1080*height:width))/2,(height-(width/1920>height/1080?height:.5625*width))/2,width/1920>height/1080?1920/1080*height:width,width/1920>height/1080?height:.5625*width),colorMode(HSB),fill(Tt.effected.backgroundOverlayColor,Tt.effected.backgroundOverlaySaturation,Tt.effected.backgroundOverlayBrightness,Tt.effected.backgroundOverlayAlpha),noStroke(),rect(0,0,width,height),colorMode(RGB),fill(0,Bt.settings.bgDim/100*255),rectMode(CORNER),rect(0,0,width,height),rectMode(CORNER),fill(255,Tt.transBackA),rect(0,0,width,height),colorMode(HSB);for(var t=A.length-1;0<=t;t--){var i=A[t],o=(push(),0),n=0,F=0,D=width,X=0,W=height,s=(width/1920>height/1080?(o=1920/1080*height/240,n=height/135,F=(width-1920/1080*height)/2,D=width-(width-1920/1080*height)/2):(o=width/240,n=.5625*width/135,X=(height-.5625*width)/2,W=height-(height-.5625*width)/2),Tt.board.str*(Tt.board.c/64)*(Tt.board.hheight/1080?translate(width/2+Tt.effected.boardX*(1920/1080*height/240),height/2+Tt.effected.boardY*(height/135)):translate(width/2+Tt.effected.boardX*(width/240),height/2+Tt.effected.boardY*(.5625*width/135)),scale(Tt.effected.boardW,Tt.effected.boardH),rotate(Tt.effected.boardR);for(var me=Tt.board.w*Tt.board.c*3/8,pe=Tt.board.h*Tt.board.c*3/8,be=width/1920>height/1080,we=kt/4/5*Bt.settings.missShake,i=0;i<9;i++)Tt.time-Tt.tileTrailLast[i]>=Tt.effected.tileTrailSpacing[i]/1e3/60*120&&(Tt.tileTrailLast[i]=Tt.time,void 0===Tt.tileTrail[i]&&(Tt.tileTrail[i]=[]),push(),translate(me*(i%3-1),pe*(floor(i/3)-1)),be?translate(Tt.effected.tileX[i]*(1920/1080*height/240),Tt.effected.tileY[i]*(height/135)):translate(Tt.effected.tileX[i]*(width/240),Tt.effected.tileY[i]*(.5625*width/135)),Tt.tileTrail[i].push({time:Tt.time,x:zt.get(1).x,y:zt.get(1).y,r:Tt.effected.tileR[i],w:Tt.effected.tileW[i],h:Tt.effected.tileH[i],a:Tt.effected.tileA[i],hue:Tt.effected.tileColor[i],saturation:Tt.effected.tileSaturation[i],brightness:Tt.effected.tileBrightness[i],alpha:Tt.effected.tileAlpha[i],overlayHue:Tt.effected.tileOverlayColor[i],overlaySaturation:Tt.effected.tileOverlaySaturation[i],overlayBrightness:Tt.effected.tileOverlayBrightness[i],overlayAlpha:Tt.effected.tileOverlayAlpha[i],rememberColor:Tt.effected.tileTrailColor[i]}),10height/1080?(o=1920/1080*height/240,height/135):(o=width/240,.5625*width/135);for(var i=Tt.newHits.length-1;0<=i;i--){var He,Re,ke,Ne,P=Tt.newHits[i],Qe=Tt.hitValues[P.type],b=(Tt.time-P.time)/(Bt.settings.hitParticlesDuration/240*Tt.mods.bpm);0===P.type&&Bt.settings.disableMarvelouses||1===P.type&&Bt.settings.disableGreats||2===P.type&&Bt.settings.disableGoods||3===P.type&&Bt.settings.disableOks||4===P.type&&Bt.settings.disableMisses||b<1&&(He=Tt.board.w*Tt.board.c*3/8*(P.tile%3-1)+width/2+Tt.effected.tileX[P.tile]*o,ke=Tt.board.h*Tt.board.c*3/8*(floor(P.tile/3)-1)+height/2+Tt.effected.tileY[P.tile]*n,Re=Tt.board.w*Tt.board.c/4*(1-abs(P.error))*Tt.effected.tileW[P.tile],Ne=Tt.board.h*Tt.board.c/4*(1-abs(P.error))*Tt.effected.tileH[P.tile],push(),rectMode(CENTER),translate(width/2,height/2),translate(Tt.effected.boardX*o,Tt.effected.boardY*n),scale(Tt.effected.boardW,Tt.effected.boardH),rotate(Tt.effected.boardR),translate(-width/2,-height/2),translate(He,ke),rotate(Tt.effected.tileR[P.tile]),push(),He=(Reheight/1080?1920/1080*height:width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1)+8,(width/1920>height/1080?height:.5625*width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1)+8),resetMatrix(),rectMode(CORNER),fill(0),noStroke(),rect(0,0,width,(height-(width/1920>height/1080?height:.5625*width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1))/2),rect(0,height,width,-(height-(width/1920>height/1080?height:.5625*width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1))/2),rect(0,0,(width-(width/1920>height/1080?1920/1080*height:width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1))/2,height),rect(width,0,-(width-(width/1920>height/1080?1920/1080*height:width)*(-pow(Tt.effected.vignette-10,3)/(pow(10,3)/14)+1))/2,height),pop(),push(),resetMatrix(),fill(0),rectMode(CORNER),noStroke(),H=width/1920>height/1080?(R=1920/1080*height/240,N=height/135,T=width-1920/1080*height,0):(R=width/240,N=.5625*width/135,T=0,height-.5625*width),rect(0,0,T/2+Tt.effected.letterboxX*R,height),rect(width,0,-T/2-Tt.effected.letterboxX*R,height),rect(0,0,width,H/2+Tt.effected.letterboxY*N),rect(0,height,width,-H/2-Tt.effected.letterboxY*N),pop();for(i=0;iheight/1080?(translate(We*(1920/1080*height/240)+(width-1920/1080*height)/2,Ue*(height/135)),S=Ot(Le*(height/135)),1920/1080*height/240):(translate(We*(width/240),Ue*(.5625*width/135)+(height-.5625*width)/2),S=Ot(Le*(.5625*width/135)),width/240),S),textSize(S),textLeading(Ye),rotate(Ke),void 0!==O.text){var B=O.text,Je=O.highlight,_e=!1,$e=!1;switch(O.textDi){case 1:B=(B=(B=B.split("")).reverse()).join(""),$e=!0;break;case 2:B=(B=B.split("")).join("\n"),Je*=2,_e=!0;break;case 3:B=(B=(B=B.split("")).reverse()).join("\n"),Je*=2,$e=_e=!0}if(Xe=Di(B,S,Ye),_e)switch(Tt.effected.subtitles[i].textAl){default:textAlign(LEFT,TOP);break;case 1:textAlign(CENTER,TOP);break;case 2:textAlign(RIGHT,TOP);break;case 3:textAlign(LEFT,TOP),translate(0,Ot(-Xe/2));break;case 4:textAlign(CENTER,TOP),translate(0,Ot(-Xe/2));break;case 5:textAlign(RIGHT,TOP),translate(0,Ot(-Xe/2));break;case 6:textAlign(LEFT,TOP),translate(0,Ot(-Xe));break;case 7:textAlign(CENTER,TOP),translate(0,Ot(-Xe));break;case 8:textAlign(RIGHT,TOP),translate(0,Ot(-Xe))}else switch(Tt.effected.subtitles[i].textAl){default:textAlign(LEFT,TOP),translate(0,0);break;case 1:textAlign(LEFT,TOP),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)/2),0);break;case 2:textAlign(LEFT,TOP),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)),0);break;case 3:textAlign(LEFT,CENTER);break;case 4:textAlign(LEFT,CENTER),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)/2),0);break;case 5:textAlign(LEFT,CENTER),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)),0);break;case 6:textAlign(LEFT,BOTTOM);break;case 7:textAlign(LEFT,BOTTOM),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)/2),0);break;case 8:textAlign(LEFT,BOTTOM),translate(Ot(-textWidth(Tt.effected.subtitles[i].text)),0)}$e&&(Je=abs(B.length-(constrain(Je,0,B.length+(_e?1:0))-(_e?1:0)))),Je=constrain(Je,0,B.length),colorMode(HSB);We=color(x,Ze,je,Ge),Ue=color(z,Ve,Me,qe),Le=(fill($e?Ue:We),_e?Ot(Di(B.substr(0,Je),S,Ye)):0);text(B.substr(Je,B.length),_e?0:Ot(textWidth(B.substr(0,Je))),0height/1080?translate(width/2+Tt.effected.boardX*(1920/1080*height/240),height/2+Tt.effected.boardY*(height/135)):translate(width/2+Tt.effected.boardX*(width/240),height/2+Tt.effected.boardY*(.5625*width/135)),rotate(Tt.effected.boardR),scale(Tt.effected.boardW,Tt.effected.boardH),Tt.flashlightX+=At(Tt.board.w*Tt.board.c*3/8*(Tt.lastHitTile%3-1),Tt.flashlightX,.2),Tt.flashlightY+=At(Tt.board.h*Tt.board.c*3/8*(floor(Tt.lastHitTile/3)-1),Tt.flashlightY,.2),translate(Tt.flashlightX,Tt.flashlightY),width/1920>height/1080?translate(Tt.effected.tileX[Tt.lastHitTile]*(1920/1080*height/240),Tt.effected.tileY[Tt.lastHitTile]*(height/135)):translate(Tt.effected.tileX[Tt.lastHitTile]*(width/240),Tt.effected.tileY[Tt.lastHitTile]*(.5625*width/135)),noFill(),stroke(0),strokeWeight(width),ellipse(0,0,Tt.board.w*Tt.board.c/4*Tt.effected.tileW[Tt.lastHitTile]*4+width,Tt.board.h*Tt.board.c/4*Tt.effected.tileH[Tt.lastHitTile]*4+width,Tt.flashlightY),pop()),push(),resetMatrix(),fill(0),rectMode(CORNER),noStroke(),width/1920>height/1080?(rect(0,0,(width-1920/1080*height)/2,height),rect(width,height,-(width-1920/1080*height)/2,-height)):height/1080>width/1920&&(rect(0,0,width,(height-.5625*width)/2),rect(width,height,-width,-(height-.5625*width)/2)),pop(),!1===Tt.edit){Tt.headerY+=At(0,Tt.headerY,.2),Tt.showGUI?Tt.guiAlpha+=At(1,Tt.guiAlpha,.3):Tt.guiAlpha+=At(0,Tt.guiAlpha,.3),rectMode(CORNER),noStroke();for(var T=Ot(lerp(width/16,width/2,(Bt.settings.headerWidth-1)/9)),et=(push(),translate(width/2-T/2,0),Bt.settings.showProgress?(R=Ot(constrain(Tt.time/Tt.timeEnd,0,1)*T),fill(40,150*Tt.guiAlpha),rect(R,0,T-R,height/32),fill(150,150*Tt.guiAlpha),rect(0,0,R,height/32)):(Bt.settings.showAccuracy||Bt.settings.showHP)&&(fill(40,150*Tt.guiAlpha),rect(0,0,T,height/32)),pop(),0),i=Tt.acc=0;iit.time){tt=i;break}}textAlign(LEFT,CENTER);for(var H=height/24,T=(textSize(H/1.5),0),ot=(!1!==tt?(N=Tt.sections[tt],Tt.sectionBarWidth+=At(textWidth(N.name)+(H-H/1.5),Tt.sectionBarWidth,.2),Tt.sectionCarouselIndex+=At(tt+1,Tt.sectionCarouselIndex,.2),T=Ot(constrain((Tt.time-N.time)/((tt===Tt.sections.length-1?Tt.timeEnd:Tt.sections[tt+1].time)-N.time),0,1)*Tt.sectionBarWidth)):(Tt.sectionBarWidth+=At(0,Tt.sectionBarWidth,.2),Tt.sectionCarouselIndex+=At(0,Tt.sectionCarouselIndex,.2)),[""]),i=0;i0-kt&&width/32*(Tt.beat[i][1]*e)*(1/Tt.snap)+(width/2-width/32*(Tt.time*e/Tt.snap))dt((e,t)=>t<=e)},{type:"button",name:"edit_select_item_selectCurrent",hint:"edit_select_item_selectCurrent_sub",event:()=>dt((e,t)=>t===e)},{type:"button",name:"edit_select_item_selectAfter",hint:"edit_select_item_selectAfter_sub",event:()=>dt((e,t)=>e<=t)}]}],Tt.effectsNSM.data.page=0,Tt.effectSelLast=!1}else if((Tt.effectSelLast!==Tt.effectSel||!1!==Tt.effectSel&&Tt.effectTypeLast!==Tt.effects[Tt.effectSel].type)&&1===Tt.effectMultiSel.length){Tt.effectsNSM.pages=[];for(var gt=[],i=0;i{_o.activate("edit_delete_confirmEffects",[String(Tt.effectMultiSel.length)],()=>{const t=Symbol();for(const e of Tt.effectMultiSel)Tt.effects[e]=t;Tt.effects=Tt.effects.filter(e=>e!==t),Tt.effectMultiSel=[],Tt.effectMultiSelLast=!1,Tt.effectSelLast=!0,Tt.effectsTabSel=0})}}),Tt.effectsNSM.pages[1].items.push({type:"number",name:"edit_effects_item_track",hint:"edit_effects_item_track_sub",min:0,max:21,bigChange:3,smallChange:1,multiple:!0,vars:I.track},{type:"boolean",name:"edit_effects_item_disable",vars:I.disabled,hint:"edit_effects_item_disable_sub",multiple:!0},{type:"button",name:"edit_select_item_copy",event:On,hint:"edit_select_item_copy_sub"})}Tt.effectsNSM.draw({x:width-width/4,y:height/16*2,width:width/4,height:height/16*12,stacked:!0,maxBarHeight:height/16/1.25,buffer:height/16*12/128}),fill(255,200),textAlign(LEFT,TOP),textSize(kt/2.5),text(Zn(),kt,height/16+kt)}else if(0===Tt.editorMode&&0mt((e,t)=>t<=e)},{type:"button",name:"edit_select_item_selectCurrent",hint:"edit_select_item_selectCurrent_sub",event:()=>mt((e,t)=>t===e)},{type:"button",name:"edit_select_item_selectAfter",hint:"edit_select_item_selectAfter_sub",event:()=>mt((e,t)=>e<=t)})}else{for(var pt=!1,i=0;ids([2,5,8,1,4,7,0,3,6])},{type:"button",name:"edit_select_item_rotateCCW",hint:"edit_select_item_rotateCCW_sub",event:()=>ds([6,3,0,7,4,1,8,5,2])},{type:"button",name:"edit_select_item_cycleCW",hint:"edit_select_item_cycleCW_sub",event:()=>ds([1,2,5,0,4,8,3,6,7])},{type:"button",name:"edit_select_item_cycleCCW",hint:"edit_select_item_cycleCCW_sub",event:()=>ds([3,0,1,6,4,2,7,8,5])},{type:"button",name:"edit_select_item_flipH",hint:"edit_select_item_flipH_sub",event:()=>ds([2,1,0,5,4,3,8,7,6])},{type:"button",name:"edit_select_item_flipV",hint:"edit_select_item_flipV_sub",event:()=>ds([6,7,8,3,4,5,0,1,2])}),1===Tt.selectedBeats.length&&Tt.beatNSM.pages[0].items.push({type:"button",name:"edit_effects_item_deleteAutomation",event:function(){Tt.beat.splice(Tt.selectedBeats[0],1),Tt.selectedBeats=[]},hint:"edit_effects_item_deleteAutomation_sub"}),1{_o.activate("edit_delete_confirmNotes",[String(Tt.selectedBeats.length)],()=>{const t=Symbol();for(const e of Tt.selectedBeats)Tt.beat[e]=t;Tt.beat=Tt.beat.filter(e=>e!==t),Tt.selectedBeats=[]})}}),Tt.sbeatsLast=Tt.selectedBeats.concat()}Tt.beatNSM.draw({x:width-width/4,y:height/16*3,width:width/4,height:height/16*10,stacked:!0,maxBarHeight:height/16/1.25,buffer:height/16*12/128})}}else fill(0,0,0,200),rectMode(CORNER),noStroke(),rect(width-width/4,height/16*3,width/2,height/16*10,(width{var e=Tt.sectionsSelected[0];void 0!==e&&(e=Tt.sections[e])&&(Tt.timelineBPM=e.bpm,Tt.timelineOffset=e.offset)}},{type:"button",name:"edit_effects_item_deselectAutomation",event:function(){Tt.sectionsSelected=[]},hint:"edit_effects_item_deselectAutomation_sub"},{type:"button",name:"edit_effects_item_deleteAutomation",event:function(){Tt.sections.splice(Tt.sectionsSelected[0],1),Tt.sectionsSelected=[]},hint:"edit_effects_item_deleteAutomation_sub"}),Tt.sectionsSelectedLast=Tt.sectionsSelected.concat()),Tt.sectionsNSM.draw({x:width-width/4,y:height/16*3,width:width/4,height:height/16*10,stacked:!0,maxBarHeight:height/16/1.25,buffer:height/16*12/128});if(Tt.showGUI&&(fill(255,200),textAlign(LEFT,BOTTOM),textSize(kt/2),text(Jt("edit_hint_keybinds_array",xt).join("\n"),kt,height-(height/16+kt)),fill(lerp(0,25,Tt.menuSize),lerp(200,255,Tt.menuSize)),rectMode(CORNER),noStroke(),rect(0,height-height/16*Tt.headerY,width,lerp(height/16*-(Tt.toolsH+1),-height,Tt.menuSize))),Tt.tools[1][3]=[],0===Tt.objType?(Tt.tools[1][0]="edit_tool_object_beat",Tt.tools[1][1]=St.objectBeat,Tt.tools[1][4]="edit_tool_object_beat"):(Tt.tools[1][0]="edit_tool_object_hold",Tt.tools[1][1]=St.objectHold,Tt.tools[1][3].push(["edit_tool_object_holdLengthVal",St.objectHoldTime,0,!1,!1,[Tt.holdLength]]),Tt.tools[1][4]="edit_tool_object_hold"),Tt.tools[1][3].push(["edit_tool_object_beatColor",St.beatColor,0,!1,!1,[Tt.beatColor,Tt.beatSaturation,Tt.beatBrightness]],["edit_tool_object_transitionIn",St.beatTransitionIn,0,!1,!1,[Tt.transitionNames[Tt.transitionIn]]],["edit_tool_object_transitionOut",St.beatTransitionOut,0,!1,!1,[Tt.transitionNames[Tt.transitionOut]]]),.5===Tt.playbackRate?Tt.tools[2][1]=St.playbackHalf:Tt.tools[2][1]=St.playbackFull,0===Tt.editorMode?(Tt.tools[7][0]="edit_tool_mode_gameplay",Tt.tools[7][1]=St.editorModeGameplay):(Tt.tools[7][0]="edit_tool_mode_effects",Tt.tools[7][1]=St.editorModeEffects),Tt.tools[2][0]="edit_tool_playback",Tt.tools[2][5]=[Tt.playbackRate],void 0!==Qt[Tt.song]&&Qt[Tt.song].rate(Tt.playbackRate),Tt.tools[3][0]="edit_tool_timeline",Tt.tools[3][1]=St.timelineTools,Tt.tools[3][4]="edit_tool_timeline",Tt.tools[3][3]=[],Tt.tools[3][3].push(["edit_tool_snap",St.timelineSnap,0,!1,!1,["1/"+Ot(1/Tt.snap)]],["edit_tool_bpm",St.metronome,0,!1,!1,[Tt.timelineBPM]],["edit_tool_bpm_offset",St.timelineOffset,0,!1,!1,[Pt("milliseconds_short",xt,Tt.timelineOffset)]],["edit_tool_section",St.bookmark,0],["edit_tool_timestamp",St.jumpToTimestamp,0]),"scroll"===Tt.timelineMode?(Tt.tools[4][0]="edit_tool_timelineMode",Tt.tools[4][1]=St.clickModeScroll,Tt.tools[4][5]=[Pt("edit_timelineMode_scroll",xt)],Tt.selectedBeats=[],Tt.sectionsSelected=[]):"select"===Tt.timelineMode&&(Tt.tools[4][0]="edit_tool_timelineMode",Tt.tools[4][1]=St.clickModeSelect,Tt.tools[4][5]=[Pt("edit_timelineMode_select",xt)]),Tt.saveNoticeDis+=At(Tt.saveNotice,Tt.saveNoticeDis,.15),Ot(100*Tt.saveNoticeDis)/100==1&&(Tt.saveNotice=0),textAlign(RIGHT,TOP),fill(255),Dt(Pt("edit_menu_item_saved",xt),width-kt,height+2*kt-Tt.saveNoticeDis*(6*kt),width,kt),!1===Tt.menu){if(Tt.saved=!1,Tt.showGUI)for(i=0;iwidth-height/32*(Tt.toolsH+1)/2&&(wt=width-height/32*(Tt.toolsH+1)/2-Ct),!1!==Tt.tools[i][3]&&(yt=1.5),fill(25,255),ellipseMode(CORNER),rect(wt,height-height/32*(Tt.toolsH+1)*(4*yt*Tt.tools[i][2]),Ct,height/32*(Tt.toolsH+1)*1.5,height/32*(Tt.toolsH+1)*2),fill(255),textAlign(CENTER,CENTER),text(bt,wt+(textWidth(bt)+height/32*(Tt.toolsH+1))/2,height-height/32*(Tt.toolsH+1)*(4*yt*Tt.tools[i][2])+height/32*(Tt.toolsH+1)*1.5/2),!1!==Tt.tools[i][3]){rectMode(CORNER),fill(0,200*Tt.tools[i][2]),rect(width/Tt.tools.length*i,height-height/32*(Tt.toolsH+1)*(4*Tt.tools[i][2]),width/Tt.tools.length,height/16*(Tt.toolsH+1));for(t=0;t=Tt.effects[t].time&&In("effected",Tt.effects[t]),1===Tt.editorMode&&Tt.showGUI&&Tt.effects[t].time<=Tt.time+5&&Tt.effects[t].time+Tt.effects[t].moveTime>=Tt.time-5&&Tt.drawEffects.push(t)):Tt.effects.splice(t,1))}}if(!Tt.edit&&!Tt.mods.noEffects){void 0===Tt.effectsCache.boardX&&(Tt.effectsCache.boardX=0,Tt.effectsCache.boardY=0,Tt.effectsCache.boardW=1,Tt.effectsCache.boardH=1,Tt.effectsCache.boardR=0,Tt.effectsCache.boardA=1,Tt.effectsCache.tileX=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileY=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileW=[1,1,1,1,1,1,1,1,1],Tt.effectsCache.tileH=[1,1,1,1,1,1,1,1,1],Tt.effectsCache.tileR=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileA=[1,1,1,1,1,1,1,1,1],Tt.effectsCache.ar=0,Tt.effectsCache.subtitles=[],Tt.effectsCache.vignette=0,Tt.effectsCache.letterboxX=0,Tt.effectsCache.letterboxY=0,Tt.effectsCache.tileColor=[141,141,141,141,141,141,141,141,141],Tt.effectsCache.tileSaturation=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileBrightness=[255,255,255,255,255,255,255,255,255],Tt.effectsCache.tileAlpha=[255,255,255,255,255,255,255,255,255],Tt.effectsCache.tileOverlayColor=[141,141,141,141,141,141,141,141,141],Tt.effectsCache.tileOverlaySaturation=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileOverlayBrightness=[255,255,255,255,255,255,255,255,255],Tt.effectsCache.tileOverlayAlpha=[255,255,255,255,255,255,255,255,255],Tt.effectsCache.foregroundOverlayColor=141,Tt.effectsCache.foregroundOverlaySaturation=255,Tt.effectsCache.foregroundOverlayBrightness=255,Tt.effectsCache.foregroundOverlayAlpha=0,Tt.effectsCache.backgroundOverlayColor=141,Tt.effectsCache.backgroundOverlaySaturation=255,Tt.effectsCache.backgroundOverlayBrightness=255,Tt.effectsCache.backgroundOverlayAlpha=0,Tt.effectsCache.tileTrailLength=[0,0,0,0,0,0,0,0,0],Tt.effectsCache.tileTrailSpacing=[25,25,25,25,25,25,25,25,25],Tt.effectsCache.tileTrailAlpha=[.5,.5,.5,.5,.5,.5,.5,.5,.5],Tt.effectsCache.tileTrailColor=[!0,!0,!0,!0,!0,!0,!0,!0,!0],Tt.effectsCache.tileTrailDelete=[0,0,0,0,0,0,0,0,0]),Tt.effected.boardX=Tt.effectsCache.boardX,Tt.effected.boardY=Tt.effectsCache.boardY,Tt.effected.boardW=Tt.effectsCache.boardW,Tt.effected.boardH=Tt.effectsCache.boardH,Tt.effected.boardR=Tt.effectsCache.boardR,Tt.effected.boardA=Tt.effectsCache.boardA;for(t=0;t<9;t++)Tt.effected.tileX[t]=Tt.effectsCache.tileX[t],Tt.effected.tileY[t]=Tt.effectsCache.tileY[t],Tt.effected.tileW[t]=Tt.effectsCache.tileW[t],Tt.effected.tileH[t]=Tt.effectsCache.tileH[t],Tt.effected.tileR[t]=Tt.effectsCache.tileR[t],Tt.effected.tileA[t]=Tt.effectsCache.tileA[t],Tt.effected.tileColor[t]=Tt.effectsCache.tileColor[t],Tt.effected.tileSaturation[t]=Tt.effectsCache.tileSaturation[t],Tt.effected.tileBrightness[t]=Tt.effectsCache.tileBrightness[t],Tt.effected.tileAlpha[t]=Tt.effectsCache.tileAlpha[t],Tt.effected.tileOverlayColor[t]=Tt.effectsCache.tileOverlayColor[t],Tt.effected.tileOverlaySaturation[t]=Tt.effectsCache.tileOverlaySaturation[t],Tt.effected.tileOverlayBrightness[t]=Tt.effectsCache.tileOverlayBrightness[t],Tt.effected.tileOverlayAlpha[t]=Tt.effectsCache.tileOverlayAlpha[t],Tt.effected.tileTrailLength[t]=Tt.effectsCache.tileTrailLength[t],Tt.effected.tileTrailSpacing[t]=Tt.effectsCache.tileTrailSpacing[t],Tt.effected.tileTrailAlpha[t]=Tt.effectsCache.tileTrailAlpha[t],Tt.effected.tileTrailColor[t]=Tt.effectsCache.tileTrailColor[t],Tt.effected.tileTrailDelete[t]=Tt.effectsCache.tileTrailDelete[t];Tt.effected.ar=Tt.effectsCache.ar,Tt.effected.subtitles=[],Tt.effected.vignette=Tt.effectsCache.vignette,Tt.effected.letterboxX=Tt.effectsCache.letterboxX,Tt.effected.letterboxY=Tt.effectsCache.letterboxY,Tt.effected.foregroundOverlayColor=Tt.effectsCache.foregroundOverlayColor,Tt.effected.foregroundOverlaySaturation=Tt.effectsCache.foregroundOverlaySaturation,Tt.effected.foregroundOverlayBrightness=Tt.effectsCache.foregroundOverlayBrightness,Tt.effected.foregroundOverlayAlpha=Tt.effectsCache.foregroundOverlayAlpha,Tt.effected.backgroundOverlayColor=Tt.effectsCache.backgroundOverlayColor,Tt.effected.backgroundOverlaySaturation=Tt.effectsCache.backgroundOverlaySaturation,Tt.effected.backgroundOverlayBrightness=Tt.effectsCache.backgroundOverlayBrightness,Tt.effected.backgroundOverlayAlpha=Tt.effectsCache.backgroundOverlayAlpha;for(t=0;tTt.time);t++)Tt.effectsFinished[t]||(Tt.effects[t].time+Tt.effects[t].moveTime{So(S),Gn({type:"success",message:"game_performanceDot_copied",keys:[Pt("milliseconds_short",xt,S)]})},pop()}}translate(0,f/1920*1080+2*kt);var b=height/3*2-2*kt-Ot(height/32)-kt-f/1920*1080;textSize(b/Tt.hitValues.length/1.25);for(a=0;aTt.time&&Tt.beat[t][1]-Tt.hw>Tt.time));n++)if(!0!==Tt.beat[t][2]){if(Tt.beat[t][1]+(1===Tt.beat[t][5]?Tt.beat[t][6]:0)+Tt.hw*Tt.hitValues[Tt.hitValues.length-2].timingTt.beat[t][1]&&Tt.time=Tt.beat[t][6]&&Rn(Tt.beat[t][0])}return{drawableBeats:i}},cs.sortBeats=function(e,t){let i=[];if(t){i=X(e);for(var o=0;o=Ot(Ie)-1&&Ot((height=Tt.editorHSStart&&!(mouseY=Tt.editorHSStart&&!(mouseYTt.metronomeLast&&Tt.metronome&&!(mouseYTt.comboMax&&(Tt.comboMax=Tt.combo),Tt.time>Tt.timeEnd+Tt.hw&&Tt.time>Tt.timeEnd+Tt.ar&&!1===Tt.edit&&(Tt.disMode=2);for(var e,t=0;t=Tt.replay.press[Tt.replay.pressI][1]-Tt.bpm/60/60/2&&(xn(Tt.replay.press[Tt.replay.pressI][0]),Tt.replay.pressI++),Tt.replay.releaseI=Tt.replay.release[Tt.replay.releaseI][1]-Tt.bpm/60/60/2&&(bn(Tt.replay.release[Tt.replay.releaseI][0]),Tt.replay.releaseI++)},fs.screens=function(){if("click"===He&&3e3<=millis()&&fs.screens.click(),"menu"===He)if("logo"===Bt.screen&&fs.screens.logo(),"logo"!==Bt.screen&&"main trans"!==Bt.screen&&fs.screens.header(),!0===Bt.side)fs.screens.nav();else if("account"===Bt.screen&&""===T.uuid)fs.screens.accountSignedOut();else if("account"===Bt.screen)fs.screens.accountSignedIn();else if("lvl"===Bt.screen&&!1===Bt.lvl.loading&&!0!==Ne){Rt=[],Rt=Uo(Ht.search,Bt.lvl.sortMode);for(var e=0;e(height-(height/16+height/24))/(height/12)?Bt.lvl.scroll/(height-(height/16+height/24)-(height-(height/16+height/24))/12)*(height/12*(Rt.length-(height-(height/16+height/24))/(height/12))):0))height?width:height,Ft("rcorner",0,i,width/3-width/48,height/12))&&(Bt.lvl.sel=e,!(Bt.lvl.deleteConfirm=!1)===Rt[e].local?Tt.mods.offset=Ht.localOffsets[Ht.saved.indexOf(Rt[e])]:Tt.mods.offset=Ht.onlineOffsets[Rt[e]],void 0!==Tt.mods.offset&&null!==Tt.mods.offset||(Tt.mods.offset=0));if(!1!==Bt.lvl.sel)if(!1===Bt.lvl.deleteConfirm&&!1===Bt.lvl.uploadConfirm)if(Bt.lvl.showMods)if(vt.active)vt.callback?.();else{if(Ft("rcorner",width/3+kt+((width/3*2-2*kt)/2+kt/2),height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2+((height-height/16)/3/3-kt/2)/4*3-kt/2,(width/3*2-2*kt)/2-kt/2,((height-height/16)/3/3-kt/2)/2)&&(Bt.lvl.buttonHover[11]/=4,Bt.lvl.showMods=!Bt.lvl.showMods),Ft("rcorner",width/3+kt+((width/3*2-2*kt)/2+kt/2),height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2+((height-height/16)/3/3-kt/2)/4*3-kt/2-((height-height/16)/3/3-kt/2)/2-kt/2,(width/3*2-2*kt)/2-kt/2,((height-height/16)/3/3-kt/2)/2)&&(Bt.lvl.buttonHover[15]/=4,vt.active=!0),Ft("rcorner",width/3+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2+((height-height/16)/3/3-kt/2)/4*3-kt/2,(width/3*2-2*kt)/2-kt/2,((height-height/16)/3/3-kt/2)/2))for(var t in Bt.lvl.buttonHover[13]/=4,Tt.modsDef)"offset"!==t&&(Tt.mods[t]=Tt.modsDef[t]);Bt.lvl.modsNSM.click()}else if(!0===Rt[Bt.lvl.sel]?.local)Bt.lvl.showLeaderboard||Bt.lvl.showMods?Bt.lvl.showLeaderboard&&Ft("rcorner",width/3+kt+((width/3*2-2*kt)/2+kt/2),height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-2*kt)/2-kt/2,(height-height/16)/3/3-kt/2)&&(Bt.lvl.buttonHover[9]/=2,Bt.lvl.showLeaderboard=!Bt.lvl.showLeaderboard):(Ft("rcorner",width/3+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt,(width/3*2-2*kt)/2-kt/2,(height-height/16)/3/3*2-kt/2)&&(Tt.edit=!1,Tt.replay.on=!1,qi(Bt.lvl.sel),Bt.lvl.buttonHover[0]/=2),Ft("rcorner",width/3+kt+(width/3*2-4*kt)/3*0,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)&&(Bt.lvl.deleteConfirm=!0,Bt.lvl.buttonHover[1]/=2),Ft("rcorner",width/3+kt+((width/3*2-2*kt)/2-kt/2)+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt,(width/3*2-2*kt)/2-kt/2,(height-height/16)/3/3*2-kt/2)&&(Tt.edit=!0,Tt.replay.on=!1,qi(Bt.lvl.sel),Bt.lvl.buttonHover[2]/=2),!Ft("rcorner",width/3+3*kt+(width/3*2-4*kt)/3*2,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)||void 0!==Rt[Bt.lvl.sel].copy&&Rt[Bt.lvl.sel].author!==T.uuid||(Bt.lvl.uploadConfirm=!0,Bt.lvl.buttonHover[3]/=2),Ft("rcorner",width/3+2*kt+(width/3*2-4*kt)/3*1,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)&&(Bt.lvl.buttonHover[12]/=2,Bt.lvl.showMods=!Bt.lvl.showMods),Ft("ccenter",width/3+kt+(width/3*2/3*2-2*kt)+kt+width/3*2/3-kt-1.5*kt,height/16+kt+(height-height/16)/3-2*kt-1.5*kt,1.5*kt,1.5*kt)&&(Ht.savedDiffReq[Rt[Bt.lvl.sel].index]=void 0,Sn.clear(),--Bt.lvl.refreshArrowR));else if(Bt.lvl.showLeaderboard||Bt.lvl.showMods)Bt.lvl.showLeaderboard&&(r=floor(height/12)-kt,Ft("rcorner",width/3+width/3+kt/2,height-height/12+kt/2,width/6,r)&&(Bt.lvl.buttonHover[9]/=2,Bt.lvl.showLeaderboard=!Bt.lvl.showLeaderboard),"Loading..."!==Bt.lvl.leaderboardData&&Ft("rcorner",width/3+width/3-width/6-kt/2,height-height/12+kt/2,width/6,r)&&(Bt.lvl.buttonHover[14]/=2,v.grabbedScoresLevel.splice(Rt[Bt.lvl.sel],1),mn.clear()),Ft("rcorner",width/3,height-floor(height/12),width,floor(height/12))||Bt.lvl.newLeaderboard.click());else{if(Ft("rcorner",width/3+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt,width/3*2-2*kt,(height-height/16)/3/3*2-kt/2)){switch(qo(Rt[Bt.lvl.sel])){case 0:m(Rt[Bt.lvl.sel],"id",!0);break;case 1:break;case 2:Tt.edit=!1,Tt.replay.on=!1,qi(Bt.lvl.sel)}Bt.lvl.buttonHover[4]/=2}Ft("rcorner",width/3+kt+(width/3*2-4*kt)/3*0,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)&&(-1!==Ht.saved.indexOf(Rt[Bt.lvl.sel])?(Ht.scores.splice(Ht.saved.indexOf(Rt[Bt.lvl.sel]),1),Ht.saved.splice(Ht.saved.indexOf(Rt[Bt.lvl.sel]),1),0===Bt.lvl.tab&&(Ht.search=[],Bt.lvl.sel=!1,Bt.lvl.searchSent=!1)):Ht.saved.push(Rt[Bt.lvl.sel]),Bt.lvl.buttonHover[5]/=2),Ft("rcorner",width/3+3*kt+(width/3*2-4*kt)/3*2,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)&&(!0===H(Rt[Bt.lvl.sel],"id").ranked?Bt.lvl.showLeaderboard=!Bt.lvl.showLeaderboard:"Loading..."!==H(Rt[Bt.lvl.sel],"id").author&&"Metadata"!==H(Rt[Bt.lvl.sel],"id").beat&&Mo(Rt[Bt.lvl.sel]),Bt.lvl.buttonHover[8]/=2),Ft("rcorner",width/3+2*kt+(width/3*2-4*kt)/3*1,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-4*kt)/3,(height-height/16)/3/3-kt/2)&&(Bt.lvl.buttonHover[10]/=2,Bt.lvl.showMods=!Bt.lvl.showMods),Ft("ccenter",width/3+kt+(width/3*2/3*2-2*kt)+kt+width/3*2/3-kt-1.5*kt,height/16+kt+(height-height/16)/3-2*kt-1.5*kt,1.5*kt,1.5*kt)&&(v.newGrabbedLevels[Rt[Bt.lvl.sel]]=void 0,v.newGLRequested[Rt[Bt.lvl.sel]]=void 0,v.newGLRequestedT[Rt[Bt.lvl.sel]]=void 0,v.newGLDownloading[Rt[Bt.lvl.sel]]=void 0,Sn.clear(),--Bt.lvl.refreshArrowR)}else Ft("rcorner",-width/3*2+kt+width/3*3*Bt.lvl.deleteBanner,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-2*kt)/2-kt/2,(height-height/16)/3/3-kt/2)&&(Bt.lvl.deleteConfirm?(isNaN(Rt[Bt.lvl.sel].index)?Gn({type:"error",message:"menu_lvl_deleteError"}):(Ht.scores.splice(Rt[Bt.lvl.sel].index,1),Ht.localOffsets.splice(Rt[Bt.lvl.sel].index,1),Ht.saved.splice(Rt[Bt.lvl.sel].index,1),Ht.search=[],Bt.lvl.searchSent=!1,Bt.lvl.sel=!1),Bt.lvl.deleteConfirm=!1):Bt.lvl.uploadConfirm&&(Bt.lvl.uploading=!0,Bt.lvl.uploadConfirm=!1,void 0===Rt[Bt.lvl.sel].copy?Ho(Bt.lvl.sel):Ro(Rt[Bt.lvl.sel])),Bt.lvl.deleteBanner=0,Bt.lvl.buttonHover[6]/=2),Ft("rcorner",-width/3*2+width/3*3*Bt.lvl.deleteBanner+kt+((width/3*2-2*kt)/2-kt/2)+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,(width/3*2-2*kt)/2-kt/2,(height-height/16)/3/3-kt/2)&&(Bt.lvl.deleteConfirm=!1,Bt.lvl.uploadConfirm=!1,Bt.lvl.buttonHover[7]/=2);Bt.lvl.scrollNewLock||(Ft("rcorner",height/24*5,height/16,width/3-width/48-height/24*5,height/24)&&Ri({var:[Bt.lvl,"search"],title:"menu_lvl_search",type:"string",allowEmpty:!0,after:function(){Ht.search=[],Bt.lvl.sel=!1,Bt.lvl.searchSent=!1}}),Ft("rcorner",0,height/16,height/24,height/24)?(Bt.lvl.tab=0,Bt.lvl.sortMode="dateDesc",Bt.lvl.showUnranked=!0,Bt.lvl.search="",Ht.search=[],Bt.lvl.scroll=0,Bt.lvl.sel=!1,Bt.lvl.searchSent=!1,Bt.lvl.viewSkip=0):Ft("rcorner",height/24,height/16,height/24,height/24)?(Bt.lvl.tab=1,Bt.lvl.sortMode="starsAsc",Bt.lvl.showUnranked=!1,Bt.lvl.search="",Ht.search=[],Bt.lvl.scroll=0,Bt.lvl.sel=!1,Bt.lvl.searchSent=!1,Bt.lvl.viewSkip=0):Ft("rcorner",width/3-width/48,height/16,width/48,height/24)?Ji():Ft("rcorner",height/24*2,height/16,height/24,height/24)?(Bt.lvl.showUnranked=!Bt.lvl.showUnranked,Ht.search=[],Bt.lvl.sel=!1,Bt.lvl.tabHighlight[7]/=2,Bt.lvl.searchSent=!1,Bt.lvl.viewSkip=0):Ft("rcorner",height/24*4,height/16,height/24,height/24)?(Bt.lvl.searchMode=Bt.lvl.searchModes.indexOf(Bt.lvl.searchMode)+1,Bt.lvl.searchMode>Bt.lvl.searchModes.length-1&&(Bt.lvl.searchMode=0),Bt.lvl.searchMode=Bt.lvl.searchModes[Bt.lvl.searchMode],Bt.lvl.tabHighlight[2]/=2,Bt.lvl.searchSent=!1,Bt.lvl.viewSkip=0):Ft("rcorner",height/24*3,height/16,height/24,height/24)&&(Bt.lvl.sortMode=Bt.lvl.sortModes.indexOf(Bt.lvl.sortMode)+1,Bt.lvl.sortMode>Bt.lvl.sortModes.length-1&&(Bt.lvl.sortMode=0),Ht.search=[],Bt.lvl.sortMode=Bt.lvl.sortModes[Bt.lvl.sortMode],Bt.lvl.tabHighlight[4]/=2,Bt.lvl.searchSent=!1,Bt.lvl.viewSkip=0))}else if("song"===Bt.screen)if("song"===Bt.song.mode){Rt=[],Rt=Uo(O.search,Bt.song.sortMode);for(var i,e=0;e(height-(height/16+height/24))/(height/12)?Bt.lvl.scroll/(height-(height/16+height/24)-(height-(height/16+height/24))/12)*(height/12*(Rt.length-(height-(height/16+height/24))/(height/12))):0))height?width:height,Ft("rcorner",0,i,width/3-width/48,height/12))&&(!0===Bt.song.listening&&(Bt.song.listening=!1,soundManager.pause(Rt[Bt.song.sel]),soundManager.setVolume("menuMusic",Bt.settings.musicVolume)),Bt.song.sel=e);!1!==Bt.song.sel&&(Ft("rcorner",width/3+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt,width/3*2-2*kt,(height-height/16)/3/3*2-kt/2)&&(So(String(Rt[Bt.song.sel])),Bt.song.buttonHover[4]/=2),Ft("rcorner",width/3+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)+kt+(height-height/16)/3/3*2+kt/2,width/3*2-2*kt,(height-height/16)/3/3-kt/2)&&(-1!==O.saved.indexOf(Rt[Bt.song.sel])?(O.saved.splice(O.saved.indexOf(Rt[Bt.song.sel]),1),0===Bt.song.tab&&(O.search=[],Bt.song.sel=!1)):O.saved.push(Rt[Bt.song.sel]),Bt.song.buttonHover[5]/=2),Ft("rcorner",width/3+kt+kt,height/16+kt+((height-height/16)/3-2*kt)+kt+((height-height/16)/3-2*kt)/2-kt,2*kt,2*kt))&&(!1===Bt.song.listening?(Bt.song.listening=!0,ao(Rt[Bt.song.sel]),soundManager.load(Rt[Bt.song.sel]),soundManager.setVolume(Rt[Bt.song.sel],Bt.settings.musicVolume),soundManager.setVolume("menuMusic",0)):(Bt.song.listening=!1,soundManager.pause(Rt[Bt.song.sel]),soundManager.setVolume("menuMusic",Bt.settings.musicVolume))),Ft("rcorner",0,height/16,height/24,height/24)?(Bt.song.listening&&(Rt=[],Rt=O.search,Bt.song.listening=!1,soundManager.pause(Rt[Bt.song.sel]),soundManager.setVolume("menuMusic",Bt.settings.musicVolume)),Bt.song.tab=0,Bt.song.search="",O.search=[],Bt.lvl.scroll=0,Bt.song.sel=!1):Ft("rcorner",height/24,height/16,height/24,height/24)?(Bt.song.listening&&(Rt=[],Rt=O.search,Bt.song.listening=!1,soundManager.pause(Rt[Bt.song.sel]),soundManager.setVolume("menuMusic",Bt.settings.musicVolume)),Bt.song.tab=1,Bt.song.search="",O.search=[],Bt.lvl.scroll=0,Bt.song.sel=!1):Ft("rcorner",width/3-width/48,height/16,width/48,height/24)&&!Bt.lvl.scrollNewLock?void 0!==T.uuid&&null!==T.uuid&&0!==T.uuid.length&&(Bt.song.listening=!1,soundManager.pause(Rt[Bt.song.sel]),soundManager.setVolume("menuMusic",Bt.settings.menuMusicVolume),Bt.song.mode="newSong",Bt.song.overlayOn=!0):Ft("rcorner",height/24*3,height/16,height/24,height/24)?(Bt.song.searchMode=Bt.song.searchModes.indexOf(Bt.song.searchMode)+1,Bt.song.searchMode>Bt.song.searchModes.length-1&&(Bt.song.searchMode=0),Bt.song.searchMode=Bt.song.searchModes[Bt.song.searchMode],Bt.song.tabHighlight[2]/=2):Ft("rcorner",height/24*2,height/16,height/24,height/24)&&(Bt.song.sortMode=Bt.song.sortModes.indexOf(Bt.song.sortMode)+1,Bt.song.sortMode>Bt.song.sortModes.length-1&&(Bt.song.sortMode=0),Bt.song.sortMode=Bt.song.sortModes[Bt.song.sortMode],Bt.song.tabHighlight[4]/=2),Ft("rcorner",height/24*4,height/16,width/3-width/48-height/24*4,height/24)&&Ri({var:[Bt.song,"search"],title:"menu_lvl_search",type:"string",allowEmpty:!0,after:function(){O.search=[],Bt.song.sel=!1}})}else"newSong"===Bt.song.mode?(Ft("rcorner",3*kt,height/16+height/32*3+7*kt+height/16*8,width/8,height/16)?(Bt.song.mode="song",Bt.song.overlayOn=!1,Bt.newSong.title="",Bt.newSong.artist="",Bt.newSong.link="",Bt.song.errors=[],Bt.song.blankErrors=[],Bt.song.takenErrors=[],Bt.song.buttonHover[4]/=2):Ft("rcorner",4*kt+width/8,height/16+height/32*3+7*kt+height/16*8,width/8,height/16)&&(gn(),Bt.account.buttonHover[3]/=2),Ft("rcorner",3*kt,height/16+height/32*3+3*kt+height/16,width/2,height/16)?Ri({var:[Bt.newSong,"title"],title:"menu_newSong_songTitle",type:"string",allowEmpty:!0}):Ft("rcorner",3*kt,height/16+height/32*3+4*kt+height/16*3,width/2,height/16)?Ri({var:[Bt.newSong,"artist"],title:"menu_newSong_songArtist",type:"string",allowEmpty:!0}):Ft("rcorner",3*kt,height/16+height/32*3+5*kt+height/16*5,width/2,height/16)&&(re.type="audio",re.sizeLimit=Bt.newSong.sizeLimit,re.success=e=>{e=e.file;const t=new FileReader;t.addEventListener("load",()=>{var e=t.result;Bt.newSong.link=e},!1),t.readAsDataURL(e)},settingsFileInput.elt.click())):"verify"===Bt.song.mode?2===Bt.newSong.songObject.readyState||!0===Bt.newSong.failedLinksCheck?Ft("rcorner",width/2-width/4/2,(height-height/16)/4*3,width/4,height/8)&&(Bt.song.mode="newSong",Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.failedLinks[Bt.newSong.failedLinks.length]=Bt.newSong.link,Bt.newSong.failedLinksCheck=!1,Bt.song.buttonHover[7]/=2):3===Bt.newSong.songObject.readyState&&(Ft("rcorner",width/16*11-width/4/2,(height-height/16)/4*3,width/4,height/8)&&(Bt.song.mode="newSong",Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.verifyDim=0,Bt.newSong.failedLinksCheck=!1,Bt.song.buttonHover[8]/=2,soundManager.stop(Bt.newSong.link+"verify"),to()),Ft("rcorner",width/16*5-width/4/2,(height-height/16)/4*3,width/4,height/8))&&(Bt.song.mode="upload",Bt.song.buttonHover[7]/=2,soundManager.stop(Bt.newSong.link+"verify"),to(),B("uploadSong",{name:Bt.newSong.title,artist:Bt.newSong.artist,link:Bt.newSong.link,uploader:T.uuid,session:T.session})):"upload"===Bt.song.mode&&Ft("rcorner",width/2-width/4/2,(height-height/16)/4*3,width/4,height/8)&&(Bt.song.mode="song",Bt.song.overlayOn=!1,Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.failedLinks[Bt.newSong.failedLinks.length]=Bt.newSong.link,Bt.newSong.failedLinksCheck=!1,Bt.newSong.title="",Bt.newSong.artist="",Bt.newSong.link="",Bt.song.buttonHover[7]/=2);else if("online"===Bt.screen){if("main"===Bt.online.mode){for(e=0;eheight/16+height/24&&(Bt.online.viewUser=Bt.online.searchedUsers[e],Bt.online.mode="viewUser",Bt.online.viewUserUUIDCheck=!1,bo(Bt.online.viewUser));Ft("rcorner",height/24,height/16,width-height/24,height/24)&&Ri({var:[Bt.online,"search"],title:"menu_lvl_search",type:"string",allowEmpty:!0,after:function(){Bt.online.searchedUsers=[]}}),Ft("rcorner",0,height/16,height/24,height/24)&&(Bt.online.searchOnline=!Bt.online.searchOnline,Bt.online.tabHighlight[0]/=2,Bt.online.searchedUsers=[],v.newGrabbedUser=[],v.newGrabbedUserUsername=[],v.newGUUnix=[],v.newGURequested=[],v.newGURequestedT=[])}else if("viewUser"===Bt.online.mode)$n("online");else if("newSong"===Bt.online.mode)!1===Bt.newSong.verify?Ft("rcorner",width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8,height/64)?Bt.online.mode="song":Ft("rcorner",width/4+width/32/2,(height-(height/16+height/32*3))/16*2+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8)?Ri({var:[Bt.newSong,"title"],title:"menu_newSong_songTitle",type:"string",allowEmpty:!1}):Ft("rcorner",width/4+width/32/2,(height-(height/16+height/32*3))/16*5+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8)?Ri({var:[Bt.newSong,"artist"],title:"menu_newSong_songArtist",type:"string",allowEmpty:!1}):Ft("rcorner",width/4+width/32/2,(height-(height/16+height/32*3))/16*8+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8)||Ft("rcorner",width/4+width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8)&&(0!==Bt.newSong.title.length&&0!==Bt.newSong.artist.length&&0!==Bt.newSong.link.length?Bt.newSong.verify=!0:Bt.newSong.verifyError=!0):!0===Bt.newSong.verify?2===Bt.newSong.songObject.readyState||!0===Bt.newSong.failedLinksCheck?Ft("rcorner",width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8,height/64)&&(Bt.newSong.verify=!1,Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.verifyDim=0,Bt.newSong.failedLinks[Bt.newSong.failedLinks.length]=Bt.newSong.link,Bt.newSong.failedLinksCheck=!1):3===Bt.newSong.songObject.readyState&&(Ft("rcenter",width/16*11,(height-height/16)/4*3,width/4,height/8,height/64)&&(Bt.newSong.verify=!1,Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.verifyDim=0,Bt.newSong.failedLinksCheck=!1,soundManager.stop(Bt.newSong.link+"verify")),Ft("rcenter",width/16*5,(height-height/16)/4*3,width/4,height/8,height/64))&&(Bt.newSong.verify="upload",soundManager.stop(Bt.newSong.link+"verify"),B("uploadSong",{name:Bt.newSong.title,artist:Bt.newSong.artist,link:Bt.newSong.link,uploader:T.uuid,session:T.session})):"upload"===Bt.newSong.verify&&Ft("rcorner",width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8,height/64)&&(Bt.newSong.verify=!1,Bt.newSong.songLoading=!1,Bt.newSong.songPlaying=!1,Bt.newSong.verifyDim=0,Bt.newSong.failedLinks[Bt.newSong.failedLinks.length]=Bt.newSong.link,Bt.newSong.failedLinksCheck=!1,Bt.newSong.uploaded=!1,Bt.newSong.uploadID=0);else if("levels"===Bt.online.mode){if(mouseY>(height-height/16)/4+height/16)for(e=0;ew||Ft("rcorner",width/2-width/4/2,height/2+height/8,width/4,height/8)&&(Bt.socialMedia.buttonHover[0]/=2,b());else if("morePulsus"===Bt.screen){var o=width/16/2/2,n=height/16*1.5;let e=0;for(const f of["https://patreon.com/tetrogem","https://discord.pulsus.cc","https://wiki.pulsus.cc","https://contribute.pulsus.cc"]){var s=height/8*1.5*e+height/8;Ft("rcorner",width-width/4-width/16+o,-height/8/2+n+s,width/4,height/8)&&(console.log("Open "+e),open(f),Bt.socialMedia.buttonHover[e]/=2),e++}}if("game"===He){if(1===Tt.disMode)if(!0===Tt.edit){var r,h,a=Tt.timelineBPM/Tt.bpm;if(!1===Tt.menu)if(Ft("rcorner",0,0,kt,kt))Nn();else{if(0===Tt.editorMode){for(e=0;e<9;e++)if(Ft("rcenter",Tt.board.w*Tt.board.c*3/8*(e%3-1)+width/2,Tt.board.h*Tt.board.c*3/8*(floor(e/3)-1)+height/2,Tt.board.w*Tt.board.c/4+Tt.board.str*(Tt.board.c/64)*Tt.missTiles[e][0],Tt.board.h*Tt.board.c/4+Tt.board.str*(Tt.board.c/64)*Tt.missTiles[e][0])){for(var l=!1,d=0;d=Tt.transitionNames.length-1?0:Tt.transitionIn+1:mouseButton===RIGHT&&(Tt.transitionIn=Tt.transitionIn<=0?Tt.transitionNames.length-1:Tt.transitionIn-1):2===c&&(mouseButton===LEFT?Tt.transitionOut=Tt.transitionOut>=Tt.transitionNames.length-1?0:Tt.transitionOut+1:mouseButton===RIGHT&&(Tt.transitionOut=Tt.transitionOut<=0?Tt.transitionNames.length-1:Tt.transitionOut-1))):3===e&&(0===d?kn("timelineSnap"):1===d?(J=Tt.timelineBPM,Tt.playing&&en(),Ri({var:[Tt,"timelineBPM"],title:"edit_tool_bpm_inp",type:"number",allowEmpty:!1,after:function(){var e=Tt.timelineBPM/Tt.bpm;Tt.time=Ot(Tt.time/J*Tt.timelineBPM*e*(1/Tt.snap))*Tt.snap/e,Tt.editorHSStart=!1,Tt.metronomeLast=!1}})):2===d?(_=Tt.timelineOffset,Tt.playing&&en(),Ri({var:[Tt,"timelineOffset"],title:"edit_tool_bpm_offset_inp",type:"number",allowEmpty:!1,after:function(){Tt.time+=Tt.bpm/60/1e3*(Tt.timelineOffset-_),Tt.editorHSStart=!1,Tt.metronomeLast=!1}})):3===d?An():4===d&&(Tt.playing&&en(),Tt.jumpToTimestamp=!1,Ri({var:[Tt,"jumpToTimestamp"],title:"edit_tool_timestamp",type:"string",allowEmpty:!0,after:function(){var e;null!==Tt.jumpToTimestamp&&!1!==(e=Ii(Tt.jumpToTimestamp))&&(Tt.time=e)},display:Xt({recieve:"bpm",time:Tt.time,bpm:Tt.timelineBPM,offset:Tt.timelineOffset,lvlBPM:Tt.bpm})}))))}else Tt.exiting?(r=(width/2-2*kt)/1.5,h=height/4/1.5,Ft("rcorner",width/4-r/2,height/4*2.5-h/4,r,h)&&(Tt.buttonHover[2]/=2,yn()),Ft("rcorner",width/4*3-r/2,height/4*2.5-h/4,r,h)&&(Tt.buttonHover[3]/=2,Tt.exiting=!1)):(Tt.menuNSM.click(),Ft("rcorner",width/Tt.tools.length*(Tt.tools.length-1),height-height/16*Tt.headerY,width/Tt.tools.length,height/16*-(Tt.toolsH+1))&&(Tt.menu=!1))}else Tt.paused&&1===Tt.disMode&&!1===Tt.resumeTime&&(Ft("rcorner",width/2-width/4/2,height/2-height/8/2-height/8*1.25,width/4,height/8)?Mn("continue"):Ft("rcorner",width/2-width/4/2,height/2-height/8/2,width/4,height/8)&&Mn("retry"),Ft("rcorner",width/2-width/4/2,height/2-height/8/2+height/8*1.25,width/4,height/8))&&Mn("menu");2===Tt.disMode&&!1===Tt.edit&&(Ft("rcorner",width/3*2+kt,height-height/8-kt,width/3-2*kt,height/8)?Mn("menu"):Ft("rcorner",width/3*2+kt,height-height/8*2-2*kt,width/3-2*kt,height/8)?Mn("retry"):Tt.performanceDotCallback&&Tt.performanceDotCallback())}};let us=function(){var e=width>height?width/64:height/64;Ft("rcorner",2*e,height/16+2*e,(width>height?height:width)/3-2*e,(width>height?height:width)/3-2*e)&&(re.type="image",re.sizeLimit=512e3,re.success=function(e){B("changePP",{pp:e.data,user:T.uuid,session:T.session})},settingsFileInput.elt.click()),Ft("rcorner",3*e+(width>height?height:width)/3-2*e,height/16+e+(width>height?height:width)/3/4*3-(width>height?height:width)/3/4/1.5/2,width/3*1.5-(width>height?height:width)/3-2*e,(width>height?height:width)/3/4/1.5)&&(Bt.account.countryScreen=!0),Ft("rcorner",e,height/16+2*e+height/3,width/3*1.5,height/3*2-height/16-3*e-3*e)&&(Bt.newBio="",e=(e=Ut(T.uuid,"uuid").bio)!==String(e)?void 0:e.substr(0,256),Bt.newBio=e,Ri({var:[Bt,"newBio"],title:"menu_account_changeBio",type:"string",allowEmpty:!0,after:function(){B("changeBio",{bio:Bt.newBio.substr(0,256),user:T.uuid,session:T.session})}})),$n()},vs=function(){mouseY>height/16&&B("changeCountry",{country:Me[xt][Bt.account.countrySel][1],user:T.uuid,session:T.session})},ms=function(){for(var e=0;eheight/16+height/24&&(Bt.account.viewFriend=Bt.online.searchedUsers[e]);Ft("rcorner",0,height/16,height/24,height/24)&&(Bt.account.onlineOnly=!Bt.account.onlineOnly,Bt.account.tabHighlight[0]/=2,Bt.online.searchedUsers=[]),Ft("rcorner",height/24+width-height/24*4,height/16,height/24*3,height/24)&&(Bt.account.friendsScreen=!1,Bt.account.tabHighlight[1]/=2)};function ps(){if(0w?e:t).push([4,"theme_platinum"],[5,"theme_gold"],[6,"theme_blackGold"],[7,"theme_premium"],[8,"theme_ruby"],[9,"theme_amethyst"]),Bt.settings.menu.pages[0].items[2]),o=0;ogs(),1e3/Bt.settings.fpsLimit)),it=Bt.settings.fpsLimit),no.gain.setValueAtTime(0,oo.currentTime),w=Math.round((new Date).getTime()/1e3),rt=performance.now()-st,st=performance.now(),xe=!1,kt=width>height?width/64:height/64;var e=verge.viewportW(),t=verge.viewportH(),e=(!(0===Ke||1e3<=millis()-Ke)||width===e&&height===t||(resizeCanvas(e,t),console.log("Resized"),Ke=millis(),fitth=width>height?height:width),Fe.log.push(rt),50e+t,0)/Fe.log.length);Fe.dis=1/(e/1e3),"c25cd9c8-d6e1-4d7e-8faa-ecd5e277c833"===T.uuid&&(Tt.ranks[Tt.ranks.length-2].symbol="7"),0===Bt.settings.language?xt="en":1===Bt.settings.language?xt="de":2===Bt.settings.language?xt="es":3===Bt.settings.language?xt="fr":4===Bt.settings.language?xt="ru":5===Bt.settings.language?xt="nl":6===Bt.settings.language?xt="th":7===Bt.settings.language?xt="ro":8===Bt.settings.language?xt="pt_BR":9===Bt.settings.language?xt="pl":10===Bt.settings.language?xt="tl":11===Bt.settings.language&&(xt="tr"),Tt.hitValues[0].name=Pt("game_hit_marvelous",xt),Tt.hitValues[1].name=Pt("game_hit_great",xt),Tt.hitValues[2].name=Pt("game_hit_good",xt),Tt.hitValues[3].name=Pt("game_hit_ok",xt),Tt.hitValues[4].name=Pt("game_hit_miss",xt),0===Bt.settings.keyboard?Tt.keys=["R","T","Y","F","G","H","V","B","N"]:1===Bt.settings.keyboard?Tt.keys=["R","T","Z","F","G","H","V","B","N"]:2===Bt.settings.keyboard?Tt.keys=[["Numpad7","Digit7"],["Numpad8","Digit8"],["Numpad9","Digit9"],["Numpad4","Digit4"],["Numpad5","Digit5"],["Numpad6","Digit6"],["Numpad1","Digit1"],["Numpad2","Digit2"],["Numpad3","Digit3"]]:3===Bt.settings.keyboard?Tt.keys=["KeyR","KeyT","KeyY","KeyF","KeyG","KeyH","KeyV","KeyB","KeyN"]:4===Bt.settings.keyboard?Tt.keys=["PrintScreen","ScrollLock","Pause","Insert","Home","PageUp","Delete","End","PageDown"]:5===Bt.settings.keyboard&&(Tt.keys=[["KeyR","Numpad7","Digit7"],["KeyT","Numpad8","Digit8"],["KeyY","Numpad9","Digit9"],["KeyF","Numpad4","Digit4"],["KeyG","Numpad5","Digit5"],["KeyH","Numpad6","Digit6"],["KeyV","Numpad1","Digit1"],["KeyB","Numpad2","Digit2"],["KeyN","Numpad3","Digit3"]]),!(Ut(T.uuid,"uuid").patreon>w)&&"Loading..."!==Ut(T.uuid,"uuid").patreon&&"Loading..."!==Ut(T.uuid,"uuid").user&&null!==Ut(T.uuid,"uuid").user&&void 0!==Ut(T.uuid,"uuid").user&&06e4/140&&(s.pulseBackR=s.theta,s.pulseBackS=s.size*(width/4)+2*s.pulse,s.pulse=1,s.pulseTime=millis()),s.pulse=Et(millis()-s.pulseTime,millis()-s.pulseTime,1,.2,6e4/140)):"main trans"===Bt.screen&&(s.pulse+=At(1,s.pulse,.2),s.w+=At(width/100,s.w,.2),s.h+=At(height/100,s.h,.2),s.size+=At(1,s.size,.2),s.theta+=At(0,s.theta,.2),s.strC[3]+=At(0,s.strC[3],.2),s.fillC[0]+=At(red($.main),s.fillC[0],.2),s.fillC[1]+=At(green($.main),s.fillC[1],.2),s.fillC[2]+=At(blue($.main),s.fillC[2],.2),Ot(5*s.w)===Ot(width/100*5))&&(Bt.screen="lvl"),!1!==Bt.trans&&(Bt.sideW+=At(6,Bt.sideW,.3),Bt.sideTextA+=At(0,Bt.sideTextA,.6),Ot(width/6*Bt.sideW)===width&&(Bt.sideW=6,Bt.sideTextA=0,Bt.sideX+=At(6,Bt.sideX,.3),Bt.screen=Bt.trans),Ot(width/6*Bt.sideX)===width)&&(Bt.side=!1,Bt.sideW=1,Bt.sideTextA=255,Bt.sideX=-1,Bt.trans=!1),"logo"===Bt.screen||"main trans"===Bt.screen?c.logo():c.pages()}function ws(){background(10),fill(255),textAlign(CENTER,CENTER),3e3<=millis()?Dt(Pt("clickToPlay",xt),width/2,height-height/8,width,height/32):Dt(Pt("loading",xt),width/2,height-height/8,width,height/32)}function Cs(){background(255);var e=width>height?width/64:height/64,t=(fill(0,s.textA),textSize(100),textAlign(CENTER,CENTER),Pt("welcome",xt)+(1===s.wave?" o/":"")),i=(fill(0,0),Dt(t,width/2,height/2,width/4,height/4),split(t,""));textAlign(LEFT,CENTER),textSize(5*e),noStroke();for(var o,n=0;nheight?width/64:height/64;Bt.account.overlayOn?(Ft("rcorner",3*e,height/16+height/32*3+7*e+height/16*8,width/8,height/16)?("haveCode"===Bt.account.mode?Bt.account.mode="resetPassword":"resetPasswordConf"===Bt.account.mode?Bt.account.mode="haveCode":(Bt.account.overlayOn=!1,Bt.account.user="",Bt.account.email="",Bt.account.pass="",Bt.account.passConf="",Bt.account.code="",Bt.account.codeUuid=""),Bt.account.errors=[],Bt.account.blankErrors=[],Bt.account.takenErrors=[],Bt.account.resetPassComplete=!1,Bt.account.buttonHover[2]/=2):Ft("rcorner",4*e+width/8,height/16+height/32*3+7*e+height/16*8,width/8,height/16)&&("signup"===Bt.account.mode?hn():"login"===Bt.account.mode?an():"resetPassword"===Bt.account.mode?fn():"haveCode"===Bt.account.mode?un():"resetPasswordConf"===Bt.account.mode&&vn(),Bt.account.buttonHover[3]/=2),"signup"===Bt.account.mode?Ft("rcorner",3*e,height/16+height/32*3+3*e+height/16,width/2,height/16)?Ri({var:[Bt.account,"user"],title:"menu_account_username",type:"string",allowEmpty:!0,after:function(){(Bt.account.blankErrors[0]||Bt.account.takenErrors[0])&&0height/16+height/16*e+height/16/2&&mouseYabs(width/5*Bt.sideW+Bt.sideX)&&mouseY>height/16&&(Bt.side=!1)},fs.notifications=function(e){for(var t=0;tw||(Bt.settings.menu.data.page=0,Bt.screen="patreon")},c.credits=function(){var e=width>height?width/64:height/64,t=(textAlign(CENTER,CENTER),fill($.text),[Pt("credits_client",xt),"TetroGem",Pt("credits_server",xt),U(["TetroGem","Epicness","Quintec"]),Pt("credits_programming",xt),"cg505",Pt("credits_security",xt),"Quintec",Pt("credits_art",xt),Pt("credits_and",xt,"TetroGem","Alexandre Declos"),Pt("credits_translation_de",xt),"Scath",Pt("credits_translation_es",xt),"Zemyro",Pt("credits_translation_fr",xt),Pt("credits_and",xt,"Alexandre Declos","Zemyro"),Pt("credits_translation_ru",xt),Pt("credits_and",xt,"ConfiG","Shiairo31"),Pt("credits_translation_nl",xt),"sbeve",Pt("credits_translation_th",xt),"oserottoNeko",Pt("credits_translation_ro",xt),"Stqrm26",Pt("credits_patreon",xt),U(["-Wiffles-","cg505","tokaku","Aero","ari","Lae_","Mungaru","rice","Tele_Crab","Tree42","AFasterSlowpoke","Arvid707","Cynth","Generic","ito","sbeve","sneaki"])]),i=(height-height/16)/(t.length+2);textSize(i);for(var o=0;oheight?width/64:height/64;imageMode(CENTER),image(1===Bt.settings.themeSel?St.discordLogoInvert:St.discordLogo,width/2,height/2-height/8-e,height/8*2,height/8*2),Kt(width/2-width/4/2,height/2,width/4,height/8,Pt("socialMedia_discord",xt),Bt.socialMedia.buttonHover,0)},c.patreon=function(){var e=width>height?width/64:height/64;Ut(T.uuid,"uuid").patreon>w?(fill($.text),textAlign(CENTER,CENTER),Dt(Pt("patreon_thanks",xt),width/2,height-height/8,width,height/16),Dt(Pt("patreon_joined",xt),width/2,height/4,width,height/32),imageMode(CENTER),image(St.platinum,width/2,height/2,height/2,height/2)):(fill($.text),textAlign(CENTER,CENTER),Dt(Pt("patreon_1",xt),width/2,height/2-height/16*4-e,width,height/16),textSize(height/16/1.5),textAlign(CENTER,CENTER),text(Pt("patreon_2",xt),width/2-width/2/2,height/2-height/16*4/2,width/2,height/16*4),imageMode(CENTER),image(1===Bt.settings.themeSel?St.patreonLogoInvert:St.patreonLogo,width/16*7,height/2-height/8-e,height/8*(2430/495),height/8),image(St.platinum,width/16*11,height/2-height/8-e,height/8,height/8),Kt(width/2-width/4/2,height/2+height/8,width/4,height/8,Pt("patreon_button",xt),Bt.socialMedia.buttonHover,0))},c.changelog=function(){var e=width>height?width/64:height/64,t=(push(),0!==Mt()&&(Bt.changelog.scroll+=e*Mt()/100),Vt*=.25,e/1.5),i=e,o=height/16+e,t=(textSize(t),Di(l,t,textLeading())),n=height-height/16*2,s=t-n,n=(Bt.changelog.scroll=constrain(Bt.changelog.scroll,0,s),push(),(height-height/16-e)*(n/t));translate(0,height/16+e/2),translate(0,(height-(height/16+e/2)-n-e/2)*(Bt.changelog.scroll/s)),fill(255),rectMode(CORNER),rect(width-.75*e,0,e/2,n,e),pop(),translate(0,-Bt.changelog.scroll),fill(255),textAlign(LEFT,TOP),text(l,i,o,width,t),pop()},c.online=function(){if("main"===Bt.online.mode)Co("main");else if("viewUser"===Bt.online.mode)wo(Bt.online.viewUser,"public");else if("song"===Bt.online.mode)Yo("song");else if("newSong"===Bt.online.mode){if(fill(255),textAlign(LEFT,TOP),Dt(Pt("menu_newSong_title",xt),width/32,height/32*3,width/2,height/32*3),rectMode(CORNER),fill(65,80,90,255),rect(width/4+width/32/2,(height-(height/16+height/32*3))/16*2+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8),textAlign(RIGHT,CENTER),fill(255),Dt(Pt("menu_newSong_songTitle",xt),width/4-width/32/2,(height-(height/16+height/32*3))/16*2+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),textAlign(CENTER,CENTER),fill(255),Dt(Bt.newSong.title,width/4+width/32/2+(width/4*3-width/32)/2,(height-(height/16+height/32*3))/16*2+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),rectMode(CORNER),fill(65,80,90,255),rect(width/4+width/32/2,(height-(height/16+height/32*3))/16*5+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8),textAlign(RIGHT,CENTER),fill(255),Dt(Pt("menu_newSong_songArtist",xt),width/4-width/32/2,(height-(height/16+height/32*3))/16*5+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),textAlign(CENTER,CENTER),fill(255),Dt(Bt.newSong.artist,width/4+width/32/2+(width/4*3-width/32)/2,(height-(height/16+height/32*3))/16*5+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),rectMode(CORNER),fill(65,80,90,255),rect(width/4+width/32/2,(height-(height/16+height/32*3))/16*8+(height/16+height/32*3),width/4*3-width/32,(height-(height/16+height/32*3))/8),textAlign(RIGHT,CENTER),fill(255),Dt(Pt("menu_newSong_songLink",xt),width/4-width/32/2,(height-(height/16+height/32*3))/16*8+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),textAlign(CENTER,CENTER),fill(255),Dt(Bt.newSong.link,width/4+width/32/2+(width/4*3-width/32)/2,(height-(height/16+height/32*3))/16*8+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/1.5,(height-(height/16+height/32*3))/8/1.5),rectMode(CORNER),fill(255),rect(width/4+width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8,height/64),textAlign(CENTER,CENTER),fill(0),Dt(Pt("menu_newSong_verify",xt),width/4+width/32/2+(width/4*3-width/32)/3/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/3/1.5,(height-(height/16+height/32*3))/8/1.5),!0===Bt.newSong.verifyError&&(textAlign(LEFT,CENTER),fill(255,0,0,255),Dt(Pt("menu_newSong_verifyError",xt),width/4+width/32/2+(width/4*3-width/32)/3/2+(width/4*3-width/32)/3/1.5,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/3*2/1.5,(height-(height/16+height/32*3))/8/1.5)),rectMode(CORNER),fill(255),rect(width/32/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3),(width/4*3-width/32)/3,(height-(height/16+height/32*3))/8,height/64),textAlign(CENTER,CENTER),fill(0),Dt(Pt("menu_back",xt),width/32/2+(width/4*3-width/32)/3/2,(height-(height/16+height/32*3))/16*11+(height/16+height/32*3)+(height-(height/16+height/32*3))/8/2,(width/4*3-width/32)/3/1.5,(height-(height/16+height/32*3))/8/1.5),!0===Bt.newSong.verify)if(Bt.newSong.verifyDim+=At(1,Bt.newSong.verifyDim,.2),Bt.loopVol+=At(0,Bt.loopVol,.2),soundManager.setVolume("menuMusic",Bt.loopVol),fill(0,200*Bt.newSong.verifyDim),rect(0,height/16,width,height-height/16),Bt.newSong.songObject=soundManager.getSoundById(Bt.newSong.link+"verify"),null===Bt.newSong.songObject||void 0===Bt.newSong.songObject)lo(Bt.newSong.link);else{!1===Bt.newSong.songLoading&&(soundManager.load(Bt.newSong.link+"verify"),Bt.newSong.songLoading=!0);for(var e=0;eheight?width:height;var e=Ut(T.uuid,"uuid")?.patreon>w??!1,t=Math.min(width,height),e=[{title:"pulsusPlatinum",subtitle:e?"patreon_thanks":"morePulsus_platinum_sub",image:St.platinum},{title:"morePulsus_discord",subtitle:"morePulsus_discord_sub",image:$.lightTheme?St.discordLogoInvert:St.discordLogo},{title:"morePulsus_wiki",subtitle:"morePulsus_wiki_sub",image:St.pulsusWiki},{title:"morePulsus_contribute",subtitle:"morePulsus_contribute_sub",image:St.contributorBadge}];push(),translate(width/16/2/2,height/16*1.5);let i=0;for(const o of e)push(),translate(0,height/8*1.5*i+height/8),imageMode(CENTER),Wt(o.image,"zoom",width/16,0,t/8,t/8),fill(255),textAlign(LEFT,CENTER),Dt(Pt(o.title,xt),width/8,-height/16*.5/2,width/2,height/16*1.5),Dt(Pt(o.subtitle,xt),width/8,height/16*1.5/2,width/2,height/16*.5,"italics"),Kt(width-width/4-width/16,-height/8/2,width/4,height/8,Pt("morePulsus_visit",xt),Bt.socialMedia.buttonHover,i),pop(),i++;pop()},c.pages=function(){switch(fill($.main),noStroke(),rectMode(CORNER),rect(0,0,width,height),Bt.screen){case"main":c.home();break;case"lvl":c.lvl();break;case"online":c.online();break;case"song":c.song();break;case"account":""===T.uuid?c.account.signedOut():Bt.account.countryScreen?c.account.countryScreen():!1!==Bt.account.friendsScreen?c.account.friendsScreen():c.account.signedIn();break;case"settings":c.settings();break;case"credits":c.credits();break;case"socialMedia":c.socialMedia();break;case"patreon":c.patreon();break;case"changelog":c.changelog();break;case"morePulsus":c.morePulsus()}fill($.shade),rectMode(CORNER),noStroke(),rect(0,0,width,ceil(height/16)),stroke($.text),strokeWeight(height/lerp(128,256,.25)),go(height/64,height/64,Bt.side),0===T.uuid.length?(fill(255),noStroke(),rectMode(CORNER),rect(height/16,(height/16-height/24)/2,height/24,height/24)):(imageMode(CORNER),"Loading..."!==Ut(T.uuid,"uuid").pp&&void 0!==Ut(T.uuid,"uuid").pp&&image(_t(Ut(T.uuid,"uuid").pp),height/16,(height/16-height/24)/2,height/24,height/24)),textAlign(LEFT,CENTER),fill($.text),noStroke(),Dt(0height/16+height/16*t+height/16/2&&mouseYheight?width/64:height/64;if(0!==Mt()&&(Bt.account.countryScroll-=height/12/2*(Mt()/100)),Vt*=.25,Bt.account.countryScroll=constrain(Bt.account.countryScroll,-(height/16+e+2*e*floor((Object.keys(D.enC).length-1)/3)+e)+height-2*e,0),push(),translate(0,Bt.account.countryScroll),void 0===Me[xt]){Me[xt]=[];for(var t=0;t2*-e&&height/16+e+2*e*floor(t/3)+e+Bt.account.countryScrollheight?width/64:height/64,t=(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_greeting",xt,Pt("defaultUsername",xt)),e,height/16+e,width-2*e,height/32*3,"bold"),Kt(e,height/16+height/32*3+2*e,width/4,height/8,Pt("menu_account_signup",xt),Bt.account.buttonHover,0),Kt(e,height/16+height/32*3+height/8+3*e,width/4,height/8,Pt("menu_account_login",xt),Bt.account.buttonHover,1),Kt(e,height/16+height/32*3+height/8*2+4*e,width/4,height/8,Pt("menu_account_resetPassword",xt),Bt.account.buttonHover,4),Bt.account.resetPassComplete&&(fill(255),textAlign(LEFT,CENTER),Dt(Pt("menu_account_resetPasswordComplete",xt),e,height/16+height/32*3+height/8*3+5*e+height/8/2,width/4,height/8)),Bt.account.overlayOn?Bt.account.overlayX+=At(1,Bt.account.overlayX,.2):Bt.account.overlayX+=At(0,Bt.account.overlayX,.2),push(),translate(Bt.account.overlayX*width-width,0),rectMode(CORNER),fill(lerpColor(color($.shade),color($.main),(Bt.account.overlayX*width-width/3)/(width/3*2))),rect(0,height/16,width,height-height/16),"signup"===Bt.account.mode?(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_signup",xt),e,height/16+e,width-2*e,height/32*3,"bold"),Wi(Bt.account.user,Pt("defaultUsername",xt),Pt("menu_account_username",xt),3*e,height/16+height/32*3+3*e+height/16,width/2,height/16,!1),Wi(Bt.account.email,"example@email.com",Pt("menu_account_email",xt),3*e,height/16+height/32*3+4*e+height/16*3,width/2,height/16,!1),Wi(Bt.account.pass,Pt("menu_account_password",xt),Pt("menu_account_password",xt),3*e,height/16+height/32*3+5*e+height/16*5,width/2,height/16,"password"),Wi(Bt.account.passConf,Pt("menu_account_password",xt),Pt("menu_account_passwordConfirm",xt),3*e,height/16+height/32*3+6*e+height/16*7,width/2,height/16,"password")):"login"===Bt.account.mode?(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_login",xt),e,height/16+e,width-2*e,height/32*3,"bold"),Wi(Bt.account.email,"example@email.com",Pt("menu_account_email",xt),3*e,height/16+height/32*3+3*e+height/16,width/2,height/16,!1),Wi(Bt.account.pass,Pt("menu_account_password",xt),Pt("menu_account_password",xt),3*e,height/16+height/32*3+4*e+height/16*3,width/2,height/16,"password")):"resetPassword"===Bt.account.mode?(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_resetPassword",xt),e,height/16+e,width-2*e,height/32*3,"bold"),Wi(Bt.account.user,Pt("defaultUsername",xt),Pt("menu_account_username",xt),3*e,height/16+height/32*3+3*e+height/16,width/2,height/16,!1),Wi(Bt.account.email,"example@email.com",Pt("menu_account_email",xt),3*e,height/16+height/32*3+4*e+height/16*3,width/2,height/16,!1)):"haveCode"===Bt.account.mode?(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_resetPassword",xt),e,height/16+e,width-2*e,height/32*3,"bold"),Wi(Bt.account.code,"######",Pt("menu_account_code",xt),3*e,height/16+height/32*3+3*e+height/16,width/2,height/16,!1),fill(255),Dt("Please check your email for a password reset code!",3*e,height/16+height/32*3+4*e+height/16*3,width/2,height/16)):"resetPasswordConf"===Bt.account.mode&&(fill($.text),textAlign(LEFT,TOP),Dt(Pt("menu_account_resetPasswordConf",xt,Ut(Bt.account.codeUuid,"uuid").user),e,height/16+e,2*e+width/2,height/32*3,"bold"),Wi(Bt.account.pass,Pt("menu_account_password",xt),Pt("menu_account_passwordNew",xt),3*e,height/16+height/32*3+3*e+height/16,width/2,height/16,"password"),Wi(Bt.account.passConf,Pt("menu_account_password",xt),Pt("menu_account_passwordConfirm",xt),3*e,height/16+height/32*3+4*e+height/16*3,width/2,height/16,"password")),Kt(3*e,height/16+height/32*3+7*e+height/16*8,width/8,height/16,Pt("menu_back",xt),Bt.account.buttonHover,2),Kt(4*e+width/8,height/16+height/32*3+7*e+height/16*8,width/8,height/16,Pt("menu_account_submit",xt),Bt.account.buttonHover,3),"resetPassword"===Bt.account.mode&&Kt(5*e+width/8*2,height/16+height/32*3+7*e+height/16*8,width/2-2*e-width/8*2,height/16,Pt("menu_account_haveCode",xt),Bt.account.buttonHover,6),0