{ "version": 3, "sources": ["../../../../server/chat-plugins/smogtours.ts"], "sourcesContent": ["/**\n * Integration for Smogon tournaments.\n * @author mia-pi-git\n */\nimport {FS, Utils} from '../../lib';\n\ntype Image = [string, number, number];\ninterface TourEvent {\n\ttitle: string;\n\turl: string;\n\tdesc: string;\n\timage?: Image;\n\t/** If there's an image, there needs to be credit to wherever they got it */\n\tartistCredit?: {url: string, name: string};\n\tid: string;\n\tshortDesc: string;\n\tdate: number;\n\t// make this required later\n\tends?: number;\n}\n\ninterface TourTable {\n\ttitle: string;\n\ttours: TourEvent[];\n\twhitelist?: string[];\n\ticon?: Image;\n\tdesc: string;\n}\n\nexport const tours: Record = {\n\tofficial: {\n\t\ttitle: \"Smogon Officials\",\n\t\t// cap this one's dimensions\n\t\ticon: ['https://www.smogon.com/media/zracknel-beta.svg', 178, 200],\n\t\ttours: [],\n\t\tdesc: \"Tournaments run by Smogon staff.\",\n\t},\n\tsmogon: {\n\t\ttitle: \"Open Sign-Ups\",\n\t\ttours: [],\n\t\tdesc: \"Tournaments run by Smogon staff and regular users alike.\",\n\t},\n\tps: {\n\t\ttitle: \"Pok\u00E9mon Showdown!\",\n\t\ticon: ['https://play.pokemonshowdown.com/pokemonshowdownbeta.png', 146, 44],\n\t\ttours: [],\n\t\tdesc: \"Tournaments run by the rooms of Pokemon Showdown.\",\n\t},\n};\ntry {\n\tconst data = JSON.parse(FS('config/chat-plugins/smogtours.json').readSync());\n\t// settings should prioritize hardcoded values for these keys\n\tconst PRIO = ['title', 'icon'];\n\tfor (const key in data) {\n\t\tconst section = (tours[key] ||= data[key]) as any;\n\t\tfor (const k in data[key]) {\n\t\t\tif (PRIO.includes(k)) {\n\t\t\t\tif (!section[k]) section[k] = data[key][k];\n\t\t\t} else {\n\t\t\t\tsection[k] = data[key][k];\n\t\t\t}\n\t\t}\n\t}\n} catch {}\n\nfunction saveTours() {\n\tFS('config/chat-plugins/smogtours.json').writeUpdate(() => JSON.stringify(tours));\n}\n\nfunction getTour(categoryID: ID, id: string) {\n\tid = toID(id);\n\tif (!tours[categoryID]) return null;\n\tconst idx = tours[categoryID].tours.findIndex(f => f.id === id) ?? -1;\n\tconst tour = tours[categoryID].tours[idx];\n\tif (!tour) {\n\t\treturn null;\n\t}\n\tif (tour.ends && Date.now() > tour.ends) {\n\t\ttours[categoryID].tours.splice(idx, 1);\n\t\treturn null;\n\t}\n\treturn tour;\n}\n\nfunction checkWhitelisted(category: ID, user: User) {\n\treturn category ?\n\t\ttours[category].whitelist?.includes(user.id) :\n\t\tObject.values(tours).some(f => f.whitelist?.includes(user.id));\n}\n\nfunction checkCanEdit(user: User, context: Chat.PageContext | Chat.CommandContext, category?: ID) {\n\tcategory = toID(category);\n\tif (!checkWhitelisted(category, user)) {\n\t\tcontext.checkCan('rangeban');\n\t}\n}\n\nexport const commands: Chat.ChatCommands = {\n\tsmogtours: {\n\t\t''() {\n\t\t\treturn this.parse('/j view-tournaments-all');\n\t\t},\n\t\tedit: 'add',\n\t\tasync add(target, room, user, connection, cmd) {\n\t\t\tif (!toID(target).length) {\n\t\t\t\treturn this.parse(`/help smogtours`);\n\t\t\t}\n\t\t\tconst targets = target.split('|');\n\t\t\tconst isEdit = cmd === 'edit';\n\t\t\tconst tourID = isEdit ? toID(targets.shift()) : null;\n\t\t\t// {title}|{category}|{url}|{end date}|{img}|{credit}|{artist}{shortDesc}|{desc}\n\t\t\tconsole.log(targets);\n\t\t\tconst [\n\t\t\t\ttitle, rawSection, url, rawEnds, rawImg, rawCredit, rawArtistName, rawShort, rawDesc,\n\t\t\t] = Utils.splitFirst(targets.join('|'), '|', 8).map(f => f.trim());\n\t\t\tconst sectionID = toID(rawSection);\n\t\t\tif (!toID(title)) {\n\t\t\t\treturn this.popupReply(`Invalid title. Must have at least one alphanumeric character.`);\n\t\t\t}\n\t\t\tconst section = tours[sectionID];\n\t\t\tif (!section) {\n\t\t\t\treturn this.errorReply(`Invalid section ID: \"${sectionID}\"`);\n\t\t\t}\n\t\t\tif (!isEdit && section.tours.find(f => toID(title) === f.id)) {\n\t\t\t\treturn this.popupReply(`A tour with that ID already exists. Please choose another.`);\n\t\t\t}\n\t\t\tcheckCanEdit(user, this, sectionID);\n\t\t\tif (!Chat.isLink(url)) {\n\t\t\t\treturn this.popupReply(`Invalid info URL: \"${url}\"`);\n\t\t\t}\n\t\t\tif (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(rawEnds)) {\n\t\t\t\treturn this.popupReply(`Invalid ending date: ${rawEnds}.`);\n\t\t\t}\n\t\t\tconst ends = new Date(rawEnds).getTime();\n\t\t\tif (isNaN(ends)) {\n\t\t\t\treturn this.popupReply(`Invalid ending date: ${rawEnds}.`);\n\t\t\t}\n\t\t\tlet image, artistCredit;\n\t\t\tif (rawImg) {\n\t\t\t\tif (!Chat.isLink(rawImg)) {\n\t\t\t\t\treturn this.popupReply(`Invalid image URL: ${rawImg}`);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst dimensions = await Chat.fitImage(rawImg, 300, 300);\n\t\t\t\t\timage = [rawImg, ...dimensions.slice(0, -1)] as Image;\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn this.popupReply(`Invalid image URL: ${rawImg}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (image && !(toID(rawCredit) && toID(rawArtistName))) {\n\t\t\t\treturn this.popupReply(`All images must have the artist named and a link to the profile of the user who created them.`);\n\t\t\t}\n\t\t\tif (rawCredit || rawArtistName) { // if one exists, both should, as verified above\n\t\t\t\tconst artistUrl = (Chat.linkRegex.exec(rawCredit))?.[0];\n\t\t\t\tif (!artistUrl) {\n\t\t\t\t\treturn this.errorReply(`Invalid artist credit URL.`);\n\t\t\t\t}\n\t\t\t\tartistCredit = {url: artistUrl, name: rawArtistName.trim()};\n\t\t\t}\n\t\t\tif (!rawShort?.length || !rawDesc?.length) {\n\t\t\t\treturn this.popupReply(`Must provide both a short description and a full description.`);\n\t\t\t}\n\t\t\tconst tour: TourEvent = {\n\t\t\t\ttitle: Utils.escapeHTML(title),\n\t\t\t\turl,\n\t\t\t\timage,\n\t\t\t\tartistCredit,\n\t\t\t\tshortDesc: rawShort.replace(/ /g, '\\n'),\n\t\t\t\tdesc: rawDesc.replace(/ /g, '\\n'),\n\t\t\t\tid: tourID || toID(title),\n\t\t\t\tdate: Date.now(),\n\t\t\t\tends,\n\t\t\t};\n\t\t\tif (isEdit) {\n\t\t\t\tconst index = section.tours.findIndex(t => t.id === tour.id);\n\t\t\t\tif (index < 0) {\n\t\t\t\t\treturn this.popupReply(`Tour not found. Create one first.`);\n\t\t\t\t}\n\t\t\t\tsection.tours.splice(index, 1);\n\t\t\t}\n\t\t\tsection.tours.push(tour);\n\t\t\tsaveTours();\n\t\t\tthis.refreshPage(`tournaments-add`);\n\t\t},\n\t\tend(target, room, user, connection) {\n\t\t\tconst [sectionID, tourID] = target.split(',').map(toID).filter(Boolean);\n\t\t\tif (!sectionID || !tourID) {\n\t\t\t\treturn this.parse(`/help smogtours`);\n\t\t\t}\n\t\t\tconst section = tours[sectionID];\n\t\t\tif (!section) return this.popupReply(`Invalid section: \"${sectionID}\"`);\n\t\t\tconst idx = section.tours.findIndex(t => t.id === tourID);\n\t\t\tconst title = section.tours[idx].title;\n\t\t\tif (idx < 0) {\n\t\t\t\treturn this.popupReply(`Tour with ID \"${tourID}\" not found.`);\n\t\t\t}\n\t\t\tsection.tours.splice(idx, 1);\n\t\t\tthis.refreshPage(`tournaments-view-${sectionID}-${tourID}`);\n\t\t\tthis.popupReply(`Tour \"${title}\" ended.`);\n\t\t},\n\t\twhitelist(target, room, user) {\n\t\t\tthis.checkCan('rangeban');\n\t\t\tconst [sectionID, targetID] = target.split(',').map(toID).filter(Boolean);\n\t\t\tif (!sectionID || !targetID) {\n\t\t\t\treturn this.parse(`/help smogtours`);\n\t\t\t}\n\t\t\tconst section = tours[sectionID];\n\t\t\tif (!section) {\n\t\t\t\treturn this.errorReply(`Invalid section ID: \"${sectionID}\". Valid IDs: ${Object.keys(tours).join(', ')}`);\n\t\t\t}\n\t\t\tif (section.whitelist?.includes(targetID)) {\n\t\t\t\treturn this.errorReply(`That user is already whitelisted on that section.`);\n\t\t\t}\n\t\t\tif (!section.whitelist) section.whitelist = [];\n\t\t\tsection.whitelist.push(targetID);\n\t\t\tthis.privateGlobalModAction(\n\t\t\t\t`${user.name} whitelisted ${targetID} to manage tours for the ${section.title} section`\n\t\t\t);\n\t\t\tthis.globalModlog('TOUR WHITELIST', targetID);\n\t\t\tsaveTours();\n\t\t},\n\t\tunwhitelist(target, room, user) {\n\t\t\tthis.checkCan('rangeban');\n\t\t\tconst [sectionID, targetID] = target.split(',').map(toID).filter(Boolean);\n\t\t\tif (!sectionID || !targetID) {\n\t\t\t\treturn this.parse(`/help smogtours`);\n\t\t\t}\n\t\t\tconst section = tours[sectionID];\n\t\t\tif (!section) {\n\t\t\t\treturn this.errorReply(`Invalid section ID: \"${sectionID}\". Valid IDs: ${Object.keys(tours).join(', ')}`);\n\t\t\t}\n\t\t\tconst idx = section.whitelist?.indexOf(targetID) ?? -1;\n\t\t\tif (!section.whitelist || idx < 0) {\n\t\t\t\treturn this.errorReply(`${targetID} is not whitelisted in that section.`);\n\t\t\t}\n\t\t\tsection.whitelist.splice(idx, 1);\n\t\t\tif (!section.whitelist.length) {\n\t\t\t\tdelete section.whitelist;\n\t\t\t}\n\t\t\tthis.privateGlobalModAction(\n\t\t\t\t`${user.name} removed ${targetID} from the tour management whitelist for the ${section.title} section`\n\t\t\t);\n\t\t\tthis.globalModlog('TOUR UNWHITELIST', targetID);\n\t\t\tsaveTours();\n\t\t},\n\t\tview() {\n\t\t\treturn this.parse(`/join view-tournaments-all`);\n\t\t},\n\t},\n\tsmogtourshelp: [\n\t\t`/smogtours view - View a list of ongoing forum tournaments.`,\n\t\t`/smogtours whitelist [section], [user] - Whitelists the given [user] to manage tournaments for the given [section].`,\n\t\t`Requires: &`,\n\t\t`/smogtours unwhitelist [section], [user] - Removes the given [user] from the [section]'s management whitelist.`,\n\t\t`Requires: &`,\n\t],\n};\n\n/** Modifies `inner` in-place to wrap it in the necessary HTML to show a tab on the sidebar. */\nfunction renderTab(inner: string, isTitle?: boolean, isCur?: boolean) {\n\tisTitle = false;\n\tlet buf = '';\n\tif (isCur) {\n\t\t// the CSS breaks entirely without the folderhacks.\n\t\tbuf += `
`;\n\t\tbuf += `
`;\n\t\tbuf += `
${inner}
`;\n\t} else {\n\t\tif (!isTitle) {\n\t\t\tinner = `
${inner}
`;\n\t\t}\n\t\tbuf += `
${inner}
`;\n\t}\n\treturn buf;\n}\n\nconst refresh = (pageid: string) => (\n\t``\n);\n\nconst back = (section?: string) => (\n\t`` +\n\t` Back`\n);\n\nexport function renderPageChooser(curPage: string, buffer: string, user?: User) {\n\tlet buf = `
`;\n\tbuf += `
`;\n\tbuf += `
`;\n\n\tconst keys = Object.keys(tours);\n\tbuf += keys.map(cat => {\n\t\tlet innerBuf = '';\n\t\tconst tourData = tours[cat];\n\t\tinnerBuf += renderTab(\n\t\t\t`${tourData.title}`,\n\t\t\ttrue,\n\t\t\tcurPage === cat\n\t\t);\n\t\tif (tourData.tours.length) {\n\t\t\tUtils.sortBy(tourData.tours, t => -t.date);\n\t\t\tinnerBuf += tourData.tours.map(t => (\n\t\t\t\trenderTab(\n\t\t\t\t\t`${t.title}`,\n\t\t\t\t\tfalse,\n\t\t\t\t\tcurPage === `${cat}-${t.id}`\n\t\t\t\t)\n\t\t\t)).join('');\n\t\t} else {\n\t\t\tinnerBuf += renderTab(`None`, false);\n\t\t}\n\t\treturn innerBuf;\n\t}).join('
');\n\tif (user && (checkWhitelisted('', user) || user?.can('rangeban'))) {\n\t\tbuf += `
`;\n\t\tbuf += renderTab(\n\t\t\t`Manage`, true, curPage === 'manage'\n\t\t);\n\t\tbuf += renderTab(\n\t\t\t`Start new`,\n\t\t\tfalse,\n\t\t\tcurPage === 'start',\n\t\t);\n\t\tbuf += renderTab(\n\t\t\t`Edit existing`,\n\t\t\tfalse,\n\t\t\tcurPage === 'edit',\n\t\t);\n\t\tif (user.can('rangeban')) {\n\t\t\tbuf += renderTab(\n\t\t\t\t`Whitelist`,\n\t\t\t\tfalse,\n\t\t\t\tcurPage === 'whitelist',\n\t\t\t);\n\t\t}\n\t}\n\n\tbuf += `
`;\n\tbuf += `${buffer}
`;\n\treturn buf;\n}\n\nfunction error(page: string, message: string, user: User) {\n\treturn renderPageChooser(page, `
${message}
`, user);\n}\n\nexport const pages: Chat.PageTable = {\n\ttournaments: {\n\t\tall(query, user) {\n\t\t\tlet buf = `${refresh(this.pageid)}
`;\n\t\t\tbuf += `

Welcome!

`;\n\t\t\tconst icon = tours.official.icon;\n\t\t\tif (icon) buf += `
`;\n\t\t\tbuf += `
`;\n\t\t\tthis.title = '[Tournaments] All';\n\t\t\tbuf += `

Smogon runs official tournaments across their metagames where the strongest and most `;\n\t\t\tbuf += `experienced competitors duke it out for prizes and recognition!

`;\n\t\t\tbuf += `You can see a listing of current official tournaments here; `;\n\t\t\tbuf += `by clicking any hyperlink, you will be directed to the forum for any given tournament!

`;\n\t\t\tbuf += `Be sure to sign up if you are eager to participate or `;\n\t\t\tbuf += `check it out if you want to spectate the most hyped games out there.

`;\n\t\t\tbuf += `For information on tournament rules and etiquette, check out this information thread.`;\n\t\t\tbuf += `

`;\n\t\t\tbuf += Object.keys(tours).map(catID => (\n\t\t\t\t`` +\n\t\t\t\t` ${tours[catID].title}`\n\t\t\t)).join(' ');\n\t\t\tbuf += `
`;\n\t\t\treturn renderPageChooser('', buf, user);\n\t\t},\n\t\tview(query, user) {\n\t\t\tconst [categoryID, tourID] = query.map(toID);\n\t\t\tif (!categoryID || !tourID) {\n\t\t\t\treturn error('', 'You must specify a tour category and a tour ID.', user);\n\t\t\t}\n\t\t\tthis.title = `[Tournaments] [${categoryID}] `;\n\t\t\tif (!tours[categoryID]) {\n\t\t\t\treturn error('', `Invalid tour section: '${categoryID}'.`, user);\n\t\t\t}\n\t\t\tconst tour = getTour(categoryID, tourID);\n\t\t\tif (!tour) {\n\t\t\t\treturn error(categoryID, `Tour '${tourID}' not found.`, user);\n\t\t\t}\n\t\t\t// unescaping since it's escaped on client\n\t\t\tthis.title += `${tour.title}`\n\t\t\t\t.replace(/"/g, '\"')\n\t\t\t\t.replace(/>/g, '>')\n\t\t\t\t.replace(/</g, '<')\n\t\t\t\t.replace(/&/g, '&');\n\t\t\t// stuff!\n\t\t\tlet buf = `${back(categoryID)}${refresh(this.pageid)}
`;\n\t\t\tbuf += `

${tour.title}

`;\n\t\t\tif (tour.image) {\n\t\t\t\tbuf += ``;\n\t\t\t\tif (tour.artistCredit) {\n\t\t\t\t\tbuf += `
The creator of this image, ${tour.artistCredit.name}, `;\n\t\t\t\t\tbuf += `can be found here.`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf += `
`;\n\t\t\tif (tour.ends) {\n\t\t\t\tbuf += `
Signups end: ${Chat.toTimestamp(new Date(tour.ends)).split(' ')[0]}`;\n\t\t\t}\n\t\t\tbuf += `
`;\n\t\t\tbuf += Utils.escapeHTML(tour.desc).replace(/\\n/ig, '
');\n\t\t\tbuf += `

View information and signups`;\n\t\t\ttry {\n\t\t\t\tcheckCanEdit(user, this, categoryID);\n\t\t\t\tbuf += `

Manage`;\n\t\t\t\tbuf += ``;\n\t\t\t\tbuf += `
`;\n\t\t\t} catch {}\n\t\t\treturn renderPageChooser(query.join('-'), buf, user);\n\t\t},\n\t\tsection(query, user) {\n\t\t\tconst categoryID = toID(query.shift());\n\t\t\tif (!categoryID) {\n\t\t\t\treturn error('', `No section specified.`, user);\n\t\t\t}\n\t\t\tthis.title = '[Tournaments] ' + categoryID;\n\t\t\tconst category = tours[categoryID];\n\t\t\tif (!category) {\n\t\t\t\treturn error('', Utils.html`Invalid section specified: '${categoryID}'`, user);\n\t\t\t}\n\t\t\tlet buf = `${back()}${refresh(this.pageid)}

${category.title}

`;\n\t\t\tif (category.icon) {\n\t\t\t\tbuf += `
`;\n\t\t\t}\n\t\t\tbuf += `
${category.desc}
`;\n\t\t\tlet needsSave = false;\n\t\t\tfor (const [i, tour] of category.tours.entries()) {\n\t\t\t\tif (tour.ends && (tour.ends < Date.now())) {\n\t\t\t\t\tcategory.tours.splice(i, 1);\n\t\t\t\t\tneedsSave = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (needsSave) saveTours();\n\t\t\tif (!category.tours.length) {\n\t\t\t\tbuf += `

There are currently no tournaments in this section with open signups.

`;\n\t\t\t\tbuf += `

Check back later for new tours.

`;\n\t\t\t} else {\n\t\t\t\tbuf += category.tours.map(tour => {\n\t\t\t\t\tlet innerBuf = `
`;\n\t\t\t\t\tinnerBuf += `${tour.title}
`;\n\t\t\t\t\tinnerBuf += Utils.escapeHTML(tour.shortDesc);\n\t\t\t\t\tinnerBuf += `
`;\n\t\t\t\t\treturn innerBuf;\n\t\t\t\t}).join('
');\n\t\t\t}\n\t\t\treturn renderPageChooser(categoryID, buf, user);\n\t\t},\n\t\tstart(query, user) {\n\t\t\tcheckCanEdit(user, this); // broad check first\n\t\t\tlet buf = `${refresh(this.pageid)}
`;\n\t\t\tthis.title = '[Tournaments] Add';\n\t\t\tbuf += `

Add new tournament


`;\n\t\t\tbuf += `
`;\n\t\t\tlet possibleCategory = Object.keys(tours)[0];\n\t\t\tfor (const k in tours) {\n\t\t\t\tif (tours[k].whitelist?.includes(user.id)) {\n\t\t\t\t\t// favor first one where user is whitelisted where applicable\n\t\t\t\t\tpossibleCategory = k;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf += `Title:
`;\n\t\t\tbuf += `Category:
`;\n\t\t\tbuf += `Info link:
`;\n\t\t\tbuf += `End date:
`;\n\t\t\tbuf += `Image link (optional):
`;\n\t\t\tbuf += `Artist name (required if image provided):
`;\n\t\t\tbuf += `Image credit URL (required if image provided, must be a link to the creator's Smogon profile): `;\n\t\t\tbuf += `
`;\n\t\t\tbuf += `Short description:

`;\n\t\t\tbuf += `Full description:

`;\n\t\t\tbuf += `
`;\n\t\t\treturn renderPageChooser('start', buf, user);\n\t\t},\n\t\t// edit single\n\t\tedit(query, user) {\n\t\t\tthis.title = '[Tournaments] Edit ';\n\t\t\tconst [sectionID, tourID] = query.map(toID);\n\t\t\tif (!sectionID || !tourID) {\n\t\t\t\treturn Chat.resolvePage(`view-tournaments-manage`, user, this.connection);\n\t\t\t}\n\t\t\tconst section = tours[sectionID];\n\t\t\tif (!section) return error('edit', `Invalid section: \"${sectionID}\"`, user);\n\t\t\tconst tour = section.tours.find(t => t.id === tourID);\n\t\t\tif (!tour) return error('edit', `Tour with ID \"${tourID}\" not found.`, user);\n\t\t\tlet buf = `${refresh(this.pageid)}

Edit tournament \"${tour.title}\"


`;\n\t\t\tbuf += `
`;\n\t\t\tbuf += `Title:
`;\n\t\t\tbuf += `Info link:
`;\n\t\t\tconst curEndDay = Chat.toTimestamp(new Date(tour.ends || Date.now())).split(' ')[0];\n\t\t\tbuf += `End date:
`;\n\t\t\tbuf += `Image link (optional):
`;\n\t\t\tbuf += `Artist name (required if image provided):
`;\n\t\t\tbuf += `Image credit (required if image provided, must be a link to the creator's Smogon profile): `;\n\t\t\tbuf += `
`;\n\t\t\tbuf += `Short description:
`;\n\t\t\tbuf += `
`;\n\t\t\tconst desc = Utils.escapeHTML(tour.desc).replace(/
/g, ' ');\n\t\t\tbuf += `Full description:

`;\n\t\t\tbuf += ``;\n\t\t\treturn renderPageChooser('edit', buf, user);\n\t\t},\n\t\t// panel for all you have perms to edit\n\t\tmanage(query, user) {\n\t\t\tcheckCanEdit(user, this);\n\t\t\tthis.title = '[Tournaments] Manage';\n\t\t\tlet buf = `${refresh(this.pageid)}

Manage ongoing tournaments


`;\n\t\t\tbuf += Object.keys(tours).map(cat => {\n\t\t\t\tlet innerBuf = '';\n\t\t\t\ttry {\n\t\t\t\t\tcheckCanEdit(user, this, toID(cat));\n\t\t\t\t} catch {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\tconst section = tours[cat];\n\t\t\t\tinnerBuf += `${section.title}:
`;\n\t\t\t\tfor (const [i, tour] of section.tours.entries()) {\n\t\t\t\t\tif (tour.ends && Date.now() > tour.ends) {\n\t\t\t\t\t\tsection.tours.splice(i, 1);\n\t\t\t\t\t\tsaveTours();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinnerBuf += section.tours.map(\n\t\t\t\t\tt => `• ${t.title}`\n\t\t\t\t).join('
') || \"None active.\";\n\t\t\t\treturn innerBuf;\n\t\t\t}).filter(Boolean).join('
');\n\t\t\treturn renderPageChooser('manage', buf, user);\n\t\t},\n\t\twhitelists(query, user) {\n\t\t\tthis.checkCan('rangeban');\n\t\t\tlet buf = `${refresh(this.pageid)}

Section whitelists
`;\n\t\t\tfor (const k in tours) {\n\t\t\t\tbuf += `${tours[k].title}
`;\n\t\t\t\tconst whitelist = tours[k].whitelist || [];\n\t\t\t\tif (!whitelist.length) {\n\t\t\t\t\tbuf += `None.
`;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbuf += Utils.sortBy(whitelist).map(f => `
  • ${f}
  • `).join('');\n\t\t\t\tbuf += `
    `;\n\t\t\t}\n\t\t\treturn renderPageChooser('whitelist', buf, user);\n\t\t},\n\t},\n};\n\nprocess.nextTick(() => {\n\tChat.multiLinePattern.register('/smogtours (add|edit)');\n});\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iBAAwB;AAyBjB,MAAM,QAAmC;AAAA,EAC/C,UAAU;AAAA,IACT,OAAO;AAAA;AAAA,IAEP,MAAM,CAAC,kDAAkD,KAAK,GAAG;AAAA,IACjE,OAAO,CAAC;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP,OAAO;AAAA,IACP,OAAO,CAAC;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA,IAAI;AAAA,IACH,OAAO;AAAA,IACP,MAAM,CAAC,4DAA4D,KAAK,EAAE;AA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