#results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateTeam(event) {\n event.preventDefault();\n var params = (0, _jquery.default)(\"#team-info-edit-form\").serializeJSON(true);\n\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#team-info-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery.default)(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery.default)(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery.default)(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = submissionIDs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var subId = _step.value;\n reqs.push(_CTFd.default.api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(event) {\n var awardIDs = (0, _jquery.default)(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery.default)(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = awardIDs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var awardID = _step2.value;\n\n var req = _CTFd.default.fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery.default)(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery.default)(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" correct for \").concat((0, _utils.htmlEntities)(TEAM_NAME), \"?\"),\n success: function success() {\n (0, _ezq.ezAlert)({\n title: \"User Attribution\",\n body: \"\\n Which user on \".concat((0, _utils.htmlEntities)(TEAM_NAME), \" solved these challenges?\\n \\n \").concat((0, _jquery.default)(\"#team-member-select\").html(), \"\\n
\\n \"),\n button: \"Mark Correct\",\n success: function success() {\n var USER_ID = (0, _jquery.default)(\"#query-team-member-solve > select\").val();\n var reqs = [];\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = challengeIDs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: USER_ID,\n team_id: TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd.default.fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd.default.api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd.default.api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery.default)(function () {\n (0, _jquery.default)(\"#team-captain-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery.default)(\"#team-captain-form\").serializeJSON(true);\n\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#team-captain-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-captain-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-captain-form\").find(\"select[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery.default)(\".edit-team\").click(function (e) {\n (0, _jquery.default)(\"#team-info-edit-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".edit-captain\").click(function (e) {\n (0, _jquery.default)(\"#team-captain-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".award-team\").click(function (e) {\n (0, _jquery.default)(\"#team-award-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".addresses-team\").click(function (event) {\n (0, _jquery.default)(\"#team-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\"#user-award-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery.default)(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = (0, _jquery.default)(\"#award-member-input\").val();\n params[\"team_id\"] = TEAM_ID;\n (0, _jquery.default)(\"#user-award-form > #results\").empty();\n\n if (!params[\"user_id\"]) {\n (0, _jquery.default)(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: \"Please select a team member\"\n }));\n return;\n }\n\n params[\"user_id\"] = parseInt(params[\"user_id\"]);\n\n _CTFd.default.fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery.default)(\".delete-member\").click(function (e) {\n e.preventDefault();\n var member_id = (0, _jquery.default)(this).attr(\"member-id\");\n var member_name = (0, _jquery.default)(this).attr(\"member-name\");\n var params = {\n user_id: member_id\n };\n var row = (0, _jquery.default)(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Remove Member\",\n body: \"Are you sure you want to remove {0} from {1}?
All of their challenges solves, attempts, awards, and unlocked hints will also be deleted!\".format(\"\" + (0, _utils.htmlEntities)(member_name) + \"\", \"\" + (0, _utils.htmlEntities)(TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID + \"/members\", {\n method: \"DELETE\",\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n });\n (0, _jquery.default)(\".delete-team\").click(function (e) {\n (0, _ezq.ezQuery)({\n title: \"Delete Team\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd.default.config.urlRoot + \"/admin/teams\";\n }\n });\n }\n });\n });\n (0, _jquery.default)(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery.default)(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery.default)(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery.default)(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery.default)(\"#team-info-create-form\").submit(createTeam);\n (0, _jquery.default)(\"#team-info-edit-form\").submit(updateTeam);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n createGraphs(type, id, name, account_id);\n setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/team.js?");
+eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _utils = __webpack_require__(/*! core/utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nvar _graphs = __webpack_require__(/*! core/graphs */ \"./CTFd/themes/core/assets/js/graphs.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction createTeam(event) {\n event.preventDefault();\n var params = (0, _jquery.default)(\"#team-info-create-form\").serializeJSON(true);\n\n _CTFd.default.fetch(\"/api/v1/teams\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var team_id = response.data.id;\n window.location = _CTFd.default.config.urlRoot + \"/admin/teams/\" + team_id;\n } else {\n (0, _jquery.default)(\"#team-info-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateTeam(event) {\n event.preventDefault();\n var params = (0, _jquery.default)(\"#team-info-edit-form\").serializeJSON(true);\n\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#team-info-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery.default)(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery.default)(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery.default)(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = submissionIDs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var subId = _step.value;\n reqs.push(_CTFd.default.api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(event) {\n var awardIDs = (0, _jquery.default)(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery.default)(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = awardIDs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var awardID = _step2.value;\n\n var req = _CTFd.default.fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery.default)(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery.default)(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" challenges correct for \").concat((0, _utils.htmlEntities)(TEAM_NAME), \"?\"),\n success: function success() {\n (0, _ezq.ezAlert)({\n title: \"User Attribution\",\n body: \"\\n Which user on \".concat((0, _utils.htmlEntities)(TEAM_NAME), \" solved these challenges?\\n \\n \").concat((0, _jquery.default)(\"#team-member-select\").html(), \"\\n
\\n \"),\n button: \"Mark Correct\",\n success: function success() {\n var USER_ID = (0, _jquery.default)(\"#query-team-member-solve > select\").val();\n var reqs = [];\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = challengeIDs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: USER_ID,\n team_id: TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd.default.fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n Promise.all(reqs).then(function (responses) {\n window.location.reload();\n });\n }\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd.default.api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd.default.api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd.default.api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery.default)(function () {\n (0, _jquery.default)(\"#team-captain-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery.default)(\"#team-captain-form\").serializeJSON(true);\n\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#team-captain-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#team-captain-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#team-captain-form\").find(\"select[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery.default)(\".edit-team\").click(function (e) {\n (0, _jquery.default)(\"#team-info-edit-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".edit-captain\").click(function (e) {\n (0, _jquery.default)(\"#team-captain-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".award-team\").click(function (e) {\n (0, _jquery.default)(\"#team-award-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\".addresses-team\").click(function (event) {\n (0, _jquery.default)(\"#team-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery.default)(\"#user-award-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery.default)(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = (0, _jquery.default)(\"#award-member-input\").val();\n params[\"team_id\"] = TEAM_ID;\n (0, _jquery.default)(\"#user-award-form > #results\").empty();\n\n if (!params[\"user_id\"]) {\n (0, _jquery.default)(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: \"Please select a team member\"\n }));\n return;\n }\n\n params[\"user_id\"] = parseInt(params[\"user_id\"]);\n\n _CTFd.default.fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery.default)(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, index) {\n (0, _jquery.default)(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery.default)(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery.default)(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery.default)(\".delete-member\").click(function (e) {\n e.preventDefault();\n var member_id = (0, _jquery.default)(this).attr(\"member-id\");\n var member_name = (0, _jquery.default)(this).attr(\"member-name\");\n var params = {\n user_id: member_id\n };\n var row = (0, _jquery.default)(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Remove Member\",\n body: \"Are you sure you want to remove {0} from {1}?
All of their challenges solves, attempts, awards, and unlocked hints will also be deleted!\".format(\"\" + (0, _utils.htmlEntities)(member_name) + \"\", \"\" + (0, _utils.htmlEntities)(TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID + \"/members\", {\n method: \"DELETE\",\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n });\n (0, _jquery.default)(\".delete-team\").click(function (e) {\n (0, _ezq.ezQuery)({\n title: \"Delete Team\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd.default.fetch(\"/api/v1/teams/\" + TEAM_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd.default.config.urlRoot + \"/admin/teams\";\n }\n });\n }\n });\n });\n (0, _jquery.default)(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery.default)(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery.default)(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery.default)(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery.default)(\"#team-info-create-form\").submit(createTeam);\n (0, _jquery.default)(\"#team-info-edit-form\").submit(updateTeam);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n createGraphs(type, id, name, account_id);\n setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/team.js?");
/***/ })
diff --git a/CTFd/themes/admin/static/js/pages/team.min.js b/CTFd/themes/admin/static/js/pages/team.min.js
index 84ac14c..a29dd56 100644
--- a/CTFd/themes/admin/static/js/pages/team.min.js
+++ b/CTFd/themes/admin/static/js/pages/team.min.js
@@ -1 +1 @@
-!function(l){function e(e){for(var t,o,n=e[0],s=e[1],a=e[2],i=0,r=[];i #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-info-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-info-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")})})}function c(e){e.preventDefault();var t=(0,u.default)("#team-info-edit-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#team-info-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-info-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-info-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function p(e,t){var o,n,s;switch(t){case"solves":o=(0,u.default)("input[data-submission-type=correct]:checked"),n="solve",s="Solves";break;case"fails":o=(0,u.default)("input[data-submission-type=incorrect]:checked"),n="fail",s="Fails"}var r=o.map(function(){return(0,u.default)(this).data("submission-id")}),a=1===r.length?n:n+"s";(0,i.ezQuery)({title:"Delete ".concat(s),body:"Are you sure you want to delete ".concat(r.length," ").concat(a,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=r[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value;e.push(m.default.api.delete_submission({submissionId:i}))}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}var f={team:[function(e){return m.default.api.get_team_solves({teamId:e})},function(e){return m.default.api.get_team_fails({teamId:e})},function(e){return m.default.api.get_team_awards({teamId:e})}],user:[function(e){return m.default.api.get_user_solves({userId:e})},function(e){return m.default.api.get_user_fails({userId:e})},function(e){return m.default.api.get_user_awards({userId:e})}]};(0,u.default)(function(){var e,t,o,n;(0,u.default)("#team-captain-form").submit(function(e){e.preventDefault();var t=(0,u.default)("#team-captain-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#team-captain-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-captain-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-captain-form").find("select[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}),(0,u.default)(".edit-team").click(function(e){(0,u.default)("#team-info-edit-modal").modal("toggle")}),(0,u.default)(".edit-captain").click(function(e){(0,u.default)("#team-captain-modal").modal("toggle")}),(0,u.default)(".award-team").click(function(e){(0,u.default)("#team-award-modal").modal("toggle")}),(0,u.default)(".addresses-team").click(function(e){(0,u.default)("#team-addresses-modal").modal("toggle")}),(0,u.default)("#user-award-form").submit(function(e){e.preventDefault();var t=(0,u.default)("#user-award-form").serializeJSON(!0);t.user_id=(0,u.default)("#award-member-input").val(),t.team_id=TEAM_ID,(0,u.default)("#user-award-form > #results").empty(),t.user_id?(t.user_id=parseInt(t.user_id),m.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#user-award-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#user-award-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#user-award-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})):(0,u.default)("#user-award-form > #results").append((0,i.ezBadge)({type:"error",body:"Please select a team member"}))}),(0,u.default)(".delete-member").click(function(e){e.preventDefault();var t=(0,u.default)(this).attr("member-id"),o=(0,u.default)(this).attr("member-name"),n={user_id:t},s=(0,u.default)(this).parent().parent();(0,i.ezQuery)({title:"Remove Member",body:"Are you sure you want to remove {0} from {1}?
All of their challenges solves, attempts, awards, and unlocked hints will also be deleted!".format(""+(0,a.htmlEntities)(o)+"",""+(0,a.htmlEntities)(TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+TEAM_ID+"/members",{method:"DELETE",body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(e){e.success&&s.remove()})}})}),(0,u.default)(".delete-team").click(function(e){(0,i.ezQuery)({title:"Delete Team",body:"Are you sure you want to delete {0}".format(""+(0,a.htmlEntities)(TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=m.default.config.urlRoot+"/admin/teams")})}})}),(0,u.default)("#solves-delete-button").click(function(e){p(0,"solves")}),(0,u.default)("#fails-delete-button").click(function(e){p(0,"fails")}),(0,u.default)("#awards-delete-button").click(function(e){!function(){var l=(0,u.default)("input[data-award-id]:checked").map(function(){return(0,u.default)(this).data("award-id")}),e=1===l.length?"award":"awards";(0,i.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(l.length," ").concat(e,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=l[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r=m.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});e.push(r)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}()}),(0,u.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var c=(0,u.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,u.default)(this).data("missing-challenge-id")});c.length,(0,i.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(c.length," correct for ").concat((0,a.htmlEntities)(TEAM_NAME),"?"),success:function(){(0,i.ezAlert)({title:"User Attribution",body:"\n Which user on ".concat((0,a.htmlEntities)(TEAM_NAME),' solved these challenges?\n \n ').concat((0,u.default)("#team-member-select").html(),"\n
\n "),button:"Mark Correct",success:function(){var e=(0,u.default)("#query-team-member-solve > select").val(),t=[],o=!0,n=!1,s=void 0;try{for(var a,i=c[Symbol.iterator]();!(o=(a=i.next()).done);o=!0){var r=a.value,l={provided:"MARKED AS SOLVED BY ADMIN",user_id:e,team_id:TEAM_ID,challenge_id:r,type:"correct"},d=m.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(l)});t.push(d)}}catch(e){n=!0,s=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}})}(e)}),(0,u.default)("#team-info-create-form").submit(r),(0,u.default)("#team-info-edit-form").submit(c);var s=window.stats_data;e=s.type,t=s.id,o=s.name,n=s.account_id,function(t,o,n,s){var e=d(f[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.createGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n),setInterval(function(){!function(t,o,n,s){var e=d(f[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.updateGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n)},3e5)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),a=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,a.default)(":input").each(function(){(0,a.default)(this).data("initial",(0,a.default)(this).val())}),(0,a.default)(".form-control").bind({focus:function(){(0,a.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,a.default)(this).val()&&(0,a.default)(this).removeClass("input-filled-valid")}}),(0,a.default)(".modal").on("show.bs.modal",function(e){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")})}),(0,a.default)(function(){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")}),(0,a.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,a.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,a.default)("[data-checkbox]").click(function(e){(0,a.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,a.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,a.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,a.default)(this).prop("checked"),o=(0,a.default)(this).index()+1;(0,a.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,a.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,a.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,a.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,s.makeSortableTables)(),(0,a.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var i=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new a.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',i='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,a=!1!==e.animation,i=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:i,animation:a}),o.toast("show"),o}function j(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=i.format(e.width),n=a.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var g={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=g},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t);if(l.empty(),void 0===l[0])return void console.log("Couldn't find graph target: "+t);l[0].fn=r.fn(n,s,a,i);var d=r.format(n,s,a,i,o);u.default.newPlot(l[0],d,r.layout,j)},t.updateGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t),d=r.format(n,s,a,i,o);u.default.update(l[0],d,r.layout,j)};var c=n(o("./node_modules/jquery/dist/jquery.js")),u=n(o("./node_modules/plotly.js-basic-dist/plotly-basic.js")),m=n(o("./node_modules/moment/moment.js")),p=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var f={score_graph:{layout:{title:"Score over Time",paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",hovermode:"closest",xaxis:{showgrid:!1,showspikes:!0},yaxis:{showgrid:!1,showspikes:!0},legend:{orientation:"h"}},fn:function(e,t,o,n){return"CTFd_score_".concat(e,"_").concat(o,"_").concat(t,"_").concat((new Date).toISOString().slice(0,19))},format:function(e,t,o,n,s){var a=[],i=[],r=s[0].data,l=s[2].data,d=r.concat(l);d.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var c=0;c>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,i.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,i.default)("th.sort-col").click(function(){var e=(0,i.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=a(e,s),n=a(t,s);return i.default.isNumeric(o)&&i.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,i.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-info-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-info-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")})})}function c(e){e.preventDefault();var t=(0,u.default)("#team-info-edit-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#team-info-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-info-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-info-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function p(e,t){var o,n,s;switch(t){case"solves":o=(0,u.default)("input[data-submission-type=correct]:checked"),n="solve",s="Solves";break;case"fails":o=(0,u.default)("input[data-submission-type=incorrect]:checked"),n="fail",s="Fails"}var r=o.map(function(){return(0,u.default)(this).data("submission-id")}),a=1===r.length?n:n+"s";(0,i.ezQuery)({title:"Delete ".concat(s),body:"Are you sure you want to delete ".concat(r.length," ").concat(a,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=r[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value;e.push(m.default.api.delete_submission({submissionId:i}))}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}var f={team:[function(e){return m.default.api.get_team_solves({teamId:e})},function(e){return m.default.api.get_team_fails({teamId:e})},function(e){return m.default.api.get_team_awards({teamId:e})}],user:[function(e){return m.default.api.get_user_solves({userId:e})},function(e){return m.default.api.get_user_fails({userId:e})},function(e){return m.default.api.get_user_awards({userId:e})}]};(0,u.default)(function(){var e,t,o,n;(0,u.default)("#team-captain-form").submit(function(e){e.preventDefault();var t=(0,u.default)("#team-captain-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#team-captain-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#team-captain-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#team-captain-form").find("select[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}),(0,u.default)(".edit-team").click(function(e){(0,u.default)("#team-info-edit-modal").modal("toggle")}),(0,u.default)(".edit-captain").click(function(e){(0,u.default)("#team-captain-modal").modal("toggle")}),(0,u.default)(".award-team").click(function(e){(0,u.default)("#team-award-modal").modal("toggle")}),(0,u.default)(".addresses-team").click(function(e){(0,u.default)("#team-addresses-modal").modal("toggle")}),(0,u.default)("#user-award-form").submit(function(e){e.preventDefault();var t=(0,u.default)("#user-award-form").serializeJSON(!0);t.user_id=(0,u.default)("#award-member-input").val(),t.team_id=TEAM_ID,(0,u.default)("#user-award-form > #results").empty(),t.user_id?(t.user_id=parseInt(t.user_id),m.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,u.default)("#user-award-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,u.default)("#user-award-form > #results").append((0,i.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,u.default)("#user-award-form").find("input[name={0}]".format(e)),n=(0,u.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})):(0,u.default)("#user-award-form > #results").append((0,i.ezBadge)({type:"error",body:"Please select a team member"}))}),(0,u.default)(".delete-member").click(function(e){e.preventDefault();var t=(0,u.default)(this).attr("member-id"),o=(0,u.default)(this).attr("member-name"),n={user_id:t},s=(0,u.default)(this).parent().parent();(0,i.ezQuery)({title:"Remove Member",body:"Are you sure you want to remove {0} from {1}?
All of their challenges solves, attempts, awards, and unlocked hints will also be deleted!".format(""+(0,a.htmlEntities)(o)+"",""+(0,a.htmlEntities)(TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+TEAM_ID+"/members",{method:"DELETE",body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(e){e.success&&s.remove()})}})}),(0,u.default)(".delete-team").click(function(e){(0,i.ezQuery)({title:"Delete Team",body:"Are you sure you want to delete {0}".format(""+(0,a.htmlEntities)(TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+TEAM_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=m.default.config.urlRoot+"/admin/teams")})}})}),(0,u.default)("#solves-delete-button").click(function(e){p(0,"solves")}),(0,u.default)("#fails-delete-button").click(function(e){p(0,"fails")}),(0,u.default)("#awards-delete-button").click(function(e){!function(){var l=(0,u.default)("input[data-award-id]:checked").map(function(){return(0,u.default)(this).data("award-id")}),e=1===l.length?"award":"awards";(0,i.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(l.length," ").concat(e,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=l[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r=m.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});e.push(r)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}()}),(0,u.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var c=(0,u.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,u.default)(this).data("missing-challenge-id")});c.length,(0,i.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(c.length," challenges correct for ").concat((0,a.htmlEntities)(TEAM_NAME),"?"),success:function(){(0,i.ezAlert)({title:"User Attribution",body:"\n Which user on ".concat((0,a.htmlEntities)(TEAM_NAME),' solved these challenges?\n \n ').concat((0,u.default)("#team-member-select").html(),"\n
\n "),button:"Mark Correct",success:function(){var e=(0,u.default)("#query-team-member-solve > select").val(),t=[],o=!0,n=!1,s=void 0;try{for(var a,i=c[Symbol.iterator]();!(o=(a=i.next()).done);o=!0){var r=a.value,l={provided:"MARKED AS SOLVED BY ADMIN",user_id:e,team_id:TEAM_ID,challenge_id:r,type:"correct"},d=m.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(l)});t.push(d)}}catch(e){n=!0,s=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}})}(e)}),(0,u.default)("#team-info-create-form").submit(r),(0,u.default)("#team-info-edit-form").submit(c);var s=window.stats_data;e=s.type,t=s.id,o=s.name,n=s.account_id,function(t,o,n,s){var e=d(f[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.createGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n),setInterval(function(){!function(t,o,n,s){var e=d(f[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.updateGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n)},3e5)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),a=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,a.default)(":input").each(function(){(0,a.default)(this).data("initial",(0,a.default)(this).val())}),(0,a.default)(".form-control").bind({focus:function(){(0,a.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,a.default)(this).val()&&(0,a.default)(this).removeClass("input-filled-valid")}}),(0,a.default)(".modal").on("show.bs.modal",function(e){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")})}),(0,a.default)(function(){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")}),(0,a.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,a.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,a.default)("[data-checkbox]").click(function(e){(0,a.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,a.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,a.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,a.default)(this).prop("checked"),o=(0,a.default)(this).index()+1;(0,a.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,a.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,a.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,a.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,a.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,a.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");if(e){var t=(0,a.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'));t.length?t.tab("show"):sessionStorage.removeItem("activeTab")}(0,s.makeSortableTables)(),(0,a.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var i=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new a.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',i='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,a=!1!==e.animation,i=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:i,animation:a}),o.toast("show"),o}function j(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=i.format(e.width),n=a.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var g={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=g},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t);if(l.empty(),void 0===l[0])return void console.log("Couldn't find graph target: "+t);l[0].fn=r.fn(n,s,a,i);var d=r.format(n,s,a,i,o);u.default.newPlot(l[0],d,r.layout,j)},t.updateGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t),d=r.format(n,s,a,i,o);u.default.update(l[0],d,r.layout,j)};var c=n(o("./node_modules/jquery/dist/jquery.js")),u=n(o("./node_modules/plotly.js-basic-dist/plotly-basic.js")),m=n(o("./node_modules/moment/moment.js")),p=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var f={score_graph:{layout:{title:"Score over Time",paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",hovermode:"closest",xaxis:{showgrid:!1,showspikes:!0},yaxis:{showgrid:!1,showspikes:!0},legend:{orientation:"h"}},fn:function(e,t,o,n){return"CTFd_score_".concat(e,"_").concat(o,"_").concat(t,"_").concat((new Date).toISOString().slice(0,19))},format:function(e,t,o,n,s){var a=[],i=[],r=s[0].data,l=s[2].data,d=r.concat(l);d.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var c=0;c>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,i.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,i.default)("th.sort-col").click(function(){var e=(0,i.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=a(e,s),n=a(t,s);return i.default.isNumeric(o)&&i.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,i.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o\n \n \n \n
\n \n \n \n
\n \n '),button:"Submit",success:function(){var e=(0,c.default)("#teams-bulk-edit").serializeJSON(!0),t=[],o=!0,n=!1,s=void 0;try{for(var i,a=r[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;t.push(d.default.fetch("/api/v1/teams/".concat(l),{method:"PATCH",body:JSON.stringify(e)}))}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}(0,c.default)(function(){(0,c.default)("#teams-delete-button").click(i),(0,c.default)("#teams-edit-button").click(a)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),i=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,i.default)(":input").each(function(){(0,i.default)(this).data("initial",(0,i.default)(this).val())}),(0,i.default)(".form-control").bind({focus:function(){(0,i.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,i.default)(this).val()&&(0,i.default)(this).removeClass("input-filled-valid")}}),(0,i.default)(".modal").on("show.bs.modal",function(e){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")})}),(0,i.default)(function(){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")}),(0,i.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,i.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,i.default)("[data-checkbox]").click(function(e){(0,i.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,i.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,i.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,i.default)(this).prop("checked"),o=(0,i.default)(this).index()+1;(0,i.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,i.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,i.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,i.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,s.makeSortableTables)(),(0,i.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),i=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var a=d(o("./node_modules/markdown-it/index.js")),l=d(o("./node_modules/jquery/dist/jquery.js")),r=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new i.API("/"),m={},p={ezq:r.default},f={$:l.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',a='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=i.format(e.title),o=(0,l.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,l.default)(e.body));var n=(0,l.default)(c.format(e.button));return e.success&&(0,l.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,l.default)("main").append(o),o.modal("show"),(0,l.default)(o).on("hidden.bs.modal",function(){(0,l.default)(this).modal("dispose")}),o}function f(e){(0,l.default)("#ezq--notifications-toast-container").length||(0,l.default)("body").append((0,l.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=r.format(e.title,e.body),o=(0,l.default)(t);if(e.onclose&&(0,l.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,l.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,i=!1!==e.animation,a=e.delay||1e4;return(0,l.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:a,animation:i}),o.toast("show"),o}function j(e){var t=i.format(e.title),o=(0,l.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,l.default)(e.body));var n=(0,l.default)(m),s=(0,l.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,l.default)("main").append(o),(0,l.default)(o).on("hidden.bs.modal",function(){(0,l.default)(this).modal("dispose")}),(0,l.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,l.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=a.format(e.width),n=i.format(e.title),s=(0,l.default)(n);return s.find(".modal-body").append((0,l.default)(o)),(0,l.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,l.default)(t)}var v={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=v},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var i=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,i(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var n,l=(n=o("./node_modules/q/q.js"))&&n.__esModule?n:{default:n},s=o("./CTFd/themes/core/assets/js/api.js");function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function r(e,t){return function(t){for(var e=1;e>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,a.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,a.default)("th.sort-col").click(function(){var e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=i(e,s),n=i(t,s);return a.default.isNumeric(o)&&a.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,a.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o\n \n \n \n
\n \n \n \n
\n \n '),button:"Submit",success:function(){var e=(0,c.default)("#teams-bulk-edit").serializeJSON(!0),t=[],o=!0,n=!1,s=void 0;try{for(var a,i=l[Symbol.iterator]();!(o=(a=i.next()).done);o=!0){var r=a.value;t.push(d.default.fetch("/api/v1/teams/".concat(r),{method:"PATCH",body:JSON.stringify(e)}))}}catch(e){n=!0,s=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}(0,c.default)(function(){(0,c.default)("#teams-delete-button").click(a),(0,c.default)("#teams-edit-button").click(i)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),a=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,a.default)(":input").each(function(){(0,a.default)(this).data("initial",(0,a.default)(this).val())}),(0,a.default)(".form-control").bind({focus:function(){(0,a.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,a.default)(this).val()&&(0,a.default)(this).removeClass("input-filled-valid")}}),(0,a.default)(".modal").on("show.bs.modal",function(e){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")})}),(0,a.default)(function(){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")}),(0,a.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,a.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,a.default)("[data-checkbox]").click(function(e){(0,a.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,a.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,a.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,a.default)(this).prop("checked"),o=(0,a.default)(this).index()+1;(0,a.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,a.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,a.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,a.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,a.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,a.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");if(e){var t=(0,a.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'));t.length?t.tab("show"):sessionStorage.removeItem("activeTab")}(0,s.makeSortableTables)(),(0,a.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var i=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new a.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',i='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,a=!1!==e.animation,i=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:i,animation:a}),o.toast("show"),o}function j(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=i.format(e.width),n=a.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var v={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=v},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var n,r=(n=o("./node_modules/q/q.js"))&&n.__esModule?n:{default:n},s=o("./CTFd/themes/core/assets/js/api.js");function a(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(e,t){return function(t){for(var e=1;e>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,i.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,i.default)("th.sort-col").click(function(){var e=(0,i.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=a(e,s),n=a(t,s);return i.default.isNumeric(o)&&i.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,i.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-info-create-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-info-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")})})}function m(e){e.preventDefault();var t=(0,i.default)("#user-info-edit-form").serializeJSON(!0);c.default.fetch("/api/v1/users/"+USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,i.default)("#user-info-edit-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-info-edit-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-info-edit-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function p(e){e.preventDefault(),(0,u.ezQuery)({title:"Delete User",body:"Are you sure you want to delete {0}".format(""+(0,a.htmlEntities)(USER_NAME)+""),success:function(){c.default.fetch("/api/v1/users/"+USER_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=c.default.config.urlRoot+"/admin/users")})}})}function f(e){e.preventDefault();var t=(0,i.default)("#user-award-form").serializeJSON(!0);t.user_id=USER_ID,c.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,i.default)("#user-award-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-award-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-award-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function j(e){e.preventDefault();var t=(0,i.default)("#user-mail-form").serializeJSON(!0);c.default.fetch("/api/v1/users/"+USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?((0,i.default)("#user-mail-form > #results").append((0,u.ezBadge)({type:"success",body:"E-Mail sent successfully!"})),(0,i.default)("#user-mail-form").find("input[type=text], textarea").val("")):((0,i.default)("#user-mail-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-mail-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function h(e,t){var o,n,s;switch(t){case"solves":o=(0,i.default)("input[data-submission-type=correct]:checked"),n="solve",s="Solves";break;case"fails":o=(0,i.default)("input[data-submission-type=incorrect]:checked"),n="fail",s="Fails"}var r=o.map(function(){return(0,i.default)(this).data("submission-id")}),a=1===r.length?n:n+"s";(0,u.ezQuery)({title:"Delete ".concat(s),body:"Are you sure you want to delete ".concat(r.length," ").concat(a,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=r[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value;e.push(c.default.api.delete_submission({submissionId:i}))}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}var _={team:[function(e){return c.default.api.get_team_solves({teamId:e})},function(e){return c.default.api.get_team_fails({teamId:e})},function(e){return c.default.api.get_team_awards({teamId:e})}],user:[function(e){return c.default.api.get_user_solves({userId:e})},function(e){return c.default.api.get_user_fails({userId:e})},function(e){return c.default.api.get_user_awards({userId:e})}]};(0,i.default)(function(){var e,t,o,n;(0,i.default)(".delete-user").click(p),(0,i.default)(".edit-user").click(function(e){(0,i.default)("#user-info-modal").modal("toggle")}),(0,i.default)(".award-user").click(function(e){(0,i.default)("#user-award-modal").modal("toggle")}),(0,i.default)(".email-user").click(function(e){(0,i.default)("#user-email-modal").modal("toggle")}),(0,i.default)(".addresses-user").click(function(e){(0,i.default)("#user-addresses-modal").modal("toggle")}),(0,i.default)("#user-mail-form").submit(j),(0,i.default)("#solves-delete-button").click(function(e){h(0,"solves")}),(0,i.default)("#fails-delete-button").click(function(e){h(0,"fails")}),(0,i.default)("#awards-delete-button").click(function(e){!function(){var l=(0,i.default)("input[data-award-id]:checked").map(function(){return(0,i.default)(this).data("award-id")}),e=1===l.length?"award":"awards";(0,u.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(l.length," ").concat(e,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=l[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r=c.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});e.push(r)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}()}),(0,i.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var d=(0,i.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,i.default)(this).data("missing-challenge-id")});d.length,(0,u.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(d.length," correct for ").concat((0,a.htmlEntities)(USER_NAME),"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=d[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r={provided:"MARKED AS SOLVED BY ADMIN",user_id:USER_ID,team_id:TEAM_ID,challenge_id:i,type:"correct"},l=c.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)});e.push(l)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}(e)}),(0,i.default)("#user-info-create-form").submit(r),(0,i.default)("#user-info-edit-form").submit(m),(0,i.default)("#user-award-form").submit(f);var s=window.stats_data;e=s.type,t=s.id,o=s.name,n=s.account_id,function(t,o,n,s){var e=d(_[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.createGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n),setInterval(function(){!function(t,o,n,s){var e=d(_[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.updateGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n)},3e5)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),a=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,a.default)(":input").each(function(){(0,a.default)(this).data("initial",(0,a.default)(this).val())}),(0,a.default)(".form-control").bind({focus:function(){(0,a.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,a.default)(this).val()&&(0,a.default)(this).removeClass("input-filled-valid")}}),(0,a.default)(".modal").on("show.bs.modal",function(e){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")})}),(0,a.default)(function(){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")}),(0,a.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,a.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,a.default)("[data-checkbox]").click(function(e){(0,a.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,a.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,a.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,a.default)(this).prop("checked"),o=(0,a.default)(this).index()+1;(0,a.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,a.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,a.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,a.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,s.makeSortableTables)(),(0,a.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var i=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new a.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',i='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,a=!1!==e.animation,i=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:i,animation:a}),o.toast("show"),o}function j(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=i.format(e.width),n=a.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var g={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=g},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t);if(l.empty(),void 0===l[0])return void console.log("Couldn't find graph target: "+t);l[0].fn=r.fn(n,s,a,i);var d=r.format(n,s,a,i,o);u.default.newPlot(l[0],d,r.layout,j)},t.updateGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t),d=r.format(n,s,a,i,o);u.default.update(l[0],d,r.layout,j)};var c=n(o("./node_modules/jquery/dist/jquery.js")),u=n(o("./node_modules/plotly.js-basic-dist/plotly-basic.js")),m=n(o("./node_modules/moment/moment.js")),p=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var f={score_graph:{layout:{title:"Score over Time",paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",hovermode:"closest",xaxis:{showgrid:!1,showspikes:!0},yaxis:{showgrid:!1,showspikes:!0},legend:{orientation:"h"}},fn:function(e,t,o,n){return"CTFd_score_".concat(e,"_").concat(o,"_").concat(t,"_").concat((new Date).toISOString().slice(0,19))},format:function(e,t,o,n,s){var a=[],i=[],r=s[0].data,l=s[2].data,d=r.concat(l);d.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var c=0;c>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,i.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,i.default)("th.sort-col").click(function(){var e=(0,i.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=a(e,s),n=a(t,s);return i.default.isNumeric(o)&&i.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,i.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-info-create-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-info-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")})})}function m(e){e.preventDefault();var t=(0,i.default)("#user-info-edit-form").serializeJSON(!0);c.default.fetch("/api/v1/users/"+USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,i.default)("#user-info-edit-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-info-edit-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-info-edit-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function p(e){e.preventDefault(),(0,u.ezQuery)({title:"Delete User",body:"Are you sure you want to delete {0}".format(""+(0,a.htmlEntities)(USER_NAME)+""),success:function(){c.default.fetch("/api/v1/users/"+USER_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=c.default.config.urlRoot+"/admin/users")})}})}function f(e){e.preventDefault();var t=(0,i.default)("#user-award-form").serializeJSON(!0);t.user_id=USER_ID,c.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?window.location.reload():((0,i.default)("#user-award-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-award-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-award-form").find("input[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function j(e){e.preventDefault();var t=(0,i.default)("#user-mail-form").serializeJSON(!0);c.default.fetch("/api/v1/users/"+USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(s){s.success?((0,i.default)("#user-mail-form > #results").append((0,u.ezBadge)({type:"success",body:"E-Mail sent successfully!"})),(0,i.default)("#user-mail-form").find("input[type=text], textarea").val("")):((0,i.default)("#user-mail-form > #results").empty(),Object.keys(s.errors).forEach(function(e,t){(0,i.default)("#user-mail-form > #results").append((0,u.ezBadge)({type:"error",body:s.errors[e]}));var o=(0,i.default)("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(e)),n=(0,i.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function h(e,t){var o,n,s;switch(t){case"solves":o=(0,i.default)("input[data-submission-type=correct]:checked"),n="solve",s="Solves";break;case"fails":o=(0,i.default)("input[data-submission-type=incorrect]:checked"),n="fail",s="Fails"}var r=o.map(function(){return(0,i.default)(this).data("submission-id")}),a=1===r.length?n:n+"s";(0,u.ezQuery)({title:"Delete ".concat(s),body:"Are you sure you want to delete ".concat(r.length," ").concat(a,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=r[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value;e.push(c.default.api.delete_submission({submissionId:i}))}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}var _={team:[function(e){return c.default.api.get_team_solves({teamId:e})},function(e){return c.default.api.get_team_fails({teamId:e})},function(e){return c.default.api.get_team_awards({teamId:e})}],user:[function(e){return c.default.api.get_user_solves({userId:e})},function(e){return c.default.api.get_user_fails({userId:e})},function(e){return c.default.api.get_user_awards({userId:e})}]};(0,i.default)(function(){var e,t,o,n;(0,i.default)(".delete-user").click(p),(0,i.default)(".edit-user").click(function(e){(0,i.default)("#user-info-modal").modal("toggle")}),(0,i.default)(".award-user").click(function(e){(0,i.default)("#user-award-modal").modal("toggle")}),(0,i.default)(".email-user").click(function(e){(0,i.default)("#user-email-modal").modal("toggle")}),(0,i.default)(".addresses-user").click(function(e){(0,i.default)("#user-addresses-modal").modal("toggle")}),(0,i.default)("#user-mail-form").submit(j),(0,i.default)("#solves-delete-button").click(function(e){h(0,"solves")}),(0,i.default)("#fails-delete-button").click(function(e){h(0,"fails")}),(0,i.default)("#awards-delete-button").click(function(e){!function(){var l=(0,i.default)("input[data-award-id]:checked").map(function(){return(0,i.default)(this).data("award-id")}),e=1===l.length?"award":"awards";(0,u.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(l.length," ").concat(e,"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=l[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r=c.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});e.push(r)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}()}),(0,i.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var d=(0,i.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,i.default)(this).data("missing-challenge-id")});d.length,(0,u.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(d.length," correct for ").concat((0,a.htmlEntities)(USER_NAME),"?"),success:function(){var e=[],t=!0,o=!1,n=void 0;try{for(var s,a=d[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var i=s.value,r={provided:"MARKED AS SOLVED BY ADMIN",user_id:USER_ID,team_id:TEAM_ID,challenge_id:i,type:"correct"},l=c.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)});e.push(l)}}catch(e){o=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(o)throw n}}Promise.all(e).then(function(e){window.location.reload()})}})}(e)}),(0,i.default)("#user-info-create-form").submit(r),(0,i.default)("#user-info-edit-form").submit(m),(0,i.default)("#user-award-form").submit(f);var s=window.stats_data;e=s.type,t=s.id,o=s.name,n=s.account_id,function(t,o,n,s){var e=d(_[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.createGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n),setInterval(function(){!function(t,o,n,s){var e=d(_[t],3),a=e[0],i=e[1],r=e[2];Promise.all([a(s),i(s),r(s)]).then(function(e){(0,l.updateGraph)("score_graph","#score-graph",e,t,o,n,s),(0,l.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,s),(0,l.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,s)})}(e,t,o,n)},3e5)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),a=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,a.default)(":input").each(function(){(0,a.default)(this).data("initial",(0,a.default)(this).val())}),(0,a.default)(".form-control").bind({focus:function(){(0,a.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,a.default)(this).val()&&(0,a.default)(this).removeClass("input-filled-valid")}}),(0,a.default)(".modal").on("show.bs.modal",function(e){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")})}),(0,a.default)(function(){(0,a.default)(".form-control").each(function(){(0,a.default)(this).val()&&(0,a.default)(this).addClass("input-filled-valid")}),(0,a.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,a.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,a.default)("[data-checkbox]").click(function(e){(0,a.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,a.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,a.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,a.default)(this).prop("checked"),o=(0,a.default)(this).index()+1;(0,a.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,a.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,a.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,a.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,a.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,a.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");if(e){var t=(0,a.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'));t.length?t.tab("show"):sessionStorage.removeItem("activeTab")}(0,s.makeSortableTables)(),(0,a.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var i=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new a.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',i='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,a=!1!==e.animation,i=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:i,animation:a}),o.toast("show"),o}function j(e){var t=a.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=i.format(e.width),n=a.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var g={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=g},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t);if(l.empty(),void 0===l[0])return void console.log("Couldn't find graph target: "+t);l[0].fn=r.fn(n,s,a,i);var d=r.format(n,s,a,i,o);u.default.newPlot(l[0],d,r.layout,j)},t.updateGraph=function(e,t,o,n,s,a,i){var r=f[e],l=(0,c.default)(t),d=r.format(n,s,a,i,o);u.default.update(l[0],d,r.layout,j)};var c=n(o("./node_modules/jquery/dist/jquery.js")),u=n(o("./node_modules/plotly.js-basic-dist/plotly-basic.js")),m=n(o("./node_modules/moment/moment.js")),p=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var f={score_graph:{layout:{title:"Score over Time",paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",hovermode:"closest",xaxis:{showgrid:!1,showspikes:!0},yaxis:{showgrid:!1,showspikes:!0},legend:{orientation:"h"}},fn:function(e,t,o,n){return"CTFd_score_".concat(e,"_").concat(o,"_").concat(t,"_").concat((new Date).toISOString().slice(0,19))},format:function(e,t,o,n,s){var a=[],i=[],r=s[0].data,l=s[2].data,d=r.concat(l);d.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var c=0;c>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,i.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,i.default)("th.sort-col").click(function(){var e=(0,i.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=a(e,s),n=a(t,s);return i.default.isNumeric(o)&&i.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,i.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o\n \n \n \n
\n \n \n \n
\n \n \n \n
\n \n '),button:"Submit",success:function(){var e=(0,c.default)("#users-bulk-edit").serializeJSON(!0),t=[],o=!0,n=!1,s=void 0;try{for(var i,a=l[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var r=i.value;t.push(d.default.fetch("/api/v1/users/".concat(r),{method:"PATCH",body:JSON.stringify(e)}))}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}(0,c.default)(function(){(0,c.default)("#users-delete-button").click(i),(0,c.default)("#users-edit-button").click(a)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),i=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,i.default)(":input").each(function(){(0,i.default)(this).data("initial",(0,i.default)(this).val())}),(0,i.default)(".form-control").bind({focus:function(){(0,i.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,i.default)(this).val()&&(0,i.default)(this).removeClass("input-filled-valid")}}),(0,i.default)(".modal").on("show.bs.modal",function(e){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")})}),(0,i.default)(function(){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")}),(0,i.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,i.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,i.default)("[data-checkbox]").click(function(e){(0,i.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,i.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,i.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,i.default)(this).prop("checked"),o=(0,i.default)(this).index()+1;(0,i.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,i.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,i.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,i.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,s.makeSortableTables)(),(0,i.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),i=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var a=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new i.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',a='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=i.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,i=!1!==e.animation,a=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:a,animation:i}),o.toast("show"),o}function j(e){var t=i.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=a.format(e.width),n=i.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var v={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=v},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var i=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,i(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var n,r=(n=o("./node_modules/q/q.js"))&&n.__esModule?n:{default:n},s=o("./CTFd/themes/core/assets/js/api.js");function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(e,t){return function(t){for(var e=1;e>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,a.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,a.default)("th.sort-col").click(function(){var e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=i(e,s),n=i(t,s);return a.default.isNumeric(o)&&a.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,a.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o\n \n \n \n
\n \n \n \n
\n \n \n \n
\n \n '),button:"Submit",success:function(){var e=(0,c.default)("#users-bulk-edit").serializeJSON(!0),t=[],o=!0,n=!1,s=void 0;try{for(var i,a=l[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var r=i.value;t.push(d.default.fetch("/api/v1/users/".concat(r),{method:"PATCH",body:JSON.stringify(e)}))}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}Promise.all(t).then(function(e){window.location.reload()})}})}(0,c.default)(function(){(0,c.default)("#users-delete-button").click(i),(0,c.default)("#users-edit-button").click(a)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n,s=o("./CTFd/themes/core/assets/js/utils.js"),i=(n=o("./node_modules/jquery/dist/jquery.js"))&&n.__esModule?n:{default:n};t.default=function(){(0,i.default)(":input").each(function(){(0,i.default)(this).data("initial",(0,i.default)(this).val())}),(0,i.default)(".form-control").bind({focus:function(){(0,i.default)(this).addClass("input-filled-valid")},blur:function(){""===(0,i.default)(this).val()&&(0,i.default)(this).removeClass("input-filled-valid")}}),(0,i.default)(".modal").on("show.bs.modal",function(e){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")})}),(0,i.default)(function(){(0,i.default)(".form-control").each(function(){(0,i.default)(this).val()&&(0,i.default)(this).addClass("input-filled-valid")}),(0,i.default)("tr[data-href]").click(function(){if(!getSelection().toString()){var e=(0,i.default)(this).attr("data-href");e&&(window.location=e)}return!1}),(0,i.default)("[data-checkbox]").click(function(e){(0,i.default)(e.target).is("input[type=checkbox]")?e.stopImmediatePropagation():((0,i.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation())}),(0,i.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,i.default)(this).prop("checked"),o=(0,i.default)(this).index()+1;(0,i.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,i.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,i.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,i.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,i.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,i.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");if(e){var t=(0,i.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'));t.length?t.tab("show"):sessionStorage.removeItem("activeTab")}(0,s.makeSortableTables)(),(0,i.default)('[data-toggle="tooltip"]').tooltip()})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(o("./CTFd/themes/core/assets/js/fetch.js")),s=d(o("./CTFd/themes/core/assets/js/config.js")),i=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var a=d(o("./node_modules/markdown-it/index.js")),r=d(o("./node_modules/jquery/dist/jquery.js")),l=d(o("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var u=new i.API("/"),m={},p={ezq:l.default},f={$:r.default,markdown:function(e){var t=function(t){for(var e=1;e {1}
',a='',s='\n Error:\n {0}\n \n
',d='\n Success!\n {0}\n \n
',c='',u='',m='';function p(e){var t=i.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(c.format(e.button));return e.success&&(0,r.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),o.modal("show"),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),o}function f(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),o=(0,r.default)(t);if(e.onclose&&(0,r.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick){var n=(0,r.default)(o).find(".toast-body");n.addClass("cursor-pointer"),n.click(function(){e.onclick()})}var s=!1!==e.autohide,i=!1!==e.animation,a=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:s,delay:a,animation:i}),o.toast("show"),o}function j(e){var t=i.format(e.title),o=(0,r.default)(t);"string"==typeof e.body?o.find(".modal-body").append("".concat(e.body,"
")):o.find(".modal-body").append((0,r.default)(e.body));var n=(0,r.default)(m),s=(0,r.default)(u);return o.find(".modal-footer").append(s),o.find(".modal-footer").append(n),(0,r.default)("main").append(o),(0,r.default)(o).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(n).click(function(){e.success()}),o.modal("show"),o}function h(e){if(e.target){var t=(0,r.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=a.format(e.width),n=i.format(e.title),s=(0,r.default)(n);return s.find(".modal-body").append((0,r.default)(o)),(0,r.default)("main").append(s),s.modal("show")}function _(e){var t={success:d,error:s}[e.type].format(e.body);return(0,r.default)(t)}var v={ezAlert:p,ezToast:f,ezQuery:j,ezProgressBar:h,ezBadge:_};t.default=v},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,s=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var i=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=s.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=s.default.csrfNonce,i(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var n,r=(n=o("./node_modules/q/q.js"))&&n.__esModule?n:{default:n},s=o("./CTFd/themes/core/assets/js/api.js");function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(e,t){return function(t){for(var e=1;e>8*s&255).toString(16)).substr(-2)}return n},t.htmlEntities=function(e){return(0,a.default)("").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,a.default)("th.sort-col").click(function(){var e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort(function(s){return function(e,t){var o=i(e,s),n=i(t,s);return a.default.isNumeric(o)&&a.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}}((0,a.default)(this).index()));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o