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CAAmB,UACxB,EAAK,gBAAA,CAAmB,UACxB,EAAK,qBAAA,CAAwB,UAC7B,EAAK,qBAAA,CAAwB,UAC7B,EAAK,kBAAA,CAAqB,CAAA,EAE1B,aAAa,OAAA,CAAQ,WAAY,KAAK,SAAA,CAAU,IAChD,6BACA,WACA,GACD,GAEA,EAAM,kBAAkB,gBAAA,CAAiB,QAAS,KACjD,GAAI,CAAC,QAAQ,mCACZ,OAGD,IAAM,EAAO,GAEb,CAAA,EAAK,QAAA,CAAW,CAAC,EAEjB,aAAa,OAAA,CAAQ,WAAY,KAAK,SAAA,CAAU,IAChD,6BACA,GACD,GAEA,EAAM,uBAAuB,gBAAA,CAAiB,QAAS,KACtD,EAAM,gBAAgB,SAAA,CAAU,MAAA,CAAO,OACxC,E,G,4D","sources":["","frontend/config/schedule.js"],"sourcesContent":["(function () {\nvar $2fec7fada1913805$exports = {};\nfunction $2fec7fada1913805$var$getConfig() {\n return Object.assign(DEFAULT_CONFIG, JSON.parse(localStorage.getItem(\"schedule\")) || \"{}\");\n}\n$2fec7fada1913805$var$getel(\"upload\").addEventListener(\"click\", async ()=>{\n const file = $2fec7fada1913805$var$getel(\"cfg\").files[0];\n if (!file) {\n alert(\"Please select a file\");\n return;\n }\n const text = await file.text();\n let data;\n try {\n data = JSON.parse(text);\n } catch {\n alert(\"Invalid file contents\");\n return;\n }\n localStorage.setItem(\"schedule\", text);\n broadcastConfigToExtension();\n $2fec7fada1913805$var$populate();\n setTheme();\n alert(\"Settings imported.\");\n});\n$2fec7fada1913805$var$getel(\"cfg\").addEventListener(\"change\", ()=>{\n $2fec7fada1913805$var$getel(\"upload\").disabled = $2fec7fada1913805$var$getel(\"cfg\").files.length !== 1;\n});\n$2fec7fada1913805$var$getel(\"include_period_name\").addEventListener(\"change\", ()=>{\n $2fec7fada1913805$var$editPeriodExample();\n});\nfunction $2fec7fada1913805$var$getel(id) {\n const selector = `#${id}`;\n return document.querySelector(selector);\n}\nfunction $2fec7fada1913805$var$populate() {\n const initial = $2fec7fada1913805$var$getConfig();\n $2fec7fada1913805$var$getel(\"foreground_color\").value = initial.foreground_color;\n $2fec7fada1913805$var$getel(\"background_color\").value = initial.background_color;\n $2fec7fada1913805$var$getel(\"foreground_text_color\").value = initial.foreground_text_color;\n $2fec7fada1913805$var$getel(\"background_text_color\").value = initial.background_text_color;\n $2fec7fada1913805$var$getel(\"schedule_color_background\").checked = initial.use_schedule_color;\n $2fec7fada1913805$var$getel(\"default-page\").value = initial.default_page || \"/\";\n $2fec7fada1913805$var$getel(\"cfg_body\").innerHTML = [\n {\n name: \"Early Bird\",\n code: \"EarlyBird\"\n },\n {\n name: \"Lunch 1\",\n code: \"Lunch 1\"\n },\n {\n name: \"Lunch 2\",\n code: \"Lunch 2\"\n },\n {\n name: \"Block 1\",\n code: \"Block1\"\n },\n {\n name: \"Block 2\",\n code: \"Block2\"\n },\n {\n name: \"Block 3\",\n code: \"Block3\"\n },\n {\n name: \"Block 4\",\n code: \"Block4\"\n },\n {\n name: \"Block 5\",\n code: \"Block5\"\n },\n {\n name: \"Block 6\",\n code: \"Block6\"\n },\n {\n name: \"Block 7\",\n code: \"Block7\"\n },\n {\n name: \"Block 8\",\n code: \"Block8\"\n }\n ].map((x)=>`${x.name}`).join(\"\\n\");\n $2fec7fada1913805$var$getel(\"include_period_name\").checked = initial.include_period_name || initial.include_period_name === undefined;\n $2fec7fada1913805$var$editPeriodExample();\n}\nfunction $2fec7fada1913805$var$editPeriodExample() {\n // Sometimes I just like to watch the world burn.\n $2fec7fada1913805$var$getel(\"example_name\").innerHTML = `${$2fec7fada1913805$var$getel(\"include_period_name\").checked ? \"Block 1 - Custom Name\" : \"Custom Name\"}`;\n}\n$2fec7fada1913805$var$populate();\n$2fec7fada1913805$var$getel(\"save-schedule\").addEventListener(\"click\", ()=>{\n const schedule = {};\n for (const x of document.querySelectorAll(\"input[data-for=name]\")){\n const period = x.getAttribute(\"data-period\");\n if (!schedule[period]) schedule[period] = {};\n schedule[period].name = x.value || null;\n }\n for (const x of document.querySelectorAll(\"input[data-for=url]\")){\n const period = x.getAttribute(\"data-period\");\n if (!schedule[period]) schedule[period] = {};\n schedule[period].url = x.value || null;\n }\n const data = $2fec7fada1913805$var$getConfig();\n data.schedule = schedule;\n data.include_period_name = $2fec7fada1913805$var$getel(\"include_period_name\").checked;\n localStorage.setItem(\"schedule\", JSON.stringify(data));\n broadcastConfigToExtension();\n alert(\"Saved.\");\n});\n$2fec7fada1913805$var$getel(\"save-default\").addEventListener(\"click\", ()=>{\n const data = $2fec7fada1913805$var$getConfig();\n data.default_page = $2fec7fada1913805$var$getel(\"default-page\").value;\n localStorage.setItem(\"schedule\", JSON.stringify(data));\n broadcastConfigToExtension();\n alert(\"Saved.\");\n});\n$2fec7fada1913805$var$getel(\"save-colors\").addEventListener(\"click\", ()=>{\n const data = $2fec7fada1913805$var$getConfig();\n data.foreground_color = $2fec7fada1913805$var$getel(\"foreground_color\").value;\n data.background_color = $2fec7fada1913805$var$getel(\"background_color\").value;\n data.foreground_text_color = $2fec7fada1913805$var$getel(\"foreground_text_color\").value;\n data.background_text_color = $2fec7fada1913805$var$getel(\"background_text_color\").value;\n data.use_schedule_color = $2fec7fada1913805$var$getel(\"schedule_color_background\").checked;\n localStorage.setItem(\"schedule\", JSON.stringify(data));\n broadcastConfigToExtension();\n setTheme();\n alert(\"Saved.\");\n});\n$2fec7fada1913805$var$getel(\"download\").addEventListener(\"click\", ()=>{\n const blob = new Blob([\n localStorage.getItem(\"schedule\")\n ], {\n type: \"application/json\"\n });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = \"ethsbell.json\";\n a.click();\n URL.revokeObjectURL(url);\n});\n$2fec7fada1913805$var$getel(\"reset-colors\").addEventListener(\"click\", ()=>{\n if (!confirm(\"Are you sure you want to reset?\")) return;\n const data = $2fec7fada1913805$var$getConfig();\n data.foreground_color = \"#1a2741\";\n data.background_color = \"#c34614\";\n data.foreground_text_color = \"#ffffff\";\n data.background_text_color = \"#ffffff\";\n data.use_schedule_color = true;\n localStorage.setItem(\"schedule\", JSON.stringify(data));\n broadcastConfigToExtension();\n setTheme();\n $2fec7fada1913805$var$populate();\n});\n$2fec7fada1913805$var$getel(\"reset-schedule\").addEventListener(\"click\", ()=>{\n if (!confirm(\"Are you sure you want to reset?\")) return;\n const data = $2fec7fada1913805$var$getConfig();\n data.schedule = {};\n localStorage.setItem(\"schedule\", JSON.stringify(data));\n broadcastConfigToExtension();\n $2fec7fada1913805$var$populate();\n});\n$2fec7fada1913805$var$getel(\"instructions_toggle\").addEventListener(\"click\", ()=>{\n $2fec7fada1913805$var$getel(\"instructions\").classList.toggle(\"show\");\n});\n\n})();\n//# sourceMappingURL=index.4eca7e9d.js.map\n","function getConfig() {\n\treturn Object.assign(DEFAULT_CONFIG, JSON.parse(localStorage.getItem('schedule')) || '{}');\n}\n\ngetel('upload').addEventListener('click', async () => {\n\tconst file = getel('cfg').files[0];\n\tif (!file) {\n\t\talert('Please select a file');\n\t\treturn;\n\t}\n\n\tconst text = await file.text();\n\n\tlet data;\n\ttry {\n\t\tdata = JSON.parse(text);\n\t} catch {\n\t\talert('Invalid file contents');\n\t\treturn;\n\t}\n\n\tlocalStorage.setItem('schedule', text);\n\tbroadcastConfigToExtension();\n\tpopulate();\n\tsetTheme();\n\talert('Settings imported.');\n});\n\ngetel('cfg').addEventListener('change', () => {\n\tgetel('upload').disabled = getel('cfg').files.length !== 1;\n});\n\ngetel('include_period_name').addEventListener('change', () => {\n\teditPeriodExample();\n});\n\nfunction getel(id) {\n\tconst selector = `#${id}`;\n\treturn document.querySelector(selector);\n}\n\nfunction populate() {\n\tconst initial = getConfig();\n\n\tgetel('foreground_color').value = initial.foreground_color;\n\tgetel('background_color').value = initial.background_color;\n\tgetel('foreground_text_color').value = initial.foreground_text_color;\n\tgetel('background_text_color').value = initial.background_text_color;\n\tgetel('schedule_color_background').checked = initial.use_schedule_color;\n\tgetel('default-page').value = initial.default_page || '/';\n\tgetel('cfg_body').innerHTML = [\n\t\t{name: 'Early Bird', code: 'EarlyBird'},\n\t\t{name: 'Lunch 1', code: 'Lunch 1'},\n\t\t{name: 'Lunch 2', code: 'Lunch 2'},\n\t\t{name: 'Block 1', code: 'Block1'},\n\t\t{name: 'Block 2', code: 'Block2'},\n\t\t{name: 'Block 3', code: 'Block3'},\n\t\t{name: 'Block 4', code: 'Block4'},\n\t\t{name: 'Block 5', code: 'Block5'},\n\t\t{name: 'Block 6', code: 'Block6'},\n\t\t{name: 'Block 7', code: 'Block7'},\n\t\t{name: 'Block 8', code: 'Block8'},\n\t]\n\t\t.map(\n\t\t\tx =>\n\t\t\t\t`${x.name}`,\n\t\t)\n\t\t.join('\\n');\n\tgetel('include_period_name').checked = initial.include_period_name || initial.include_period_name === undefined;\n\teditPeriodExample();\n}\n\nfunction editPeriodExample() {\n\t// Sometimes I just like to watch the world burn.\n\tgetel('example_name').innerHTML = `${getel('include_period_name').checked ? 'Block 1 - Custom Name' : 'Custom Name'}`;\n}\n\npopulate();\n\ngetel('save-schedule').addEventListener('click', () => {\n\tconst schedule = {};\n\tfor (const x of document.querySelectorAll('input[data-for=name]')) {\n\t\tconst period = x.getAttribute('data-period');\n\t\tif (!schedule[period]) {\n\t\t\tschedule[period] = {};\n\t\t}\n\n\t\tschedule[period].name = x.value || null;\n\t}\n\n\tfor (const x of document.querySelectorAll('input[data-for=url]')) {\n\t\tconst period = x.getAttribute('data-period');\n\t\tif (!schedule[period]) {\n\t\t\tschedule[period] = {};\n\t\t}\n\n\t\tschedule[period].url = x.value || null;\n\t}\n\n\tconst data = getConfig();\n\n\tdata.schedule = schedule;\n\tdata.include_period_name = getel('include_period_name').checked;\n\n\tlocalStorage.setItem('schedule', JSON.stringify(data));\n\tbroadcastConfigToExtension();\n\talert('Saved.');\n});\n\ngetel('save-default').addEventListener('click', () => {\n\tconst data = getConfig();\n\n\tdata.default_page = getel('default-page').value;\n\n\tlocalStorage.setItem('schedule', JSON.stringify(data));\n\tbroadcastConfigToExtension();\n\talert('Saved.');\n});\n\ngetel('save-colors').addEventListener('click', () => {\n\tconst data = getConfig();\n\n\tdata.foreground_color = getel('foreground_color').value;\n\tdata.background_color = getel('background_color').value;\n\tdata.foreground_text_color = getel('foreground_text_color').value;\n\tdata.background_text_color = getel('background_text_color').value;\n\tdata.use_schedule_color = getel('schedule_color_background').checked;\n\n\tlocalStorage.setItem('schedule', JSON.stringify(data));\n\tbroadcastConfigToExtension();\n\tsetTheme();\n\talert('Saved.');\n});\n\ngetel('download').addEventListener('click', () => {\n\tconst blob = new Blob([localStorage.getItem('schedule')], {\n\t\ttype: 'application/json',\n\t});\n\n\tconst url = URL.createObjectURL(blob);\n\tconst a = document.createElement('a');\n\ta.href = url;\n\ta.download = 'ethsbell.json';\n\ta.click();\n\tURL.revokeObjectURL(url);\n});\n\ngetel('reset-colors').addEventListener('click', () => {\n\tif (!confirm('Are you sure you want to reset?')) {\n\t\treturn;\n\t}\n\n\tconst data = getConfig();\n\n\tdata.foreground_color = '#1a2741';\n\tdata.background_color = '#c34614';\n\tdata.foreground_text_color = '#ffffff';\n\tdata.background_text_color = '#ffffff';\n\tdata.use_schedule_color = true;\n\n\tlocalStorage.setItem('schedule', JSON.stringify(data));\n\tbroadcastConfigToExtension();\n\tsetTheme();\n\tpopulate();\n});\n\ngetel('reset-schedule').addEventListener('click', () => {\n\tif (!confirm('Are you sure you want to reset?')) {\n\t\treturn;\n\t}\n\n\tconst data = getConfig();\n\n\tdata.schedule = {};\n\n\tlocalStorage.setItem('schedule', JSON.stringify(data));\n\tbroadcastConfigToExtension();\n\tpopulate();\n});\n\ngetel('instructions_toggle').addEventListener('click', () => {\n\tgetel('instructions').classList.toggle('show');\n});\n"],"names":["$2fec7fada1913805$var$getConfig","Object","assign","DEFAULT_CONFIG","JSON","parse","localStorage","getItem","$2fec7fada1913805$var$getel","id","selector","document","querySelector","$2fec7fada1913805$var$populate","initial","value","foreground_color","background_color","foreground_text_color","background_text_color","checked","use_schedule_color","default_page","innerHTML","name","code","map","x","schedule","url","join","include_period_name","undefined","$2fec7fada1913805$var$editPeriodExample","addEventListener","file","files","alert","text","setItem","broadcastConfigToExtension","setTheme","disabled","length","querySelectorAll","period","getAttribute","data","stringify","blob","Blob","type","URL","createObjectURL","a","createElement","href","download","click","revokeObjectURL","confirm","classList","toggle"],"version":3,"file":"index.4eca7e9d.js.map"}