From eace93059f3f2d014e5b9803d78f2511e4483847 Mon Sep 17 00:00:00 2001 From: agoujot Date: Sun, 25 May 2025 22:08:46 +0200 Subject: [PATCH 01/15] +approx autoedits count using tags in ec --- i18n/en.json | 1 + i18n/qqq.json | 1 + src/Controller/EditCounterController.php | 72 ++++++++++++------- src/Helper/AutomatedEditsHelper.php | 12 ++++ src/Model/EditCounter.php | 30 +++++++- src/Repository/EditCounterRepository.php | 22 ++++-- templates/editCounter/general_stats.html.twig | 9 +++ 7 files changed, 115 insertions(+), 32 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 5d21645b8..5262408e2 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -42,6 +42,7 @@ "auto-contribs-use-tool": "Show only edits using the tool:", "auto-edits": "(Semi-)automated edits", "auto-edits-bot": "This user is a bot. All edits may be automated. Statistics shown here are based on edits made using known tools.", + "auto-edits-tagged": "Tagged (semi-)automated edits", "auto-edits-counts-desc": "Some tool usage overlaps (e.g. rolling back to a revision that is a redirect counts as Rollback and as Redirect), so the total of edits made with each tool may differ from the $1.", "auto-edits-counts-desc-grand-total": "grand total", "auto-edits-logged-out": "You must login to use the sandbox configuration. Using production configuration instead.", diff --git a/i18n/qqq.json b/i18n/qqq.json index c4fa78f4e..815093bc2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -61,6 +61,7 @@ "auto-contribs-use-tool": "Label for dropdown that limits results to edits made by the selected (semi-)automated tool. The dropdown is located immediately after the label.", "auto-edits": "(semi-)automated edits with known tools like Huggle", "auto-edits-bot": "Message shown at the top of the AutoEdits tool for users who are a bot, explaining that all edits made by the bot may be automated, even if XTools says they are not.", + "auto-edits-tagged": "Label for the very approximate count of tagged (semi-)automated edits in the last 5000 edits in the Edit Counter.", "auto-edits-counts-desc": "In the AutoEdits tool, this message explains how the totals of individual tools (shown in the '(semi-)automated edits' section) may be different from the total shown in the 'Summary' section. $1 is a link to the 'Summary' section with the message 'auto-edits-counts-grand-total' as the link text.", "auto-edits-counts-desc-grand-total": "The text 'grand total'. This is used as the text for the link in the 'auto-edits-counts-desc' message.", "auto-edits-logged-out": "Message shown when the user attempts to use the AutoEdits tool in sandbox mode, but hasn't logged in.", diff --git a/src/Controller/EditCounterController.php b/src/Controller/EditCounterController.php index 2189ca99f..58fe97c0d 100644 --- a/src/Controller/EditCounterController.php +++ b/src/Controller/EditCounterController.php @@ -4,6 +4,7 @@ namespace App\Controller; +use App\Helper\AutomatedEditsHelper; use App\Model\EditCounter; use App\Model\GlobalContribs; use App\Model\UserRights; @@ -92,7 +93,8 @@ public function restrictedApiActions(): array protected function setUpEditCounter( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper ): void { // Whether we're making a subrequest (the view makes a request to another action). // Subrequests to the same controller do not re-instantiate a new controller, and hence @@ -119,7 +121,8 @@ protected function setUpEditCounter( $this->i18n, $this->userRights, $this->project, - $this->user + $this->user, + $autoEditsHelper ); } @@ -242,15 +245,17 @@ private function redirectFromSections(): RedirectResponse * @param EditCounterRepository $editCounterRepo * @param UserRightsRepository $userRightsRepo * @param RequestStack $requestStack + * @param AutomatedEditsHelper $autoEditsHelper * @return Response|RedirectResponse * @codeCoverageIgnore */ public function resultAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper ) { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); if (1 === count($this->sections)) { // Redirect to dedicated route. @@ -297,9 +302,10 @@ public function generalStatsAction( UserRightsRepository $userRightsRepo, GlobalContribsRepository $globalContribsRepo, EditRepository $editRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $globalContribs = new GlobalContribs( $globalContribsRepo, @@ -358,9 +364,11 @@ public function generalStatsIndexAction(): Response public function namespaceTotalsAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = [ 'xtTitle' => $this->user->getUsername(), @@ -405,9 +413,11 @@ public function namespaceTotalsIndexAction(): Response public function timecardAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = [ 'xtTitle' => $this->user->getUsername(), @@ -453,9 +463,11 @@ public function timecardIndexAction(): Response public function yearCountsAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = [ 'xtTitle' => $this->user->getUsername(), @@ -500,9 +512,11 @@ public function yearCountsIndexAction(): Response public function monthCountsAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = [ 'xtTitle' => $this->user->getUsername(), @@ -548,9 +562,11 @@ public function monthCountsIndexAction(): Response public function rightsChangesAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): Response { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = [ 'xtTitle' => $this->user->getUsername(), @@ -628,9 +644,11 @@ public function rightsChangesIndexAction(): Response public function logCountsApiAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): JsonResponse { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); return $this->getFormattedApiResponse([ 'log_counts' => $this->editCounter->getLogCounts(), @@ -674,9 +692,11 @@ public function logCountsApiAction( public function namespaceTotalsApiAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): JsonResponse { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); return $this->getFormattedApiResponse([ 'namespace_totals' => (object)$this->editCounter->namespaceTotals(), @@ -730,9 +750,11 @@ public function namespaceTotalsApiAction( public function monthCountsApiAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): JsonResponse { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); $ret = $this->editCounter->monthCounts(); @@ -790,9 +812,11 @@ public function monthCountsApiAction( public function timecardApiAction( EditCounterRepository $editCounterRepo, UserRightsRepository $userRightsRepo, - RequestStack $requestStack + RequestStack $requestStack, + AutomatedEditsHelper $autoEditsHelper + ): JsonResponse { - $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack); + $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); return $this->getFormattedApiResponse([ 'timecard' => $this->editCounter->timeCard(), diff --git a/src/Helper/AutomatedEditsHelper.php b/src/Helper/AutomatedEditsHelper.php index bb6d91b9c..dd30f6bba 100644 --- a/src/Helper/AutomatedEditsHelper.php +++ b/src/Helper/AutomatedEditsHelper.php @@ -184,6 +184,18 @@ public function getTools(Project $project, bool $useSandbox = false): array return $this->tools[$projectDomain]; } + /** + * Get all the tags associated to automated edits on a given project. + * @param bool $useSandbox Whether to use the /sandbox version for testing (also bypasses caching). + * @return array Array with numeric keys and values being tag names (as in change_tag_def). + */ + public function getTags(Project $project, bool $useSandbox = false): array + { + $tools = $this->getTools($project, $useSandbox); + $tags = array_merge(... array_map(fn($o) => $o["tags"], array_values($tools))); + return $tags; + } + /** * Merges the given rule sets, giving priority to the local set. Regex is concatenated, not overridden. * @param string[] $globalRules The global rule set. diff --git a/src/Model/EditCounter.php b/src/Model/EditCounter.php index 099ad4698..50e0ca421 100644 --- a/src/Model/EditCounter.php +++ b/src/Model/EditCounter.php @@ -5,6 +5,7 @@ namespace App\Model; use App\Helper\I18nHelper; +use App\Helper\AutomatedEditsHelper; use App\Repository\EditCounterRepository; use DateInterval; use DatePeriod; @@ -67,6 +68,7 @@ class EditCounter extends Model * @param I18nHelper $i18n * @param UserRights $userRights * @param Project $project The base project to count edits + * @param AutomatedEditsHelper * @param User $user */ public function __construct( @@ -74,13 +76,15 @@ public function __construct( I18nHelper $i18n, UserRights $userRights, Project $project, - User $user + User $user, + AutomatedEditsHelper $autoEditsHelper ) { $this->repository = $repository; $this->i18n = $i18n; $this->userRights = $userRights; $this->project = $project; $this->user = $user; + $this->autoEditsHelper = $autoEditsHelper; } /** @@ -1056,6 +1060,30 @@ public function countLargeEdits(): int return isset($editSizeData['large_edits']) ? (int) $editSizeData['large_edits'] : 0; } + /** + * Get the number of edits that have automated tags in the user's past 5000 edits. + * @return int + */ + public function countAutoEdits(): int + { + $editSizeData = $this->getEditSizeData(); + if (!isset($editSizeData['tag_lists'])) { + return 0; + } + $tags = json_decode($editSizeData['tag_lists']); + $autoTags = $this->autoEditsHelper->getTags($this->project); + return count( // Number + array_filter($tags, // of revisions + fn($a) => $a !== null && // with tags + count( // where the number of tags + array_filter($a, + fn($t) => in_array($t, $autoTags) // that mean these edits are auto + ) + ) > 0 // is greater than 0 + ) + ); + } + /** * Get the average size of the user's past 5000 edits. * @return float Size in bytes. diff --git a/src/Repository/EditCounterRepository.php b/src/Repository/EditCounterRepository.php index 8d6a5eb87..ff8888b81 100644 --- a/src/Repository/EditCounterRepository.php +++ b/src/Repository/EditCounterRepository.php @@ -570,7 +570,8 @@ public function getEditSizeData(Project $project, User $user): array // Prepare the queries and execute them. $revisionTable = $project->getTableName('revision'); - $pageTable = $project->getTableName('page'); + $ctTable = $project->getTableName('change_tag'); + $ctdTable = $project->getTableName('change_tag_def'); $ipcJoin = ''; $whereClause = 'revs.rev_actor = :actorId'; $params = ['actorId' => $user->getActorId($project)]; @@ -582,19 +583,26 @@ public function getEditSizeData(Project $project, User $user): array $whereClause = 'ipc_hex BETWEEN :startIp AND :endIp'; } - $sql = "SELECT AVG(sizes.size) AS average_size, - COUNT(CASE WHEN sizes.size < 20 THEN 1 END) AS small_edits, - COUNT(CASE WHEN sizes.size > 1000 THEN 1 END) AS large_edits + $sql = "SELECT AVG(data.size) AS average_size, + COUNT(CASE WHEN data.size < 20 THEN 1 END) AS small_edits, + COUNT(CASE WHEN data.size > 1000 THEN 1 END) AS large_edits, + JSON_ARRAYAGG(data.tags) as tag_lists FROM ( - SELECT (CAST(revs.rev_len AS SIGNED) - IFNULL(parentrevs.rev_len, 0)) AS size + SELECT (CAST(revs.rev_len AS SIGNED) - IFNULL(parentrevs.rev_len, 0)) AS size, + ( + SELECT JSON_ARRAYAGG(ctd_name) + FROM $ctTable + JOIN $ctdTable + ON ct_tag_id = ctd_id + WHERE ct_rev_id = revs.rev_id + ) AS tags FROM $revisionTable AS revs - JOIN $pageTable ON revs.rev_page = page_id $ipcJoin LEFT JOIN $revisionTable AS parentrevs ON (revs.rev_parent_id = parentrevs.rev_id) WHERE $whereClause ORDER BY revs.rev_timestamp DESC LIMIT 5000 - ) sizes"; + ) data"; $results = $this->executeProjectsQuery($project, $sql, $params)->fetchAssociative(); // Cache and return. diff --git a/templates/editCounter/general_stats.html.twig b/templates/editCounter/general_stats.html.twig index d93eaad6e..e7c62272f 100644 --- a/templates/editCounter/general_stats.html.twig +++ b/templates/editCounter/general_stats.html.twig @@ -170,6 +170,15 @@ {% endif %} + + {{ msg('auto-edits-tagged')* }} + + {{ ec.countAutoEdits|num_format }} + {% if ec.countLast5000 %} + · + ({{ ((ec.countAutoEdits / ec.countLast5000) * 100)|percent_format }} ) + {% endif %} + {{ msg('small-edits') }}* From 3705f18fd62c766bb2ce0a6d4eff0966682e5579 Mon Sep 17 00:00:00 2001 From: agoujot Date: Sun, 25 May 2025 22:21:17 +0200 Subject: [PATCH 02/15] some formatting --- src/Controller/EditCounterController.php | 9 --------- src/Model/EditCounter.php | 12 +++++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Controller/EditCounterController.php b/src/Controller/EditCounterController.php index 58fe97c0d..40a3af2b0 100644 --- a/src/Controller/EditCounterController.php +++ b/src/Controller/EditCounterController.php @@ -366,7 +366,6 @@ public function namespaceTotalsAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): Response { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -415,7 +414,6 @@ public function timecardAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): Response { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -465,7 +463,6 @@ public function yearCountsAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): Response { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -514,7 +511,6 @@ public function monthCountsAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): Response { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -564,7 +560,6 @@ public function rightsChangesAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): Response { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -646,7 +641,6 @@ public function logCountsApiAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): JsonResponse { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -694,7 +688,6 @@ public function namespaceTotalsApiAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): JsonResponse { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -752,7 +745,6 @@ public function monthCountsApiAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): JsonResponse { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); @@ -814,7 +806,6 @@ public function timecardApiAction( UserRightsRepository $userRightsRepo, RequestStack $requestStack, AutomatedEditsHelper $autoEditsHelper - ): JsonResponse { $this->setUpEditCounter($editCounterRepo, $userRightsRepo, $requestStack, $autoEditsHelper); diff --git a/src/Model/EditCounter.php b/src/Model/EditCounter.php index 50e0ca421..619c9f3a2 100644 --- a/src/Model/EditCounter.php +++ b/src/Model/EditCounter.php @@ -4,8 +4,8 @@ namespace App\Model; -use App\Helper\I18nHelper; use App\Helper\AutomatedEditsHelper; +use App\Helper\I18nHelper; use App\Repository\EditCounterRepository; use DateInterval; use DatePeriod; @@ -1073,11 +1073,13 @@ public function countAutoEdits(): int $tags = json_decode($editSizeData['tag_lists']); $autoTags = $this->autoEditsHelper->getTags($this->project); return count( // Number - array_filter($tags, // of revisions - fn($a) => $a !== null && // with tags + array_filter( + $tags, // of revisions + fn($a) => null !== $a && // with tags count( // where the number of tags - array_filter($a, - fn($t) => in_array($t, $autoTags) // that mean these edits are auto + array_filter( + $a, + fn($t) => in_array($t, $autoTags) // that mean these edits are auto ) ) > 0 // is greater than 0 ) From b3a5a86a85a64dfb814279742e8020b410a156d2 Mon Sep 17 00:00:00 2001 From: agoujot Date: Sun, 25 May 2025 22:26:41 +0200 Subject: [PATCH 03/15] add to wikitext and a few fixes --- templates/editCounter/general_stats.html.twig | 2 +- templates/editCounter/general_stats.wikitext.twig | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/editCounter/general_stats.html.twig b/templates/editCounter/general_stats.html.twig index e7c62272f..8f7684afd 100644 --- a/templates/editCounter/general_stats.html.twig +++ b/templates/editCounter/general_stats.html.twig @@ -171,7 +171,7 @@ - {{ msg('auto-edits-tagged')* }} + {{ msg('auto-edits-tagged') }}* {{ ec.countAutoEdits|num_format }} {% if ec.countLast5000 %} diff --git a/templates/editCounter/general_stats.wikitext.twig b/templates/editCounter/general_stats.wikitext.twig index 6e4705a98..d07fd5ab4 100644 --- a/templates/editCounter/general_stats.wikitext.twig +++ b/templates/editCounter/general_stats.wikitext.twig @@ -90,6 +90,10 @@ | {% verbatim %}{{FORMATNUM:{% endverbatim %}{{ ec.countMinorRevisions }}}}{% if ec.countLiveRevisions %} ({{ ((ec.countMinorRevisions / ec.countLiveRevisions) * 100)|percent_format }}) {% endif %} |- +| {{ msg('auto-edits-tagged') }} +| {% verbatim %}{{FORMATNUM:{% endverbatim %}{{ ec.countAutoEdits }}}}{% if ec.countLast5000 %} ({{ ((ec.countAutoEdits / ec.countLast5000) * 100)|percent_format }}) +{% endif %} +|- | {{ msg('small-edits') }}* | {% verbatim %}{{FORMATNUM:{% endverbatim %}{{ ec.countSmallEdits }}}}{% if ec.countLast5000 %} ({{ ((ec.countSmallEdits / ec.countLast5000) * 100)|percent_format }}) {% endif %} From fcb4d6e646c0cd8e02e035fa7f63b3af0b6b2030 Mon Sep 17 00:00:00 2001 From: agoujot Date: Sun, 25 May 2025 22:38:14 +0200 Subject: [PATCH 04/15] fix tests --- tests/Model/EditCounterTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Model/EditCounterTest.php b/tests/Model/EditCounterTest.php index c7f489cb5..e9f007ee0 100644 --- a/tests/Model/EditCounterTest.php +++ b/tests/Model/EditCounterTest.php @@ -4,6 +4,7 @@ namespace App\Tests\Model; +use App\Helper\AutomatedEditsHelper; use App\Helper\I18nHelper; use App\Model\EditCounter; use App\Model\Project; @@ -58,7 +59,8 @@ public function setUp(): void $this->i18n, $this->createMock(UserRights::class), $this->project, - $this->user + $this->user, + $this->createMock(AutomatedEditsHelper::class) ); $this->editCounter->setRepository($this->editCounterRepo); } From a3eebe5168206b7ea272a54d021cc85215a958f8 Mon Sep 17 00:00:00 2001 From: agoujot Date: Thu, 29 May 2025 23:05:00 +0200 Subject: [PATCH 05/15] readd page join --- src/Repository/EditCounterRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Repository/EditCounterRepository.php b/src/Repository/EditCounterRepository.php index ff8888b81..e18b4d030 100644 --- a/src/Repository/EditCounterRepository.php +++ b/src/Repository/EditCounterRepository.php @@ -570,6 +570,7 @@ public function getEditSizeData(Project $project, User $user): array // Prepare the queries and execute them. $revisionTable = $project->getTableName('revision'); + $pageTable = $project->getTableName('page'); $ctTable = $project->getTableName('change_tag'); $ctdTable = $project->getTableName('change_tag_def'); $ipcJoin = ''; @@ -597,6 +598,7 @@ public function getEditSizeData(Project $project, User $user): array WHERE ct_rev_id = revs.rev_id ) AS tags FROM $revisionTable AS revs + JOIN $pageTable ON revs.rev_page = page_id $ipcJoin LEFT JOIN $revisionTable AS parentrevs ON (revs.rev_parent_id = parentrevs.rev_id) WHERE $whereClause From 73703246e98307e7378150ffd6086df7d1a1e05c Mon Sep 17 00:00:00 2001 From: agoujot Date: Fri, 13 Jun 2025 09:27:10 +0200 Subject: [PATCH 06/15] fix merge mess --- assets/js/editcounter.js | 2 +- public/build/app.892f5cd7.js | 2 -- public/build/app.a6586164.js | 2 ++ ...ICENSE.txt => app.a6586164.js.LICENSE.txt} | 0 public/build/entrypoints.json | 2 +- public/build/manifest.json | 2 +- src/Repository/EditCounterRepository.php | 34 +++++++++++-------- templates/editCounter/general_stats.html.twig | 2 +- 8 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 public/build/app.892f5cd7.js create mode 100644 public/build/app.a6586164.js rename public/build/{app.892f5cd7.js.LICENSE.txt => app.a6586164.js.LICENSE.txt} (100%) diff --git a/assets/js/editcounter.js b/assets/js/editcounter.js index cdd848fc4..9c6d1fc30 100644 --- a/assets/js/editcounter.js +++ b/assets/js/editcounter.js @@ -316,7 +316,7 @@ xtools.editcounter.setupMonthYearChart = function (id, datasets, labels, maxTota xtools.editcounter.setupSizeHistogram = function (data, colors, barLabels) { let bars = 11; // First sanitize input, to get array. - let total = Object.keys(data).length - 3; // -3 to exclude small edits, large edits and average + let total = Object.keys(data).length; data.length = total; data = Array.from(data) // Then make datasets diff --git a/public/build/app.892f5cd7.js b/public/build/app.892f5cd7.js deleted file mode 100644 index 595247631..000000000 --- a/public/build/app.892f5cd7.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see app.892f5cd7.js.LICENSE.txt */ -(self.webpackChunkxtools=self.webpackChunkxtools||[]).push([[524],{3441:()=>{xtools.adminstats={},$((function(){var t=$("#project_input"),e=t.val();0!==$("body.adminstats, body.patrollerstats, body.stewardstats").length&&(xtools.application.setupMultiSelectListeners(),$(".group-selector").on("change",(function(){$(".action-selector").addClass("hidden"),$(".action-selector--"+$(this).val()).removeClass("hidden"),$(".xt-page-title--title").text($.i18n("tool-"+$(this).val()+"stats")),$(".xt-page-title--desc").text($.i18n("tool-"+$(this).val()+"stats-desc"));var n=$.i18n("tool-"+$(this).val()+"stats")+" - "+$.i18n("xtools-title");document.title=n,history.replaceState({},n,"/"+$(this).val()+"stats"),"steward"===$(this).val()?(e=t.val(),t.val("meta.wikimedia.org")):t.val(e),xtools.application.setupMultiSelectListeners()})))}))},9654:(t,e,n)=>{n(8636),n(5086),$((function(){if($("body.authorship").length){var t=$("#show_selector");t.on("change",(function(t){$(".show-option").addClass("hidden").find("input").prop("disabled",!0),$(".show-option--".concat(t.target.value)).removeClass("hidden").find("input").prop("disabled",!1)})),window.onload=function(){return t.trigger("change")}}}))},5611:(t,e,n)=>{n(8476),n(5086),n(8379),n(7899),n(2231),n(115),xtools.autoedits={},$((function(){if($("body.autoedits").length){var t=$(".contributions-container"),e=$("#tool_selector");if(e.length)return xtools.autoedits.fetchTools=function(t){e.prop("disabled",!0),$.get("/api/project/automated_tools/"+t).done((function(t){t.error||(delete t.project,delete t.elapsed_time,e.html('"),Object.keys(t).forEach((function(n){e.append('")}))),e.prop("disabled",!1)}))},$(document).ready((function(){$("#project_input").on("change.autoedits",(function(){xtools.autoedits.fetchTools($("#project_input").val())}))})),void xtools.autoedits.fetchTools($("#project_input").val());if(xtools.application.setupToggleTable(window.countsByTool,window.toolsChart,"count",(function(t){var e=0;Object.keys(t).forEach((function(n){e+=parseInt(t[n].count,10)}));var n=Object.keys(t).length;$(".tools--tools").text(n.toLocaleString(i18nLang)+" "+$.i18n("num-tools",n)),$(".tools--count").text(e.toLocaleString(i18nLang))})),t.length){var n=$(".contributions-table").length?"setupContributionsNavListeners":"loadContributions";xtools.application[n]((function(t){return"".concat(t.target,"-contributions/").concat(t.project,"/").concat(t.username)+"/".concat(t.namespace,"/").concat(t.start,"/").concat(t.end)}),t.data("target"))}}}))},3600:(t,e,n)=>{n(7136),n(173),n(9073),n(6048),n(8636),n(5086),xtools.blame={},$((function(){if($("body.blame").length){$(".diff-empty").length===$(".diff tr").length-1&&$(".diff-empty").eq(0).text("(".concat($.i18n("diff-empty").toLowerCase(),")")).addClass("text-muted text-center").prop("width","20%"),$(".diff-addedline").each((function(){var t=xtools.blame.query.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),e=function(e){var n=new RegExp("(".concat(t,")"),"gi");$(e).html($(e).html().replace(n,"$1"))};$(this).find(".diffchange-inline").length?$(".diffchange-inline").each((function(){e(this)})):e(this)}));var t=$("#show_selector");t.on("change",(function(t){$(".show-option").addClass("hidden").find("input").prop("disabled",!0),$(".show-option--".concat(t.target.value)).removeClass("hidden").find("input").prop("disabled",!1)})),window.onload=function(){return t.trigger("change")}}}))},514:(t,e,n)=>{function a(t,e){xtools.categoryedits.$select2Input.data("select2")&&(xtools.categoryedits.$select2Input.off("change"),xtools.categoryedits.$select2Input.select2("val",null),xtools.categoryedits.$select2Input.select2("data",null),xtools.categoryedits.$select2Input.select2("destroy"));var n=e||xtools.categoryedits.$select2Input.data("ns"),a={ajax:{url:t||xtools.categoryedits.$select2Input.data("api"),dataType:"jsonp",jsonpCallback:"categorySuggestionCallback",delay:200,data:function(t){return{action:"query",list:"prefixsearch",format:"json",pssearch:t.term||"",psnamespace:14,cirrusUseCompletionSuggester:"yes"}},processResults:function(t){var e=t?t.query:{},a=[];return e&&e.prefixsearch.length&&(a=e.prefixsearch.map((function(t){var e=t.title.replace(new RegExp("^"+n+":"),"");return{id:e.score(),text:e}}))),{results:a}}},placeholder:$.i18n("category-search"),maximumSelectionLength:10,minimumInputLength:1};xtools.categoryedits.$select2Input.select2(a)}n(475),n(8476),n(5086),n(8379),n(7899),n(2231),n(9581),n(7136),n(173),n(9073),n(6048),xtools.categoryedits={},$((function(){$("body.categoryedits").length&&$(document).ready((function(){var t;xtools.categoryedits.$select2Input=$("#category_selector"),a(),$("#project_input").on("xtools.projectLoaded",(function(t,e){$.get(xtBaseUrl+"api/project/namespaces/"+e.project).done((function(t){a(t.api,t.namespaces[14])}))})),$("form").on("submit",(function(){$("#category_input").val(xtools.categoryedits.$select2Input.val().join("|"))})),xtools.application.setupToggleTable(window.countsByCategory,window.categoryChart,"editCount",(function(t){var e=0,n=0;Object.keys(t).forEach((function(a){e+=parseInt(t[a].editCount,10),n+=parseInt(t[a].pageCount,10)}));var a=Object.keys(t).length;$(".category--category").text(a.toLocaleString(i18nLang)+" "+$.i18n("num-categories",a)),$(".category--count").text(e.toLocaleString(i18nLang)),$(".category--percent-of-edit-count").text(100*(e/xtools.categoryedits.userEditCount).toLocaleString(i18nLang)+"%"),$(".category--pages").text(n.toLocaleString(i18nLang))})),$(".contributions-container").length&&(t=$(".contributions-table").length?"setupContributionsNavListeners":"loadContributions",xtools.application[t]((function(t){return"categoryedits-contributions/"+t.project+"/"+t.username+"/"+t.categories+"/"+t.start+"/"+t.end}),"Category"))}))}))},5779:(t,e,n)=>{function a(t){$("#project_input").val(xtools.application.vars.lastProject),$(".site-notice").append("")}function o(){var t=$("#page_input"),e=$("#user_input"),n=$("#namespace_select");if(t[0]||e[0]||$("#project_input")[0]){t.data("typeahead")&&t.data("typeahead").destroy(),e.data("typeahead")&&e.data("typeahead").destroy(),xtools.application.vars.apiPath||(xtools.application.vars.apiPath=$("#page_input").data("api")||$("#user_input").data("api"));var a={url:xtools.application.vars.apiPath,timeout:200,triggerLength:1,method:"get",preDispatch:null,preProcess:null};t[0]&&t.typeahead({ajax:Object.assign(a,{preDispatch:function(t){n[0]&&"0"!==n.val()&&(t=n.find("option:selected").text().trim()+":"+t);return{action:"query",list:"prefixsearch",format:"json",pssearch:t}},preProcess:function(t){var e="";return n[0]&&"0"!==n.val()&&(e=n.find("option:selected").text().trim()),t.query.prefixsearch.map((function(t){return t.title.replace(new RegExp("^"+e+":"),"")}))}})}),e[0]&&e.typeahead({ajax:Object.assign(a,{preDispatch:function(t){return{action:"query",list:"prefixsearch",format:"json",pssearch:"User:"+t}},preProcess:function(t){return t.query.prefixsearch.map((function(t){return t.title.split("/")[0].substr(t.title.indexOf(":")+1)})).filter((function(t,e,n){return n.indexOf(t)===e}))}})})}}function i(t){t?($(".form-control").prop("readonly",!1),$(".form-submit").prop("disabled",!1),$(".form-submit").text($.i18n("submit")).prop("disabled",!1)):$("#content form").on("submit",(function(){document.activeElement.blur(),$(".form-control").prop("readonly",!0),$(".form-submit").prop("disabled",!0).html($.i18n("loading")+" ");var t=Date.now();setInterval((function(){var e=Math.round((Date.now()-t)/1e3),n=Math.floor(e/60),a=("00"+(e-60*n)).slice(-2);$("#submit_timer").text(n+":"+a)}),1e3)}))}n(8665),n(5086),n(9979),n(4602),n(789),n(933),n(9218),n(2231),n(8636),n(5231),n(6088),n(8476),n(8379),n(7899),n(4189),n(8329),n(9581),n(7136),n(173),n(9073),n(6048),n(9693),n(17),n(9560),n(9389),n(8772),n(4913),xtools={},xtools.application={},xtools.application.vars={sectionOffset:{}},xtools.application.chartGridColor="rgba(0, 0, 0, 0.1)",window.matchMedia("(prefers-color-scheme: dark)").matches&&(Chart.defaults.global.defaultFontColor="#AAA",xtools.application.chartGridColor="#333"),$.i18n({locale:i18nLang}).load(i18nPaths),$((function(){$(document).ready((function(){if($(".xt-hide").on("click",(function(){$(this).hide(),$(this).siblings(".xt-show").show(),$(this).parents(".panel-heading").length?$(this).parents(".panel-heading").siblings(".panel-body").hide():$(this).parents(".xt-show-hide--parent").next(".xt-show-hide--target").hide()})),$(".xt-show").on("click",(function(){$(this).hide(),$(this).siblings(".xt-hide").show(),$(this).parents(".panel-heading").length?$(this).parents(".panel-heading").siblings(".panel-body").show():$(this).parents(".xt-show-hide--parent").next(".xt-show-hide--target").show()})),function(){var t=$(window).width(),e=$(".tool-links").outerWidth(),n=$(".nav-buttons").outerWidth();if(t<768)return;e+n>t&&$(".tool-links--more").removeClass("hidden");var a=$(".tool-links--entry").length;for(;a>0&&e+n>t;){var o=$(".tool-links--nav > .tool-links--entry:not(.active)").last().remove();$(".tool-links--more .dropdown-menu").append(o),e=$(".tool-links").outerWidth(),a--}}(),xtools.application.setupColumnSorting(),function(){var t=$(".xt-toc");if(!t||!t[0])return;xtools.application.vars.tocHeight=t.height();var e=function(){$(".xt-toc").find("a").off("click").on("click",(function(t){document.activeElement.blur();var e=$("#"+$(t.target).data("section"));$(window).scrollTop(e.offset().top-xtools.application.vars.tocHeight),$(this).parents(".xt-toc").find("a").removeClass("bold"),n(),xtools.application.vars.$tocClone.addClass("bold")}))};xtools.application.setupTocListeners=e;var n=function(){xtools.application.vars.$tocClone||(xtools.application.vars.$tocClone=t.clone(),xtools.application.vars.$tocClone.addClass("fixed"),t.after(xtools.application.vars.$tocClone),e())};xtools.application.buildSectionOffsets=function(){$.each(t.find("a"),(function(t,e){var n=$(e).data("section");xtools.application.vars.sectionOffset[n]=$("#"+n).offset().top}))},$(".xt-show, .xt-hide").on("click",xtools.application.buildSectionOffsets),xtools.application.buildSectionOffsets(),e();var a=t.offset().top;$(window).on("scroll.toc",(function(t){var e,o=$(t.target).scrollTop(),i=o>a;i?(xtools.application.vars.$tocClone||n(),Object.keys(xtools.application.vars.sectionOffset).forEach((function(t){o>xtools.application.vars.sectionOffset[t]-xtools.application.vars.tocHeight-1&&(e=xtools.application.vars.$tocClone.find('a[data-section="'+t+'"]'))})),xtools.application.vars.$tocClone.find("a").removeClass("bold"),e&&e.addClass("bold")):!i&&xtools.application.vars.$tocClone&&(xtools.application.vars.$tocClone.remove(),xtools.application.vars.$tocClone=null)}))}(),function(){var t=$(".table-sticky-header");if(!t||!t[0])return;var e,n=t.find("thead tr").eq(0),a=function(){e||(e=n.clone(),n.addClass("sticky-heading"),n.before(e),n.find("th").each((function(t){$(this).css("width",e.find("th").eq(t).outerWidth())})),n.css("width",e.outerWidth()+1))},o=t.offset().top;$(window).on("scroll.stickyHeader",(function(i){var r=$(i.target).scrollTop()>o;r&&!e?a():!r&&e?(n.removeClass("sticky-heading"),e.remove(),e=null):e&&n.css("top",$(window).scrollTop()-t.offset().top)}))}(),function(){var t=$("#project_input");if(!t)return;t.length&&$("#namespace_select").length?(xtools.application.vars.lastProject=$("#project_input").val(),$("#project_input").off("change").on("change",(function(){$("#namespace_select").prop("disabled",!0);var t=this.value;$.get(xtBaseUrl+"api/project/namespaces/"+t).done((function(e){var n=$('#namespace_select option[value="all"]').eq(0).clone();for(var a in $("#namespace_select").html(n),xtools.application.vars.apiPath=e.api,e.namespaces)if(e.namespaces.hasOwnProperty(a)){var i=0===parseInt(a,10)?$.i18n("mainspace"):e.namespaces[a];$("#namespace_select").append("")}$("#namespace_select").val(0),xtools.application.vars.lastProject=t,o()})).fail(a.bind(this,t)).always((function(){$("#namespace_select").prop("disabled",!1)}))})),$("#namespace_select").on("change",o)):($("#user_input")[0]||$("#page_input")[0])&&(xtools.application.vars.lastProject=t.val(),t.on("change",(function(){var e=this.value;$.get(xtBaseUrl+"api/project/normalize/"+e).done((function(n){xtools.application.vars.apiPath=n.api,xtools.application.vars.lastProject=e,o(),t.trigger("xtools.projectLoaded",n)})).fail(a.bind(this,e))})))}(),o(),i(),"function"==typeof URL){var t=new URL(window.location.href).searchParams.get("focus");t&&$("[name=".concat(t,"]")).focus()}})),window.onpageshow=function(t){t.persisted&&i(!0)}})),xtools.application.setupToggleTable=function(t,e,n,a){var o;$(".toggle-table").on("click",".toggle-table--toggle",(function(){o||(o=Object.assign({},t));var i=$(this).data("index"),r=$(this).data("key");"true"===$(this).attr("data-disabled")?(o[r]=t[r],e&&(e.data.datasets[0].data[i]=parseInt(n?o[r][n]:o[r],10)),$(this).attr("data-disabled","false")):(delete o[r],e&&(e.data.datasets[0].data[i]=null),$(this).attr("data-disabled","true")),$(this).parents("tr").toggleClass("excluded"),$(this).find(".glyphicon").toggleClass("glyphicon-remove").toggleClass("glyphicon-plus"),a(o,r,i),e&&e.update()}))},xtools.application.setupColumnSorting=function(){var t,e;$(".sort-link").on("click",(function(){t=e===$(this).data("column")?-t:1,$(".sort-link .glyphicon").removeClass("glyphicon-sort-by-alphabet-alt glyphicon-sort-by-alphabet").addClass("glyphicon-sort");var n=1===t?"glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet";$(this).find(".glyphicon").addClass(n).removeClass("glyphicon-sort"),e=$(this).data("column");var a=$(this).parents("table"),o=a.find(".sort-entry--"+e).parent();o.length&&(o.sort((function(n,a){var o=$(n).find(".sort-entry--"+e).data("value")||0,i=$(a).find(".sort-entry--"+e).data("value")||0;return isNaN(o)||(o=parseFloat(o)||0),isNaN(i)||(i=parseFloat(i)||0),oi?-t:0})),$(".sort-entry--rank").length>0&&$.each(o,(function(t,e){$(e).find(".sort-entry--rank").text(t+1)})),a.find("tbody").html(o))}))},xtools.application.setupMultiSelectListeners=function(){var t=$(".multi-select--body:not(.hidden) .multi-select--option");t.on("change",(function(){$(".multi-select--all").prop("checked",$(".multi-select--body:not(.hidden) .multi-select--option:checked").length===t.length)})),$(".multi-select--all").on("click",(function(){t.prop("checked",$(this).prop("checked"))}))}},6618:(t,e,n)=>{function a(){xtools.application.vars.offset||(xtools.application.vars.initialOffset=$(".contributions-container").data("offset"),xtools.application.vars.offset=xtools.application.vars.initialOffset)}n(9218),n(2231),n(8665),n(5086),n(9979),n(4602),n(933),n(7136),n(785),n(9389),n(6048),n(9073),n(173),Object.assign(xtools.application.vars,{initialOffset:"",offset:"",prevOffsets:[],initialLoad:!1}),xtools.application.loadContributions=function(t,e){a();var n=$(".contributions-container"),o=$(".contributions-loading"),i=n.data(),r=t(i),s=parseInt(i.limit,10)||50,l=new URLSearchParams(window.location.search),u=xtBaseUrl+r+"/"+xtools.application.vars.offset,c=location.pathname.split("/")[1],d=u.split("/")[1];n.addClass("contributions-container--loading"),o.show(),l.set("limit",s.toString()),l.append("htmlonly","yes"),$.ajax({url:u+"?"+l.toString(),timeout:6e4}).always((function(){n.removeClass("contributions-container--loading"),o.hide()})).done((function(a){if(n.html(a).show(),xtools.application.setupContributionsNavListeners(t,e),xtools.application.vars.initialOffset||(xtools.application.vars.initialOffset=$(".contribs-row-date").first().data("value"),xtools.application.vars.initialLoad=!0),c!==d){var o=new RegExp("^/".concat(d,"/(.*)/"));u=u.replace(o,"/".concat(c,"/$1/"))}xtools.application.vars.initialLoad?xtools.application.vars.initialLoad=!1:(l.delete("htmlonly"),window.history.replaceState(null,document.title,u+"?"+l.toString()),n.parents(".panel")[0].scrollIntoView()),xtools.application.vars.offset"+i+"")).show()}))},xtools.application.setupContributionsNavListeners=function(t,e){a(),$(".contributions--prev").off("click").one("click",(function(n){n.preventDefault(),xtools.application.vars.offset=xtools.application.vars.prevOffsets.pop()||xtools.application.vars.initialOffset,xtools.application.loadContributions(t,e)})),$(".contributions--next").off("click").one("click",(function(n){n.preventDefault(),xtools.application.vars.offset&&xtools.application.vars.prevOffsets.push(xtools.application.vars.offset),xtools.application.vars.offset=$(".contribs-row-date").last().data("value"),xtools.application.loadContributions(t,e)})),$("#contributions_limit").on("change",(function(t){var e=parseInt(t.target.value,10);$(".contributions-container").data("limit",e),$(".contributions--prev-text").text($.i18n("pager-newer-n",e).capitalize()),$(".contributions--next-text").text($.i18n("pager-older-n",e).capitalize())}))}},9143:(t,e,n)=>{n(7136),n(173),n(17),n(5086),n(9693),n(5852),n(4913),String.prototype.descore=function(){return this.replace(/_/g," ")},String.prototype.score=function(){return this.replace(/ /g,"_")},String.prototype.escape=function(){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return this.replace(/[&<>"'\/]/g,(function(e){return t[e]}))},Array.prototype.unique=function(){return this.filter((function(t,e,n){return n.indexOf(t)===e}))},Object.defineProperty(String.prototype,"capitalize",{value:function(){return this.charAt(0).toUpperCase()+this.slice(1)},enumerable:!1})},9307:(t,e,n)=>{function a(t,e){var n=0,a=[];Object.keys(t).forEach((function(e){var o=parseInt(t[e],10);a.push(o),n+=o}));var i=Object.keys(t).length;$(".namespaces--namespaces").text(i.toLocaleString(i18nLang)+" "+$.i18n("num-namespaces",i)),$(".namespaces--count").text(n.toLocaleString(i18nLang)),a.forEach((function(t){var e=r(t,n);$(".namespaces-table .sort-entry--count[data-value="+t+"]").text(t.toLocaleString(i18nLang)+" ("+e+")")})),["year","month"].forEach((function(t){var n=window[t+"countsChart"],a=window.namespaces[e]||$.i18n("mainspace");if(n){var i=0;n.data.datasets.forEach((function(t,e){t.label===a&&(i=e)}));var r=n.getDatasetMeta(i);r.hidden=null===r.hidden?!n.data.datasets[i].hidden:null,r.hidden?xtools.editcounter.excludedNamespaces.push(a):xtools.editcounter.excludedNamespaces=xtools.editcounter.excludedNamespaces.filter((function(t){return t!==a})),window[t+"countsChart"].config.data.labels=o(t,n.data.datasets),n.update()}}))}function o(t,e){var n=i(t,e);return Object.keys(n).map((function(e){var a=n[e].toString().length,o=2*(xtools.editcounter.maxDigits[t]-a);return e+Array(o+5).join("\t")+n[e].toLocaleString(i18nLang,{useGrouping:!1})}))}function i(t,e){var n={};return e.forEach((function(e){-1===xtools.editcounter.excludedNamespaces.indexOf(e.label)&&e.data.forEach((function(e,a){n[xtools.editcounter.chartLabels[t][a]]||(n[xtools.editcounter.chartLabels[t][a]]=0),n[xtools.editcounter.chartLabels[t][a]]+=e}))})),n}function r(t,e){return(t/e).toLocaleString(i18nLang,{style:"percent"})}n(8476),n(5086),n(8379),n(7899),n(2231),n(17),n(9581),n(9389),n(6048),n(475),n(9693),n(7136),n(173),n(5195),n(9979),n(2982),n(115),n(1128),n(5843),n(533),n(8825),n(6088),xtools.editcounter={},xtools.editcounter.excludedNamespaces=[],xtools.editcounter.chartLabels={},xtools.editcounter.maxDigits={},$((function(){0!==$("body.editcounter").length&&(xtools.application.setupMultiSelectListeners(),$(".chart-wrapper").each((function(){var t=$(this).data("chart-type");if(void 0===t)return!1;var e=$(this).data("chart-data"),n=$(this).data("chart-labels"),a=$("canvas",$(this));new Chart(a,{type:t,data:{labels:n,datasets:[{data:e}]}})})),xtools.application.setupToggleTable(window.namespaceTotals,window.namespaceChart,null,a))})),xtools.editcounter.setupMonthYearChart=function(t,e,n,a){var s=e.map((function(t){return t.label}));xtools.editcounter.maxDigits[t]=a.toString().length,xtools.editcounter.chartLabels[t]=n;var l=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"linear";return window[t+"countsChart"]=new Chart($("#"+t+"counts-canvas"),{type:"horizontalBar",data:{labels:o(t,e),datasets:e},options:{tooltips:{mode:"nearest",intersect:!0,callbacks:{label:function(n){var a=i(t,e),o=Object.keys(a).map((function(t){return a[t]})),s=o[n.index],l=r(n.xLabel,s);return n.xLabel.toLocaleString(i18nLang)+" ("+l+")"},title:function(t){return t[0].yLabel.replace(/\t.*/,"")+" - "+s[t[0].datasetIndex]}}},responsive:!0,maintainAspectRatio:!1,scales:{xAxes:[{type:n,stacked:!0,ticks:{beginAtZero:!0,min:"logarithmic"==n?1:0,reverse:i18nRTL,callback:function(t){if(Math.floor(t)===t)return t.toLocaleString(i18nLang)}},gridLines:{color:xtools.application.chartGridColor},afterBuildTicks:function(t){if("logarithmic"==n){var e=[];t.ticks.forEach((function(t,n){(0==n||1.5*e[e.length-1]"+u[11].toLocaleString(i18nLang)),window.sizeHistogramChart=new Chart($("#sizechart-canvas"),{type:"bar",data:{labels:c,datasets:[s,l,i]},options:{tooltips:{mode:"nearest",intersect:!0,callbacks:{label:function(t){return percentage=r(Math.abs(t.yLabel),o),Math.abs(t.yLabel).toLocaleString(i18nLang)+" ("+percentage+")"}}},responsive:!0,maintainAspectRatio:!1,legend:{position:"top"},scales:{yAxes:[{stacked:!0,gridLines:{color:xtools.application.chartGridColor},ticks:{callback:function(t){return Math.abs(t).toLocaleString(i18nLang)}}}],xAxes:[{stacked:!0,gridLines:{color:xtools.application.chartGridColor}}]}}})},xtools.editcounter.setupTimecard=function(t,e){var n=(new Date).getTimezoneOffset()/60;t=t.map((function(t){return t.backgroundColor=new Array(t.data.length).fill(t.backgroundColor),t})),window.chart=new Chart($("#timecard-bubble-chart"),{type:"bubble",data:{datasets:t},options:{responsive:!0,legend:{display:!1},layout:{padding:{right:0}},elements:{point:{radius:function(t){var e=t.dataIndex,n=t.dataset.data[e],a=(t.chart.height-20)/9/2;return n.scale/20*a},hitRadius:8}},scales:{yAxes:[{ticks:{min:0,max:8,stepSize:1,padding:25,callback:function(t,n){return e[n]}},position:i18nRTL?"right":"left",gridLines:{color:xtools.application.chartGridColor}},{ticks:{min:0,max:8,stepSize:1,padding:25,callback:function(e,n){return 0===n||n>7?"":(window.chart?window.chart.data.datasets:t).map((function(t){return t.data})).flat().filter((function(t){return t.y==8-n})).reduce((function(t,e){return t+parseInt(e.value,10)}),0)}},position:i18nRTL?"left":"right"}],xAxes:[{ticks:{beginAtZero:!0,min:0,max:24,stepSize:1,reverse:i18nRTL,padding:0,callback:function(e,n,a,o){if(24===e)return"";var i=[];if($("#timecard-bubble-chart").attr("width")>=1e3){var r=(window.chart?window.chart.data.datasets:t).map((function(t){return t.data})).flat().filter((function(t){return t.x==e}));i.push(r.reduce((function(t,e){return t+parseInt(e.value,10)}),0))}return e%2==0&&i.push(e+":00"),i}},gridLines:{color:xtools.application.chartGridColor},position:"bottom"}]},tooltips:{displayColors:!1,callbacks:{title:function(t){return e[7-t[0].yLabel+1]+" "+parseInt(t[0].xLabel)+":"+String(t[0].xLabel%1*60).padStart(2,"0")},label:function(e){var n=[t[e.datasetIndex].data[e.index].value];return"".concat(n," ").concat($.i18n("num-edits",[n]))}}}}}),$((function(){$(".use-local-time").prop("checked",!1).on("click",(function(){var t=$(this).is(":checked")?n:-n,e=new Array(7);chart.data.datasets.forEach((function(t){return e[t.data[0].day_of_week-1]=t.backgroundColor[0]})),chart.data.datasets=chart.data.datasets.map((function(n){var a=[];return n.data=n.data.map((function(n){var o=parseFloat(n.hour)-t,i=parseInt(n.day_of_week,10);return o<0?(o=24+o,(i-=1)<1&&(i=7+i)):o>=24&&(o-=24,(i+=1)>7&&(i-=7)),n.hour=o.toString(),n.x=o.toString(),n.day_of_week=i.toString(),n.y=(8-i).toString(),a.push(e[i-1]),n})),n.backgroundColor=a,n})),$(this).is(":checked"),chart.update()}))}))}},6730:(t,e,n)=>{n(115),xtools.globalcontribs={},$((function(){0!==$("body.globalcontribs").length&&xtools.application.setupContributionsNavListeners((function(t){return"globalcontribs/".concat(t.username,"/").concat(t.namespace,"/").concat(t.start,"/").concat(t.end)}),"globalcontribs")}))},1680:(t,e,n)=>{n(7136),n(173),xtools.pageinfo={},$((function(){if($("body.pageinfo").length){var t=function(){xtools.application.setupToggleTable(window.textshares,window.textsharesChart,"percentage",$.noop)},e=$(".textshares-container");if(e[0]){var n=xtBaseUrl+"authorship/"+e.data("project")+"/"+e.data("page")+"/"+(xtools.pageinfo.endDate?xtools.pageinfo.endDate+"/":"");n="".concat(n.replace(/\/$/,""),"?htmlonly=yes"),$.ajax({url:n,timeout:3e4}).done((function(n){e.replaceWith(n),xtools.application.buildSectionOffsets(),xtools.application.setupTocListeners(),xtools.application.setupColumnSorting(),t()})).fail((function(t,n,a){e.replaceWith($.i18n("api-error","Authorship API: "+a+""))}))}else $(".textshares-table").length&&t()}}))},1595:(t,e,n)=>{n(8476),n(5086),n(8379),n(7899),n(4867),n(9389),n(6048),n(8636),xtools.pages={},$((function(){if($("body.pages").length){var t={};xtools.application.setupToggleTable(window.countsByNamespace,window.pieChart,"count",(function(t){var e={count:0,deleted:0,redirects:0};Object.keys(t).forEach((function(n){e.count+=t[n].count,e.deleted+=t[n].deleted,e.redirects+=t[n].redirects})),$(".namespaces--namespaces").text(Object.keys(t).length.toLocaleString()+" "+$.i18n("num-namespaces",Object.keys(t).length)),$(".namespaces--pages").text(e.count.toLocaleString()),$(".namespaces--deleted").text(e.deleted.toLocaleString()+" ("+(e.deleted/e.count*100).toFixed(1)+"%)"),$(".namespaces--redirects").text(e.redirects.toLocaleString()+" ("+(e.redirects/e.count*100).toFixed(1)+"%)")})),$(".deleted-page").on("mouseenter",(function(e){var n=$(this).data("page-title"),a=$(this).data("namespace"),o=$(this).data("datetime").toString(),i=$(this).data("username"),r=function(t){$(e.target).find(".tooltip-body").html(t)};if(void 0!==t[a+"/"+n])return r(t[a+"/"+n]);var s=function(){r(""+$.i18n("api-error","Deletion Summary API")+"")};$.ajax({url:xtBaseUrl+"pages/deletion_summary/"+wikiDomain+"/"+i+"/"+a+"/"+n+"/"+o}).done((function(e){if(null===e.summary)return s();r(e.summary),t[a+"/"+n]=e.summary})).fail(s)}))}}))},1223:()=>{xtools.topedits={},$((function(){$("body.topedits").length&&$("#namespace_select").on("change",(function(){$("#page_input").prop("disabled","all"===$(this).val())}))}))},7852:(t,e,n)=>{var a,o,i,s;function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}n(7136),n(6255),n(2231),n(4913),n(6088),n(9389),n(5086),n(6048),n(8665),n(4602),n(115),n(8476),n(9693),n(475),n(9581),n(2982),n(4009),n(17),n(2157),n(8763),n(9560),n(5852),n(8379),n(7899),n(533),n(4538),n(1145),n(6943),n(8772),n(5231),n(4867),n(4895),n(4189),n(557),n(8844),n(2006),n(3534),n(590),n(4216),n(9979),s=function(){return function t(e,n,a){function o(r,s){if(!n[r]){if(!e[r]){if(i)return i(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[r]={exports:{}};e[r][0].call(u.exports,(function(t){return o(e[r][1][t]||t)}),u,u.exports,t,e,n,a)}return n[r].exports}for(var i=void 0,r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,a=t,o=void 0===e?.5:e,i=2*o-1,r=n.alpha()-a.alpha(),s=((i*r==-1?i:(i+r)/(1+i*r))+1)/2,l=1-s;return this.rgb(s*n.red()+l*a.red(),s*n.green()+l*a.green(),s*n.blue()+l*a.blue()).alpha(n.alpha()*o+a.alpha()*(1-o))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new i,a=this.values,o=n.values;for(var r in a)a.hasOwnProperty(r)&&(t=a[r],"[object Array]"===(e={}.toString.call(t))?o[r]=t.slice(0):"[object Number]"===e?o[r]=t:console.error("unexpected color value:",t));return n}},i.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},i.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},i.prototype.getValues=function(t){for(var e=this.values,n={},a=0;a.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92)),100*(.2126*e+.7152*n+.0722*a),100*(.0193*e+.1192*n+.9505*a)]}function c(t){var e=u(t),n=e[0],a=e[1],o=e[2];return a/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116)-16,500*(n-a),200*(a-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]}function d(t){var e,n,a,o,i,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[i=255*l,i,i];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),o=[0,0,0];for(var u=0;u<3;u++)(a=r+1/3*-(u-1))<0&&a++,a>1&&a--,i=6*a<1?e+6*(n-e)*a:2*a<1?n:3*a<2?e+(n-e)*(2/3-a)*6:e,o[u]=255*i;return o}function h(t){var e=t[0]/60,n=t[1]/100,a=t[2]/100,o=Math.floor(e)%6,i=e-Math.floor(e),r=255*a*(1-n),s=255*a*(1-n*i),l=255*a*(1-n*(1-i));switch(a*=255,o){case 0:return[a,l,r];case 1:return[s,a,r];case 2:return[r,a,l];case 3:return[r,s,a];case 4:return[l,r,a];case 5:return[a,r,s]}}function f(t){var e,n,a,o,i=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),a=6*i-(e=Math.floor(6*i)),!!(1&e)&&(a=1-a),o=s+a*((n=1-l)-s),e){default:case 6:case 0:r=n,g=o,b=s;break;case 1:r=o,g=n,b=s;break;case 2:r=s,g=n,b=o;break;case 3:r=s,g=o,b=n;break;case 4:r=o,g=s,b=n;break;case 5:r=n,g=s,b=o}return[255*r,255*g,255*b]}function p(t){var e=t[0]/100,n=t[1]/100,a=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,a*(1-o)+o))]}function v(t){var e,n,a,o=t[0]/100,i=t[1]/100,r=t[2]/100;return n=-.9689*o+1.8758*i+.0415*r,a=.0557*o+-.204*i+1.057*r,e=(e=3.2406*o+-1.5372*i+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(a=Math.min(Math.max(0,a),1))]}function m(t){var e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function x(t){var e,n,a,o,i=t[0],r=t[1],s=t[2];return i<=8?o=(n=100*i/903.3)/100*7.787+16/116:(n=100*Math.pow((i+16)/116,3),o=Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(r/500+o-16/116)/7.787:95.047*Math.pow(r/500+o,3),n,a=a/108.883<=.008859?a=108.883*(o-s/200-16/116)/7.787:108.883*Math.pow(o-s/200,3)]}function y(t){var e,n=t[0],a=t[1],o=t[2];return(e=360*Math.atan2(o,a)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(a*a+o*o),e]}function k(t){return v(x(t))}function w(t){var e,n=t[0],a=t[1];return e=t[2]/360*2*Math.PI,[n,a*Math.cos(e),a*Math.sin(e)]}function C(t){return S[t]}e.exports={rgb2hsl:a,rgb2hsv:o,rgb2hwb:i,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:c,rgb2lch:function(t){return y(c(t))},hsl2rgb:d,hsl2hsv:function(t){var e=t[0],n=t[1]/100,a=t[2]/100;return 0===a?[0,0,0]:[e,2*(n*=(a*=2)<=1?a:2-a)/(a+n)*100,(a+n)/2*100]},hsl2hwb:function(t){return i(d(t))},hsl2cmyk:function(t){return s(d(t))},hsl2keyword:function(t){return l(d(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,a=t[0],o=t[1]/100,i=t[2]/100;return e=o*i,[a,100*(e=(e/=(n=(2-o)*i)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return i(h(t))},hsv2cmyk:function(t){return s(h(t))},hsv2keyword:function(t){return l(h(t))},hwb2rgb:f,hwb2hsl:function(t){return a(f(t))},hwb2hsv:function(t){return o(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return a(p(t))},cmyk2hsv:function(t){return o(p(t))},cmyk2hwb:function(t){return i(p(t))},cmyk2keyword:function(t){return l(p(t))},keyword2rgb:C,keyword2hsl:function(t){return a(C(t))},keyword2hsv:function(t){return o(C(t))},keyword2hwb:function(t){return i(C(t))},keyword2cmyk:function(t){return s(C(t))},keyword2lab:function(t){return c(C(t))},keyword2xyz:function(t){return u(C(t))},xyz2rgb:v,xyz2lab:m,xyz2lch:function(t){return y(m(t))},lab2xyz:x,lab2rgb:k,lab2lch:y,lch2lab:w,lch2xyz:function(t){return x(w(t))},lch2rgb:function(t){return k(w(t))}};var S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},M={};for(var _ in S)M[JSON.stringify(S[_])]=_},{}],5:[function(t,e,n){var a=t(4),o=function(){return new u};for(var i in a){o[i+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),a[t](e)}}(i);var r=/(\w+)2(\w+)/.exec(i),s=r[1],l=r[2];(o[s]=o[s]||{})[l]=o[i]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=a[t](e);if("string"==typeof n||void 0===n)return n;for(var o=0;o0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index=0&&o>0)&&(v+=o));return i=d.getPixelForValue(v),{size:s=((r=d.getPixelForValue(v+f))-i)/2,base:i,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,n){var a,o,r,s,l,u=n.scale.options,c=this.getStackIndex(t),d=n.pixels,h=d[e],f=d.length,p=n.start,g=n.end;return 1===f?(a=h>p?h-p:g-h,o=h0&&(a=(h-d[e-1])/2,e===f-1&&(o=a)),e');var n=t.data,a=n.datasets,o=n.labels;if(a.length)for(var i=0;i'),o[i]&&e.push(o[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var o=t.getDatasetMeta(0),r=e.datasets[0],s=o.data[a],l=s&&s.custom||{},u=i.valueAtIndexOrDefault,c=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:u(r.backgroundColor,a,c.backgroundColor),strokeStyle:l.borderColor?l.borderColor:u(r.borderColor,a,c.borderColor),lineWidth:l.borderWidth?l.borderWidth:u(r.borderWidth,a,c.borderWidth),hidden:isNaN(r.data[a])||o.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,o,i=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n=Math.PI?-1:p<-Math.PI?1:0))+f,v={x:Math.cos(p),y:Math.sin(p)},m={x:Math.cos(g),y:Math.sin(g)},b=p<=0&&g>=0||p<=2*Math.PI&&2*Math.PI<=g,x=p<=.5*Math.PI&&.5*Math.PI<=g||p<=2.5*Math.PI&&2.5*Math.PI<=g,y=p<=-Math.PI&&-Math.PI<=g||p<=Math.PI&&Math.PI<=g,k=p<=.5*-Math.PI&&.5*-Math.PI<=g||p<=1.5*Math.PI&&1.5*Math.PI<=g,w=h/100,C={x:y?-1:Math.min(v.x*(v.x<0?1:w),m.x*(m.x<0?1:w)),y:k?-1:Math.min(v.y*(v.y<0?1:w),m.y*(m.y<0?1:w))},S={x:b?1:Math.max(v.x*(v.x>0?1:w),m.x*(m.x>0?1:w)),y:x?1:Math.max(v.y*(v.y>0?1:w),m.y*(m.y>0?1:w))},M={width:.5*(S.x-C.x),height:.5*(S.y-C.y)};u=Math.min(s/M.width,l/M.height),c={x:-.5*(S.x+C.x),y:-.5*(S.y+C.y)}}n.borderWidth=e.getMaxBorderWidth(d.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=c.x*n.outerRadius,n.offsetY=c.y*n.outerRadius,d.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),i.each(d.data,(function(n,a){e.updateElement(n,a,t)}))},updateElement:function(t,e,n){var a=this,o=a.chart,r=o.chartArea,s=o.options,l=s.animation,u=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=s.rotation,h=s.rotation,f=a.getDataset(),p=n&&l.animateRotate||t.hidden?0:a.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),g=n&&l.animateScale?0:a.innerRadius,v=n&&l.animateScale?0:a.outerRadius,m=i.valueAtIndexOrDefault;i.extend(t,{_datasetIndex:a.index,_index:e,_model:{x:u+o.offsetX,y:c+o.offsetY,startAngle:d,endAngle:h,circumference:p,outerRadius:v,innerRadius:g,label:m(f.label,e,o.data.labels[e])}});var b=t._model;this.removeHoverStyle(t),n&&l.animateRotate||(b.startAngle=0===e?s.rotation:a.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),a=0;return i.each(n.data,(function(n,o){t=e.data[o],isNaN(t)||n.hidden||(a+=Math.abs(t))})),a},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,a=0,o=this.index,i=t.length,r=0;r(a=e>a?e:a)?n:a;return a}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return i.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:o.Line,dataElementType:o.Point,update:function(t){var n,a,o,r=this,s=r.getMeta(),l=s.dataset,u=s.data||[],c=r.chart.options,d=c.elements.line,h=r.getScaleForId(s.yAxisID),f=r.getDataset(),p=e(f,c);for(p&&(o=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=r.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:c.spanGaps,tension:o.tension?o.tension:i.valueOrDefault(f.lineTension,d.tension),backgroundColor:o.backgroundColor?o.backgroundColor:f.backgroundColor||d.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:f.borderWidth||d.borderWidth,borderColor:o.borderColor?o.borderColor:f.borderColor||d.borderColor,borderCapStyle:o.borderCapStyle?o.borderCapStyle:f.borderCapStyle||d.borderCapStyle,borderDash:o.borderDash?o.borderDash:f.borderDash||d.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:f.borderDashOffset||d.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:f.borderJoinStyle||d.borderJoinStyle,fill:o.fill?o.fill:void 0!==f.fill?f.fill:d.fill,steppedLine:o.steppedLine?o.steppedLine:i.valueOrDefault(f.steppedLine,d.stepped),cubicInterpolationMode:o.cubicInterpolationMode?o.cubicInterpolationMode:i.valueOrDefault(f.cubicInterpolationMode,d.cubicInterpolationMode)},l.pivot()),n=0,a=u.length;n');var n=t.data,a=n.datasets,o=n.labels;if(a.length)for(var i=0;i'),o[i]&&e.push(o[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var o=t.getDatasetMeta(0),r=e.datasets[0],s=o.data[a].custom||{},l=i.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:l(r.backgroundColor,a,u.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(r.borderColor,a,u.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(r.borderWidth,a,u.borderWidth),hidden:isNaN(r.data[a])||o.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,o,i=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:o.Line,dataElementType:o.Point,linkScales:i.noop,update:function(t){var e=this,n=e.getMeta(),a=n.dataset,o=n.data,r=a.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,u=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:o,_loop:!0,_model:{tension:r.tension?r.tension:i.valueOrDefault(s.lineTension,l.tension),backgroundColor:r.backgroundColor?r.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:s.borderWidth||l.borderWidth,borderColor:r.borderColor?r.borderColor:s.borderColor||l.borderColor,fill:r.fill?r.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:r.borderDash?r.borderDash:s.borderDash||l.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),n.dataset.pivot(),i.each(o,(function(n,a){e.updateElement(n,a,t)}),e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var a=this,o=t.custom||{},r=a.getDataset(),s=a.chart.scale,l=a.chart.options.elements.point,u=s.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),i.extend(t,{_datasetIndex:a.index,_index:e,_scale:s,_model:{x:n?s.xCenter:u.x,y:n?s.yCenter:u.y,tension:o.tension?o.tension:i.valueOrDefault(r.lineTension,a.chart.options.elements.line.tension),radius:o.radius?o.radius:i.valueAtIndexOrDefault(r.pointRadius,e,l.radius),backgroundColor:o.backgroundColor?o.backgroundColor:i.valueAtIndexOrDefault(r.pointBackgroundColor,e,l.backgroundColor),borderColor:o.borderColor?o.borderColor:i.valueAtIndexOrDefault(r.pointBorderColor,e,l.borderColor),borderWidth:o.borderWidth?o.borderWidth:i.valueAtIndexOrDefault(r.pointBorderWidth,e,l.borderWidth),pointStyle:o.pointStyle?o.pointStyle:i.valueAtIndexOrDefault(r.pointStyle,e,l.pointStyle),hitRadius:o.hitRadius?o.hitRadius:i.valueAtIndexOrDefault(r.pointHitRadius,e,l.hitRadius)}}),t._model.skip=o.skip?o.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();i.each(e.data,(function(n,a){var o=n._model,r=i.splineCurve(i.previousItem(e.data,a,!0)._model,o,i.nextItem(e.data,a,!0)._model,o.tension);o.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),o.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),o.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),o.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),n.pivot()}))},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},a=t._index,o=t._model;o.radius=n.hoverRadius?n.hoverRadius:i.valueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),o.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:i.valueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.getHoverColor(o.backgroundColor)),o.borderColor=n.hoverBorderColor?n.hoverBorderColor:i.valueAtIndexOrDefault(e.pointHoverBorderColor,a,i.getHoverColor(o.borderColor)),o.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:i.valueAtIndexOrDefault(e.pointHoverBorderWidth,a,o.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},a=t._index,o=t._model,r=this.chart.options.elements.point;o.radius=n.radius?n.radius:i.valueAtIndexOrDefault(e.pointRadius,a,r.radius),o.backgroundColor=n.backgroundColor?n.backgroundColor:i.valueAtIndexOrDefault(e.pointBackgroundColor,a,r.backgroundColor),o.borderColor=n.borderColor?n.borderColor:i.valueAtIndexOrDefault(e.pointBorderColor,a,r.borderColor),o.borderWidth=n.borderWidth?n.borderWidth:i.valueAtIndexOrDefault(e.pointBorderWidth,a,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:i.noop,onComplete:i.noop}}),e.exports=function(t){t.Animation=o.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,a){var o,i,r=this.animations;for(e.chart=t,a||(t.animating=!0),o=0,i=r.length;o1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var a=Date.now();t.dropFrames+=(a-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,a=this.animations,o=0;o=e.numSteps?(i.callback(e.onAnimationComplete,[e],n),n.animating=!1,a.splice(o,1)):++o}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var a=t(25),o=t(45),i=t(28),r=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=o.configMerge(a.global,a[t.type],t.options||{}),t}function n(t){return"top"===t||"bottom"===t}var s=t.plugins;t.types={},t.instances={},t.controllers={},o.extend(t.prototype,{construct:function(n,a){var i=this;a=e(a);var s=r.acquireContext(n,a),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;i.id=o.uid(),i.ctx=s,i.canvas=l,i.config=a,i.width=c,i.height=u,i.aspectRatio=u?c/u:null,i.options=a.options,i._bufferedRender=!1,i.chart=i,i.controller=i,t.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),s&&l?(i.initialize(),i.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return s.notify(t,"beforeInit"),o.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),s.notify(t,"afterInit"),t},clear:function(){return o.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,a=e.canvas,i=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(o.getMaximumWidth(a))),l=Math.max(0,Math.floor(i?r/i:o.getMaximumHeight(a)));if((e.width!==r||e.height!==l)&&(a.width=e.width=r,a.height=e.height=l,a.style.width=r+"px",a.style.height=l+"px",o.retinaScale(e,n.devicePixelRatio),!t)){var u={width:r,height:l};s.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;o.each(e.xAxes,(function(t,e){t.id=t.id||"x-axis-"+e})),o.each(e.yAxes,(function(t,e){t.id=t.id||"y-axis-"+e})),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,a=e.options,i=e.scales={},r=[];a.scales&&(r=r.concat((a.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(a.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),a.scale&&r.push({options:a.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),o.each(r,(function(a){var r=a.options,s=o.valueOrDefault(r.type,a.dtype),l=t.scaleService.getScaleConstructor(s);if(l){n(r.position)!==n(a.dposition)&&(r.position=a.dposition);var u=new l({id:r.id,options:r,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),a.isDefault&&(e.scale=u)}})),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],a=[];return o.each(e.data.datasets,(function(o,i){var r=e.getDatasetMeta(i),s=o.type||e.config.type;if(r.type&&r.type!==s&&(e.destroyDatasetMeta(i),r=e.getDatasetMeta(i)),r.type=s,n.push(r.type),r.controller)r.controller.updateIndex(i);else{var l=t.controllers[r.type];if(void 0===l)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new l(e,i),a.push(r.controller)}}),e),a},resetElements:function(){var t=this;o.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==l(t)||(t={duration:t,lazy:arguments[1]}),function(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach((function(e){t.scales[e.id].options=e})),t.tooltip._options=e.tooltips}(e),!1!==s.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var n=e.buildOrUpdateControllers();o.each(e.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()}),e),e.updateLayout(),o.each(n,(function(t){t.reset()})),e.updateDatasets(),s.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==s.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),s.notify(e,"afterScaleUpdate"),s.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==s.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);s.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,a=n.getDatasetMeta(t),o={meta:a,index:t,easingValue:e};!1!==s.notify(n,"beforeDatasetDraw",[o])&&(a.controller.draw(e),s.notify(n,"afterDatasetDraw",[o]))},getElementAtEvent:function(t){return i.modes.single(this,t)},getElementsAtEvent:function(t){return i.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return i.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var a=i.modes[e];return"function"==typeof a?a(this,t,n):[]},getDatasetAtEvent:function(t){return i.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var a=n._meta[e.id];return a||(a=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),a},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e0||(o.forEach((function(e){delete t[e]})),delete t._chartjs)}}var o=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},a.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,a=n.getMeta(),o=n.getDataset().data||[],i=a.data;for(t=0,e=o.length;ta&&t.insertElements(a,o-a)},insertElements:function(t,e){for(var n=0;n=n[e].length&&n[e].push({}),!n[e][r].type||l.type&&l.type!==n[e][r].type?i.merge(n[e][r],[t.scaleService.getScaleDefaults(s),l]):i.merge(n[e][r],l)}else i._merger(e,n,a,o)}})},i.where=function(t,e){if(i.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return i.each(t,(function(t){e(t)&&n.push(t)})),n},i.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var a=0,o=t.length;a=0;a--){var o=t[a];if(e(o))return o}},i.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=e.prototype,n.prototype=new a,n.extend=i.inherits,t&&i.extend(n.prototype,t),n.__super__=e.prototype,n},i.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.almostEquals=function(t,e,n){return Math.abs(t-e)t},i.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},i.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},i.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},i.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},i.toRadians=function(t){return t*(Math.PI/180)},i.toDegrees=function(t){return t*(180/Math.PI)},i.getAngleFromPoint=function(t,e){var n=e.x-t.x,a=e.y-t.y,o=Math.sqrt(n*n+a*a),i=Math.atan2(a,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:o}},i.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},i.aliasPixel=function(t){return t%2==0?0:.5},i.splineCurve=function(t,e,n,a){var o=t.skip?e:t,i=e,r=n.skip?e:n,s=Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)),l=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),u=s/(s+l),c=l/(s+l),d=a*(u=isNaN(u)?0:u),h=a*(c=isNaN(c)?0:c);return{previous:{x:i.x-d*(r.x-o.x),y:i.y-d*(r.y-o.y)},next:{x:i.x+h*(r.x-o.x),y:i.y+h*(r.y-o.y)}}},i.EPSILON=Number.EPSILON||1e-14,i.splineCurveMonotone=function(t){var e,n,a,o,r,s,l,u,c,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(o=e0?d[e-1]:null,o=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},i.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},i.niceNum=function(t,e){var n=Math.floor(i.log10(t)),a=t/Math.pow(10,n);return(e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*Math.pow(10,n)},i.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},i.getRelativePosition=function(t,e){var n,a,o=t.originalEvent||t,r=t.currentTarget||t.srcElement,s=r.getBoundingClientRect(),l=o.touches;l&&l.length>0?(n=l[0].clientX,a=l[0].clientY):(n=o.clientX,a=o.clientY);var u=parseFloat(i.getStyle(r,"padding-left")),c=parseFloat(i.getStyle(r,"padding-top")),d=parseFloat(i.getStyle(r,"padding-right")),h=parseFloat(i.getStyle(r,"padding-bottom")),f=s.right-s.left-u-d,p=s.bottom-s.top-c-h;return{x:n=Math.round((n-s.left-u)/f*r.width/e.currentDevicePixelRatio),y:a=Math.round((a-s.top-c)/p*r.height/e.currentDevicePixelRatio)}},i.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},i.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},i.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(i.getStyle(e,"padding-left"),10),a=parseInt(i.getStyle(e,"padding-right"),10),o=e.clientWidth-n-a,r=i.getConstraintWidth(t);return isNaN(r)?o:Math.min(o,r)},i.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(i.getStyle(e,"padding-top"),10),a=parseInt(i.getStyle(e,"padding-bottom"),10),o=e.clientHeight-n-a,r=i.getConstraintHeight(t);return isNaN(r)?o:Math.min(o,r)},i.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},i.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var a=t.canvas,o=t.height,i=t.width;a.height=o*n,a.width=i*n,t.ctx.scale(n,n),a.style.height=o+"px",a.style.width=i+"px"}},i.fontString=function(t,e,n){return e+" "+t+"px "+n},i.longestText=function(t,e,n,a){var o=(a=a||{}).data=a.data||{},r=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(o=a.data={},r=a.garbageCollect=[],a.font=e),t.font=e;var s=0;i.each(n,(function(e){null!=e&&!0!==i.isArray(e)?s=i.measureText(t,o,r,s,e):i.isArray(e)&&i.each(e,(function(e){null==e||i.isArray(e)||(s=i.measureText(t,o,r,s,e))}))}));var l=r.length/2;if(l>n.length){for(var u=0;ua&&(a=i),a},i.numberOfLabelLines=function(t){var e=1;return i.each(t,(function(t){i.isArray(t)&&t.length>e&&(e=t.length)})),e},i.color=a?function(t){return t instanceof CanvasGradient&&(t=o.global.defaultColor),a(t)}:function(t){return console.error("Color.js not found!"),t},i.getHoverColor=function(t){return t instanceof CanvasPattern?t:i.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,n){"use strict";function a(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function o(t,e){var n,a,o,i,r;for(a=0,i=t.data.datasets.length;a0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return l(t,e,{intersect:!0})},point:function(t,e){return i(t,a(e,t))},nearest:function(t,e,n){var o=a(e,t);n.axis=n.axis||"xy";var i=s(n.axis),l=r(t,o,n.intersect,i);return l.length>1&&l.sort((function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n})),l.slice(0,1)},x:function(t,e,n){var i=a(e,t),r=[],s=!1;return o(t,(function(t){t.inXRange(i.x)&&r.push(t),t.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r},y:function(t,e,n){var i=a(e,t),r=[],s=!1;return o(t,(function(t){t.inYRange(i.y)&&r.push(t),t.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var a=t(45);e.exports=function(t){function e(t,e){return a.where(t,(function(t){return t.position===e}))}function n(t,e){t.forEach((function(t,e){return t._tmpIndex_=e,t})),t.sort((function(t,n){var a=e?n:t,o=e?t:n;return a.weight===o.weight?a._tmpIndex_-o._tmpIndex_:a.weight-o.weight})),t.forEach((function(t){delete t._tmpIndex_}))}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var a,o=["fullWidth","position","weight"],i=o.length,r=0;rh&&lt.maxHeight){l--;break}l++,d=u*c}t.labelRotation=l},afterCalculateTickRotation:function(){s.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){s.callback(this.options.beforeFit,[this])},fit:function(){var t=this,o=t.minSize={width:0,height:0},i=a(t._ticks),r=t.options,u=r.ticks,c=r.scaleLabel,d=r.gridLines,h=r.display,f=t.isHorizontal(),p=n(u),g=r.gridLines.tickMarkLength;if(o.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&d.drawTicks?g:0,o.height=f?h&&d.drawTicks?g:0:t.maxHeight,c.display&&h){var v=l(c)+s.options.toPadding(c.padding).height;f?o.height+=v:o.width+=v}if(u.display&&h){var m=s.longestText(t.ctx,p.font,i,t.longestTextCache),b=s.numberOfLabelLines(i),x=.5*p.size,y=t.options.ticks.padding;if(f){t.longestLabelWidth=m;var k=s.toRadians(t.labelRotation),w=Math.cos(k),C=Math.sin(k)*m+p.size*b+x*(b-1)+x;o.height=Math.min(t.maxHeight,o.height+C+y),t.ctx.font=p.font;var S=e(t.ctx,i[0],p.font),M=e(t.ctx,i[i.length-1],p.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?w*S+3:w*x+3,t.paddingRight="bottom"===r.position?w*x+3:w*M+3):(t.paddingLeft=S/2+3,t.paddingRight=M/2+3)}else u.mirror?m=0:m+=y+x,o.width=Math.min(t.maxWidth,o.width+m),t.paddingTop=p.size/2,t.paddingBottom=p.size/2}t.handleMargins(),t.width=o.width,t.height=o.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){s.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(s.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:s.noop,getPixelForValue:s.noop,getValueForPixel:s.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var a=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),o=a*t+e.paddingLeft;return n&&(o+=a/2),e.left+Math.round(o)+(e.isFullWidth()?e.margins.left:0)}var i=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(i/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft;return e.left+Math.round(n)+(e.isFullWidth()?e.margins.left:0)}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,a,o,i=this,r=i.isHorizontal(),l=i.options.ticks.minor,u=t.length,c=s.toRadians(i.labelRotation),d=Math.cos(c),h=i.longestLabelWidth*d,f=[];for(l.maxTicksLimit&&(o=l.maxTicksLimit),r&&(e=!1,(h+l.autoSkipPadding)*u>i.width-(i.paddingLeft+i.paddingRight)&&(e=1+Math.floor((h+l.autoSkipPadding)*u/(i.width-(i.paddingLeft+i.paddingRight)))),o&&u>o&&(e=Math.max(e,Math.floor(u/o)))),n=0;n1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1||s.isNullOrUndef(a.label))&&delete a.label,f.push(a);return f},draw:function(t){var e=this,a=e.options;if(a.display){var r=e.ctx,u=i.global,c=a.ticks.minor,d=a.ticks.major||c,h=a.gridLines,f=a.scaleLabel,p=0!==e.labelRotation,g=e.isHorizontal(),v=c.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),m=s.valueOrDefault(c.fontColor,u.defaultFontColor),b=n(c),x=s.valueOrDefault(d.fontColor,u.defaultFontColor),y=n(d),k=h.drawTicks?h.tickMarkLength:0,w=s.valueOrDefault(f.fontColor,u.defaultFontColor),C=n(f),S=s.options.toPadding(f.padding),M=s.toRadians(e.labelRotation),_=[],I="right"===a.position?e.left:e.right-k,D="right"===a.position?e.left+k:e.right,P="bottom"===a.position?e.top:e.bottom-k,A="bottom"===a.position?e.top+k:e.bottom;if(s.each(v,(function(n,i){if(void 0!==n.label){var r,l,d,f,m=n.label;i===e.zeroLineIndex&&a.offset===h.offsetGridLines?(r=h.zeroLineWidth,l=h.zeroLineColor,d=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(r=s.valueAtIndexOrDefault(h.lineWidth,i),l=s.valueAtIndexOrDefault(h.color,i),d=s.valueOrDefault(h.borderDash,u.borderDash),f=s.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var b,x,y,w,C,S,T,L,F,$,O="middle",z="middle",R=c.padding;if(g){var j=k+R;"bottom"===a.position?(z=p?"middle":"top",O=p?"right":"center",$=e.top+j):(z=p?"middle":"bottom",O=p?"left":"center",$=e.bottom-j);var B=o(e,i,h.offsetGridLines&&v.length>1);B1);E0)n=t.stepSize;else{var i=a.niceNum(e.max-e.min,!1);n=a.niceNum(i/(t.maxTicks-1),!0)}var r=Math.floor(e.min/n)*n,s=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&a.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(r=t.min,s=t.max);var l=(s-r)/n;l=a.almostEquals(l,Math.round(l),n/1e3)?Math.round(l):Math.ceil(l),o.push(void 0!==t.min?t.min:r);for(var u=1;u3?n[2]-n[1]:n[1]-n[0];Math.abs(o)>1&&t!==Math.floor(t)&&(o=t-Math.floor(t));var i=a.log10(Math.abs(o)),r="";if(0!==t){var s=-1*Math.floor(i);s=Math.max(Math.min(s,20),0),r=t.toFixed(s)}else r="0";return r},logarithmic:function(t,e,n){var o=t/Math.pow(10,Math.floor(a.log10(t)));return 0===t?"0":1===o||2===o||5===o||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:i.noop,title:function(t,e){var n="",a=e.labels,o=a?a.length:0;if(t.length>0){var i=t[0];i.xLabel?n=i.xLabel:o>0&&i.indexa.height-e.height&&(r="bottom");var s,l,u,c,d,h=(o.left+o.right)/2,f=(o.top+o.bottom)/2;"center"===r?(s=function(t){return t<=h},l=function(t){return t>h}):(s=function(t){return t<=e.width/2},l=function(t){return t>=a.width-e.width/2}),u=function(t){return t+e.width>a.width},c=function(t){return t-e.width<0},d=function(t){return t<=f?"top":"bottom"},s(n.x)?(i="left",u(n.x)&&(i="center",r=d(n.y))):l(n.x)&&(i="right",c(n.x)&&(i="center",r=d(n.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:i,yAlign:p.yAlign?p.yAlign:r}}(this,g))}else c.opacity=0;return c.xAlign=f.xAlign,c.yAlign=f.yAlign,c.x=p.x,c.y=p.y,c.width=g.width,c.height=g.height,c.caretX=v.x,c.caretY=v.y,o._model=c,e&&l.custom&&l.custom.call(o,c),o},drawCaret:function(t,e){var n=this._chart.ctx,a=this._view,o=this.getCaretPosition(t,e,a);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)},getCaretPosition:function(t,e,n){var a,o,i,r,s,l,u=n.caretSize,c=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=t.x,p=t.y,g=e.width,v=e.height;if("center"===h)s=p+v/2,"left"===d?(o=(a=f)-u,i=a,r=s+u,l=s-u):(o=(a=f+g)+u,i=a,r=s-u,l=s+u);else if("left"===d?(a=(o=f+c+u)-u,i=o+u):"right"===d?(a=(o=f+g-c-u)-u,i=o+u):(a=(o=f+g/2)-u,i=o+u),"top"===h)s=(r=p)-u,l=r;else{s=(r=p+v)+u,l=r;var m=i;i=a,a=m}return{x1:a,x2:o,x3:i,y1:r,y2:s,y3:l}},drawTitle:function(t,n,a,o){var r=n.title;if(r.length){a.textAlign=n._titleAlign,a.textBaseline="top";var s,l,u=n.titleFontSize,c=n.titleSpacing;for(a.fillStyle=e(n.titleFontColor,o),a.font=i.fontString(u,n._titleFontStyle,n._titleFontFamily),s=0,l=r.length;s0&&a.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},a={x:e.x,y:e.y},o=Math.abs(e.opacity<.001)?0:e.opacity,i=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&i&&(this.drawBackground(a,e,t,n,o),a.x+=e.xPadding,a.y+=e.yPadding,this.drawTitle(a,e,t,o),this.drawBody(a,e,t,o),this.drawFooter(a,e,t,o))}},handleEvent:function(t){var e=this,n=e._options,a=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(a=!i.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var o=e._model;e.update(!0),e.pivot(),a|=o.x!==e._model.x||o.y!==e._model.y}return a}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,a=0,o=0,i=0;for(e=0,n=t.length;el;)o-=2*Math.PI;for(;o=s&&o<=l,c=r>=n.innerRadius&&r<=n.outerRadius;return u&&c}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,a=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,a),t.arc(e.x,e.y,e.innerRadius,a,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45),r=a.global;a._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=o.extend({draw:function(){var t,e,n,a,o=this,s=o._view,l=o._chart.ctx,u=s.spanGaps,c=o._children.slice(),d=r.elements.line,h=-1;for(o._loop&&c.length&&c.push(c[0]),l.save(),l.lineCap=s.borderCapStyle||d.borderCapStyle,l.setLineDash&&l.setLineDash(s.borderDash||d.borderDash),l.lineDashOffset=s.borderDashOffset||d.borderDashOffset,l.lineJoin=s.borderJoinStyle||d.borderJoinStyle,l.lineWidth=s.borderWidth||d.borderWidth,l.strokeStyle=s.borderColor||r.defaultColor,l.beginPath(),h=-1,t=0;te?1:-1,r=1,s=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,a=u.y,i=1,r=(o=u.base)>a?1:-1,s=u.borderSkipped||"bottom"),c){var d=Math.min(Math.abs(e-n),Math.abs(a-o)),h=(c=c>d?d:c)/2,f=e+("left"!==s?h*i:0),p=n+("right"!==s?-h*i:0),g=a+("top"!==s?h*r:0),v=o+("bottom"!==s?-h*r:0);f!==p&&(a=g,o=v),g!==v&&(e=f,n=p)}l.beginPath(),l.fillStyle=u.backgroundColor,l.strokeStyle=u.borderColor,l.lineWidth=c;var m=[[e,o],[e,a],[n,a],[n,o]],b=["bottom","left","top","right"].indexOf(s,0);-1===b&&(b=0);var x=t(0);l.moveTo(x[0],x[1]);for(var y=1;y<4;y++)x=t(y),l.lineTo(x[0],x[1]);l.fill(),c&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var a=o(this);n=t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var i=o(n);return a(n)?t>=i.left&&t<=i.right:e>=i.top&&e<=i.bottom},inXRange:function(t){var e=o(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=o(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return a(this)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var a=t(42);n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,a,o,i){if(i){var r=Math.min(i,a/2),s=Math.min(i,o/2);t.moveTo(e+r,n),t.lineTo(e+a-r,n),t.quadraticCurveTo(e+a,n,e+a,n+s),t.lineTo(e+a,n+o-s),t.quadraticCurveTo(e+a,n+o,e+a-r,n+o),t.lineTo(e+r,n+o),t.quadraticCurveTo(e,n+o,e,n+o-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+r,n)}else t.rect(e,n,a,o)},drawPoint:function(t,e,n,a,o){var i,r,s,u,c,d;if("object"!=l(e)||"[object HTMLImageElement]"!==(i=e.toString())&&"[object HTMLCanvasElement]"!==i){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(a,o,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),c=(r=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(a-r/2,o+c/3),t.lineTo(a+r/2,o+c/3),t.lineTo(a,o-2*c/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(a-d,o-d,2*d,2*d),t.strokeRect(a-d,o-d,2*d,2*d);break;case"rectRounded":var h=n/Math.SQRT2,f=a-h,p=o-h,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,f,p,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(a-d,o),t.lineTo(a,o+d),t.lineTo(a+d,o),t.lineTo(a,o-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(a,o+n),t.lineTo(a,o-n),t.moveTo(a-n,o),t.lineTo(a+n,o),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(a-s,o-u),t.lineTo(a+s,o+u),t.moveTo(a-s,o+u),t.lineTo(a+s,o-u),t.closePath();break;case"star":t.beginPath(),t.moveTo(a,o+n),t.lineTo(a,o-n),t.moveTo(a-n,o),t.lineTo(a+n,o),s=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(a-s,o-u),t.lineTo(a+s,o+u),t.moveTo(a-s,o+u),t.lineTo(a+s,o-u),t.closePath();break;case"line":t.beginPath(),t.moveTo(a-n,o),t.lineTo(a+n,o),t.closePath();break;case"dash":t.beginPath(),t.moveTo(a,o),t.lineTo(a+n,o),t.closePath()}t.stroke()}}else t.drawImage(e,a-e.width/2,o-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,a){if(n.steppedLine)return"after"===n.steppedLine&&!a||"after"!==n.steppedLine&&a?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(a?e.controlPointPreviousX:e.controlPointNextX,a?e.controlPointPreviousY:e.controlPointNextY,a?n.controlPointNextX:n.controlPointPreviousX,a?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},a.clear=n.clear,a.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var a={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null==t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return a.valueOrDefault(a.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,o){var i,r,s;if(a.isArray(t))if(r=t.length,o)for(i=r-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-o.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*o.easeInBounce(2*t):.5*o.easeOutBounce(2*t-1)+.5}};e.exports={effects:o},a.easingEffects=o},{42:42}],44:[function(t,e,n){"use strict";var a=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,o,i;return a.isObject(t)?(e=+t.top||0,n=+t.right||0,o=+t.bottom||0,i=+t.left||0):e=n=o=i=+t||0,{top:e,right:n,bottom:o,left:i,height:e+o,width:i+n}},resolve:function(t,e,n){var o,i,r;for(o=0,i=t.length;o
';var i=e.childNodes[0],r=e.childNodes[1];e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var s=function(){e._reset(),t()};return o(i,"scroll",s.bind(i,"expand")),o(r,"scroll",s.bind(r,"shrink")),e}(function(t,e){var n=!1,a=[];return function(){a=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,u.requestAnimFrame.call(window,(function(){n=!1,t.apply(e,a)})))}}((function(){if(a.resizer)return e(r("resize",n))})));!function(t,e){var n=(t[c]||(t[c]={})).renderProxy=function(t){t.animationName===f&&e()};u.each(p,(function(e){o(t,e,n)})),t.classList.add(h)}(t,(function(){if(a.resizer){var e=t.parentNode;e&&e!==i.parentNode&&e.insertBefore(i,e.firstChild),i._reset()}}))}function l(t){var e=t[c]||{},n=e.resizer;delete e.resizer,function(t){var e=t[c]||{},n=e.renderProxy;n&&(u.each(p,(function(e){i(t,e,n)})),delete e.renderProxy),t.classList.remove(h)}(t),n&&n.parentNode&&n.parentNode.removeChild(n)}var u=t(45),c="$chartjs",d="chartjs-",h=d+"render-monitor",f=d+"render-animation",p=["animationstart","webkitAnimationStart"],g={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},v=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";!function(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}(this,"@-webkit-keyframes "+f+"{"+t+"}@keyframes "+f+"{"+t+"}."+h+"{-webkit-animation:"+f+" 0.001s;animation:"+f+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){var n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[c]={initial:{height:o,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===i||""===i){var r=a(t,"width");void 0!==r&&(t.width=r)}if(null===o||""===o)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=a(t,"height");void 0!==r&&(t.height=s)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[c]){var n=e[c].initial;["height","width"].forEach((function(t){var a=n[t];u.isNullOrUndef(a)?e.removeAttribute(t):e.setAttribute(t,a)})),u.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e[c]}},addEventListener:function(t,e,n){var a=t.canvas;if("resize"!==e){var i=n[c]||(n[c]={});o(a,e,(i.proxies||(i.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=g[t.type]||t.type,a=u.getRelativePosition(t,e);return r(n,e,a.x,a.y,t)}(e,t))})}else s(a,n,t)},removeEventListener:function(t,e,n){var a=t.canvas;if("resize"!==e){var o=((n[c]||{}).proxies||{})[t.id+"_"+e];o&&i(a,e,o)}else l(a)}},u.addEvent=o,u.removeEvent=i},{45:45}],48:[function(t,e,n){"use strict";var a=t(45),o=t(46),i=t(47),r=i._enabled?i:o;e.exports=a.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var a,o=t._model||{},i=o.fill;if(void 0===i&&(i=!!o.backgroundColor),!1===i||null===i)return!1;if(!0===i)return"origin";if(a=parseFloat(i,10),isFinite(a)&&Math.floor(a)===a)return"-"!==i[0]&&"+"!==i[0]||(a=e+a),!(a===e||a<0||a>=n)&&a;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function e(t){var e,n=t.el._model||{},a=t.el._scale||{},o=t.fill,i=null;if(isFinite(o))return null;if("start"===o?i=void 0===n.scaleBottom?a.bottom:n.scaleBottom:"end"===o?i=void 0===n.scaleTop?a.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:a.getBasePosition?i=a.getBasePosition():a.getBasePixel&&(i=a.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if("number"==typeof i&&isFinite(i))return{x:(e=a.isHorizontal())?i:null,y:e?null:i}}return null}function n(t,e,n){var a,o=t[e].fill,i=[e];if(!n)return o;for(;!1!==o&&-1===i.indexOf(o);){if(!isFinite(o))return o;if(!(a=t[o]))return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function r(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),c[n](t))}function s(t){return t&&!t.skip}function l(t,e,n,a,o){var r;if(a&&o){for(t.moveTo(e[0].x,e[0].y),r=1;r0;--r)i.canvas.lineTo(t,n[r],n[r-1],!0)}}function u(t,e,n,a,o,i){var r,u,c,d,h,f,p,g=e.length,v=a.spanGaps,m=[],b=[],x=0,y=0;for(t.beginPath(),r=0,u=g+!!i;r');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push(""),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var a=new t.Legend({ctx:e.ctx,options:n,chart:e});r.configure(e,a,n),r.addBox(e,a),e.legend=a}var r=t.layoutService,s=i.noop;return t.Legend=o.extend({initialize:function(t){i.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:s,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:s,beforeSetDimensions:s,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:s,beforeBuildLabels:s,buildLabels:function(){var t=this,e=t.options.labels||{},n=i.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:s,beforeFit:s,fit:function(){var t=this,n=t.options,o=n.labels,r=n.display,s=t.ctx,l=a.global,u=i.valueOrDefault,c=u(o.fontSize,l.defaultFontSize),d=u(o.fontStyle,l.defaultFontStyle),h=u(o.fontFamily,l.defaultFontFamily),f=i.fontString(c,d,h),p=t.legendHitBoxes=[],g=t.minSize,v=t.isHorizontal();if(v?(g.width=t.maxWidth,g.height=r?10:0):(g.width=r?10:0,g.height=t.maxHeight),r)if(s.font=f,v){var m=t.lineWidths=[0],b=t.legendItems.length?c+o.padding:0;s.textAlign="left",s.textBaseline="top",i.each(t.legendItems,(function(n,a){var i=e(o,c)+c/2+s.measureText(n.text).width;m[m.length-1]+i+o.padding>=t.width&&(b+=c+o.padding,m[m.length]=t.left),p[a]={left:0,top:0,width:i,height:c},m[m.length-1]+=i+o.padding})),g.height+=b}else{var x=o.padding,y=t.columnWidths=[],k=o.padding,w=0,C=0,S=c+x;i.each(t.legendItems,(function(t,n){var a=e(o,c)+c/2+s.measureText(t.text).width;C+S>g.height&&(k+=w+o.padding,y.push(w),w=0,C=0),w=Math.max(w,a),C+=S,p[n]={left:0,top:0,width:a,height:c}})),k+=w,y.push(w),g.width+=k}t.width=g.width,t.height=g.height},afterFit:s,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,o=n.labels,r=a.global,s=r.elements.line,l=t.width,u=t.lineWidths;if(n.display){var c,d=t.ctx,h=i.valueOrDefault,f=h(o.fontColor,r.defaultFontColor),p=h(o.fontSize,r.defaultFontSize),g=h(o.fontStyle,r.defaultFontStyle),v=h(o.fontFamily,r.defaultFontFamily),m=i.fontString(p,g,v);d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=f,d.fillStyle=f,d.font=m;var b=e(o,p),x=t.legendHitBoxes,y=function(t,e,a){if(!(isNaN(b)||b<=0)){d.save(),d.fillStyle=h(a.fillStyle,r.defaultColor),d.lineCap=h(a.lineCap,s.borderCapStyle),d.lineDashOffset=h(a.lineDashOffset,s.borderDashOffset),d.lineJoin=h(a.lineJoin,s.borderJoinStyle),d.lineWidth=h(a.lineWidth,s.borderWidth),d.strokeStyle=h(a.strokeStyle,r.defaultColor);var o=0===h(a.lineWidth,s.borderWidth);if(d.setLineDash&&d.setLineDash(h(a.lineDash,s.borderDash)),n.labels&&n.labels.usePointStyle){var l=p*Math.SQRT2/2,u=l/Math.SQRT2,c=t+u,f=e+u;i.canvas.drawPoint(d,a.pointStyle,l,c,f)}else o||d.strokeRect(t,e,b,p),d.fillRect(t,e,b,p);d.restore()}},k=t.isHorizontal();c=k?{x:t.left+(l-u[0])/2,y:t.top+o.padding,line:0}:{x:t.left+o.padding,y:t.top+o.padding,line:0};var w=p+o.padding;i.each(t.legendItems,(function(e,n){var a=d.measureText(e.text).width,i=b+p/2+a,r=c.x,s=c.y;k?r+i>=l&&(s=c.y+=w,c.line++,r=c.x=t.left+(l-u[c.line])/2):s+w>t.bottom&&(r=c.x=r+t.columnWidths[c.line]+o.padding,s=c.y=t.top+o.padding,c.line++),y(r,s,e),x[n].left=r,x[n].top=s,function(t,e,n,a){var o=p/2,i=b+o+t,r=e+o;d.fillText(n.text,i,r),n.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(i,r),d.lineTo(i+a,r),d.stroke())}(r,s,e,a),k?c.x+=i+o.padding:c.y+=w}))}},handleEvent:function(t){var e=this,n=e.options,a="mouseup"===t.type?"click":t.type,o=!1;if("mousemove"===a){if(!n.onHover)return}else{if("click"!==a)return;if(!n.onClick)return}var i=t.x,r=t.y;if(i>=e.left&&i<=e.right&&r>=e.top&&r<=e.bottom)for(var s=e.legendHitBoxes,l=0;l=u.left&&i<=u.left+u.width&&r>=u.top&&r<=u.top+u.height){if("click"===a){n.onClick.call(e,t.native,e.legendItems[l]),o=!0;break}if("mousemove"===a){n.onHover.call(e,t.native,e.legendItems[l]),o=!0;break}}}return o}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,o=t.legend;e?(i.mergeIf(e,a.global.legend),o?(r.configure(t,o,e),o.options=e):n(t,e)):o&&(r.removeBox(t,o),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,a){var o=new t.Title({ctx:e.ctx,options:a,chart:e});n.configure(e,o,a),n.addBox(e,o),e.titleBlock=o}var n=t.layoutService,r=i.noop;return t.Title=o.extend({initialize:function(t){i.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:r,beforeSetDimensions:r,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=this,e=i.valueOrDefault,n=t.options,o=n.display,r=e(n.fontSize,a.global.defaultFontSize),s=t.minSize,l=i.isArray(n.text)?n.text.length:1,u=i.options.toLineHeight(n.lineHeight,r),c=o?l*u+2*n.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=c):(s.width=c,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=i.valueOrDefault,o=t.options,r=a.global;if(o.display){var s,l,u,c=n(o.fontSize,r.defaultFontSize),d=n(o.fontStyle,r.defaultFontStyle),h=n(o.fontFamily,r.defaultFontFamily),f=i.fontString(c,d,h),p=i.options.toLineHeight(o.lineHeight,c),g=p/2+o.padding,v=0,m=t.top,b=t.left,x=t.bottom,y=t.right;e.fillStyle=n(o.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(l=b+(y-b)/2,u=m+g,s=y-b):(l="left"===o.position?b+g:y-g,u=m+(x-m)/2,s=x-m,v=Math.PI*("left"===o.position?-.5:.5)),e.save(),e.translate(l,u),e.rotate(v),e.textAlign="center",e.textBaseline="middle";var k=o.text;if(i.isArray(k))for(var w=0,C=0;Ce.max)&&(e.max=a))}))}));e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var i=o.valueOrDefault(n.fontSize,a.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*i)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,a=n.start,o=+n.getRightValue(t),i=n.end-a;return n.isHorizontal()?(e=n.left+n.width/i*(o-a),Math.round(e)):(e=n.bottom-n.height/i*(o-a),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),a=n?e.width:e.height,o=(n?t-e.left:e.bottom-t)/a;return e.start+(e.end-e.start)*o},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var a=t(45),o=t(34);e.exports=function(t){var e=a.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=a.sign(t.min),o=a.sign(t.max);n<0&&o<0?t.max=0:n>0&&o>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==r&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:a.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=o.generators.linear(i,t);t.handleDirectionalChanges(),t.max=a.max(r),t.min=a.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var a=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return l?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,o=n.ticks,i=e.chart,r=i.data.datasets,s=a.valueOrDefault,l=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&a.each(r,(function(e,n){if(!u){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&t(a)&&void 0!==a.stack&&(u=!0)}})),n.stacked||u){var c={};a.each(r,(function(o,r){var s=i.getDatasetMeta(r),l=[s.type,void 0===n.stacked&&void 0===s.stack?r:"",s.stack].join(".");i.isDatasetVisible(r)&&t(s)&&(void 0===c[l]&&(c[l]=[]),a.each(o.data,(function(t,a){var o=c[l],i=+e.getRightValue(t);isNaN(i)||s.data[a].hidden||(o[a]=o[a]||0,n.relativePoints?o[a]=100:o[a]+=i)})))})),a.each(c,(function(t){var n=a.min(t),o=a.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?o:Math.max(e.max,o)}))}else a.each(r,(function(n,o){var r=i.getDatasetMeta(o);i.isDatasetVisible(o)&&t(r)&&a.each(n.data,(function(t,n){var a=+e.getRightValue(t);isNaN(a)||r.data[n].hidden||((null===e.min||ae.max)&&(e.max=a),0!==a&&(null===e.minNotZero||ao?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function l(t){return 0===t||180===t?"center":t<180?"left":"right"}function u(t,e,n,a){if(o.isArray(e))for(var i=n.y,r=1.5*a,s=0;s270||t<90)&&(n.y-=e.h)}function d(t){var a=t.ctx,i=o.valueOrDefault,r=t.options,s=r.angleLines,d=r.pointLabels;a.lineWidth=s.lineWidth,a.strokeStyle=s.color;var h=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),f=n(t);a.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(s.display){var v=t.getPointPosition(g,h);a.beginPath(),a.moveTo(t.xCenter,t.yCenter),a.lineTo(v.x,v.y),a.stroke(),a.closePath()}if(d.display){var m=t.getPointPosition(g,h+5),b=i(d.fontColor,p.defaultFontColor);a.font=f.font,a.fillStyle=b;var x=t.getIndexAngle(g),y=o.toDegrees(x);a.textAlign=l(y),c(y,t._pointLabelSizes[g],m),u(a,t.pointLabels[g]||"",m,f.size)}}}function h(t,n,a,i){var r=t.ctx;if(r.strokeStyle=o.valueAtIndexOrDefault(n.color,i-1),r.lineWidth=o.valueAtIndexOrDefault(n.lineWidth,i-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,a,0,2*Math.PI),r.closePath(),r.stroke();else{var s=e(t);if(0===s)return;r.beginPath();var l=t.getPointPosition(0,a);r.moveTo(l.x,l.y);for(var u=1;ud.r&&(d.r=v.end,h.r=p),m.startd.b&&(d.b=m.end,h.b=p)}t.setReductions(c,d,h)}(this):function(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}(this)},setReductions:function(t,e,n){var a=this,o=e.l/Math.sin(n.l),i=Math.max(e.r-a.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),s=-Math.max(e.b-a.height,0)/Math.cos(n.b);o=f(o),i=f(i),r=f(r),s=f(s),a.drawingArea=Math.min(Math.round(t-(o+i)/2),Math.round(t-(r+s)/2)),a.setCenterPoint(o,i,r,s)},setCenterPoint:function(t,e,n,a){var o=this,i=o.width-e-o.drawingArea,r=t+o.drawingArea,s=n+o.drawingArea,l=o.height-a-o.drawingArea;o.xCenter=Math.round((r+i)/2+o.left),o.yCenter=Math.round((s+l)/2+o.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,a=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(a)*e)+n.xCenter,y:Math.round(Math.sin(a)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,a=e.ticks,i=o.valueOrDefault;if(e.display){var r=t.ctx,s=this.getIndexAngle(0),l=i(a.fontSize,p.defaultFontSize),u=i(a.fontStyle,p.defaultFontStyle),c=i(a.fontFamily,p.defaultFontFamily),f=o.fontString(l,u,c);o.each(t.ticks,(function(e,o){if(o>0||a.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[o]);if(n.display&&0!==o&&h(t,n,u,o),a.display){var c=i(a.fontColor,p.defaultFontColor);if(r.font=f,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(s),a.showLabelBackdrop){var d=r.measureText(e).width;r.fillStyle=a.backdropColor,r.fillRect(-d/2-a.backdropPaddingX,-u-l/2-a.backdropPaddingY,d+2*a.backdropPaddingX,l+2*a.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=c,r.fillText(e,0,-u),r.restore()}}})),(e.angleLines.display||e.pointLabels.display)&&d(t)}}});t.scaleService.registerScaleType("radialLinear",v,g)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function a(t,e){return t-e}function o(t){var e,n,a,o={},i=[];for(e=0,n=t.length;e=0&&r<=s;){if(o=t[(a=r+s>>1)-1]||null,i=t[a],!o)return{lo:null,hi:i};if(i[e]n))return{lo:o,hi:i};s=a-1}}return{lo:i,hi:null}}(t,e,n),i=o.lo?o.hi?o.lo:t[t.length-2]:t[0],r=o.lo?o.hi?o.hi:t[t.length-1]:t[1],s=r[e]-i[e],l=s?(n-i[e])/s:0,u=(r[a]-i[a])*l;return i[a]+u}function r(t,e){var n=e.parser,a=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof a?h(t,a):(t instanceof h||(t=h(t)),t.isValid()?t:"function"==typeof a?a(t):t)}function s(t,e){if(p.isNullOrUndef(t))return null;var n=e.options.time,a=r(e.getRightValue(t),n);return a.isValid()?(n.round&&a.startOf(n.round),a.valueOf()):null}function l(t,e,n,a){var o,i,r,s=b.length;for(o=b.indexOf(t);o1?e[1]:a,s=e[0],l=(i(t,"time",r,"pos")-i(t,"time",s,"pos"))/2),o.time.max||(r=e[e.length-1],s=e.length>1?e[e.length-2]:n,u=(i(t,"time",r,"pos")-i(t,"time",s,"pos"))/2)),{left:l,right:u}}function d(t,e){var n,a,o,i,r=[];for(n=0,a=t.length;n=o&&n<=i&&y.push(n);return a.min=o,a.max=i,a._unit=g,a._majorUnit=v,a._minorFormat=f[g],a._majorFormat=f[v],a._table=function(t,e,n,a){if("linear"===a||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var o,i,r,s,l,u=[],c=[e];for(o=0,i=t.length;oe&&s=0&&t{function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}n(8636),n(5086),n(8329),n(8772),n(4913),n(9693),n(115),n(7136),n(173),n(9073),n(6048),n(9581),n(3534),n(590),n(4216),n(8665),n(9979),n(4602),function(t){"use strict";var e=function(e,n){t.fn.typeahead.defaults;n.scrollBar&&(n.items=100,n.menu='');var a=this;if(a.$element=t(e),a.options=t.extend({},t.fn.typeahead.defaults,n),a.$menu=t(a.options.menu).insertAfter(a.$element),a.eventSupported=a.options.eventSupported||a.eventSupported,a.grepper=a.options.grepper||a.grepper,a.highlighter=a.options.highlighter||a.highlighter,a.lookup=a.options.lookup||a.lookup,a.matcher=a.options.matcher||a.matcher,a.render=a.options.render||a.render,a.onSelect=a.options.onSelect||null,a.sorter=a.options.sorter||a.sorter,a.source=a.options.source||a.source,a.displayField=a.options.displayField||a.displayField,a.valueField=a.options.valueField||a.valueField,a.options.ajax){var o=a.options.ajax;"string"==typeof o?a.ajax=t.extend({},t.fn.typeahead.defaults.ajax,{url:o}):("string"==typeof o.displayField&&(a.displayField=a.options.displayField=o.displayField),"string"==typeof o.valueField&&(a.valueField=a.options.valueField=o.valueField),a.ajax=t.extend({},t.fn.typeahead.defaults.ajax,o)),a.ajax.url||(a.ajax=null),a.query=""}else a.source=a.options.source,a.ajax=null;a.shown=!1,a.listen()};e.prototype={constructor:e,eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},select:function(){var t=this.$menu.find(".active").attr("data-value"),e=this.$menu.find(".active a").text();return this.options.onSelect&&this.options.onSelect({value:t,text:e}),this.$element.val(this.updater(e)).change(),this.hide()},updater:function(t){return t},show:function(){var e=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});if(this.$menu.css({top:e.top+e.height,left:e.left}),this.options.alignWidth){var n=t(this.$element[0]).outerWidth();this.$menu.css({width:n})}return this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},ajaxLookup:function(){var e=t.trim(this.$element.val());if(e===this.query)return this;if(this.query=e,this.ajax.timerId&&(clearTimeout(this.ajax.timerId),this.ajax.timerId=null),!e||e.length"+e+""}))},render:function(e){var n,o=this,i="string"==typeof o.options.displayField;return(e=t(e).map((function(e,r){return"object"===a(r)?(n=i?r[o.options.displayField]:o.options.displayField(r),e=t(o.options.item).attr("data-value",r[o.options.valueField])):(n=r,e=t(o.options.item).attr("data-value",r)),e.find("a").html(o.highlighter(n)),e[0]}))).first().addClass("active"),this.$menu.html(e),this},grepper:function(e){var n,a,o=this,i="string"==typeof o.options.displayField;if(!(i&&e&&e.length))return null;if(e[0].hasOwnProperty(o.options.displayField))n=t.grep(e,(function(t){return a=i?t[o.options.displayField]:o.options.displayField(t),o.matcher(a)}));else{if("string"!=typeof e[0])return null;n=t.grep(e,(function(t){return o.matcher(t)}))}return this.sorter(n)},next:function(e){var n=this.$menu.find(".active").removeClass("active").next();if(n.length||(n=t(this.$menu.find("li")[0])),this.options.scrollBar){var a=this.$menu.children("li").index(n);a%8==0&&this.$menu.scrollTop(26*a)}n.addClass("active")},prev:function(t){var e=this.$menu.find(".active").removeClass("active").prev();if(e.length||(e=this.$menu.find("li").last()),this.options.scrollBar){var n=this.$menu.children("li"),a=n.length-1,o=n.index(e);(a-o)%8==0&&this.$menu.scrollTop(26*(o-7))}e.addClass("active")},listen:function(){this.$element.on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("keypress",t.proxy(this.keypress,this)).on("keyup",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",t.proxy(this.keydown,this)),this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter","li",t.proxy(this.mouseenter,this)).on("mouseleave","li",t.proxy(this.mouseleave,this))},move:function(t){if(this.shown){switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:t.preventDefault(),this.prev();break;case 40:t.preventDefault(),this.next()}t.stopPropagation()}},keydown:function(e){this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.move(e)},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},keyup:function(t){switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.ajax?this.ajaxLookup():this.lookup()}t.stopPropagation(),t.preventDefault()},focus:function(t){this.focused=!0},blur:function(t){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(t){t.stopPropagation(),t.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},destroy:function(){this.$element.off("focus",t.proxy(this.focus,this)).off("blur",t.proxy(this.blur,this)).off("keypress",t.proxy(this.keypress,this)).off("keyup",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.off("keydown",t.proxy(this.keydown,this)),this.$menu.off("click",t.proxy(this.click,this)).off("mouseenter","li",t.proxy(this.mouseenter,this)).off("mouseleave","li",t.proxy(this.mouseleave,this)),this.$element.removeData("typeahead")}},t.fn.typeahead=function(n){return this.each((function(){var o=t(this),i=o.data("typeahead"),r="object"===a(n)&&n;i||o.data("typeahead",i=new e(this,r)),"string"==typeof n&&i[n]()}))},t.fn.typeahead.defaults={source:[],items:10,scrollBar:!1,alignWidth:!0,menu:'',item:'
  • ',valueField:"id",displayField:"name",onSelect:function(){},ajax:{url:null,timeout:300,method:"get",triggerLength:1,loadingClass:null,preDispatch:null,preProcess:null}},t.fn.typeahead.Constructor=e,t((function(){t("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',(function(e){var n=t(this);n.data("typeahead")||(e.preventDefault(),n.typeahead(n.data()))}))}))}(window.jQuery)},2811:function(t,e,n){var a,o;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}n(4913),n(475),n(115),n(9693),n(8636),n(5086),n(7136),n(173),n(2231),n(6255),n(9389),n(6048),n(9581),n(6088),n(9073),n(3534),n(590),n(4216),n(8665),n(9979),n(4602),function(t){"use strict";var e,n,a=Array.prototype.slice;(n=function(e){this.options=t.extend({},n.defaults,e),this.parser=this.options.parser,this.locale=this.options.locale,this.messageStore=this.options.messageStore,this.languages={},this.init()}).prototype={init:function(){var e=this;String.locale=e.locale,String.prototype.toLocaleString=function(){var n,a,o,i,r,s,l;for(o=this.valueOf(),i=e.locale,r=0;i;){a=(n=i.split("-")).length;do{if(s=n.slice(0,a).join("-"),l=e.messageStore.get(s,o))return l;a--}while(a);if("en"===i)break;i=t.i18n.fallbacks[e.locale]&&t.i18n.fallbacks[e.locale][r]||e.options.fallbackLocale,t.i18n.log("Trying fallback locale for "+e.locale+": "+i),r++}return""}},destroy:function(){t.removeData(document,"i18n")},load:function(e,n){var a,o,i,r={};if(e||n||(e="i18n/"+t.i18n().locale+".json",n=t.i18n().locale),"string"==typeof e&&"json"!==e.split(".").pop()){for(o in r[n]=e+"/"+n+".json",a=(t.i18n.fallbacks[n]||[]).concat(this.options.fallbackLocale))r[i=a[o]]=e+"/"+i+".json";return this.load(r)}return this.messageStore.load(e,n)},parse:function(e,n){var a=e.toLocaleString();return this.parser.language=t.i18n.languages[t.i18n().locale]||t.i18n.languages.default,""===a&&(a=e),this.parser.parse(a,n)}},t.i18n=function(e,o){var r,s=t.data(document,"i18n"),l="object"===i(e)&&e;return l&&l.locale&&s&&s.locale!==l.locale&&(String.locale=s.locale=l.locale),s||(s=new n(l),t.data(document,"i18n",s)),"string"==typeof e?(r=void 0!==o?a.call(arguments,1):[],s.parse(e,r)):s},t.fn.i18n=function(){var e=t.data(document,"i18n");return e||(e=new n,t.data(document,"i18n",e)),String.locale=e.locale,this.each((function(){var n,a,o,i,r=t(this),s=r.data("i18n");s?(n=s.indexOf("["),a=s.indexOf("]"),-1!==n&&-1!==a&&n1?["CONCAT"].concat(t):t[0]}function P(){var t=w([h,n,I]);return null===t?null:[t[0],t[2]]}function A(){var t=w([h,n,v]);return null===t?null:[t[0],t[2]]}function T(){var t=w([f,d,p]);return null===t?null:t[1]}if(e=S("|"),n=S(":"),a=S("\\"),o=M(/^./),i=S("$"),r=M(/^\d+/),s=M(/^[^{}\[\]$\\]/),l=M(/^[^{}\[\]$\\|]/),k([_,M(/^[^{}\[\]$\s]/)]),u=k([_,l]),c=k([_,s]),b=M(/^[ !"$&'()*,.\/0-9;=?@A-Z\^_`a-z~\x80-\xFF+\-]+/),x=function(t){return t.toString()},h=function(){var t=b();return null===t?null:x(t)},d=k([function(){var t=w([k([P,A]),C(0,D)]);return null===t?null:t[0].concat(t[1])},function(){var t=w([h,C(0,D)]);return null===t?null:[t[0]].concat(t[1])}]),f=S("{{"),p=S("}}"),g=k([T,I,function(){var t=C(1,c)();return null===t?null:t.join("")}]),v=k([T,I,function(){var t=C(1,u)();return null===t?null:t.join("")}]),null===(m=function(){var t=C(0,g)();return null===t?null:["CONCAT"].concat(t)}())||y!==t.length)throw new Error("Parse error at position "+y.toString()+" in input: "+t);return m}},t.extend(t.i18n.parser,new e)}(jQuery),function(t){"use strict";var e=function(){this.language=t.i18n.languages[String.locale]||t.i18n.languages.default};e.prototype={constructor:e,emit:function(e,n){var a,o,r,s=this;switch(i(e)){case"string":case"number":a=e;break;case"object":if(o=t.map(e.slice(1),(function(t){return s.emit(t,n)})),r=e[0].toLowerCase(),"function"!=typeof s[r])throw new Error('unknown operation "'+r+'"');a=s[r](o,n);break;case"undefined":a="";break;default:throw new Error("unexpected type in AST: "+i(e))}return a},concat:function(e){var n="";return t.each(e,(function(t,e){n+=e})),n},replace:function(t,e){var n=parseInt(t[0],10);return n=parseInt(t[0],10)&&e[0]{},1536:()=>{},2559:()=>{},2553:()=>{},5264:()=>{},6387:()=>{},5985:()=>{},63:()=>{},3888:()=>{},7278:()=>{},3704:()=>{}},t=>{var e=e=>t(t.s=e);t.O(0,[95],(()=>(e(2811),e(7852),e(6108),e(9143),e(5779),e(6618),e(3441),e(1680),e(9654),e(5611),e(3600),e(514),e(9307),e(6730),e(1595),e(1223),e(9662),e(63),e(1536),e(2559),e(2553),e(5264),e(6387),e(5985),e(3888),e(3704),e(7278))));t.O()}]); \ No newline at end of file diff --git a/public/build/app.a6586164.js b/public/build/app.a6586164.js new file mode 100644 index 000000000..9db389b40 --- /dev/null +++ b/public/build/app.a6586164.js @@ -0,0 +1,2 @@ +/*! For license information please see app.a6586164.js.LICENSE.txt */ +(self.webpackChunkxtools=self.webpackChunkxtools||[]).push([[524],{3441:()=>{xtools.adminstats={},$((function(){var t=$("#project_input"),e=t.val();0!==$("body.adminstats, body.patrollerstats, body.stewardstats").length&&(xtools.application.setupMultiSelectListeners(),$(".group-selector").on("change",(function(){$(".action-selector").addClass("hidden"),$(".action-selector--"+$(this).val()).removeClass("hidden"),$(".xt-page-title--title").text($.i18n("tool-"+$(this).val()+"stats")),$(".xt-page-title--desc").text($.i18n("tool-"+$(this).val()+"stats-desc"));var n=$.i18n("tool-"+$(this).val()+"stats")+" - "+$.i18n("xtools-title");document.title=n,history.replaceState({},n,"/"+$(this).val()+"stats"),"steward"===$(this).val()?(e=t.val(),t.val("meta.wikimedia.org")):t.val(e),xtools.application.setupMultiSelectListeners()})))}))},9654:(t,e,n)=>{n(8636),n(5086),$((function(){if($("body.authorship").length){var t=$("#show_selector");t.on("change",(function(t){$(".show-option").addClass("hidden").find("input").prop("disabled",!0),$(".show-option--".concat(t.target.value)).removeClass("hidden").find("input").prop("disabled",!1)})),window.onload=function(){return t.trigger("change")}}}))},5611:(t,e,n)=>{n(8476),n(5086),n(8379),n(7899),n(2231),n(115),xtools.autoedits={},$((function(){if($("body.autoedits").length){var t=$(".contributions-container"),e=$("#tool_selector");if(e.length)return xtools.autoedits.fetchTools=function(t){e.prop("disabled",!0),$.get("/api/project/automated_tools/"+t).done((function(t){t.error||(delete t.project,delete t.elapsed_time,e.html('"),Object.keys(t).forEach((function(n){e.append('")}))),e.prop("disabled",!1)}))},$(document).ready((function(){$("#project_input").on("change.autoedits",(function(){xtools.autoedits.fetchTools($("#project_input").val())}))})),void xtools.autoedits.fetchTools($("#project_input").val());if(xtools.application.setupToggleTable(window.countsByTool,window.toolsChart,"count",(function(t){var e=0;Object.keys(t).forEach((function(n){e+=parseInt(t[n].count,10)}));var n=Object.keys(t).length;$(".tools--tools").text(n.toLocaleString(i18nLang)+" "+$.i18n("num-tools",n)),$(".tools--count").text(e.toLocaleString(i18nLang))})),t.length){var n=$(".contributions-table").length?"setupContributionsNavListeners":"loadContributions";xtools.application[n]((function(t){return"".concat(t.target,"-contributions/").concat(t.project,"/").concat(t.username)+"/".concat(t.namespace,"/").concat(t.start,"/").concat(t.end)}),t.data("target"))}}}))},3600:(t,e,n)=>{n(7136),n(173),n(9073),n(6048),n(8636),n(5086),xtools.blame={},$((function(){if($("body.blame").length){$(".diff-empty").length===$(".diff tr").length-1&&$(".diff-empty").eq(0).text("(".concat($.i18n("diff-empty").toLowerCase(),")")).addClass("text-muted text-center").prop("width","20%"),$(".diff-addedline").each((function(){var t=xtools.blame.query.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),e=function(e){var n=new RegExp("(".concat(t,")"),"gi");$(e).html($(e).html().replace(n,"$1"))};$(this).find(".diffchange-inline").length?$(".diffchange-inline").each((function(){e(this)})):e(this)}));var t=$("#show_selector");t.on("change",(function(t){$(".show-option").addClass("hidden").find("input").prop("disabled",!0),$(".show-option--".concat(t.target.value)).removeClass("hidden").find("input").prop("disabled",!1)})),window.onload=function(){return t.trigger("change")}}}))},514:(t,e,n)=>{function a(t,e){xtools.categoryedits.$select2Input.data("select2")&&(xtools.categoryedits.$select2Input.off("change"),xtools.categoryedits.$select2Input.select2("val",null),xtools.categoryedits.$select2Input.select2("data",null),xtools.categoryedits.$select2Input.select2("destroy"));var n=e||xtools.categoryedits.$select2Input.data("ns"),a={ajax:{url:t||xtools.categoryedits.$select2Input.data("api"),dataType:"jsonp",jsonpCallback:"categorySuggestionCallback",delay:200,data:function(t){return{action:"query",list:"prefixsearch",format:"json",pssearch:t.term||"",psnamespace:14,cirrusUseCompletionSuggester:"yes"}},processResults:function(t){var e=t?t.query:{},a=[];return e&&e.prefixsearch.length&&(a=e.prefixsearch.map((function(t){var e=t.title.replace(new RegExp("^"+n+":"),"");return{id:e.score(),text:e}}))),{results:a}}},placeholder:$.i18n("category-search"),maximumSelectionLength:10,minimumInputLength:1};xtools.categoryedits.$select2Input.select2(a)}n(475),n(8476),n(5086),n(8379),n(7899),n(2231),n(9581),n(7136),n(173),n(9073),n(6048),xtools.categoryedits={},$((function(){$("body.categoryedits").length&&$(document).ready((function(){var t;xtools.categoryedits.$select2Input=$("#category_selector"),a(),$("#project_input").on("xtools.projectLoaded",(function(t,e){$.get(xtBaseUrl+"api/project/namespaces/"+e.project).done((function(t){a(t.api,t.namespaces[14])}))})),$("form").on("submit",(function(){$("#category_input").val(xtools.categoryedits.$select2Input.val().join("|"))})),xtools.application.setupToggleTable(window.countsByCategory,window.categoryChart,"editCount",(function(t){var e=0,n=0;Object.keys(t).forEach((function(a){e+=parseInt(t[a].editCount,10),n+=parseInt(t[a].pageCount,10)}));var a=Object.keys(t).length;$(".category--category").text(a.toLocaleString(i18nLang)+" "+$.i18n("num-categories",a)),$(".category--count").text(e.toLocaleString(i18nLang)),$(".category--percent-of-edit-count").text(100*(e/xtools.categoryedits.userEditCount).toLocaleString(i18nLang)+"%"),$(".category--pages").text(n.toLocaleString(i18nLang))})),$(".contributions-container").length&&(t=$(".contributions-table").length?"setupContributionsNavListeners":"loadContributions",xtools.application[t]((function(t){return"categoryedits-contributions/"+t.project+"/"+t.username+"/"+t.categories+"/"+t.start+"/"+t.end}),"Category"))}))}))},5779:(t,e,n)=>{function a(t){$("#project_input").val(xtools.application.vars.lastProject),$(".site-notice").append("")}function o(){var t=$("#page_input"),e=$("#user_input"),n=$("#namespace_select");if(t[0]||e[0]||$("#project_input")[0]){t.data("typeahead")&&t.data("typeahead").destroy(),e.data("typeahead")&&e.data("typeahead").destroy(),xtools.application.vars.apiPath||(xtools.application.vars.apiPath=$("#page_input").data("api")||$("#user_input").data("api"));var a={url:xtools.application.vars.apiPath,timeout:200,triggerLength:1,method:"get",preDispatch:null,preProcess:null};t[0]&&t.typeahead({ajax:Object.assign(a,{preDispatch:function(t){n[0]&&"0"!==n.val()&&(t=n.find("option:selected").text().trim()+":"+t);return{action:"query",list:"prefixsearch",format:"json",pssearch:t}},preProcess:function(t){var e="";return n[0]&&"0"!==n.val()&&(e=n.find("option:selected").text().trim()),t.query.prefixsearch.map((function(t){return t.title.replace(new RegExp("^"+e+":"),"")}))}})}),e[0]&&e.typeahead({ajax:Object.assign(a,{preDispatch:function(t){return{action:"query",list:"prefixsearch",format:"json",pssearch:"User:"+t}},preProcess:function(t){return t.query.prefixsearch.map((function(t){return t.title.split("/")[0].substr(t.title.indexOf(":")+1)})).filter((function(t,e,n){return n.indexOf(t)===e}))}})})}}function i(t){t?($(".form-control").prop("readonly",!1),$(".form-submit").prop("disabled",!1),$(".form-submit").text($.i18n("submit")).prop("disabled",!1)):$("#content form").on("submit",(function(){document.activeElement.blur(),$(".form-control").prop("readonly",!0),$(".form-submit").prop("disabled",!0).html($.i18n("loading")+" ");var t=Date.now();setInterval((function(){var e=Math.round((Date.now()-t)/1e3),n=Math.floor(e/60),a=("00"+(e-60*n)).slice(-2);$("#submit_timer").text(n+":"+a)}),1e3)}))}n(8665),n(5086),n(9979),n(4602),n(789),n(933),n(9218),n(2231),n(8636),n(5231),n(6088),n(8476),n(8379),n(7899),n(4189),n(8329),n(9581),n(7136),n(173),n(9073),n(6048),n(9693),n(17),n(9560),n(9389),n(8772),n(4913),xtools={},xtools.application={},xtools.application.vars={sectionOffset:{}},xtools.application.chartGridColor="rgba(0, 0, 0, 0.1)",window.matchMedia("(prefers-color-scheme: dark)").matches&&(Chart.defaults.global.defaultFontColor="#AAA",xtools.application.chartGridColor="#333"),$.i18n({locale:i18nLang}).load(i18nPaths),$((function(){$(document).ready((function(){if($(".xt-hide").on("click",(function(){$(this).hide(),$(this).siblings(".xt-show").show(),$(this).parents(".panel-heading").length?$(this).parents(".panel-heading").siblings(".panel-body").hide():$(this).parents(".xt-show-hide--parent").next(".xt-show-hide--target").hide()})),$(".xt-show").on("click",(function(){$(this).hide(),$(this).siblings(".xt-hide").show(),$(this).parents(".panel-heading").length?$(this).parents(".panel-heading").siblings(".panel-body").show():$(this).parents(".xt-show-hide--parent").next(".xt-show-hide--target").show()})),function(){var t=$(window).width(),e=$(".tool-links").outerWidth(),n=$(".nav-buttons").outerWidth();if(t<768)return;e+n>t&&$(".tool-links--more").removeClass("hidden");var a=$(".tool-links--entry").length;for(;a>0&&e+n>t;){var o=$(".tool-links--nav > .tool-links--entry:not(.active)").last().remove();$(".tool-links--more .dropdown-menu").append(o),e=$(".tool-links").outerWidth(),a--}}(),xtools.application.setupColumnSorting(),function(){var t=$(".xt-toc");if(!t||!t[0])return;xtools.application.vars.tocHeight=t.height();var e=function(){$(".xt-toc").find("a").off("click").on("click",(function(t){document.activeElement.blur();var e=$("#"+$(t.target).data("section"));$(window).scrollTop(e.offset().top-xtools.application.vars.tocHeight),$(this).parents(".xt-toc").find("a").removeClass("bold"),n(),xtools.application.vars.$tocClone.addClass("bold")}))};xtools.application.setupTocListeners=e;var n=function(){xtools.application.vars.$tocClone||(xtools.application.vars.$tocClone=t.clone(),xtools.application.vars.$tocClone.addClass("fixed"),t.after(xtools.application.vars.$tocClone),e())};xtools.application.buildSectionOffsets=function(){$.each(t.find("a"),(function(t,e){var n=$(e).data("section");xtools.application.vars.sectionOffset[n]=$("#"+n).offset().top}))},$(".xt-show, .xt-hide").on("click",xtools.application.buildSectionOffsets),xtools.application.buildSectionOffsets(),e();var a=t.offset().top;$(window).on("scroll.toc",(function(t){var e,o=$(t.target).scrollTop(),i=o>a;i?(xtools.application.vars.$tocClone||n(),Object.keys(xtools.application.vars.sectionOffset).forEach((function(t){o>xtools.application.vars.sectionOffset[t]-xtools.application.vars.tocHeight-1&&(e=xtools.application.vars.$tocClone.find('a[data-section="'+t+'"]'))})),xtools.application.vars.$tocClone.find("a").removeClass("bold"),e&&e.addClass("bold")):!i&&xtools.application.vars.$tocClone&&(xtools.application.vars.$tocClone.remove(),xtools.application.vars.$tocClone=null)}))}(),function(){var t=$(".table-sticky-header");if(!t||!t[0])return;var e,n=t.find("thead tr").eq(0),a=function(){e||(e=n.clone(),n.addClass("sticky-heading"),n.before(e),n.find("th").each((function(t){$(this).css("width",e.find("th").eq(t).outerWidth())})),n.css("width",e.outerWidth()+1))},o=t.offset().top;$(window).on("scroll.stickyHeader",(function(i){var r=$(i.target).scrollTop()>o;r&&!e?a():!r&&e?(n.removeClass("sticky-heading"),e.remove(),e=null):e&&n.css("top",$(window).scrollTop()-t.offset().top)}))}(),function(){var t=$("#project_input");if(!t)return;t.length&&$("#namespace_select").length?(xtools.application.vars.lastProject=$("#project_input").val(),$("#project_input").off("change").on("change",(function(){$("#namespace_select").prop("disabled",!0);var t=this.value;$.get(xtBaseUrl+"api/project/namespaces/"+t).done((function(e){var n=$('#namespace_select option[value="all"]').eq(0).clone();for(var a in $("#namespace_select").html(n),xtools.application.vars.apiPath=e.api,e.namespaces)if(e.namespaces.hasOwnProperty(a)){var i=0===parseInt(a,10)?$.i18n("mainspace"):e.namespaces[a];$("#namespace_select").append("")}$("#namespace_select").val(0),xtools.application.vars.lastProject=t,o()})).fail(a.bind(this,t)).always((function(){$("#namespace_select").prop("disabled",!1)}))})),$("#namespace_select").on("change",o)):($("#user_input")[0]||$("#page_input")[0])&&(xtools.application.vars.lastProject=t.val(),t.on("change",(function(){var e=this.value;$.get(xtBaseUrl+"api/project/normalize/"+e).done((function(n){xtools.application.vars.apiPath=n.api,xtools.application.vars.lastProject=e,o(),t.trigger("xtools.projectLoaded",n)})).fail(a.bind(this,e))})))}(),o(),i(),"function"==typeof URL){var t=new URL(window.location.href).searchParams.get("focus");t&&$("[name=".concat(t,"]")).focus()}})),window.onpageshow=function(t){t.persisted&&i(!0)}})),xtools.application.setupToggleTable=function(t,e,n,a){var o;$(".toggle-table").on("click",".toggle-table--toggle",(function(){o||(o=Object.assign({},t));var i=$(this).data("index"),r=$(this).data("key");"true"===$(this).attr("data-disabled")?(o[r]=t[r],e&&(e.data.datasets[0].data[i]=parseInt(n?o[r][n]:o[r],10)),$(this).attr("data-disabled","false")):(delete o[r],e&&(e.data.datasets[0].data[i]=null),$(this).attr("data-disabled","true")),$(this).parents("tr").toggleClass("excluded"),$(this).find(".glyphicon").toggleClass("glyphicon-remove").toggleClass("glyphicon-plus"),a(o,r,i),e&&e.update()}))},xtools.application.setupColumnSorting=function(){var t,e;$(".sort-link").on("click",(function(){t=e===$(this).data("column")?-t:1,$(".sort-link .glyphicon").removeClass("glyphicon-sort-by-alphabet-alt glyphicon-sort-by-alphabet").addClass("glyphicon-sort");var n=1===t?"glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet";$(this).find(".glyphicon").addClass(n).removeClass("glyphicon-sort"),e=$(this).data("column");var a=$(this).parents("table"),o=a.find(".sort-entry--"+e).parent();o.length&&(o.sort((function(n,a){var o=$(n).find(".sort-entry--"+e).data("value")||0,i=$(a).find(".sort-entry--"+e).data("value")||0;return isNaN(o)||(o=parseFloat(o)||0),isNaN(i)||(i=parseFloat(i)||0),oi?-t:0})),$(".sort-entry--rank").length>0&&$.each(o,(function(t,e){$(e).find(".sort-entry--rank").text(t+1)})),a.find("tbody").html(o))}))},xtools.application.setupMultiSelectListeners=function(){var t=$(".multi-select--body:not(.hidden) .multi-select--option");t.on("change",(function(){$(".multi-select--all").prop("checked",$(".multi-select--body:not(.hidden) .multi-select--option:checked").length===t.length)})),$(".multi-select--all").on("click",(function(){t.prop("checked",$(this).prop("checked"))}))}},6618:(t,e,n)=>{function a(){xtools.application.vars.offset||(xtools.application.vars.initialOffset=$(".contributions-container").data("offset"),xtools.application.vars.offset=xtools.application.vars.initialOffset)}n(9218),n(2231),n(8665),n(5086),n(9979),n(4602),n(933),n(7136),n(785),n(9389),n(6048),n(9073),n(173),Object.assign(xtools.application.vars,{initialOffset:"",offset:"",prevOffsets:[],initialLoad:!1}),xtools.application.loadContributions=function(t,e){a();var n=$(".contributions-container"),o=$(".contributions-loading"),i=n.data(),r=t(i),s=parseInt(i.limit,10)||50,l=new URLSearchParams(window.location.search),u=xtBaseUrl+r+"/"+xtools.application.vars.offset,c=location.pathname.split("/")[1],d=u.split("/")[1];n.addClass("contributions-container--loading"),o.show(),l.set("limit",s.toString()),l.append("htmlonly","yes"),$.ajax({url:u+"?"+l.toString(),timeout:6e4}).always((function(){n.removeClass("contributions-container--loading"),o.hide()})).done((function(a){if(n.html(a).show(),xtools.application.setupContributionsNavListeners(t,e),xtools.application.vars.initialOffset||(xtools.application.vars.initialOffset=$(".contribs-row-date").first().data("value"),xtools.application.vars.initialLoad=!0),c!==d){var o=new RegExp("^/".concat(d,"/(.*)/"));u=u.replace(o,"/".concat(c,"/$1/"))}xtools.application.vars.initialLoad?xtools.application.vars.initialLoad=!1:(l.delete("htmlonly"),window.history.replaceState(null,document.title,u+"?"+l.toString()),n.parents(".panel")[0].scrollIntoView()),xtools.application.vars.offset"+i+"")).show()}))},xtools.application.setupContributionsNavListeners=function(t,e){a(),$(".contributions--prev").off("click").one("click",(function(n){n.preventDefault(),xtools.application.vars.offset=xtools.application.vars.prevOffsets.pop()||xtools.application.vars.initialOffset,xtools.application.loadContributions(t,e)})),$(".contributions--next").off("click").one("click",(function(n){n.preventDefault(),xtools.application.vars.offset&&xtools.application.vars.prevOffsets.push(xtools.application.vars.offset),xtools.application.vars.offset=$(".contribs-row-date").last().data("value"),xtools.application.loadContributions(t,e)})),$("#contributions_limit").on("change",(function(t){var e=parseInt(t.target.value,10);$(".contributions-container").data("limit",e),$(".contributions--prev-text").text($.i18n("pager-newer-n",e).capitalize()),$(".contributions--next-text").text($.i18n("pager-older-n",e).capitalize())}))}},9143:(t,e,n)=>{n(7136),n(173),n(17),n(5086),n(9693),n(5852),n(4913),String.prototype.descore=function(){return this.replace(/_/g," ")},String.prototype.score=function(){return this.replace(/ /g,"_")},String.prototype.escape=function(){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return this.replace(/[&<>"'\/]/g,(function(e){return t[e]}))},Array.prototype.unique=function(){return this.filter((function(t,e,n){return n.indexOf(t)===e}))},Object.defineProperty(String.prototype,"capitalize",{value:function(){return this.charAt(0).toUpperCase()+this.slice(1)},enumerable:!1})},9307:(t,e,n)=>{function a(t,e){var n=0,a=[];Object.keys(t).forEach((function(e){var o=parseInt(t[e],10);a.push(o),n+=o}));var i=Object.keys(t).length;$(".namespaces--namespaces").text(i.toLocaleString(i18nLang)+" "+$.i18n("num-namespaces",i)),$(".namespaces--count").text(n.toLocaleString(i18nLang)),a.forEach((function(t){var e=r(t,n);$(".namespaces-table .sort-entry--count[data-value="+t+"]").text(t.toLocaleString(i18nLang)+" ("+e+")")})),["year","month"].forEach((function(t){var n=window[t+"countsChart"],a=window.namespaces[e]||$.i18n("mainspace");if(n){var i=0;n.data.datasets.forEach((function(t,e){t.label===a&&(i=e)}));var r=n.getDatasetMeta(i);r.hidden=null===r.hidden?!n.data.datasets[i].hidden:null,r.hidden?xtools.editcounter.excludedNamespaces.push(a):xtools.editcounter.excludedNamespaces=xtools.editcounter.excludedNamespaces.filter((function(t){return t!==a})),window[t+"countsChart"].config.data.labels=o(t,n.data.datasets),n.update()}}))}function o(t,e){var n=i(t,e);return Object.keys(n).map((function(e){var a=n[e].toString().length,o=2*(xtools.editcounter.maxDigits[t]-a);return e+Array(o+5).join("\t")+n[e].toLocaleString(i18nLang,{useGrouping:!1})}))}function i(t,e){var n={};return e.forEach((function(e){-1===xtools.editcounter.excludedNamespaces.indexOf(e.label)&&e.data.forEach((function(e,a){n[xtools.editcounter.chartLabels[t][a]]||(n[xtools.editcounter.chartLabels[t][a]]=0),n[xtools.editcounter.chartLabels[t][a]]+=e}))})),n}function r(t,e){return(t/e).toLocaleString(i18nLang,{style:"percent"})}n(8476),n(5086),n(8379),n(7899),n(2231),n(17),n(9581),n(9389),n(6048),n(475),n(9693),n(7136),n(173),n(5195),n(9979),n(2982),n(115),n(1128),n(5843),n(533),n(8825),n(6088),xtools.editcounter={},xtools.editcounter.excludedNamespaces=[],xtools.editcounter.chartLabels={},xtools.editcounter.maxDigits={},$((function(){0!==$("body.editcounter").length&&(xtools.application.setupMultiSelectListeners(),$(".chart-wrapper").each((function(){var t=$(this).data("chart-type");if(void 0===t)return!1;var e=$(this).data("chart-data"),n=$(this).data("chart-labels"),a=$("canvas",$(this));new Chart(a,{type:t,data:{labels:n,datasets:[{data:e}]}})})),xtools.application.setupToggleTable(window.namespaceTotals,window.namespaceChart,null,a))})),xtools.editcounter.setupMonthYearChart=function(t,e,n,a){var s=e.map((function(t){return t.label}));xtools.editcounter.maxDigits[t]=a.toString().length,xtools.editcounter.chartLabels[t]=n;var l=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"linear";return window[t+"countsChart"]=new Chart($("#"+t+"counts-canvas"),{type:"horizontalBar",data:{labels:o(t,e),datasets:e},options:{tooltips:{mode:"nearest",intersect:!0,callbacks:{label:function(n){var a=i(t,e),o=Object.keys(a).map((function(t){return a[t]})),s=o[n.index],l=r(n.xLabel,s);return n.xLabel.toLocaleString(i18nLang)+" ("+l+")"},title:function(t){return t[0].yLabel.replace(/\t.*/,"")+" - "+s[t[0].datasetIndex]}}},responsive:!0,maintainAspectRatio:!1,scales:{xAxes:[{type:n,stacked:!0,ticks:{beginAtZero:!0,min:"logarithmic"==n?1:0,reverse:i18nRTL,callback:function(t){if(Math.floor(t)===t)return t.toLocaleString(i18nLang)}},gridLines:{color:xtools.application.chartGridColor},afterBuildTicks:function(t){if("logarithmic"==n){var e=[];t.ticks.forEach((function(t,n){(0==n||1.5*e[e.length-1]"+u[11].toLocaleString(i18nLang)),window.sizeHistogramChart=new Chart($("#sizechart-canvas"),{type:"bar",data:{labels:c,datasets:[s,l,i]},options:{tooltips:{mode:"nearest",intersect:!0,callbacks:{label:function(t){return percentage=r(Math.abs(t.yLabel),o),Math.abs(t.yLabel).toLocaleString(i18nLang)+" ("+percentage+")"}}},responsive:!0,maintainAspectRatio:!1,legend:{position:"top"},scales:{yAxes:[{stacked:!0,gridLines:{color:xtools.application.chartGridColor},ticks:{callback:function(t){return Math.abs(t).toLocaleString(i18nLang)}}}],xAxes:[{stacked:!0,gridLines:{color:xtools.application.chartGridColor}}]}}})},xtools.editcounter.setupTimecard=function(t,e){var n=(new Date).getTimezoneOffset()/60;t=t.map((function(t){return t.backgroundColor=new Array(t.data.length).fill(t.backgroundColor),t})),window.chart=new Chart($("#timecard-bubble-chart"),{type:"bubble",data:{datasets:t},options:{responsive:!0,legend:{display:!1},layout:{padding:{right:0}},elements:{point:{radius:function(t){var e=t.dataIndex,n=t.dataset.data[e],a=(t.chart.height-20)/9/2;return n.scale/20*a},hitRadius:8}},scales:{yAxes:[{ticks:{min:0,max:8,stepSize:1,padding:25,callback:function(t,n){return e[n]}},position:i18nRTL?"right":"left",gridLines:{color:xtools.application.chartGridColor}},{ticks:{min:0,max:8,stepSize:1,padding:25,callback:function(e,n){return 0===n||n>7?"":(window.chart?window.chart.data.datasets:t).map((function(t){return t.data})).flat().filter((function(t){return t.y==8-n})).reduce((function(t,e){return t+parseInt(e.value,10)}),0)}},position:i18nRTL?"left":"right"}],xAxes:[{ticks:{beginAtZero:!0,min:0,max:24,stepSize:1,reverse:i18nRTL,padding:0,callback:function(e,n,a,o){if(24===e)return"";var i=[];if($("#timecard-bubble-chart").attr("width")>=1e3){var r=(window.chart?window.chart.data.datasets:t).map((function(t){return t.data})).flat().filter((function(t){return t.x==e}));i.push(r.reduce((function(t,e){return t+parseInt(e.value,10)}),0))}return e%2==0&&i.push(e+":00"),i}},gridLines:{color:xtools.application.chartGridColor},position:"bottom"}]},tooltips:{displayColors:!1,callbacks:{title:function(t){return e[7-t[0].yLabel+1]+" "+parseInt(t[0].xLabel)+":"+String(t[0].xLabel%1*60).padStart(2,"0")},label:function(e){var n=[t[e.datasetIndex].data[e.index].value];return"".concat(n," ").concat($.i18n("num-edits",[n]))}}}}}),$((function(){$(".use-local-time").prop("checked",!1).on("click",(function(){var t=$(this).is(":checked")?n:-n,e=new Array(7);chart.data.datasets.forEach((function(t){return e[t.data[0].day_of_week-1]=t.backgroundColor[0]})),chart.data.datasets=chart.data.datasets.map((function(n){var a=[];return n.data=n.data.map((function(n){var o=parseFloat(n.hour)-t,i=parseInt(n.day_of_week,10);return o<0?(o=24+o,(i-=1)<1&&(i=7+i)):o>=24&&(o-=24,(i+=1)>7&&(i-=7)),n.hour=o.toString(),n.x=o.toString(),n.day_of_week=i.toString(),n.y=(8-i).toString(),a.push(e[i-1]),n})),n.backgroundColor=a,n})),$(this).is(":checked"),chart.update()}))}))}},6730:(t,e,n)=>{n(115),xtools.globalcontribs={},$((function(){0!==$("body.globalcontribs").length&&xtools.application.setupContributionsNavListeners((function(t){return"globalcontribs/".concat(t.username,"/").concat(t.namespace,"/").concat(t.start,"/").concat(t.end)}),"globalcontribs")}))},1680:(t,e,n)=>{n(7136),n(173),xtools.pageinfo={},$((function(){if($("body.pageinfo").length){var t=function(){xtools.application.setupToggleTable(window.textshares,window.textsharesChart,"percentage",$.noop)},e=$(".textshares-container");if(e[0]){var n=xtBaseUrl+"authorship/"+e.data("project")+"/"+e.data("page")+"/"+(xtools.pageinfo.endDate?xtools.pageinfo.endDate+"/":"");n="".concat(n.replace(/\/$/,""),"?htmlonly=yes"),$.ajax({url:n,timeout:3e4}).done((function(n){e.replaceWith(n),xtools.application.buildSectionOffsets(),xtools.application.setupTocListeners(),xtools.application.setupColumnSorting(),t()})).fail((function(t,n,a){e.replaceWith($.i18n("api-error","Authorship API: "+a+""))}))}else $(".textshares-table").length&&t()}}))},1595:(t,e,n)=>{n(8476),n(5086),n(8379),n(7899),n(4867),n(9389),n(6048),n(8636),xtools.pages={},$((function(){if($("body.pages").length){var t={};xtools.application.setupToggleTable(window.countsByNamespace,window.pieChart,"count",(function(t){var e={count:0,deleted:0,redirects:0};Object.keys(t).forEach((function(n){e.count+=t[n].count,e.deleted+=t[n].deleted,e.redirects+=t[n].redirects})),$(".namespaces--namespaces").text(Object.keys(t).length.toLocaleString()+" "+$.i18n("num-namespaces",Object.keys(t).length)),$(".namespaces--pages").text(e.count.toLocaleString()),$(".namespaces--deleted").text(e.deleted.toLocaleString()+" ("+(e.deleted/e.count*100).toFixed(1)+"%)"),$(".namespaces--redirects").text(e.redirects.toLocaleString()+" ("+(e.redirects/e.count*100).toFixed(1)+"%)")})),$(".deleted-page").on("mouseenter",(function(e){var n=$(this).data("page-title"),a=$(this).data("namespace"),o=$(this).data("datetime").toString(),i=$(this).data("username"),r=function(t){$(e.target).find(".tooltip-body").html(t)};if(void 0!==t[a+"/"+n])return r(t[a+"/"+n]);var s=function(){r(""+$.i18n("api-error","Deletion Summary API")+"")};$.ajax({url:xtBaseUrl+"pages/deletion_summary/"+wikiDomain+"/"+i+"/"+a+"/"+n+"/"+o}).done((function(e){if(null===e.summary)return s();r(e.summary),t[a+"/"+n]=e.summary})).fail(s)}))}}))},1223:()=>{xtools.topedits={},$((function(){$("body.topedits").length&&$("#namespace_select").on("change",(function(){$("#page_input").prop("disabled","all"===$(this).val())}))}))},7852:(t,e,n)=>{var a,o,i,s;function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}n(7136),n(6255),n(2231),n(4913),n(6088),n(9389),n(5086),n(6048),n(8665),n(4602),n(115),n(8476),n(9693),n(475),n(9581),n(2982),n(4009),n(17),n(2157),n(8763),n(9560),n(5852),n(8379),n(7899),n(533),n(4538),n(1145),n(6943),n(8772),n(5231),n(4867),n(4895),n(4189),n(557),n(8844),n(2006),n(3534),n(590),n(4216),n(9979),s=function(){return function t(e,n,a){function o(r,s){if(!n[r]){if(!e[r]){if(i)return i(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[r]={exports:{}};e[r][0].call(u.exports,(function(t){return o(e[r][1][t]||t)}),u,u.exports,t,e,n,a)}return n[r].exports}for(var i=void 0,r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,a=t,o=void 0===e?.5:e,i=2*o-1,r=n.alpha()-a.alpha(),s=((i*r==-1?i:(i+r)/(1+i*r))+1)/2,l=1-s;return this.rgb(s*n.red()+l*a.red(),s*n.green()+l*a.green(),s*n.blue()+l*a.blue()).alpha(n.alpha()*o+a.alpha()*(1-o))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new i,a=this.values,o=n.values;for(var r in a)a.hasOwnProperty(r)&&(t=a[r],"[object Array]"===(e={}.toString.call(t))?o[r]=t.slice(0):"[object Number]"===e?o[r]=t:console.error("unexpected color value:",t));return n}},i.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},i.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},i.prototype.getValues=function(t){for(var e=this.values,n={},a=0;a.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92)),100*(.2126*e+.7152*n+.0722*a),100*(.0193*e+.1192*n+.9505*a)]}function c(t){var e=u(t),n=e[0],a=e[1],o=e[2];return a/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116)-16,500*(n-a),200*(a-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]}function d(t){var e,n,a,o,i,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[i=255*l,i,i];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),o=[0,0,0];for(var u=0;u<3;u++)(a=r+1/3*-(u-1))<0&&a++,a>1&&a--,i=6*a<1?e+6*(n-e)*a:2*a<1?n:3*a<2?e+(n-e)*(2/3-a)*6:e,o[u]=255*i;return o}function h(t){var e=t[0]/60,n=t[1]/100,a=t[2]/100,o=Math.floor(e)%6,i=e-Math.floor(e),r=255*a*(1-n),s=255*a*(1-n*i),l=255*a*(1-n*(1-i));switch(a*=255,o){case 0:return[a,l,r];case 1:return[s,a,r];case 2:return[r,a,l];case 3:return[r,s,a];case 4:return[l,r,a];case 5:return[a,r,s]}}function f(t){var e,n,a,o,i=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),a=6*i-(e=Math.floor(6*i)),!!(1&e)&&(a=1-a),o=s+a*((n=1-l)-s),e){default:case 6:case 0:r=n,g=o,b=s;break;case 1:r=o,g=n,b=s;break;case 2:r=s,g=n,b=o;break;case 3:r=s,g=o,b=n;break;case 4:r=o,g=s,b=n;break;case 5:r=n,g=s,b=o}return[255*r,255*g,255*b]}function p(t){var e=t[0]/100,n=t[1]/100,a=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,a*(1-o)+o))]}function v(t){var e,n,a,o=t[0]/100,i=t[1]/100,r=t[2]/100;return n=-.9689*o+1.8758*i+.0415*r,a=.0557*o+-.204*i+1.057*r,e=(e=3.2406*o+-1.5372*i+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(a=Math.min(Math.max(0,a),1))]}function m(t){var e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function x(t){var e,n,a,o,i=t[0],r=t[1],s=t[2];return i<=8?o=(n=100*i/903.3)/100*7.787+16/116:(n=100*Math.pow((i+16)/116,3),o=Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(r/500+o-16/116)/7.787:95.047*Math.pow(r/500+o,3),n,a=a/108.883<=.008859?a=108.883*(o-s/200-16/116)/7.787:108.883*Math.pow(o-s/200,3)]}function y(t){var e,n=t[0],a=t[1],o=t[2];return(e=360*Math.atan2(o,a)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(a*a+o*o),e]}function k(t){return v(x(t))}function w(t){var e,n=t[0],a=t[1];return e=t[2]/360*2*Math.PI,[n,a*Math.cos(e),a*Math.sin(e)]}function C(t){return S[t]}e.exports={rgb2hsl:a,rgb2hsv:o,rgb2hwb:i,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:c,rgb2lch:function(t){return y(c(t))},hsl2rgb:d,hsl2hsv:function(t){var e=t[0],n=t[1]/100,a=t[2]/100;return 0===a?[0,0,0]:[e,2*(n*=(a*=2)<=1?a:2-a)/(a+n)*100,(a+n)/2*100]},hsl2hwb:function(t){return i(d(t))},hsl2cmyk:function(t){return s(d(t))},hsl2keyword:function(t){return l(d(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,a=t[0],o=t[1]/100,i=t[2]/100;return e=o*i,[a,100*(e=(e/=(n=(2-o)*i)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return i(h(t))},hsv2cmyk:function(t){return s(h(t))},hsv2keyword:function(t){return l(h(t))},hwb2rgb:f,hwb2hsl:function(t){return a(f(t))},hwb2hsv:function(t){return o(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return a(p(t))},cmyk2hsv:function(t){return o(p(t))},cmyk2hwb:function(t){return i(p(t))},cmyk2keyword:function(t){return l(p(t))},keyword2rgb:C,keyword2hsl:function(t){return a(C(t))},keyword2hsv:function(t){return o(C(t))},keyword2hwb:function(t){return i(C(t))},keyword2cmyk:function(t){return s(C(t))},keyword2lab:function(t){return c(C(t))},keyword2xyz:function(t){return u(C(t))},xyz2rgb:v,xyz2lab:m,xyz2lch:function(t){return y(m(t))},lab2xyz:x,lab2rgb:k,lab2lch:y,lch2lab:w,lch2xyz:function(t){return x(w(t))},lch2rgb:function(t){return k(w(t))}};var S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},M={};for(var _ in S)M[JSON.stringify(S[_])]=_},{}],5:[function(t,e,n){var a=t(4),o=function(){return new u};for(var i in a){o[i+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),a[t](e)}}(i);var r=/(\w+)2(\w+)/.exec(i),s=r[1],l=r[2];(o[s]=o[s]||{})[l]=o[i]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=a[t](e);if("string"==typeof n||void 0===n)return n;for(var o=0;o0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index=0&&o>0)&&(v+=o));return i=d.getPixelForValue(v),{size:s=((r=d.getPixelForValue(v+f))-i)/2,base:i,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,n){var a,o,r,s,l,u=n.scale.options,c=this.getStackIndex(t),d=n.pixels,h=d[e],f=d.length,p=n.start,g=n.end;return 1===f?(a=h>p?h-p:g-h,o=h0&&(a=(h-d[e-1])/2,e===f-1&&(o=a)),e');var n=t.data,a=n.datasets,o=n.labels;if(a.length)for(var i=0;i'),o[i]&&e.push(o[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var o=t.getDatasetMeta(0),r=e.datasets[0],s=o.data[a],l=s&&s.custom||{},u=i.valueAtIndexOrDefault,c=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:u(r.backgroundColor,a,c.backgroundColor),strokeStyle:l.borderColor?l.borderColor:u(r.borderColor,a,c.borderColor),lineWidth:l.borderWidth?l.borderWidth:u(r.borderWidth,a,c.borderWidth),hidden:isNaN(r.data[a])||o.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,o,i=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n=Math.PI?-1:p<-Math.PI?1:0))+f,v={x:Math.cos(p),y:Math.sin(p)},m={x:Math.cos(g),y:Math.sin(g)},b=p<=0&&g>=0||p<=2*Math.PI&&2*Math.PI<=g,x=p<=.5*Math.PI&&.5*Math.PI<=g||p<=2.5*Math.PI&&2.5*Math.PI<=g,y=p<=-Math.PI&&-Math.PI<=g||p<=Math.PI&&Math.PI<=g,k=p<=.5*-Math.PI&&.5*-Math.PI<=g||p<=1.5*Math.PI&&1.5*Math.PI<=g,w=h/100,C={x:y?-1:Math.min(v.x*(v.x<0?1:w),m.x*(m.x<0?1:w)),y:k?-1:Math.min(v.y*(v.y<0?1:w),m.y*(m.y<0?1:w))},S={x:b?1:Math.max(v.x*(v.x>0?1:w),m.x*(m.x>0?1:w)),y:x?1:Math.max(v.y*(v.y>0?1:w),m.y*(m.y>0?1:w))},M={width:.5*(S.x-C.x),height:.5*(S.y-C.y)};u=Math.min(s/M.width,l/M.height),c={x:-.5*(S.x+C.x),y:-.5*(S.y+C.y)}}n.borderWidth=e.getMaxBorderWidth(d.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=c.x*n.outerRadius,n.offsetY=c.y*n.outerRadius,d.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),i.each(d.data,(function(n,a){e.updateElement(n,a,t)}))},updateElement:function(t,e,n){var a=this,o=a.chart,r=o.chartArea,s=o.options,l=s.animation,u=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=s.rotation,h=s.rotation,f=a.getDataset(),p=n&&l.animateRotate||t.hidden?0:a.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),g=n&&l.animateScale?0:a.innerRadius,v=n&&l.animateScale?0:a.outerRadius,m=i.valueAtIndexOrDefault;i.extend(t,{_datasetIndex:a.index,_index:e,_model:{x:u+o.offsetX,y:c+o.offsetY,startAngle:d,endAngle:h,circumference:p,outerRadius:v,innerRadius:g,label:m(f.label,e,o.data.labels[e])}});var b=t._model;this.removeHoverStyle(t),n&&l.animateRotate||(b.startAngle=0===e?s.rotation:a.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),a=0;return i.each(n.data,(function(n,o){t=e.data[o],isNaN(t)||n.hidden||(a+=Math.abs(t))})),a},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,a=0,o=this.index,i=t.length,r=0;r(a=e>a?e:a)?n:a;return a}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return i.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:o.Line,dataElementType:o.Point,update:function(t){var n,a,o,r=this,s=r.getMeta(),l=s.dataset,u=s.data||[],c=r.chart.options,d=c.elements.line,h=r.getScaleForId(s.yAxisID),f=r.getDataset(),p=e(f,c);for(p&&(o=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=r.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:c.spanGaps,tension:o.tension?o.tension:i.valueOrDefault(f.lineTension,d.tension),backgroundColor:o.backgroundColor?o.backgroundColor:f.backgroundColor||d.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:f.borderWidth||d.borderWidth,borderColor:o.borderColor?o.borderColor:f.borderColor||d.borderColor,borderCapStyle:o.borderCapStyle?o.borderCapStyle:f.borderCapStyle||d.borderCapStyle,borderDash:o.borderDash?o.borderDash:f.borderDash||d.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:f.borderDashOffset||d.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:f.borderJoinStyle||d.borderJoinStyle,fill:o.fill?o.fill:void 0!==f.fill?f.fill:d.fill,steppedLine:o.steppedLine?o.steppedLine:i.valueOrDefault(f.steppedLine,d.stepped),cubicInterpolationMode:o.cubicInterpolationMode?o.cubicInterpolationMode:i.valueOrDefault(f.cubicInterpolationMode,d.cubicInterpolationMode)},l.pivot()),n=0,a=u.length;n');var n=t.data,a=n.datasets,o=n.labels;if(a.length)for(var i=0;i'),o[i]&&e.push(o[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var o=t.getDatasetMeta(0),r=e.datasets[0],s=o.data[a].custom||{},l=i.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:l(r.backgroundColor,a,u.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(r.borderColor,a,u.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(r.borderWidth,a,u.borderWidth),hidden:isNaN(r.data[a])||o.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,o,i=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:o.Line,dataElementType:o.Point,linkScales:i.noop,update:function(t){var e=this,n=e.getMeta(),a=n.dataset,o=n.data,r=a.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,u=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:o,_loop:!0,_model:{tension:r.tension?r.tension:i.valueOrDefault(s.lineTension,l.tension),backgroundColor:r.backgroundColor?r.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:s.borderWidth||l.borderWidth,borderColor:r.borderColor?r.borderColor:s.borderColor||l.borderColor,fill:r.fill?r.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:r.borderDash?r.borderDash:s.borderDash||l.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),n.dataset.pivot(),i.each(o,(function(n,a){e.updateElement(n,a,t)}),e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var a=this,o=t.custom||{},r=a.getDataset(),s=a.chart.scale,l=a.chart.options.elements.point,u=s.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),i.extend(t,{_datasetIndex:a.index,_index:e,_scale:s,_model:{x:n?s.xCenter:u.x,y:n?s.yCenter:u.y,tension:o.tension?o.tension:i.valueOrDefault(r.lineTension,a.chart.options.elements.line.tension),radius:o.radius?o.radius:i.valueAtIndexOrDefault(r.pointRadius,e,l.radius),backgroundColor:o.backgroundColor?o.backgroundColor:i.valueAtIndexOrDefault(r.pointBackgroundColor,e,l.backgroundColor),borderColor:o.borderColor?o.borderColor:i.valueAtIndexOrDefault(r.pointBorderColor,e,l.borderColor),borderWidth:o.borderWidth?o.borderWidth:i.valueAtIndexOrDefault(r.pointBorderWidth,e,l.borderWidth),pointStyle:o.pointStyle?o.pointStyle:i.valueAtIndexOrDefault(r.pointStyle,e,l.pointStyle),hitRadius:o.hitRadius?o.hitRadius:i.valueAtIndexOrDefault(r.pointHitRadius,e,l.hitRadius)}}),t._model.skip=o.skip?o.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();i.each(e.data,(function(n,a){var o=n._model,r=i.splineCurve(i.previousItem(e.data,a,!0)._model,o,i.nextItem(e.data,a,!0)._model,o.tension);o.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),o.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),o.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),o.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),n.pivot()}))},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},a=t._index,o=t._model;o.radius=n.hoverRadius?n.hoverRadius:i.valueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),o.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:i.valueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.getHoverColor(o.backgroundColor)),o.borderColor=n.hoverBorderColor?n.hoverBorderColor:i.valueAtIndexOrDefault(e.pointHoverBorderColor,a,i.getHoverColor(o.borderColor)),o.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:i.valueAtIndexOrDefault(e.pointHoverBorderWidth,a,o.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},a=t._index,o=t._model,r=this.chart.options.elements.point;o.radius=n.radius?n.radius:i.valueAtIndexOrDefault(e.pointRadius,a,r.radius),o.backgroundColor=n.backgroundColor?n.backgroundColor:i.valueAtIndexOrDefault(e.pointBackgroundColor,a,r.backgroundColor),o.borderColor=n.borderColor?n.borderColor:i.valueAtIndexOrDefault(e.pointBorderColor,a,r.borderColor),o.borderWidth=n.borderWidth?n.borderWidth:i.valueAtIndexOrDefault(e.pointBorderWidth,a,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:i.noop,onComplete:i.noop}}),e.exports=function(t){t.Animation=o.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,a){var o,i,r=this.animations;for(e.chart=t,a||(t.animating=!0),o=0,i=r.length;o1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var a=Date.now();t.dropFrames+=(a-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,a=this.animations,o=0;o=e.numSteps?(i.callback(e.onAnimationComplete,[e],n),n.animating=!1,a.splice(o,1)):++o}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var a=t(25),o=t(45),i=t(28),r=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=o.configMerge(a.global,a[t.type],t.options||{}),t}function n(t){return"top"===t||"bottom"===t}var s=t.plugins;t.types={},t.instances={},t.controllers={},o.extend(t.prototype,{construct:function(n,a){var i=this;a=e(a);var s=r.acquireContext(n,a),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;i.id=o.uid(),i.ctx=s,i.canvas=l,i.config=a,i.width=c,i.height=u,i.aspectRatio=u?c/u:null,i.options=a.options,i._bufferedRender=!1,i.chart=i,i.controller=i,t.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),s&&l?(i.initialize(),i.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return s.notify(t,"beforeInit"),o.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),s.notify(t,"afterInit"),t},clear:function(){return o.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,a=e.canvas,i=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(o.getMaximumWidth(a))),l=Math.max(0,Math.floor(i?r/i:o.getMaximumHeight(a)));if((e.width!==r||e.height!==l)&&(a.width=e.width=r,a.height=e.height=l,a.style.width=r+"px",a.style.height=l+"px",o.retinaScale(e,n.devicePixelRatio),!t)){var u={width:r,height:l};s.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;o.each(e.xAxes,(function(t,e){t.id=t.id||"x-axis-"+e})),o.each(e.yAxes,(function(t,e){t.id=t.id||"y-axis-"+e})),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,a=e.options,i=e.scales={},r=[];a.scales&&(r=r.concat((a.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(a.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),a.scale&&r.push({options:a.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),o.each(r,(function(a){var r=a.options,s=o.valueOrDefault(r.type,a.dtype),l=t.scaleService.getScaleConstructor(s);if(l){n(r.position)!==n(a.dposition)&&(r.position=a.dposition);var u=new l({id:r.id,options:r,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),a.isDefault&&(e.scale=u)}})),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],a=[];return o.each(e.data.datasets,(function(o,i){var r=e.getDatasetMeta(i),s=o.type||e.config.type;if(r.type&&r.type!==s&&(e.destroyDatasetMeta(i),r=e.getDatasetMeta(i)),r.type=s,n.push(r.type),r.controller)r.controller.updateIndex(i);else{var l=t.controllers[r.type];if(void 0===l)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new l(e,i),a.push(r.controller)}}),e),a},resetElements:function(){var t=this;o.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==l(t)||(t={duration:t,lazy:arguments[1]}),function(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach((function(e){t.scales[e.id].options=e})),t.tooltip._options=e.tooltips}(e),!1!==s.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var n=e.buildOrUpdateControllers();o.each(e.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()}),e),e.updateLayout(),o.each(n,(function(t){t.reset()})),e.updateDatasets(),s.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==s.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),s.notify(e,"afterScaleUpdate"),s.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==s.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);s.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,a=n.getDatasetMeta(t),o={meta:a,index:t,easingValue:e};!1!==s.notify(n,"beforeDatasetDraw",[o])&&(a.controller.draw(e),s.notify(n,"afterDatasetDraw",[o]))},getElementAtEvent:function(t){return i.modes.single(this,t)},getElementsAtEvent:function(t){return i.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return i.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var a=i.modes[e];return"function"==typeof a?a(this,t,n):[]},getDatasetAtEvent:function(t){return i.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var a=n._meta[e.id];return a||(a=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),a},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e0||(o.forEach((function(e){delete t[e]})),delete t._chartjs)}}var o=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},a.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,a=n.getMeta(),o=n.getDataset().data||[],i=a.data;for(t=0,e=o.length;ta&&t.insertElements(a,o-a)},insertElements:function(t,e){for(var n=0;n=n[e].length&&n[e].push({}),!n[e][r].type||l.type&&l.type!==n[e][r].type?i.merge(n[e][r],[t.scaleService.getScaleDefaults(s),l]):i.merge(n[e][r],l)}else i._merger(e,n,a,o)}})},i.where=function(t,e){if(i.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return i.each(t,(function(t){e(t)&&n.push(t)})),n},i.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var a=0,o=t.length;a=0;a--){var o=t[a];if(e(o))return o}},i.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=e.prototype,n.prototype=new a,n.extend=i.inherits,t&&i.extend(n.prototype,t),n.__super__=e.prototype,n},i.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.almostEquals=function(t,e,n){return Math.abs(t-e)t},i.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},i.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},i.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},i.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},i.toRadians=function(t){return t*(Math.PI/180)},i.toDegrees=function(t){return t*(180/Math.PI)},i.getAngleFromPoint=function(t,e){var n=e.x-t.x,a=e.y-t.y,o=Math.sqrt(n*n+a*a),i=Math.atan2(a,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:o}},i.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},i.aliasPixel=function(t){return t%2==0?0:.5},i.splineCurve=function(t,e,n,a){var o=t.skip?e:t,i=e,r=n.skip?e:n,s=Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)),l=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),u=s/(s+l),c=l/(s+l),d=a*(u=isNaN(u)?0:u),h=a*(c=isNaN(c)?0:c);return{previous:{x:i.x-d*(r.x-o.x),y:i.y-d*(r.y-o.y)},next:{x:i.x+h*(r.x-o.x),y:i.y+h*(r.y-o.y)}}},i.EPSILON=Number.EPSILON||1e-14,i.splineCurveMonotone=function(t){var e,n,a,o,r,s,l,u,c,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(o=e0?d[e-1]:null,o=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},i.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},i.niceNum=function(t,e){var n=Math.floor(i.log10(t)),a=t/Math.pow(10,n);return(e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*Math.pow(10,n)},i.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},i.getRelativePosition=function(t,e){var n,a,o=t.originalEvent||t,r=t.currentTarget||t.srcElement,s=r.getBoundingClientRect(),l=o.touches;l&&l.length>0?(n=l[0].clientX,a=l[0].clientY):(n=o.clientX,a=o.clientY);var u=parseFloat(i.getStyle(r,"padding-left")),c=parseFloat(i.getStyle(r,"padding-top")),d=parseFloat(i.getStyle(r,"padding-right")),h=parseFloat(i.getStyle(r,"padding-bottom")),f=s.right-s.left-u-d,p=s.bottom-s.top-c-h;return{x:n=Math.round((n-s.left-u)/f*r.width/e.currentDevicePixelRatio),y:a=Math.round((a-s.top-c)/p*r.height/e.currentDevicePixelRatio)}},i.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},i.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},i.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(i.getStyle(e,"padding-left"),10),a=parseInt(i.getStyle(e,"padding-right"),10),o=e.clientWidth-n-a,r=i.getConstraintWidth(t);return isNaN(r)?o:Math.min(o,r)},i.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(i.getStyle(e,"padding-top"),10),a=parseInt(i.getStyle(e,"padding-bottom"),10),o=e.clientHeight-n-a,r=i.getConstraintHeight(t);return isNaN(r)?o:Math.min(o,r)},i.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},i.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var a=t.canvas,o=t.height,i=t.width;a.height=o*n,a.width=i*n,t.ctx.scale(n,n),a.style.height=o+"px",a.style.width=i+"px"}},i.fontString=function(t,e,n){return e+" "+t+"px "+n},i.longestText=function(t,e,n,a){var o=(a=a||{}).data=a.data||{},r=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(o=a.data={},r=a.garbageCollect=[],a.font=e),t.font=e;var s=0;i.each(n,(function(e){null!=e&&!0!==i.isArray(e)?s=i.measureText(t,o,r,s,e):i.isArray(e)&&i.each(e,(function(e){null==e||i.isArray(e)||(s=i.measureText(t,o,r,s,e))}))}));var l=r.length/2;if(l>n.length){for(var u=0;ua&&(a=i),a},i.numberOfLabelLines=function(t){var e=1;return i.each(t,(function(t){i.isArray(t)&&t.length>e&&(e=t.length)})),e},i.color=a?function(t){return t instanceof CanvasGradient&&(t=o.global.defaultColor),a(t)}:function(t){return console.error("Color.js not found!"),t},i.getHoverColor=function(t){return t instanceof CanvasPattern?t:i.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,n){"use strict";function a(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function o(t,e){var n,a,o,i,r;for(a=0,i=t.data.datasets.length;a0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return l(t,e,{intersect:!0})},point:function(t,e){return i(t,a(e,t))},nearest:function(t,e,n){var o=a(e,t);n.axis=n.axis||"xy";var i=s(n.axis),l=r(t,o,n.intersect,i);return l.length>1&&l.sort((function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n})),l.slice(0,1)},x:function(t,e,n){var i=a(e,t),r=[],s=!1;return o(t,(function(t){t.inXRange(i.x)&&r.push(t),t.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r},y:function(t,e,n){var i=a(e,t),r=[],s=!1;return o(t,(function(t){t.inYRange(i.y)&&r.push(t),t.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var a=t(45);e.exports=function(t){function e(t,e){return a.where(t,(function(t){return t.position===e}))}function n(t,e){t.forEach((function(t,e){return t._tmpIndex_=e,t})),t.sort((function(t,n){var a=e?n:t,o=e?t:n;return a.weight===o.weight?a._tmpIndex_-o._tmpIndex_:a.weight-o.weight})),t.forEach((function(t){delete t._tmpIndex_}))}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var a,o=["fullWidth","position","weight"],i=o.length,r=0;rh&&lt.maxHeight){l--;break}l++,d=u*c}t.labelRotation=l},afterCalculateTickRotation:function(){s.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){s.callback(this.options.beforeFit,[this])},fit:function(){var t=this,o=t.minSize={width:0,height:0},i=a(t._ticks),r=t.options,u=r.ticks,c=r.scaleLabel,d=r.gridLines,h=r.display,f=t.isHorizontal(),p=n(u),g=r.gridLines.tickMarkLength;if(o.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&d.drawTicks?g:0,o.height=f?h&&d.drawTicks?g:0:t.maxHeight,c.display&&h){var v=l(c)+s.options.toPadding(c.padding).height;f?o.height+=v:o.width+=v}if(u.display&&h){var m=s.longestText(t.ctx,p.font,i,t.longestTextCache),b=s.numberOfLabelLines(i),x=.5*p.size,y=t.options.ticks.padding;if(f){t.longestLabelWidth=m;var k=s.toRadians(t.labelRotation),w=Math.cos(k),C=Math.sin(k)*m+p.size*b+x*(b-1)+x;o.height=Math.min(t.maxHeight,o.height+C+y),t.ctx.font=p.font;var S=e(t.ctx,i[0],p.font),M=e(t.ctx,i[i.length-1],p.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?w*S+3:w*x+3,t.paddingRight="bottom"===r.position?w*x+3:w*M+3):(t.paddingLeft=S/2+3,t.paddingRight=M/2+3)}else u.mirror?m=0:m+=y+x,o.width=Math.min(t.maxWidth,o.width+m),t.paddingTop=p.size/2,t.paddingBottom=p.size/2}t.handleMargins(),t.width=o.width,t.height=o.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){s.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(s.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:s.noop,getPixelForValue:s.noop,getValueForPixel:s.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var a=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),o=a*t+e.paddingLeft;return n&&(o+=a/2),e.left+Math.round(o)+(e.isFullWidth()?e.margins.left:0)}var i=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(i/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft;return e.left+Math.round(n)+(e.isFullWidth()?e.margins.left:0)}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,a,o,i=this,r=i.isHorizontal(),l=i.options.ticks.minor,u=t.length,c=s.toRadians(i.labelRotation),d=Math.cos(c),h=i.longestLabelWidth*d,f=[];for(l.maxTicksLimit&&(o=l.maxTicksLimit),r&&(e=!1,(h+l.autoSkipPadding)*u>i.width-(i.paddingLeft+i.paddingRight)&&(e=1+Math.floor((h+l.autoSkipPadding)*u/(i.width-(i.paddingLeft+i.paddingRight)))),o&&u>o&&(e=Math.max(e,Math.floor(u/o)))),n=0;n1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1||s.isNullOrUndef(a.label))&&delete a.label,f.push(a);return f},draw:function(t){var e=this,a=e.options;if(a.display){var r=e.ctx,u=i.global,c=a.ticks.minor,d=a.ticks.major||c,h=a.gridLines,f=a.scaleLabel,p=0!==e.labelRotation,g=e.isHorizontal(),v=c.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),m=s.valueOrDefault(c.fontColor,u.defaultFontColor),b=n(c),x=s.valueOrDefault(d.fontColor,u.defaultFontColor),y=n(d),k=h.drawTicks?h.tickMarkLength:0,w=s.valueOrDefault(f.fontColor,u.defaultFontColor),C=n(f),S=s.options.toPadding(f.padding),M=s.toRadians(e.labelRotation),_=[],I="right"===a.position?e.left:e.right-k,D="right"===a.position?e.left+k:e.right,P="bottom"===a.position?e.top:e.bottom-k,A="bottom"===a.position?e.top+k:e.bottom;if(s.each(v,(function(n,i){if(void 0!==n.label){var r,l,d,f,m=n.label;i===e.zeroLineIndex&&a.offset===h.offsetGridLines?(r=h.zeroLineWidth,l=h.zeroLineColor,d=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(r=s.valueAtIndexOrDefault(h.lineWidth,i),l=s.valueAtIndexOrDefault(h.color,i),d=s.valueOrDefault(h.borderDash,u.borderDash),f=s.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var b,x,y,w,C,S,T,L,F,$,O="middle",z="middle",R=c.padding;if(g){var j=k+R;"bottom"===a.position?(z=p?"middle":"top",O=p?"right":"center",$=e.top+j):(z=p?"middle":"bottom",O=p?"left":"center",$=e.bottom-j);var B=o(e,i,h.offsetGridLines&&v.length>1);B1);E0)n=t.stepSize;else{var i=a.niceNum(e.max-e.min,!1);n=a.niceNum(i/(t.maxTicks-1),!0)}var r=Math.floor(e.min/n)*n,s=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&a.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(r=t.min,s=t.max);var l=(s-r)/n;l=a.almostEquals(l,Math.round(l),n/1e3)?Math.round(l):Math.ceil(l),o.push(void 0!==t.min?t.min:r);for(var u=1;u3?n[2]-n[1]:n[1]-n[0];Math.abs(o)>1&&t!==Math.floor(t)&&(o=t-Math.floor(t));var i=a.log10(Math.abs(o)),r="";if(0!==t){var s=-1*Math.floor(i);s=Math.max(Math.min(s,20),0),r=t.toFixed(s)}else r="0";return r},logarithmic:function(t,e,n){var o=t/Math.pow(10,Math.floor(a.log10(t)));return 0===t?"0":1===o||2===o||5===o||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:i.noop,title:function(t,e){var n="",a=e.labels,o=a?a.length:0;if(t.length>0){var i=t[0];i.xLabel?n=i.xLabel:o>0&&i.indexa.height-e.height&&(r="bottom");var s,l,u,c,d,h=(o.left+o.right)/2,f=(o.top+o.bottom)/2;"center"===r?(s=function(t){return t<=h},l=function(t){return t>h}):(s=function(t){return t<=e.width/2},l=function(t){return t>=a.width-e.width/2}),u=function(t){return t+e.width>a.width},c=function(t){return t-e.width<0},d=function(t){return t<=f?"top":"bottom"},s(n.x)?(i="left",u(n.x)&&(i="center",r=d(n.y))):l(n.x)&&(i="right",c(n.x)&&(i="center",r=d(n.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:i,yAlign:p.yAlign?p.yAlign:r}}(this,g))}else c.opacity=0;return c.xAlign=f.xAlign,c.yAlign=f.yAlign,c.x=p.x,c.y=p.y,c.width=g.width,c.height=g.height,c.caretX=v.x,c.caretY=v.y,o._model=c,e&&l.custom&&l.custom.call(o,c),o},drawCaret:function(t,e){var n=this._chart.ctx,a=this._view,o=this.getCaretPosition(t,e,a);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)},getCaretPosition:function(t,e,n){var a,o,i,r,s,l,u=n.caretSize,c=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=t.x,p=t.y,g=e.width,v=e.height;if("center"===h)s=p+v/2,"left"===d?(o=(a=f)-u,i=a,r=s+u,l=s-u):(o=(a=f+g)+u,i=a,r=s-u,l=s+u);else if("left"===d?(a=(o=f+c+u)-u,i=o+u):"right"===d?(a=(o=f+g-c-u)-u,i=o+u):(a=(o=f+g/2)-u,i=o+u),"top"===h)s=(r=p)-u,l=r;else{s=(r=p+v)+u,l=r;var m=i;i=a,a=m}return{x1:a,x2:o,x3:i,y1:r,y2:s,y3:l}},drawTitle:function(t,n,a,o){var r=n.title;if(r.length){a.textAlign=n._titleAlign,a.textBaseline="top";var s,l,u=n.titleFontSize,c=n.titleSpacing;for(a.fillStyle=e(n.titleFontColor,o),a.font=i.fontString(u,n._titleFontStyle,n._titleFontFamily),s=0,l=r.length;s0&&a.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},a={x:e.x,y:e.y},o=Math.abs(e.opacity<.001)?0:e.opacity,i=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&i&&(this.drawBackground(a,e,t,n,o),a.x+=e.xPadding,a.y+=e.yPadding,this.drawTitle(a,e,t,o),this.drawBody(a,e,t,o),this.drawFooter(a,e,t,o))}},handleEvent:function(t){var e=this,n=e._options,a=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(a=!i.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var o=e._model;e.update(!0),e.pivot(),a|=o.x!==e._model.x||o.y!==e._model.y}return a}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,a=0,o=0,i=0;for(e=0,n=t.length;el;)o-=2*Math.PI;for(;o=s&&o<=l,c=r>=n.innerRadius&&r<=n.outerRadius;return u&&c}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,a=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,a),t.arc(e.x,e.y,e.innerRadius,a,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45),r=a.global;a._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=o.extend({draw:function(){var t,e,n,a,o=this,s=o._view,l=o._chart.ctx,u=s.spanGaps,c=o._children.slice(),d=r.elements.line,h=-1;for(o._loop&&c.length&&c.push(c[0]),l.save(),l.lineCap=s.borderCapStyle||d.borderCapStyle,l.setLineDash&&l.setLineDash(s.borderDash||d.borderDash),l.lineDashOffset=s.borderDashOffset||d.borderDashOffset,l.lineJoin=s.borderJoinStyle||d.borderJoinStyle,l.lineWidth=s.borderWidth||d.borderWidth,l.strokeStyle=s.borderColor||r.defaultColor,l.beginPath(),h=-1,t=0;te?1:-1,r=1,s=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,a=u.y,i=1,r=(o=u.base)>a?1:-1,s=u.borderSkipped||"bottom"),c){var d=Math.min(Math.abs(e-n),Math.abs(a-o)),h=(c=c>d?d:c)/2,f=e+("left"!==s?h*i:0),p=n+("right"!==s?-h*i:0),g=a+("top"!==s?h*r:0),v=o+("bottom"!==s?-h*r:0);f!==p&&(a=g,o=v),g!==v&&(e=f,n=p)}l.beginPath(),l.fillStyle=u.backgroundColor,l.strokeStyle=u.borderColor,l.lineWidth=c;var m=[[e,o],[e,a],[n,a],[n,o]],b=["bottom","left","top","right"].indexOf(s,0);-1===b&&(b=0);var x=t(0);l.moveTo(x[0],x[1]);for(var y=1;y<4;y++)x=t(y),l.lineTo(x[0],x[1]);l.fill(),c&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var a=o(this);n=t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var i=o(n);return a(n)?t>=i.left&&t<=i.right:e>=i.top&&e<=i.bottom},inXRange:function(t){var e=o(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=o(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return a(this)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var a=t(42);n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,a,o,i){if(i){var r=Math.min(i,a/2),s=Math.min(i,o/2);t.moveTo(e+r,n),t.lineTo(e+a-r,n),t.quadraticCurveTo(e+a,n,e+a,n+s),t.lineTo(e+a,n+o-s),t.quadraticCurveTo(e+a,n+o,e+a-r,n+o),t.lineTo(e+r,n+o),t.quadraticCurveTo(e,n+o,e,n+o-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+r,n)}else t.rect(e,n,a,o)},drawPoint:function(t,e,n,a,o){var i,r,s,u,c,d;if("object"!=l(e)||"[object HTMLImageElement]"!==(i=e.toString())&&"[object HTMLCanvasElement]"!==i){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(a,o,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),c=(r=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(a-r/2,o+c/3),t.lineTo(a+r/2,o+c/3),t.lineTo(a,o-2*c/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(a-d,o-d,2*d,2*d),t.strokeRect(a-d,o-d,2*d,2*d);break;case"rectRounded":var h=n/Math.SQRT2,f=a-h,p=o-h,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,f,p,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(a-d,o),t.lineTo(a,o+d),t.lineTo(a+d,o),t.lineTo(a,o-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(a,o+n),t.lineTo(a,o-n),t.moveTo(a-n,o),t.lineTo(a+n,o),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(a-s,o-u),t.lineTo(a+s,o+u),t.moveTo(a-s,o+u),t.lineTo(a+s,o-u),t.closePath();break;case"star":t.beginPath(),t.moveTo(a,o+n),t.lineTo(a,o-n),t.moveTo(a-n,o),t.lineTo(a+n,o),s=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(a-s,o-u),t.lineTo(a+s,o+u),t.moveTo(a-s,o+u),t.lineTo(a+s,o-u),t.closePath();break;case"line":t.beginPath(),t.moveTo(a-n,o),t.lineTo(a+n,o),t.closePath();break;case"dash":t.beginPath(),t.moveTo(a,o),t.lineTo(a+n,o),t.closePath()}t.stroke()}}else t.drawImage(e,a-e.width/2,o-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,a){if(n.steppedLine)return"after"===n.steppedLine&&!a||"after"!==n.steppedLine&&a?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(a?e.controlPointPreviousX:e.controlPointNextX,a?e.controlPointPreviousY:e.controlPointNextY,a?n.controlPointNextX:n.controlPointPreviousX,a?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},a.clear=n.clear,a.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var a={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null==t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return a.valueOrDefault(a.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,o){var i,r,s;if(a.isArray(t))if(r=t.length,o)for(i=r-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-o.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*o.easeInBounce(2*t):.5*o.easeOutBounce(2*t-1)+.5}};e.exports={effects:o},a.easingEffects=o},{42:42}],44:[function(t,e,n){"use strict";var a=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,o,i;return a.isObject(t)?(e=+t.top||0,n=+t.right||0,o=+t.bottom||0,i=+t.left||0):e=n=o=i=+t||0,{top:e,right:n,bottom:o,left:i,height:e+o,width:i+n}},resolve:function(t,e,n){var o,i,r;for(o=0,i=t.length;o
    ';var i=e.childNodes[0],r=e.childNodes[1];e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var s=function(){e._reset(),t()};return o(i,"scroll",s.bind(i,"expand")),o(r,"scroll",s.bind(r,"shrink")),e}(function(t,e){var n=!1,a=[];return function(){a=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,u.requestAnimFrame.call(window,(function(){n=!1,t.apply(e,a)})))}}((function(){if(a.resizer)return e(r("resize",n))})));!function(t,e){var n=(t[c]||(t[c]={})).renderProxy=function(t){t.animationName===f&&e()};u.each(p,(function(e){o(t,e,n)})),t.classList.add(h)}(t,(function(){if(a.resizer){var e=t.parentNode;e&&e!==i.parentNode&&e.insertBefore(i,e.firstChild),i._reset()}}))}function l(t){var e=t[c]||{},n=e.resizer;delete e.resizer,function(t){var e=t[c]||{},n=e.renderProxy;n&&(u.each(p,(function(e){i(t,e,n)})),delete e.renderProxy),t.classList.remove(h)}(t),n&&n.parentNode&&n.parentNode.removeChild(n)}var u=t(45),c="$chartjs",d="chartjs-",h=d+"render-monitor",f=d+"render-animation",p=["animationstart","webkitAnimationStart"],g={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},v=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";!function(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}(this,"@-webkit-keyframes "+f+"{"+t+"}@keyframes "+f+"{"+t+"}."+h+"{-webkit-animation:"+f+" 0.001s;animation:"+f+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){var n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[c]={initial:{height:o,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===i||""===i){var r=a(t,"width");void 0!==r&&(t.width=r)}if(null===o||""===o)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=a(t,"height");void 0!==r&&(t.height=s)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[c]){var n=e[c].initial;["height","width"].forEach((function(t){var a=n[t];u.isNullOrUndef(a)?e.removeAttribute(t):e.setAttribute(t,a)})),u.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e[c]}},addEventListener:function(t,e,n){var a=t.canvas;if("resize"!==e){var i=n[c]||(n[c]={});o(a,e,(i.proxies||(i.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=g[t.type]||t.type,a=u.getRelativePosition(t,e);return r(n,e,a.x,a.y,t)}(e,t))})}else s(a,n,t)},removeEventListener:function(t,e,n){var a=t.canvas;if("resize"!==e){var o=((n[c]||{}).proxies||{})[t.id+"_"+e];o&&i(a,e,o)}else l(a)}},u.addEvent=o,u.removeEvent=i},{45:45}],48:[function(t,e,n){"use strict";var a=t(45),o=t(46),i=t(47),r=i._enabled?i:o;e.exports=a.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var a=t(25),o=t(40),i=t(45);a._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var a,o=t._model||{},i=o.fill;if(void 0===i&&(i=!!o.backgroundColor),!1===i||null===i)return!1;if(!0===i)return"origin";if(a=parseFloat(i,10),isFinite(a)&&Math.floor(a)===a)return"-"!==i[0]&&"+"!==i[0]||(a=e+a),!(a===e||a<0||a>=n)&&a;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function e(t){var e,n=t.el._model||{},a=t.el._scale||{},o=t.fill,i=null;if(isFinite(o))return null;if("start"===o?i=void 0===n.scaleBottom?a.bottom:n.scaleBottom:"end"===o?i=void 0===n.scaleTop?a.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:a.getBasePosition?i=a.getBasePosition():a.getBasePixel&&(i=a.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if("number"==typeof i&&isFinite(i))return{x:(e=a.isHorizontal())?i:null,y:e?null:i}}return null}function n(t,e,n){var a,o=t[e].fill,i=[e];if(!n)return o;for(;!1!==o&&-1===i.indexOf(o);){if(!isFinite(o))return o;if(!(a=t[o]))return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function r(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),c[n](t))}function s(t){return t&&!t.skip}function l(t,e,n,a,o){var r;if(a&&o){for(t.moveTo(e[0].x,e[0].y),r=1;r0;--r)i.canvas.lineTo(t,n[r],n[r-1],!0)}}function u(t,e,n,a,o,i){var r,u,c,d,h,f,p,g=e.length,v=a.spanGaps,m=[],b=[],x=0,y=0;for(t.beginPath(),r=0,u=g+!!i;r');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push(""),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var a=new t.Legend({ctx:e.ctx,options:n,chart:e});r.configure(e,a,n),r.addBox(e,a),e.legend=a}var r=t.layoutService,s=i.noop;return t.Legend=o.extend({initialize:function(t){i.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:s,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:s,beforeSetDimensions:s,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:s,beforeBuildLabels:s,buildLabels:function(){var t=this,e=t.options.labels||{},n=i.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:s,beforeFit:s,fit:function(){var t=this,n=t.options,o=n.labels,r=n.display,s=t.ctx,l=a.global,u=i.valueOrDefault,c=u(o.fontSize,l.defaultFontSize),d=u(o.fontStyle,l.defaultFontStyle),h=u(o.fontFamily,l.defaultFontFamily),f=i.fontString(c,d,h),p=t.legendHitBoxes=[],g=t.minSize,v=t.isHorizontal();if(v?(g.width=t.maxWidth,g.height=r?10:0):(g.width=r?10:0,g.height=t.maxHeight),r)if(s.font=f,v){var m=t.lineWidths=[0],b=t.legendItems.length?c+o.padding:0;s.textAlign="left",s.textBaseline="top",i.each(t.legendItems,(function(n,a){var i=e(o,c)+c/2+s.measureText(n.text).width;m[m.length-1]+i+o.padding>=t.width&&(b+=c+o.padding,m[m.length]=t.left),p[a]={left:0,top:0,width:i,height:c},m[m.length-1]+=i+o.padding})),g.height+=b}else{var x=o.padding,y=t.columnWidths=[],k=o.padding,w=0,C=0,S=c+x;i.each(t.legendItems,(function(t,n){var a=e(o,c)+c/2+s.measureText(t.text).width;C+S>g.height&&(k+=w+o.padding,y.push(w),w=0,C=0),w=Math.max(w,a),C+=S,p[n]={left:0,top:0,width:a,height:c}})),k+=w,y.push(w),g.width+=k}t.width=g.width,t.height=g.height},afterFit:s,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,o=n.labels,r=a.global,s=r.elements.line,l=t.width,u=t.lineWidths;if(n.display){var c,d=t.ctx,h=i.valueOrDefault,f=h(o.fontColor,r.defaultFontColor),p=h(o.fontSize,r.defaultFontSize),g=h(o.fontStyle,r.defaultFontStyle),v=h(o.fontFamily,r.defaultFontFamily),m=i.fontString(p,g,v);d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=f,d.fillStyle=f,d.font=m;var b=e(o,p),x=t.legendHitBoxes,y=function(t,e,a){if(!(isNaN(b)||b<=0)){d.save(),d.fillStyle=h(a.fillStyle,r.defaultColor),d.lineCap=h(a.lineCap,s.borderCapStyle),d.lineDashOffset=h(a.lineDashOffset,s.borderDashOffset),d.lineJoin=h(a.lineJoin,s.borderJoinStyle),d.lineWidth=h(a.lineWidth,s.borderWidth),d.strokeStyle=h(a.strokeStyle,r.defaultColor);var o=0===h(a.lineWidth,s.borderWidth);if(d.setLineDash&&d.setLineDash(h(a.lineDash,s.borderDash)),n.labels&&n.labels.usePointStyle){var l=p*Math.SQRT2/2,u=l/Math.SQRT2,c=t+u,f=e+u;i.canvas.drawPoint(d,a.pointStyle,l,c,f)}else o||d.strokeRect(t,e,b,p),d.fillRect(t,e,b,p);d.restore()}},k=t.isHorizontal();c=k?{x:t.left+(l-u[0])/2,y:t.top+o.padding,line:0}:{x:t.left+o.padding,y:t.top+o.padding,line:0};var w=p+o.padding;i.each(t.legendItems,(function(e,n){var a=d.measureText(e.text).width,i=b+p/2+a,r=c.x,s=c.y;k?r+i>=l&&(s=c.y+=w,c.line++,r=c.x=t.left+(l-u[c.line])/2):s+w>t.bottom&&(r=c.x=r+t.columnWidths[c.line]+o.padding,s=c.y=t.top+o.padding,c.line++),y(r,s,e),x[n].left=r,x[n].top=s,function(t,e,n,a){var o=p/2,i=b+o+t,r=e+o;d.fillText(n.text,i,r),n.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(i,r),d.lineTo(i+a,r),d.stroke())}(r,s,e,a),k?c.x+=i+o.padding:c.y+=w}))}},handleEvent:function(t){var e=this,n=e.options,a="mouseup"===t.type?"click":t.type,o=!1;if("mousemove"===a){if(!n.onHover)return}else{if("click"!==a)return;if(!n.onClick)return}var i=t.x,r=t.y;if(i>=e.left&&i<=e.right&&r>=e.top&&r<=e.bottom)for(var s=e.legendHitBoxes,l=0;l=u.left&&i<=u.left+u.width&&r>=u.top&&r<=u.top+u.height){if("click"===a){n.onClick.call(e,t.native,e.legendItems[l]),o=!0;break}if("mousemove"===a){n.onHover.call(e,t.native,e.legendItems[l]),o=!0;break}}}return o}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,o=t.legend;e?(i.mergeIf(e,a.global.legend),o?(r.configure(t,o,e),o.options=e):n(t,e)):o&&(r.removeBox(t,o),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var a=t(25),o=t(26),i=t(45);a._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,a){var o=new t.Title({ctx:e.ctx,options:a,chart:e});n.configure(e,o,a),n.addBox(e,o),e.titleBlock=o}var n=t.layoutService,r=i.noop;return t.Title=o.extend({initialize:function(t){i.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:r,beforeSetDimensions:r,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=this,e=i.valueOrDefault,n=t.options,o=n.display,r=e(n.fontSize,a.global.defaultFontSize),s=t.minSize,l=i.isArray(n.text)?n.text.length:1,u=i.options.toLineHeight(n.lineHeight,r),c=o?l*u+2*n.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=c):(s.width=c,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=i.valueOrDefault,o=t.options,r=a.global;if(o.display){var s,l,u,c=n(o.fontSize,r.defaultFontSize),d=n(o.fontStyle,r.defaultFontStyle),h=n(o.fontFamily,r.defaultFontFamily),f=i.fontString(c,d,h),p=i.options.toLineHeight(o.lineHeight,c),g=p/2+o.padding,v=0,m=t.top,b=t.left,x=t.bottom,y=t.right;e.fillStyle=n(o.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(l=b+(y-b)/2,u=m+g,s=y-b):(l="left"===o.position?b+g:y-g,u=m+(x-m)/2,s=x-m,v=Math.PI*("left"===o.position?-.5:.5)),e.save(),e.translate(l,u),e.rotate(v),e.textAlign="center",e.textBaseline="middle";var k=o.text;if(i.isArray(k))for(var w=0,C=0;Ce.max)&&(e.max=a))}))}));e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var i=o.valueOrDefault(n.fontSize,a.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*i)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,a=n.start,o=+n.getRightValue(t),i=n.end-a;return n.isHorizontal()?(e=n.left+n.width/i*(o-a),Math.round(e)):(e=n.bottom-n.height/i*(o-a),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),a=n?e.width:e.height,o=(n?t-e.left:e.bottom-t)/a;return e.start+(e.end-e.start)*o},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var a=t(45),o=t(34);e.exports=function(t){var e=a.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=a.sign(t.min),o=a.sign(t.max);n<0&&o<0?t.max=0:n>0&&o>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==r&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:a.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=o.generators.linear(i,t);t.handleDirectionalChanges(),t.max=a.max(r),t.min=a.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var a=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return l?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,o=n.ticks,i=e.chart,r=i.data.datasets,s=a.valueOrDefault,l=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&a.each(r,(function(e,n){if(!u){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&t(a)&&void 0!==a.stack&&(u=!0)}})),n.stacked||u){var c={};a.each(r,(function(o,r){var s=i.getDatasetMeta(r),l=[s.type,void 0===n.stacked&&void 0===s.stack?r:"",s.stack].join(".");i.isDatasetVisible(r)&&t(s)&&(void 0===c[l]&&(c[l]=[]),a.each(o.data,(function(t,a){var o=c[l],i=+e.getRightValue(t);isNaN(i)||s.data[a].hidden||(o[a]=o[a]||0,n.relativePoints?o[a]=100:o[a]+=i)})))})),a.each(c,(function(t){var n=a.min(t),o=a.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?o:Math.max(e.max,o)}))}else a.each(r,(function(n,o){var r=i.getDatasetMeta(o);i.isDatasetVisible(o)&&t(r)&&a.each(n.data,(function(t,n){var a=+e.getRightValue(t);isNaN(a)||r.data[n].hidden||((null===e.min||ae.max)&&(e.max=a),0!==a&&(null===e.minNotZero||ao?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function l(t){return 0===t||180===t?"center":t<180?"left":"right"}function u(t,e,n,a){if(o.isArray(e))for(var i=n.y,r=1.5*a,s=0;s270||t<90)&&(n.y-=e.h)}function d(t){var a=t.ctx,i=o.valueOrDefault,r=t.options,s=r.angleLines,d=r.pointLabels;a.lineWidth=s.lineWidth,a.strokeStyle=s.color;var h=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),f=n(t);a.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(s.display){var v=t.getPointPosition(g,h);a.beginPath(),a.moveTo(t.xCenter,t.yCenter),a.lineTo(v.x,v.y),a.stroke(),a.closePath()}if(d.display){var m=t.getPointPosition(g,h+5),b=i(d.fontColor,p.defaultFontColor);a.font=f.font,a.fillStyle=b;var x=t.getIndexAngle(g),y=o.toDegrees(x);a.textAlign=l(y),c(y,t._pointLabelSizes[g],m),u(a,t.pointLabels[g]||"",m,f.size)}}}function h(t,n,a,i){var r=t.ctx;if(r.strokeStyle=o.valueAtIndexOrDefault(n.color,i-1),r.lineWidth=o.valueAtIndexOrDefault(n.lineWidth,i-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,a,0,2*Math.PI),r.closePath(),r.stroke();else{var s=e(t);if(0===s)return;r.beginPath();var l=t.getPointPosition(0,a);r.moveTo(l.x,l.y);for(var u=1;ud.r&&(d.r=v.end,h.r=p),m.startd.b&&(d.b=m.end,h.b=p)}t.setReductions(c,d,h)}(this):function(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}(this)},setReductions:function(t,e,n){var a=this,o=e.l/Math.sin(n.l),i=Math.max(e.r-a.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),s=-Math.max(e.b-a.height,0)/Math.cos(n.b);o=f(o),i=f(i),r=f(r),s=f(s),a.drawingArea=Math.min(Math.round(t-(o+i)/2),Math.round(t-(r+s)/2)),a.setCenterPoint(o,i,r,s)},setCenterPoint:function(t,e,n,a){var o=this,i=o.width-e-o.drawingArea,r=t+o.drawingArea,s=n+o.drawingArea,l=o.height-a-o.drawingArea;o.xCenter=Math.round((r+i)/2+o.left),o.yCenter=Math.round((s+l)/2+o.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,a=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(a)*e)+n.xCenter,y:Math.round(Math.sin(a)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,a=e.ticks,i=o.valueOrDefault;if(e.display){var r=t.ctx,s=this.getIndexAngle(0),l=i(a.fontSize,p.defaultFontSize),u=i(a.fontStyle,p.defaultFontStyle),c=i(a.fontFamily,p.defaultFontFamily),f=o.fontString(l,u,c);o.each(t.ticks,(function(e,o){if(o>0||a.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[o]);if(n.display&&0!==o&&h(t,n,u,o),a.display){var c=i(a.fontColor,p.defaultFontColor);if(r.font=f,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(s),a.showLabelBackdrop){var d=r.measureText(e).width;r.fillStyle=a.backdropColor,r.fillRect(-d/2-a.backdropPaddingX,-u-l/2-a.backdropPaddingY,d+2*a.backdropPaddingX,l+2*a.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=c,r.fillText(e,0,-u),r.restore()}}})),(e.angleLines.display||e.pointLabels.display)&&d(t)}}});t.scaleService.registerScaleType("radialLinear",v,g)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function a(t,e){return t-e}function o(t){var e,n,a,o={},i=[];for(e=0,n=t.length;e=0&&r<=s;){if(o=t[(a=r+s>>1)-1]||null,i=t[a],!o)return{lo:null,hi:i};if(i[e]n))return{lo:o,hi:i};s=a-1}}return{lo:i,hi:null}}(t,e,n),i=o.lo?o.hi?o.lo:t[t.length-2]:t[0],r=o.lo?o.hi?o.hi:t[t.length-1]:t[1],s=r[e]-i[e],l=s?(n-i[e])/s:0,u=(r[a]-i[a])*l;return i[a]+u}function r(t,e){var n=e.parser,a=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof a?h(t,a):(t instanceof h||(t=h(t)),t.isValid()?t:"function"==typeof a?a(t):t)}function s(t,e){if(p.isNullOrUndef(t))return null;var n=e.options.time,a=r(e.getRightValue(t),n);return a.isValid()?(n.round&&a.startOf(n.round),a.valueOf()):null}function l(t,e,n,a){var o,i,r,s=b.length;for(o=b.indexOf(t);o1?e[1]:a,s=e[0],l=(i(t,"time",r,"pos")-i(t,"time",s,"pos"))/2),o.time.max||(r=e[e.length-1],s=e.length>1?e[e.length-2]:n,u=(i(t,"time",r,"pos")-i(t,"time",s,"pos"))/2)),{left:l,right:u}}function d(t,e){var n,a,o,i,r=[];for(n=0,a=t.length;n=o&&n<=i&&y.push(n);return a.min=o,a.max=i,a._unit=g,a._majorUnit=v,a._minorFormat=f[g],a._majorFormat=f[v],a._table=function(t,e,n,a){if("linear"===a||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var o,i,r,s,l,u=[],c=[e];for(o=0,i=t.length;oe&&s=0&&t{function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}n(8636),n(5086),n(8329),n(8772),n(4913),n(9693),n(115),n(7136),n(173),n(9073),n(6048),n(9581),n(3534),n(590),n(4216),n(8665),n(9979),n(4602),function(t){"use strict";var e=function(e,n){t.fn.typeahead.defaults;n.scrollBar&&(n.items=100,n.menu='');var a=this;if(a.$element=t(e),a.options=t.extend({},t.fn.typeahead.defaults,n),a.$menu=t(a.options.menu).insertAfter(a.$element),a.eventSupported=a.options.eventSupported||a.eventSupported,a.grepper=a.options.grepper||a.grepper,a.highlighter=a.options.highlighter||a.highlighter,a.lookup=a.options.lookup||a.lookup,a.matcher=a.options.matcher||a.matcher,a.render=a.options.render||a.render,a.onSelect=a.options.onSelect||null,a.sorter=a.options.sorter||a.sorter,a.source=a.options.source||a.source,a.displayField=a.options.displayField||a.displayField,a.valueField=a.options.valueField||a.valueField,a.options.ajax){var o=a.options.ajax;"string"==typeof o?a.ajax=t.extend({},t.fn.typeahead.defaults.ajax,{url:o}):("string"==typeof o.displayField&&(a.displayField=a.options.displayField=o.displayField),"string"==typeof o.valueField&&(a.valueField=a.options.valueField=o.valueField),a.ajax=t.extend({},t.fn.typeahead.defaults.ajax,o)),a.ajax.url||(a.ajax=null),a.query=""}else a.source=a.options.source,a.ajax=null;a.shown=!1,a.listen()};e.prototype={constructor:e,eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},select:function(){var t=this.$menu.find(".active").attr("data-value"),e=this.$menu.find(".active a").text();return this.options.onSelect&&this.options.onSelect({value:t,text:e}),this.$element.val(this.updater(e)).change(),this.hide()},updater:function(t){return t},show:function(){var e=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});if(this.$menu.css({top:e.top+e.height,left:e.left}),this.options.alignWidth){var n=t(this.$element[0]).outerWidth();this.$menu.css({width:n})}return this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},ajaxLookup:function(){var e=t.trim(this.$element.val());if(e===this.query)return this;if(this.query=e,this.ajax.timerId&&(clearTimeout(this.ajax.timerId),this.ajax.timerId=null),!e||e.length"+e+""}))},render:function(e){var n,o=this,i="string"==typeof o.options.displayField;return(e=t(e).map((function(e,r){return"object"===a(r)?(n=i?r[o.options.displayField]:o.options.displayField(r),e=t(o.options.item).attr("data-value",r[o.options.valueField])):(n=r,e=t(o.options.item).attr("data-value",r)),e.find("a").html(o.highlighter(n)),e[0]}))).first().addClass("active"),this.$menu.html(e),this},grepper:function(e){var n,a,o=this,i="string"==typeof o.options.displayField;if(!(i&&e&&e.length))return null;if(e[0].hasOwnProperty(o.options.displayField))n=t.grep(e,(function(t){return a=i?t[o.options.displayField]:o.options.displayField(t),o.matcher(a)}));else{if("string"!=typeof e[0])return null;n=t.grep(e,(function(t){return o.matcher(t)}))}return this.sorter(n)},next:function(e){var n=this.$menu.find(".active").removeClass("active").next();if(n.length||(n=t(this.$menu.find("li")[0])),this.options.scrollBar){var a=this.$menu.children("li").index(n);a%8==0&&this.$menu.scrollTop(26*a)}n.addClass("active")},prev:function(t){var e=this.$menu.find(".active").removeClass("active").prev();if(e.length||(e=this.$menu.find("li").last()),this.options.scrollBar){var n=this.$menu.children("li"),a=n.length-1,o=n.index(e);(a-o)%8==0&&this.$menu.scrollTop(26*(o-7))}e.addClass("active")},listen:function(){this.$element.on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("keypress",t.proxy(this.keypress,this)).on("keyup",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",t.proxy(this.keydown,this)),this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter","li",t.proxy(this.mouseenter,this)).on("mouseleave","li",t.proxy(this.mouseleave,this))},move:function(t){if(this.shown){switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:t.preventDefault(),this.prev();break;case 40:t.preventDefault(),this.next()}t.stopPropagation()}},keydown:function(e){this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.move(e)},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},keyup:function(t){switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.ajax?this.ajaxLookup():this.lookup()}t.stopPropagation(),t.preventDefault()},focus:function(t){this.focused=!0},blur:function(t){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(t){t.stopPropagation(),t.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},destroy:function(){this.$element.off("focus",t.proxy(this.focus,this)).off("blur",t.proxy(this.blur,this)).off("keypress",t.proxy(this.keypress,this)).off("keyup",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.off("keydown",t.proxy(this.keydown,this)),this.$menu.off("click",t.proxy(this.click,this)).off("mouseenter","li",t.proxy(this.mouseenter,this)).off("mouseleave","li",t.proxy(this.mouseleave,this)),this.$element.removeData("typeahead")}},t.fn.typeahead=function(n){return this.each((function(){var o=t(this),i=o.data("typeahead"),r="object"===a(n)&&n;i||o.data("typeahead",i=new e(this,r)),"string"==typeof n&&i[n]()}))},t.fn.typeahead.defaults={source:[],items:10,scrollBar:!1,alignWidth:!0,menu:'',item:'
  • ',valueField:"id",displayField:"name",onSelect:function(){},ajax:{url:null,timeout:300,method:"get",triggerLength:1,loadingClass:null,preDispatch:null,preProcess:null}},t.fn.typeahead.Constructor=e,t((function(){t("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',(function(e){var n=t(this);n.data("typeahead")||(e.preventDefault(),n.typeahead(n.data()))}))}))}(window.jQuery)},2811:function(t,e,n){var a,o;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}n(4913),n(475),n(115),n(9693),n(8636),n(5086),n(7136),n(173),n(2231),n(6255),n(9389),n(6048),n(9581),n(6088),n(9073),n(3534),n(590),n(4216),n(8665),n(9979),n(4602),function(t){"use strict";var e,n,a=Array.prototype.slice;(n=function(e){this.options=t.extend({},n.defaults,e),this.parser=this.options.parser,this.locale=this.options.locale,this.messageStore=this.options.messageStore,this.languages={},this.init()}).prototype={init:function(){var e=this;String.locale=e.locale,String.prototype.toLocaleString=function(){var n,a,o,i,r,s,l;for(o=this.valueOf(),i=e.locale,r=0;i;){a=(n=i.split("-")).length;do{if(s=n.slice(0,a).join("-"),l=e.messageStore.get(s,o))return l;a--}while(a);if("en"===i)break;i=t.i18n.fallbacks[e.locale]&&t.i18n.fallbacks[e.locale][r]||e.options.fallbackLocale,t.i18n.log("Trying fallback locale for "+e.locale+": "+i),r++}return""}},destroy:function(){t.removeData(document,"i18n")},load:function(e,n){var a,o,i,r={};if(e||n||(e="i18n/"+t.i18n().locale+".json",n=t.i18n().locale),"string"==typeof e&&"json"!==e.split(".").pop()){for(o in r[n]=e+"/"+n+".json",a=(t.i18n.fallbacks[n]||[]).concat(this.options.fallbackLocale))r[i=a[o]]=e+"/"+i+".json";return this.load(r)}return this.messageStore.load(e,n)},parse:function(e,n){var a=e.toLocaleString();return this.parser.language=t.i18n.languages[t.i18n().locale]||t.i18n.languages.default,""===a&&(a=e),this.parser.parse(a,n)}},t.i18n=function(e,o){var r,s=t.data(document,"i18n"),l="object"===i(e)&&e;return l&&l.locale&&s&&s.locale!==l.locale&&(String.locale=s.locale=l.locale),s||(s=new n(l),t.data(document,"i18n",s)),"string"==typeof e?(r=void 0!==o?a.call(arguments,1):[],s.parse(e,r)):s},t.fn.i18n=function(){var e=t.data(document,"i18n");return e||(e=new n,t.data(document,"i18n",e)),String.locale=e.locale,this.each((function(){var n,a,o,i,r=t(this),s=r.data("i18n");s?(n=s.indexOf("["),a=s.indexOf("]"),-1!==n&&-1!==a&&n1?["CONCAT"].concat(t):t[0]}function P(){var t=w([h,n,I]);return null===t?null:[t[0],t[2]]}function A(){var t=w([h,n,v]);return null===t?null:[t[0],t[2]]}function T(){var t=w([f,d,p]);return null===t?null:t[1]}if(e=S("|"),n=S(":"),a=S("\\"),o=M(/^./),i=S("$"),r=M(/^\d+/),s=M(/^[^{}\[\]$\\]/),l=M(/^[^{}\[\]$\\|]/),k([_,M(/^[^{}\[\]$\s]/)]),u=k([_,l]),c=k([_,s]),b=M(/^[ !"$&'()*,.\/0-9;=?@A-Z\^_`a-z~\x80-\xFF+\-]+/),x=function(t){return t.toString()},h=function(){var t=b();return null===t?null:x(t)},d=k([function(){var t=w([k([P,A]),C(0,D)]);return null===t?null:t[0].concat(t[1])},function(){var t=w([h,C(0,D)]);return null===t?null:[t[0]].concat(t[1])}]),f=S("{{"),p=S("}}"),g=k([T,I,function(){var t=C(1,c)();return null===t?null:t.join("")}]),v=k([T,I,function(){var t=C(1,u)();return null===t?null:t.join("")}]),null===(m=function(){var t=C(0,g)();return null===t?null:["CONCAT"].concat(t)}())||y!==t.length)throw new Error("Parse error at position "+y.toString()+" in input: "+t);return m}},t.extend(t.i18n.parser,new e)}(jQuery),function(t){"use strict";var e=function(){this.language=t.i18n.languages[String.locale]||t.i18n.languages.default};e.prototype={constructor:e,emit:function(e,n){var a,o,r,s=this;switch(i(e)){case"string":case"number":a=e;break;case"object":if(o=t.map(e.slice(1),(function(t){return s.emit(t,n)})),r=e[0].toLowerCase(),"function"!=typeof s[r])throw new Error('unknown operation "'+r+'"');a=s[r](o,n);break;case"undefined":a="";break;default:throw new Error("unexpected type in AST: "+i(e))}return a},concat:function(e){var n="";return t.each(e,(function(t,e){n+=e})),n},replace:function(t,e){var n=parseInt(t[0],10);return n=parseInt(t[0],10)&&e[0]{},1536:()=>{},2559:()=>{},2553:()=>{},5264:()=>{},6387:()=>{},5985:()=>{},63:()=>{},3888:()=>{},7278:()=>{},3704:()=>{}},t=>{var e=e=>t(t.s=e);t.O(0,[95],(()=>(e(2811),e(7852),e(6108),e(9143),e(5779),e(6618),e(3441),e(1680),e(9654),e(5611),e(3600),e(514),e(9307),e(6730),e(1595),e(1223),e(9662),e(63),e(1536),e(2559),e(2553),e(5264),e(6387),e(5985),e(3888),e(3704),e(7278))));t.O()}]); \ No newline at end of file diff --git a/public/build/app.892f5cd7.js.LICENSE.txt b/public/build/app.a6586164.js.LICENSE.txt similarity index 100% rename from public/build/app.892f5cd7.js.LICENSE.txt rename to public/build/app.a6586164.js.LICENSE.txt diff --git a/public/build/entrypoints.json b/public/build/entrypoints.json index 6b56a324e..b40dd6fa9 100644 --- a/public/build/entrypoints.json +++ b/public/build/entrypoints.json @@ -4,7 +4,7 @@ "js": [ "/build/runtime.c217f8c4.js", "/build/95.7a87ed1a.js", - "/build/app.892f5cd7.js" + "/build/app.a6586164.js" ], "css": [ "/build/app.9e0648f3.css" diff --git a/public/build/manifest.json b/public/build/manifest.json index 12a1afbf6..8917dab94 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -1,6 +1,6 @@ { "build/app.css": "/build/app.9e0648f3.css", - "build/app.js": "/build/app.892f5cd7.js", + "build/app.js": "/build/app.a6586164.js", "build/runtime.js": "/build/runtime.c217f8c4.js", "build/95.7a87ed1a.js": "/build/95.7a87ed1a.js", "build/images/VPS-badge.svg": "/build/images/VPS-badge.svg", diff --git a/src/Repository/EditCounterRepository.php b/src/Repository/EditCounterRepository.php index 14ac7feec..997bc15fd 100644 --- a/src/Repository/EditCounterRepository.php +++ b/src/Repository/EditCounterRepository.php @@ -584,21 +584,25 @@ public function getEditSizeData(Project $project, User $user): array $whereClause = 'ipc_hex BETWEEN :startIp AND :endIp'; } - $sql = "SELECT JSON_ARRAYAGG(CAST(revs.rev_len AS SIGNED) - IFNULL(parentrevs.rev_len, 0)) AS sizes, - JSON_ARRAYAGG( - SELECT JSON_ARRAYAGG(ctd_name) - FROM $ctTable - JOIN $ctdTable - ON ct_tag_id = ctd_id - WHERE ct_rev_id = revs.rev_id - ) AS tag_lists - FROM $revisionTable AS revs - JOIN $pageTable ON revs.rev_page = page_id - $ipcJoin - LEFT JOIN $revisionTable AS parentrevs ON (revs.rev_parent_id = parentrevs.rev_id) - WHERE $whereClause - ORDER BY revs.rev_timestamp DESC - LIMIT 5000"; + $sql = "SELECT JSON_ARRAYAGG(data.size) as sizes, + JSON_ARRAYAGG(data.tags) as tag_lists + FROM ( + SELECT CAST(revs.rev_len AS SIGNED) - IFNULL(parentrevs.rev_len, 0) AS size, + ( + SELECT JSON_ARRAYAGG(ctd_name) + FROM $ctTable + JOIN $ctdTable + ON ct_tag_id = ctd_id + WHERE ct_rev_id = revs.rev_id + ) as tags + FROM $revisionTable AS revs + JOIN $pageTable ON revs.rev_page = page_id + $ipcJoin + LEFT JOIN $revisionTable AS parentrevs ON (revs.rev_parent_id = parentrevs.rev_id) + WHERE $whereClause + ORDER BY revs.rev_timestamp DESC + LIMIT 5000 + ) data"; $results = $this->executeProjectsQuery($project, $sql, $params)->fetchAssociative(); $results['sizes'] = json_decode($results['sizes']); $results['average_size'] = count($results['sizes']) > 0 ? array_sum($results['sizes'])/count($results['sizes']) : 0; diff --git a/templates/editCounter/general_stats.html.twig b/templates/editCounter/general_stats.html.twig index 4c1da7ef8..cf83f6621 100644 --- a/templates/editCounter/general_stats.html.twig +++ b/templates/editCounter/general_stats.html.twig @@ -531,7 +531,7 @@